@reltio/remotes 1.4.1621 → 1.4.1622

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 (88) hide show
  1. package/1039.js +1 -1
  2. package/1146.js +1 -1
  3. package/1148.js +1 -1
  4. package/1334.js +1 -1
  5. package/1425.js +1 -1
  6. package/1572.js +1 -1
  7. package/1664.js +1 -1
  8. package/1707.js +1 -1
  9. package/1790.js +1 -1
  10. package/1840.js +1 -1
  11. package/1925.js +1 -1
  12. package/2049.js +1 -1
  13. package/2066.js +1 -1
  14. package/2201.js +1 -1
  15. package/2400.js +1 -1
  16. package/2404.js +1 -1
  17. package/2463.js +1 -1
  18. package/2641.js +1 -1
  19. package/3096.js +1 -1
  20. package/3348.js +1 -1
  21. package/3358.js +1 -1
  22. package/3358.js.map +1 -1
  23. package/3373.js +1 -1
  24. package/3381.js +1 -1
  25. package/3383.js +1 -1
  26. package/3463.js +1 -1
  27. package/3469.js +1 -1
  28. package/3538.js +1 -1
  29. package/356.js +1 -1
  30. package/3727.js +1 -1
  31. package/3875.js +1 -1
  32. package/3902.js +1 -1
  33. package/3926.js +1 -1
  34. package/415.js +1 -1
  35. package/4212.js +1 -1
  36. package/4390.js +1 -1
  37. package/4481.js +1 -1
  38. package/4703.js +1 -1
  39. package/4780.js +1 -1
  40. package/4806.js +1 -1
  41. package/4838.js +1 -1
  42. package/50.js +1 -1
  43. package/5034.js +1 -1
  44. package/5039.js +1 -1
  45. package/5053.js +1 -1
  46. package/5108.js +1 -1
  47. package/5163.js +1 -1
  48. package/5617.js +1 -1
  49. package/6020.js +1 -1
  50. package/6173.js +1 -1
  51. package/6228.js +1 -1
  52. package/6280.js +1 -1
  53. package/6287.js +1 -1
  54. package/6531.js +1 -1
  55. package/6606.js +1 -1
  56. package/673.js +1 -1
  57. package/6799.js +1 -1
  58. package/6844.js +1 -1
  59. package/6853.js +1 -1
  60. package/6860.js +1 -1
  61. package/6903.js +1 -1
  62. package/7340.js +1 -1
  63. package/735.js +1 -1
  64. package/7422.js +1 -1
  65. package/7626.js +1 -1
  66. package/764.js +1 -1
  67. package/7896.js +1 -1
  68. package/8168.js +1 -1
  69. package/820.js +1 -1
  70. package/8207.js +1 -1
  71. package/8322.js +1 -1
  72. package/8565.js +1 -1
  73. package/8741.js +1 -1
  74. package/9016.js +1 -1
  75. package/9028.js +1 -1
  76. package/9283.js +1 -1
  77. package/9309.js +1 -1
  78. package/9328.js +1 -1
  79. package/9387.js +1 -1
  80. package/9719.js +1 -1
  81. package/9736.js +1 -1
  82. package/9861.js +1 -1
  83. package/987.js +1 -1
  84. package/99.js +1 -1
  85. package/9960.js +1 -1
  86. package/main.js +1 -1
  87. package/package.json +1 -1
  88. package/remoteEntry.js +1 -1
package/6606.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c6413f45-2f4b-4599-8761-814813c29bd3",e._sentryDebugIdIdentifier="sentry-dbid-c6413f45-2f4b-4599-8761-814813c29bd3")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"1.4.1622"},(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6606],{44938:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(24328),o=n.n(r),i=n(50166),a=n(44443),l=n(17512);const s=(0,n(72342).makeStyles)({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){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 u=(0,r.memo)((e=>{let{width:t=0,height:n=0,defaultItemSize:d,data:u,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 R=(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:u.length,itemData:u,itemSize:e=>y[(e=>E(u,e))(e)]||d,itemKey:h},R)}))},33945:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(2507),s=n.n(l),c=n(79573),d=n(50914),u=n(76799);const p=(0,n(72342).makeStyles)({pagination:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"56px",flexShrink:0,borderTop:"1px solid rgba(0,0,0,0.12)",boxShadow:"none",boxSizing:"border-box",overflowY:"hidden",containerType:"inline-size","& .MuiInputBase-root":{display:"none","@container (min-width: 420px)":{display:"inline-flex"}}},caption:{color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px",display:"none","@container (min-width: 420px)":{display:"block"}},displayedRows:{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!important"}});function h(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){m(e,t,n[t])}))}return e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const g=e=>{let{classes:t={},count:n,rowsPerPageOptions:i,page:l,onChangePage:m,rowsPerPage:g,onChangeRowsPerPage:f,basicTableRef:b,labelRowsPerPage:y}=e;const v=p(),x=(0,r.useCallback)((()=>{(0,d.pathOr)(d.identity,["current","resetScrollbarPosition"],b)()}),[b]),E=(0,r.useCallback)((e=>{m(e),x()}),[m,x]),w=(0,r.useCallback)((e=>{m(0),f(e),x()}),[m,f,x]);return o().createElement(u.Z,{classes:h({},t,{root:a()(v.pagination,t.root),select:a()(v.select,t.select),selectLabel:a()(v.caption,t.selectLabel),displayedRows:a()(v.displayedRows,t.displayedRows),input:a()(v.selectRoot,t.selectRoot),actions:v.actions}),backIconButtonProps:{size:"large"},nextIconButtonProps:{size:"large"},component:"div",labelRowsPerPage:y||s().text("Rows per page:"),labelDisplayedRows:e=>{let{from:t,to:n,count:r}=e;return s().text("${fromRow}-${toRow} of ${countRows}",{fromRow:s().number(t,"0,0"),toRow:s().number(n,"0,0"),countRows:s().number(r,"0,0")})},count:n,rowsPerPageOptions:i,page:l,onPageChange:(0,d.pipe)((0,d.nthArg)(1),E),rowsPerPage:g,onRowsPerPageChange:(0,d.pipe)(c.NA,w)})};g.displayName="BasicTablePagination";const f=(0,r.memo)(g)},1469:(e,t,n)=>{n.d(t,{n:()=>y});const r=(0,n(72342).makeStyles)({item:{marginBottom:"16px"},dense:{marginBottom:0}});var o=n(55962),i=n(24328),a=n.n(i),l=n(52730),s=n(50673),c=n(17512),d=n(76141),u=n(71153),p=n.n(u),h=n(50914),m=n(85596),g=n(93555),f=n(72283);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:u=[],outRelationTypes:y=[],showEmptyEditors:v,entityErrorMessage:x,onChangeAttribute:E,onRemoveAttribute:w,onAddAttributes:C,onChangeRelationType:R,onChangeEntity:S}=e;const T=r(),{relation:P,entity:O}=t,{attributes:k,uri:L,type:N="",direction:_}=P||{},I=Boolean(N),j=(0,l.useSelector)(s.ZP.selectors.getMetadata),A=(0,i.useMemo)((()=>P&&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:k},(0,c.p2l)(P))),[P,k]),U=(0,i.useMemo)((()=>(0,c.xF8)(j,N)),[N,j]),z=(0,i.useMemo)((()=>I?(0,c.jWj)(_===c.Nsj.OUT,j,[(0,c.V3K)(j,N)]):(0,h.uniq)((0,c.jWj)(!0,j,y).concat((0,c.jWj)(!1,j,u)))),[I,N,j,u,y]),D=(0,l.useSelector)((e=>s.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),Z=(0,i.useMemo)((()=>P&&{relationType:P.type,direction:P.direction}),[P]),M=(0,i.useMemo)((()=>O&&{entityUri:O.uri,entityType:O.type,entityLabel:(0,c.idV)(O.label)}),[O]),F=(0,i.useMemo)((()=>O&&O.uri?u.filter((0,c.eHk)(!1,O,n,j)):u),[O,u,n,j]),B=(0,i.useMemo)((()=>O&&O.uri?y.filter((0,c.eHk)(!0,O,n,j)):y),[O,y,n,j]);(0,i.useEffect)((()=>{const{type:e,direction:t}=(0,c.z7d)(u,y)||{};!N&&e&&R&&R({type:e.uri,direction:t})}),[N,u,y,R]),(0,o.D)((()=>{const{type:e,direction:t}=(0,c.z7d)(F,B)||{};!N&&e&&R({type:e.uri,direction:t})}),[N,O,F,B,S]);const G=(0,i.useCallback)((e=>{let{type:t,direction:n}=e;R({type:t.uri,direction:n})}),[R]);return a().createElement(a().Fragment,null,R&&a().createElement(m.Z,{className:T.item,relation:Z,metadata:j,inRelationTypes:u,outRelationTypes:y,onChange:G}),S&&a().createElement(g.Z,{errorMessage:x,className:T.item},a().createElement(f.Z,{key:N,className:p()({[T.dense]:x}),entity:M||{},entityTypesUris:z,max:20,globalSearchRequestOptions:D,mode:c.fO_.EDITING,onChange:S,onCreate:void 0,metadata:j,attributeTypesSelectionStrategy:void 0})),N&&a().createElement(d.Z,{attrTypes:U,entity:A,showEmptyEditors:v,mode:c.fO_.EDITING,parentUri:L,onAddAttributes:C,onChangeAttribute:E,onDeleteAttribute:w}))}},20146:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(24328),o=n.n(r),i=n(52730),a=n(71153),l=n.n(a),s=n(79312),c=n(17512),d=n(50673),u=n(40007);const p=(0,n(72342).makeStyles)({"entityType-overflow":{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",marginRight:"12px",borderRadius:"2px",flexShrink:0},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",marginRight:"16px",flexShrink:0}}),h=e=>{let{entity:t,className:n,size:r="small"}=e;const a=p(),h=(0,i.useSelector)(d.ZP.selectors.getMetadata),m=t.type,g=(0,c.nt9)(h,m),f=(g?(0,c.VD3)(h,g,"typeColor"):null)||c.rSc.palette.primary.main,b=(0,c.jFi)(h,t);return o().createElement(u.Z,{value:b,placement:"top"},o().createElement(s.Z,{style:{backgroundColor:f,color:c.P6Y.Colors.getColor(f)?"#FFFFFF":"#212121"},className:l()(a[`entityType-${r}`],a["entityType-overflow"],n),component:"div"},b))}},92934:(e,t,n)=>{n.d(t,{Q:()=>c});var r=n(24328),o=n.n(r),i=n(2507),a=n.n(i),l=n(17512),s=n(72108);const c=(0,r.memo)((e=>{let{entityTypes:t,selectedEntityTypes:n,single:i,placeholder:c,enableEmptyValueUnderline:d,onChange:u,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:d,onChange:u,classes:p,ListLabelProps:h,disabled:m,label:a().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:a().text("Select entity types")})}));c.displayName="EntityTypesSelector"},72108:(e,t,n)=>{n.d(t,{S:()=>N});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(50914),s=n(17512),c=n(53242),d=n(65643),u=n(23883),p=n(72342);const h=(0,p.makeStyles)({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)"}}),m=(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},g=e=>e.join(", "),f=e=>`calc(${(0,l.isNil)(e)?"100%":`${e}px`} - 35px)`,b=e=>{let{list:t,maxWidth:n}=e;const i=h(),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=m(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 c=g(t),d=l>0,p=d?g(t.slice(0,-l)):c;return o().createElement(u.Z,{title:d?c:""},o().createElement("div",{className:i.listLabelContainer},o().createElement("div",{style:{width:f(n)},className:i.listLabel,ref:a},c),o().createElement("div",{className:i.visibleItemsLabel},p),d&&o().createElement("div",{className:i.hiddenCount},`+${l}`)))};var y=n(40435),v=n(22311),x=n(26638),E=n(33117),w=n(94792),C=n(63485);function R(){return R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(this,arguments)}const S=(0,l.always)(32),T=(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(C.Z,R({getItemSize:S,renderItem:(e,i,a)=>{let{item:l}=i;const s=!!t.find((e=>l.uri===e)),c=a===r;return o().createElement(E.Z,{key:l.uri,onClick:n,checked:s,data:l,label:o().createElement(w.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))}));T.displayName="SelectMetadataTypesList";const P=(0,p.makeStyles)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",cursor:"pointer",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","&.Mui-disabled":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px",cursor:"pointer","&$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 O(){return O=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},O.apply(this,arguments)}function k(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}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 N=(0,r.memo)((e=>{let{placeholder:t,classes:n={},items:i,selectedItemsUris:u,onChange:p,ListLabelProps:h={},disabled:m,enableEmptyValueUnderline:g,single:f,label:E,dataReltioId:w,selectionPopupTitle:C}=e;const R=P(),[S,L]=(0,r.useState)(!1),N=(0,r.useCallback)((()=>L(!0)),[]),_=(0,r.useCallback)((()=>L(!1)),[]),[I,j]=(0,r.useState)(""),A=(0,r.useCallback)((()=>j("")),[]),U=(0,r.useCallback)((0,l.pipe)(A,_),[_,A]),z=i.filter((e=>{let{label:t}=e;return s.P6Y.strings.search(t,I)})).map(((e,t)=>({item:{item:k({},e,{filterText:I})},index:t}))),D=(0,r.useMemo)((()=>u.map((e=>i.find((0,l.propEq)("uri",e)))).map((0,l.prop)("label"))),[u,i]),Z=(0,r.useCallback)(((e,t)=>{f?(p(t?[e.uri]:[]),U()):p(t?u.concat(e.uri):u.filter((t=>t!==e.uri)))}),[u,p,f,U]),M=(0,r.useCallback)((e=>{let{item:t}=e;const n=!u.includes(t.uri);Z(t,n)}),[u,Z]),{focusIndex:F,handleKeyDown:B}=(0,x.t)({items:z,open:S,onSelectFocusedItem:M,selectedItems:u,onClose:U}),G=(0,r.useRef)(),q=G.current?G.current.getBoundingClientRect().width:0,H=Math.max(q,255),V=0===u.length;return o().createElement(o().Fragment,null,o().createElement(c.Z,{label:E,ref:G,InputProps:{startAdornment:V&&!t?null:o().createElement("div",{className:a()(R.inputText,n.inputText)},V?o().createElement("div",null,t):o().createElement(b,O({},h,{list:D}))),classes:{root:R.inputRoot,input:a()(R.input,n.input,{[R.emptyInput]:V&&!t}),disabled:a()(R.disabledInput,{[R.disabledPointer]:m}),underline:R.disabledUnderline},endAdornment:o().createElement(y.Z,{size:"L",icon:d.Z,iconClassName:a()(R.icon,{[R["popup-opened-icon"]]:S}),disabled:m}),readOnly:!0,disableUnderline:V&&!g},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:a()(R.inputLabel,n.label)}},value:"",onClick:m?void 0:N,classes:{root:a()(R.root,n.root)},size:"small",variant:"filled",disabled:m,"data-reltio-id":w}),o().createElement(v.Z,{open:S,anchorEl:G.current,onClose:U,onSearch:j,title:C,containerWidth:H,containerHeight:355,searchInputOnKeyDown:B,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${w}-popup`}},o().createElement(T,{items:z,onItemClick:Z,selectedItems:u,width:H,height:245,focusIndex:F})))}));N.displayName="MetadataTypesSelector"},79386:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(52730),s=n(50914),c=n(79312),d=n(23883),u=n(2507),p=n.n(u),h=n(17512),m=n(50673),g=n(37573),f=n(20146);const b=(0,n(72342).makeStyles)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"0px 1px 0px rgba(0, 0, 0, 0.12)",marginBottom:"1px","&: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"}}}))),y=e=>{let{className:t,entity:n,children:i,classes:u,renderLabel:y=s.identity}=e;const v=b({classes:u}),x=(0,l.useSelector)(m.ZP.selectors.getMetadata),E=(0,l.useSelector)(m.ZP.selectors.getShowEntityId),w=(0,r.useCallback)((()=>{navigator.clipboard.writeText((0,h.BTI)(n))}),[n]);if((0,s.isNil)(n))return null;const C=(0,h.idV)(n.label),R=n.secondaryLabel,S=(0,h.ptG)(x,n),T=(0,h.Fn9)(n),P=n.uri,O=(0,h.BTI)(n);return o().createElement("div",{className:a()(v.profileBandWrapper,t)},o().createElement("div",{className:a()(v.profileBand,{[v.inactive]:!T}),"data-entity-uri":P},o().createElement(g.Z,{key:n.uri,entity:n,avatarClassName:v.profileIcon,imageClassName:v.imageProfileIcon}),o().createElement("div",{className:v.profileInfo},o().createElement("div",null,o().createElement(c.Z,{variant:"h6",className:v.label},y(C)),R&&o().createElement(c.Z,{variant:"subtitle2",className:v.secondaryLabel},R),S&&o().createElement(c.Z,{variant:"subtitle1",className:v.businessCard},S)),o().createElement("div",{className:v.specialInfo},o().createElement("div",{className:v.entityType},o().createElement(f.Z,{entity:n,size:"medium",className:v.badge}),!(0,h.ZiX)(P)&&E&&o().createElement(d.Z,{title:p().text("Copy to clipboard")},o().createElement(c.Z,{display:"inline",variant:"body2",className:v.entityId,onClick:w},p().text("Entity ID"),": ",O))))),i&&o().createElement("div",null,i)))}},60883:(e,t,n)=>{n.d(t,{a:()=>U});var r=n(24328),o=n.n(r),i=n(55485),a=n(23468),l=n(31373),s=n(17512),c=n(71153),d=n.n(c),u=n(50914),p=n(2507),h=n.n(p),m=n(49753),g=n(78223),f=n(39475);const b=(0,n(72342).makeStyles)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),y=(0,g.Z)(i.Z),v=e=>{var t;let{className:n,total:i=0,onPrev:c,onNext:p,onSearchResultsClick:g,isPrevDisabled:v,isNextDisabled:x}=e;const E=b(),w=(0,r.useContext)(m.T),{OPEN_RESULTS:C,SEARCH_RESULT:R,SEARCH_RESULTS:S,NEXT_PROFILE:T,PREVIOUS_PROFILE:P}=(0,u.mergeRight)({OPEN_RESULTS:h().text("Go to search results"),SEARCH_RESULT:h().text("Search result"),SEARCH_RESULTS:h().text("Search results"),PREVIOUS_PROFILE:h().text("Go to previous profile"),NEXT_PROFILE:h().text("Go to next profile")},null!==(t=null==w?void 0:w.profileBand)&&void 0!==t?t:{});return o().createElement("div",{className:d()(E.container,n)},o().createElement(y,{className:E.link,component:"button",variant:"caption",onClick:g,underline:"none",tooltipTitle:C},(0,s.k7L)(i,1e6)," ",1===i?R:S),o().createElement(f.k,{size:"L",icon:a.Z,"data-reltio-id":"reltio-previous-profile-button",tooltipTitle:P,onClick:c,disabled:v,showForDisabled:!0}),o().createElement(f.k,{size:"L",icon:l.Z,"data-reltio-id":"reltio-next-profile-button",tooltipTitle:T,onClick:p,disabled:x,showForDisabled:!0}))};var x=n(52730),E=n(50673),w=n(96697),C=n(63532),R=n(98001),S=n(19701);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){P(e,t,n[t])}))}return e}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class O{constructor(e){var t=this;let{data:{query:n,sortField:r,sortOrder:o},tenant:i,searchTenant:a,apiPath:l,dtssPath:c,globalSearchRequestOptions:d}=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=T({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},n);return t.isDT()?(0,s.uqV)({filters:r,options:o,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,s.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,s.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,s.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=c,this.globalSearchRequestOptions=d}}function k(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}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}class N{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,s.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:k({},t.searchBody,{filter:e.length?(0,s.Uqd)()(r):t.searchBody.filter}),options:n})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,s.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,s.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=n,this.tenant=r,this.apiPath=o}}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){I(e,t,n[t])}))}return e}function I(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)=>(0,u.pipe)((0,u.map)((0,u.prop)("uri")),(0,u.reject)((e=>t.includes(e))))(e),A=()=>{const e=(0,S._)(),t=(0,S._)(),n=(0,S._)(),{uri:o,index:i,total:a,tenant:l,cache:c}=(0,x.useSelector)(E.ZP.selectors.getSearchNavigationData)||{},{type:d,data:u}=(0,x.useSelector)(E.ZP.selectors.getSearchProviderData)||{},p=(0,x.useSelector)(E.ZP.selectors.getTenant),h=(0,x.useSelector)(E.ZP.selectors.getApiPath),m=(0,x.useSelector)(E.ZP.selectors.getDtssPath),g=(0,x.useSelector)((e=>E.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),{updateEntitiesNavigationLoadingState:f}=(0,w.M)(),b=(0,r.useContext)(C.m),y=(0,x.useDispatch)(),[v,T]=(0,r.useState)(!1),P=(0,r.useMemo)((()=>((e,t)=>{switch(e){case"search":return new O(t);case"graphsearch":return new N(t)}})(d,{data:u,tenant:p,searchTenant:l,apiPath:h,dtssPath:m,globalSearchRequestOptions:g})),[d,u,p,l,h,m,g]),k=(0,r.useCallback)((e=>{y(E.yC.actions.updateSearchNavigationDataFields(e))}),[y]),L=(0,r.useCallback)((e=>{const t=p!==l?(0,s.wwR)({uri:e,dataTenant:l}):e;y(E.ui.actions.openEntity({uri:t,viewId:b,source:"navigation"}))}),[y,b,p,l]),I=(0,r.useCallback)((()=>{y(E.ui.actions.openPerspective({perspectiveId:d,viewId:b}))}),[y,d,b]);(0,r.useEffect)((()=>{i>=a?k({index:a-1}):i<0&&k({index:0})}),[a,i,k]);const A=(0,R.u)();(0,r.useEffect)((()=>{const e=A(((e,t)=>{switch(e.type){case E.yC.constants.UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE:{const n=E.ZP.selectors.getSearchNavigationData(t);n&&k(((e,t)=>{const{winnerUri:n,losersUris:r=[]}=t,o=((e,t)=>{let{uri:n,index:r,total:o,cache:i}=e;if(t&&t!==n){if(i&&i.includes(n)){i=[...i];const e=i.indexOf(t);let a=i.indexOf(n);e>=0&&(i.splice(e,1),o--,e<a&&r--),a=i.indexOf(n),i.splice(a,1,t)}return n=t,_({},e,{uri:n,index:r,cache:i,total:o})}return e})(e,n);return((e,t)=>{const{cache:n=[],index:r,total:o,uri:i}=e,a=t.filter((e=>n.includes(e)));if(0===a.length)return e;const l=o-a.length,s=n.indexOf(i);let c=r;for(const e of a)n.indexOf(e)<s&&c--;const d=n.filter((e=>!a.includes(e)));return _({},e,{cache:d,index:c,total:l})})(o,r)})(n,e.payload));break}}}));return()=>e()}),[A,k]);const U=(0,r.useCallback)(((e,r,o)=>{T(!0),t(P.requestTotal()).then((e=>k({total:e})));const i=o+1;return n(P.requestEntities(15,i)).then((t=>{if(t){if(t.length){const n=j(t,e);if(n.length>0)return k({cache:e.concat(n),uri:n[0],index:i+t.length-n.length}),void L(n[0]);if(o+t.length<r-1)return U(e,r-t.length,o+t.length)}k({index:i})}})).finally((()=>{T(!1)}))}),[P,k,L]),z=(0,r.useCallback)(((e,r)=>{T(!0),t(P.requestTotal()).then((e=>k({total:e})));const o=r-1,i=Math.max(0,r-15),a=15+Math.min(0,r-15);return n(P.requestEntities(a,i)).then((t=>{if(t){if(t.length){const n=j(t,e);if(n.length>0)return k({cache:n.concat(e),uri:n[n.length-1],index:o-(t.length-n.length)}),void L(n[n.length-1]);if(r-t.length>0)return z(e,r-t.length)}k({index:0})}})).finally((()=>{T(!1)}))}),[P,k,L]),D=(0,r.useCallback)(((t,n,r,o)=>{if(n<t.length){const i=t[n];return T(!0),e(P.checkEntity(i)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),D(e,n,r-1,o)}k({index:o+1,uri:i,cache:t,total:r}),L(i)})).finally((()=>{T(!1)}))}if(!(o>=r-1))return U(t,r,o);k({cache:t,total:r,index:r-1})}),[P,k,L,U]),Z=(0,r.useCallback)(((t,n,r,o)=>{if(n>-1){const i=t[n];return T(!0),e(P.checkEntity(i)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),Z(e,n-1,r-1,o-1)}k({index:o-1,uri:i,cache:t,total:r}),L(i)})).finally((()=>{T(!1)}))}if(!(o<=0))return z(t,o);k({index:0,cache:t,total:r})}),[P,k,L,z]),M=(0,r.useCallback)((()=>{if(c&&o){const e=c.indexOf(o)-1;Z(c,e,a,i)}}),[Z,c,o,a,i]),F=(0,r.useCallback)((()=>{if(c&&o){const e=c.indexOf(o)+1;D(c,e,a,i)}}),[D,c,o,a,i]);return(0,r.useEffect)((()=>{f(v)}),[f,v]),(0,r.useEffect)((()=>()=>f(!1)),[]),{total:a,onPrev:M,onNext:F,onSearchResultsClick:I,isPrevDisabled:v||i<=0,isNextDisabled:v||i>=a-1}},U=e=>{let{className:t}=e;const{total:n,onPrev:r,onNext:i,onSearchResultsClick:a,isPrevDisabled:l,isNextDisabled:c}=A();return(()=>{const{cache:e}=(0,x.useSelector)(E.ZP.selectors.getSearchNavigationData)||{},t=(0,x.useSelector)(E.ZP.selectors.getMode),n=(0,x.useSelector)(E.ZP.selectors.getEntity);return(0,s.uzs)(t)&&(null==e?void 0:e.includes(null==n?void 0:n.uri))})()?o().createElement(v,{className:t,total:n,onPrev:r,onNext:i,onSearchResultsClick:a,isPrevDisabled:l,isNextDisabled:c}):null}},68977:(e,t,n)=>{n.d(t,{U:()=>c});var r=n(24328),o=n.n(r),i=n(2507),a=n.n(i),l=n(17512),s=n(72108);const c=(0,r.memo)((e=>{let{relationTypes:t,selectedRelationTypes:n,single:i,placeholder:c,enableEmptyValueUnderline:d,onChange:u,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:d,onChange:u,classes:p,ListLabelProps:h,disabled:m,label:a().text("Relation type"),dataReltioId:"relation-type-selector",selectionPopupTitle:a().text("Select relation types")})}));c.displayName="RelationTypesSelector"},11802:(e,t,n)=>{n.d(t,{u:()=>h});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(31396),s=n(47746),c=n(17512);const d=(0,n(72342).makeStyles)((()=>({container:{position:"relative","& .Resizer":{zIndex:1,boxSizing:"border-box",backgroundClip:"padding-box","&.disabled":{cursor:"initial",height:0,margin:0},"&.horizontal":{height:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"100% 1px",backgroundPosition:"top",width:"100%",marginBottom:"-10px","&:not(.disabled):hover":{cursor:"row-resize",backgroundImage:"linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))",backgroundSize:"100% 3px"}},"&.vertical":{width:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"1px 100%",backgroundPosition:"left",height:"100%",marginRight:"-10px","&:not(.disabled):hover":{cursor:"col-resize",backgroundImage:"linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))",backgroundSize:"3px 100%"}}}}}))),u=250,p=e=>"horizontal"===e,h=e=>{let{className:t,children:n,orientation:i,primary:h,defaultSize:m,size:g,minSize:f,maxSize:b,allowResize:y,debounceInterval:v=u,onChange:x}=e;const E=d(),w=(0,s.Z)(),[C,R]=(0,r.useState)(null),[S,T]=(0,r.useState)(!0),P=(0,r.useCallback)((()=>T(!0)),[]),O=(0,r.useCallback)((()=>T(!1)),[]),k=()=>p(i)?null==C?void 0:C.clientHeight:null==C?void 0:C.clientWidth,L=(0,r.useCallback)((0,c.DsO)((e=>{const t=k();x({percentageSize:e/t*100+"%",isMaxSize:+b>0?e===b:e===t+b,isMinSize:e===f,size:e})}),v),[x,i,b,C]),N=(0,r.useMemo)((()=>({transition:w.transitions.create(p(i)?"height":"width",{easing:w.transitions.easing.sharp,duration:w.transitions.duration.leavingScreen})})),[i,w]);return"number"==typeof g&&g<0&&(g=(k()||0)+g),o().createElement("div",{ref:R,className:a()(E.container,t)},o().createElement(l.Z,{split:i,size:g,primary:h,allowResize:y,onChange:L,defaultSize:m,minSize:f,maxSize:b,onDragStarted:O,onDragFinished:P,pane1Style:S?N:void 0},n))};h.displayName="ResizablePanes"},67275:(e,t,n)=>{n.d(t,{n:()=>f});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(17512),s=n(79386),c=n(60883),d=n(72316),u=n(1824),p=n(62901),h=n(36852),m=n(75647);const g=(0,n(72342).makeStyles)({profileBandNavigation:{marginBottom:"10px"},comments:{display:"flex",justifyContent:"flex-end"}}),f=(0,r.memo)((e=>{let{entity:t,className:n,historySlice:i}=e;const f=g(),b=(0,r.useMemo)((()=>(0,l.L5S)(t)),[t]),y=(0,h.C)({objectIds:b}),v=(0,l.wwR)(t);return o().createElement(u.e,{collaboration:y},o().createElement(s.Z,{className:a()(n,p.U),entity:(null==i?void 0:i.aEntity)||t},i?o().createElement(m.Z,null):o().createElement(o().Fragment,null,o().createElement(c.a,{className:f.profileBandNavigation}),o().createElement(d.Z,{className:f.comments,uri:v,relatedObjectUris:(0,l.wp9)(l.q7e.ENTITY,{entityUri:v}),objectType:l.q7e.ENTITY}))))}));f.displayName="ScreenProfileBand"},75647:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(24328),o=n.n(r),i=n(52730),a=n(50673),l=n(38677),s=n(79312),c=n(50914),d=n(2507),u=n.n(d);const p=(0,n(72342).makeStyles)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),h=()=>{const e=p(),t=(0,i.useSelector)(a.ZP.selectors.getHistoryEvent),n=(0,i.useDispatch)(),r=(0,c.pipe)(a.N5.history.actions.clearHistoryEvent,n);return t?o().createElement("div",{className:e.root},o().createElement(s.Z,{component:"div"},u().text("You are viewing a historic slice:")," ",o().createElement("span",{className:e.slice},u().date(t.aStamp,"llll"))),o().createElement(l.Z,{className:e.cancelButton,variant:"contained",color:"primary",onClick:r},u().text("Cancel"))):null}},98001:(e,t,n)=>{n.d(t,{G:()=>a,u:()=>l});var r=n(24328),o=n.n(r);const i=(0,r.createContext)(null);i.displayName="ActionsHookContext";const a=e=>{let{children:t,hook:n}=e;return o().createElement(i.Provider,{value:n},t)},l=()=>{const e=(0,r.useContext)(i);if(!e)throw new Error("ActionsHookContext must be provided");return e}},96697:(e,t,n)=>{n.d(t,{f:()=>d,M:()=>u});var r=n(24328),o=n.n(r),i=n(79573);function a(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}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 s=o().createContext({isLoading:!1,updateEntityLoadingState:i.ZT,updateEntitiesNavigationLoadingState:i.ZT,resetLoadingState:i.ZT}),c={entitiesNavigation:!1,entity:!1},d=e=>{let{children:t}=e;const n=(()=>{const[e,t]=(0,r.useState)(c),n=(0,r.useCallback)((e=>{t((t=>a({},t,{entity:e})))}),[]),o=(0,r.useCallback)((e=>{t((t=>a({},t,{entitiesNavigation:e})))}),[]),i=(0,r.useCallback)((()=>{t(c)}),[]);return{isLoading:Object.values(e).includes(!0),updateEntityLoadingState:n,updateEntitiesNavigationLoadingState:o,resetLoadingState:i}})();return o().createElement(s.Provider,{value:n},t)},u=()=>(0,r.useContext)(s)},49753:(e,t,n)=>{n.d(t,{T:()=>o});var r=n(24328);const o=n.n(r)().createContext({profileBand:{}});o.displayName="LabelsContext"},36852:(e,t,n)=>{n.d(t,{C:()=>m});var r=n(24328),o=n(52730),i=n(50914),a=n(17512),l=n(50673);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 d=(e,t)=>t.filter((t=>t.replyId!==e)),u=(e,t)=>{const n=e.replies.findIndex((e=>{let{replyId:n}=e;return n===t.replyId})),r=[...e.replies];return r[n]=t,r},p=[],h=e=>console.error("Collaboration error",e),m=e=>{let{objectIds:t=p,objectTypes:n,enabled:c=!0}=e;const m=(0,o.useSelector)(l.ZP.selectors.getEntity),g=(0,o.useSelector)(l.ZP.selectors.getTenant),f=(0,o.useSelector)(l.ZP.selectors.getCollaborationPath),b=(0,o.useSelector)(l.ZP.selectors.isCollaborationEnabled)&&c,[y,v]=(0,r.useState)(null),[x,E]=(0,r.useState)([]),[w,C]=(0,r.useState)(null),[R,S]=(0,r.useState)(null),[T,P]=(0,r.useState)(!1),[O,k]=(0,r.useState)(!1),[L,N]=(0,r.useState)({}),_=(0,r.useCallback)((e=>{C((t=>s({},t,e)))}),[]),I=null==m?void 0:m.uri,j=(0,r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(b&&I&&!(0,a.ZiX)(I)){const n=e=>{console.warn("Collaboration error",e),C(null)};(0,i.pipe)(a.$oF,(0,i.andThen)((0,i.map)((0,i.props)(["objectId","comments"]))),(0,i.andThen)(i.fromPairs),(0,i.andThen)(t?C:_),(0,i.otherwise)(n))({uris:e,tenant:g,collaborationPath:f})}else C(null)}),[_,f,I,b,g]);(0,r.useEffect)((()=>{j(t,!0)}),[t,j]);const A=(0,r.useCallback)(((e,t)=>{(0,a.liG)({collaborationPath:f,tenant:g,relatedObjectUri:e,pageToken:t}).then((e=>{let{items:n,nextPageToken:r}=e;E((e=>t?(0,i.uniqBy)((0,i.prop)("commentId"),[...e,...n]):n)),v(r)})).catch(h)}),[f,g]),U=(0,r.useCallback)((e=>{k(!0),(0,a.d7q)({collaborationPath:f,tenant:g,commentId:e}).then(S).catch(h).finally((()=>k(!1)))}),[f,g]),z=(0,r.useCallback)((e=>{let{content:t,namedUsers:n,objectType:r,uri:o,relatedObjectUris:i}=e;P(!0);const l={objectId:o,content:t,relatedObjectUris:i,objectType:r,visibility:"public",namedUsers:n,permanentLink:`${window.location.href}&commentId=${encodeURIComponent("{commentId}")}`};return(0,a.Yrx)({collaborationPath:f,tenant:g,data:l}).then((e=>{let[t]=e;return((e,t)=>{S(e),C((n=>s({},n,{[t]:[...n[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),E((t=>[e,...t]))})(t,o)})).catch(h).finally((()=>P(!1)))}),[f,g]),D=(0,r.useCallback)((e=>{let{content:t,namedUsers:n,objectType:r,uri:o,relatedObjectUris:l,commentId:c,replies:d}=e;P(!0);const u={objectId:o,content:t,relatedObjectUris:l,objectType:r,visibility:"public",namedUsers:n,commentId:c,replies:d};return(0,a.uAg)({collaborationPath:f,tenant:g,data:u}).then((e=>(e=>{S(e),E((0,i.map)((0,i.when)((0,i.propEq)("commentId",e.commentId),(0,i.always)(e))))})(s({},e,{replies:d})))).catch(h).finally((()=>P(!1)))}),[f,g]),Z=(0,r.useCallback)((e=>{let{uri:t,commentId:n}=e;P(!0),(0,a.YFy)({collaborationPath:f,tenant:g,commentId:n}).then((()=>((e,t)=>{S(null),C((n=>{const r=n[t]||[];return s({},n,{[t]:r.filter((t=>t.commentId!==e))})})),E((t=>t.filter((t=>t.commentId!==e))))})(n,t))).catch(h).finally((()=>P(!1)))}),[f,g]),M=(0,r.useCallback)(((e,t,n,r)=>{const o="resolve"===e.action?"resolved":"open",{replyId:i}=e;S("resolved"===o?e=>{if(e)return null}:t=>{if(t)return s({},t,{replies:r?d(i,t.replies):[...t.replies,e]})}),C((e=>s({},e,{[t]:(e[t]||[]).map((e=>e.commentId===n?s({},e,{status:o,replies:r?e.replies-1:e.replies+1}):e))}))),E((t=>t.map((t=>t.commentId===n?s({},t,{status:o,replies:r?d(e.replyId,t.replies):[...t.replies,e]}):t))))}),[]),F=(0,r.useCallback)((e=>{let{uri:t,commentId:n,reply:r}=e;P(!0),(0,a.Mfr)({collaborationPath:f,tenant:g,commentId:n,replyId:r.replyId}).then((()=>M(r,t,n,!0))).catch(h).finally((()=>P(!1)))}),[f,M,g]),B=(0,r.useCallback)(((e,t)=>{S((t=>{if(t)return s({},t,{replies:u(t,e)})})),E((n=>n.map((n=>n.commentId===t?s({},n,{replies:u(n,e)}):n))))}),[]),G=(0,r.useCallback)((e=>{let{content:t,namedUsers:n,commentId:r,replyId:o}=e;P(!0);const i={content:t,namedUsers:n};return(0,a.ufV)({collaborationPath:f,tenant:g,commentId:r,replyId:o,data:i}).then((e=>B(e,r))).catch(h).finally((()=>P(!1)))}),[f,g,B]),q=(0,r.useCallback)((e=>{let{content:t,namedUsers:n,commentId:r,action:o,uri:i}=e;P(!0);const l={content:t,action:o,namedUsers:n};return(0,a.PP2)({collaborationPath:f,tenant:g,commentId:r,data:l}).then((e=>{let[t]=e;return M(t,i,r)})).catch(h).finally((()=>P(!1)))}),[f,g,M]),H=(0,r.useCallback)((e=>{let{commentId:t,uri:n}=e;q({content:"",namedUsers:[],commentId:t,action:"resolve",uri:n})}),[q]),V=(0,r.useCallback)((e=>{let{commentId:t,uri:n}=e;q({content:"",namedUsers:[],commentId:t,action:"reopen",uri:n})}),[q]);return{clearCurrentComment:(0,r.useCallback)((()=>{S(null)}),[]),comments:x,commentsMap:w,getCommentState:(e,t)=>(0,i.pathOr)({},[e,t],L),updateCommentState:(e,t,n)=>{N((r=>{const o=[e,t],a=(0,i.path)(o,r);return(0,i.assocPath)(o,(0,i.mergeRight)(a,n),r)}))},clearCommentState:(e,t)=>N((0,i.dissocPath)([e,t])),createComment:z,createReply:q,currentComment:R,deleteComment:Z,editComment:D,getComment:U,getComments:A,getCommentsCount:j,loading:O,objectTypes:n,pageToken:y,reOpenThread:V,resolveThread:H,sending:T,deleteReply:F,editReply:G}}},32794:(e,t,n)=>{n.d(t,{R:()=>d});var r=n(24328),o=n(17512),i=n(50914),a=n(52730),l=n(50673);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 d=e=>{let{connection:t,onConnectionChange:n,relatedEntity:c}=e;const d=(0,a.useSelector)(l.ZP.selectors.getMetadata),u=(0,r.useCallback)((e=>n(s({},t,{relation:e}))),[t,n]),p=(0,r.useCallback)((0,i.pipe)((0,o.zE1)(t.relation),u),[t.relation,u]),h=(0,r.useCallback)((0,i.pipe)((0,o.lIv)(t.relation),u),[t.relation,u]),m=(0,r.useCallback)((0,i.pipe)((0,o.Ilm)(t.relation),u),[t.relation,u]),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,d,(0,o.V3K)(d,r))?t.entity:null,relation:s({},t.relation,{attributes:{},type:r,direction:i})};n(a)}),[t,n,c,d]);return{onAddAttributes:p,onChangeAttribute:h,onRemoveAttribute:m,onChangeEntity:(0,r.useCallback)((e=>n(s({},t,{entity:e}))),[t,n]),onChangeRelationType:g}}},40577:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Jn});var r=n(24328),o=n.n(r),i=n(52730),a=n(54426),l=n(40855),s=n(97333),c=n(41633),d=n(9366),u=n(50914),p=n(50673),h=n(17512),m=n(87378),g=n(3466),f=n(67275),b=n(98996),y=n(2507),v=n.n(y),x=n(19701),E=n(62127),w=n(72942),C=n(60715),R=n(35174);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){T(e,t,n[t])}))}return e}function T(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=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,u.either)((0,u.pipe)(h.nqN,(0,u.equals)(e)),(0,u.pipe)(h.j5q,(0,u.equals)(e))));n.push(...r);const o=(0,u.pipe)(O,(0,u.without)([e]))(r);return o.forEach((e=>P(e,t,n))),n},O=e=>(0,u.pipe)((0,u.chain)((e=>[(0,h.nqN)(e),(0,h.j5q)(e)])),u.uniq)(e),k=(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,h.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})}))},L=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=>L(e,t,n))),n},N=(e,t,n)=>{const[o,a]=(0,r.useState)(null),l=(0,i.useDispatch)(),[s,c]=(0,r.useState)(null),[d,m]=(0,r.useState)(!1),g=null==e?void 0:e.uri,f=(0,h.biM)(e),y=(0,i.useSelector)(p.ZP.selectors.getMetadata),T=(0,x._)(),N=(0,x._)(),_=n===h.YGb.TREE,I=(0,E.D)(n),j=(0,r.useContext)(w.F),A=I===h.YGb.TREE&&_,U=(0,r.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return N((0,h.ZYI)({uri:e,deep:n,limitCreditsConsumption:!0,graphTypes:t?[(0,h.nIW)(t)]:null,activenessDate:null,max:t?200:3e3,signal:j}))}),[t,N,j]);(0,r.useEffect)((()=>(!g||(0,h.ZiX)(g)||f||_||(m(!0),T((0,h.ZYI)({uri:g,deep:t?2:1,limitCreditsConsumption:!0,graphTypes:t?[(0,h.nIW)(t)]:null,activenessDate:null,max:t?200:3e3,signal:j})).then((e=>{const t=new b.MultiGraph;k(t,e),a(t),c(e)})).catch((e=>{console.error(e),c(null),(0,h.D_E)(e)||l(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Something went wrong"))))})).finally((()=>{m(!1)}))),()=>{a(null),c(null),m(!1)})),[g,f,l,t,A]);const z=(0,r.useCallback)((async e=>{let{startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d}=e;try{var f;m(!0);const e=await(0,h.DsR)({startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d});if(null==e||null===(f=e[0])||void 0===f||!f.successful)throw null==e?void 0:e[0];const l=e[0].object,p=t===g?l.endObject.objectURI:l.startObject.objectURI,b=await(0,h.HvW)(p,{select:"label"});t===g?l.endObject.label=b.label:l.startObject.label=b.label;const v=((e,t,n)=>{const r=t.startObject.objectURI,o=t.endObject.objectURI,i=[r,o],a=e.entities.map((0,u.prop)("uri")),l=(0,h.V3K)(n,t.type),s=i.find((e=>!(0,u.includes)(e,a))),c=s&&(t.startObject.objectURI===s?t.startObject:t.endObject),d=c&&{type:c.type,label:c.label,uri:c.objectURI,traversedRelations:0,untraversedRelations:1},p=S({},(0,u.pick)(["uri","type","attributes","startDate","endDate","crosswalks","direction"],t),{startObject:(0,u.pick)(["objectURI","directionalLabel"],t.startObject),endObject:(0,u.pick)(["objectURI","directionalLabel"],t.endObject),direction:null==l?void 0:l.direction});return{entities:(d?e.entities.concat([d]):e.entities).map((e=>e.uri===r||e.uri===o?S({},e,{traversedRelations:e.traversedRelations+1}):e)),relations:(e.relations||[]).concat([p])}})(s,l,y);k(o,v);const x=[l.startObject.objectURI,l.endObject.objectURI],E=s.entities.map((0,u.prop)("uri"));x.forEach((e=>{if(E.includes(e)){const t=o.getNodeAttribute(e,"traversedRelationsCount");o.setNodeAttribute(e,"traversedRelationsCount",t+1)}})),c(v)}catch(e){throw l(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Something went wrong")))),e}finally{m(!1)}}),[l,s,o,y]),D=(0,r.useCallback)((e=>{m(!0),(0,h.VGk)(e).then((()=>{o.extremities(e).forEach((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,u.propEq)("uri",t)),i=(0,h.nqN)(o),a=(0,h.j5q)(o),l=(0,R.toUndirected)(n),s=(0,u.cond)([[()=>!(0,C.Ar)(l,e,i),(0,u.always)(i)],[()=>!(0,C.Ar)(l,e,a),(0,u.always)(a)],[u.T,(0,u.always)(null)]])(),c=(0,u.evolve)({entities:(0,u.map)((e=>e.uri===i||e.uri===a?S({},e,{traversedRelations:e.traversedRelations-1}):e)),relations:(0,u.reject)((0,u.propEq)("uri",t))})(r),{updatedData:d,removedEntitiesUris:p}=s?((e,t)=>{const n=P(e,t),r=(0,u.pipe)(O,(0,u.append)(e),u.uniq)(n);return{updatedData:(0,u.evolve)({relations:(0,u.reject)((e=>n.includes(e))),entities:(0,u.reject)((e=>r.includes(e.uri)))})(t),removedEntitiesUris:r}})(s,c):{updatedData:c,removedEntitiesUris:[]};return{updatedData:d,removedEntitiesUris:p}})(g,e,o,s);((e,t)=>{(t||[]).forEach((t=>{e.dropNode(t)}))})(o,n),c(t)})).catch((e=>{l(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Something went wrong"))))})).finally((()=>{m(!1)}))}),[l,o,g,s]),Z=(0,r.useCallback)(((e,t)=>{const{nodes:n=[]}=t,r=(0,u.difference)(o.neighbors(e),n);((e,t,n,r)=>{const o=(0,R.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,C.Ar)(e,t,n)?null:n)(o,e,t)&&a.push(t)})),(0,u.uniq)(a.reduce(((e,t)=>L(t,o,e)),[...a]))})(g,e,r,o).forEach((t=>{t!==g&&t!==e&&o.setNodeAttribute(t,"hidden",!0)}))}),[g,o]),M=(0,r.useCallback)((e=>{if(e&&!(0,h.ZiX)(e)&&!f){const t=o.getNodeAttribute(e,"untraversedRelationsCount");o.neighbors(e).forEach((e=>{o.setNodeAttribute(e,"hidden",!1)})),t>0&&(m(!0),U(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]=S({},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);k(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),(0,h.D_E)(e)||l(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Something went wrong"))))})).finally((()=>{m(!1)})))}}),[s,l,o,f,U]);return{graphLoading:d,data:s,graphologyGraph:o,onAddRelation:z,onDeleteRelation:D,onCollapseEntity:Z,onExpandEntity:M}};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 I=(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){_(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},j=[25,50,100];function A(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,t,n)=>{const{startObject:r,endObject:o,type:i}=t,{directionalLabel:a}=(0,h.nqN)(t)===n?r:o;return a||(0,h.Lmx)(e,i)},z=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),[m,g]=(0,r.useState)(j[0]),[f,b]=(0,r.useState)([]),[y,x]=(0,r.useState)(!1),E=(0,i.useDispatch)(),w=(0,i.useSelector)(p.ZP.selectors.getMetadata),C=(0,r.useMemo)((()=>{const e=(null==t?void 0:t.entities)||[];return(0,u.zipObj)(e.map((0,u.prop)("uri")),e)}),[null==t?void 0:t.entities]),R=(0,r.useMemo)((()=>(0,u.pipe)((0,u.filter)((0,u.either)((0,u.pipe)(h.nqN,(0,u.equals)(n)),(0,u.pipe)(h.j5q,(0,u.equals)(n)))),(0,u.uniqBy)((0,u.prop)("uri")),(0,u.map)((e=>{const t=C[((e,t)=>{const n=(0,h.nqN)(t),r=(0,h.j5q)(t);return n===e?r:n})(n,e)];return{relation:e,entity:t,entityLabel:(0,h.idV)(t.label),entityTypeLabel:(0,h.jFi)(w,t),relationTypeLabel:U(w,e,t.uri)}})))((null==t?void 0:t.relations)||[])),[t,n,C,w]),{searchText:S,onChangeSearchText:T,filters:P,onFilter:O,relationTypesOptions:k,entityTypesOptions:L}=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)({entityTypesUris:[],relationTypesUris:[]}),l=(0,i.useSelector)(p.ZP.selectors.getMetadata),s=(0,r.useMemo)((()=>(0,u.pipe)((0,u.map)((e=>{let{entity:t}=e;return t.type})),(0,u.concat)(u.__,o.entityTypesUris),u.uniq,(0,u.map)((0,h.nt9)(l)))(e)),[e,l,o.entityTypesUris]),c=(0,r.useMemo)((()=>(0,u.pipe)((0,u.map)((e=>{let{relation:t}=e;return t.type})),(0,u.concat)(u.__,o.relationTypesUris),u.uniq,(0,u.map)((0,h.V3K)(l)))(e)),[e,l,o.relationTypesUris]);return{searchText:t,onChangeSearchText:n,filters:o,onFilter:a,entityTypesOptions:s,relationTypesOptions:c}})(R),N=(0,r.useMemo)((()=>(0,u.pipe)((0,u.filter)((e=>{let{entityLabel:t,entity:n,relation:r}=e;const{entityTypesUris:o,relationTypesUris:i}=P;return h.P6Y.strings.search(t,S)&&(0,u.ifElse)((0,u.prop)("length"),(0,u.includes)(r.type),u.T)(i)&&(0,u.ifElse)((0,u.prop)("length"),(0,u.includes)(n.type),u.T)(o)})),l.field?(0,u.sort)(((e,t)=>h.P6Y.strings.sort(l.order,e[l.field],t[l.field]))):u.identity)(R)),[R,l,S,P]),_=(0,r.useMemo)((()=>N.slice(c*m,c*m+m)),[N,c,m]),I=(0,r.useCallback)((e=>{x(!0),(0,h._vs)(e).then((e=>{b((t=>[...t,{initialRelation:e,relation:e}]))})).catch((e=>{E(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Can't load relationship's attributes"))))})).finally((()=>x(!1)))}),[E]),z=(0,r.useCallback)((e=>{b((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){A(e,t,n[t])}))}return e}({},t,{relation:e}):t))))}),[]);(0,r.useEffect)((()=>{d(0),T("")}),[n,a,T,O]),(0,r.useEffect)((()=>{O({entityTypesUris:[],relationTypesUris:[]})}),[a,o,O]),(0,r.useEffect)((()=>{d(0)}),[l,S,P]);const D=(0,r.useCallback)((e=>{b((t=>t.filter((t=>t.relation.uri!==e))))}),[]),Z=(0,r.useCallback)(((e,t)=>{x(!0),(0,h.HH7)({oldRelation:e,newRelation:t}).then((()=>{D(t.uri)})).catch((e=>{E(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Can't edit relationship"))))})).finally((()=>x(!1)))}),[D,E]);return{rowsData:_,onSort:s,sorting:l,searchText:S,onChangeSearchText:T,filters:P,onFilter:O,entityTypesOptions:L,relationTypesOptions:k,editingRelations:f,onStartRelationEditing:I,onCancelRelationEditing:D,onUpdateEditingRelation:z,total:N.length,page:c,rowsPerPage:m,onPageChange:d,onRowsPerPageChange:g,onSaveEditingRelation:Z,loading:y}};var D=n(89025),Z=n(79312),M=n(79573),F=n(33945),B=n(50548),G=n(71153),q=n.n(G);const H=o().createContext({graphLoading:!1,data:null,graphologyGraph:null,selectedEntityLoading:!1,selectedEntity:null,onEntitySelect:()=>{},relationshipTable:{},onCollapseEntity:()=>{},onExpandEntity:()=>{},layout:null,setLayout:()=>{}});H.displayName="GraphStateContext";var V=n(44443),Y=n(44938),W=n(72342);const X="1px solid rgba(0, 0, 0, 0.05)",$=(0,W.makeStyles)({table:{flex:1,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},tableBody:{height:"100%",overflow:"auto"},tableBodyWrapper:{height:"100%",overflow:"hidden"},tableRowWrapper:{borderBottom:X},tableRow:{display:"flex",alignItems:"center","& > div":{flexShrink:0}},editingRow:{paddingTop:"8px",paddingBottom:"8px"},headRow:{borderBottom:X}});function K(){return K=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},K.apply(this,arguments)}const Q=(0,r.memo)((e=>{let{columnsData:t,sorting:n,onSort:r}=e;const i=$();return o().createElement("div",{className:q()(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,M.Dh)(n.order):"asc"})}}:{};return o().createElement("div",{key:t,className:l},o().createElement(s,K({headCellData:e},c)))})))})),J=(0,r.forwardRef)(((e,t)=>{let{classes:n,columnsData:i,rowsData:a,sorting:l,onSort:s,getRowKey:c,ExpandedRowRenderer:d,defaultRowHeight:u}=e;const p=$(),[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:q()(p.tableRowWrapper,null==n?void 0:n.tableRowWrapper)},o().createElement("div",{className:q()(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&&d&&o().createElement(d,{open:a.expanded,rowValue:a}))}),[i,d]),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(Q,{columnsData:i,sorting:l,onSort:s}),o().createElement("div",{className:p.tableBodyWrapper},o().createElement(V.Z,{handleHeight:!0,handleWidth:!0,onResize:f}),o().createElement("div",{className:p.tableBody},o().createElement(Y.Z,{listRef:b,width:h.width,height:h.height,data:a,defaultItemSize:u,itemKey:c,showNotMeasuredItems:!0},g))))})),ee=(0,r.memo)(J);var te=n(92332),ne=n(40007);const re="rgba(238, 238, 238, 1)",oe=(0,W.makeStyles)({tableWithPagination:{flex:1,overflow:"hidden",paddingRight:"1px",display:"flex",flexDirection:"column"},tableContainer:{flex:1,overflow:"hidden"},profileColumn:{minWidth:"180px",flex:3},relationshipTypeColumn:{minWidth:"70px",flex:1},entityTypeColumn:{minWidth:"70px",flex:1},row:{position:"relative","&:hover":{background:re}}});function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ae(e,t,n[t])}))}return e}function ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const le={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"},se=".collapsibleTableRow:hover &",ce=ie({},le,{[se]:{background:`linear-gradient(to right, rgba(238, 238, 238, 0), ${re} 100%)`}}),de=(0,W.makeStyles)((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":ie({},le,{right:"25px",width:"20px"})},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":ce},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",[se]:{visibility:"visible",background:re}},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 ue(){return ue=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},ue.apply(this,arguments)}function pe(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){he(e,t,n[t])}))}return e}function he(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=>{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=de();return o().createElement("div",{className:q()(i.headCell,t)},o().createElement(te.default,ue({},r,{headCellData:pe({},n,{label:o().createElement(ne.Z,{value:n.label},o().createElement("div",{className:i.headLabel},n.label))})})))},ge=(0,r.memo)((e=>{let{value:t="",tooltip:n,onClick:r,className:i}=e;const a=de();return n=n||t,o().createElement(ne.Z,{value:n},o().createElement("div",{className:q()(a.defaultCell,i,{[a.clickable]:!!r}),onClick:r},t))}));var fe=n(37573);const be=(0,B.l)(H,(e=>{let{onEntitySelect:t}=e;return{onClick:t}}),(e=>{let{value:t,rowValue:{entity:n},className:r,onClick:i}=e;const a=de(),l=o().createElement(o().Fragment,null,o().createElement(fe.Z,{entity:n,avatarClassName:a.entityAvatar}),t);return o().createElement(ge,{value:l,tooltip:t,className:q()(a.profileCell,r),onClick:()=>i(n.uri)})}));var ye=n(38677),ve=n(32794),xe=n(1469);const Ee=(0,B.l)(H,((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)(p.ZP.selectors.getMetadata),{relation:m,initialRelation:g}=n,f=(0,r.useMemo)((()=>!(0,u.equals)(g,m)),[m,g]),b=de(),y=(0,r.useCallback)((e=>{let{relation:t}=e;return a(t)}),[a]),x=(0,r.useCallback)((()=>l(m.uri)),[l,m.uri]),E=(0,r.useMemo)((()=>({relation:m})),[m]),{onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:R}=(0,ve.R)({connection:E,onConnectionChange:y});return t?o().createElement("div",{className:b.expandedRow},o().createElement(xe.n,{connection:E,onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:R}),o().createElement("div",{className:b.actionButtons},o().createElement(ye.Z,{onClick:x},v().text("Cancel")),o().createElement(ye.Z,{color:"primary",disabled:!f,onClick:()=>{(e=>{const t=(0,h.xkB)(d,{relation:{object:e}});return c(p.N5.errors.actions.errorsSet(t)),0===t.length})(m)&&s(g,m)}},v().text("Save")))):null}));var we=n(39475),Ce=n(29754),Re=n(6163),Se=n(22118);const Te=(0,B.l)(H,(0,u.pick)(["onDeleteRelation"]),(e=>{let{uri:t,open:n,onClose:r,onDeleteRelation:i}=e;return o().createElement(Se.Z,{open:n,title:v().text("Do you want to make a clean break?"),content:v().text("To end this relationship, click Delete Relationship. To keep the connection, click Cancel."),saveCaption:v().text("Delete relationship"),discardCaption:v().text("Cancel"),onDiscard:r,onSave:()=>{i(t),r()}})})),Pe=(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(we.k,{icon:Re.Z,size:"XXS",tooltipTitle:v().text("Delete"),"data-reltio-id":"reltio-delete-relation-button",onClick:a}),o().createElement(Te,{open:n,onClose:l,uri:t}))}));Pe.displayName="DeleteRelationButton";const Oe=Pe,ke=(0,B.l)(H,((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=de(),c=(0,i.useSelector)(p.ZP.selectors.getMetadata),d=(0,h.V3K)(c,n),u=(0,h.Z5t)(h.ARY.Editing,d),m=(0,h.Edd)(h.ARY.Editing,d);return o().createElement("div",{className:q()(s.controlsCell,r,{[s.editingMode]:l})},u&&o().createElement(we.k,{className:q()(s.editButton,{[s.hidden]:l}),icon:Ce.Z,size:"XXS",tooltipTitle:v().text("Edit"),"data-reltio-id":"reltio-edit-relationship-button",onClick:()=>a(t)}),m&&o().createElement(Oe,{uri:t}))}));function Le(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){Ne(e,t,n[t])}))}return e}function Ne(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=(e,t)=>t[e].relation.uri||`${e}`,Ie=(0,B.l)(H,(e=>{let{relationshipTable:t}=e;return Le({},t)}),(e=>{let{rowsData:t,sorting:n,onSort:i,total:a,page:l,rowsPerPage:s,onPageChange:c,onRowsPerPageChange:d,editingRelations:u,loading:p}=e;const h=oe(),g=(0,r.useMemo)((()=>[{id:"entityLabel",label:v().text("Profile"),headCellRenderer:me,rowCellValueRenderer:be,sortable:!0,columnClassName:h.profileColumn},{id:"relationTypeLabel",label:v().text("Relationship type"),headCellRenderer:me,rowCellValueRenderer:ge,sortable:!0,columnClassName:h.relationshipTypeColumn},{id:"entityTypeLabel",label:v().text("Entity Type"),headCellRenderer:me,rowCellValueRenderer:ge,sortable:!0,columnClassName:h.entityTypeColumn},{id:"controls",label:"",headCellRenderer:M.Vd,rowCellValueRenderer:ke}]),[h]),f=(0,r.useRef)(null);(0,r.useEffect)((()=>{var e;null===(e=f.current)||void 0===e||e.resetScrollbarPosition()}),[t]);const b=(0,r.useMemo)((()=>t.map((e=>null!=u&&u.some((t=>{var n;return t.initialRelation.uri===(null==e||null===(n=e.relation)||void 0===n?void 0:n.uri)}))?Le({},e,{expanded:!0}):e))),[t,u]),y=(0,r.useMemo)((()=>({tableRow:q()(h.row,"collapsibleTableRow")})),[h]);return o().createElement("div",{className:h.tableWithPagination},o().createElement("div",{className:h.tableContainer},o().createElement(ee,{ref:f,columnsData:g,rowsData:b,sorting:n,onSort:i,getRowKey:_e,ExpandedRowRenderer:Ee,defaultRowHeight:28,classes:y})),a>j[0]&&o().createElement(F.Z,{count:a,rowsPerPageOptions:j,rowsPerPage:s,onChangeRowsPerPage:d,page:l,onChangePage:c,basicTableRef:f}),p&&o().createElement(m.Z,null))}));var je=n(80653),Ae=n(87037),Ue=n(33662);const ze=(0,W.makeStyles)((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}}}))),De=(0,B.l)(H,(0,u.pipe)((0,u.prop)("relationshipTable"),(0,u.pick)(["searchText","onChangeSearchText"])),(e=>{let{searchText:t,onChangeSearchText:n}=e;const r=ze();return o().createElement(Ue.Z,{fullWidth:!0,height:40,autofocus:!1,value:t,onSearch:n,placeholder:v().text("Search profiles"),classes:{input:r.input}})}));var Ze=n(92934),Me=n(68977),Fe=n(69089);const Be=(0,W.makeStyles)((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"}}))),Ge=(0,B.l)(H,(0,u.pipe)((0,u.prop)("relationshipTable"),(0,u.pick)(["onFilter","filters","entityTypesOptions","relationTypesOptions"])),(e=>{let{open:t,onClose:n,filters:i,onFilter:a,entityTypesOptions:l,relationTypesOptions:s}=e;const c=Be(),[d,u]=(0,r.useState)([]),[p,h]=(0,r.useState)([]),m=()=>{u(i.entityTypesUris),h(i.relationTypesUris),n()};return(0,r.useEffect)((()=>{u(i.entityTypesUris),h(i.relationTypesUris)}),[i.entityTypesUris,i.relationTypesUris]),o().createElement(Fe.Z,{classes:{paper:c.dialogPaper},onClose:m,open:t},o().createElement(Z.Z,{className:c.title},v().text("Filter")),o().createElement(Ze.Q,{classes:{root:c.entityTypesSelector},entityTypes:l,selectedEntityTypes:d,enableEmptyValueUnderline:!0,onChange:u}),o().createElement(Me.U,{classes:{root:c.relationTypesSelector},relationTypes:s,selectedRelationTypes:p,enableEmptyValueUnderline:!0,onChange:h}),o().createElement("div",{className:c.footer},o().createElement(ye.Z,{className:c.clearAllButton,onClick:()=>{u([]),h([])}},v().text("Clear All")),o().createElement(ye.Z,{className:c.cancelButton,onClick:m},v().text("Cancel")),o().createElement(ye.Z,{onClick:()=>{a({entityTypesUris:d,relationTypesUris:p}),n()},color:"primary"},v().text("Apply"))))})),qe=(0,W.makeStyles)((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}}))),He=(0,B.l)(H,(0,u.pipe)((0,u.prop)("relationshipTable"),(0,u.pick)(["filters"])),(e=>{let{filters:t}=e;const n=qe(),[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(De,null),o().createElement(Ae.Z,{"data-reltio-id":"reltio-filter-relationship-button",className:n.iconButton,onClick:()=>a(!0),size:"large"},o().createElement(je.Z,{className:c?n.activeFiltersIcon:n.inactiveFiltersIcon})),o().createElement(Ge,{open:i,onClose:()=>a(!1)}))}));var Ve=n(93553),Ye=n(25601),We=n(79811),Xe=n(290),$e=n(35936);const Ke=e=>{const t=(0,i.useSelector)(p.ZP.selectors.getMetadata),{inRelations:n=[],outRelations:o=[]}=(0,r.useMemo)((()=>(0,h.UWq)(t,e,(0,h.d89)(h.ARY.Editing))),[t,e]);return{inRelationTypes:n,outRelationTypes:o}},Qe=(0,W.makeStyles)((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!important",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},attributeList:{paddingTop:"22px"}}))),Je=(0,B.l)(H,(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=Qe(),c=(0,i.useSelector)(p.ZP.selectors.getMetadata),[d,u]=(0,r.useState)({}),{relation:m,entity:g}=d,{type:f,direction:b}=m||{},[y,x]=(0,r.useState)(!1),E=(0,i.useDispatch)();(0,r.useEffect)((()=>{n&&u({relation:{uri:(0,h.ncP)(),type:null,attributes:{}}})}),[n]);const{inRelationTypes:w,outRelationTypes:C}=Ke(null==t?void 0:t.type),R=(0,r.useCallback)((()=>{const e=(0,h.xkB)(c,{relation:{object:m}});return E(p.N5.errors.actions.errorsSet(e)),0===e.length}),[m,c,E]),{onAddAttributes:S,onChangeAttribute:T,onRemoveAttribute:P,onChangeEntity:O,onChangeRelationType:k}=(0,ve.R)({connection:d,onConnectionChange:u,relatedEntity:t});return o().createElement(Fe.Z,{open:n,fullWidth:!0,maxWidth:"sm",onClose:a,classes:{paper:s.dialogPaper}},o().createElement($e.Z,{classes:{root:s.dialogTitle}},o().createElement(Z.Z,{variant:"subtitle1",classes:{root:s.titleText}},v().text("Add relationship"))),o().createElement(Xe.Z,{classes:{root:s.content}},o().createElement(xe.n,{connection:d,onAddAttributes:S,onChangeAttribute:T,onRemoveAttribute:P,relatedEntity:t,inRelationTypes:w,outRelationTypes:C,onChangeRelationType:k,onChangeEntity:O})),o().createElement(We.Z,null,o().createElement(ye.Z,{onClick:a},v().text("Cancel")),o().createElement(ye.Z,{disabled:!(null!=d&&d.entity)||!f||y,color:"primary",onClick:()=>{const{type:e,attributes:n={},startDate:r,endDate:o}=m,i=b===h.Nsj.OUT?t.uri:g.uri,s=b===h.Nsj.OUT?g.uri:t.uri;R()&&(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)})))}},v().text("Add"))))})),et=(0,B.l)(H,(0,u.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;const{inRelationTypes:n,outRelationTypes:i}=Ke(null==t?void 0:t.type),a=n.length+i.length>0,[l,s]=(0,r.useState)(!1);return a&&o().createElement(o().Fragment,null,o().createElement(Ye.K,{"data-reltio-id":"reltio-add-relationship-button",mode:Ye.N.button,label:v().text("Add relationship"),icon:Ve.Z,onClick:()=>{s(!0)}}),o().createElement(Je,{open:l,onClose:()=>{s(!1)}}))})),tt=(0,W.makeStyles)({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}}),nt=()=>{const e=tt();return o().createElement("div",{className:e.wrapper},o().createElement("div",{className:e.caption},o().createElement(Z.Z,{variant:"subtitle1"},v().text("Relationships")),o().createElement(et,null)),o().createElement(He,null),o().createElement(Ie,null))};var rt=n(15177);const ot=(0,W.makeStyles)({noShadowBlock:{boxShadow:"none"},wrapper:{position:"relative",paddingRight:"1px",overflow:"auto"}}),it=(0,B.l)(H,(0,u.pick)(["selectedEntity","selectedEntityLoading"]),(e=>{let{selectedEntity:t,selectedEntityLoading:n}=e;const r=ot();return o().createElement("div",{className:r.wrapper},n&&o().createElement(m.Z,null),o().createElement(rt.Z,{entity:t,caption:v().text("Entity details"),className:r.noShadowBlock}))}));var at=n(11821),lt=n(18527),st=n(79386);const ct=(0,W.makeStyles)((e=>({link:{textDecoration:"none",color:e.palette.primary.main}}))),dt=(0,B.l)(H,(0,u.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;const n=ct(),r=(0,i.useSelector)(p.ZP.selectors.getEntityUri),a=null==t?void 0:t.uri;return o().createElement(st.Z,{entity:t,renderLabel:e=>r===a?e:o().createElement(lt.Z,{className:n.link,value:(0,h.wwR)(t),screen:"graph"},e)})}));let ut;!function(e){e[e.Relationship=0]="Relationship",e[e.EntityDetails=1]="EntityDetails"}(ut||(ut={}));const pt=(0,r.memo)((e=>{var t;let{active:n,tabs:r}=e;const i=!(0,u.isNil)(n);return o().createElement(at.h,{open:i},o().createElement(dt,null),null===(t=r[n])||void 0===t?void 0:t.content)}));function ht(){return ht=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},ht.apply(this,arguments)}pt.displayName="GraphRightSidePanel";const mt=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",ht({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 gt=n(46339),ft=n(23304),bt=n(64488),yt=n(95372),vt=n.n(yt),xt=n(88586);const Et=e=>e.getContext("2d",{preserveDrawingBuffer:!1,antialias:!1}),wt=e=>{const t=document.createElement("canvas");return t.style.position="absolute",t.setAttribute("class",`sigma-${e}`),t},Ct=(0,r.createContext)({addRenderers:M.ZT,canvases:{}}),Rt=()=>(0,r.useContext)(Ct);Ct.displayName="SigmaCustomRenderersContext";const St=e=>{let{children:t}=e;const n=(()=>{const{container:e,sigma:t}=(0,gt.Vr)(),[n,o]=(0,r.useState)({}),i=(0,r.useRef)({}),a=(0,r.useRef)(0),l=(0,r.useRef)(0),s=(0,r.useCallback)((e=>{o((0,u.mergeLeft)(e))}),[]),c=(0,r.useCallback)((()=>{a.current=e.offsetWidth,l.current=e.offsetHeight;const t=(0,xt.getPixelRatio)();for(const e in i.current){const{canvasElement:n,context:r}=i.current[e];n.style.width=a.current+"px",n.style.height=l.current+"px",n.setAttribute("width",a.current*t+"px"),n.setAttribute("height",l.current*t+"px"),1!==t&&r.scale(t,t)}}),[e.offsetHeight,e.offsetWidth]),d=(0,r.useCallback)((()=>{for(const e in n){const{context:t}=i.current[e];t.clearRect(0,0,a.current,l.current);const{renderer:r}=n[e];r(t)}}),[n]),p=(0,r.useCallback)((()=>{for(const t in n){if(!(0,h.O27)(i.current[t]))continue;const{insertBefore:r}=n[t],o=e.querySelector(".sigma-container"),a=wt(t),l=Et(a);o.insertBefore(a,o.querySelector(`.sigma-${r}`)),i.current[t]={canvasElement:a,context:l},c()}}),[n,e,c]);return(0,r.useEffect)((()=>(t.addListener("beforeRender",p),()=>{t.off("beforeRender",p)})),[t,p]),(0,r.useEffect)((()=>(t.addListener("afterRender",d),()=>{t.off("afterRender",d)})),[t,d]),(0,r.useEffect)((()=>(t.addListener("resize",c),()=>{t.off("resize",c)})),[t,c]),(0,r.useEffect)((()=>{const e=i.current;return()=>{for(const t in e)e[t].canvasElement.remove(),delete e[t]}}),[]),{addRenderers:s,canvases:i.current}})();return o().createElement(Ct.Provider,{value:n},t)},Tt=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,d=t.y-s/2,u=t.y+s/2,p=t.x+(r?0:c),h=p+l+(r?c:0);e.beginPath(),e.moveTo(p,u-i),e.quadraticCurveTo(p,u,p+i,u),e.lineTo(h-i,u),e.quadraticCurveTo(h,u,h,u-i),e.lineTo(h,d+i),e.quadraticCurveTo(h,d,h-i,d),e.lineTo(p+i,d),e.quadraticCurveTo(p,d,p,d+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())},Pt=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&&Tt(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)},Ot=(e,t,n)=>{Tt(e,t,n,!0),Pt(e,t,n,!1)};class kt extends ft.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,xt.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 Lt{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.startsWith("data:image")?t:t+"?not-from-cache"},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 Nt={id:"defaultImage",path:(0,h.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 _t extends ft.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 Lt,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(Nt.id,Nt.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,xt.floatColor)(e.color),r[o++]=e.inactive?1:0,a&&"ready"===a.status||(a=this.imageLoader.images[Nt.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 It=[{id:"expandIcon",path:(0,h.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,h.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 jt extends ft.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 Lt,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])),It.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,d=0;if(s&&(s=1/Math.sqrt(s),c=l*s,d=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,xt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=c,r[o++]=-d,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,xt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=-c,r[o++]=-d,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 At=n(23193),Ut=n.n(At);class zt extends(Ut()){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,d=t.x,u=t.y,p=(0,xt.floatColor)(n.color),h=d-s,m=u-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++]=d,v[y++]=u,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=1,v[y++]=0,v[y++]=0,v[y++]=d,v[y++]=u,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=0,v[y++]=1,v[y++]=0,v[y++]=d,v[y++]=u,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=0,v[y++]=0,v[y]=1}}class Dt extends zt{process(e,t,n,r,o){super.process(t,e,n,r,o)}}var Zt=n(73343),Mt=n.n(Zt);class Ft extends bt.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}",Mt(),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,xt.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,d=t.y,u="doubleArrow"===n.type?e.size||1:0,p=t.size||1,h=(0,xt.floatColor)(n.color),m=c-l,g=d-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++]=-u,x[v++]=i,x[v++]=l,x[v++]=s,x[v++]=-b,x[v++]=-y,x[v++]=h,x[v++]=u,x[v++]=i,x[v++]=c,x[v++]=d,x[v++]=b,x[v++]=y,x[v++]=h,x[v++]=p,x[v++]=i,x[v++]=c,x[v++]=d,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 Bt=e=>{let{children:t}=e;const n=(0,r.useMemo)((()=>({allowInvalidContainer:!0,defaultNodeType:"image",hoverRenderer:Ot,labelRenderer:Pt,nodeProgramClasses:{image:(0,ft.createNodeCompoundProgram)([_t,kt,jt])},edgeProgramClasses:{line:vt(),arrow:(0,bt.createEdgeCompoundProgram)([Ft,zt]),doubleArrow:(0,bt.createEdgeCompoundProgram)([Ft,zt,Dt])},labelFont:"Roboto",labelSize:13,labelColor:{color:"rgba(0, 0, 0, 0.87)"}})),[]);return o().createElement(gt.C6,{graph:b.MultiGraph,style:{background:"transparent"},settings:n},o().createElement(St,null,t))};var Gt=n(28833),qt=n.n(Gt),Ht=n(3660),Vt=n.n(Ht),Yt=n(28301),Wt=n.n(Yt),Xt=n(55962),$t=n(31181);const Kt={[h.MCv.bidirectional]:"doubleArrow",[h.MCv.directed]:"arrow",[h.MCv.undirected]:"line"},Qt=(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,Jt=e=>{let{graph:t,undirectedGraph:n,selectedNode:r,rootNodeUri:o}=e;if(t&&n&&o&&r&&o!==r)try{const e=(0,C.Ar)(n,o,r),i=function(e,t){const n=[],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"findOutEdge":"findEdge";return t&&t.forEach(((t,o,i)=>{const a=i[o+1];a&&n.push(e[r](t,a,(e=>!!e)))})),n}(t,e);return e?{edges:i,nodes:e}:{}}catch(e){}return{}},en=.4,tn=(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}),nn=(e,t,n,r,o)=>{e.beginPath(),e.moveTo(t+r,n+o),e.lineTo(t+o*en,n-r*en),e.lineTo(t-o*en,n+r*en),e.lineTo(t+r,n+o),e.closePath(),e.fill()};function rn(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){on(e,t,n[t])}))}return e}function on(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function an(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){ln(e,t,n[t])}))}return e}function ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sn=(0,u.memoizeWith)(((e,t,n)=>n.type),h.uie),cn={size:24,buttonSize:8,buttonOffset:[19,19]},dn={size:12,buttonSize:6,buttonOffset:[8,13]},un=e=>{let{data:t,graph:n,syncLayout:o,workerLayout:a,layoutSettings:l,selectedNode:s,isDirected:c=!1,onNodeClick:d,onNodeCollapse:u,onNodeExpand:m,filters:g}=e;const f=(0,gt.Ys)(),b=(0,gt.sG)(),y=(0,gt.$j)(),v=(0,gt.eP)(),{selfRelationsPathsMap:x,selfRelationLoopsCanvas:E}=(e=>{const t=(0,gt.Ys)(),{addRenderers:n,canvases:o}=Rt(),i=(0,r.useRef)({}),{selfRelationLoops:a}=o;return(0,r.useEffect)((()=>{n({selfRelationLoops:{renderer:n=>{e.forEachEdge(((e,r,o)=>{if(r.loop){delete i.current[e];const r=t.getEdgeDisplayData(e),a=t.getNodeDisplayData(o);if(r.hidden||a.hidden)return;const l=((e,t,n)=>{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);e.strokeStyle=o,e.lineWidth=r;const d=new Path2D;if("arrow"===t.type||"doubleArrow"===t.type){if(e.fillStyle=o,"doubleArrow"===t.type){const t=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return tn(e.x2,e.y2,i,t,n,r,o)})(c,a,l,s,r*i*2.2);nn(e,t.aX,t.aY,t.vX,t.vY),d.moveTo(t.aX,t.aY)}else d.moveTo(a,l);const n=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return tn(e.x1,e.y1,i,t,n,r,o)})(c,a,l,s,r*i*2.2);d.bezierCurveTo(c.x2,c.y2,c.x1,c.y1,n.aX,n.aY),e.stroke(d),nn(e,n.aX,n.aY,n.vX,n.vY)}else d.moveTo(a,l),d.bezierCurveTo(c.x1,c.y1,c.x2,c.y2,a,l),e.stroke(d);return d})(n,rn({},r,{size:t.scaleSize(r.size)}),rn({},a,t.framedGraphToViewport(a),{size:t.scaleSize(a.size)}));i.current[e]=l}}))},insertBefore:"edges"}})}),[n,e,t]),{selfRelationsPathsMap:i.current,selfRelationLoopsCanvas:a}})(n),w=((e,t,n)=>{const o=(0,gt.Ys)(),i=(0,gt.$j)(),{addRenderers:a}=Rt(),l=(0,r.useRef)({x:0,y:0}),[s,c]=(0,r.useState)(null),[d,u]=(0,r.useState)(null),p=s||d;return(0,r.useEffect)((()=>{i({enterEdge:e=>{let{edge:t}=e;c(t)},leaveEdge:()=>{c(null)},mousemove:e=>{if(l.current.x=e.x,l.current.y=e.y,!t)return;const{context:r,canvasElement:o}=t,{x:i,y:a}=((e,t)=>{const n=e.getBoundingClientRect();return{x:(t.clientX-n.left)/(n.right-n.left)*e.width,y:(t.clientY-n.top)/(n.bottom-n.top)*e.height}})(o,e.original);for(const e in n){const t=n[e];if(r.isPointInStroke(t,i,a)){u(e);break}u(null)}}})}),[o,i,t,n]),(0,r.useEffect)((()=>{a({tooltips:{renderer:t=>{e.forEachEdge(((e,n,r)=>{const i=o.getEdgeDisplayData(e),a=o.getNodeDisplayData(r);if(!i.hovered||a.highlighted)return;const{x:s,y:c}=l.current;((e,t,n,r)=>{e.font="normal 10px Roboto",e.textAlign="center",e.textBaseline="middle";const o=e.measureText(r).width+16,i=t-o/2,a=n-12;e.fillStyle="rgba(0, 0, 0, 0.54)",((e,t,n,r,o,i)=>{e.beginPath(),e.moveTo(t,n+4),e.arcTo(t,n+24,t+4,n+24,4),e.arcTo(t+r,n+24,t+r,n+24-4,4),e.arcTo(t+r,n,t+r-4,n,4),e.arcTo(t,n,t,n+4,4),e.fill()})(e,i,a,o),e.fillStyle="#fff",e.fillText(r,i+o/2,a+12)})(t,s,c-15,i.relationLabel)}))},insertBefore:"mouse"}})}),[a,e,o]),p})(n,E,x),C=(0,i.useSelector)(p.ZP.selectors.getEntity),S=(0,i.useSelector)(p.ZP.selectors.getMetadata),T=(0,i.useSelector)(p.ZP.selectors.getAbsoluteImagePath)||"",[P,O]=(0,r.useState)(void 0),[k,L]=(0,r.useState)(null),[N,_]=(0,r.useState)({}),I=null==C?void 0:C.uri;(0,r.useEffect)((()=>{f.getCamera().setState({ratio:1.2})}),[n,f]),(0,r.useEffect)((()=>{if(L((0,R.toUndirected)(n)),b(n),o){const e=o(f.getGraph(),l);(0,$t.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,b,c]),(0,r.useEffect)((()=>{const e=Jt({graph:f.getGraph(),undirectedGraph:k,selectedNode:s,rootNodeUri:I});_(e)}),[s,I,f,k]),(0,r.useEffect)((()=>{y({enterNode:e=>{let{node:t}=e;O(t)},leaveNode:()=>{O(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)return;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=Qt(e.x,e.y,r.x+o,r.y-i,a),s=Qt(e.x,e.y,r.x+o,r.y+i,a);if(n.showExpand&&l&&(m(t),d(t)),n.showCollapse&&s){const e=Jt({graph:f.getGraph(),undirectedGraph:k,selectedNode:t,rootNodeUri:I});u(t,e),d(t)}}})}),[f,y,d,u,m,I,k]),(0,r.useEffect)((()=>{const e=f.getGraph();let t;try{t=e.neighbors(s)}catch(e){}v({nodeReducer:(n,r)=>{const{entityTypesUris:o=[]}=g||{},i=sn(S,T,{type:r.entityTypeUri}),a=e.neighbors(n),l=a.map((t=>e.getNodeAttribute(t,"hidden"))).filter((e=>!!e)).length,c=(N.nodes||[]).includes(n),d=P===n,u=n===I,p=n===s,h=t&&!t.includes(n)&&s!==n&&s!==I&&!c,m=![s,I].includes(n)&&o.length>0&&!o.includes(r.entityTypeUri),f=an({},r,n===s?cn:dn,{color:"#0072CE",image:i,showExpand:r.untraversedRelationsCount>0||l>0,showCollapse:r.traversedRelationsCount>1&&a.length-l>1});return c||p||u?(f.inPath=!0,f.color=u?"#00FFFF":r.color):h&&(f.label=d?r.label:"",f.inactive=!0),d&&(f.highlighted=!0),m&&(f.hidden=!0),f},edgeReducer:(t,n)=>{const{relationTypesUris:r=[]}=g||{},o=an({},n,{hidden:!1}),i=(N.edges||[]).includes(t),a=(0,h.V3K)(S,n.relationTypeUri),l=(0,h.oSN)(S,a,"typeColor"),d=s&&s!==I&&!e.hasExtremity(t,s)&&!i||r.length>0&&!r.includes(n.relationTypeUri);var u;return l&&(o.color=l),w===t&&(o.hovered=!0),d&&(o.hidden=!0),c&&(o.arrowSizeRatio=4),i&&(o.color="#0072CE",o.size=4,o.arrowSizeRatio=c?1.4:n.arrowSizeRatio),o.type=(u=c?n.direction:h.MCv.undirected,Kt[u]||"line"),o.relationLabel=(0,h.idV)(null==a?void 0:a.label),o},enableEdgeHoverEvents:!0})}),[f,v,P,s,N,I,S,T,c,g,w])};function pn(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){hn(e,t,n[t])}))}return e}function hn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mn=e=>{let{data:t,graph:n,selectedNode:o,layout:i,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const d=(0,E.D)(t);(0,Xt.D)((()=>{if(d){const e=(0,u.difference)(t.entities.map((0,u.prop)("uri")),d.entities.map((0,u.prop)("uri")));if(e.length){const t=n.copy();qt().assign(t),e.forEach((e=>{n.setNodeAttribute(e,"x",t.getNodeAttribute(e,"x")),n.setNodeAttribute(e,"y",t.getNodeAttribute(e,"y"))}))}}}),[t]);const p=(0,r.useMemo)((()=>(qt().assign(n),{settings:pn({},Vt().inferSettings(n),{gravity:1})})),[n]);return un({workerLayout:Wt(),layoutSettings:p,data:t,graph:n,selectedNode:o,onNodeClick:a,isDirected:i===h.YGb.DIRECTED_NETWORK,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var gn=n(36039);const fn=(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},bn=(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)?bn(o,t,n,r):t},yn=(e,t,n,r,o)=>{if(e.length<=o&&(t[r]=[...e]),e.length>o){const i=e.slice(o),a=e.slice(0,o);t[r]=a,t[r+1]=n[r+1]?[...n[r+1],...i]:i}if(t[r+1]||n[r+1]){const e=t[++r]||n[r];return yn(e,t,n,r,o)}return t},vn=e=>{let{quantityAtLvl:t,rowNumber:n,isEvenItem:r,layout:o,shouldUseCheckboardPattern:i}=e;const a=o===h.YGb.VERTICAL_TB;return i&&a&&r&&1!==t?10*n+5:10*n},xn=e=>{let{quantityAtLvl:t,posAtLvl:n,max:r,isEvenRow:o,layout:i,shouldUseCheckboardPattern:a}=e;const l=i===h.YGb.HORIZONTAL_LR;return t===r?a&&o&&l?10*n+5:10*n:1===t?10*(r-1)/2:10*(r-1)/(t+1)*(n+1)},En=e=>e<100;function wn(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 d=(0,r.useCallback)((e=>{const t=e.copy(),n=(e=>{switch(e){case h.YGb.VERTICAL_TB:return 180;case h.YGb.HORIZONTAL_LR:return 270}})(i),r=(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),a=r.nodes.length,l=!En(a),s=((e,t)=>{if(En(e))return 10;const n=t===h.YGb.VERTICAL_TB?1.5:.7;return Math.round(Math.sqrt(e)*n)})(a,i),c=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;const r=e.nodes,o=e.edges.filter((e=>e.from!==e.to)),i=fn(o,r,t),a=bn(i,[],new Set,o);return yn(a[0],[],a,0,n)}(r,o,s),d=(e=>{const t=e.map((e=>e.length));return Math.max(...t)})(c);for(let e=0;e<c.length;++e){const n=e%2==0,r=c[e].length;for(let o=0;o<r;++o){const a=o%2==0,s=xn({quantityAtLvl:r,posAtLvl:o,max:d,isEvenRow:n,layout:i,shouldUseCheckboardPattern:l}),u=vn({quantityAtLvl:r,rowNumber:e,isEvenItem:a,layout:i,shouldUseCheckboardPattern:l});t.setNodeAttribute(c[e][o],"x",s),t.setNodeAttribute(c[e][o],"y",u)}}return gn.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){wn(e,t,n[t])}))}return e}({},e,{[t]:{x:r,y:o}})}),{})}),[i,o]);return un({syncLayout:d,data:t,graph:n,selectedNode:o,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var Rn=n(84425);const Sn=(0,W.makeStyles)({graphTypeSelector:{minWidth:"200px",backgroundColor:"#FAFAFA",opacity:1,height:"40px"},filledInputRoot:{borderRadius:"4px"},valueContainer:{width:"auto",marginLeft:"16px"}}),Tn=(0,B.l)(H,(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;return{setGraphTypeUri:n,graphTypeUri:t}}),(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;const a=Sn(),l=(0,i.useSelector)(p.ZP.selectors.getMetadata),s=(0,i.useSelector)(p.ZP.selectors.getEntity),c=(0,r.useMemo)((()=>[{label:v().text("All"),value:null},...(0,h.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(Rn.Z,{classes:{valueContainer:a.valueContainer},className:a.graphTypeSelector,height:42,label:v().text("Graph type"),value:d,options:c,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:a.filledInputRoot}}}})})),Pn=(0,W.makeStyles)({graphLayoutSelector:{minWidth:"202px",backgroundColor:"#FAFAFA",opacity:1,marginLeft:"10px"},filledInputRoot:{borderRadius:"4px",height:"42px"}}),On=(0,r.memo)((e=>{let{value:t,onChangeHandler:n,graphTypeUri:r}=e;const i=Pn(),a=[{label:v().text("Simple network"),value:h.YGb.SIMPLE_NETWORK},{label:v().text("Vertical hierarchy"),value:h.YGb.VERTICAL_TB},{label:v().text("Horizontal hierarchy"),value:h.YGb.HORIZONTAL_LR},{label:v().text("Directed network"),value:h.YGb.DIRECTED_NETWORK},{label:v().text("Tree"),value:h.YGb.TREE}],l=r?a:a.filter((e=>e.value!==h.YGb.TREE));return o().createElement(Rn.Z,{className:i.graphLayoutSelector,label:v().text("Graph layout"),value:a.find((0,u.propEq)("value",t)),options:l,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:i.filledInputRoot}}}})})),kn=()=>{const e=(0,gt.Ys)(),t=(0,r.useCallback)((()=>{e.refresh()}),[e]);return o().createElement(V.Z,{handleWidth:!0,onResize:t})};var Ln=n(81087),Nn=n(16844);function _n(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){In(e,t,n[t])}))}return e}function In(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jn="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)",An={background:"#FFFFFF",boxShadow:jn,width:"28px",height:"28px"},Un=(0,W.makeStyles)({container:{display:"flex",alignItems:"center"},maxButton:_n({},An,{borderRadius:"2px 4px 4px 2px"}),minButton:_n({},An,{borderRadius:"4px 2px 2px 4px"}),thumb:{boxShadow:jn,borderRadius:"2px",width:"8px",height:"28px",marginLeft:"5px",color:"rgba(0,0,0,0.54)",backgroundColor:"#FFFFFF","&.MuiSlider-thumb.Mui-focusVisible, &:hover":{boxShadow:jn},"&:before":{boxShadow:"none"}},thumbIcon:{transform:"rotate(90deg)"},icon:{width:"18px",height:"18px"},rail:{opacity:1,height:"4px",paddingRight:"10px",marginTop:"1px"},sliderRoot:{color:"#EDEDED",marginRight:"10px",height:"2px"}});const zn=e=>Math.pow(100/e,2),Dn=e=>100/Math.sqrt(e),Zn=e=>{const{children:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},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"]),r=Un();return o().createElement(Nn.gs,n,t,o().createElement(Ln.Z,{className:q()(r.icon,r.thumbIcon)}))},Mn=e=>{let{className:t,max:n,min:i}=e;const a=Un(),l=(0,gt.eP)(),s=(0,gt.$j)(),c=(0,gt.Ys)().getCamera(),{zoomIn:d,zoomOut:p}=(0,gt.AH)({factor:1.2}),[h,m]=(0,r.useState)((0,u.clamp)(i,n,Dn(c.getState().ratio))),g=(0,r.useMemo)((()=>i>0?zn(i):null),[i]),f=(0,r.useMemo)((()=>n>0?zn(n):null),[n]);return(0,r.useEffect)((()=>(l({maxCameraRatio:g,minCameraRatio:f}),()=>{l({maxCameraRatio:null,minCameraRatio:null})})),[l,f,g]),(0,r.useEffect)((()=>{s({updated:e=>m(Dn(e.ratio))})}),[s]),o().createElement("div",{className:q()(a.container,t)},o().createElement(Ae.Z,{className:a.minButton,onClick:()=>p(),size:"large"},o().createElement(Ln.Z,{className:a.icon})),o().createElement(Nn.ZP,{slots:{thumb:Zn},slotProps:{thumb:{className:a.thumb}},classes:{root:a.sliderRoot,rail:a.rail},track:!1,value:h,min:i,max:n,onChange:(e,t)=>c.setState({ratio:c.getBoundedRatio(zn(t))})}),o().createElement(Ae.Z,{className:a.maxButton,onClick:()=>d(),size:"large"},o().createElement(Ve.Z,{className:a.icon})))};var Fn=n(35299);const Bn=(0,W.makeStyles)({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"}}),Gn=e=>{let{node:t}=e;const n=Bn(),{gotoNode:r}=(0,gt.AH)();return o().createElement(Ae.Z,{className:n.button,onClick:()=>r(t),size:"large"},o().createElement(Fn.Z,{className:n.icon}))};var qn=n(91572);const Hn=(0,W.makeStyles)({hierarchyTree:{position:"relative",width:"calc(100% - 190px)",margin:"80px 95px 0",height:"calc(100% - 100px)"}}),Vn=e=>{var t;let{graphTypeUri:n}=e;const a=Hn(),{store:l}=(0,r.useContext)(i.ReactReduxContext),s=(0,i.useSelector)(p.ZP.selectors.getMetadata),c=(0,i.useSelector)(p.ZP.selectors.getEntity),d=null===(t=(0,h.mmY)(s,c.type).find((0,u.propEq)("uri",n)))||void 0===t?void 0:t.label,m=(0,r.useMemo)((()=>({id:"___graphView___",class:h.ZIY.HierarchyTree,graph:{type:n},caption:d})),[d,n]);return o().createElement(qn.HierarchyTreeView,{config:m,store:l,className:a.hierarchyTree,isGraphView:!0})},Yn=(0,W.makeStyles)({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"}}),Wn=(0,B.l)(H,(e=>{let{data:t,graphologyGraph:n,selectedEntity:r,onEntitySelect:o,onCollapseEntity:i,onExpandEntity:a,relationshipTable:{filters:l},graphTypeUri:s,layout:c,setLayout:d}=e;return{data:t,graph:n,selectedNode:null==r?void 0:r.uri,onNodeSelect:o,onNodeCollapse:i,onNodeExpand:a,filters:l,graphTypeUri:s,layout:c,setLayout:d}}),(e=>{let{data:t,graph:n,selectedNode:r,onNodeSelect:i,onNodeCollapse:a,onNodeExpand:l,filters:s,graphTypeUri:c,layout:d,setLayout:u}=e;const p=Yn(),m={data:t,graph:n,selectedNode:r,layout:d,onNodeClick:i,onNodeCollapse:a,onNodeExpand:l,filters:s};return o().createElement("div",{className:p.wrapper},o().createElement("div",{className:p.selectors},o().createElement(Tn,null),o().createElement(On,{value:d,onChangeHandler:u,graphTypeUri:c})),o().createElement("div",{className:p.graph},d===h.YGb.TREE?o().createElement(Vn,{graphTypeUri:c}):n&&o().createElement(Bt,null,o().createElement(o().Fragment,null,o().createElement(kn,null),d===h.YGb.SIMPLE_NETWORK||d===h.YGb.DIRECTED_NETWORK?o().createElement(mn,m):o().createElement(Cn,m),o().createElement("div",{className:p.rightBottomControls},o().createElement(Mn,{className:p.zoomSlider,min:30,max:300}),o().createElement(Gn,{node:r}))))))})),Xn=(0,W.makeStyles)((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)((e=>{let{graphTypeUri:t,graphLayout:n}=e;const a=Xn(),l=(0,i.useSelector)(p.ZP.selectors.getEntity),s=((e,t,n)=>{const{layout:o,setLayout:a}=(e=>{const[t,n]=(0,r.useState)(h.YGb.SIMPLE_NETWORK);return(0,r.useEffect)((()=>{const t=Object.values(h.YGb).some((t=>e===t));t&&n(e)}),[e]),{layout:t,setLayout:n}})(n),{graphTypeUri:l,setGraphTypeUri:s}=((e,t,n)=>{const[o,a]=(0,r.useState)(null),l=(0,i.useSelector)(p.ZP.selectors.getMetadata);return(0,r.useEffect)((()=>{(0,h.mmY)(l,e.type).some((e=>{let{uri:n}=e;return t===n}))&&a(t)}),[t,e,l]),{graphTypeUri:o,setGraphTypeUri:e=>{a(e),e||n(h.YGb.SIMPLE_NETWORK)}}})(e,t,a),{graphLoading:c,data:d,graphologyGraph:m,onAddRelation:g,onDeleteRelation:f,onCollapseEntity:b,onExpandEntity:y}=N(e,l,o),{selectedEntity:E,onEntitySelect:w,selectedEntityLoading:C}=((e,t)=>{const n=(0,x._)(),o=(0,i.useDispatch)(),[a,l]=(0,r.useState)(null),s=(0,r.useRef)({}),[c,d]=(0,r.useState)(!1),m=(0,r.useCallback)((e=>{const t=s.current[e];return t?Promise.resolve(t):(0,h.HvW)(e).then((e=>(s.current=I(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,u.propEq)("uri",e));i&&l(i),d(!0),n(m(e)).then(l).catch((e=>{o(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Something went wrong"))))})).finally((()=>{d(!1)}))}),[o,t,n,m]);return(0,r.useEffect)((()=>{null!=e&&e.uri&&(s.current=I({},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=I({},e),g(e.uri)):(s.current={},l(null)))}),[t]),{selectedEntityLoading:c,selectedEntity:a,onEntitySelect:g}})(e,d);return{graphLoading:c,data:d,graphologyGraph:m,selectedEntity:E,selectedEntityLoading:C,graphTypeUri:l,relationshipTable:z({data:d,selectedEntityUri:null==E?void 0:E.uri,mainEntityUri:null==e?void 0:e.uri,graphTypeUri:l}),layout:o,onAddRelation:g,onDeleteRelation:f,onCollapseEntity:b,onExpandEntity:y,onEntitySelect:w,setGraphTypeUri:s,setLayout:a}})(l,t,n),{graphLoading:c,layout:d}=s,b=d===h.YGb.TREE,{tabs:y}={tabs:(0,r.useMemo)((()=>[{buttonProps:{id:ut.Relationship,icon:mt,tooltipTitle:v().text("Relationship"),showForDisabled:!0},content:o().createElement(nt,null)},{buttonProps:{id:ut.EntityDetails,icon:D.Z,tooltipTitle:v().text("Entity Details"),showForDisabled:!0},content:o().createElement(it,null)}]),[])};return o().createElement(H.Provider,{value:s},o().createElement("div",{className:a.perspectiveView},c&&o().createElement(m.Z,null),(null==l?void 0:l.uri)&&o().createElement("div",{className:a.graphContainer},o().createElement(g.n,{disabled:b,perspectiveId:"graph",buttonsProps:(0,u.pluck)("buttonProps",y)},o().createElement("div",{className:a.graphWrapper},o().createElement(f.n,{entity:l}),o().createElement(Wn,null)),o().createElement(pt,{tabs:y})))))}));$n.displayName="GraphPerspectiveView";const Kn=$n,Qn=(0,a.Z)({productionPrefix:"graph",disableGlobal:!0,seed:"grp"}),Jn=e=>{let{store:t,graphTypeUri:n,graphLayout:r}=e;return o().createElement(i.Provider,{store:t},o().createElement(l.ZP,{generateClassName:Qn},o().createElement(c._,{dateAdapter:d.Q},o().createElement(Kn,{graphTypeUri:n,graphLayout:r}),o().createElement(s.Z,{showErrorFromStore:!0}))))}}}]);
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c6413f45-2f4b-4599-8761-814813c29bd3",e._sentryDebugIdIdentifier="sentry-dbid-c6413f45-2f4b-4599-8761-814813c29bd3")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"1.4.1623"},(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6606],{44938:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(24328),o=n.n(r),i=n(50166),a=n(44443),l=n(17512);const s=(0,n(72342).makeStyles)({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){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 u=(0,r.memo)((e=>{let{width:t=0,height:n=0,defaultItemSize:d,data:u,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 R=(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:u.length,itemData:u,itemSize:e=>y[(e=>E(u,e))(e)]||d,itemKey:h},R)}))},33945:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(2507),s=n.n(l),c=n(79573),d=n(50914),u=n(76799);const p=(0,n(72342).makeStyles)({pagination:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"56px",flexShrink:0,borderTop:"1px solid rgba(0,0,0,0.12)",boxShadow:"none",boxSizing:"border-box",overflowY:"hidden",containerType:"inline-size","& .MuiInputBase-root":{display:"none","@container (min-width: 420px)":{display:"inline-flex"}}},caption:{color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px",display:"none","@container (min-width: 420px)":{display:"block"}},displayedRows:{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!important"}});function h(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){m(e,t,n[t])}))}return e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const g=e=>{let{classes:t={},count:n,rowsPerPageOptions:i,page:l,onChangePage:m,rowsPerPage:g,onChangeRowsPerPage:f,basicTableRef:b,labelRowsPerPage:y}=e;const v=p(),x=(0,r.useCallback)((()=>{(0,d.pathOr)(d.identity,["current","resetScrollbarPosition"],b)()}),[b]),E=(0,r.useCallback)((e=>{m(e),x()}),[m,x]),w=(0,r.useCallback)((e=>{m(0),f(e),x()}),[m,f,x]);return o().createElement(u.Z,{classes:h({},t,{root:a()(v.pagination,t.root),select:a()(v.select,t.select),selectLabel:a()(v.caption,t.selectLabel),displayedRows:a()(v.displayedRows,t.displayedRows),input:a()(v.selectRoot,t.selectRoot),actions:v.actions}),backIconButtonProps:{size:"large"},nextIconButtonProps:{size:"large"},component:"div",labelRowsPerPage:y||s().text("Rows per page:"),labelDisplayedRows:e=>{let{from:t,to:n,count:r}=e;return s().text("${fromRow}-${toRow} of ${countRows}",{fromRow:s().number(t,"0,0"),toRow:s().number(n,"0,0"),countRows:s().number(r,"0,0")})},count:n,rowsPerPageOptions:i,page:l,onPageChange:(0,d.pipe)((0,d.nthArg)(1),E),rowsPerPage:g,onRowsPerPageChange:(0,d.pipe)(c.NA,w)})};g.displayName="BasicTablePagination";const f=(0,r.memo)(g)},1469:(e,t,n)=>{n.d(t,{n:()=>y});const r=(0,n(72342).makeStyles)({item:{marginBottom:"16px"},dense:{marginBottom:0}});var o=n(55962),i=n(24328),a=n.n(i),l=n(52730),s=n(50673),c=n(17512),d=n(76141),u=n(71153),p=n.n(u),h=n(50914),m=n(85596),g=n(93555),f=n(72283);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:u=[],outRelationTypes:y=[],showEmptyEditors:v,entityErrorMessage:x,onChangeAttribute:E,onRemoveAttribute:w,onAddAttributes:C,onChangeRelationType:R,onChangeEntity:S}=e;const T=r(),{relation:P,entity:O}=t,{attributes:k,uri:L,type:N="",direction:_}=P||{},I=Boolean(N),j=(0,l.useSelector)(s.ZP.selectors.getMetadata),A=(0,i.useMemo)((()=>P&&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:k},(0,c.p2l)(P))),[P,k]),U=(0,i.useMemo)((()=>(0,c.xF8)(j,N)),[N,j]),z=(0,i.useMemo)((()=>I?(0,c.jWj)(_===c.Nsj.OUT,j,[(0,c.V3K)(j,N)]):(0,h.uniq)((0,c.jWj)(!0,j,y).concat((0,c.jWj)(!1,j,u)))),[I,N,j,u,y]),D=(0,l.useSelector)((e=>s.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),Z=(0,i.useMemo)((()=>P&&{relationType:P.type,direction:P.direction}),[P]),M=(0,i.useMemo)((()=>O&&{entityUri:O.uri,entityType:O.type,entityLabel:(0,c.idV)(O.label)}),[O]),F=(0,i.useMemo)((()=>O&&O.uri?u.filter((0,c.eHk)(!1,O,n,j)):u),[O,u,n,j]),B=(0,i.useMemo)((()=>O&&O.uri?y.filter((0,c.eHk)(!0,O,n,j)):y),[O,y,n,j]);(0,i.useEffect)((()=>{const{type:e,direction:t}=(0,c.z7d)(u,y)||{};!N&&e&&R&&R({type:e.uri,direction:t})}),[N,u,y,R]),(0,o.D)((()=>{const{type:e,direction:t}=(0,c.z7d)(F,B)||{};!N&&e&&R({type:e.uri,direction:t})}),[N,O,F,B,S]);const G=(0,i.useCallback)((e=>{let{type:t,direction:n}=e;R({type:t.uri,direction:n})}),[R]);return a().createElement(a().Fragment,null,R&&a().createElement(m.Z,{className:T.item,relation:Z,metadata:j,inRelationTypes:u,outRelationTypes:y,onChange:G}),S&&a().createElement(g.Z,{errorMessage:x,className:T.item},a().createElement(f.Z,{key:N,className:p()({[T.dense]:x}),entity:M||{},entityTypesUris:z,max:20,globalSearchRequestOptions:D,mode:c.fO_.EDITING,onChange:S,onCreate:void 0,metadata:j,attributeTypesSelectionStrategy:void 0})),N&&a().createElement(d.Z,{attrTypes:U,entity:A,showEmptyEditors:v,mode:c.fO_.EDITING,parentUri:L,onAddAttributes:C,onChangeAttribute:E,onDeleteAttribute:w}))}},20146:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(24328),o=n.n(r),i=n(52730),a=n(71153),l=n.n(a),s=n(79312),c=n(17512),d=n(50673),u=n(40007);const p=(0,n(72342).makeStyles)({"entityType-overflow":{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",marginRight:"12px",borderRadius:"2px",flexShrink:0},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",marginRight:"16px",flexShrink:0}}),h=e=>{let{entity:t,className:n,size:r="small"}=e;const a=p(),h=(0,i.useSelector)(d.ZP.selectors.getMetadata),m=t.type,g=(0,c.nt9)(h,m),f=(g?(0,c.VD3)(h,g,"typeColor"):null)||c.rSc.palette.primary.main,b=(0,c.jFi)(h,t);return o().createElement(u.Z,{value:b,placement:"top"},o().createElement(s.Z,{style:{backgroundColor:f,color:c.P6Y.Colors.getColor(f)?"#FFFFFF":"#212121"},className:l()(a[`entityType-${r}`],a["entityType-overflow"],n),component:"div"},b))}},92934:(e,t,n)=>{n.d(t,{Q:()=>c});var r=n(24328),o=n.n(r),i=n(2507),a=n.n(i),l=n(17512),s=n(72108);const c=(0,r.memo)((e=>{let{entityTypes:t,selectedEntityTypes:n,single:i,placeholder:c,enableEmptyValueUnderline:d,onChange:u,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:d,onChange:u,classes:p,ListLabelProps:h,disabled:m,label:a().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:a().text("Select entity types")})}));c.displayName="EntityTypesSelector"},72108:(e,t,n)=>{n.d(t,{S:()=>N});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(50914),s=n(17512),c=n(53242),d=n(65643),u=n(23883),p=n(72342);const h=(0,p.makeStyles)({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)"}}),m=(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},g=e=>e.join(", "),f=e=>`calc(${(0,l.isNil)(e)?"100%":`${e}px`} - 35px)`,b=e=>{let{list:t,maxWidth:n}=e;const i=h(),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=m(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 c=g(t),d=l>0,p=d?g(t.slice(0,-l)):c;return o().createElement(u.Z,{title:d?c:""},o().createElement("div",{className:i.listLabelContainer},o().createElement("div",{style:{width:f(n)},className:i.listLabel,ref:a},c),o().createElement("div",{className:i.visibleItemsLabel},p),d&&o().createElement("div",{className:i.hiddenCount},`+${l}`)))};var y=n(40435),v=n(22311),x=n(26638),E=n(33117),w=n(94792),C=n(63485);function R(){return R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(this,arguments)}const S=(0,l.always)(32),T=(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(C.Z,R({getItemSize:S,renderItem:(e,i,a)=>{let{item:l}=i;const s=!!t.find((e=>l.uri===e)),c=a===r;return o().createElement(E.Z,{key:l.uri,onClick:n,checked:s,data:l,label:o().createElement(w.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))}));T.displayName="SelectMetadataTypesList";const P=(0,p.makeStyles)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",cursor:"pointer",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","&.Mui-disabled":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px",cursor:"pointer","&$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 O(){return O=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},O.apply(this,arguments)}function k(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}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 N=(0,r.memo)((e=>{let{placeholder:t,classes:n={},items:i,selectedItemsUris:u,onChange:p,ListLabelProps:h={},disabled:m,enableEmptyValueUnderline:g,single:f,label:E,dataReltioId:w,selectionPopupTitle:C}=e;const R=P(),[S,L]=(0,r.useState)(!1),N=(0,r.useCallback)((()=>L(!0)),[]),_=(0,r.useCallback)((()=>L(!1)),[]),[I,j]=(0,r.useState)(""),A=(0,r.useCallback)((()=>j("")),[]),U=(0,r.useCallback)((0,l.pipe)(A,_),[_,A]),z=i.filter((e=>{let{label:t}=e;return s.P6Y.strings.search(t,I)})).map(((e,t)=>({item:{item:k({},e,{filterText:I})},index:t}))),D=(0,r.useMemo)((()=>u.map((e=>i.find((0,l.propEq)("uri",e)))).map((0,l.prop)("label"))),[u,i]),Z=(0,r.useCallback)(((e,t)=>{f?(p(t?[e.uri]:[]),U()):p(t?u.concat(e.uri):u.filter((t=>t!==e.uri)))}),[u,p,f,U]),M=(0,r.useCallback)((e=>{let{item:t}=e;const n=!u.includes(t.uri);Z(t,n)}),[u,Z]),{focusIndex:F,handleKeyDown:B}=(0,x.t)({items:z,open:S,onSelectFocusedItem:M,selectedItems:u,onClose:U}),G=(0,r.useRef)(),q=G.current?G.current.getBoundingClientRect().width:0,H=Math.max(q,255),V=0===u.length;return o().createElement(o().Fragment,null,o().createElement(c.Z,{label:E,ref:G,InputProps:{startAdornment:V&&!t?null:o().createElement("div",{className:a()(R.inputText,n.inputText)},V?o().createElement("div",null,t):o().createElement(b,O({},h,{list:D}))),classes:{root:R.inputRoot,input:a()(R.input,n.input,{[R.emptyInput]:V&&!t}),disabled:a()(R.disabledInput,{[R.disabledPointer]:m}),underline:R.disabledUnderline},endAdornment:o().createElement(y.Z,{size:"L",icon:d.Z,iconClassName:a()(R.icon,{[R["popup-opened-icon"]]:S}),disabled:m}),readOnly:!0,disableUnderline:V&&!g},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:a()(R.inputLabel,n.label)}},value:"",onClick:m?void 0:N,classes:{root:a()(R.root,n.root)},size:"small",variant:"filled",disabled:m,"data-reltio-id":w}),o().createElement(v.Z,{open:S,anchorEl:G.current,onClose:U,onSearch:j,title:C,containerWidth:H,containerHeight:355,searchInputOnKeyDown:B,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${w}-popup`}},o().createElement(T,{items:z,onItemClick:Z,selectedItems:u,width:H,height:245,focusIndex:F})))}));N.displayName="MetadataTypesSelector"},79386:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(52730),s=n(50914),c=n(79312),d=n(23883),u=n(2507),p=n.n(u),h=n(17512),m=n(50673),g=n(37573),f=n(20146);const b=(0,n(72342).makeStyles)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"0px 1px 0px rgba(0, 0, 0, 0.12)",marginBottom:"1px","&: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"}}}))),y=e=>{let{className:t,entity:n,children:i,classes:u,renderLabel:y=s.identity}=e;const v=b({classes:u}),x=(0,l.useSelector)(m.ZP.selectors.getMetadata),E=(0,l.useSelector)(m.ZP.selectors.getShowEntityId),w=(0,r.useCallback)((()=>{navigator.clipboard.writeText((0,h.BTI)(n))}),[n]);if((0,s.isNil)(n))return null;const C=(0,h.idV)(n.label),R=n.secondaryLabel,S=(0,h.ptG)(x,n),T=(0,h.Fn9)(n),P=n.uri,O=(0,h.BTI)(n);return o().createElement("div",{className:a()(v.profileBandWrapper,t)},o().createElement("div",{className:a()(v.profileBand,{[v.inactive]:!T}),"data-entity-uri":P},o().createElement(g.Z,{key:n.uri,entity:n,avatarClassName:v.profileIcon,imageClassName:v.imageProfileIcon}),o().createElement("div",{className:v.profileInfo},o().createElement("div",null,o().createElement(c.Z,{variant:"h6",className:v.label},y(C)),R&&o().createElement(c.Z,{variant:"subtitle2",className:v.secondaryLabel},R),S&&o().createElement(c.Z,{variant:"subtitle1",className:v.businessCard},S)),o().createElement("div",{className:v.specialInfo},o().createElement("div",{className:v.entityType},o().createElement(f.Z,{entity:n,size:"medium",className:v.badge}),!(0,h.ZiX)(P)&&E&&o().createElement(d.Z,{title:p().text("Copy to clipboard")},o().createElement(c.Z,{display:"inline",variant:"body2",className:v.entityId,onClick:w},p().text("Entity ID"),": ",O))))),i&&o().createElement("div",null,i)))}},60883:(e,t,n)=>{n.d(t,{a:()=>U});var r=n(24328),o=n.n(r),i=n(55485),a=n(23468),l=n(31373),s=n(17512),c=n(71153),d=n.n(c),u=n(50914),p=n(2507),h=n.n(p),m=n(49753),g=n(78223),f=n(39475);const b=(0,n(72342).makeStyles)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),y=(0,g.Z)(i.Z),v=e=>{var t;let{className:n,total:i=0,onPrev:c,onNext:p,onSearchResultsClick:g,isPrevDisabled:v,isNextDisabled:x}=e;const E=b(),w=(0,r.useContext)(m.T),{OPEN_RESULTS:C,SEARCH_RESULT:R,SEARCH_RESULTS:S,NEXT_PROFILE:T,PREVIOUS_PROFILE:P}=(0,u.mergeRight)({OPEN_RESULTS:h().text("Go to search results"),SEARCH_RESULT:h().text("Search result"),SEARCH_RESULTS:h().text("Search results"),PREVIOUS_PROFILE:h().text("Go to previous profile"),NEXT_PROFILE:h().text("Go to next profile")},null!==(t=null==w?void 0:w.profileBand)&&void 0!==t?t:{});return o().createElement("div",{className:d()(E.container,n)},o().createElement(y,{className:E.link,component:"button",variant:"caption",onClick:g,underline:"none",tooltipTitle:C},(0,s.k7L)(i,1e6)," ",1===i?R:S),o().createElement(f.k,{size:"L",icon:a.Z,"data-reltio-id":"reltio-previous-profile-button",tooltipTitle:P,onClick:c,disabled:v,showForDisabled:!0}),o().createElement(f.k,{size:"L",icon:l.Z,"data-reltio-id":"reltio-next-profile-button",tooltipTitle:T,onClick:p,disabled:x,showForDisabled:!0}))};var x=n(52730),E=n(50673),w=n(96697),C=n(63532),R=n(98001),S=n(19701);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){P(e,t,n[t])}))}return e}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class O{constructor(e){var t=this;let{data:{query:n,sortField:r,sortOrder:o},tenant:i,searchTenant:a,apiPath:l,dtssPath:c,globalSearchRequestOptions:d}=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=T({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},n);return t.isDT()?(0,s.uqV)({filters:r,options:o,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,s.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,s.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,s.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=c,this.globalSearchRequestOptions=d}}function k(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}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}class N{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,s.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:k({},t.searchBody,{filter:e.length?(0,s.Uqd)()(r):t.searchBody.filter}),options:n})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,s.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,s.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=n,this.tenant=r,this.apiPath=o}}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){I(e,t,n[t])}))}return e}function I(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)=>(0,u.pipe)((0,u.map)((0,u.prop)("uri")),(0,u.reject)((e=>t.includes(e))))(e),A=()=>{const e=(0,S._)(),t=(0,S._)(),n=(0,S._)(),{uri:o,index:i,total:a,tenant:l,cache:c}=(0,x.useSelector)(E.ZP.selectors.getSearchNavigationData)||{},{type:d,data:u}=(0,x.useSelector)(E.ZP.selectors.getSearchProviderData)||{},p=(0,x.useSelector)(E.ZP.selectors.getTenant),h=(0,x.useSelector)(E.ZP.selectors.getApiPath),m=(0,x.useSelector)(E.ZP.selectors.getDtssPath),g=(0,x.useSelector)((e=>E.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),{updateEntitiesNavigationLoadingState:f}=(0,w.M)(),b=(0,r.useContext)(C.m),y=(0,x.useDispatch)(),[v,T]=(0,r.useState)(!1),P=(0,r.useMemo)((()=>((e,t)=>{switch(e){case"search":return new O(t);case"graphsearch":return new N(t)}})(d,{data:u,tenant:p,searchTenant:l,apiPath:h,dtssPath:m,globalSearchRequestOptions:g})),[d,u,p,l,h,m,g]),k=(0,r.useCallback)((e=>{y(E.yC.actions.updateSearchNavigationDataFields(e))}),[y]),L=(0,r.useCallback)((e=>{const t=p!==l?(0,s.wwR)({uri:e,dataTenant:l}):e;y(E.ui.actions.openEntity({uri:t,viewId:b,source:"navigation"}))}),[y,b,p,l]),I=(0,r.useCallback)((()=>{y(E.ui.actions.openPerspective({perspectiveId:d,viewId:b}))}),[y,d,b]);(0,r.useEffect)((()=>{i>=a?k({index:a-1}):i<0&&k({index:0})}),[a,i,k]);const A=(0,R.u)();(0,r.useEffect)((()=>{const e=A(((e,t)=>{switch(e.type){case E.yC.constants.UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE:{const n=E.ZP.selectors.getSearchNavigationData(t);n&&k(((e,t)=>{const{winnerUri:n,losersUris:r=[]}=t,o=((e,t)=>{let{uri:n,index:r,total:o,cache:i}=e;if(t&&t!==n){if(i&&i.includes(n)){i=[...i];const e=i.indexOf(t);let a=i.indexOf(n);e>=0&&(i.splice(e,1),o--,e<a&&r--),a=i.indexOf(n),i.splice(a,1,t)}return n=t,_({},e,{uri:n,index:r,cache:i,total:o})}return e})(e,n);return((e,t)=>{const{cache:n=[],index:r,total:o,uri:i}=e,a=t.filter((e=>n.includes(e)));if(0===a.length)return e;const l=o-a.length,s=n.indexOf(i);let c=r;for(const e of a)n.indexOf(e)<s&&c--;const d=n.filter((e=>!a.includes(e)));return _({},e,{cache:d,index:c,total:l})})(o,r)})(n,e.payload));break}}}));return()=>e()}),[A,k]);const U=(0,r.useCallback)(((e,r,o)=>{T(!0),t(P.requestTotal()).then((e=>k({total:e})));const i=o+1;return n(P.requestEntities(15,i)).then((t=>{if(t){if(t.length){const n=j(t,e);if(n.length>0)return k({cache:e.concat(n),uri:n[0],index:i+t.length-n.length}),void L(n[0]);if(o+t.length<r-1)return U(e,r-t.length,o+t.length)}k({index:i})}})).finally((()=>{T(!1)}))}),[P,k,L]),z=(0,r.useCallback)(((e,r)=>{T(!0),t(P.requestTotal()).then((e=>k({total:e})));const o=r-1,i=Math.max(0,r-15),a=15+Math.min(0,r-15);return n(P.requestEntities(a,i)).then((t=>{if(t){if(t.length){const n=j(t,e);if(n.length>0)return k({cache:n.concat(e),uri:n[n.length-1],index:o-(t.length-n.length)}),void L(n[n.length-1]);if(r-t.length>0)return z(e,r-t.length)}k({index:0})}})).finally((()=>{T(!1)}))}),[P,k,L]),D=(0,r.useCallback)(((t,n,r,o)=>{if(n<t.length){const i=t[n];return T(!0),e(P.checkEntity(i)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),D(e,n,r-1,o)}k({index:o+1,uri:i,cache:t,total:r}),L(i)})).finally((()=>{T(!1)}))}if(!(o>=r-1))return U(t,r,o);k({cache:t,total:r,index:r-1})}),[P,k,L,U]),Z=(0,r.useCallback)(((t,n,r,o)=>{if(n>-1){const i=t[n];return T(!0),e(P.checkEntity(i)).then((e=>{if(!e){const e=[...t];return e.splice(n,1),Z(e,n-1,r-1,o-1)}k({index:o-1,uri:i,cache:t,total:r}),L(i)})).finally((()=>{T(!1)}))}if(!(o<=0))return z(t,o);k({index:0,cache:t,total:r})}),[P,k,L,z]),M=(0,r.useCallback)((()=>{if(c&&o){const e=c.indexOf(o)-1;Z(c,e,a,i)}}),[Z,c,o,a,i]),F=(0,r.useCallback)((()=>{if(c&&o){const e=c.indexOf(o)+1;D(c,e,a,i)}}),[D,c,o,a,i]);return(0,r.useEffect)((()=>{f(v)}),[f,v]),(0,r.useEffect)((()=>()=>f(!1)),[]),{total:a,onPrev:M,onNext:F,onSearchResultsClick:I,isPrevDisabled:v||i<=0,isNextDisabled:v||i>=a-1}},U=e=>{let{className:t}=e;const{total:n,onPrev:r,onNext:i,onSearchResultsClick:a,isPrevDisabled:l,isNextDisabled:c}=A();return(()=>{const{cache:e}=(0,x.useSelector)(E.ZP.selectors.getSearchNavigationData)||{},t=(0,x.useSelector)(E.ZP.selectors.getMode),n=(0,x.useSelector)(E.ZP.selectors.getEntity);return(0,s.uzs)(t)&&(null==e?void 0:e.includes(null==n?void 0:n.uri))})()?o().createElement(v,{className:t,total:n,onPrev:r,onNext:i,onSearchResultsClick:a,isPrevDisabled:l,isNextDisabled:c}):null}},68977:(e,t,n)=>{n.d(t,{U:()=>c});var r=n(24328),o=n.n(r),i=n(2507),a=n.n(i),l=n(17512),s=n(72108);const c=(0,r.memo)((e=>{let{relationTypes:t,selectedRelationTypes:n,single:i,placeholder:c,enableEmptyValueUnderline:d,onChange:u,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:d,onChange:u,classes:p,ListLabelProps:h,disabled:m,label:a().text("Relation type"),dataReltioId:"relation-type-selector",selectionPopupTitle:a().text("Select relation types")})}));c.displayName="RelationTypesSelector"},11802:(e,t,n)=>{n.d(t,{u:()=>h});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(31396),s=n(47746),c=n(17512);const d=(0,n(72342).makeStyles)((()=>({container:{position:"relative","& .Resizer":{zIndex:1,boxSizing:"border-box",backgroundClip:"padding-box","&.disabled":{cursor:"initial",height:0,margin:0},"&.horizontal":{height:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"100% 1px",backgroundPosition:"top",width:"100%",marginBottom:"-10px","&:not(.disabled):hover":{cursor:"row-resize",backgroundImage:"linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))",backgroundSize:"100% 3px"}},"&.vertical":{width:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"1px 100%",backgroundPosition:"left",height:"100%",marginRight:"-10px","&:not(.disabled):hover":{cursor:"col-resize",backgroundImage:"linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))",backgroundSize:"3px 100%"}}}}}))),u=250,p=e=>"horizontal"===e,h=e=>{let{className:t,children:n,orientation:i,primary:h,defaultSize:m,size:g,minSize:f,maxSize:b,allowResize:y,debounceInterval:v=u,onChange:x}=e;const E=d(),w=(0,s.Z)(),[C,R]=(0,r.useState)(null),[S,T]=(0,r.useState)(!0),P=(0,r.useCallback)((()=>T(!0)),[]),O=(0,r.useCallback)((()=>T(!1)),[]),k=()=>p(i)?null==C?void 0:C.clientHeight:null==C?void 0:C.clientWidth,L=(0,r.useCallback)((0,c.DsO)((e=>{const t=k();x({percentageSize:e/t*100+"%",isMaxSize:+b>0?e===b:e===t+b,isMinSize:e===f,size:e})}),v),[x,i,b,C]),N=(0,r.useMemo)((()=>({transition:w.transitions.create(p(i)?"height":"width",{easing:w.transitions.easing.sharp,duration:w.transitions.duration.leavingScreen})})),[i,w]);return"number"==typeof g&&g<0&&(g=(k()||0)+g),o().createElement("div",{ref:R,className:a()(E.container,t)},o().createElement(l.Z,{split:i,size:g,primary:h,allowResize:y,onChange:L,defaultSize:m,minSize:f,maxSize:b,onDragStarted:O,onDragFinished:P,pane1Style:S?N:void 0},n))};h.displayName="ResizablePanes"},67275:(e,t,n)=>{n.d(t,{n:()=>f});var r=n(24328),o=n.n(r),i=n(71153),a=n.n(i),l=n(17512),s=n(79386),c=n(60883),d=n(72316),u=n(1824),p=n(62901),h=n(36852),m=n(75647);const g=(0,n(72342).makeStyles)({profileBandNavigation:{marginBottom:"10px"},comments:{display:"flex",justifyContent:"flex-end"}}),f=(0,r.memo)((e=>{let{entity:t,className:n,historySlice:i}=e;const f=g(),b=(0,r.useMemo)((()=>(0,l.L5S)(t)),[t]),y=(0,h.C)({objectIds:b}),v=(0,l.wwR)(t);return o().createElement(u.e,{collaboration:y},o().createElement(s.Z,{className:a()(n,p.U),entity:(null==i?void 0:i.aEntity)||t},i?o().createElement(m.Z,null):o().createElement(o().Fragment,null,o().createElement(c.a,{className:f.profileBandNavigation}),o().createElement(d.Z,{className:f.comments,uri:v,relatedObjectUris:(0,l.wp9)(l.q7e.ENTITY,{entityUri:v}),objectType:l.q7e.ENTITY}))))}));f.displayName="ScreenProfileBand"},75647:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(24328),o=n.n(r),i=n(52730),a=n(50673),l=n(38677),s=n(79312),c=n(50914),d=n(2507),u=n.n(d);const p=(0,n(72342).makeStyles)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),h=()=>{const e=p(),t=(0,i.useSelector)(a.ZP.selectors.getHistoryEvent),n=(0,i.useDispatch)(),r=(0,c.pipe)(a.N5.history.actions.clearHistoryEvent,n);return t?o().createElement("div",{className:e.root},o().createElement(s.Z,{component:"div"},u().text("You are viewing a historic slice:")," ",o().createElement("span",{className:e.slice},u().date(t.aStamp,"llll"))),o().createElement(l.Z,{className:e.cancelButton,variant:"contained",color:"primary",onClick:r},u().text("Cancel"))):null}},98001:(e,t,n)=>{n.d(t,{G:()=>a,u:()=>l});var r=n(24328),o=n.n(r);const i=(0,r.createContext)(null);i.displayName="ActionsHookContext";const a=e=>{let{children:t,hook:n}=e;return o().createElement(i.Provider,{value:n},t)},l=()=>{const e=(0,r.useContext)(i);if(!e)throw new Error("ActionsHookContext must be provided");return e}},96697:(e,t,n)=>{n.d(t,{f:()=>d,M:()=>u});var r=n(24328),o=n.n(r),i=n(79573);function a(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}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 s=o().createContext({isLoading:!1,updateEntityLoadingState:i.ZT,updateEntitiesNavigationLoadingState:i.ZT,resetLoadingState:i.ZT}),c={entitiesNavigation:!1,entity:!1},d=e=>{let{children:t}=e;const n=(()=>{const[e,t]=(0,r.useState)(c),n=(0,r.useCallback)((e=>{t((t=>a({},t,{entity:e})))}),[]),o=(0,r.useCallback)((e=>{t((t=>a({},t,{entitiesNavigation:e})))}),[]),i=(0,r.useCallback)((()=>{t(c)}),[]);return{isLoading:Object.values(e).includes(!0),updateEntityLoadingState:n,updateEntitiesNavigationLoadingState:o,resetLoadingState:i}})();return o().createElement(s.Provider,{value:n},t)},u=()=>(0,r.useContext)(s)},49753:(e,t,n)=>{n.d(t,{T:()=>o});var r=n(24328);const o=n.n(r)().createContext({profileBand:{}});o.displayName="LabelsContext"},36852:(e,t,n)=>{n.d(t,{C:()=>m});var r=n(24328),o=n(52730),i=n(50914),a=n(17512),l=n(50673);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 d=(e,t)=>t.filter((t=>t.replyId!==e)),u=(e,t)=>{const n=e.replies.findIndex((e=>{let{replyId:n}=e;return n===t.replyId})),r=[...e.replies];return r[n]=t,r},p=[],h=e=>console.error("Collaboration error",e),m=e=>{let{objectIds:t=p,objectTypes:n,enabled:c=!0}=e;const m=(0,o.useSelector)(l.ZP.selectors.getEntity),g=(0,o.useSelector)(l.ZP.selectors.getTenant),f=(0,o.useSelector)(l.ZP.selectors.getCollaborationPath),b=(0,o.useSelector)(l.ZP.selectors.isCollaborationEnabled)&&c,[y,v]=(0,r.useState)(null),[x,E]=(0,r.useState)([]),[w,C]=(0,r.useState)(null),[R,S]=(0,r.useState)(null),[T,P]=(0,r.useState)(!1),[O,k]=(0,r.useState)(!1),[L,N]=(0,r.useState)({}),_=(0,r.useCallback)((e=>{C((t=>s({},t,e)))}),[]),I=null==m?void 0:m.uri,j=(0,r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(b&&I&&!(0,a.ZiX)(I)){const n=e=>{console.warn("Collaboration error",e),C(null)};(0,i.pipe)(a.$oF,(0,i.andThen)((0,i.map)((0,i.props)(["objectId","comments"]))),(0,i.andThen)(i.fromPairs),(0,i.andThen)(t?C:_),(0,i.otherwise)(n))({uris:e,tenant:g,collaborationPath:f})}else C(null)}),[_,f,I,b,g]);(0,r.useEffect)((()=>{j(t,!0)}),[t,j]);const A=(0,r.useCallback)(((e,t)=>{(0,a.liG)({collaborationPath:f,tenant:g,relatedObjectUri:e,pageToken:t}).then((e=>{let{items:n,nextPageToken:r}=e;E((e=>t?(0,i.uniqBy)((0,i.prop)("commentId"),[...e,...n]):n)),v(r)})).catch(h)}),[f,g]),U=(0,r.useCallback)((e=>{k(!0),(0,a.d7q)({collaborationPath:f,tenant:g,commentId:e}).then(S).catch(h).finally((()=>k(!1)))}),[f,g]),z=(0,r.useCallback)((e=>{let{content:t,namedUsers:n,objectType:r,uri:o,relatedObjectUris:i}=e;P(!0);const l={objectId:o,content:t,relatedObjectUris:i,objectType:r,visibility:"public",namedUsers:n,permanentLink:`${window.location.href}&commentId=${encodeURIComponent("{commentId}")}`};return(0,a.Yrx)({collaborationPath:f,tenant:g,data:l}).then((e=>{let[t]=e;return((e,t)=>{S(e),C((n=>s({},n,{[t]:[...n[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),E((t=>[e,...t]))})(t,o)})).catch(h).finally((()=>P(!1)))}),[f,g]),D=(0,r.useCallback)((e=>{let{content:t,namedUsers:n,objectType:r,uri:o,relatedObjectUris:l,commentId:c,replies:d}=e;P(!0);const u={objectId:o,content:t,relatedObjectUris:l,objectType:r,visibility:"public",namedUsers:n,commentId:c,replies:d};return(0,a.uAg)({collaborationPath:f,tenant:g,data:u}).then((e=>(e=>{S(e),E((0,i.map)((0,i.when)((0,i.propEq)("commentId",e.commentId),(0,i.always)(e))))})(s({},e,{replies:d})))).catch(h).finally((()=>P(!1)))}),[f,g]),Z=(0,r.useCallback)((e=>{let{uri:t,commentId:n}=e;P(!0),(0,a.YFy)({collaborationPath:f,tenant:g,commentId:n}).then((()=>((e,t)=>{S(null),C((n=>{const r=n[t]||[];return s({},n,{[t]:r.filter((t=>t.commentId!==e))})})),E((t=>t.filter((t=>t.commentId!==e))))})(n,t))).catch(h).finally((()=>P(!1)))}),[f,g]),M=(0,r.useCallback)(((e,t,n,r)=>{const o="resolve"===e.action?"resolved":"open",{replyId:i}=e;S("resolved"===o?e=>{if(e)return null}:t=>{if(t)return s({},t,{replies:r?d(i,t.replies):[...t.replies,e]})}),C((e=>s({},e,{[t]:(e[t]||[]).map((e=>e.commentId===n?s({},e,{status:o,replies:r?e.replies-1:e.replies+1}):e))}))),E((t=>t.map((t=>t.commentId===n?s({},t,{status:o,replies:r?d(e.replyId,t.replies):[...t.replies,e]}):t))))}),[]),F=(0,r.useCallback)((e=>{let{uri:t,commentId:n,reply:r}=e;P(!0),(0,a.Mfr)({collaborationPath:f,tenant:g,commentId:n,replyId:r.replyId}).then((()=>M(r,t,n,!0))).catch(h).finally((()=>P(!1)))}),[f,M,g]),B=(0,r.useCallback)(((e,t)=>{S((t=>{if(t)return s({},t,{replies:u(t,e)})})),E((n=>n.map((n=>n.commentId===t?s({},n,{replies:u(n,e)}):n))))}),[]),G=(0,r.useCallback)((e=>{let{content:t,namedUsers:n,commentId:r,replyId:o}=e;P(!0);const i={content:t,namedUsers:n};return(0,a.ufV)({collaborationPath:f,tenant:g,commentId:r,replyId:o,data:i}).then((e=>B(e,r))).catch(h).finally((()=>P(!1)))}),[f,g,B]),q=(0,r.useCallback)((e=>{let{content:t,namedUsers:n,commentId:r,action:o,uri:i}=e;P(!0);const l={content:t,action:o,namedUsers:n};return(0,a.PP2)({collaborationPath:f,tenant:g,commentId:r,data:l}).then((e=>{let[t]=e;return M(t,i,r)})).catch(h).finally((()=>P(!1)))}),[f,g,M]),H=(0,r.useCallback)((e=>{let{commentId:t,uri:n}=e;q({content:"",namedUsers:[],commentId:t,action:"resolve",uri:n})}),[q]),V=(0,r.useCallback)((e=>{let{commentId:t,uri:n}=e;q({content:"",namedUsers:[],commentId:t,action:"reopen",uri:n})}),[q]);return{clearCurrentComment:(0,r.useCallback)((()=>{S(null)}),[]),comments:x,commentsMap:w,getCommentState:(e,t)=>(0,i.pathOr)({},[e,t],L),updateCommentState:(e,t,n)=>{N((r=>{const o=[e,t],a=(0,i.path)(o,r);return(0,i.assocPath)(o,(0,i.mergeRight)(a,n),r)}))},clearCommentState:(e,t)=>N((0,i.dissocPath)([e,t])),createComment:z,createReply:q,currentComment:R,deleteComment:Z,editComment:D,getComment:U,getComments:A,getCommentsCount:j,loading:O,objectTypes:n,pageToken:y,reOpenThread:V,resolveThread:H,sending:T,deleteReply:F,editReply:G}}},32794:(e,t,n)=>{n.d(t,{R:()=>d});var r=n(24328),o=n(17512),i=n(50914),a=n(52730),l=n(50673);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 d=e=>{let{connection:t,onConnectionChange:n,relatedEntity:c}=e;const d=(0,a.useSelector)(l.ZP.selectors.getMetadata),u=(0,r.useCallback)((e=>n(s({},t,{relation:e}))),[t,n]),p=(0,r.useCallback)((0,i.pipe)((0,o.zE1)(t.relation),u),[t.relation,u]),h=(0,r.useCallback)((0,i.pipe)((0,o.lIv)(t.relation),u),[t.relation,u]),m=(0,r.useCallback)((0,i.pipe)((0,o.Ilm)(t.relation),u),[t.relation,u]),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,d,(0,o.V3K)(d,r))?t.entity:null,relation:s({},t.relation,{attributes:{},type:r,direction:i})};n(a)}),[t,n,c,d]);return{onAddAttributes:p,onChangeAttribute:h,onRemoveAttribute:m,onChangeEntity:(0,r.useCallback)((e=>n(s({},t,{entity:e}))),[t,n]),onChangeRelationType:g}}},40577:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Jn});var r=n(24328),o=n.n(r),i=n(52730),a=n(54426),l=n(40855),s=n(97333),c=n(41633),d=n(9366),u=n(50914),p=n(50673),h=n(17512),m=n(87378),g=n(3466),f=n(67275),b=n(98996),y=n(2507),v=n.n(y),x=n(19701),E=n(62127),w=n(72942),C=n(60715),R=n(35174);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){T(e,t,n[t])}))}return e}function T(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=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,u.either)((0,u.pipe)(h.nqN,(0,u.equals)(e)),(0,u.pipe)(h.j5q,(0,u.equals)(e))));n.push(...r);const o=(0,u.pipe)(O,(0,u.without)([e]))(r);return o.forEach((e=>P(e,t,n))),n},O=e=>(0,u.pipe)((0,u.chain)((e=>[(0,h.nqN)(e),(0,h.j5q)(e)])),u.uniq)(e),k=(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,h.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})}))},L=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=>L(e,t,n))),n},N=(e,t,n)=>{const[o,a]=(0,r.useState)(null),l=(0,i.useDispatch)(),[s,c]=(0,r.useState)(null),[d,m]=(0,r.useState)(!1),g=null==e?void 0:e.uri,f=(0,h.biM)(e),y=(0,i.useSelector)(p.ZP.selectors.getMetadata),T=(0,x._)(),N=(0,x._)(),_=n===h.YGb.TREE,I=(0,E.D)(n),j=(0,r.useContext)(w.F),A=I===h.YGb.TREE&&_,U=(0,r.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return N((0,h.ZYI)({uri:e,deep:n,limitCreditsConsumption:!0,graphTypes:t?[(0,h.nIW)(t)]:null,activenessDate:null,max:t?200:3e3,signal:j}))}),[t,N,j]);(0,r.useEffect)((()=>(!g||(0,h.ZiX)(g)||f||_||(m(!0),T((0,h.ZYI)({uri:g,deep:t?2:1,limitCreditsConsumption:!0,graphTypes:t?[(0,h.nIW)(t)]:null,activenessDate:null,max:t?200:3e3,signal:j})).then((e=>{const t=new b.MultiGraph;k(t,e),a(t),c(e)})).catch((e=>{console.error(e),c(null),(0,h.D_E)(e)||l(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Something went wrong"))))})).finally((()=>{m(!1)}))),()=>{a(null),c(null),m(!1)})),[g,f,l,t,A]);const z=(0,r.useCallback)((async e=>{let{startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d}=e;try{var f;m(!0);const e=await(0,h.DsR)({startEntityUri:t,endEntityUri:n,relationType:r,attributes:i,startDate:a,endDate:d});if(null==e||null===(f=e[0])||void 0===f||!f.successful)throw null==e?void 0:e[0];const l=e[0].object,p=t===g?l.endObject.objectURI:l.startObject.objectURI,b=await(0,h.HvW)(p,{select:"label"});t===g?l.endObject.label=b.label:l.startObject.label=b.label;const v=((e,t,n)=>{const r=t.startObject.objectURI,o=t.endObject.objectURI,i=[r,o],a=e.entities.map((0,u.prop)("uri")),l=(0,h.V3K)(n,t.type),s=i.find((e=>!(0,u.includes)(e,a))),c=s&&(t.startObject.objectURI===s?t.startObject:t.endObject),d=c&&{type:c.type,label:c.label,uri:c.objectURI,traversedRelations:0,untraversedRelations:1},p=S({},(0,u.pick)(["uri","type","attributes","startDate","endDate","crosswalks","direction"],t),{startObject:(0,u.pick)(["objectURI","directionalLabel"],t.startObject),endObject:(0,u.pick)(["objectURI","directionalLabel"],t.endObject),direction:null==l?void 0:l.direction});return{entities:(d?e.entities.concat([d]):e.entities).map((e=>e.uri===r||e.uri===o?S({},e,{traversedRelations:e.traversedRelations+1}):e)),relations:(e.relations||[]).concat([p])}})(s,l,y);k(o,v);const x=[l.startObject.objectURI,l.endObject.objectURI],E=s.entities.map((0,u.prop)("uri"));x.forEach((e=>{if(E.includes(e)){const t=o.getNodeAttribute(e,"traversedRelationsCount");o.setNodeAttribute(e,"traversedRelationsCount",t+1)}})),c(v)}catch(e){throw l(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Something went wrong")))),e}finally{m(!1)}}),[l,s,o,y]),D=(0,r.useCallback)((e=>{m(!0),(0,h.VGk)(e).then((()=>{o.extremities(e).forEach((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,u.propEq)("uri",t)),i=(0,h.nqN)(o),a=(0,h.j5q)(o),l=(0,R.toUndirected)(n),s=(0,u.cond)([[()=>!(0,C.Ar)(l,e,i),(0,u.always)(i)],[()=>!(0,C.Ar)(l,e,a),(0,u.always)(a)],[u.T,(0,u.always)(null)]])(),c=(0,u.evolve)({entities:(0,u.map)((e=>e.uri===i||e.uri===a?S({},e,{traversedRelations:e.traversedRelations-1}):e)),relations:(0,u.reject)((0,u.propEq)("uri",t))})(r),{updatedData:d,removedEntitiesUris:p}=s?((e,t)=>{const n=P(e,t),r=(0,u.pipe)(O,(0,u.append)(e),u.uniq)(n);return{updatedData:(0,u.evolve)({relations:(0,u.reject)((e=>n.includes(e))),entities:(0,u.reject)((e=>r.includes(e.uri)))})(t),removedEntitiesUris:r}})(s,c):{updatedData:c,removedEntitiesUris:[]};return{updatedData:d,removedEntitiesUris:p}})(g,e,o,s);((e,t)=>{(t||[]).forEach((t=>{e.dropNode(t)}))})(o,n),c(t)})).catch((e=>{l(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Something went wrong"))))})).finally((()=>{m(!1)}))}),[l,o,g,s]),Z=(0,r.useCallback)(((e,t)=>{const{nodes:n=[]}=t,r=(0,u.difference)(o.neighbors(e),n);((e,t,n,r)=>{const o=(0,R.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,C.Ar)(e,t,n)?null:n)(o,e,t)&&a.push(t)})),(0,u.uniq)(a.reduce(((e,t)=>L(t,o,e)),[...a]))})(g,e,r,o).forEach((t=>{t!==g&&t!==e&&o.setNodeAttribute(t,"hidden",!0)}))}),[g,o]),M=(0,r.useCallback)((e=>{if(e&&!(0,h.ZiX)(e)&&!f){const t=o.getNodeAttribute(e,"untraversedRelationsCount");o.neighbors(e).forEach((e=>{o.setNodeAttribute(e,"hidden",!1)})),t>0&&(m(!0),U(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]=S({},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);k(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),(0,h.D_E)(e)||l(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Something went wrong"))))})).finally((()=>{m(!1)})))}}),[s,l,o,f,U]);return{graphLoading:d,data:s,graphologyGraph:o,onAddRelation:z,onDeleteRelation:D,onCollapseEntity:Z,onExpandEntity:M}};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 I=(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){_(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},j=[25,50,100];function A(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,t,n)=>{const{startObject:r,endObject:o,type:i}=t,{directionalLabel:a}=(0,h.nqN)(t)===n?r:o;return a||(0,h.Lmx)(e,i)},z=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),[m,g]=(0,r.useState)(j[0]),[f,b]=(0,r.useState)([]),[y,x]=(0,r.useState)(!1),E=(0,i.useDispatch)(),w=(0,i.useSelector)(p.ZP.selectors.getMetadata),C=(0,r.useMemo)((()=>{const e=(null==t?void 0:t.entities)||[];return(0,u.zipObj)(e.map((0,u.prop)("uri")),e)}),[null==t?void 0:t.entities]),R=(0,r.useMemo)((()=>(0,u.pipe)((0,u.filter)((0,u.either)((0,u.pipe)(h.nqN,(0,u.equals)(n)),(0,u.pipe)(h.j5q,(0,u.equals)(n)))),(0,u.uniqBy)((0,u.prop)("uri")),(0,u.map)((e=>{const t=C[((e,t)=>{const n=(0,h.nqN)(t),r=(0,h.j5q)(t);return n===e?r:n})(n,e)];return{relation:e,entity:t,entityLabel:(0,h.idV)(t.label),entityTypeLabel:(0,h.jFi)(w,t),relationTypeLabel:U(w,e,t.uri)}})))((null==t?void 0:t.relations)||[])),[t,n,C,w]),{searchText:S,onChangeSearchText:T,filters:P,onFilter:O,relationTypesOptions:k,entityTypesOptions:L}=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)({entityTypesUris:[],relationTypesUris:[]}),l=(0,i.useSelector)(p.ZP.selectors.getMetadata),s=(0,r.useMemo)((()=>(0,u.pipe)((0,u.map)((e=>{let{entity:t}=e;return t.type})),(0,u.concat)(u.__,o.entityTypesUris),u.uniq,(0,u.map)((0,h.nt9)(l)))(e)),[e,l,o.entityTypesUris]),c=(0,r.useMemo)((()=>(0,u.pipe)((0,u.map)((e=>{let{relation:t}=e;return t.type})),(0,u.concat)(u.__,o.relationTypesUris),u.uniq,(0,u.map)((0,h.V3K)(l)))(e)),[e,l,o.relationTypesUris]);return{searchText:t,onChangeSearchText:n,filters:o,onFilter:a,entityTypesOptions:s,relationTypesOptions:c}})(R),N=(0,r.useMemo)((()=>(0,u.pipe)((0,u.filter)((e=>{let{entityLabel:t,entity:n,relation:r}=e;const{entityTypesUris:o,relationTypesUris:i}=P;return h.P6Y.strings.search(t,S)&&(0,u.ifElse)((0,u.prop)("length"),(0,u.includes)(r.type),u.T)(i)&&(0,u.ifElse)((0,u.prop)("length"),(0,u.includes)(n.type),u.T)(o)})),l.field?(0,u.sort)(((e,t)=>h.P6Y.strings.sort(l.order,e[l.field],t[l.field]))):u.identity)(R)),[R,l,S,P]),_=(0,r.useMemo)((()=>N.slice(c*m,c*m+m)),[N,c,m]),I=(0,r.useCallback)((e=>{x(!0),(0,h._vs)(e).then((e=>{b((t=>[...t,{initialRelation:e,relation:e}]))})).catch((e=>{E(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Can't load relationship's attributes"))))})).finally((()=>x(!1)))}),[E]),z=(0,r.useCallback)((e=>{b((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){A(e,t,n[t])}))}return e}({},t,{relation:e}):t))))}),[]);(0,r.useEffect)((()=>{d(0),T("")}),[n,a,T,O]),(0,r.useEffect)((()=>{O({entityTypesUris:[],relationTypesUris:[]})}),[a,o,O]),(0,r.useEffect)((()=>{d(0)}),[l,S,P]);const D=(0,r.useCallback)((e=>{b((t=>t.filter((t=>t.relation.uri!==e))))}),[]),Z=(0,r.useCallback)(((e,t)=>{x(!0),(0,h.HH7)({oldRelation:e,newRelation:t}).then((()=>{D(t.uri)})).catch((e=>{E(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Can't edit relationship"))))})).finally((()=>x(!1)))}),[D,E]);return{rowsData:_,onSort:s,sorting:l,searchText:S,onChangeSearchText:T,filters:P,onFilter:O,entityTypesOptions:L,relationTypesOptions:k,editingRelations:f,onStartRelationEditing:I,onCancelRelationEditing:D,onUpdateEditingRelation:z,total:N.length,page:c,rowsPerPage:m,onPageChange:d,onRowsPerPageChange:g,onSaveEditingRelation:Z,loading:y}};var D=n(89025),Z=n(79312),M=n(79573),F=n(33945),B=n(50548),G=n(71153),q=n.n(G);const H=o().createContext({graphLoading:!1,data:null,graphologyGraph:null,selectedEntityLoading:!1,selectedEntity:null,onEntitySelect:()=>{},relationshipTable:{},onCollapseEntity:()=>{},onExpandEntity:()=>{},layout:null,setLayout:()=>{}});H.displayName="GraphStateContext";var V=n(44443),Y=n(44938),W=n(72342);const X="1px solid rgba(0, 0, 0, 0.05)",$=(0,W.makeStyles)({table:{flex:1,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},tableBody:{height:"100%",overflow:"auto"},tableBodyWrapper:{height:"100%",overflow:"hidden"},tableRowWrapper:{borderBottom:X},tableRow:{display:"flex",alignItems:"center","& > div":{flexShrink:0}},editingRow:{paddingTop:"8px",paddingBottom:"8px"},headRow:{borderBottom:X}});function K(){return K=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},K.apply(this,arguments)}const Q=(0,r.memo)((e=>{let{columnsData:t,sorting:n,onSort:r}=e;const i=$();return o().createElement("div",{className:q()(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,M.Dh)(n.order):"asc"})}}:{};return o().createElement("div",{key:t,className:l},o().createElement(s,K({headCellData:e},c)))})))})),J=(0,r.forwardRef)(((e,t)=>{let{classes:n,columnsData:i,rowsData:a,sorting:l,onSort:s,getRowKey:c,ExpandedRowRenderer:d,defaultRowHeight:u}=e;const p=$(),[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:q()(p.tableRowWrapper,null==n?void 0:n.tableRowWrapper)},o().createElement("div",{className:q()(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&&d&&o().createElement(d,{open:a.expanded,rowValue:a}))}),[i,d]),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(Q,{columnsData:i,sorting:l,onSort:s}),o().createElement("div",{className:p.tableBodyWrapper},o().createElement(V.Z,{handleHeight:!0,handleWidth:!0,onResize:f}),o().createElement("div",{className:p.tableBody},o().createElement(Y.Z,{listRef:b,width:h.width,height:h.height,data:a,defaultItemSize:u,itemKey:c,showNotMeasuredItems:!0},g))))})),ee=(0,r.memo)(J);var te=n(92332),ne=n(40007);const re="rgba(238, 238, 238, 1)",oe=(0,W.makeStyles)({tableWithPagination:{flex:1,overflow:"hidden",paddingRight:"1px",display:"flex",flexDirection:"column"},tableContainer:{flex:1,overflow:"hidden"},profileColumn:{minWidth:"180px",flex:3},relationshipTypeColumn:{minWidth:"70px",flex:1},entityTypeColumn:{minWidth:"70px",flex:1},row:{position:"relative","&:hover":{background:re}}});function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ae(e,t,n[t])}))}return e}function ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const le={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"},se=".collapsibleTableRow:hover &",ce=ie({},le,{[se]:{background:`linear-gradient(to right, rgba(238, 238, 238, 0), ${re} 100%)`}}),de=(0,W.makeStyles)((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":ie({},le,{right:"25px",width:"20px"})},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":ce},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",[se]:{visibility:"visible",background:re}},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 ue(){return ue=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},ue.apply(this,arguments)}function pe(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){he(e,t,n[t])}))}return e}function he(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=>{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=de();return o().createElement("div",{className:q()(i.headCell,t)},o().createElement(te.default,ue({},r,{headCellData:pe({},n,{label:o().createElement(ne.Z,{value:n.label},o().createElement("div",{className:i.headLabel},n.label))})})))},ge=(0,r.memo)((e=>{let{value:t="",tooltip:n,onClick:r,className:i}=e;const a=de();return n=n||t,o().createElement(ne.Z,{value:n},o().createElement("div",{className:q()(a.defaultCell,i,{[a.clickable]:!!r}),onClick:r},t))}));var fe=n(37573);const be=(0,B.l)(H,(e=>{let{onEntitySelect:t}=e;return{onClick:t}}),(e=>{let{value:t,rowValue:{entity:n},className:r,onClick:i}=e;const a=de(),l=o().createElement(o().Fragment,null,o().createElement(fe.Z,{entity:n,avatarClassName:a.entityAvatar}),t);return o().createElement(ge,{value:l,tooltip:t,className:q()(a.profileCell,r),onClick:()=>i(n.uri)})}));var ye=n(38677),ve=n(32794),xe=n(1469);const Ee=(0,B.l)(H,((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)(p.ZP.selectors.getMetadata),{relation:m,initialRelation:g}=n,f=(0,r.useMemo)((()=>!(0,u.equals)(g,m)),[m,g]),b=de(),y=(0,r.useCallback)((e=>{let{relation:t}=e;return a(t)}),[a]),x=(0,r.useCallback)((()=>l(m.uri)),[l,m.uri]),E=(0,r.useMemo)((()=>({relation:m})),[m]),{onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:R}=(0,ve.R)({connection:E,onConnectionChange:y});return t?o().createElement("div",{className:b.expandedRow},o().createElement(xe.n,{connection:E,onAddAttributes:w,onChangeAttribute:C,onRemoveAttribute:R}),o().createElement("div",{className:b.actionButtons},o().createElement(ye.Z,{onClick:x},v().text("Cancel")),o().createElement(ye.Z,{color:"primary",disabled:!f,onClick:()=>{(e=>{const t=(0,h.xkB)(d,{relation:{object:e}});return c(p.N5.errors.actions.errorsSet(t)),0===t.length})(m)&&s(g,m)}},v().text("Save")))):null}));var we=n(39475),Ce=n(29754),Re=n(6163),Se=n(22118);const Te=(0,B.l)(H,(0,u.pick)(["onDeleteRelation"]),(e=>{let{uri:t,open:n,onClose:r,onDeleteRelation:i}=e;return o().createElement(Se.Z,{open:n,title:v().text("Do you want to make a clean break?"),content:v().text("To end this relationship, click Delete Relationship. To keep the connection, click Cancel."),saveCaption:v().text("Delete relationship"),discardCaption:v().text("Cancel"),onDiscard:r,onSave:()=>{i(t),r()}})})),Pe=(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(we.k,{icon:Re.Z,size:"XXS",tooltipTitle:v().text("Delete"),"data-reltio-id":"reltio-delete-relation-button",onClick:a}),o().createElement(Te,{open:n,onClose:l,uri:t}))}));Pe.displayName="DeleteRelationButton";const Oe=Pe,ke=(0,B.l)(H,((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=de(),c=(0,i.useSelector)(p.ZP.selectors.getMetadata),d=(0,h.V3K)(c,n),u=(0,h.Z5t)(h.ARY.Editing,d),m=(0,h.Edd)(h.ARY.Editing,d);return o().createElement("div",{className:q()(s.controlsCell,r,{[s.editingMode]:l})},u&&o().createElement(we.k,{className:q()(s.editButton,{[s.hidden]:l}),icon:Ce.Z,size:"XXS",tooltipTitle:v().text("Edit"),"data-reltio-id":"reltio-edit-relationship-button",onClick:()=>a(t)}),m&&o().createElement(Oe,{uri:t}))}));function Le(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){Ne(e,t,n[t])}))}return e}function Ne(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=(e,t)=>t[e].relation.uri||`${e}`,Ie=(0,B.l)(H,(e=>{let{relationshipTable:t}=e;return Le({},t)}),(e=>{let{rowsData:t,sorting:n,onSort:i,total:a,page:l,rowsPerPage:s,onPageChange:c,onRowsPerPageChange:d,editingRelations:u,loading:p}=e;const h=oe(),g=(0,r.useMemo)((()=>[{id:"entityLabel",label:v().text("Profile"),headCellRenderer:me,rowCellValueRenderer:be,sortable:!0,columnClassName:h.profileColumn},{id:"relationTypeLabel",label:v().text("Relationship type"),headCellRenderer:me,rowCellValueRenderer:ge,sortable:!0,columnClassName:h.relationshipTypeColumn},{id:"entityTypeLabel",label:v().text("Entity Type"),headCellRenderer:me,rowCellValueRenderer:ge,sortable:!0,columnClassName:h.entityTypeColumn},{id:"controls",label:"",headCellRenderer:M.Vd,rowCellValueRenderer:ke}]),[h]),f=(0,r.useRef)(null);(0,r.useEffect)((()=>{var e;null===(e=f.current)||void 0===e||e.resetScrollbarPosition()}),[t]);const b=(0,r.useMemo)((()=>t.map((e=>null!=u&&u.some((t=>{var n;return t.initialRelation.uri===(null==e||null===(n=e.relation)||void 0===n?void 0:n.uri)}))?Le({},e,{expanded:!0}):e))),[t,u]),y=(0,r.useMemo)((()=>({tableRow:q()(h.row,"collapsibleTableRow")})),[h]);return o().createElement("div",{className:h.tableWithPagination},o().createElement("div",{className:h.tableContainer},o().createElement(ee,{ref:f,columnsData:g,rowsData:b,sorting:n,onSort:i,getRowKey:_e,ExpandedRowRenderer:Ee,defaultRowHeight:28,classes:y})),a>j[0]&&o().createElement(F.Z,{count:a,rowsPerPageOptions:j,rowsPerPage:s,onChangeRowsPerPage:d,page:l,onChangePage:c,basicTableRef:f}),p&&o().createElement(m.Z,null))}));var je=n(80653),Ae=n(87037),Ue=n(33662);const ze=(0,W.makeStyles)((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}}}))),De=(0,B.l)(H,(0,u.pipe)((0,u.prop)("relationshipTable"),(0,u.pick)(["searchText","onChangeSearchText"])),(e=>{let{searchText:t,onChangeSearchText:n}=e;const r=ze();return o().createElement(Ue.Z,{fullWidth:!0,height:40,autofocus:!1,value:t,onSearch:n,placeholder:v().text("Search profiles"),classes:{input:r.input}})}));var Ze=n(92934),Me=n(68977),Fe=n(69089);const Be=(0,W.makeStyles)((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"}}))),Ge=(0,B.l)(H,(0,u.pipe)((0,u.prop)("relationshipTable"),(0,u.pick)(["onFilter","filters","entityTypesOptions","relationTypesOptions"])),(e=>{let{open:t,onClose:n,filters:i,onFilter:a,entityTypesOptions:l,relationTypesOptions:s}=e;const c=Be(),[d,u]=(0,r.useState)([]),[p,h]=(0,r.useState)([]),m=()=>{u(i.entityTypesUris),h(i.relationTypesUris),n()};return(0,r.useEffect)((()=>{u(i.entityTypesUris),h(i.relationTypesUris)}),[i.entityTypesUris,i.relationTypesUris]),o().createElement(Fe.Z,{classes:{paper:c.dialogPaper},onClose:m,open:t},o().createElement(Z.Z,{className:c.title},v().text("Filter")),o().createElement(Ze.Q,{classes:{root:c.entityTypesSelector},entityTypes:l,selectedEntityTypes:d,enableEmptyValueUnderline:!0,onChange:u}),o().createElement(Me.U,{classes:{root:c.relationTypesSelector},relationTypes:s,selectedRelationTypes:p,enableEmptyValueUnderline:!0,onChange:h}),o().createElement("div",{className:c.footer},o().createElement(ye.Z,{className:c.clearAllButton,onClick:()=>{u([]),h([])}},v().text("Clear All")),o().createElement(ye.Z,{className:c.cancelButton,onClick:m},v().text("Cancel")),o().createElement(ye.Z,{onClick:()=>{a({entityTypesUris:d,relationTypesUris:p}),n()},color:"primary"},v().text("Apply"))))})),qe=(0,W.makeStyles)((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}}))),He=(0,B.l)(H,(0,u.pipe)((0,u.prop)("relationshipTable"),(0,u.pick)(["filters"])),(e=>{let{filters:t}=e;const n=qe(),[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(De,null),o().createElement(Ae.Z,{"data-reltio-id":"reltio-filter-relationship-button",className:n.iconButton,onClick:()=>a(!0),size:"large"},o().createElement(je.Z,{className:c?n.activeFiltersIcon:n.inactiveFiltersIcon})),o().createElement(Ge,{open:i,onClose:()=>a(!1)}))}));var Ve=n(93553),Ye=n(25601),We=n(79811),Xe=n(290),$e=n(35936);const Ke=e=>{const t=(0,i.useSelector)(p.ZP.selectors.getMetadata),{inRelations:n=[],outRelations:o=[]}=(0,r.useMemo)((()=>(0,h.UWq)(t,e,(0,h.d89)(h.ARY.Editing))),[t,e]);return{inRelationTypes:n,outRelationTypes:o}},Qe=(0,W.makeStyles)((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!important",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},attributeList:{paddingTop:"22px"}}))),Je=(0,B.l)(H,(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=Qe(),c=(0,i.useSelector)(p.ZP.selectors.getMetadata),[d,u]=(0,r.useState)({}),{relation:m,entity:g}=d,{type:f,direction:b}=m||{},[y,x]=(0,r.useState)(!1),E=(0,i.useDispatch)();(0,r.useEffect)((()=>{n&&u({relation:{uri:(0,h.ncP)(),type:null,attributes:{}}})}),[n]);const{inRelationTypes:w,outRelationTypes:C}=Ke(null==t?void 0:t.type),R=(0,r.useCallback)((()=>{const e=(0,h.xkB)(c,{relation:{object:m}});return E(p.N5.errors.actions.errorsSet(e)),0===e.length}),[m,c,E]),{onAddAttributes:S,onChangeAttribute:T,onRemoveAttribute:P,onChangeEntity:O,onChangeRelationType:k}=(0,ve.R)({connection:d,onConnectionChange:u,relatedEntity:t});return o().createElement(Fe.Z,{open:n,fullWidth:!0,maxWidth:"sm",onClose:a,classes:{paper:s.dialogPaper}},o().createElement($e.Z,{classes:{root:s.dialogTitle}},o().createElement(Z.Z,{variant:"subtitle1",classes:{root:s.titleText}},v().text("Add relationship"))),o().createElement(Xe.Z,{classes:{root:s.content}},o().createElement(xe.n,{connection:d,onAddAttributes:S,onChangeAttribute:T,onRemoveAttribute:P,relatedEntity:t,inRelationTypes:w,outRelationTypes:C,onChangeRelationType:k,onChangeEntity:O})),o().createElement(We.Z,null,o().createElement(ye.Z,{onClick:a},v().text("Cancel")),o().createElement(ye.Z,{disabled:!(null!=d&&d.entity)||!f||y,color:"primary",onClick:()=>{const{type:e,attributes:n={},startDate:r,endDate:o}=m,i=b===h.Nsj.OUT?t.uri:g.uri,s=b===h.Nsj.OUT?g.uri:t.uri;R()&&(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)})))}},v().text("Add"))))})),et=(0,B.l)(H,(0,u.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;const{inRelationTypes:n,outRelationTypes:i}=Ke(null==t?void 0:t.type),a=n.length+i.length>0,[l,s]=(0,r.useState)(!1);return a&&o().createElement(o().Fragment,null,o().createElement(Ye.K,{"data-reltio-id":"reltio-add-relationship-button",mode:Ye.N.button,label:v().text("Add relationship"),icon:Ve.Z,onClick:()=>{s(!0)}}),o().createElement(Je,{open:l,onClose:()=>{s(!1)}}))})),tt=(0,W.makeStyles)({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}}),nt=()=>{const e=tt();return o().createElement("div",{className:e.wrapper},o().createElement("div",{className:e.caption},o().createElement(Z.Z,{variant:"subtitle1"},v().text("Relationships")),o().createElement(et,null)),o().createElement(He,null),o().createElement(Ie,null))};var rt=n(15177);const ot=(0,W.makeStyles)({noShadowBlock:{boxShadow:"none"},wrapper:{position:"relative",paddingRight:"1px",overflow:"auto"}}),it=(0,B.l)(H,(0,u.pick)(["selectedEntity","selectedEntityLoading"]),(e=>{let{selectedEntity:t,selectedEntityLoading:n}=e;const r=ot();return o().createElement("div",{className:r.wrapper},n&&o().createElement(m.Z,null),o().createElement(rt.Z,{entity:t,caption:v().text("Entity details"),className:r.noShadowBlock}))}));var at=n(11821),lt=n(18527),st=n(79386);const ct=(0,W.makeStyles)((e=>({link:{textDecoration:"none",color:e.palette.primary.main}}))),dt=(0,B.l)(H,(0,u.pick)(["selectedEntity"]),(e=>{let{selectedEntity:t}=e;const n=ct(),r=(0,i.useSelector)(p.ZP.selectors.getEntityUri),a=null==t?void 0:t.uri;return o().createElement(st.Z,{entity:t,renderLabel:e=>r===a?e:o().createElement(lt.Z,{className:n.link,value:(0,h.wwR)(t),screen:"graph"},e)})}));let ut;!function(e){e[e.Relationship=0]="Relationship",e[e.EntityDetails=1]="EntityDetails"}(ut||(ut={}));const pt=(0,r.memo)((e=>{var t;let{active:n,tabs:r}=e;const i=!(0,u.isNil)(n);return o().createElement(at.h,{open:i},o().createElement(dt,null),null===(t=r[n])||void 0===t?void 0:t.content)}));function ht(){return ht=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},ht.apply(this,arguments)}pt.displayName="GraphRightSidePanel";const mt=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",ht({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 gt=n(46339),ft=n(23304),bt=n(64488),yt=n(95372),vt=n.n(yt),xt=n(88586);const Et=e=>e.getContext("2d",{preserveDrawingBuffer:!1,antialias:!1}),wt=e=>{const t=document.createElement("canvas");return t.style.position="absolute",t.setAttribute("class",`sigma-${e}`),t},Ct=(0,r.createContext)({addRenderers:M.ZT,canvases:{}}),Rt=()=>(0,r.useContext)(Ct);Ct.displayName="SigmaCustomRenderersContext";const St=e=>{let{children:t}=e;const n=(()=>{const{container:e,sigma:t}=(0,gt.Vr)(),[n,o]=(0,r.useState)({}),i=(0,r.useRef)({}),a=(0,r.useRef)(0),l=(0,r.useRef)(0),s=(0,r.useCallback)((e=>{o((0,u.mergeLeft)(e))}),[]),c=(0,r.useCallback)((()=>{a.current=e.offsetWidth,l.current=e.offsetHeight;const t=(0,xt.getPixelRatio)();for(const e in i.current){const{canvasElement:n,context:r}=i.current[e];n.style.width=a.current+"px",n.style.height=l.current+"px",n.setAttribute("width",a.current*t+"px"),n.setAttribute("height",l.current*t+"px"),1!==t&&r.scale(t,t)}}),[e.offsetHeight,e.offsetWidth]),d=(0,r.useCallback)((()=>{for(const e in n){const{context:t}=i.current[e];t.clearRect(0,0,a.current,l.current);const{renderer:r}=n[e];r(t)}}),[n]),p=(0,r.useCallback)((()=>{for(const t in n){if(!(0,h.O27)(i.current[t]))continue;const{insertBefore:r}=n[t],o=e.querySelector(".sigma-container"),a=wt(t),l=Et(a);o.insertBefore(a,o.querySelector(`.sigma-${r}`)),i.current[t]={canvasElement:a,context:l},c()}}),[n,e,c]);return(0,r.useEffect)((()=>(t.addListener("beforeRender",p),()=>{t.off("beforeRender",p)})),[t,p]),(0,r.useEffect)((()=>(t.addListener("afterRender",d),()=>{t.off("afterRender",d)})),[t,d]),(0,r.useEffect)((()=>(t.addListener("resize",c),()=>{t.off("resize",c)})),[t,c]),(0,r.useEffect)((()=>{const e=i.current;return()=>{for(const t in e)e[t].canvasElement.remove(),delete e[t]}}),[]),{addRenderers:s,canvases:i.current}})();return o().createElement(Ct.Provider,{value:n},t)},Tt=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,d=t.y-s/2,u=t.y+s/2,p=t.x+(r?0:c),h=p+l+(r?c:0);e.beginPath(),e.moveTo(p,u-i),e.quadraticCurveTo(p,u,p+i,u),e.lineTo(h-i,u),e.quadraticCurveTo(h,u,h,u-i),e.lineTo(h,d+i),e.quadraticCurveTo(h,d,h-i,d),e.lineTo(p+i,d),e.quadraticCurveTo(p,d,p,d+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())},Pt=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&&Tt(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)},Ot=(e,t,n)=>{Tt(e,t,n,!0),Pt(e,t,n,!1)};class kt extends ft.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,xt.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 Lt{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.startsWith("data:image")?t:t+"?not-from-cache"},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 Nt={id:"defaultImage",path:(0,h.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 _t extends ft.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 Lt,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(Nt.id,Nt.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,xt.floatColor)(e.color),r[o++]=e.inactive?1:0,a&&"ready"===a.status||(a=this.imageLoader.images[Nt.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 It=[{id:"expandIcon",path:(0,h.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,h.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 jt extends ft.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 Lt,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])),It.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,d=0;if(s&&(s=1/Math.sqrt(s),c=l*s,d=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,xt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=c,r[o++]=-d,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,xt.floatColor)(e.color),r[o++]=e.buttonSize||0,r[o++]=-c,r[o++]=-d,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 At=n(23193),Ut=n.n(At);class zt extends(Ut()){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,d=t.x,u=t.y,p=(0,xt.floatColor)(n.color),h=d-s,m=u-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++]=d,v[y++]=u,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=1,v[y++]=0,v[y++]=0,v[y++]=d,v[y++]=u,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=0,v[y++]=1,v[y++]=0,v[y++]=d,v[y++]=u,v[y++]=-f,v[y++]=-b,v[y++]=l,v[y++]=p,v[y++]=0,v[y++]=0,v[y]=1}}class Dt extends zt{process(e,t,n,r,o){super.process(t,e,n,r,o)}}var Zt=n(73343),Mt=n.n(Zt);class Ft extends bt.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}",Mt(),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,xt.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,d=t.y,u="doubleArrow"===n.type?e.size||1:0,p=t.size||1,h=(0,xt.floatColor)(n.color),m=c-l,g=d-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++]=-u,x[v++]=i,x[v++]=l,x[v++]=s,x[v++]=-b,x[v++]=-y,x[v++]=h,x[v++]=u,x[v++]=i,x[v++]=c,x[v++]=d,x[v++]=b,x[v++]=y,x[v++]=h,x[v++]=p,x[v++]=i,x[v++]=c,x[v++]=d,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 Bt=e=>{let{children:t}=e;const n=(0,r.useMemo)((()=>({allowInvalidContainer:!0,defaultNodeType:"image",hoverRenderer:Ot,labelRenderer:Pt,nodeProgramClasses:{image:(0,ft.createNodeCompoundProgram)([_t,kt,jt])},edgeProgramClasses:{line:vt(),arrow:(0,bt.createEdgeCompoundProgram)([Ft,zt]),doubleArrow:(0,bt.createEdgeCompoundProgram)([Ft,zt,Dt])},labelFont:"Roboto",labelSize:13,labelColor:{color:"rgba(0, 0, 0, 0.87)"}})),[]);return o().createElement(gt.C6,{graph:b.MultiGraph,style:{background:"transparent"},settings:n},o().createElement(St,null,t))};var Gt=n(28833),qt=n.n(Gt),Ht=n(3660),Vt=n.n(Ht),Yt=n(28301),Wt=n.n(Yt),Xt=n(55962),$t=n(31181);const Kt={[h.MCv.bidirectional]:"doubleArrow",[h.MCv.directed]:"arrow",[h.MCv.undirected]:"line"},Qt=(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,Jt=e=>{let{graph:t,undirectedGraph:n,selectedNode:r,rootNodeUri:o}=e;if(t&&n&&o&&r&&o!==r)try{const e=(0,C.Ar)(n,o,r),i=function(e,t){const n=[],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?"findOutEdge":"findEdge";return t&&t.forEach(((t,o,i)=>{const a=i[o+1];a&&n.push(e[r](t,a,(e=>!!e)))})),n}(t,e);return e?{edges:i,nodes:e}:{}}catch(e){}return{}},en=.4,tn=(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}),nn=(e,t,n,r,o)=>{e.beginPath(),e.moveTo(t+r,n+o),e.lineTo(t+o*en,n-r*en),e.lineTo(t-o*en,n+r*en),e.lineTo(t+r,n+o),e.closePath(),e.fill()};function rn(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){on(e,t,n[t])}))}return e}function on(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function an(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){ln(e,t,n[t])}))}return e}function ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sn=(0,u.memoizeWith)(((e,t,n)=>n.type),h.uie),cn={size:24,buttonSize:8,buttonOffset:[19,19]},dn={size:12,buttonSize:6,buttonOffset:[8,13]},un=e=>{let{data:t,graph:n,syncLayout:o,workerLayout:a,layoutSettings:l,selectedNode:s,isDirected:c=!1,onNodeClick:d,onNodeCollapse:u,onNodeExpand:m,filters:g}=e;const f=(0,gt.Ys)(),b=(0,gt.sG)(),y=(0,gt.$j)(),v=(0,gt.eP)(),{selfRelationsPathsMap:x,selfRelationLoopsCanvas:E}=(e=>{const t=(0,gt.Ys)(),{addRenderers:n,canvases:o}=Rt(),i=(0,r.useRef)({}),{selfRelationLoops:a}=o;return(0,r.useEffect)((()=>{n({selfRelationLoops:{renderer:n=>{e.forEachEdge(((e,r,o)=>{if(r.loop){delete i.current[e];const r=t.getEdgeDisplayData(e),a=t.getNodeDisplayData(o);if(r.hidden||a.hidden)return;const l=((e,t,n)=>{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);e.strokeStyle=o,e.lineWidth=r;const d=new Path2D;if("arrow"===t.type||"doubleArrow"===t.type){if(e.fillStyle=o,"doubleArrow"===t.type){const t=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return tn(e.x2,e.y2,i,t,n,r,o)})(c,a,l,s,r*i*2.2);nn(e,t.aX,t.aY,t.vX,t.vY),d.moveTo(t.aX,t.aY)}else d.moveTo(a,l);const n=((e,t,n,r,o)=>{const i=Math.sqrt(Math.pow(t-e.x1,2)+Math.pow(n-e.y1,2));return tn(e.x1,e.y1,i,t,n,r,o)})(c,a,l,s,r*i*2.2);d.bezierCurveTo(c.x2,c.y2,c.x1,c.y1,n.aX,n.aY),e.stroke(d),nn(e,n.aX,n.aY,n.vX,n.vY)}else d.moveTo(a,l),d.bezierCurveTo(c.x1,c.y1,c.x2,c.y2,a,l),e.stroke(d);return d})(n,rn({},r,{size:t.scaleSize(r.size)}),rn({},a,t.framedGraphToViewport(a),{size:t.scaleSize(a.size)}));i.current[e]=l}}))},insertBefore:"edges"}})}),[n,e,t]),{selfRelationsPathsMap:i.current,selfRelationLoopsCanvas:a}})(n),w=((e,t,n)=>{const o=(0,gt.Ys)(),i=(0,gt.$j)(),{addRenderers:a}=Rt(),l=(0,r.useRef)({x:0,y:0}),[s,c]=(0,r.useState)(null),[d,u]=(0,r.useState)(null),p=s||d;return(0,r.useEffect)((()=>{i({enterEdge:e=>{let{edge:t}=e;c(t)},leaveEdge:()=>{c(null)},mousemove:e=>{if(l.current.x=e.x,l.current.y=e.y,!t)return;const{context:r,canvasElement:o}=t,{x:i,y:a}=((e,t)=>{const n=e.getBoundingClientRect();return{x:(t.clientX-n.left)/(n.right-n.left)*e.width,y:(t.clientY-n.top)/(n.bottom-n.top)*e.height}})(o,e.original);for(const e in n){const t=n[e];if(r.isPointInStroke(t,i,a)){u(e);break}u(null)}}})}),[o,i,t,n]),(0,r.useEffect)((()=>{a({tooltips:{renderer:t=>{e.forEachEdge(((e,n,r)=>{const i=o.getEdgeDisplayData(e),a=o.getNodeDisplayData(r);if(!i.hovered||a.highlighted)return;const{x:s,y:c}=l.current;((e,t,n,r)=>{e.font="normal 10px Roboto",e.textAlign="center",e.textBaseline="middle";const o=e.measureText(r).width+16,i=t-o/2,a=n-12;e.fillStyle="rgba(0, 0, 0, 0.54)",((e,t,n,r,o,i)=>{e.beginPath(),e.moveTo(t,n+4),e.arcTo(t,n+24,t+4,n+24,4),e.arcTo(t+r,n+24,t+r,n+24-4,4),e.arcTo(t+r,n,t+r-4,n,4),e.arcTo(t,n,t,n+4,4),e.fill()})(e,i,a,o),e.fillStyle="#fff",e.fillText(r,i+o/2,a+12)})(t,s,c-15,i.relationLabel)}))},insertBefore:"mouse"}})}),[a,e,o]),p})(n,E,x),C=(0,i.useSelector)(p.ZP.selectors.getEntity),S=(0,i.useSelector)(p.ZP.selectors.getMetadata),T=(0,i.useSelector)(p.ZP.selectors.getAbsoluteImagePath)||"",[P,O]=(0,r.useState)(void 0),[k,L]=(0,r.useState)(null),[N,_]=(0,r.useState)({}),I=null==C?void 0:C.uri;(0,r.useEffect)((()=>{f.getCamera().setState({ratio:1.2})}),[n,f]),(0,r.useEffect)((()=>{if(L((0,R.toUndirected)(n)),b(n),o){const e=o(f.getGraph(),l);(0,$t.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,b,c]),(0,r.useEffect)((()=>{const e=Jt({graph:f.getGraph(),undirectedGraph:k,selectedNode:s,rootNodeUri:I});_(e)}),[s,I,f,k]),(0,r.useEffect)((()=>{y({enterNode:e=>{let{node:t}=e;O(t)},leaveNode:()=>{O(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)return;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=Qt(e.x,e.y,r.x+o,r.y-i,a),s=Qt(e.x,e.y,r.x+o,r.y+i,a);if(n.showExpand&&l&&(m(t),d(t)),n.showCollapse&&s){const e=Jt({graph:f.getGraph(),undirectedGraph:k,selectedNode:t,rootNodeUri:I});u(t,e),d(t)}}})}),[f,y,d,u,m,I,k]),(0,r.useEffect)((()=>{const e=f.getGraph();let t;try{t=e.neighbors(s)}catch(e){}v({nodeReducer:(n,r)=>{const{entityTypesUris:o=[]}=g||{},i=sn(S,T,{type:r.entityTypeUri}),a=e.neighbors(n),l=a.map((t=>e.getNodeAttribute(t,"hidden"))).filter((e=>!!e)).length,c=(N.nodes||[]).includes(n),d=P===n,u=n===I,p=n===s,h=t&&!t.includes(n)&&s!==n&&s!==I&&!c,m=![s,I].includes(n)&&o.length>0&&!o.includes(r.entityTypeUri),f=an({},r,n===s?cn:dn,{color:"#0072CE",image:i,showExpand:r.untraversedRelationsCount>0||l>0,showCollapse:r.traversedRelationsCount>1&&a.length-l>1});return c||p||u?(f.inPath=!0,f.color=u?"#00FFFF":r.color):h&&(f.label=d?r.label:"",f.inactive=!0),d&&(f.highlighted=!0),m&&(f.hidden=!0),f},edgeReducer:(t,n)=>{const{relationTypesUris:r=[]}=g||{},o=an({},n,{hidden:!1}),i=(N.edges||[]).includes(t),a=(0,h.V3K)(S,n.relationTypeUri),l=(0,h.oSN)(S,a,"typeColor"),d=s&&s!==I&&!e.hasExtremity(t,s)&&!i||r.length>0&&!r.includes(n.relationTypeUri);var u;return l&&(o.color=l),w===t&&(o.hovered=!0),d&&(o.hidden=!0),c&&(o.arrowSizeRatio=4),i&&(o.color="#0072CE",o.size=4,o.arrowSizeRatio=c?1.4:n.arrowSizeRatio),o.type=(u=c?n.direction:h.MCv.undirected,Kt[u]||"line"),o.relationLabel=(0,h.idV)(null==a?void 0:a.label),o},enableEdgeHoverEvents:!0})}),[f,v,P,s,N,I,S,T,c,g,w])};function pn(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){hn(e,t,n[t])}))}return e}function hn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mn=e=>{let{data:t,graph:n,selectedNode:o,layout:i,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}=e;const d=(0,E.D)(t);(0,Xt.D)((()=>{if(d){const e=(0,u.difference)(t.entities.map((0,u.prop)("uri")),d.entities.map((0,u.prop)("uri")));if(e.length){const t=n.copy();qt().assign(t),e.forEach((e=>{n.setNodeAttribute(e,"x",t.getNodeAttribute(e,"x")),n.setNodeAttribute(e,"y",t.getNodeAttribute(e,"y"))}))}}}),[t]);const p=(0,r.useMemo)((()=>(qt().assign(n),{settings:pn({},Vt().inferSettings(n),{gravity:1})})),[n]);return un({workerLayout:Wt(),layoutSettings:p,data:t,graph:n,selectedNode:o,onNodeClick:a,isDirected:i===h.YGb.DIRECTED_NETWORK,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var gn=n(36039);const fn=(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},bn=(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)?bn(o,t,n,r):t},yn=(e,t,n,r,o)=>{if(e.length<=o&&(t[r]=[...e]),e.length>o){const i=e.slice(o),a=e.slice(0,o);t[r]=a,t[r+1]=n[r+1]?[...n[r+1],...i]:i}if(t[r+1]||n[r+1]){const e=t[++r]||n[r];return yn(e,t,n,r,o)}return t},vn=e=>{let{quantityAtLvl:t,rowNumber:n,isEvenItem:r,layout:o,shouldUseCheckboardPattern:i}=e;const a=o===h.YGb.VERTICAL_TB;return i&&a&&r&&1!==t?10*n+5:10*n},xn=e=>{let{quantityAtLvl:t,posAtLvl:n,max:r,isEvenRow:o,layout:i,shouldUseCheckboardPattern:a}=e;const l=i===h.YGb.HORIZONTAL_LR;return t===r?a&&o&&l?10*n+5:10*n:1===t?10*(r-1)/2:10*(r-1)/(t+1)*(n+1)},En=e=>e<100;function wn(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 d=(0,r.useCallback)((e=>{const t=e.copy(),n=(e=>{switch(e){case h.YGb.VERTICAL_TB:return 180;case h.YGb.HORIZONTAL_LR:return 270}})(i),r=(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),a=r.nodes.length,l=!En(a),s=((e,t)=>{if(En(e))return 10;const n=t===h.YGb.VERTICAL_TB?1.5:.7;return Math.round(Math.sqrt(e)*n)})(a,i),c=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;const r=e.nodes,o=e.edges.filter((e=>e.from!==e.to)),i=fn(o,r,t),a=bn(i,[],new Set,o);return yn(a[0],[],a,0,n)}(r,o,s),d=(e=>{const t=e.map((e=>e.length));return Math.max(...t)})(c);for(let e=0;e<c.length;++e){const n=e%2==0,r=c[e].length;for(let o=0;o<r;++o){const a=o%2==0,s=xn({quantityAtLvl:r,posAtLvl:o,max:d,isEvenRow:n,layout:i,shouldUseCheckboardPattern:l}),u=vn({quantityAtLvl:r,rowNumber:e,isEvenItem:a,layout:i,shouldUseCheckboardPattern:l});t.setNodeAttribute(c[e][o],"x",s),t.setNodeAttribute(c[e][o],"y",u)}}return gn.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){wn(e,t,n[t])}))}return e}({},e,{[t]:{x:r,y:o}})}),{})}),[i,o]);return un({syncLayout:d,data:t,graph:n,selectedNode:o,onNodeClick:a,onNodeCollapse:l,onNodeExpand:s,filters:c}),null};var Rn=n(84425);const Sn=(0,W.makeStyles)({graphTypeSelector:{minWidth:"200px",backgroundColor:"#FAFAFA",opacity:1,height:"40px"},filledInputRoot:{borderRadius:"4px"},valueContainer:{width:"auto",marginLeft:"16px"}}),Tn=(0,B.l)(H,(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;return{setGraphTypeUri:n,graphTypeUri:t}}),(e=>{let{graphTypeUri:t,setGraphTypeUri:n}=e;const a=Sn(),l=(0,i.useSelector)(p.ZP.selectors.getMetadata),s=(0,i.useSelector)(p.ZP.selectors.getEntity),c=(0,r.useMemo)((()=>[{label:v().text("All"),value:null},...(0,h.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(Rn.Z,{classes:{valueContainer:a.valueContainer},className:a.graphTypeSelector,height:42,label:v().text("Graph type"),value:d,options:c,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:a.filledInputRoot}}}})})),Pn=(0,W.makeStyles)({graphLayoutSelector:{minWidth:"202px",backgroundColor:"#FAFAFA",opacity:1,marginLeft:"10px"},filledInputRoot:{borderRadius:"4px",height:"42px"}}),On=(0,r.memo)((e=>{let{value:t,onChangeHandler:n,graphTypeUri:r}=e;const i=Pn(),a=[{label:v().text("Simple network"),value:h.YGb.SIMPLE_NETWORK},{label:v().text("Vertical hierarchy"),value:h.YGb.VERTICAL_TB},{label:v().text("Horizontal hierarchy"),value:h.YGb.HORIZONTAL_LR},{label:v().text("Directed network"),value:h.YGb.DIRECTED_NETWORK},{label:v().text("Tree"),value:h.YGb.TREE}],l=r?a:a.filter((e=>e.value!==h.YGb.TREE));return o().createElement(Rn.Z,{className:i.graphLayoutSelector,label:v().text("Graph layout"),value:a.find((0,u.propEq)("value",t)),options:l,onChange:e=>n(e.value),TextFieldProps:{InputProps:{disableUnderline:!0,classes:{root:i.filledInputRoot}}}})})),kn=()=>{const e=(0,gt.Ys)(),t=(0,r.useCallback)((()=>{e.refresh()}),[e]);return o().createElement(V.Z,{handleWidth:!0,onResize:t})};var Ln=n(81087),Nn=n(16844);function _n(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){In(e,t,n[t])}))}return e}function In(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jn="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)",An={background:"#FFFFFF",boxShadow:jn,width:"28px",height:"28px"},Un=(0,W.makeStyles)({container:{display:"flex",alignItems:"center"},maxButton:_n({},An,{borderRadius:"2px 4px 4px 2px"}),minButton:_n({},An,{borderRadius:"4px 2px 2px 4px"}),thumb:{boxShadow:jn,borderRadius:"2px",width:"8px",height:"28px",marginLeft:"5px",color:"rgba(0,0,0,0.54)",backgroundColor:"#FFFFFF","&.MuiSlider-thumb.Mui-focusVisible, &:hover":{boxShadow:jn},"&:before":{boxShadow:"none"}},thumbIcon:{transform:"rotate(90deg)"},icon:{width:"18px",height:"18px"},rail:{opacity:1,height:"4px",paddingRight:"10px",marginTop:"1px"},sliderRoot:{color:"#EDEDED",marginRight:"10px",height:"2px"}});const zn=e=>Math.pow(100/e,2),Dn=e=>100/Math.sqrt(e),Zn=e=>{const{children:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},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"]),r=Un();return o().createElement(Nn.gs,n,t,o().createElement(Ln.Z,{className:q()(r.icon,r.thumbIcon)}))},Mn=e=>{let{className:t,max:n,min:i}=e;const a=Un(),l=(0,gt.eP)(),s=(0,gt.$j)(),c=(0,gt.Ys)().getCamera(),{zoomIn:d,zoomOut:p}=(0,gt.AH)({factor:1.2}),[h,m]=(0,r.useState)((0,u.clamp)(i,n,Dn(c.getState().ratio))),g=(0,r.useMemo)((()=>i>0?zn(i):null),[i]),f=(0,r.useMemo)((()=>n>0?zn(n):null),[n]);return(0,r.useEffect)((()=>(l({maxCameraRatio:g,minCameraRatio:f}),()=>{l({maxCameraRatio:null,minCameraRatio:null})})),[l,f,g]),(0,r.useEffect)((()=>{s({updated:e=>m(Dn(e.ratio))})}),[s]),o().createElement("div",{className:q()(a.container,t)},o().createElement(Ae.Z,{className:a.minButton,onClick:()=>p(),size:"large"},o().createElement(Ln.Z,{className:a.icon})),o().createElement(Nn.ZP,{slots:{thumb:Zn},slotProps:{thumb:{className:a.thumb}},classes:{root:a.sliderRoot,rail:a.rail},track:!1,value:h,min:i,max:n,onChange:(e,t)=>c.setState({ratio:c.getBoundedRatio(zn(t))})}),o().createElement(Ae.Z,{className:a.maxButton,onClick:()=>d(),size:"large"},o().createElement(Ve.Z,{className:a.icon})))};var Fn=n(35299);const Bn=(0,W.makeStyles)({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"}}),Gn=e=>{let{node:t}=e;const n=Bn(),{gotoNode:r}=(0,gt.AH)();return o().createElement(Ae.Z,{className:n.button,onClick:()=>r(t),size:"large"},o().createElement(Fn.Z,{className:n.icon}))};var qn=n(91572);const Hn=(0,W.makeStyles)({hierarchyTree:{position:"relative",width:"calc(100% - 190px)",margin:"80px 95px 0",height:"calc(100% - 100px)"}}),Vn=e=>{var t;let{graphTypeUri:n}=e;const a=Hn(),{store:l}=(0,r.useContext)(i.ReactReduxContext),s=(0,i.useSelector)(p.ZP.selectors.getMetadata),c=(0,i.useSelector)(p.ZP.selectors.getEntity),d=null===(t=(0,h.mmY)(s,c.type).find((0,u.propEq)("uri",n)))||void 0===t?void 0:t.label,m=(0,r.useMemo)((()=>({id:"___graphView___",class:h.ZIY.HierarchyTree,graph:{type:n},caption:d})),[d,n]);return o().createElement(qn.HierarchyTreeView,{config:m,store:l,className:a.hierarchyTree,isGraphView:!0})},Yn=(0,W.makeStyles)({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"}}),Wn=(0,B.l)(H,(e=>{let{data:t,graphologyGraph:n,selectedEntity:r,onEntitySelect:o,onCollapseEntity:i,onExpandEntity:a,relationshipTable:{filters:l},graphTypeUri:s,layout:c,setLayout:d}=e;return{data:t,graph:n,selectedNode:null==r?void 0:r.uri,onNodeSelect:o,onNodeCollapse:i,onNodeExpand:a,filters:l,graphTypeUri:s,layout:c,setLayout:d}}),(e=>{let{data:t,graph:n,selectedNode:r,onNodeSelect:i,onNodeCollapse:a,onNodeExpand:l,filters:s,graphTypeUri:c,layout:d,setLayout:u}=e;const p=Yn(),m={data:t,graph:n,selectedNode:r,layout:d,onNodeClick:i,onNodeCollapse:a,onNodeExpand:l,filters:s};return o().createElement("div",{className:p.wrapper},o().createElement("div",{className:p.selectors},o().createElement(Tn,null),o().createElement(On,{value:d,onChangeHandler:u,graphTypeUri:c})),o().createElement("div",{className:p.graph},d===h.YGb.TREE?o().createElement(Vn,{graphTypeUri:c}):n&&o().createElement(Bt,null,o().createElement(o().Fragment,null,o().createElement(kn,null),d===h.YGb.SIMPLE_NETWORK||d===h.YGb.DIRECTED_NETWORK?o().createElement(mn,m):o().createElement(Cn,m),o().createElement("div",{className:p.rightBottomControls},o().createElement(Mn,{className:p.zoomSlider,min:30,max:300}),o().createElement(Gn,{node:r}))))))})),Xn=(0,W.makeStyles)((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)((e=>{let{graphTypeUri:t,graphLayout:n}=e;const a=Xn(),l=(0,i.useSelector)(p.ZP.selectors.getEntity),s=((e,t,n)=>{const{layout:o,setLayout:a}=(e=>{const[t,n]=(0,r.useState)(h.YGb.SIMPLE_NETWORK);return(0,r.useEffect)((()=>{const t=Object.values(h.YGb).some((t=>e===t));t&&n(e)}),[e]),{layout:t,setLayout:n}})(n),{graphTypeUri:l,setGraphTypeUri:s}=((e,t,n)=>{const[o,a]=(0,r.useState)(null),l=(0,i.useSelector)(p.ZP.selectors.getMetadata);return(0,r.useEffect)((()=>{(0,h.mmY)(l,e.type).some((e=>{let{uri:n}=e;return t===n}))&&a(t)}),[t,e,l]),{graphTypeUri:o,setGraphTypeUri:e=>{a(e),e||n(h.YGb.SIMPLE_NETWORK)}}})(e,t,a),{graphLoading:c,data:d,graphologyGraph:m,onAddRelation:g,onDeleteRelation:f,onCollapseEntity:b,onExpandEntity:y}=N(e,l,o),{selectedEntity:E,onEntitySelect:w,selectedEntityLoading:C}=((e,t)=>{const n=(0,x._)(),o=(0,i.useDispatch)(),[a,l]=(0,r.useState)(null),s=(0,r.useRef)({}),[c,d]=(0,r.useState)(!1),m=(0,r.useCallback)((e=>{const t=s.current[e];return t?Promise.resolve(t):(0,h.HvW)(e).then((e=>(s.current=I(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,u.propEq)("uri",e));i&&l(i),d(!0),n(m(e)).then(l).catch((e=>{o(p.ui.actions.errorSet((0,h.xU7)(e,v().text("Something went wrong"))))})).finally((()=>{d(!1)}))}),[o,t,n,m]);return(0,r.useEffect)((()=>{null!=e&&e.uri&&(s.current=I({},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=I({},e),g(e.uri)):(s.current={},l(null)))}),[t]),{selectedEntityLoading:c,selectedEntity:a,onEntitySelect:g}})(e,d);return{graphLoading:c,data:d,graphologyGraph:m,selectedEntity:E,selectedEntityLoading:C,graphTypeUri:l,relationshipTable:z({data:d,selectedEntityUri:null==E?void 0:E.uri,mainEntityUri:null==e?void 0:e.uri,graphTypeUri:l}),layout:o,onAddRelation:g,onDeleteRelation:f,onCollapseEntity:b,onExpandEntity:y,onEntitySelect:w,setGraphTypeUri:s,setLayout:a}})(l,t,n),{graphLoading:c,layout:d}=s,b=d===h.YGb.TREE,{tabs:y}={tabs:(0,r.useMemo)((()=>[{buttonProps:{id:ut.Relationship,icon:mt,tooltipTitle:v().text("Relationship"),showForDisabled:!0},content:o().createElement(nt,null)},{buttonProps:{id:ut.EntityDetails,icon:D.Z,tooltipTitle:v().text("Entity Details"),showForDisabled:!0},content:o().createElement(it,null)}]),[])};return o().createElement(H.Provider,{value:s},o().createElement("div",{className:a.perspectiveView},c&&o().createElement(m.Z,null),(null==l?void 0:l.uri)&&o().createElement("div",{className:a.graphContainer},o().createElement(g.n,{disabled:b,perspectiveId:"graph",buttonsProps:(0,u.pluck)("buttonProps",y)},o().createElement("div",{className:a.graphWrapper},o().createElement(f.n,{entity:l}),o().createElement(Wn,null)),o().createElement(pt,{tabs:y})))))}));$n.displayName="GraphPerspectiveView";const Kn=$n,Qn=(0,a.Z)({productionPrefix:"graph",disableGlobal:!0,seed:"grp"}),Jn=e=>{let{store:t,graphTypeUri:n,graphLayout:r}=e;return o().createElement(i.Provider,{store:t},o().createElement(l.ZP,{generateClassName:Qn},o().createElement(c._,{dateAdapter:d.Q},o().createElement(Kn,{graphTypeUri:n,graphLayout:r}),o().createElement(s.Z,{showErrorFromStore:!0}))))}}}]);
2
2
  //# sourceMappingURL=6606.js.map