@reltio/remotes 1.4.1386 → 1.4.1387
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/9211.js +1 -1
- package/9211.js.map +1 -1
- package/package.json +1 -1
package/9211.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[9211],{27815:(e,t,n)=>{n.d(t,{Z:()=>O});var r=n(24328),o=n.n(r),a=n(87918),l=n.n(a),i=n(71153),s=n.n(i),c=n(17440),u=n(52730),d=n(59431),p=n(90088),m=n(94079),g=n(92575),f=n(37285),h=n(96808),b=n(7785),y=n(79692);function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){E(e,t,n[t])}))}return e}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const x={input:e=>v({},e,{fontSize:"14px"}),menuPortal:e=>v({},e,{zIndex:1300})},w=(0,y.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},dropDownInput:{width:"100%",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.03)",borderTop:"4px"},option:{fontSize:"14px",height:"32px"},noOptionsMessage:{fontSize:"14px"}});const O=e=>{let{entityType:t,selectedAttributes:n,className:a,onChange:i,title:y,disableUnderline:v,menuPlacement:E="bottom"}=e;const O=(0,u.useSelector)(d.ZP.selectors.getMetadata),C=w(),S=(0,r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.reduce(((e,r)=>{if(r.hidden)return e;const o=`${n&&n+" / "}${r.label}`;e.push({label:r.label,value:r.uri,attrType:r,chipLabel:o,level:t});const a=(0,p.EUG)(O,r);return e.concat(a?S(a,t+1,o):[])}),[])}),[O]),P=(0,r.useMemo)((()=>S((null==t?void 0:t.attributes)||[])),[t,S]);return o().createElement("div",{className:s()(C.root,a)},o().createElement(m.Typography,{className:C.title,variant:"subtitle1"},y||l().text("Attribute")),o().createElement(g.Z,{value:n,options:P,TextFieldProps:{InputProps:{disableUnderline:v},classes:{root:C.dropDownInput}},components:{DropdownIndicator:h.Z,MultiValue:e=>{let{data:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["data"]);return o().createElement(f.Z,n,t.chipLabel)},Option:e=>{let{isFocused:t,isSelected:n,data:r,label:a,innerProps:l}=e;return o().createElement("div",l,o().createElement(b.Z,{checked:n,level:r.level,data:r,label:a,labelInText:a,isFocused:t}))}},onChange:(0,c.pipe)((0,c.defaultTo)([]),i),styles:x,classes:C,menuPlacement:E,menuPortalTarget:document.body}))}},10237:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(27556),o=n(13980),a=n.n(o),l=n(24328),i=n.n(l);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,n(79692).Z)((e=>({"basic-view__paper":s({display:"flex",flexDirection:"column"},e.basicView)})));function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}const p=(0,l.forwardRef)(((e,t)=>{let{children:n,className:o}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children","className"]);const l=u();return i().createElement(r.Z,d({ref:t,className:o,classes:{root:l["basic-view__paper"]}},a),n)}));p.displayName="BasicView",p.propTypes={children:a().node,className:a().string};const m=p},39621:(e,t,n)=>{n.d(t,{Z:()=>g});var r=n(24328),o=n.n(r),a=n(17440),l=n(87918),i=n.n(l),s=n(6782),c=n(94079),u=n(31517),d=n(31276);const p=(0,n(79692).Z)({root:{display:"flex",flex:1},input:{height:"100%",paddingLeft:"12px",paddingRight:"8px",fontSize:"14px"},inputNumber:{minWidth:"60px",marginRight:10,height:"100%",backgroundColor:"rgba(0, 0, 0, 0.03)"},inputUnit:{width:"100%"}}),m=[i().text("minutes"),i().text("hours"),i().text("days"),i().text("weeks"),i().text("months"),i().text("years")],g=e=>{let{interval:[t,n],onChange:r,onFocus:l}=e;const i=p(),g=(0,a.pipe)(d.NA,parseInt,(e=>[e,n]),r),f=(0,a.pipe)((e=>{let{value:n}=e;return[t,n]}),r);return o().createElement("div",{className:i.root},o().createElement(c.TextField,{type:"number",value:t||"",onChange:g,inputProps:{min:1,onFocus:l},InputProps:{classes:{root:i.input}},className:i.inputNumber}),o().createElement(u.Z,{label:"",placeholder:(0,s.Z)(n),className:i.inputUnit,value:{value:n,label:(0,s.Z)(n)},options:m.map((e=>({value:e,label:(0,s.Z)(e)}))),onChange:f,TextFieldProps:{inputProps:{onFocus:l},InputProps:{classes:{root:i.input}}}}))}},2256:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(24328),o=n.n(r);class a extends o().Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e}),console.error(e)}render(){const{children:e,error:t}=this.props;return this.state.error?t:e}}},85451:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(24328),o=n.n(r),a=n(52730),l=n(87918),i=n.n(l),s=n(17440),c=n(71153),u=n.n(c),d=n(94079),p=n(92575),m=n(96808),g=n(90088),f=n(59431),h=n(79692);function b(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){y(e,t,n[t])}))}return e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const v={input:e=>b({},e,{fontSize:"14px"}),loadingMessage:e=>b({},e,{fontSize:"14px"}),menuPortal:e=>b({},e,{zIndex:1300})},E=(0,h.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},dropDownInput:{width:"100%",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.03)",borderTop:"4px"},option:{fontSize:"14px",height:"32px"}}),x=e=>{let{selectedUsers:t,onChange:n,className:l,disableUnderline:c}=e;const h=E(),b=e=>({value:e,label:e}),y=e=>e.map(b),x=(0,a.useSelector)(f.ZP.selectors.getTenant),w=(0,a.useSelector)(f.ZP.selectors.getServicesPath),O=(0,r.useRef)();return o().createElement("div",{className:u()(h.root,l)},o().createElement(d.Typography,{className:h.title,variant:"subtitle1"},i().text("User")),o().createElement(p.Z,{value:y(t),onChange:(0,s.pipe)((0,s.defaultTo)([]),(0,s.pluck)("value"),n),defaultOptions:!0,getOptions:e=>(O.current||(O.current=(0,g.kz_)({tenant:x,servicesPath:w})),O.current.then((0,s.pipe)((0,s.prop)("array"),(0,s.pluck)("username"),(e=>t=>e?t.filter((t=>g.P6Y.strings.search(t,e))):t)(e),y))),TextFieldProps:{InputProps:{disableUnderline:c},className:h.dropDownInput},components:{DropdownIndicator:m.Z},styles:v,classes:h,menuPortalTarget:document.body}))}},31537:(e,t,n)=>{let r;n.d(t,{I:()=>r}),function(e){e.MODEL_UPDATED="MODEL_UPDATED",e.ENTITY_REMOVED="ENTITY_REMOVED",e.ENTITY_CREATED="ENTITY_CREATED",e.ENTITY_CHANGED="ENTITY_CHANGED",e.ENTITIES_MERGED="ENTITIES_MERGED",e.ENTITIES_SPLITTED="ENTITIES_SPLITTED",e.ENTITY_LOST_MERGE="ENTITY_LOST_MERGE",e.RELATIONSHIP_CREATED="RELATIONSHIP_CREATED",e.RELATIONSHIP_REMOVED="RELATIONSHIP_REMOVED",e.RELATIONSHIP_CHANGED="RELATIONSHIP_CHANGED",e.POTENTIAL_MATCHES_FOUND="POTENTIAL_MATCHES_FOUND",e.NOT_MATCHES_SET="NOT_MATCHES_SET",e.NOT_MATCHES_RESET="NOT_MATCHES_RESET",e.PERIODIC_TASK_SCHEDULED="PERIODIC_TASK_SCHEDULED",e.ENTITIES_MERGED_MANUALLY="ENTITIES_MERGED_MANUALLY",e.POTENTIAL_MATCHES_REMOVED="POTENTIAL_MATCHES_REMOVED",e.ENTITIES_MERGED_ON_THE_FLY="ENTITIES_MERGED_ON_THE_FLY",e.USER_LOGIN="USER_LOGIN",e.USER_LOGOUT="USER_LOGOUT",e.USER_SEARCH="USER_SEARCH",e.USER_PROFILE_VIEW="USER_PROFILE_VIEW",e.COMMENT_ADDED="COMMENT_ADDED",e.COMMENT_UPDATED="COMMENT_UPDATED",e.COMMENT_DELETED="COMMENT_DELETED",e.ANALYTICS_ATTRIBUTES_CHANGED="ANALYTICS_ATTRIBUTES_CHANGED",e.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE="SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE",e.GROUP_CREATED="GROUP_CREATED",e.GROUP_REMOVED="GROUP_REMOVED",e.GROUP_CHANGED="GROUP_CHANGED"}(r||(r={}))},34606:(e,t,n)=>{n.d(t,{te:()=>d,Io:()=>p,rx:()=>m,_V:()=>g,Xr:()=>f});var r=n(90088),o=n(17440),a=n(87918),l=n.n(a),i=n(31537);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,o.path)(["data","type"]),d=e=>{const{items:t,label:n}=e,[r]=t||[];return u(r)||n},p=e=>{const{items:t,label:n}=e,r=e=>{return t=u(e)||n,(0,o.pipe)(o.values,(0,o.includes)(t))(i.I);var t},a=(0,o.filter)(r)(t);return t.length!==a.length&&console.error("Activities not implemented:",(0,o.reject)(r)(t)),s({},e,{items:a,itemsTotal:a.length})},m=e=>(0,o.pipe)((0,o.propOr)([],"items"),(0,o.groupBy)(u),o.values,(0,o.ifElse)((e=>{let{length:t}=e;return t>1}),(0,o.map)((t=>s({},e,{items:t,itemsTotal:t.length}))),(()=>[e])))(e),g=(e,t,n,a)=>{const l=(0,r.zeJ)(n,t),i=(0,r.PFL)(l),s=(0,r.mB6)({attributePresentations:a,dataTypeDefinition:i});return(0,o.isNil)(e)?"":"string"==typeof e?l?s(e):e:Object.entries(e).flatMap((e=>{let[o,l]=e;return l.map((e=>g(e.value,(0,r.tCm)(t,o),n,a)))})).join(", ")},f=e=>({[i.I.COMMENT_ADDED]:l().text("Comment added"),[i.I.COMMENT_DELETED]:l().text("Comment deleted"),[i.I.COMMENT_UPDATED]:l().text("Comment updated"),[i.I.ENTITIES_MERGED]:l().text("Profile merged"),[i.I.ENTITIES_MERGED_MANUALLY]:l().text("Profile merged manually"),[i.I.ENTITIES_MERGED_ON_THE_FLY]:l().text("Profile merged on the fly"),[i.I.ENTITIES_SPLITTED]:l().text("Profile un-merged"),[i.I.ENTITY_CHANGED]:l().text("Profile updated"),[i.I.ENTITY_CREATED]:l().text("Profile created"),[i.I.ENTITY_LOST_MERGE]:l().text("Profile lost merge"),[i.I.ENTITY_REMOVED]:l().text("Profile removed"),[i.I.GROUP_CHANGED]:l().text("Group updated"),[i.I.GROUP_CREATED]:l().text("Group created"),[i.I.GROUP_REMOVED]:l().text("Group removed"),[i.I.MODEL_UPDATED]:l().text("Model was updated"),[i.I.NOT_MATCHES_RESET]:l().text("Not matches reset"),[i.I.NOT_MATCHES_SET]:l().text("Not matches set"),[i.I.PERIODIC_TASK_SCHEDULED]:l().text("Periodic task was scheduled"),[i.I.POTENTIAL_MATCHES_FOUND]:l().text("Potential matches found"),[i.I.POTENTIAL_MATCHES_REMOVED]:l().text("Potential matches removed"),[i.I.RELATIONSHIP_CHANGED]:l().text("Relationship updated"),[i.I.RELATIONSHIP_CREATED]:l().text("Relationship created"),[i.I.RELATIONSHIP_REMOVED]:l().text("Relationship removed"),[i.I.USER_LOGIN]:l().text("Logged in"),[i.I.USER_LOGOUT]:l().text("Logged out"),[i.I.USER_PROFILE_VIEW]:l().text("Profile viewed"),[i.I.USER_SEARCH]:l().text("Searched"),[i.I.ANALYTICS_ATTRIBUTES_CHANGED]:l().text("Analytics attribute changed"),[i.I.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE]:l().text("SFDC connector synchronization issue")}[e]||"")},51843:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(24328),o=n.n(r),a=n(95038),l=n.n(a),i=n(87918),s=n.n(i),c=n(17440),u=n(90088),d=n(94079),p=n(96808),m=n(82943);const g=(0,n(79692).Z)({root:{flex:1},dropdownIndicator:{transition:"transform .15s ease"},inputRoot:{fontSize:"14px",height:46},input:{padding:"0 12px 0"},dateOptionLabel:{minWidth:"100px"},paper:{minWidth:"112px"}}),f=l().localeData().longDateFormat("L"),h=e=>{let{values:t,onChange:n,onFocus:a}=e;const l=f,i=(0,r.useRef)(null),[h,b]=(0,r.useState)(!1),y=g(),v=(0,r.useCallback)((()=>{b((e=>!e)),a()}),[a]),E=()=>{b(!1)};return o().createElement("div",{className:y.root},o().createElement(d.TextField,{fullWidth:!0,value:t.map((e=>((e,t)=>(0,c.isNil)(e)?`${t}`:`${(0,u.mB6)({dataTypeDefinition:{type:u.oS0.TYPE_ACTIVENESS_DATE}},e)}`)(e,l))).join(" — "),onClick:v,variant:"filled",ref:i,InputProps:{endAdornment:o().createElement(p.Z,{selectProps:{classes:y,menuIsOpen:h},innerProps:{}}),disableUnderline:(0,c.isNil)(t),readOnly:!0,classes:{root:y.inputRoot,input:y.input}},InputLabelProps:{shrink:!1},placeholder:s().text(`${l} — ${l}`)}),o().createElement(d.Menu,{variant:"menu",open:h,autoFocus:!1,classes:{paper:y.paper},anchorEl:i.current,onClose:E,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},elevation:2,getContentAnchorEl:null,MenuListProps:{autoFocusItem:h,style:{width:"100%"}}},o().createElement(m.Z,{values:t,onCancel:E,onApply:e=>{n(e),b(!1)},type:u.oS0.TYPE_ACTIVENESS_DATE})))}},67885:(e,t,n)=>{let r,o;n.d(t,{K:()=>r,o:()=>o}),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(r||(r={})),function(e){e.INIT="init",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}(o||(o={}))},96617:(e,t,n)=>{n.r(t),n.d(t,{HierarchyTreeView:()=>ur});var r={};n.r(r),n.d(r,{MIN_NODE_CONTENT_WIDTH:()=>Y,nodeContentRenderer:()=>B,rowHeight:()=>X,scaffoldBlockPxWidth:()=>Q,slideRegionSize:()=>K,treeNodeRenderer:()=>$});var o=n(8598),a=n(24328),l=n.n(a),i=n(44443),s=n(71153),c=n.n(s),u=n(17440),d=n(87918),p=n.n(d),m=n(94079),g=n(13980),f=n.n(g),h=n(83348),b=n(93416);function y(){return y=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},y.apply(this,arguments)}const v=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return l().createElement("svg",y({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),l().createElement("defs",null,l().createElement("path",{d:"M12 7c2.762 0 5 2.238 5 5s-2.238 5-5 5-5-2.238-5-5 2.238-5 5-5zm0 2a3 3 0 100 6 3 3 0 100-6zm8.94 2A8.994 8.994 0 0013 3.06V1h-2v2.06A8.994 8.994 0 003.06 11H1v2h2.06A8.994 8.994 0 0011 20.94V23h2v-2.06A8.994 8.994 0 0020.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z",id:"svg2250934887a"})),l().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},l().createElement("mask",{id:"svg2250934887b",fill:"#fff"},l().createElement("use",{xlinkHref:"#svg2250934887a"})),l().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2250934887b)",d:"M0 0h24v24H0z"})))};function E(){return E=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},E.apply(this,arguments)}const x=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return l().createElement("svg",E({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),l().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},l().createElement("path",{d:"M14.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm4 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm-17 1a1.5 1.5 0 110-3 1.5 1.5 0 010 3zM4 4a2 2 0 110-4 2 2 0 010 4zm1 16a2 2 0 110-4 2 2 0 010 4zm4.5-6a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm0-2a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm6 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3z",fill:"#000"})))};var w=n(79692);const O=(0,w.Z)((()=>({header:{padding:"0 4px 0 16px"},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"},icon:{width:"24px",height:"24px"},disabledIcon:{opacity:.54}}))),C=(0,h.Z)(m.IconButton),S=e=>{let{title:t,entityLabel:n="",onScrollToCurrentEntity:r,onGraphOpen:o,disabled:a=!1}=e;const i=O(),s=c()(i.icon,{[i.disabledIcon]:a});return l().createElement(b.Z,{title:t,className:i.header},l().createElement("div",{className:i.buttonsContainer},l().createElement(C,{tooltipTitle:p().text("Show Graph"),onClick:o,classes:{root:i.button,label:s},disabled:a,showForDisabled:!0},l().createElement(x,null)),l().createElement(C,{tooltipTitle:p().text("Scroll to ${node}",{node:n}),tooltipPlacement:"bottom-end",onClick:r,classes:{root:i.button,label:s},disabled:a,showForDisabled:!0},l().createElement(v,null))))};S.propTypes={title:f().string,entityLabel:f().string,total:f().number,onScrollToCurrentEntity:f().func,onGraphOpen:f().func,disabled:f().bool};const P=S;var N=n(52730),T=n(90088);const k=(0,w.Z)((e=>({textField:{marginLeft:e.spacing(),marginRight:e.spacing(),width:200},panel:{display:"flex",flexGrow:1,flexDirection:"column",minHeight:"372px",maxHeight:"507px"},treeWrapper:{flexGrow:1,height:0,marginTop:7},checkedNode:{backgroundColor:"rgba(0,114,206, 0.12)"},editorNode:{overflow:"hidden","&:hover":{backgroundColor:"transparent !important"},"&:hover div.rst__moveHandle":{visibility:"hidden"},"& div.rst__rowLabel":{paddingRight:0}}})));var R=n(12335);const I=(0,w.Z)((()=>({container:{display:"flex",flexDirection:"column",height:"100%"},root:{minHeight:"28px",display:"flex",padding:"0 18px","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"},wordBreak:"break-all"},tree:{flexGrow:1,height:0}})));var D=n(92898),j=n(21113),Z=n(30634),L=n(58600),M=n(14940);function A(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}function _(){return _=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_.apply(this,arguments)}function U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){H(e,t,n[t])}))}return e}function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class z extends a.Component{render(){const e=this.props,{scaffoldBlockPxWidth:t,toggleChildrenVisibility:n,connectDragPreview:r,connectDragSource:o,isDragging:a,canDrop:i,canDrag:s,node:c,title:u,subtitle:d,draggedNode:g,path:f,treeIndex:h,isSearchMatch:b,isSearchFocus:y,buttons:v,className:E,style:x,didDrop:w,treeId:O,isOver:C,parentNode:S,rowDirection:P}=e,N=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["scaffoldBlockPxWidth","toggleChildrenVisibility","connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","node","title","subtitle","draggedNode","path","treeIndex","isSearchMatch","isSearchFocus","buttons","className","style","didDrop","treeId","isOver","parentNode","rowDirection"]),T=u||c.title,k=d||c.subtitle,R="rtl"===P?"rst__rtl":null;let I;s&&(I="function"==typeof c.children&&c.expanded?l().createElement("div",{className:"rst__loadingHandle"},l().createElement("div",{className:"rst__loadingCircle"},[...new Array(12)].map(((e,t)=>l().createElement("div",{key:t,className:A("rst__loadingCirclePoint",R)}))))):o(l().createElement("div",{className:"rst__moveHandle"},l().createElement(m.Tooltip,{title:p().text("Drag node")},l().createElement(M.Z,null))),{dropEffect:"copy"}));const D=g&&j.ZP.isDescendant(g,c),Z=!w&&a,L=n&&!c.root&&!c.cycled&&(c.children&&c.children.length>0||c.pending);return l().createElement("div",_({style:{height:"100%"}},N,{key:c.nodeId}),L&&c.expanded&&!a&&l().createElement("div",{style:{width:t-2},className:A("rst__lineChildren",R)}),l().createElement("div",{className:A("rst__rowWrapper",R)},r(l().createElement("div",{className:A("rst__row",Z&&"rst__rowLandingPad",Z&&!i&&"rst__rowCancelPad",b&&"rst__rowSearchMatch",y&&"rst__rowSearchFocus",R,E),style:U({opacity:D?.5:1},x)},I,l().createElement("div",{className:A("rst__rowContents",!s&&"rst__rowContentsDragDisabled",R)},L?l().createElement("div",{className:"rst__buttonWrapper",onClick:()=>{n({node:c,path:f,treeIndex:h})}},l().createElement("div",{"aria-label":c.expanded?"Collapse":"Expand",className:A(c.expanded?"rst__collapseButton":"rst__expandButton",R)})):l().createElement("div",{className:A("rst__buttonWrapper","rst__noButton")}),l().createElement("div",{className:A("rst__rowLabel",R)},l().createElement("div",{className:A("rst__rowTitle",c.subtitle&&"rst__rowTitleWithSubtitle")},"function"==typeof T?T({node:c,path:f,treeIndex:h}):T),k&&l().createElement("span",{className:"rst__rowSubtitle"},"function"==typeof k?k({node:c,path:f,treeIndex:h}):k)),l().createElement("div",{className:"rst__rowToolbar"},v.map(((e,t)=>l().createElement("div",{key:t,className:"rst__toolbarButton"},e)))))),{offsetX:0,offsetY:0})))}}z.defaultProps={isSearchMatch:!1,isSearchFocus:!1,canDrag:!1,toggleChildrenVisibility:null,buttons:[],className:"",style:{},parentNode:null,draggedNode:null,canDrop:!1,title:null,subtitle:null,rowDirection:"ltr"},z.propTypes={node:f().shape({}).isRequired,title:f().oneOfType([f().func,f().node]),subtitle:f().oneOfType([f().func,f().node]),path:f().arrayOf(f().oneOfType([f().string,f().number])).isRequired,treeIndex:f().number.isRequired,treeId:f().string.isRequired,isSearchMatch:f().bool,isSearchFocus:f().bool,canDrag:f().bool,scaffoldBlockPxWidth:f().number.isRequired,toggleChildrenVisibility:f().func,buttons:f().arrayOf(f().node),className:f().string,style:f().shape({}),connectDragPreview:f().func.isRequired,connectDragSource:f().func.isRequired,parentNode:f().shape({}),isDragging:f().bool.isRequired,didDrop:f().bool.isRequired,draggedNode:f().shape({}),isOver:f().bool.isRequired,canDrop:f().bool,rowDirection:f().string};const B=z,F=(0,a.createContext)({generateTreeNodeProps:void 0});function V(){return V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(this,arguments)}function W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){G(e,t,n[t])}))}return e}function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}F.displayName="TreeThemeContext";class q extends a.Component{render(){const e=this.props,{children:t,listIndex:n,swapFrom:r,swapLength:o,swapDepth:i,scaffoldBlockPxWidth:s,lowerSiblingCounts:c,connectDropTarget:u,isOver:d,draggedNode:p,canDrop:m,treeIndex:g,treeId:f,getPrevRow:h,node:b,path:y,rowDirection:v}=e,E=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children","listIndex","swapFrom","swapLength","swapDepth","scaffoldBlockPxWidth","lowerSiblingCounts","connectDropTarget","isOver","draggedNode","canDrop","treeIndex","treeId","getPrevRow","node","path","rowDirection"]),x="rtl"===v?"rst__rtl":null,w=c.length,O=[];let C;c.forEach(((e,t)=>{let a="";if(e>0?a=t===w-1?"rst__lineHalfHorizontalRight rst__lineFullVertical":"rst__lineFullVertical":t===w-1&&(a="rst__lineHalfVerticalTop rst__lineHalfHorizontalRight"),O.push(l().createElement("div",{key:`pre_${1+t}`,style:{width:s},className:A("rst__lineBlock",a,x)})),g!==n&&t===i){let e,a="";a=n===r+o-1?"rst__highlightBottomLeftCorner":g===r?"rst__highlightTopLeftCorner":"rst__highlightLineVertical",e="rtl"===v?{width:s,right:s*t}:{width:s,left:s*t},O.push(l().createElement("div",{key:t,style:e,className:A("rst__absoluteLineBlock",a,x)}))}}));const S=s*w;C="rtl"===v?{right:S}:{left:S},C=W({},C,{width:`calc(100% - ${S}px`});const P=`${S+Y}px`,N=W({},E.style,{width:P}),T=this.context&&this.context.generateTreeNodeProps&&this.context.generateTreeNodeProps(this.props);return u(l().createElement("div",V({},E,{className:A("rst__node",b.root&&"rst__root",x,T&&T.treeNodeClassName,!!p&&p.nodeId!==b.nodeId&&"rst_node_hover_disabled"),style:N}),O,l().createElement("div",{className:"rst__nodeContent",style:C},a.Children.map(t,(e=>(0,a.cloneElement)(e,{isOver:d,canDrop:m,draggedNode:p}))))))}}q.contextType=F,q.defaultProps={swapFrom:null,swapDepth:null,swapLength:null,canDrop:!1,draggedNode:null,rowDirection:"ltr"},q.propTypes={treeIndex:f().number.isRequired,treeId:f().string.isRequired,swapFrom:f().number,swapDepth:f().number,swapLength:f().number,scaffoldBlockPxWidth:f().number.isRequired,lowerSiblingCounts:f().arrayOf(f().number).isRequired,listIndex:f().number.isRequired,children:f().node.isRequired,connectDropTarget:f().func.isRequired,isOver:f().bool.isRequired,canDrop:f().bool,draggedNode:f().shape({}),getPrevRow:f().func.isRequired,node:f().shape({}).isRequired,path:f().arrayOf(f().oneOfType([f().string,f().number])).isRequired,rowDirection:f().string};const $=q,Y=250,Q=16,X=28,K=50,J=f().shape({nodeId:f().oneOfType([f().number,f().string]),children:f().arrayOf((()=>J)),showParents:f().bool,expanded:f().bool,pending:f().bool,cycled:f().bool}),ee=f().shape({nodeId:f().oneOfType([f().number,f().string]),entity:T.pyR,relation:T.uTS,relations:f().arrayOf(T.uTS),total:f().number,parent:f().arrayOf(f().string),directParentUri:f().string,children:f().arrayOf((()=>ee)),loading:f().bool,expanded:f().bool,showParents:f().bool,cycled:f().bool,pending:f().bool}),te=f().number,ne=f().shape({root:ee,graphTypes:f().string,entitiesMap:f().object,title:f().string,activenessDate:te,scrollTo:ee,loading:f().bool}),re=e=>{let{measure:t,registerChild:n,NodeRenderer:r,node:o,treeIndex:i}=e;return(0,a.useEffect)(t,[i]),l().createElement(r,{measure:t,registerChild:n,node:o})};re.propTypes={measure:f().func,registerChild:f().func,NodeRenderer:f().func,node:J,treeIndex:f().number};const oe=e=>{const t=(e=>document.querySelector(`[data-node-id="${e}"]`))(e);t?t.scrollIntoView({block:"nearest",inline:"start"}):setTimeout((()=>oe(e)),0)},ae=e=>{let{node:t}=e;return t.nodeId},le=e=>{let{node:t}=e;return t.title||null};function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){se(e,t,n[t])}))}return e}function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ce=(0,u.pick)(["nodeContentRenderer","treeNodeRenderer","scaffoldBlockPxWidth","rowHeight","slideRegionSize"],r),ue=e=>{let{NodeRenderer:t=le,root:n,scrollToNode:r,onChange:o,onRequestChildren:s,canDrag:c=!1,canDrop:d,onScroll:p=u.identity,onNodeMoved:m=u.identity,inlineRoot:g}=e;const f=I(),h=(0,a.useMemo)((()=>{const e=n&&n.children||[];return g?[(0,u.pipe)((0,u.omit)(["children"]),(0,u.assoc)("root",!0))(n),...e]:e}),[n,g]),b=(0,a.useRef)(null),y=(0,a.useRef)(null);y.current=h;const v=((e,t)=>{const n=(0,a.useCallback)((n=>{const r=j.ZP.getVisibleNodeInfoAtIndex({treeData:e.current,index:n,getNodeKey:t});return t({node:(0,u.propOr)({nodeId:-1},"node",r)})}),[t,e]),[r]=(0,a.useState)(new R.t1({fixedWidth:!0,defaultHeight:X,minHeight:X,keyMapper:n})),o=(0,a.useCallback)((()=>{r.clearAll()}),[]);return(0,a.useEffect)((()=>(window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)})),[o]),r})(y,ae);(0,D.q)((()=>{setTimeout((()=>{const e=E();e&&e.forceUpdateGrid()}),0)}),n),(0,a.useEffect)((()=>{if(n&&r){const e=j.ZP.find({treeData:h,getNodeKey:ae,searchFocusOffset:0,searchQuery:"",searchMethod:e=>{let{node:t}=e;return t===r}}),t=(0,u.path)(["matches",0,"treeIndex"],e),n=E();n&&null!=t&&(n.scrollToRow(t),setTimeout((()=>{oe(r.nodeId)}),500))}}),[n,h,r]);const E=()=>(0,u.path)(["current","wrappedInstance","current"],b),x=(0,a.useCallback)((e=>{o&&o(ie({},n,{children:g?e.slice(1):e}))}),[o,n,g]),w=(0,a.useCallback)((e=>{let{node:n,treeIndex:r}=e;return l().createElement(R.Z8,{cache:v,columnIndex:0,key:ae({node:n}),rowIndex:r,parent:E()},(e=>{let{NodeRenderer:t,node:n,treeIndex:r}=e;return e=>{let{measure:o,registerChild:a}=e;return l().createElement(re,{NodeRenderer:t,node:n,treeIndex:r,measure:o,registerChild:a})}})({NodeRenderer:t,node:n,treeIndex:r}))}),[t,v]),O=(0,a.useCallback)((e=>({title:w(e)})),[w]),C=(0,Z.D)(h),S=(0,a.useCallback)((e=>{const{prevPath:t,nextParentNode:r}=e;let o;if(t.length>1){const e=t.slice(0,-1),n=j.ZP.getNodeAtPath({treeData:C,getNodeKey:ae,path:e});n&&(o=n.node)}else o=n;m(ie({prevParentNode:o},e,{nextParentNode:r||n}))}),[m,n,C]),P=(0,a.useCallback)((e=>{let{node:t}=e;s(t)}),[s]),N=(0,a.useCallback)((()=>{v.clearAll()}),[v]);return n?l().createElement(i.Z,{skipOnMount:!0,handleWidth:!0,onResize:N},l().createElement("div",{className:f.container},!g&&l().createElement("div",{className:f.root},l().createElement(t,{node:n})),l().createElement("div",{className:f.tree},l().createElement(L.ZP,{isVirtualized:!0,canDrag:c,canDrop:d,treeData:h,theme:ce,generateNodeProps:O,rowHeight:v.rowHeight,reactVirtualizedListProps:{ref:b,scrollToAlignment:"end",onScroll:p},onMoveNode:S,onChange:x,onLazyLoadChildren:P,getNodeKey:ae})))):null};ue.propTypes={NodeRenderer:f().elementType,root:J,canDrag:f().oneOfType([f().bool,f().func]),canDrop:f().func,scrollToNode:f().object,onChange:f().func,onRequestChildren:f().func,onNodeMoved:f().func,onScroll:f().func,inlineRoot:f().bool,getNodeKey:f().func};const de=ue,pe=(0,w.Z)((()=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,width:0,minHeight:"15px"}}))),me=(0,w.Z)((()=>({loadingSpinner:{alignSelf:"center",maxHeight:"16px",marginRight:"16px"}})));var ge=n(37014);const fe=e=>{let{className:t,registerChild:n}=e;const r=pe(),o=me();return l().createElement("div",{className:c()(r.container,t),ref:n},l().createElement(ge.Z,{className:o.loadingSpinner}),l().createElement("div",{className:r.title},p().text("Loading...")))};fe.propTypes={className:f().string,registerChild:f().func};const he=fe;var be=n(59431),ye=n(66130),ve=n(33310);const Ee=(0,w.Z)((()=>({wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px"},avatarWithMultiParent:{cursor:"pointer"},number:{color:"rgba(0,0,0,0.54)",marginLeft:"13px"},multiParentIcon:{position:"absolute",top:"15px",left:"-3px",cursor:"pointer"},actionsBlock:{position:"absolute",right:"0",top:"2px",backgroundColor:"rgb(240,240,240)","&::after":{content:'""',position:"absolute",left:"-40px",top:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(240,240,240, 0.2), rgba(240,240,240, 1) 100%)",pointerEvents:"none"}},actionsBlockWithOpenMenu:{backgroundColor:"white","&::after":{background:"linear-gradient(to right, rgba(255,255,255, 0.2), rgba(255,255,255, 1) 100%)"}},actionsBlockForCheckedNode:{backgroundColor:"rgb(224,238,249)","&::after":{background:"linear-gradient(to right, rgba(224,238,249, 0.2), rgba(224,238,249, 1) 100%)"}},regularNodeCheckbox:{padding:0,marginRight:"16px",marginTop:"-4px",marginLeft:"-4px"},subtitle:{fontSize:"11px",letterSpacing:0,lineHeight:"13px",paddingLeft:"24px",paddingTop:"2px",paddingBottom:"4px",wordBreak:"break-word"},popper:{maxWidth:"345px",minWidth:"200px",boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",backgroundColor:"white",borderRadius:"2px"}})));var xe=n(96330);function we(){return we=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},we.apply(this,arguments)}const Oe=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return l().createElement("svg",we({width:"11",height:"11",viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),l().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},l().createElement("circle",{strokeOpacity:".54",stroke:"#000",fill:"#FFF",cx:"6",cy:"6",r:"5.5"}),l().createElement("path",{d:"M5.536 4.641L4.505 3.61H8v3.495L6.874 5.98 5.509 7.344a1.995 1.995 0 00-.581 1.548l-.407-.408a2 2 0 010-2.828l1.015-1.015z",fillOpacity:".87",fill:"#000"})))};var Ce=n(55400);const Se=(0,w.Z)((e=>({link:{cursor:"pointer",color:e.palette.primary.main,lineHeight:"15px"},selected:{fontWeight:"bold"}})));function Pe(){return Pe=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},Pe.apply(this,arguments)}const Ne=e=>{let{title:t,isSelected:n,link:r,onClick:o}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["title","isSelected","link","onClick"]);const i=Se();return l().createElement("span",Pe({},a,{className:c()(i.link,{[i.selected]:n})}),l().createElement(Ce.Z,{to:r,onClick:o},t))},Te=(0,w.Z)((()=>({avatar:{height:"16px",width:"16px",marginRight:"6px",flexShrink:"0"},multiParent:{position:"relative",background:"#ffffff",border:"1px solid rgba(0,0,0,0.12)",marginLeft:"-5px",marginTop:"10px",padding:"10px 11px 9px 6px","&:after,&:before":{bottom:"100%",left:"12px",border:"solid transparent",content:"' '",height:0,width:0,position:"absolute","pointer-events":"none"},"&:after":{borderColor:"rgba(255, 255, 255, 0)",borderBottomColor:"#ffffff",borderWidth:"6px",marginLeft:"-6px"},"&:before":{borderColor:"rgba(220, 216, 245, 0)",borderBottomColor:"rgba(0,0,0,0.12)",borderWidth:"7px",marginLeft:"-7px"}},parentContainer:{fontSize:"13px",lineHeight:"16px",display:"flex",marginBottom:"12px",alignItems:"center","&:last-child":{marginBottom:0}},loadingNode:{paddingTop:0}})));function ke(){return ke=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},ke.apply(this,arguments)}const Re=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return l().createElement("svg",ke({width:"10",height:"10",viewBox:"0 0 10 10",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),l().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".38"},l().createElement("path",{d:"M4.536 3.641L3.505 2.61H7v3.495L5.874 4.98 4.509 6.344a1.995 1.995 0 00-.581 1.548l-.407-.408a2 2 0 010-2.828l1.015-1.015z",fill:"#000"})))},Ie=e=>{let{showParents:t,additionalParents:n}=e;const r=Te(),o=(0,N.useDispatch)();return t&&n.length>0?l().createElement("div",{className:r.multiParent},n.map(((e,t)=>l().createElement("div",{key:t,className:r.parentContainer},e.pending?l().createElement(he,{className:r.loadingNode}):l().createElement(l().Fragment,null,l().createElement(Re,{className:r.avatar}),l().createElement(Ne,{title:e.title,link:e.entityLink,onClick:()=>o(be.ui.actions.openEntity({uri:e.entityUri,viewId:e.viewId}))})))))):null},De=(0,w.Z)((()=>({details:{margin:"1px 0 8px 24px"},loadingNode:{paddingTop:0},detailLine:{display:"flex"},detail:{flexGrow:1,width:0,wordWrap:"break-word",lineHeight:"16px",paddingLeft:"8px",textIndent:"-8px"},detailLabel:{color:"rgba(0, 0, 0, 0.6)",whiteSpace:"nowrap",lineHeight:"16px",letterSpacing:0,marginRight:"5px"},detailValue:{fontSize:"0.75rem",letterSpacing:0}})));var je=n(72768);function Ze(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}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){Me(e,t,n[t])}))}return e}function Me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ae=(e,t)=>{const{sortField:n,sortOrder:r,graphTypes:o}=e,a=(0,T.GyU)(e.root,{childrenProcessing:(0,T.MjG)({sortField:n,sortOrder:r,typesLabelsMap:(0,T.ORg)(t)}),nodeProcessing:(0,u.pipe)(Ve,Ge,qe)});return Le({},e,{root:a,entitiesMap:Ye(a),title:((0,T.jrr)(t,o)||{}).label})};let _e=0;const Ue=()=>_e++,He=e=>e?[].concat(e):[],ze=e=>(0,u.path)(["entity","uri"],e),Be=e=>e?(0,T.VGB)(e):[],Fe=(e,t)=>{const n=(0,u.prop)("relation",e);if(Array.isArray(n)){const r=He(e.parent),o=(0,u.findIndex)((0,u.equals)(t),r);return(0,u.path)([o],n)}return n},Ve=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.formatted?e:Le({},e,{nodeId:Ue(),parent:He(e.parent),directParentUri:ze(t),pending:!e.children&&e.total>0,formatted:!0,relations:Be(e.relation),relation:Fe(e,ze(t))})},We=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{children:n,parent:r,traversedRelations:o,untraversedRelations:a,cycled:l,formatted:i,relation:s}=e,c=Ze(e,["children","parent","traversedRelations","untraversedRelations","cycled","formatted","relation"]);if(i)return e;const u=o+a-1,d=ze(t),p={nodeId:Ue(),cycled:l,entity:c,parent:He(r),directParentUri:d,total:u,pending:!l&&!n&&u>0,formatted:!0,relations:Be(s),relation:Fe(e,d)};return n&&(p.children=n,p.pending=!l&&u>n.length),p},Ge=e=>{const t=e.children||[];return t.some((t=>(0,u.path)(["entity","uri"],t)===e.entity.uri||t.uri===e.entity.uri))||e.cycled||!e.parent.includes(e.entity.uri)?e:Le({},e,{children:t.concat(Le({},e,{nodeId:Ue(),directParentUri:e.entity.uri,total:0,children:[],cycled:!0}))})},qe=(0,u.when)((0,u.both)((0,u.has)("children"),(0,u.complement)((0,u.prop)("pending"))),(0,u.assoc)("expanded",!0)),$e=e=>{let{nodeId:t,relation:n,formatted:r,directParentUri:o,pending:a,children:l,total:i}=e;return Ze(e,["nodeId","relation","formatted","directParentUri","pending","children","total"])},Ye=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=ze(e);return n&&(t[n]=$e(e)),e.children&&e.children.forEach((e=>Ye(e,t))),t},Qe=e=>Object.keys(e).reduce(((t,n)=>{const r=We(e[n]);return t[n]=$e(r),t}),{}),Xe=(e,t)=>{let{entities:n,relations:r}=e;if(Array.isArray(n)){const e=n.reduce(((e,t)=>(e[t.uri]=t,e)),{});return(r||[]).forEach((n=>{const r=t?"startObject":"endObject",o=e[n[t?"endObject":"startObject"].objectURI],a=e[n[r].objectURI];o.children=o.children||[],o.children.includes(a)||o.children.push(a),a.parent=a.parent||[],a.relation||(a.relation=n),a.parent.includes(o.uri)||a.parent.push(o.uri)})),e}},Ke=(0,u.curry)(((e,t)=>(0,u.pipe)(Xe,Qe)(t,e))),Je=()=>({nodeId:Ue(),relation:{uri:(0,T.ncP)(),attributes:{}}}),et=be.N5.trees.actions,tt=e=>{let{parentUri:t,parentId:n,graphTypes:r,activenessDate:o,id:a,isReversed:l}=e;return(e,i)=>{const{sortField:s,sortOrder:c}=be.ZP.selectors.getTree(i(),a),d=be.ZP.selectors.getMetadata(i());return e(et.childrenLoading({id:a,parentId:n,nodeId:Ue()})),(0,T.ZYI)({uri:t,graphTypes:r,activenessDate:o}).then((r=>{const{children:o}=(e=>{let{json:t,parentUri:n,sortField:r,sortOrder:o,metadata:a,isReversed:l}=e;const i=Xe(t,l),s=i&&(e=>{const t=[{node:e,parent:null}],n=[];for(const e of t){const{node:r,parent:o}=e;n.includes(r)?o.children=o.children.map((e=>e===r?Le({},r,{cycled:!0,children:[]}):e)):(n.push(r),r.children&&t.push(...r.children.map((e=>({node:e,parent:r})))))}return e})(i[n]);return(0,T.GyU)(s,{nodeProcessing:(0,u.pipe)(We,Ge),childrenProcessing:(0,T.MjG)({sortField:r,sortOrder:o,typesLabelsMap:(0,T.ORg)(a)})})})({json:r,parentUri:t,sortField:s,sortOrder:c,metadata:d,isReversed:l}),i=Ke(l,r);e(et.childrenLoaded({id:a,children:o,parentId:n})),e(et.entitiesMappingLoaded({id:a,entitiesSubMap:i}))}))}},nt=e=>{let{id:t,uri:n}=e;return e=>{e(et.currentEntityShownInTree({id:t,uri:n})),setTimeout((()=>{e(et.resetScrollToNode(t))}),0)}},rt=(0,u.pipe)(T.kiP,(0,u.any)((0,u.prop)("secondaryLabelPattern")));function ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const at=be.N5.trees.actions,lt=(0,u.has)("attributes"),it=e=>{let{node:t,checkedNodes:n}=e;return(0,u.has)(t.nodeId,n)},st=(0,u.has)("editingMode"),ct=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return st(e)||(0,u.has)("children",e)&&e.children.some(ct)},ut=e=>{let{id:t,node:n}=e;return e=>{const{nodeId:r,relation:o}=n,a=Array.isArray(o)?o[0]:o;return lt(a)?Promise.resolve(o):(0,T._vs)(a.uri).then((n=>{const 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){ot(e,t,n[t])}))}return e}({},a,n);return e(at.treeNodeChanged({id:t,node:{nodeId:r,relation:o}})),Promise.resolve(o)}))}},dt=e=>e.loading||(0,u.has)("children",e)&&e.children.some(dt),pt=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return t&&e},mt=(0,u.pick)(["startDate","endDate"]),gt=[{uri:"typeName",type:T.oS0.TYPE_STRING,label:p().text("Relationship")},...T.ViP],ft=e=>{let{showDetails:t,metadata:n,relation:r={}}=e;const o=De(),a=mt(r);return a.typeName=(0,u.prop)("label",(0,T.V3K)(n,r.type)),t&&r?l().createElement("div",{className:o.details},lt(r)?gt.map((e=>a[e.uri]&&l().createElement("div",{key:e.uri,className:o.detailLine},l().createElement("div",{className:o.detail},l().createElement(m.Typography,{variant:"caption",gutterBottom:!0,className:o.detailLabel},e.label+": "),l().createElement("span",{className:o.detailValue},l().createElement(je.Z,{value:a[e.uri],dataTypeDefinition:e})))))):l().createElement(he,{key:"loading-details",className:o.loadingNode})):null};ft.propTypes={showDetails:f().bool,relation:T.uTS,metadata:T.pGS};const ht=ft;var bt=n(27604),yt=n(82726),vt=n(86602),Et=n(74443),xt=n(22983),wt=n(8818),Ot=n(55847);const Ct=(0,w.Z)((()=>({addButton:{marginRight:"11px"},editButton:{marginRight:"13px"}}))),St=e=>{let{className:t,show:n,showDetails:r,onToggleRelationDetails:o,onMenuOpen:a,onMenuClose:i,onStartEditing:s,onAddParent:c,onAddChild:d,onDelete:m}=e;const g=Ct(),f=[c&&{text:p().text("Add Parent"),onClick:c},d&&{text:p().text("Add Child"),onClick:d}].filter(u.identity);return n&&(o||s||c||d||m)?l().createElement("div",{className:t},o&&l().createElement(wt.k,{tooltipTitle:r?p().text("Hide details"):p().text("View details"),tooltipPlacement:"bottom-end",size:"S",icon:r?vt.Z:yt.Z,onClick:o}),f.length>0&&l().createElement(Ot.Z,{buttonComponent:wt.k,buttonProps:{icon:Et.Z,size:"S",tooltipTitle:p().text("Add node"),className:g.addButton},menuId:"tree-node-actions",menuItems:f,onMenuOpen:a,onMenuClose:i}),s&&l().createElement(wt.k,{tooltipTitle:p().text("Edit node"),size:"S",icon:bt.Z,onClick:s,className:g.editButton}),m&&l().createElement(wt.k,{tooltipTitle:p().text("Delete node"),size:"S",icon:xt.Z,onClick:m})):null};St.propTypes={show:f().bool,showDetails:f().bool,className:f().string,onMenuOpen:f().func,onMenuClose:f().func,onStartEditing:f().func,onAddParent:f().func,onAddChild:f().func,onDelete:f().func,onToggleRelationDetails:f().func};const Pt=St,Nt=(0,u.prop)("graph"),Tt=(0,u.pipe)(Nt,(0,u.path)(["options","reverseRelations"])),kt=(0,u.pipe)(Nt,(0,u.prop)("type")),Rt=(0,u.pipe)((0,u.prop)("sortOrder"),T.de5),It=(0,u.pipe)((0,u.prop)("sortBy"),T.VO3),Dt=(0,u.pipe)((0,u.prop)("attributes"),(0,u.defaultTo)([]),(0,u.includes)("secondaryLabel"));function jt(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){Zt(e,t,n[t])}))}return e}function Zt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Lt=be.N5.trees.actions,Mt=(e,t,n)=>{const r=(0,T.nt9)(t,n)||{},o=(0,T.VD3)(t,r,"typeGraphIcon");return o&&(0,T.vPL)(e,o)},At=(e,t,n)=>{let{relation:r}=e;return!!r&&(0,T.Z5t)(n,(0,T.V3K)(t,r.type))},_t=(0,u.curry)(((e,t,n,r)=>{const{entity:o={}}=r,a=Tt(t)?"parent"===e:"child"===e,l=o.type,i=kt(t);if(i){const e=(0,T.jrr)(n,i),t=(0,T.SxO)(e)||[],r=(0,T.lhE)(n,u.__,l);return t.map((0,T.V3K)(n)).filter(u.identity).map(a?T.MaZ:T.GGR).some(r)}return!0})),Ut=_t("parent"),Ht=_t("child"),zt=(e,t,n)=>{let{relation:r}=e;return!!r&&(0,T.Edd)(n,(0,T.V3K)(t,r.type))},Bt=e=>{let{node:t,metadata:n,absoluteImagePath:r,currentEntityUri:o,mode:a,config:l={},uiPath:i,showSecondaryLabel:s,onParentsRequested:c,dispatch:d}=e;const{entity:p,children:m,total:g,pending:f,showParents:h,nodeId:b}=t,{id:y}=l,v=((e,t)=>ze(e)===t)(t,o),E=(0,T.KIu)(a),x={onToggleShowParents:e=>{d(Lt.treeNodeChanged({id:y,node:{nodeId:b,showParents:!h}})),e&&c(t)}},w=jt(E?{onStartEditing:At(t,n,a)?()=>d((e=>{let{id:t,node:n}=e;return e=>{const{nodeId:r}=n;e(at.treeNodeChanged({id:t,node:{nodeId:r,loading:!0}})),e(ut({id:t,node:n})).then((()=>{e(at.treeNodeEditingStarted({id:t,node:n}))}))}})({id:y,node:t})):null,onAddParent:Ut(l,n,t)?()=>d(Lt.treeNodeNewParentEditingStarted({id:y,node:t,newNode:Je()})):null,onAddChild:Ht(l,n,t)?()=>d((e=>{let{id:t,node:n,newNode:r,isReversed:o}=e;return(e,a)=>{if(e(at.treeNodeNewChildEditingStarted({id:t,node:n,newNode:r})),n.pending){const r=a(),{activenessDate:l,graphTypes:i}=be.ZP.selectors.getTree(r,t);e(tt({parentUri:n.entity.uri,parentId:n.nodeId,graphTypes:i,activenessDate:l,id:t,isReversed:o}))}}})({id:y,isReversed:Tt(l),node:t,newNode:Je()})):null,onDelete:zt(t,n,a)?()=>{const e=(0,u.path)(["relation","uri"],t);e&&d(Lt.treeRelationRemoved({relationUri:e})),d(Lt.treeNodeRemoved({id:y,nodeId:b}))}:null}:{onToggleRelationDetails:()=>d((e=>{let{id:t,node:n}=e;return e=>{const{nodeId:r,showDetails:o,relation:a}=n,l={nodeId:r,showDetails:!o};e(at.treeNodeChanged({id:t,node:l})),!o&&!lt(a)&&a&&e(ut({id:t,node:n}))}})({id:y,node:t}))},x);return jt({title:(0,T.idV)(p.label),subtitle:s?p.secondaryLabel:void 0,number:m&&!f?m.length:g,icon:Mt(r,n,p.type),isSelectedNode:v,entityLink:(0,T.ChB)({uiPath:i,uri:p.uri}),entityUri:p.uri,viewId:y,showDetails:t.showDetails&&!E},(0,u.reject)(u.isNil,w))},Ft=e=>{let{node:t,entitiesMap:n,metadata:r,config:o,absoluteImagePath:a,uiPath:l}=e;const{entity:i,directParentUri:s}=t;return(0,u.pathOr)([],[i.uri,"parent"],n).filter((e=>e!==s)).map((e=>{const t=(0,u.prop)(e,n);return t?Bt({node:t,config:o,metadata:r,absoluteImagePath:a,uiPath:l}):{pending:!0}}))},Vt=(0,a.createContext)({config:{},entitiesMap:{},onToggleNodeCheckbox:()=>{},onParentsRequested:()=>{},checkedNodes:{},canSelect:!1});Vt.displayName="NodeContext";var Wt=n(85229);const Gt=e=>{e.target.src=xe},qt=e=>{let{node:t={},registerChild:n,measure:r=u.identity}=e;const o=Ee(),i=(0,a.useRef)(),s=pe(),d=(0,N.useDispatch)(),{config:p,entitiesMap:g,onToggleNodeCheckbox:f,checkedNodes:h,canSelect:b,onParentsRequested:y,showSecondaryLabel:v}=(0,a.useContext)(Vt),E=(0,N.useSelector)(be.ZP.selectors.getAbsoluteImagePath),x=(0,N.useSelector)(be.ZP.selectors.getMetadata),{uri:w}=(0,N.useSelector)(be.ZP.selectors.getEntity),O=(0,N.useSelector)(be.ZP.selectors.getMode),C=(0,N.useSelector)(be.ZP.selectors.getUIPath),{title:S,subtitle:P,number:k,icon:R,relation:I,showDetails:D,additionalParents:j=[],showParents:Z,isSelectedNode:L,nodeId:M,entityLink:A,viewId:_,entityUri:U,onStartEditing:H,onAddParent:z,onAddChild:B,onToggleRelationDetails:F,onDelete:V,onToggleShowParents:W}=(e=>{let{node:t,entitiesMap:n,metadata:r,absoluteImagePath:o,currentEntityUri:a,mode:l,config:i,uiPath:s,showSecondaryLabel:c,onParentsRequested:u,dispatch:d}=e;return jt({},t,{relation:Array.isArray(t.relation)?t.relation[0]:t.relation},Bt({node:t,metadata:r,absoluteImagePath:o,currentEntityUri:a,mode:l,config:i,uiPath:s,showSecondaryLabel:c,onParentsRequested:u,dispatch:d}),{additionalParents:Ft({node:t,config:i,entitiesMap:n,metadata:r,absoluteImagePath:o,uiPath:s})})})({node:t,entitiesMap:g,metadata:x,absoluteImagePath:E,currentEntityUri:w,mode:O,config:p,uiPath:C,showSecondaryLabel:v,onParentsRequested:y,dispatch:d}),{isLoading:G,entityDetails:q,showEntityDetails:$,hideEntityDetails:Y}=(e=>{const[t,n]=(0,a.useState)(null),[r,o]=(0,a.useState)(!1),l=(0,a.useRef)(null),i=(0,Wt._)(),s=(0,a.useCallback)((()=>i(Promise.resolve())),[i]),c=(0,a.useCallback)((()=>{l.current=setTimeout((()=>{o(!0),i((0,T.HvW)(e)).then(n).finally((()=>o(!1)))}),1e3)}),[e,i]),u=(0,a.useCallback)((()=>{s(),clearTimeout(l.current),o(!1),n(null)}),[s]);return(0,a.useEffect)((()=>()=>clearTimeout(l.current)),[]),{isLoading:r,entityDetails:t,showEntityDetails:c,hideEntityDetails:u}})(U),Q=Boolean(q)||G,X=j.some((e=>e.pending)),[K,J]=(0,a.useState)(!1),ee=(0,a.useCallback)((()=>J(!0)),[]),te=(0,a.useCallback)((()=>J(!1)),[]),[ne,re]=(0,a.useState)(!1),oe=(0,a.useCallback)((()=>re(!0)),[]),ae=(0,a.useCallback)((()=>{re(!1),J(!1)}),[]),le=j.length>0,ie=le&&W?W.bind(null,X):void 0,se=((0,a.useCallback)((e=>f({checked:e.target.checked,node:t})),[t,f]),it({node:t,checkedNodes:h})),ce=(0,a.useCallback)((()=>{d(be.ui.actions.openEntity({uri:U,viewId:_}))}),[_,U,d]);return(0,a.useEffect)(r,[!1,le,P,!!F,D,k,Z,D&<(I),Z&&X,r]),l().createElement("div",{className:o.wrapper,"data-node-id":M,onMouseEnter:ee,onMouseLeave:te,ref:n},l().createElement("div",{ref:i,className:s.container},l().createElement(m.Avatar,{className:c()(o.avatar,{[o.avatarWithMultiParent]:le}),src:R||xe,onError:Gt,onClick:ie}),le&&l().createElement(Oe,{className:o.multiParentIcon,onClick:ie}),l().createElement("div",{className:s.title},l().createElement(Ne,{title:S,isSelected:L,link:A,onClick:ce,onMouseEnter:$,onMouseLeave:Y}),!!k&&l().createElement("span",{className:o.number},k),l().createElement(Pt,{show:K||ne,className:c()(o.actionsBlock,{[o.actionsBlockWithOpenMenu]:ne&&!se,[o.actionsBlockForCheckedNode]:ne&&se}),showDetails:D,onToggleRelationDetails:I&&F,onMenuOpen:oe,onMenuClose:ae,onStartEditing:H,onAddChild:B,onAddParent:z,onDelete:V}))),l().createElement(Ie,{showParents:Z,additionalParents:j}),P&&l().createElement("div",{className:o.subtitle},P),F&&l().createElement(ht,{showDetails:D,metadata:x,relation:I}),l().createElement(ye.Z,{anchorEl:i.current,className:o.popper,open:Q,modal:!1,placement:"top-start"},l().createElement(ve.Z,{entity:q,variant:G?"loading":"normal"})))};qt.propTypes={node:ee,registerChild:f().func,measure:f().func};const $t=(0,a.memo)(qt);var Yt=n(20562),Qt=n(47137),Xt=n(11564),Kt=n(26579),Jt=n(81077),en=n(91262),tn=n(27185);function nn(){return nn=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},nn.apply(this,arguments)}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}const an=e=>e.value,ln=(e,t)=>t.find((0,u.propEq)("value",e)),sn=e=>{let{value:t,relationTypes:n=[],isChild:r,onChange:o=u.identity,metadata:i}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["value","relationTypes","isChild","onChange","metadata"]);const c=(0,a.useMemo)((()=>((e,t,n)=>{const r={},o=(0,u.pipe)(T.PjQ,(0,u.tap)((e=>r[e]=(0,u.propOr)(0,e,r)+1))),a=(0,u.ascend)((0,u.prop)("label")),l=(e,t)=>{const n=(0,T.nt9)(e,t);return rn({},n,{typeIcon:(0,T.VD3)(e,n,"typeIcon")})};return e.map((e=>{let{uri:r,label:a,startObject:i,endObject:s}=e;return{label:{directionalLabel:o(t?s:i),typeLabel:a},value:r,startObject:rn({},i,{objectType:l(n,i.objectTypeURI)}),endObject:rn({},s,{objectType:l(n,s.objectTypeURI)})}})).map((0,u.evolve)({label:e=>{let{directionalLabel:t,typeLabel:n}=e;return t?r[t]>1?`${t} (${n})`:t:n}})).sort(a)})(n,r,i)),[n,r,i]);return l().createElement(tn.Z,nn({value:ln(t,c),options:c,onChange:(0,u.pipe)(an,o)},s))};sn.propTypes={className:f().string,value:f().string,relationTypes:f().arrayOf(T.IYE),isChild:f().bool,metadata:T.pGS,onChange:f().func};const cn=sn,un=(0,u.curry)(((e,t,n,r)=>{const o=(0,T.lhE)(n,u.__,t.type),a=e?T.MaZ:T.GGR;return(0,u.pipe)(a,o)(r)})),dn=(0,w.Z)((()=>({editorContainer:{width:"calc(100% - 34px)",minWidth:"185px",backgroundColor:"rgba(0,0,0,0.03)",padding:"16px 16px 8px 16px"},dense:{marginBottom:0},item:{marginBottom:"20px"},actionButtons:{display:"flex",justifyContent:"flex-end"}})));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){mn(e,t,n[t])}))}return e}function mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gn=be.N5.trees.actions,fn=e=>{let{node:t={},measure:n,registerChild:r}=e;const o=dn(),s=(0,N.useDispatch)(),{relatedEntity:d,relation:{uri:g}={},editingMode:f,initialConnection:h}=t,b=f===T.wwy.addingParent,{config:y}=(0,a.useContext)(Vt),v=y.id,E=Tt(y)||!1,x=E?b:!b,w=(0,N.useSelector)((e=>be.ZP.selectors.getTreeEditingConnection(e,v,g))),O=(0,N.useSelector)((e=>(0,T.NZI)(w,be.ZP.selectors.getProfileErrors(e)))),C=(0,N.useSelector)(be.ZP.selectors.getProfileErrors),{relation:S,entity:P}=w,{attributes:k,type:R,crosswalks:I=[]}=S,D=(0,a.useMemo)((()=>pn({attributes:k},(0,T.p2l)(S))),[k,S]),j=(0,N.useSelector)((e=>be.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),Z=(0,N.useSelector)(be.ZP.selectors.getMetadata),L=(0,N.useSelector)(be.ZP.selectors.getMode),M=kt(y),A=(0,T.jrr)(Z,M)||{},_=(0,a.useMemo)((()=>((e,t,n,r)=>(0,u.pipe)(T.SxO,(0,u.defaultTo)([]),(0,u.map)((0,T.V3K)(n)),(0,u.reject)(u.isNil),(0,u.filter)(un(e,t,n)))(r))(x,d,Z,A)),[x,d,Z,A]),U=(0,a.useMemo)((()=>P&&P.uri?_.filter((0,T.eHk)(x,P,d,Z)):_),[P,_,x,d,Z]),H=(0,a.useMemo)((()=>(0,T.jWj)(x,Z,R?[(0,T.V3K)(Z,R)]:_)),[x,Z,R,_]),z=(0,a.useCallback)((e=>{s(gn.treeNodeRelationTypeChanged({id:v,node:t,relationTypeUri:e}))}),[t,v,s]),B=(0,a.useCallback)((e=>{s(gn.treeNodeEntityChanged({id:v,node:t,entity:e}))}),[t,v,s]);(0,a.useEffect)((()=>{R||1!==_.length||z(_[0].uri)}),[R,_,z]),(0,Yt.D)((()=>{!R&&U.length>=1&&z(U[0].uri)}),[R,P,U,z]),(0,a.useEffect)(n,[v,w,C,R,_,!!z,P,U,n]);const F=(0,a.useMemo)((()=>(0,T.xF8)(Z,R)),[R,Z]),V=(0,a.useMemo)((()=>P&&{entityUri:P.uri,entityType:P.type,entityLabel:(0,T.idV)(P.label)}),[P]),W=(0,a.useCallback)((e=>(0,u.pipe)(be.N5.actions.addAttributes,s)(e.map((e=>pn({},e,{viewId:v}))))),[v,s]),G=(0,a.useCallback)((e=>(0,u.pipe)(be.N5.actions.modifyAttribute,s)(pn({},e,{viewId:v}))),[v,s]),q=(0,a.useCallback)((e=>(0,u.pipe)(be.N5.actions.removeAttribute,s)(pn({},e,{viewId:v}))),[v,s]),$=(0,a.useCallback)((()=>{const e=(0,T.Bxm)(Z,w);return s(be.N5.errors.actions.errorsSet(e)),0===e.length}),[w,Z,s]),Y=(0,a.useCallback)((()=>{s((e=>{let{id:t,node:n}=e;return e=>{e((0,u.cond)([[(0,u.equals)(T.wwy.addingParent),(0,u.always)(at.treeNodeNewParentEditingCanceled)],[(0,u.equals)(T.wwy.addingChild),(0,u.always)(at.treeNodeNewChildEditingCanceled)],[(0,u.equals)(T.wwy.editing),(0,u.always)(at.treeNodeEditingCanceled)]])(n.editingMode)({id:t,node:n}))}})({id:v,node:t}))}),[t,v,s]),Q=(0,a.useCallback)((()=>{$()&&s((e=>{let{id:t,node:n,isReversed:r}=e;return(e,o)=>{const a=be.ZP.selectors.getTreeEditingConnection(o(),t,n.relation.uri);let l;switch(n.editingMode){case T.wwy.addingParent:case T.wwy.addingChild:l=at.treeRelationCreated;break;case T.wwy.editing:l=at.treeRelationChanged}e(l((0,T.OT5)({node:n,connection:a,isReversed:r}))),e((0,u.cond)([[(0,u.equals)(T.wwy.addingParent),(0,u.always)(at.treeNodeNewParentEditingApplied)],[(0,u.equals)(T.wwy.addingChild),(0,u.always)(at.treeNodeNewChildEditingApplied)],[(0,u.equals)(T.wwy.editing),(0,u.always)(at.treeNodeEditingApplied)]])(n.editingMode)({id:t,node:n}))}})({id:v,isReversed:E,node:t}))}),[t,v,E,s,$]),X=!(0,u.equals)(h,w)&&R,K=(0,T.e$p)(O),J=(0,a.useContext)(Qt.M),ee=(0,a.useMemo)((()=>(0,u.allPass)([(0,u.pipe)((0,u.prop)("uri"),T.O27),(0,u.propEq)("parentUri",g),(0,u.propEq)("attributeTypeUri",R)])(J.error)),[g,R,J]),{ref:te,errorClassName:ne}=(0,Xt.B)({highlightedError:ee?J:null,isSimple:!0});return l().createElement("div",{className:o.editorContainer,ref:r},l().createElement(i.Z,{handleHeight:!0,onResize:n}),1!==_.length&&l().createElement(cn,{isChild:x,relationTypes:U,className:o.item,value:R,metadata:Z,onChange:z}),l().createElement("div",{ref:te,className:ne},l().createElement(Kt.Z,{errorMessage:K,className:o.item},l().createElement(Jt.Z,{key:R,className:c()({[o.dense]:K}),entity:V||{},entityTypesUris:H,max:y.max||20,globalSearchRequestOptions:j,mode:L,onChange:B,metadata:Z,attributeTypesSelectionStrategy:T.wcJ}))),R&&l().createElement(en.Z,{className:o.item,attrTypes:F,entity:D,showEmptyEditors:!1,crosswalks:I,mode:L,parentUri:g,onAddAttributes:W,onChangeAttribute:G,onDeleteAttribute:q}),l().createElement("div",{className:o.actionButtons},l().createElement(m.Button,{onClick:Y},p().text("Cancel")),l().createElement(m.Button,{color:"primary",disabled:!X,onClick:Q},p().text("Apply"))))};fn.propTypes={node:ee,registerChild:f().func,measure:f().func};const hn=(0,a.memo)(fn),bn="loading",yn="regular",vn="editor",En=(0,u.cond)([[st,(0,u.always)(vn)],[e=>e.loading,(0,u.always)(bn)],[u.T,(0,u.always)(yn)]]),xn=e=>class{static build(e){const{node:t}=e;switch(En(t)){case bn:return l().createElement(he,e);case yn:return l().createElement($t,e);case vn:return l().createElement(hn,e)}}}.build(e);xn.propTypes={node:ee,onToggleShowParents:f().func};const wn=xn,On=e=>{let{className:t,config:n,tree:r={},onChildrenRequested:o,onParentsRequested:i,onTreeChanged:s,onTreeScroll:u,onNodeMoved:d,onToggleNodeCheckbox:p,checkedNodes:m,mode:g}=e;const f=k(),h=(0,T.KIu)(g),b=(0,N.useSelector)(be.ZP.selectors.getMetadata),y=(0,a.useMemo)((()=>({config:n,entitiesMap:r.entitiesMap,onToggleNodeCheckbox:p,checkedNodes:m,canSelect:h,onParentsRequested:i,showSecondaryLabel:pt(r.showSecondaryLabel,Dt(n))})),[m,n,h,p,r.entitiesMap,r.showSecondaryLabel,i]),v=(0,a.useMemo)((()=>({generateTreeNodeProps:e=>{let{node:t}=e;return{treeNodeClassName:c()({[f.checkedNode]:it({node:t,checkedNodes:m}),[f.editorNode]:st(t)})}}})),[m,f]),E=(0,a.useCallback)((e=>{let{node:t}=e;return h&&!st(t)&&!dt(t)&&zt(t,b,g)}),[h,b,g]),x=(0,a.useCallback)((e=>{let{nextParent:t,node:o}=e;const a=!Tt(n),l=null===t?r.root:t;return l&&!l.loading&&Ht(n,b,l)&&(0,T.eHk)(a,o.entity,l.entity,b,(0,T.V3K)(b,o.relation.type))}),[n,b,r.root]);return l().createElement("div",{className:c()(f.panel,t)},l().createElement("div",{className:f.treeWrapper},l().createElement(F.Provider,{value:v},l().createElement(Vt.Provider,{value:y},l().createElement(de,{NodeRenderer:wn,onChange:s,canDrag:E,canDrop:x,root:r.root,scrollToNode:r.scrollTo,onScroll:u,onRequestChildren:o,onNodeMoved:d,inlineRoot:!!r.root&&st(r.root)})))))};On.propTypes={className:f().string,tree:ne,onChildrenRequested:f().func,onParentsRequested:f().func,onTreeChanged:f().func,onTreeScroll:f().func,onNodeMoved:f().func,onToggleNodeCheckbox:f().func,checkedNodes:f().object,mode:f().string,config:f().object};const Cn=(0,a.memo)(On);var Sn=n(10237),Pn=n(99136);function Nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tn=be.N5.trees.actions;var kn=n(43775);const Rn=e=>{let{value:t,onChange:n,graphTypes:r,className:o}=e;return l().createElement(kn.Z,{classes:{root:o},value:t,onChange:n,options:r.map((e=>{let{uri:t,label:n}=e;return{value:t,label:n}}))})};Rn.propTypes={value:f().string,onChange:f().func,graphTypes:f().arrayOf(T.mNm),className:f().string};const In=Rn;var Dn=n(8459);function jn(){return jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}const Zn=e=>{let{value:t,onChange: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={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["value","onChange"]);const o=(0,u.pipe)((e=>e&&e.getTime()),n);return l().createElement(Dn.Z,jn({value:t,label:p().text("Effective date"),onChange:o,margin:"dense"},r))};Zn.propTypes={value:te,onChange:f().func};const Ln=Zn;var Mn=n(36444),An=n(70595),_n=n(90324);const Un="23px",Hn=(0,w.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:Un,paddingRight:Un,minWidth:"245px",maxWidth:"308px",width:"40%"},title:{marginBottom:"30px"},sortControls:{display:"flex",alignItems:"center"},sortSelectorRoot:{flex:1,padding:"13px 16px",fontSize:"0.85rem"},sortSelectorMenuItem:{fontSize:"0.85rem"},sortOrderButton:{flexShrink:0,margin:"0 8px 0 7px"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{backgroundColor:"rgba(0,0,0,0.1)",margin:"19px -23px"}})));var zn=n(79026);const Bn=(0,h.Z)(m.FormControlLabel),Fn=[{label:p().text("Relationship type label"),value:T._R1.relationTypeLabel},{label:p().text("Entity label"),value:T._R1.entityLabel}],Vn=e=>{let{className:t,sortField:n,sortOrder:r,onSort:o,showSecondaryLabel:i,showSecondaryLabelDisabledReason:s,onShowSecondaryLabelChange:u}=e;const d=Hn(),g=(0,a.useRef)(),[f,h]=(0,a.useState)(!1),b=r===T.wUm.asc,y=()=>h((e=>!e));return l().createElement(l().Fragment,null,l().createElement(m.Button,{ref:g,classes:{root:c()(d.triggerButton,t)},onClick:y},l().createElement(Mn.Z,null)),l().createElement(m.Popover,{open:f,classes:{paper:d.popupContent},anchorEl:g.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},u&&l().createElement(l().Fragment,null,l().createElement(m.Typography,{className:d.viewOptionsTitle,variant:"h6"},p().text("View options")),l().createElement(Bn,{tooltipTitle:s,showForDisabled:!!s,classes:{root:d.checkboxControlRoot,label:d.checkboxControlLabel},control:l().createElement(m.Checkbox,{className:d.checkboxControlCheckbox,checked:i||!1,onChange:e=>u(e.target.checked)}),label:p().text("Display secondary label"),disabled:!!s}),l().createElement(m.Divider,{className:d.divider})),l().createElement(m.Typography,{className:d.title,variant:"h6"},p().text("Sort by")),l().createElement("div",{className:d.sortControls},l().createElement(zn.Z,{entries:Fn,TextFieldProps:{variant:"filled"},classes:{root:d.sortSelectorRoot,menuItem:d.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:n,onChange:e=>{o({sortField:e,sortOrder:r})},MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),l().createElement(wt.k,{tooltipTitle:b?p().text("Ascending"):p().text("Descending"),icon:b?_n.Z:An.Z,onClick:()=>{o({sortField:n,sortOrder:b?T.wUm.desc:T.wUm.asc})},className:d.sortOrderButton,size:"L"}))))};Vn.propTypes={className:f().string,sortField:f().string,sortOrder:f().string,onSort:f().func,showSecondaryLabel:f().bool,showSecondaryLabelDisabledReason:f().string,onShowSecondaryLabelChange:f().func};const Wn=Vn,Gn=(0,w.Z)((()=>({text:{fontSize:"12px",lineHeight:"14px",letterSpacing:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},textContainer:{maxWidth:"calc(100% - 13px)"},separator:{marginLeft:"4px",marginRight:"4px"}})));function qn(){return qn=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},qn.apply(this,arguments)}const $n=e=>{let{items:t=[]}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["items"]);const r=Gn();return l().createElement(m.Breadcrumbs,qn({"aria-label":p().text("Breadcrumb"),expandText:p().text("Show path"),classes:{li:r.textContainer,separator:c()(r.text,r.separator)}},n),t.map(((e,t,n)=>{const{label:o,href:a,onClick:i}=e,s=t===n.length-1?"textPrimary":"textSecondary";return i||a?l().createElement(m.Link,{key:t,color:s,classes:{root:r.text},href:a,onClick:i},o):l().createElement(m.Typography,{key:t,href:a,color:s,classes:{root:r.text}},o)})))},Yn=f().shape({label:f().string.isRequired,href:f().string,onClick:f().func});$n.propTypes={items:f().arrayOf(Yn)};const Qn=$n,Xn=be.N5.trees.actions,Kn=["showSecondaryLabel"],Jn=(0,u.pipe)((0,u.filter)((0,u.anyPass)([(0,u.has)("root"),...Kn.map((e=>(0,u.has)(e)))])),(0,u.map)((0,u.pick)(Kn)),(0,u.reject)(u.isEmpty)),er=be.N5.trees.actions,tr=(0,w.Z)((e=>({view:{width:"100%"},linearIndicator:{top:"42px"},filtersBar:{paddingLeft:"24px",display:"flex",alignItems:"center",marginTop:"2px",marginBottom:"12px",height:"46px"},errorMessage:{fontSize:"13px",marginLeft:"24px",marginRight:"16px",lineHeight:"1.4",color:e.palette.text.secondary},activenessDate:{flex:1,margin:0},filterSortButton:{flexShrink:0,margin:"0 6px 0 12px"},breadcrumbs:{padding:"8px 24px",backgroundColor:"rgba(0,0,0,0.03)"},graphTypeSelector:{margin:"0 10px 15px 24px",overflow:"hidden"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}})));function nr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rr=be.N5.trees.actions,or=(0,N.connect)(((e,t)=>({tree:be.ZP.selectors.getTree(e,t.config.id),total:be.ZP.selectors.getTreeTotal(e,t.config.id),entity:be.ZP.selectors.getEntity(e),metadata:be.ZP.selectors.getMetadata(e),mode:be.ZP.selectors.getMode(e)})),void 0)((e=>{let{config:t,tree:n,metadata:r,entity:o={},mode:i,className:s}=e;const{id:d,caption:g,graph:f,showPath:h}=t,{uri:b,type:y}=o,v=(0,a.useRef)(Date.now()),{activenessDate:E=v.current,sortField:x,sortOrder:w,loading:O,errorMessage:C,showSecondaryLabel:S}=n||{},k=Tt(t),R=Dt(t),I=pt(S,R),[D,j]=(0,a.useState)(f.type),L=(0,a.useMemo)((()=>((0,T.mmY)(r,y),[])),[r,y]),M=rt(r,D),A=(0,N.useDispatch)(),_=(0,a.useCallback)((e=>{let{sortField:t,sortOrder:n}=e;A(rr.treeSorted({id:d,typesLabelsMap:(0,T.ORg)(r),sortField:t,sortOrder:n})),A((e=>(t,n)=>{const r=be.ZP.selectors.getTree(n(),e),o=(0,u.path)(["root","children",0,"entity","uri"],r);o&&t(nt({id:e,uri:o}))})(d))}),[d,r,A]),U=(0,a.useCallback)((0,T.DsO)((()=>A((e=>(t,n)=>{const r=n(),o=be.ZP.selectors.getTrees(r),a=Jn(o);t(Xn.treesStateSaved({id:e,state:a}))})(d))),500),[d,A]),H=(0,a.useCallback)((e=>{A(rr.treeSecondaryLabelShown({id:d,show:e})),U()}),[d,A,U]);(0,a.useEffect)((()=>{x&&w||_({sortField:It(t),sortOrder:Rt(t)})}),[_,x,w,t]),(e=>{let{entityUri:t,id:n,graphTypes:r,activenessDate:o,isReversed:l,enabled:i}=e;const s=(0,Wt._)({cancelOnUnmount:!1}),c=(0,N.useDispatch)(),d=(0,N.useSelector)(be.ZP.selectors.getMetadata),m=(0,N.useSelector)((e=>be.ZP.selectors.getTree(e,n)))||{},{root:g,isReversed:f,graphTypes:h}=m,b=(0,Z.D)(o)||o,y=(0,a.useCallback)((()=>setTimeout((()=>c(nt({id:n,uri:t}))),100)),[n,t,c]),v=!!g,E=(0,N.useSelector)(be.ZP.selectors.getEntity);(0,Yt.D)((()=>{const e=(0,T.XTh)((0,u.pick)(["uri","label","secondaryLabel","type"],E),{[n]:m});e.length&&c(Tn.treeChanged({id:n,tree:e[0].root}))}),[null==E?void 0:E.updatedTime]),(0,a.useEffect)((()=>{i&&v&&y()}),[i,y,v]),(0,a.useEffect)((()=>{if(i){const e=e=>Tn.treeLoaded({id:n,tree:e,graphTypes:r,activenessDate:o,isReversed:l}),a=(0,u.pipe)(Ae,e,c);(!(0,T.fbl)(g,t)||f!==l||b!==o||h!==r||ct(g))&&(c(Tn.treeLoading(n)),s((0,T.IMU)({uri:t,graphTypes:r,activenessDate:o,isReversed:l})).then((e=>a(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){Nn(e,t,n[t])}))}return e}({},e,{graphTypes:r}),d))).then((e=>y())).catch((e=>{c(Tn.treeLoadedWithError({id:n,errorMessage:(0,T.xU7)(e,p().text("Something went wrong"))})),console.warn(e)})))}}),[t,g,r,o,n,d,l,i,s,c,y,f,h,b])})({id:d,entityUri:b,graphTypes:D,activenessDate:E,isReversed:k,enabled:b&&(0,T.uzs)(i)&&!(0,T.ZiX)(b)}),(e=>{let{id:t,entityUri:n,graphTypes:r,activenessDate:o,isReversed:l}=e;const i=(0,N.useDispatch)(),s=(0,N.useSelector)(be.ZP.selectors.getMetadata),c=(0,N.useSelector)((e=>be.ZP.selectors.getModifiedEntity(e,n))),{root:d}=(0,N.useSelector)((e=>be.ZP.selectors.getTree(e,t)))||{};(0,a.useEffect)((()=>{var e;if(c&&(0,T.ZiX)(n)&&(null==d||null===(e=d.entity)||void 0===e?void 0:e.uri)!==n){const e=e=>er.treeLoaded({id:t,tree:e,graphTypes:r,activenessDate:o,isReversed:l});(0,u.pipe)(Ae,e,i)({root:{entity:c,total:0},graphTypes:r},s)}}),[o,i,n,r,t,l,s,c,d])})({id:d,entityUri:b,graphTypes:D,activenessDate:E,isReversed:k});const z=(0,a.useCallback)((e=>A(tt({parentUri:e.entity.uri,parentId:e.nodeId,graphTypes:D,activenessDate:E,id:d,isReversed:k}))),[D,E,d,A,k]),B=(0,a.useCallback)((e=>A((e=>{let{uri:t,graphTypes:n,activenessDate:r,id:o,isReversed:a}=e;return e=>{const l=(0,u.pipe)(Ke(a),(e=>et.entitiesMappingLoaded({id:o,entitiesSubMap:e})),e);return(0,T.ZYI)({uri:t,graphTypes:n,activenessDate:r}).then(l)}})({uri:e.entity.uri,graphTypes:D,activenessDate:E,id:d,isReversed:k}))),[D,E,d,k,A]),F=(0,a.useCallback)((e=>{A(rr.treeChanged({id:d,tree:e}))}),[A,d]),V=(0,a.useCallback)((e=>{A(rr.activenessDateChanged({id:d,activenessDate:e}))}),[A,d]),W=(0,a.useCallback)((e=>{A(nt({id:d,uri:b}))}),[A,d,b]),G=(0,a.useCallback)((e=>{const{node:t,nextParentNode:n}=e,{entity:r}=n||{},{relation:o,entity:a}=t;o?A(rr.treeRelationRepointed({entity:a,relation:o,newParent:r,isReversed:k})):console.error("relation not found:"+JSON.stringify(e))}),[A,k]),[q,$]=(0,a.useState)({}),Y=(0,a.useCallback)((e=>{let{checked:t,node:n}=e;$(t?e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){nr(e,t,n[t])}))}return e}({},e,{[n.nodeId]:n}):(0,u.omit)([n.nodeId]))}),[]),Q=(0,a.useCallback)((()=>{A(be.ui.actions.openGraph({viewId:d,graphType:D,entityUri:b}))}),[A,d,D,b]),X=(0,a.useCallback)((()=>$({})),[]);(0,a.useEffect)(X,[i]);const K=tr(),J=(0,a.useMemo)((()=>(0,T.aNC)((n||{}).root,b).map((e=>({label:(0,T.idV)((0,u.path)(["entity","label"],e))})))),[n,b]);return l().createElement(Sn.Z,{className:c()(K.view,s)},l().createElement(P,{title:g,onScrollToCurrentEntity:W,entityLabel:(0,T.idV)(o.label),onGraphOpen:Q,disabled:O}),O&&l().createElement(Pn.Z,{className:K.linearIndicator}),L.length>0&&l().createElement(In,{className:K.graphTypeSelector,value:D,onChange:j,graphTypes:L}),l().createElement("div",{className:K.filtersBar},l().createElement(Ln,{className:K.activenessDate,value:E,onChange:V,fullWidth:!0}),l().createElement(Wn,{sortField:x,sortOrder:w,className:K.filterSortButton,onSort:_,showSecondaryLabel:I,onShowSecondaryLabelChange:R?H:void 0,showSecondaryLabelDisabledReason:M?"":p().text("Entity types in this hierarchy don't have any secondary label pattern defined.")})),h&&J.length>0&&l().createElement(Qn,{items:J,className:K.breadcrumbs}),C?l().createElement(m.Typography,{className:K.errorMessage},C):l().createElement(Cn,{config:t,tree:n,onTreeChanged:F,mode:i,onNodeMoved:G,onParentsRequested:B,onChildrenRequested:z,onToggleNodeCheckbox:Y,checkedNodes:q}))}));var ar=n(36138),lr=n(22664),ir=n(39450),sr=n(585);const cr=(0,ar.createGenerateClassName)({productionPrefix:"hierarchyTree",disableGlobal:!0}),ur=e=>{let{config:t,store:n,onResize:r=u.identity,className:a}=e;return l().createElement(N.Provider,{store:n},l().createElement(ir.m.Provider,{value:t.id},l().createElement(ar.StylesProvider,{generateClassName:cr},l().createElement(lr.MuiPickersUtilsProvider,{utils:o.Z},l().createElement(i.Z,{handleHeight:!0,onResize:(e,t)=>r(Math.floor(e),Math.floor(t))}),t&&l().createElement(or,{config:t,className:a}),l().createElement(sr.Z,null)))))}},99496:(e,t,n)=>{n.d(t,{_n:()=>Za,tM:()=>Ya});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),s=n(36138),c=n(44443),u=n(22664),d=n(24605),p=n(39450),m=n(97094),g=n(60115),f=n(585),h=n(90088),b=n(87918),y=n.n(b),v=n(3096),E=n.n(v),x=n(59431),w=n(60641),O=n(7718),C=n(3515),S=n(17554),P=n(61756),N=n(57730),T=n(76536),k=n(26481),R=n(49759),I=n(94150),D=n(26005),j=n(72249),Z=n(47137),L=n(99136),M=n(30268),A=n(21077),_=n(67268),U=n(71153),H=n.n(U),z=n(8962);const B=o().createContext(null);B.displayName="SingleAttributeContext";var F=n(60995),V=n(10237),W=n(58662),G=n(94079),q=n(93416),$=n(75512),Y=n(30553),Q=n(81149),X=n(32152),K=n(36444),J=n(79692);const ee=(0,J.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),te=e=>{let{className:t}=e;const n=ee(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(B),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(G.Button,{ref:a,classes:{root:H()(n.triggerButton,t)},onClick:u},o().createElement(K.Z,null)),o().createElement(G.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(G.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(G.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:y().text("Show inactive values")})))},ne=(0,J.Z)((()=>({root:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},ovIcon:{marginTop:"2px",marginLeft:"5px"}}))),re=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=ne(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:d,attributeType:p}=(0,r.useContext)(B);return o().createElement(q.Z,{title:t,className:l.root},o().createElement($.Z,{widthToHide:500},o().createElement(Y.Z,{height:24,margin:16}),o().createElement(G.Typography,{className:l.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),o().createElement(Q.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:d,attributeType:p}),o().createElement(X.i,{query:i,onChange:e=>{s(e),c(0)}}),a&&o().createElement(te,null))};var oe=n(65549),ae=n(93140),le=n(76134),ie=n(96698);const se=(0,J.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 -16px 8px",backgroundColor:"rgba(0,0,0,0.12)"},ovFalse:e.inactive,noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px 8px 0"}}))),ce=h.nIW,ue=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ue(n,t)})))):h.P6Y.strings.search(String(e),t),de=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(h.XtP,(0,i.filter)((e=>{let{value:t}=e;return ue(t,l)})))(t,n,r),c=(0,i.filter)(h.OXP,s);return{[(0,h.xy8)(r)]:{[ce(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function pe(){return pe=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},pe.apply(this,arguments)}function me(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){ge(e,t,n[t])}))}return e}function ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fe=[],he=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s,noDataText:c}=e;const u=se(),{uri:d,required:m,cardinality:g,name:f}=n,b=(0,a.useDispatch)(),v=(0,r.useContext)(p.m),E=(0,a.useSelector)(x.ZP.selectors.getEntity),w=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,E.uri)||{})),O=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),C=(0,a.useSelector)((e=>(0,h.tQX)(l,n,x.ZP.selectors.getProfileErrors(e)))),S=(0,a.useSelector)(x.ZP.selectors.getMode),P=(0,h.xy8)(n),N=(0,i.pipe)((0,i.pathOr)(fe,[P,f]),(0,i.map)((0,i.prop)("uri")))(E),T=(0,i.pathOr)(fe,[P,f],w),k=T.map((0,i.prop)("uri")),R=(0,h.ZiX)(E.uri),I=(0,r.useRef)((0,h.gjI)({parentUri:l,attributeType:n})),D=(0,h.O27)(T),j=m&&D,Z=j?[I.current]:T.filter((0,i.pipe)((0,i.prop)("uri"),h.ZiX)),L=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,b)(e.map((e=>me({},e,{viewId:v}))))),[v,b]),M=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.modifyAttribute,b)(me({},e,{viewId:v}))),[v,b]),A=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,b)(me({},e,{viewId:v}))),[v,b]),_=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,b),[b]),U=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return L(j&&!(0,h.YkM)(n.type)?[e,e]:[e])}),[L,l,n,j]),z=(0,h.Vg3)({attributeType:n,mode:S}),B={attributeType:n,errors:O,crosswalks:w.crosswalks,mode:S,onAddAttributes:L,onChangeAttribute:M,onDeactivateError:_,showNonOv:s},F=0===Z.length&&0===t.length;return o().createElement("div",null,o().createElement(ae.Z,{cardinality:g}),o().createElement(le.Z,{message:C}),z&&o().createElement(G.Button,{color:"primary",onClick:U,className:u.moreButton},o().createElement(oe.Z,{classes:{root:u.icon}}),o().createElement("div",{className:u.buttonLabel},y().text("Add"))),Z.map(((e,t)=>o().createElement(ie.Z,pe({key:e.uri},B,{attributeValue:e,lazy:j&&!m,showEmptyEditors:R,ownError:(0,h.ADq)(e,t,d,O),onDeleteAttribute:A})))),Z.length>0&&t.length>0&&o().createElement(G.Divider,{className:u.divider}),t.map((e=>{const t=T.find((0,i.propEq)("uri",e.uri)),n=t||e,r=N.includes(n.uri)&&!k.includes(n.uri),a=!r&&t&&!((e,t)=>{const n=(0,i.is)(Object,e.value)||(0,i.is)(Object,t.value)?(0,i.over)((0,i.lensPath)(["value"]),(0,h.vKJ)({valueTransformer:(0,i.unless)(h.OXP,(0,i.omit)(["value"])),deleteEmptyComplex:!0})):i.identity;return(0,i.equals)(n(e),n(t))})(t,e),l=(0,i.cond)([[(0,i.always)(r),(0,i.always)("deleted")],[(0,i.always)(a),(0,i.always)("edited")]])();return o().createElement("div",{key:n.uri,className:H()({[u.ovFalse]:!(0,h.OXP)(n)})},o().createElement(ie.Z,pe({},B,{attributeValue:n,ownError:(0,h.ADq)(n,null,d,O),onDeleteAttribute:A,state:l})))})),F&&o().createElement(G.Typography,{className:u.noData},c))};var be=n(81303);const ye=e=>{let{values:t,attributeType:n,showInactive:r}=e;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(be.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r}))))},ve=(0,J.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),Ee=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=ve(),{values:u,totalVisibleValues:d,page:p,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:b}=(0,r.useContext)(B),v=(0,a.useSelector)(x.ZP.selectors.getEntityUri),E=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),O=(0,a.useSelector)(x.ZP.selectors.getPivotingAttributes),C=0!==u.length,S=t["text-empty"]||y().text("No data found");return o().createElement(F.J.Provider,{value:O},o().createElement(V.Z,{className:H()(c.root,n)},o().createElement(re,{totalVisibleValues:d,caption:l,showInactiveValuesMenu:s}),o().createElement(G.Box,{className:c.content},(()=>{if(g)return o().createElement(L.Z,null);if(h){if(E&&C){const e={values:u,attributeType:h,showInactive:b};return o().createElement(ye,e)}if(w){const e={values:u,attributeType:h,parentUri:v,showInactive:b,noDataText:S};return o().createElement(he,e)}}return o().createElement(G.Typography,{className:c.noData},S)})()),f&&o().createElement(W.Z,{count:d,page:p,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var xe=n(85229),we=n(20562);function Oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ce=(e,t,n)=>{const{attributeUri:o,max:l=15}=e,s=(0,a.useSelector)(x.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[d,p]=(0,r.useState)(null),[m,g]=(0,r.useState)(!1),f=(0,xe._)(),b=(0,r.useRef)(null),y=(0,a.useDispatch)(),v=(0,a.useSelector)(x.ZP.selectors.getApiPath),E=(0,a.useSelector)(x.ZP.selectors.getTenant),w=n?x.ZP.selectors.getEntityWithDiff:x.ZP.selectors.getEntityWithoutDiff,O=(0,a.useSelector)(w),C=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),S=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),P=(0,a.useSelector)(x.ZP.selectors.getHistoryDiff),N=O.uri,T=ce(o),k=(0,h.xy8)(o);b.current=(0,h.JQy)(O,N,T);const R=(0,r.useMemo)((()=>(0,h.zeJ)(s,o)),[s,o]),{globalFilter:I}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:D}=t,j=(0,r.useCallback)((()=>{if(R&&(0,h.Uty)(R)&&!(0,h.ZiX)(N)&&(0,h.YOQ)(o)){g(!0);const{page:e,showInactive:n}=t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["page","showInactive"]),a=(0,h.biM)(O)||S?de:h.KbL;f(a(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){Oe(e,t,n[t])}))}return e}({metadata:s,entity:O,apiPath:v,tenant:E,parentUri:N,defaultMaxValues:l,attributeTypeUri:o,offset:l*e,globalFilter:I,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([k],e),n=(0,i.pathOr)([],[T],t);S||y(x.N5.actions.processNextPageOfAttributeValues({parentUri:N,attributeTypeUri:o,attributeTypeName:T,values:n})),u(n.map((e=>{var t;return(null===(t=b.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),p((0,i.path)(["paging",o],t))})).finally((()=>{g(!1)}))}else u([]),p(null)}),[v,N,E,o,l,s,t,I,R,S,P]);(0,r.useEffect)((()=>{j()}),[j]),(0,we.D)((()=>{C&&j()}),[C]);const Z=(0,i.partition)(h.OXP),[,L]=Z(b.current||[]),M=D?[]:L,A=D?"totalValues":"totalOvValues",_=(0,i.ifElse)((0,i.has)(A),(0,i.prop)(A),(0,i.always)(c.length))(d),U=l<_,H=null!=d&&d.totalValues?d.totalValues-_:M.length;return{values:c,isLoading:m,hasPaging:U,totalVisibleValues:_,attributeType:R,totalNonVisibleValues:H,nonVisibleValues:M}};function Se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pe=n(37152),Ne=n(31274),Te=n(79026),ke=n(8818),Re=n(90324),Ie=n(70595);const De=o().createContext(null);De.displayName="RelationsViewStateContext";const je=(0,J.Z)((e=>({button:{color:e.palette.text.secondary,width:"36px",minWidth:"36px"},popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{backgroundColor:"rgba(0,0,0,0.1)",margin:"19px -23px"},title:{marginBottom:"30px"},sortControls:{display:"flex",alignItems:"center"},sortSelectorRoot:{flex:1,padding:"13px 16px",fontSize:"0.85rem"},sortSelectorMenuItem:{fontSize:"0.85rem"},sortOrderButton:{flexShrink:0,margin:"0 8px 0 7px"}}))),Ze=e=>{let{className:t}=e;const n=je(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:d,sortOptions:p}=(0,r.useContext)(De),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),b=!(0,h.O27)(p),v="asc"===s;return o().createElement(o().Fragment,null,o().createElement(G.Button,{ref:a,classes:{root:H()(n.button,t)},onClick:f},o().createElement(K.Z,null)),o().createElement(G.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(G.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(G.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),b&&o().createElement(o().Fragment,null,o().createElement(G.Divider,{className:n.divider}),o().createElement(G.Typography,{className:n.title,variant:"h6"},y().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Te.Z,{entries:p,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:d,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),o().createElement(ke.k,{tooltipTitle:v?y().text("Ascending"):y().text("Descending"),icon:v?Re.Z:Ie.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Ze.displayName="FilterButton";const Le=Ze,Me=(0,J.Z)({header:{padding:"0 6px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"}});var Ae=n(61932),_e=n(55847);const Ue=o().createContext(null);function He(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){ze(e,t,n[t])}))}return e}function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Be=Math.pow(2,31)-1,Fe=(0,J.Z)((()=>({tenant:{backgroundColor:"#0000EE",cursor:"pointer",position:"absolute",top:"8px",left:"22px",width:"10px",height:"10px",color:"white",fontSize:"10px",fontWeight:"bold",userSelect:"text",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},button:{position:"relative"},badge:{fontSize:"10px",height:"14px",minWidth:"14px",width:"14px",fontWeight:"bold",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px",top:"4px"}})));var Ve=n(81137);const We=e=>{let{label:t}=e;const n=Fe();return o().createElement(G.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Ae.Z,null))},Ge=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(x.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Ue),i=(0,a.useSelector)(x.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,d]=(0,r.useState)(null),p=(0,a.useSelector)(x.ZP.selectors.getDtssPath),m=(0,a.useSelector)(x.ZP.selectors.getTenant),g=[He({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:Be})],f=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,h.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,h.QXb)({entityUri:i,content:g,dtssPath:p,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return He({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,p,m,o,t]),b=(0,r.useCallback)((()=>{(0,h.MOC)({entityUri:i,content:g,dtssPath:p,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(x.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong")))))),d(null)}),[i,p,m,o,f,l,u,d]);(0,r.useEffect)((()=>{f()}),[f]);const v=(0,r.useCallback)((()=>d(null)),[]),E=(0,r.useCallback)((e=>d(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:b,onCancelConfirmation:v,onImportClick:E}})(),s=Fe(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return o().createElement(o().Fragment,null,!!e.length&&o().createElement(o().Fragment,null,c?o().createElement("div",{className:s.button},o().createElement(ke.k,{size:"L",icon:Ae.Z,tooltipTitle:y().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:H()(s.tenant)},u)):o().createElement(_e.Z,{menuId:"importDT-table-actions",buttonComponent:ke.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>o().createElement(We,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(Ve.Z,{open:!!t,title:y().text("Confirmation"),content:y().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:y().text("Cancel"),saveCaption:y().text("Import"),onDiscard:l,onSave:n})))},qe=e=>{let{title:t,total:n}=e;const a=Me(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(De);return o().createElement(q.Z,{title:t||"",className:a.header},n>0&&o().createElement($.Z,{widthToHide:400},o().createElement(Y.Z,{height:24,margin:16}),o().createElement(G.Typography,{className:a.totalCaption,variant:"caption"},n>1?y().text("${count} items",{count:n}):y().text("${count} item",{count:n}))),o().createElement(X.i,{query:l,onChange:i}),o().createElement(Ge,null),o().createElement(Le,null))};var $e=n(11013),Ye=n(27604),Qe=n(22983),Xe=n(31254),Ke=n(31039);const Je=(0,J.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px"},label:{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},secondaryLabel:{color:"rgba(255, 255, 255, 0.7)",fontSize:"10px",marginTop:"4px",fontWeight:500,lineHeight:"11px"},progress:{marginTop:"4px",color:"#FFFFFF"}})));function et(){return et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},et.apply(this,arguments)}const tt=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["label","entity","children"]);const c=Je(),u=(0,xe._)(),d=(0,a.useSelector)(x.ZP.selectors.getTenant),p=(0,a.useSelector)(x.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,b]=(0,r.useState)(null);(0,r.useEffect)((()=>{b(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&!(0,h.ZiX)(null==n?void 0:n.entityUri)&&(0,i.isNil)(f)){const e=(0,i.ifElse)(h.biM,(e=>(0,h.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:d,dtssPath:p})),(e=>(0,h.XkT)(e.entityUri)));g(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;b(t)})).finally((()=>{g(!1)}))}}),[p,n,d,u,f]),v=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),m&&o().createElement(G.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),f&&o().createElement("div",{className:c.secondaryLabel},f));return o().createElement(G.Tooltip,et({onOpen:y,title:v,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},nt=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,h.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,h.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,h.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,h.Lmx)(t,null==r?void 0:r.relationType)}};var rt=n(77277);const ot=(0,J.Z)((()=>({container:{display:"flex"}})));function at(){return at=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},at.apply(this,arguments)}const lt=e=>{let{acceptRelation:t,ignoreRelation: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={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["acceptRelation","ignoreRelation"]);const a=ot();return o().createElement("div",{className:a.container},o().createElement(rt.Z,at({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),o().createElement(rt.Z,at({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},it=(0,J.Z)((e=>({container:{display:"flex",flexDirection:"column",marginBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"24px",padding:"0 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},editButtonsContent:{marginLeft:"auto",flex:"0 0 40px"},editButtons:{padding:0},removed:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary,margin:"0 5px"}}))),st=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:l,onRemoveRelation:i,onEditRelation:s,onAcceptRelation:c,onIgnoreRelation:u,renderRelationArrowButton:d}=e;const p=it(),{entity:m,relation:g}=t,f=(0,h.$qe)(t),b=(0,h.xr3)(t),v=(0,h.iJH)(t),{entityType:E,entityLabel:w,preparedUri:O,relationLabel:C}=nt(t,n),S=(0,h.Fn9)(g)&&(0,h.Fn9)(m),P=(0,a.useSelector)(x.ZP.selectors.getMode),{canRemove:N,canUpdate:T}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===h.ARY.Editing||n===h.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,h.$qe)(r),i=(0,h.V3K)(t,e);return{canRemove:o&&!l&&(0,h.Edd)(n,i),canUpdate:a&&!l&&(0,h.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:P,onRemoveRelation:i,onEditRelation:s,metadata:n,connection:t}),k=(0,r.useCallback)((()=>i(t.relation.relationUri)),[i,t]),R=(0,r.useCallback)((()=>s(t)),[s,t]),I=(0,r.useCallback)((()=>{c(t)}),[c,t]),D=(0,r.useCallback)((()=>u(t)),[u,t]),j=(N||T)&&l&&!t.suggested?o().createElement(o().Fragment,null,T&&o().createElement(ke.k,{icon:Ye.Z,size:"XS",onClick:R,tooltipTitle:y().text("Edit")}),N&&o().createElement(ke.k,{icon:Qe.Z,size:"XS",onClick:k,tooltipTitle:y().text("Remove")})):void 0,Z=t.suggested?o().createElement(lt,{acceptRelation:I,ignoreRelation:D,size:"small",disabled:v}):void 0,L=v?y().text("ignored"):y().text("edited");return o().createElement("div",{className:H()(p.container,{[p.rowInactive]:!S},{[p.removed]:f||v})},o().createElement("div",{className:p.row},d&&d(),o().createElement(Xe.Z,{className:p.entityAvatar,entityType:E}),o().createElement(Ke.Z,{value:O,className:p.entityLabelContainer},o().createElement(tt,{label:w,entity:m},o().createElement("span",{className:p.entityLabel},w)),(b||v)&&o().createElement(G.Typography,{variant:"caption",className:p.editedLabel},"(",L,")"),C&&o().createElement("span",{className:p.relationLabel},`, ${C}`)),o().createElement("div",{className:p.editButtonsContent},j),Z))}));st.displayName="EditableRelationItem";const ct=st,ut=(e,t)=>{const n=(e,t)=>(t?(0,h.VGB)(t):[]).map((t=>({type:t,direction:e===h.Nsj.IN?h.Nsj.IN:h.Nsj.OUT})));return n(h.Nsj.IN,e).concat(n(h.Nsj.OUT,t))[0]};function dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pt=n(98989),mt=n(83543);const gt=(0,J.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),ft=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=gt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,h.xvW)(n)?null:a?o().createElement(mt.Z,c):o().createElement(pt.Z,c)},ht=(0,J.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),bt=e=>{let{config:t,connection:n,children:l}=e;const i=ht(),{showInactive:s}=(0,r.useContext)(De),{connections:c,showSecondLevel:u,toggleShowSecondLevel:d,loadRelations:p,loading:m,total:g}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),{contentSecondLevel:d}=t,{entity:p}=n,m=(0,a.useSelector)((e=>x.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,p.entityUri)))||[],g=(0,a.useSelector)((e=>x.ZP.selectors.getTotalByViewId(e,t.id,p.entityUri))),{activityFilter:f}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions)||{},b=(0,r.useCallback)((()=>{const e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){dt(e,t,n[t])}))}return e}({},d,{returnObjects:!0,returnDates:!0,activeness:{relation:o||h.Ng6.ALL,entity:f}});u(!0),(0,h.N6e)(p.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(x.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:p.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,d,l,p.entityUri,f,o]),y=(0,r.useCallback)((()=>{i||n.connections||b(),s((e=>!e))}),[b,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:y,loadRelations:b,loading:c,total:g}})({config:t,connection:n,relationActivityFilter:s?h.Ng6.ALL:h.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,h.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(ft,{onClick:d,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Ne.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(Yt,{isLoading:m,config:t,loadRelations:p,connections:c,total:g,parentEntityUri:n.entity.entityUri}))))},yt=(0,J.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px",marginLeft:"16px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 0 8px",backgroundColor:"rgba(0,0,0,0.12)"},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),vt=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const d=(0,a.useSelector)(x.ZP.selectors.getMetadata),p=(0,a.useSelector)((e=>x.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>x.ZP.selectors.getRelationsToEditByViewId(e,l.id))),g=(0,a.useSelector)(x.ZP.selectors.getEntity),f=(0,a.useSelector)((e=>x.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),b=(0,a.useDispatch)(),v=yt(),E=(0,r.useCallback)((()=>{const e=(0,h.vlo)({config:l,mode:s,metadata:d,parentEntityUri:u});(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),b)(e)}),[l,s,d,b,u]),w=(0,r.useCallback)((e=>{b(x.N5.relations.actions.closeRelationEditor(l.id,e)),b(x.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>x.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=x.N5.relations.selectors.getEntityUriFromConnection(t);(0,h.ZiX)(r)&&b(x.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,b]),O=l.content,C=ut(O.inRelations,O.outRelations),S=(0,r.useCallback)((e=>{const t=(0,i.pipe)((0,i.omit)(["suggested"]),(0,i.evolve)({relation:{relationType:(0,i.always)(C.type),object:(0,i.evolve)({type:(0,i.always)(C.type),attributes:(0,i.always)(null)})}}))(e);b(x.N5.relations.actions.addRelation(l.id,t))}),[b,l,C]),P=(0,r.useCallback)((e=>{b(x.N5.relations.actions.ignoreRelation(l.id,{relationType:C.type,relationDirection:C.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[b,l,C]),[N,T]=(0,i.partition)(h.xvW,n),k=g&&f,R=0===N.length&&0===T.length,I=e=>{var t,n;const r=m.find((t=>{var n,r;return(null==t||null===(n=t.relation)||void 0===n?void 0:n.relationUri)===(null==e||null===(r=e.relation)||void 0===r?void 0:r.relationUri)})),a=!l.allowOnlyCreateNew||(0,h.xvW)(e),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(bt,{config:l,connection:e,key:c},(t=>r?o().createElement($e.Z,{connection:r,config:l,mode:s,metadata:d}):o().createElement(ct,{renderRelationArrowButton:t,connection:e,metadata:d,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),b),onAcceptRelation:S,onIgnoreRelation:P})))},D=k&&(!p||p&&p.parentEntityUri===u),j=p&&p.parentEntityUri===u;return o().createElement("div",{className:t},D&&o().createElement(G.Button,{color:"primary",onClick:E,className:v.moreButton},o().createElement(oe.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},y().text("Add"))),j&&o().createElement($e.Z,{connection:p,config:l,mode:s,metadata:d}),N.map(I),N.length>0&&T.length>0&&o().createElement(G.Divider,{className:v.divider}),T.map(I),R&&o().createElement(G.Typography,{className:v.noData},c))};var Et=n(19603),xt=n(94646),wt=n(78101),Ot=n(80931);const Ct=(0,J.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function St(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){Pt(e,t,n[t])}))}return e}function Pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Nt=e=>{let{connection:t,className:n}=e;const l=Ct(),{relation:s}=t,c=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(x.ZP.selectors.getMetadata),d=(0,r.useMemo)((()=>(0,h.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),p=(0,r.useMemo)((()=>St({attributes:St({},x.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,h.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,h.fyF)(d,p)),[d,p]).filter((e=>{let{values:t}=e;return!(0,h.O27)(t)})).length>0,g=(0,r.useMemo)((()=>(0,h.R$r)(p.attributes)),[p]),{getCommentsCount:f}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const b=(0,r.useMemo)((()=>(0,h.wp9)(h.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return m?o().createElement(wt.A.Provider,{value:b},o().createElement(Ot.Z,{className:H()(l.attributesList,n),entity:p,attrTypes:d})):o().createElement("div",{className:H()(l.attributesList,n)},y().text("No attributes"))};var Tt=n(86602),kt=n(82726);const Rt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(ke.k,{className:r,tooltipTitle:t?y().text("Hide attributes of the relationship"):y().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Tt.Z:kt.Z,onClick:n})},It=(0,J.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"16px",padding:"3px 11px 3px 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",wordBreak:"break-all",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},showDetails:{marginLeft:"auto",paddingRight:"5px"},attributesList:{paddingLeft:"46px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0},suggestedWrapper:{backgroundColor:e.suggested},commentsContainer:{marginLeft:"auto",alignItems:"center","& + $showDetails":{marginLeft:"4px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"},labelWrapper:{display:"flex",alignItems:"center"}}))),Dt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=It(),u=t.suggested,{entity:d,relation:p}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityType:b,entityLabel:y,preparedUri:v,relationLabel:E}=nt(t,f),w=(0,h.Fn9)(p)&&(0,h.Fn9)(d),O=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),C=d&&p&&(0,h.wp9)(h.q7e.RELATION,{entityUri:O,connection:t})||[];return o().createElement("div",{className:H()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:H()(c.row,Et.U)},n&&n(),o().createElement("div",{className:c.labelWrapper},o().createElement(Xe.Z,{className:c.entityAvatar,entityType:b}),o().createElement(Ke.Z,{value:v,className:c.entityLabelContainer},o().createElement(tt,{label:y,entity:d},o().createElement("span",{className:c.entityLabel},y)),E&&o().createElement("span",{className:c.relationLabel},`, ${E}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(C)&&o().createElement(xt.Z,{className:c.commentsContainer,uri:(0,h.gjS)(p),relatedObjectUris:C,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(lt,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(Rt,{show:m,onToggle:()=>{g((e=>!e))},className:c.showDetails}))),m&&o().createElement(Nt,{connection:t}))}));Dt.displayName="RelationItem";const jt=Dt;var Zt=n(52691),Lt=n(16208);const Mt=e=>e.filter((e=>5===e.value)).length,At=e=>e.filter((e=>1===e.value)).length,_t=e=>0===e.length?"0%":Mt(e)/e.length*100+"%",Ut=e=>0===e.length?"0%":At(e)/e.length*100+"%",Ht=(0,J.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end"},averageRating:{marginBottom:"7px",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px",color:e.palette.text.primary},scale:{display:"flex",marginBottom:"6px",width:"128px",height:"4px"},likesScale:{height:"100%",backgroundColor:"#8CC152"},dislikesScale:{height:"100%",backgroundColor:"rgb(255, 112, 112)"},counts:{display:"flex"},likesCount:{marginRight:"32px"},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:"rgba(0,0,0,0.38)"}}))),zt=e=>{let{ratings:t,className:n}=e;const r=Ht();return o().createElement("div",{className:H()(r.wrapper,n)},o().createElement(G.Typography,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),o().createElement("div",{className:r.scale},o().createElement("div",{className:r.likesScale,style:{width:_t(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Ut(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:H()(r.likesCount,r.count)},o().createElement(Zt.Z,{className:r.icon}),Mt(t)),o().createElement("div",{className:r.count},o().createElement(Lt.Z,{className:r.icon}),At(t))))},Bt=(0,J.Z)((e=>({wrapper:{display:"flex"},button:{fontSize:"14px",textTransform:"none",color:e.palette.text.secondary},likeButton:{marginLeft:"-12px",marginRight:"8px"},isActive:{color:e.palette.text.primary}}))),Ft=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Bt(),i=(0,a.useSelector)(x.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:y().text("Has left the practice"),onClick:()=>r(y().text("Has left the practice"))},{text:y().text("Has moved away"),onClick:()=>r(y().text("Has moved away"))},{text:y().text("Has passed away"),onClick:()=>r(y().text("Has passed away"))},{text:y().text("Has retired"),onClick:()=>r(y().text("Has retired"))},{text:y().text("Other"),onClick:()=>r(y().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(G.Button,{onClick:n,variant:"text",size:"small",className:H()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(_e.Z,{buttonProps:{endIcon:o().createElement(mt.Z,null),variant:"text",size:"small",className:H()(l.button,{[l.isActive]:1===(null==s?void 0:s.value)})},buttonContent:1===(null==s?void 0:s.value)?s.comment:"Disagree",menuItems:c,menuId:"disagree-dropdown-menu-button"}))},Vt=(0,J.Z)((e=>({wrapper:{padding:"6px 16px 6px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{wordBreak:"break-all",textDecoration:"none"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"18px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 8px 6px 16px",backgroundColor:e.suggested},commentsContainer:{alignSelf:"center","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),Wt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Vt(),d=t.suggested,[p,m]=(0,r.useState)(!1),{entity:g,relation:f}=t,b=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityLabel:y,entityType:v,preparedUri:E,relationLabel:w}=nt(t,b),O=(null==f?void 0:f.ratings)||[],C=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),S=g&&f&&(0,h.wp9)(h.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:H()(u.wrapper,{[u.suggestedWrapper]:d})},o().createElement(G.Box,{display:"flex",minHeight:"44px",className:Et.U},o().createElement(G.Box,{display:"flex",alignItems:"center"},o().createElement(G.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(Xe.Z,{entityType:v,className:u.entityTypeIcon})),o().createElement(G.Box,{display:"flex",flexDirection:"column"},o().createElement(Ke.Z,{value:E,className:u.entityLabelContainer},o().createElement(tt,{label:y,entity:g},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!d&&o().createElement(Ft,{ratings:O,onAgree:()=>{(0,h.Buf)(null==f?void 0:f.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,h.Buf)(null==f?void 0:f.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(xt.Z,{className:u.commentsContainer,uri:(0,h.gjS)(f),relatedObjectUris:S,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),d&&o().createElement(lt,{acceptRelation:s(t),ignoreRelation:c(t)}),!d&&o().createElement(o().Fragment,null,o().createElement(zt,{ratings:O,className:u.ratings}),o().createElement(Rt,{show:p,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),p&&o().createElement(Nt,{connection:t,className:u.relationAttributes}))},Gt=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:s}=e;const{isComplex:c,content:u}=i,{ignoreRelation:d,acceptRelation:p}=((e,t,n)=>{const r=ut(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,h.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===h.Nsj.IN,u=c?a.entityUri:n,d=c?n:a.entityUri;(0,h.DsR)({startEntityUri:u,endEntityUri:d,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong"))))}))}}})(u,l,s),m=(0,r.useMemo)((()=>(0,h.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(C.h);return(0,r.useEffect)((()=>{g(m)}),[g,m]),o().createElement("div",{className:t},n.map((e=>{var t,n;const r=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(bt,{config:i,connection:e,key:r},(t=>c?o().createElement(Wt,{loadRelations:l,connection:e,acceptRelation:p,ignoreRelation:d,renderRelationArrowButton:t}):o().createElement(jt,{acceptRelation:p,ignoreRelation:d,connection:e,renderRelationArrowButton:t})))})))};Gt.displayName="RelationsList";const qt=Gt,$t=(0,J.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Yt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=$t(),{selectors:u}=x.ZP,d=(0,a.useSelector)(u.getEntity),p=(0,a.useSelector)(u.getMode),m=n["text-empty"]||y().text("No data found");return t?o().createElement(L.Z,null):(0,h.KIu)(p)?o().createElement(vt,{connections:l,className:c.list,key:null==d?void 0:d.uri,config:n,mode:p,noDataText:m,parentEntityUri:s}):i>0?o().createElement(qt,{config:n,loadRelations:r,connections:l,className:c.list,key:null==d?void 0:d.uri,mainEnityUri:d.uri}):o().createElement(G.Typography,{className:c.noData},m)},Qt=(0,J.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:0},content:{position:"relative",display:"flex",flexGrow:1,flexDirection:"column",minHeight:0},pagination:{height:"52px",flexGrow:0,flexShrink:0}}),Xt=e=>{let{config:t,className:n}=e;const l=Qt(),{page:s,setPage:c,rowsPerPage:u,sortOrder:d,sortOption:p,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(De),{selectors:b}=x.ZP,y=(0,a.useSelector)((e=>b.getConnectionsWithDraftsByViewId(e,t.id))),v=(0,a.useSelector)(b.getEntity),E=(0,a.useSelector)((e=>b.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(b.getMode),O=(0,r.useMemo)((()=>({order:d,field:p})),[d,p]);(0,r.useEffect)((()=>{f("")}),[null==v?void 0:v.uri]);const C=(0,r.useMemo)((()=>(e=>{const t=h.wSh.fromFalsy(e).map(h.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new h.MEy).addClause(t).build()})(g)),[g]),{isLoading:S,reload:P}=(0,Pe.a)({sorting:O,filter:C,page:s,rowsPerPage:u,config:t,entity:v,relationActivityFilter:m?h.Ng6.ALL:h.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,h.Px$)(y)),[y]),T=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Ne.X.Provider,{value:N},o().createElement(V.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Ue.Provider,{value:T},o().createElement(qe,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(Yt,{isLoading:S,config:t,loadRelations:P,connections:y,total:E}),E>u&&o().createElement(W.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};Xt.displayName="RelationsView";const Kt=o().createContext(null);Kt.displayName="TableAttributeContext";var Jt=n(86361),en=n(26180),tn=n(31276);function nn(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){rn(e,t,n[t])}))}return e}function rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const on="CHANGE_SEARCH_QUERY",an=nn({},en.ZP.actions,{changeSearchQuery:(0,tn.zD)(on)}),ln=(e,t)=>t.type===on?nn({},e,{searchQuery:t.payload,page:0}):en.ZP.reducer(e,t);var sn=n(92332),cn=n(67353);const un={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},dn=(0,J.Z)((()=>({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)",marginBottom:"15px"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},"row-cell--removed":{pointerEvents:"none","& > div":un}}))),pn=(0,cn.Z)((e=>{const t=dn();return o().createElement("div",{className:t.headCell},o().createElement(sn.default,e))}));var mn=n(64091);function gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fn=(e,t)=>{const{uri:n,label:r,children:o,name:a}=e;return(0,i.reject)(i.isNil,{id:(0,h.Tde)(n,t),label:r,dataTypeDefinition:(0,h.PFL)(e),children:null==o?void 0:o.map((e=>fn(e,t.concat({name:a}))))})},hn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),bn=e=>{if((0,h.vZp)(e)){const t=hn(e);return t.length>1?t.slice(0,-1):null}return null},yn=(0,i.map)((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){gn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:bn(e.id),headCellRenderer:pn,rowCellValueRenderer:mn.Z})));var vn=n(99341);function En(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xn=n(52016),wn=n(1876),On=n(60894);const Cn=(0,J.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Sn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=Cn();return o().createElement(q.Z,{title:t,className:u.header},o().createElement(X.i,{query:n,onChange:r}),o().createElement(wn.Z,{enabled:a,onClick:l}),o().createElement(Y.Z,{height:24,margin:4}),o().createElement(On.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};function Pn(){return Pn=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},Pn.apply(this,arguments)}const Nn=(0,n(32528).Z)(((e,t)=>{let{deletedUris:n}=e,{rowValue:{value:r}}=t;return{isRemoved:Boolean(n.find((e=>r.uri===e)))}}))((e=>{let{cell:t,CellValueRenderer:n,isRemoved:r,isSorted:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["cell","CellValueRenderer","isRemoved","isSorted"]);const i=dn();return o().createElement("div",{className:H()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,Pn({key:t,value:e},l)))))}));var Tn=n(85709);const kn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(ke.k,{tooltipTitle:y().text("Edit"),icon:Ye.Z,size:"L",onClick:t}),n&&o().createElement(ke.k,{tooltipTitle:y().text("Remove"),icon:Qe.Z,size:"L",onClick:n}))};function Rn(){return Rn=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},Rn.apply(this,arguments)}const In=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:d,onEdit:p,onDeleteAttribute:m,deletedUris:g}=e;const f=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,n)=>{let{id:r}=n;return(0,i.assoc)(r,((e,t)=>((e,t)=>(0,i.pipe)((0,i.path)(["value"]),(0,h.tT_)(e))(t))(hn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),b=(0,r.useMemo)((()=>yn(t)),[t]),y=dn(),v=(0,a.useSelector)(x.ZP.selectors.getMode),E=(0,h.KIu)(v),w=(0,a.useSelector)(x.ZP.selectors.getMetadata),O=(0,a.useSelector)(x.ZP.selectors.getEntityUri),C=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,O)||{})),{attributeType:S}=(0,r.useContext)(Kt),P=(0,r.useCallback)((e=>o().createElement(Nn,Rn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,T]=(0,r.useState)(null),{canUpdate:k,canDelete:R}=(0,xn.l)(),I=(0,r.useMemo)((()=>"number"!=typeof N||!E||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,E]),D="number"==typeof N&&(j=(0,i.path)([N],n),R(d)&&(0,h.xv5)({attributeType:S,mode:v,attributeValue:j,metadata:w,isReltioCrosswalk:(0,h.KVV)(C.crosswalks,j)}));var j;const Z="number"==typeof N&&(e=>k(d)&&(0,h.yv0)({attributeType:S,mode:v,attributeValue:e,isReltioCrosswalk:(0,h.KVV)(C.crosswalks,e)}))((0,i.path)([N],n)),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);Z&&p(e)}),[p,N,n,Z]),M=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!D)return;const t={parentUri:O,attributeType:S,uri:e.uri,value:e};m(t),T(null)}),[N,n,m,D,S,O]),A=I||!D&&!Z?void 0:o().createElement(kn,{onEdit:Z?L:void 0,onRemove:D?M:void 0}),_=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:y.tableContainer},o().createElement(Tn.Z,{autosizing:!0,maxHeight:477,columnsData:b,rowsData:f,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:T,hoverRowIndex:N,hoveredRowRightContent:A,context:_,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Dn=(0,J.Z)((()=>({actionButtons:{display:"flex",justifyContent:"flex-end",margin:"0 8px 10px","& > button":{fontSize:"14px",lineHeight:"16px",marginLeft:"8px",padding:"10px 8px",backgroundColor:"rgba(98, 2, 238, 0)"}}})));function jn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const d=Dn(),m=(0,a.useSelector)(x.ZP.selectors.getEntityUri),{attributeType:g}=(0,r.useContext)(Kt),f=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),b=(0,a.useSelector)(x.ZP.selectors.getMode),v=(0,a.useDispatch)(),E=(0,r.useContext)(p.m),w=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,v)(e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){jn(e,t,n[t])}))}return e}({},e,{viewId:E}))))),[E,v]),O=(0,h.ZiX)(m),C=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,m,g))),S=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,v),[v]);return o().createElement(o().Fragment,null,o().createElement(ie.Z,{expanded:!0,attributeValue:u,showEmptyEditors:O,onDeleteAttribute:s,onDeactivateError:S,onChangeAttribute:t,onAddAttributes:w,mode:b,crosswalks:f.crosswalks,errors:C,attributeType:g,ownError:(0,h.ADq)(u,null,g.uri,C)}),o().createElement("div",{className:d.actionButtons},o().createElement(G.Button,{onClick:()=>{n(u)}},y().text("Cancel")),o().createElement(G.Button,{color:"primary",disabled:!c,onClick:()=>{l(u)}},y().text("Apply"))))},Ln=(0,J.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",flex:1,overflow:"auto"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function Mn(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){An(e,t,n[t])}))}return e}function An(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=[],Un=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=Ln(),{values:u,page:d,setPage:m,isLoading:g,searchQuery:f,setSearchQuery:b,visibleColumns:v,onFilter:E,onSort:w,onToggleFilters:O,onChangeColumns:C,filters:S,sorting:P,totalVisibleValues:N,hasPaging:T,attributeType:k,showTable:R,allColumnsData:I}=(0,r.useContext)(Kt),{checkHasChanges:D,onChangeAttribute:j,onDeleteAttribute:Z,onAdd:M,onCancel:A,onApply:_,onStartEditing:U,modifiedValues:z,editingValues:B,deletedUris:F}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(x.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const s=(0,a.useDispatch)(),c=(0,r.useContext)(p.m),{attributeType:u,values:d}=(0,r.useContext)(Kt),m=(0,a.useSelector)(x.ZP.selectors.getEntityUri),g=(0,a.useSelector)(x.ZP.selectors.getMetadata),f=(0,r.useCallback)((e=>{(0,i.pipe)(x.N5.actions.modifyAttribute,s)(Mn({},e,{viewId:c}))}),[c,s]),b=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(Mn({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,h.gjI)({parentUri:m,attributeType:u});t(e.uri),f(Mn({},e,{value:(0,h.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:g}),attributeType:u}))}),[m,u]),v=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),E=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=Mn({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),f(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),b(n)}}),[b,f,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),O=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),C=(0,h.KIu)(l),S=(0,h.xy8)(u),P=(0,i.pathOr)(_n,[S,null==u?void 0:u.name],O),N=(0,r.useMemo)((()=>[...P.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(h.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>P.find((0,i.propEq)("uri",e.uri))||e))(d)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[P,n,e,d]),T=(0,r.useMemo)((()=>C?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!P.find((0,i.propEq)("uri",e)))))(d):[]),[P,d]),k=P.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:f,onDeleteAttribute:b,onAdd:y,onCancel:E,onApply:w,onStartEditing:v,modifiedValues:N,editingValues:k,deletedUris:T}})(),$=(0,a.useSelector)(x.ZP.selectors.getMode),Y=(0,h.KIu)($),Q=Y?z:u,{canCreate:X}=(0,xn.l)(),K=X(t)&&k&&(0,h.Vg3)({attributeType:k,mode:$})&&!B.length,J=(0,r.useMemo)((()=>v.map((e=>I.find((0,i.propEq)("id",e))))),[v,I]);return o().createElement(V.Z,{className:H()(c.root,n)},R?o().createElement(o().Fragment,null,o().createElement(Sn,{title:l,total:N,columnsData:I,selectedColumns:v,onChangeColumns:C,searchQuery:f,onChangeSearchQuery:b,filtersEnabled:!!S,onToggleFilters:O}),o().createElement("div",{style:{position:"relative"}},Y&&o().createElement("div",{className:c.editor},K&&o().createElement(G.Button,{color:"primary",onClick:M,className:c.addButton},o().createElement(oe.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},y().text("Add"))),B.map((e=>o().createElement(Zn,{key:e.uri,attributeValue:e,onChangeAttribute:j,onDeleteAttribute:Z,onCancel:A,onApply:_,hasChanges:D(e)})))),J.length>0&&o().createElement(In,{columnsData:J,config:t,values:Q,filters:S,onFilter:E,sorting:P,onSort:w,onEdit:U,onDeleteAttribute:Z,deletedUris:F}),T&&o().createElement(W.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:s,page:d,onChangePage:m}),g&&o().createElement(L.Z,null))):o().createElement(o().Fragment,null,o().createElement(q.Z,{title:l,className:c.header}),o().createElement(G.Typography,{className:c.noData},y().text("No data"))))};var Hn=n(58600);function zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Bn=0;const Fn=()=>Bn++,Vn=e=>{const t={children:[],nodeId:Fn()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let o=t;for(let t=r.length-1;t>=0;t--){const a=r[t],l=e.entities[a.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:Fn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),o.children.push(s),o=s}}return t.children},Wn=(0,J.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.primary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.primary.main,lineHeight:"15px"},selected:{fontWeight:"bold"},wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"}})));var Gn=n(1242);const qn=o().createContext(null);var $n=n(55400);const Yn=e=>{e.target.src=Gn},Qn=e=>{let{node:t}=e;const n=Wn(),l=(0,a.useDispatch)(),i=t.entity.uri,s=(0,a.useSelector)(x.ZP.selectors.getAbsoluteImagePath),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,r.useContext)(qn),d=(0,a.useSelector)(x.ZP.selectors.getUIPath),{uri:p}=(0,a.useSelector)(x.ZP.selectors.getEntity),m=(0,h.ChB)({uiPath:d,uri:i}),g=i===p,f=(0,r.useCallback)((()=>{l(x.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:b},nodeId:y}=t,v=(0,h.nt9)(c,t.entity.type)||{},E=(0,h.VD3)(c,v,"typeGraphIcon"),w=E&&(0,h.vPL)(s,E);return o().createElement("div",{className:n.wrapper,"data-node-id":y},o().createElement("div",{className:n.container},o().createElement(G.Avatar,{className:H()(n.avatar),src:w||Gn,onError:Yn}),o().createElement("span",{className:H()(n.link,{[n.selected]:g})},o().createElement($n.Z,{to:m,onClick:f},b))))},Xn=((0,r.memo)(Qn),e=>{let{node:t}=e;return t.nodeId}),Kn=(0,J.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block"},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"50%",top:0,height:"50%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:"14px",left:"50%",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},row:{display:"flex"},rowContents:{position:"relative",borderLeft:"none",paddingLeft:"4px",flex:"1 1 auto",width:0,display:"flex",verticalAlign:"middle",boxSizing:"border-box"},buttonWrapper:{display:"flex",paddingTop:"13px",width:"12px",cursor:"pointer"},collapsedButton:{transform:"rotate(-90deg)"},expandedButton:{transform:"rotate(0deg)"},button:{transition:"transform .15s ease",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid rgba(0, 0, 0, 0.54)"},rowTitle:{flex:"1 1 auto",width:0,paddingRight:"11px"}})));function Jn(){return Jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jn.apply(this,arguments)}function er(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tr(){return tr=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},tr.apply(this,arguments)}const nr={nodeContentRenderer:e=>{const t=(0,i.omit)(["connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","draggedNode","isSearchMatch","isSearchFocus","buttons","didDrop","children","treeId","isOver","parentNode","rowDirection"],e),{scaffoldBlockPxWidth:n,toggleChildrenVisibility:r,node:a,title:l,path:s,treeIndex:c,style:u}=t,d=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),p=l,m=r&&!a.root&&a.children&&a.children.length>0,g=Kn();return o().createElement("div",tr({style:{height:"100%"}},d,{key:a.nodeId}),m&&a.expanded&&o().createElement("div",{style:{width:n-2},className:g.lineChildren}),o().createElement("div",{className:g.row,style:u},o().createElement("div",{className:g.rowContents},m&&o().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:a,path:s,treeIndex:c})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:H()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof p?p({node:a,path:s,treeIndex:c}):p))))},treeNodeRenderer:e=>{const t=(0,i.omit)(["listIndex","swapFrom","swapLength","swapDepth","draggedNode","getPrevRow","connectDropTarget","isOver","canDrop","treeIndex","treeId","path","rowDirection"],e),{children:n,scaffoldBlockPxWidth:r,lowerSiblingCounts:a,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=Kn(),u=a.length,d=[];a.forEach(((e,t)=>{d.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&o().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:c.verticalLine}),o().createElement("div",{className:c.horizontalLineRight}))))}));const p=l.root?r-4:0,m=r*u-p,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,h=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){er(e,t,n[t])}))}return e}({},s.style,{width:f});return o().createElement("div",Jn({},s,{className:c.node,style:h}),d,o().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function rr(){return rr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rr.apply(this,arguments)}const or=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",rr({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},o().createElement("path",{d:"M14.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm4 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm-17 1a1.5 1.5 0 110-3 1.5 1.5 0 010 3zM4 4a2 2 0 110-4 2 2 0 010 4zm1 16a2 2 0 110-4 2 2 0 010 4zm4.5-6a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm0-2a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm6 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3z",fill:"#000"})))},ar=e=>{let{title:t,onGraphOpen:n}=e;const r=Wn();return o().createElement(q.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(ke.k,{className:r.button,tooltipTitle:y().text("Show Graph"),icon:or,onClick:n,size:"L"})))};var lr=n(9757);const ir=(0,J.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function sr(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){cr(e,t,n[t])}))}return e}function cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ur=e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),l=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{height:u,width:d,tooltip:p}=t,{html:m,visible:g,tooltip:f,customStyles:h,popup:b}=(0,lr.E)(t),y=ir(),v=f||p;(0,r.useEffect)((()=>{a.current&&m&&(a.current.innerHTML="",Array.from(m.childNodes).forEach((e=>{a.current.appendChild(e)})))}),[m]),(0,r.useEffect)((()=>{c(!!b)}),[b]),(0,r.useEffect)((()=>{s&&l.current&&(l.current.innerHTML="",b&&Array.from(b.childNodes).forEach((e=>{l.current.appendChild(e)})))}),[s,b]);const E=(0,i.reject)(i.isNil,{width:d,height:u});return g?o().createElement("div",{className:y.bodyWrapper},o().createElement(G.Dialog,{ref:l,open:!!b}),o().createElement(G.Tooltip,{title:v||""},o().createElement("div",{ref:a,style:sr({},E,h),className:H()(y.root,n)}))):null};var dr=n(14940);const pr=(0,J.Z)({dragHandleContainer:{position:"relative",width:"100%",height:"inherit"},dragHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $dragHandle":{visibility:"visible"},".react-grid-item.static &:hover $dragHandle":{visibility:"hidden"}},dragHandle:{position:"absolute",width:"100%",display:"flex",justifyContent:"center",top:"-3px",zIndex:11,cursor:"move",visibility:"hidden"},dragIcon:{transform:"translateX(-50%) rotate(90deg)",color:"rgba(0, 0, 0, 0.3)"}}),mr=e=>{const t=t=>{const n=pr();return o().createElement("div",{className:n.dragHandleContainer},o().createElement("div",{className:n.dragHandleVisibilityArea},o().createElement("div",{className:H()("viewDraggableHandle",n.dragHandle)},o().createElement(dr.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithDragHandle",t};var gr=n(2256);const fr=e=>{const t=t=>o().createElement(gr.Z,{error:o().createElement(A.ZP,{LogoRenderer:A.B9.ERROR,text:"",secondaryText:y().text("Something went wrong"),variant:A.tC.small})},o().createElement(e,t));return t.displayName="WithErrorBoundary",t},hr=(0,J.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var br=n(29103),yr=n(83911),vr=n(48747),Er=n(22385);const xr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),wr=(0,J.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Or=n(13074),Cr=n(24338);const Sr=(0,J.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Pr=Sr,Nr=e=>{let{totalImages:t}=e;const n=Pr(),r=t>1?y().text("photos"):y().text("photo");return o().createElement(G.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Tr(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){kr(e,t,n[t])}))}return e}function kr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,c.uri)||{})),d=(0,i.pathOr)([],["attributes",n.name],u),p=t.id;return o().createElement(o().Fragment,null,o().createElement(Cr.Z,{attributeValues:d,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(Tr({},e,{viewId:p})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(x.N5.actions.modifyAttribute,s)(Tr({},e,{viewId:p})),imageSize:jr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Nr,{totalImages:d.length}))},Ir=(0,J.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Dr=Ir,jr={imageMargin:4,imageWidth:162,imageHeight:162};var Zr=n(28741);const Lr=(0,J.Z)((e=>({root:{display:"flex",flexDirection:"column"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}})));var Mr=n(49734),Ar=n(98808),_r=n(93428),Ur=n(30885);function Hr(){return Hr=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},Hr.apply(this,arguments)}const zr=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,a.useSelector)(x.ZP.selectors.getEntity),{canMerge:d,canMark:m}=(0,h.hXd)(c,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:Ar.N.iconButton,onStartRequest:l},b=(0,r.useContext)(p.m),y=(0,r.useCallback)((()=>{i(),s(x.N5.entity.actions.loadEntity({viewId:b,uri:u.uri}))}),[s,u.uri,i,b]);return o().createElement(o().Fragment,null,d&&o().createElement(_r.H,Hr({},f,{onFinishRequest:y})),m&&o().createElement(Ur.i,Hr({},f,{onFinishRequest:i})))},Br=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,a.useSelector)(x.ZP.selectors.getMetadata),c=(0,a.useSelector)(x.ZP.selectors.getEntity);return o().createElement(Mr.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:Et.U},o().createElement(xt.Z,{uri:(0,h.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,h.wp9)(h.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:h.q7e.POTENTIAL_MATCH}),o().createElement(zr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Fr={showTransitiveMatches:!0,showInactiveEntities:!1},Vr={order:h.KM9.asc,field:"score"};var Wr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Wr||(Wr={}));const Gr=e=>(0,i.pipe)(fr,mr)(e),qr=Gr((e=>{let{className:t}=e;const n=hr();return o().createElement(V.Z,{className:H()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),$r=Gr((e=>{let{className:t,config:n}=e;return o().createElement(z.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Yr=Gr((e=>{let{className:t,config:n}=e;const a=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),c=Ce(e,s,!0),u=(0,r.useCallback)((()=>{a(0),i((e=>!e))}),[]);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){Se(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},c)})(n);return o().createElement(B.Provider,{value:a},o().createElement(Ee,{config:n,className:t}))})),Qr=Gr((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(x.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,h.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>l?((e,t)=>(0,i.pipe)(((e,t)=>(0,h.WN0)(e,t)),(0,i.map)((e=>fn(e,[t]))),(0,i.chain)(h.HQx),(0,i.uniqBy)((0,i.prop)("id")))(e,t))(o,l):[]),[o,l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),h.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,d]=(0,r.useReducer)(ln,c),{searchQuery:p,filters:m,sorting:g,page:f}=u,b=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>h.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const o=e.find((0,i.propEq)("id",n));return(0,vn.su)(o,r)})))).orSome([]))(s,m);return e.length?e:null}),[m,s]),v=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:f,sorting:g,searchQuery:p})),[y,f,g,p]),{changeSearchQuery:E,changePage:w,toggleSort:O,changeFilter:C,toggleFilters:S,changeColumns:P}=(0,Jt.o)({actions:an,dispatch:d}),N=Ce(e,v,!1);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){En(e,t,n[t])}))}return e}({},u,{setSearchQuery:E,setPage:w,onSort:O,onFilter:C,onToggleFilters:S,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||p||b)&&l&&!l.hidden),allColumnsData:s},N)})(t);return o().createElement(Kt.Provider,{value:l},t&&o().createElement(Un,{config:t,className:n}))})),Xr=Gr((e=>{let{config:t,className:n}=e;const a=(e=>{var t;const n=(0,r.useMemo)((()=>Object.entries(e.sortOptions||{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[e.sortOptions]),o=Number(e.max)||15,[a,l]=(0,r.useState)(0),[i,s]=(0,r.useState)(e.sortOrder||"asc"),[c,u]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[d,p]=(0,r.useState)(""),[m,g]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{l(0),g((e=>!e))}),[]),h=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),b=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:d,changeSearchQuery:(0,r.useCallback)((e=>{l(0),p(e)}),[]),sortOrder:i,toggleSortOrder:h,sortOption:c,changeSortOption:b,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:m,toggleShowInactive:f}})(t);return o().createElement(De.Provider,{value:a},o().createElement(Xt,{config:t,className:n}))})),Kr=Gr(ur),Jr=Gr((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(x.ZP.selectors.getEntityUri),{treeData:s,setTreeData:c}=((e,t)=>{const n=(0,xe._)(),[o,l]=(0,r.useState)([]),s=(0,a.useSelector)(x.ZP.selectors.getEntity);return(0,we.D)((()=>{const e=o.map(((e,t)=>({tree:e,index:t}))).reduce(((e,t)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){zn(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,h.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],s),e);l(t.map((0,i.prop)("root")))}),[null==s?void 0:s.updatedTime]),(0,r.useEffect)((()=>((0,h.ZiX)(e)||n((0,h.RFJ)({uri:e,graphUri:t})).then(Vn).then(l).catch((e=>{console.warn(e)})),()=>{l([])})),[e,t,n]),{treeData:o,setTreeData:l}})(l,t.graph.type),u=Wn(),d=(0,a.useDispatch)(),{id:p,graph:m}=t,g=(0,r.useCallback)((()=>{d(x.ui.actions.openGraph({viewId:p,graphType:m.type,entityUri:l}))}),[d,p,m,l]),f=(0,r.useCallback)((e=>({title:o().createElement(Qn,{node:e.node})})),[]);return o().createElement(V.Z,{className:n},o().createElement(ar,{onGraphOpen:g,title:t.caption}),o().createElement(qn.Provider,{value:t},o().createElement("div",{className:u.treeContainer},o().createElement("div",{className:u.tree},o().createElement(Hn.ZP,{isVirtualized:!1,treeData:s,canDrag:!1,theme:nr,generateNodeProps:f,onChange:c,getNodeKey:Xn})))))})),eo=Gr((e=>{let{config:t,className:n}=e;const l=Lr(),s=(0,a.useSelector)(x.ZP.selectors.getEntity),c=(0,h.wwR)(s),[u,d]=(0,r.useState)(!1),m=(0,r.useCallback)((()=>{d(!0)}),[]),g=(0,r.useCallback)((()=>{d(!1)}),[]),{matches:f,entitiesMap:b,loadMatches:v,total:E}=(0,Zr.s)({enabled:!!c,entity:s,options:Fr,filter:"",page:0,sorting:Vr,rowsPerPage:3,onStartLoading:m,onFinishLoading:g}),w=(0,r.useCallback)((()=>{v()}),[v]),O=(0,a.useDispatch)(),S=(0,r.useContext)(p.m),P=(0,r.useCallback)((()=>{O(x.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:S}))}),[O,S]),N=(0,r.useMemo)((()=>(0,h.NVY)(c,(0,i.map)(h.ev7,f))),[c,f]),{getCommentsCount:T}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{T(N)}),[T,N]);const k=E>3&&!(0,i.isEmpty)(f),R=u?Wr.Loading:(0,i.isEmpty)(f)?Wr.NoData:Wr.Loaded;return o().createElement(Ne.X.Provider,{value:b},o().createElement(V.Z,{className:H()(l.root,n)},o().createElement(q.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},R===Wr.Loading&&o().createElement(L.Z,null),R===Wr.NoData&&o().createElement(G.Typography,{className:l.noData},y().text("No matches found")),R===Wr.Loaded&&f.map((e=>o().createElement(Br,{config:t,entitiesMap:b,match:e,onFinishRequest:w,onStartRequest:m,key:e.object.uri})))),k&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(G.Link,{component:"button",variant:"caption",onClick:P,underline:"none"},y().text("See all"))))))})),to=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,96617)).then((e=>({default:Gr(e.HierarchyTreeView)}))))),no=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,79417)).then((e=>({default:Gr(e.RelationshipsTableView)}))))),ro=Gr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=wr(),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,a.useSelector)(x.ZP.selectors.getEntity),d=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{markers:p,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,xe._)();return(0,r.useEffect)((()=>{i(!0),s((0,h.DBr)(t,[e],n)).then((e=>{a(e.filter(xr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,d),g=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(L.Z,null))),[s]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),b=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return d&&o().createElement(V.Z,{className:H()(s.root,i)},m&&o().createElement(L.Z,null),o().createElement(Er.Z,{size:"S",icon:n?yr.Z:br.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(vr.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:p,mapContainerClassName:s.fullHeight,mapKey:d,mapOptions:b}))})),oo=Gr((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Dr(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(x.ZP.selectors.getMode),d=(0,a.useSelector)(x.ZP.selectors.getEntityWithDiff),p=(0,a.useSelector)(x.ZP.selectors.getMetadata),m=(0,h.zeJ)(p,l),g=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],d),f=(0,i.path)(["attributes","paging",l],d),b=g.length,v=t["text-empty"]||y().text("No data found"),E=(0,r.useCallback)((e=>c(x.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(V.Z,{className:n},o().createElement(q.Z,{title:t.caption}),o().createElement("div",{className:s.container},(()=>{if(m){if((0,h.KIu)(u)){const e={attributeType:m,config:t,paging:f,requestNextPageOfAttributeValues:E};return o().createElement(Rr,e)}if(b>0){const e={attributeValues:g,attributeType:m,imageSize:jr,paging:f,parentUri:d.uri,requestNextPageOfAttributeValues:E};return o().createElement(o().Fragment,null,o().createElement(Or.Z,e),o().createElement(Nr,{totalImages:b}))}}return o().createElement(G.Typography,{className:s.noData},v)})()))}));class ao{}ao.ViewTypes=h.ZIY,ao.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case ao.ViewTypes.HierarchyTree:return o().createElement(to,{config:r,store:n,className:a});case ao.ViewTypes.HierarchyPaths:return o().createElement(Jr,{config:r,className:a});case ao.ViewTypes.RelationsTable:return o().createElement(no,{config:r,store:n,className:a});case ao.ViewTypes.Relations:return o().createElement(Xr,{config:r,className:a});case ao.ViewTypes.Attributes:return o().createElement($r,{className:a,config:r});case ao.ViewTypes.SingleAttribute:return o().createElement(Yr,{config:r,className:a});case ao.ViewTypes.AttributeTable:return o().createElement(Qr,{config:r,className:a});case ao.ViewTypes.Map:return o().createElement(ro,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case ao.ViewTypes.Custom:return o().createElement(Kr,{config:r,className:a});case ao.ViewTypes.ImageAttribute:return o().createElement(oo,{config:r,className:a});case ao.ViewTypes.PotentialMatches:return o().createElement(eo,{config:r,className:a})}},ao.getComponent=e=>ao.getComponentBy("class",e)||ao.getComponentBy("react-class",e)||o().createElement(qr,{className:e.className});const lo=ao,io=()=>null,so=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=hr();return o().createElement(r.Suspense,{fallback:o().createElement(io,null)},lo.getComponent({config:t,store:n,className:H()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));so.displayName="ViewComponent";const co=(0,J.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function uo(){return uo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uo.apply(this,arguments)}const po=["onConfigChanged","onRemove"],mo=e=>{var t;let{layoutItemConfig:n,views:l,className:s,children:c,style:u,isFullscreen:d,onToggleFullscreen:p,AutosizeComponent:m}=e,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const f=l.find((e=>{let{id:t}=e;return n.i===t})),b=co(),y=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{store:v}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const E=f.class===lo.ViewTypes.Custom;if(E&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===h.X1H.CLASSIC)return null;if(f.class===lo.ViewTypes.Map&&!y)return null;const w=(e=>{var t;return null===(t=Object.entries(h.ZIY).find((t=>{let[n,r]=t;return e===r})))||void 0===t?void 0:t[0]})(f.class);return o().createElement("div",uo({},(0,i.omit)(po,g),{"data-reltio-id":f.id,"data-reltio-class":w||"",style:u,className:H()(s,{[b.item]:!E})}),o().createElement("div",{className:H()({[b.fixedSizeContainer]:!m})},m,o().createElement(so,{store:v,config:f,isFullscreen:d,onToggleFullscreen:p,isAutosize:Boolean(m)})),c)},go=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(_.Z,{LayoutItem:mo,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var fo=n(87685);const ho=(0,J.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),bo=e=>{let{notification:t}=e;const n=ho({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(x.ZP.selectors.getAutoCloseInterval),s=t.autoHideDuration||i&&1e3*i||5e3,[c,u]=(0,r.useState)(),[d,p]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(x.ui.actions.closeNotification(t.id)),p(!1))}),[t]),g=(0,r.useCallback)((()=>{c.cancelAction&&l(c.cancelAction),u(void 0)}),[c]),f=(0,r.useCallback)((()=>{l(c.applyAction),u(void 0),l(x.ui.actions.closeNotification(t.id))}),[c,t]),h=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(G.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),p(!1)}},e.label)))),b=o().createElement(o().Fragment,null,o().createElement(Er.Z,{className:n.closeIcon,size:"S",icon:fo.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(G.Portal,{container:document.body},o().createElement(G.Snackbar,{autoHideDuration:s,open:d,classes:{root:n.snackbar},action:h,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:b})),o().createElement(Ve.Z,{open:!!c,title:null==c?void 0:c.confirmationText,content:null==c?void 0:c.confirmationDescription,onSave:f,onDiscard:g,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))},yo=()=>{const e=(0,a.useSelector)(x.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(bo,{key:e.id,notification:e})))):null};var vo=n(72753),Eo=n(43576),xo=n(64459),wo=n(3409),Oo=n(93873),Co=n(22860);function So(){return So=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},So.apply(this,arguments)}const Po=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",So({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M14 17v2H4v-2h10zm6-4v2H4v-2l12.884.001H17l.116-.002L20 13zm-8.457-2H4V9h5.82a8.465 8.465 0 001.723 2zM9.139 6.178l-.289.733.035.088L4 7V5l5.713-.002c-.22.375-.412.768-.574 1.18zM17 2.82a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091 6.451 6.451 0 00-6-4.091zm0 6.815a2.728 2.728 0 010-5.455 2.728 2.728 0 010 5.455zm0-4.365c-.905 0-1.636.73-1.636 1.636 0 .906.73 1.637 1.636 1.637.905 0 1.636-.731 1.636-1.637 0-.905-.73-1.636-1.636-1.636z",id:"svg1467685497a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",{transform:"translate(-4 -2.5)"},o().createElement("mask",{id:"svg1467685497b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg1467685497a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))};function No(){return No=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},No.apply(this,arguments)}const To=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",No({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM20 8H8v12h12V8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg2383396984a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("mask",{id:"svg2383396984b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2383396984a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2383396984b)",d:"M0 0h24v24H0z"})))},ko=(0,J.Z)({editingButtons:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}});function Ro(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){Io(e,t,n[t])}))}return e}function Io(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Do=e=>o().createElement(G.SvgIcon,e,o().createElement(Po,null)),jo=e=>o().createElement(G.SvgIcon,e,o().createElement(To,null)),Zo=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,h.KIu)(a))&&!!(r&&o||!(0,h.fnZ)(a))&&(0,h.uGe)(l,t)})),Lo=e=>{let{className:t,profileBandConfig:n}=e;const l=ko(),s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getCanUserStartProcessFromQuery),u=(0,a.useSelector)(x.ZP.selectors.getEntityWithoutDiff),d=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,u.uri))),p=(0,a.useSelector)(x.ZP.selectors.getMetadata),m=(0,a.useSelector)(x.ZP.selectors.isWorkflowEnabled),g=(0,a.useSelector)(x.ZP.selectors.getMode),f=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),b=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),v=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),E=(0,a.useSelector)(x.ZP.selectors.getProfileOperation),w=null==u?void 0:u.type,O=(0,r.useMemo)((()=>(0,h.nt9)(p,w)),[w,p]),C=E===h.OXy.Saving,S=E===h.OXy.Cloning||C,[P,N]=(0,r.useState)(!1),T=(0,r.useCallback)((()=>{N(!1)}),[]),k=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const o=(0,a.useSelector)(x.ZP.selectors.getEntityWithoutDiff),l=(0,a.useSelector)(x.ZP.selectors.getMetadata),s=(0,a.useDispatch)(),c=null==o?void 0:o.type,u=l.relationTypes,d=(0,r.useCallback)((0,h.Ian)(l,c),[l,c]),p=(0,h.nt9)(l,c),m=(0,r.useMemo)((()=>(0,i.when)((0,i.complement)(i.isNil),(0,i.pipe)((0,i.find)((0,i.pipe)((0,i.propOr)([],"entityTypeUris"),(0,i.either)((0,i.includes)(c),(0,i.includes)("*")))),(0,i.when)((0,i.complement)(i.isNil),(0,i.omit)(["entityTypeUris"]))))(t)),[t,c]),g=(0,r.useCallback)((()=>{if(m){const e=(0,i.pipe)((0,i.prop)("relationshipTypesToCopy"),(0,i.cond)([[i.isNil,(0,i.pipe)((0,i.always)(p),(0,i.propOr)([],"attributes"),(0,i.filter)(h.YkG),(0,i.map)(h.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(d))],[i.T,i.identity]]))(m);s(x.N5.entity.actions.entityCloneRequested({data:Ro({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,p,u,o.uri,d]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:T}),R=(0,r.useMemo)((()=>[{label:y().text("Editing"),value:h.fO_.EDITING,description:y().text("Edit profile directly"),icon:Eo.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:h.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:Do,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:h.fO_.VIEWING,description:y().text("Read or print profile"),icon:vo.Z,permission:"READ"}]),[]),I=(0,r.useMemo)((()=>[...k?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:jo,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:Qe.Z,onClick:()=>{window.confirm(y().text("Are you sure you want to delete this?"))&&s(x.N5.entity.actions.entityRemoveRequested({entityUri:u.uri}))},permission:"DELETE"}]),[s,u.uri,k]),D=!v&&!(0,h.biM)(u)&&!(e=>(0,h.uGe)(h.BDP.READ,e)&&!(0,h.uGe)(h.BDP.UPDATE,e)&&!(0,h.uGe)(h.BDP.DELETE,e)&&!(0,h.uGe)(h.BDP.INITIATE_CHANGE_REQUEST,e))(O),j=(0,h.ZiX)(null==u?void 0:u.uri),Z=(0,r.useMemo)((()=>Zo(R,O,j,m,c)),[R,O,m,c,j]),L=(0,r.useMemo)((()=>Zo(I,O,j,m,c)),[I,O,m,c,j]),M=(0,r.useCallback)((e=>{s(x.N5.mode.actions.modeUpdated(e))}),[s]),A=(0,r.useCallback)((()=>{s(x.N5.mode.actions.modeCancelEditing())}),[s]),_=(0,r.useCallback)((()=>{s(x.N5.actions.saveProfile())}),[s]);return o().createElement(o().Fragment,null,o().createElement(xo.Z,{className:H()(t,Et.U),entity:f&&d?d:u},o().createElement(G.Box,{display:"flex",alignItems:"center"},o().createElement(G.Box,{mr:3},f&&o().createElement(G.Box,{className:l.editingButtons},o().createElement(G.Button,{variant:"outlined",onClick:A,"data-reltio-id":"reltio-profile-cancel-editing",disabled:S},y().text("Cancel")),o().createElement(G.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:_,disabled:S},(0,h.fnZ)(g)?y().text("Suggest"):y().text("Save"))),v&&b?o().createElement(wo.Z,null):b&&o().createElement(Oo.a,null)),D&&o().createElement(Co.T,{optionsGroup:Z,buttonsGroup:L,value:g,onChange:M,disabled:S})),o().createElement(G.Box,{className:l.comments},o().createElement(xt.Z,{uri:u.uri,relatedObjectUris:(0,h.wp9)(h.q7e.ENTITY,{entityUri:u.uri}),objectType:h.q7e.ENTITY}))),!!k&&o().createElement(Ve.Z,{open:P,title:y().text("Do you want to create a clone of the profile?"),content:y().text("Cloning will create a copy of the current profile. You can modify the cloned profile in the next step. Are you sure you want to proceed?"),onSave:k,onDiscard:T,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))};var Mo=n(71820),Ao=n(85890),_o=n(26789),Uo=n(54362),Ho=n(6674),zo=n(91515),Bo=n(52043),Fo=n(17308),Vo=n(39827),Wo=n(80147),Go=n(76569);const qo=(0,J.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),$o=()=>{const{total:e}=(0,r.useContext)(I.O),t=qo();return o().createElement(G.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Go.Z,null))};var Yo=n(26313),Qo=n(9371),Xo=n(4426);const Ko=(0,J.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Jo=()=>{const e=Ko(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(C.h),i=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const s=(0,Yo.Q)(n);return o().createElement(Ne.X.Provider,{value:s},o().createElement(G.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Qo.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(G.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(Xo.Z,{className:e.showMoreIcon}),y().text("Show more"))))};var ea=n(39445);const ta=(0,J.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),na=()=>{const e=ta(),{tasks:t,loading:n}=(0,r.useContext)(I.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(L.Z,null),t&&t.map((e=>o().createElement(ea.s,{key:e.taskId,task:e}))))};function ra(){return ra=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},ra.apply(this,arguments)}const oa=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",ra({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M4 17.17L5.17 16H20V4H4v13.17zM20 2c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h16zm-3 9H7v2h10v-2zm0-4H7v2h10V7z",id:"svg2697213709a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",null,o().createElement("g",{transform:"translate(-2 -2)"},o().createElement("mask",{id:"svg2697213709b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2697213709a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2697213709b)",d:"M0 0h24v24H0z"})))))},aa=()=>{const{commentsMap:e}=(0,r.useContext)(C.h),t=qo();return o().createElement(G.Badge,{badgeContent:(0,h.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(oa,null))};var la=n(10159);const ia=()=>o().createElement(la.Z,{text:y().text("Ready to go with the flow?"),secondaryText:y().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),sa=()=>o().createElement(la.Z,{text:y().text("Care to join the conversation?"),secondaryText:y().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function ca(){return ca=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},ca.apply(this,arguments)}const ua=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",ca({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{d:"M14.101 16A5.003 5.003 0 0016 18.987V20H2v-4h12.101zM22 18.987V20v-1.013zM4 17v2h2v-2H4zM16 4v1.013A5.004 5.004 0 0014.101 8H2V4h14zm6 0v1.013V4zM6 7V5H4v2h2zm8 3v4H2v-4h12zM4 11v2h2v-2H4zm12 4v-2h6v2c0 1.3-.84 2.4-2 2.82V22h-2v-4.18c-1.16-.42-2-1.52-2-2.82zm0-6c0-1.3.84-2.4 2-2.82V2h2v4.18c1.16.42 2 1.52 2 2.82v2h-6V9z",fill:"#000",fillOpacity:".54"}))},da=(0,J.Z)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),pa=()=>{const e=da(),t=(0,a.useSelector)(x.ZP.selectors.getDBConnectorSideViews);return o().createElement("div",{className:e.wrapper},t.map((t=>o().createElement(ur,{key:t.id,config:t,className:e.itemWrapper}))))};function ma(){return ma=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},ma.apply(this,arguments)}let ga;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(ga||(ga={}));const fa=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},ha=()=>{var e,t,n;const l=qo(),s=(0,a.useSelector)(x.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(x.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(x.ZP.selectors.isCollaborationSideViewEnabled),d=(0,a.useSelector)(x.ZP.selectors.isDBConnectorSideViewEnabled),p=(0,a.useSelector)(x.ZP.selectors.isCollaborationEnabled),m=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent),g=(0,a.useSelector)(x.ZP.selectors.getMetadata),f=(0,a.useSelector)(x.ZP.selectors.getEntity),b=(0,r.useContext)(I.O),v=(0,r.useContext)(C.h),[E,w]=(0,r.useState)(null),O=(0,r.useCallback)((e=>{w((t=>t===e?null:e))}),[]),S=(0,r.useCallback)((()=>{w(null)}),[]),P=null!==E,N=E===ga.History,{isHistoryEnabled:T,isProfilePersisted:k}=(0,Mo.C)({isHistoryTabActive:N,entity:f}),{historyFilter:R,onApplyFilter:D,isLoading:j,historicUris:Z,historyWithTotal:L,canLoadMore:M,onLoadMore:A}=(0,Ao.k6)({entity:f,enabled:T}),_=s&&c&&!(0,h.ZiX)(null==f?void 0:f.uri),U=u&&p,H=(0,h.mdt)(null==v?void 0:v.commentsMap),z=[{buttonProps:{id:ga.Workflow,icon:$o,tooltipTitle:y().text("Workflow")},content:null!=b&&b.total?o().createElement(na,null):o().createElement(ia,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:fa(null==b?void 0:b.total),rightContent:o().createElement(_o.G,null)},hidden:!_},{buttonProps:{id:ga.Collaboration,icon:aa,tooltipTitle:y().text("Collaboration")},content:H?o().createElement(Jo,null):o().createElement(sa,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:fa(H)},hidden:!U},{buttonProps:{id:ga.History,icon:Wo.Z,tooltipTitle:y().text("History")},content:k?o().createElement(Uo.Z,{isLoading:j,historyWithTotal:L,contributorsUris:Z,entityUri:null==f?void 0:f.uri,historyEvent:m,onLoadMore:A,canLoadMore:M}):o().createElement(Ho.Z,null),headerProps:{content:o().createElement(zo.Z,{total:k?((null==Z?void 0:Z.length)||0)+1:void 0,entityType:(0,h.nt9)(g,null==f?void 0:f.type),filter:R,onApplyFilter:D})}},{buttonProps:{id:ga.DBConnector,icon:ua,tooltipTitle:y().text("D&B Connector")},content:o().createElement(pa,null),headerProps:{mainTitle:y().text("D&B Connector")},hidden:!d}],B=(0,i.reject)((0,i.propEq)("hidden",!0))(z);return(0,r.useEffect)((()=>{var e;null!==(e=z[E])&&void 0!==e&&e.hidden&&S()}),[E,z,S,B]),o().createElement("div",{className:l.wrapper},o().createElement(Bo.h,{open:P,width:480},!(null!==(e=z[E])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(Fo.P,ma({},null===(t=z[E])||void 0===t?void 0:t.headerProps,{onClose:S})),null===(n=z[E])||void 0===n?void 0:n.content)),o().createElement(Vo.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(z),onButtonClick:O,activeIndexId:E}))};var ba=n(39781),ya=n(16715);const va="48px",Ea="1px solid rgba(0, 0, 0, .125)",xa=(0,J.Z)((e=>({accordion:{borderTop:Ea,borderBottom:Ea,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:va,minHeight:va,"&$accordionSummaryExpanded":{height:va,minHeight:va}},accordionSummaryHeading:{flex:1,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular},accordionSummaryExpanded:{},accordionSummaryContent:{display:"flex",alignItems:"center"},accordionDetails:{maxHeight:"21vh",overflow:"auto",paddingTop:0,paddingBottom:0,"& ul":{paddingLeft:"23px",marginTop:"3px"},"& li":{paddingLeft:"9px",paddingBottom:"8px"}},parents:{color:e.palette.text.primary},errorWrapper:{lineHeight:"18px",display:"flex",flexDirection:"column"},errorTitle:{display:"flex",alignItems:"center"},goToIcon:{marginLeft:"4px"},errorsAccordion:{backgroundColor:"#FFF4F6",borderColor:"#FFB8B3"},errorsAccordionDetails:{color:"#DD2C00"},warningsAccordion:{backgroundColor:"#FFF9ED",borderColor:"#FFDD91"},warningsAccordionDetails:{color:"#CC7500"},icon:{marginRight:"8px"},errorIcon:{fill:"#FF1744"},warningIcon:{fill:"#F9A825"}}))),wa=xa;var Oa=n(38016);const Ca=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=wa();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:d}=e;return o().createElement(G.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(G.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(Oa.Z,null)},i,o().createElement(G.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(G.AccordionDetails,{className:H()(l.accordionDetails,d)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));function Sa(){return Sa=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},Sa.apply(this,arguments)}Ca.displayName="ErrorsPanel";const Pa=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Sa({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.245 12.75c0 .825-.467 1.5-1.045 1.5H4.8c-.583 0-1.05-.675-1.05-1.5v-7.5c0-.832.467-1.5 1.05-1.5h8.4c.578 0 1.05.668 1.05 1.5l-.005 7.5zM9.75 9.96v1.642l3-2.805L9.75 6v1.598c-2.918.404-4.08 2.4-4.5 4.402 1.043-1.402 2.415-2.04 4.5-2.04z",fill:"#000",fillOpacity:".54"}))},Na=(0,i.omit)(["deactivated","path"]),Ta=(0,r.memo)((e=>{let{error:t}=e;const n=wa(),l=(0,a.useSelector)(x.ZP.selectors.getMetadata),s=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),c=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===h.NIO.missed&&r===h.zHr.local){const t=l||(0,h.zeJ)(e,a);return t?y().text("${attribute} is required",{attribute:t.label}):o}return o})(l,t),u=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[h.HAc.attributeValue,h.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t),{highlightError:d}=(0,r.useContext)(Z.M),p=t.uri||t.parentUri&&t.attributeTypeUri;return o().createElement("li",null,o().createElement("div",{className:n.errorWrapper},o().createElement("span",{className:n.errorTitle},c,p&&s&&o().createElement(ke.k,{icon:Pa,size:"XXS",onClick:()=>d(t),tooltipTitle:y().text("Go to error"),className:n.goToIcon})),u&&o().createElement("span",{className:n.parents},u)))}));Ta.displayName="Error";const ka=()=>{const e=wa(),t=(e=>{const t=(0,r.useRef)(e);return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&(0,i.equals)(e.map(Na),t.map(Na))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(x.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(h.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:y().text("${number} ${errors}",{number:n.length,errors:1===n.length?y().text("error"):y().text("errors")}),icon:o().createElement(ba.Z,{className:H()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:y().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?y().text("warning"):y().text("warnings")}),icon:o().createElement(ya.Z,{className:H()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{c("errors")}),[n]);const d=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(Ca,{panels:u,expandedPanelId:s,onToggle:d,ErrorComponent:Ta}):null},Ra=(0,J.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},scrollWrapper:{flexGrow:1,overflowY:"auto"},emptyState:{backgroundColor:"#FAFAFA",height:"100%"},profileWrapper:e=>{let{maxWidth:t}=e;return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,maxWidth:t?`${t}px`:"100%"}},profileContainer:{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"}}))),Ia={},Da=(0,r.memo)((e=>{var t;let{config:n,saveState:l,getSavedState:i}=e;const s=Ra({maxWidth:null==n?void 0:n.maxWidth}),c=(0,a.useDispatch)(),u=(0,r.useCallback)((()=>i().then((e=>e.layout?{}:e))),[i]),d=(0,r.useRef)(),p=(0,r.useCallback)((0,h.DsO)(l,1e3),[l]),m=(0,a.useSelector)(x.ZP.selectors.getEntity),g=null!=n&&n.nestedRoute?`/${n.nestedRoute}`:"",f=m?m.type:null,b=f&&n?f+g:null,{isLoaded:v,savedState:_=Ia,updateSavedState:U}=(0,w.w)({getSavedState:u,saveState:p,entityTypeUri:b}),[H,z]=(0,r.useState)([]),[B,F]=(0,r.useState)([]),V=(0,r.useMemo)((()=>E()(n)),[n]),W=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),G=(0,r.useMemo)((()=>(0,h.dvH)(m)),[m]),q=(0,O.C)({objectIds:G}),$=(0,r.useContext)(C.h),Y=(0,S.U)(),Q=(0,P.v)(null==n?void 0:n.workflow),X=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent);(0,N.a)({entity:m,historyEvent:X});const K=(0,T.u)(),J=(null===(t=(0,a.useSelector)(x.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"";(0,r.useEffect)((()=>{if(v){const e=V!==_.configHash,{views:t,layout:r}=(0,h.Mfk)({views:e||!_.views?n.views:_.views,layout:e?n.layout:_.layout});F(t),z(r)}}),[v,_,b]),(0,r.useEffect)((()=>{c(x.N5.views.actions.profileViewsSet(B))}),[c,B]),(0,r.useEffect)((()=>{n.sidePanelViews&&c(x.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>{d.current&&(d.current.scrollTop=0)}),[null==m?void 0:m.uri]),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(x.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(x.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,h.biM)(n),s=(0,a.useSelector)(x.ZP.selectors.getMode),c=(0,a.useSelector)(x.ZP.selectors.getProfileViews),u=c&&c.length>0,d=(0,r.useCallback)((0,h.DsO)((t=>{t&&e(x.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,h.ZiX)(o)&&s===h.ARY.Viewing&&u;d(e)}),[d,i,t,l,o,s,u])})();const ee=(0,r.useCallback)((e=>{U({layout:e,views:B,configHash:V}),z(e)}),[U,V,B]),te=d.current,ne=(0,r.useMemo)((()=>({element:te,priority:["top","bottom"]})),[te]);return o().createElement(k.j.Provider,{value:!0},o().createElement(R.s.Provider,{value:Y},o().createElement(C.h.Provider,{value:W?$:q},o().createElement(I.O.Provider,{value:Q},o().createElement(D.m.Provider,{value:K},o().createElement(j.l.Provider,{value:J},o().createElement(Z.R,null,o().createElement("div",{className:s.perspectiveView},(!v||!(null!=m&&m.uri))&&o().createElement(L.Z,null),v&&null!=m&&m.uri?o().createElement("div",{className:s.profileContainer},o().createElement("div",{className:s.profileWrapper},o().createElement(Lo,{profileBandConfig:n.profileBand}),!W&&o().createElement(ka,null),o().createElement("div",{ref:d,className:s.scrollWrapper},o().createElement(M.p.Provider,{value:ne},o().createElement(go,{layout:H,onLayoutChanged:ee,views:B})))),o().createElement(ha,null)):o().createElement("div",{className:s.emptyState},o().createElement(A.ZP,{LogoRenderer:A.B9.NO_DATA,text:y().text("No data to display."),variant:A.tC.embedded})),o().createElement(yo,null)))))))))}));Da.displayName="ProfilePerspectiveView";const ja=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),Za=e=>{let{config:t,store:n,onResize:b=i.identity,saveState:y,getSavedState:v,qxSandboxApi:E}=e;const x=(0,r.useCallback)((0,h.aYu)(v),[v]),{SnackbarRenderer:w,showSnackbarMessage:O}=(0,d.D)(),C=(0,r.useMemo)((()=>t&&(0,h.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(p.m.Provider,{value:null==C?void 0:C.id},o().createElement(m.S.Provider,{value:O},o().createElement(g.Y.Provider,{value:E},o().createElement(s.StylesProvider,{generateClassName:ja},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>b(Math.floor(e),Math.floor(t))}),C&&o().createElement(Da,{config:C,saveState:y,getSavedState:x}),o().createElement(f.Z,{showErrorFromStore:!0}),o().createElement(w,null))))))))};var La=n(82842),Ma=n(51229),Aa=n(91131);const _a=(0,J.Z)((e=>({titleContainer:{overflow:"hidden",fontSize:"16px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",alignItems:"center",display:"flex",minHeight:"48px",color:e.palette.text.secondary},link:{fontSize:"16px",fontWeight:"normal"},icon:{height:"18px",color:e.palette.text.secondary},totalCaption:{lineHeight:"inherit",fontSize:"14px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px"},totalNumber:{fontSize:"16px",color:"rgba(0,0,0,0.87)",marginRight:"5px",fontWeight:500}}))),Ua=e=>{let{total:t=0}=e;const n=_a(),l=(0,a.useDispatch)(),i=(0,r.useContext)(p.m),s=(0,r.useCallback)((()=>{l(x.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(q.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(G.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},y().text("Profile")),o().createElement(Aa.Z,{className:n.icon}),y().text("Tags")),o().createElement(Ma.Z,null),o().createElement(G.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var Ha=n(20404);const za=(0,J.Z)((e=>({toolbar:{display:"flex",flexShrink:0,background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"16px"},avatar:{color:"rgba(0, 0, 0, 0.38)",marginRight:"12px"},label:{fontSize:"20px",letterSpacing:"0.25px",lineHeight:"1.2",fontWeight:500,color:e.palette.text.primary,wordBreak:"break-word"}}))),Ba=e=>{let{label:t}=e;const n=za();return o().createElement(G.Toolbar,{className:n.toolbar},o().createElement(Ha.Z,{className:n.avatar}),o().createElement(G.Typography,{variant:"h6",className:n.label},t))};function Fa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Va(e,t,n[t])}))}return e}function Va(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wa=(0,J.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},tagsContainer:{display:"flex"},fullHeight:{flexGrow:1,height:0},tagsView:{margin:"16px",width:"100%",paddingTop:"4px"},listContainer:{flex:1,display:"flex",overflow:"hidden",position:"relative",flexDirection:"column",minHeight:"4px"},entitiesList:{overflowY:"auto",flexGrow:1},pagination:{flexGrow:0}}))),Ga=[25,50,100],qa=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=Wa(),[s,c]=(0,r.useState)(Ga[0]),[u,d]=(0,r.useState)(0),p=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{d(0)}),[t,n,p]);const{isLoading:m,total:g,entities:f}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const s=(0,a.useDispatch)(),c=(0,xe._)(),u=(0,xe._)(),[d,p]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,b]=(0,r.useState)([]),{requestEntities:v,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(x.ZP.selectors.getTenant),s=(0,a.useSelector)(x.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,h.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),d=!!c,p=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Fa({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return d?(0,h.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,h.E7G)(c))):(0,h.ZOr)(e,t)}),[d,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>p(u,Fa({offset:t,max:e},o))),[u,o,p]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(d?(0,h.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,h.j_Q)(u,e)).then((e=>e.total))}),[u,o,d,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(x.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong")))),g(0)}),[s]);return(0,r.useEffect)((()=>{c(E()).then(g).catch(w)}),[E,c,w]),(0,r.useEffect)((()=>{p(!0),u(v(l,o*l)).then(b).catch(w).finally((()=>p(!1)))}),[o,l,v,u,w]),{isLoading:d,total:m,entities:f}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),b=(0,r.useRef)(null);(0,r.useEffect)((()=>{b.current&&(b.current.scrollTop=0)}),[f]);const v=g>Ga[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(Ba,{label:t}),o().createElement("div",{className:H()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(V.Z,{className:l.tagsView},o().createElement(Ua,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(L.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:b},o().createElement(La.Z,{entities:f})),v&&o().createElement("div",{className:l.pagination},o().createElement(W.Z,{count:g,rowsPerPageOptions:Ga,rowsPerPage:s,page:u,onChangePage:d,onChangeRowsPerPage:c}))))))}));qa.displayName="TagPerspectiveView";const $a=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Ya=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(p.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:$a},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(qa,{tag:n,entityUri:r}),o().createElement(f.Z,{showErrorFromStore:!0}))))}},79417:(e,t,n)=>{n.r(t),n.d(t,{RelationshipsTableView:()=>Qe});var r=n(8598),o=n(24328),a=n.n(o),l=n(44443),i=n(17440),s=n(52730),c=n(59431),u=n(65549),d=n(94079),p=n(13980),m=n.n(p),g=n(87918),f=n.n(g),h=n(79692);const b=(0,h.Z)({addButton:{marginLeft:"12px",padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},label:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),y=e=>{let{onClick:t}=e;const n=b();return a().createElement(d.Button,{color:"primary",className:n.addButton,onClick:t},a().createElement(u.Z,{classes:{root:n.icon}}),a().createElement("div",{className:n.label},f().text("Add")))};y.propTypes={onClick:m().func};const v=y;var E=n(71153),x=n.n(E),w=n(90088);const O={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},C={color:"rgba(0,0,0,.54)"},S=(0,h.Z)((e=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},entityCell:{display:"flex",alignItems:"center",height:"100%"},entityLabel:{fontSize:"15px",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","$row-cell--removed &":O,"$row-cell--inactive &":C},entityAvatar:{transform:"scale(0.7)",margin:"0 10px"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > :not($entityCell)":O},"row-cell--inactive":C})));function P(){return P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P.apply(this,arguments)}const N=e=>{let{cell:t,CellValueRenderer:n,rowValue:{connection:r},isSorted:o}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["cell","CellValueRenderer","rowValue","isSorted"]);const i=S(),s=(0,w.$qe)(r),c=(0,w.Fn9)(r.relation)&&(0,w.Fn9)(r.entity);return a().createElement("div",{className:x()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:s,[i["row-cell--inactive"]]:!c},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,P({key:t,value:e},l)))))};N.propTypes={rowValue:m().object,cell:m().object,CellValueRenderer:m().elementType,isSorted:m().bool};const T=N;var k=n(85709),R=n(94656),I=n(39450),D=n(31254),j=n(95613);const Z=e=>{let{value:{entityType:t,entity:n}}=e;const r=(0,s.useDispatch)(),l=(0,o.useContext)(I.m),u=S(),d=(0,w.idV)(n.entityLabel),p=(0,w.wwR)({uri:n.entityUri,dataTenant:n.dataTenant});return a().createElement("div",{className:u.entityCell},a().createElement(D.Z,{className:u.entityAvatar,entityType:t}),a().createElement(j.Z,{value:d},a().createElement("span",{className:u.entityLabel,onClick:(0,i.pipe)((0,i.always)({uri:p,viewId:l}),c.ui.actions.openEntity,r)},d)))};Z.propTypes={value:m().shape({entity:m().shape({entityUri:m().string,entityLabel:m().string}),entityType:w.p8l})};const L=Z;var M=n(92332);const A=(0,n(67353).Z)((e=>{const t=S();return a().createElement("div",{className:t.headCell},a().createElement(M.default,e))}));var _=n(64091);const U=(0,i.pipe)((0,i.map)((e=>e.uri||e)),i.uniq);function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const z=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),B=e=>{if(e.startsWith("relation.attributes")){const t=z(e);return t.length>1?t.slice(0,-1):null}return null},F=(0,i.map)((e=>{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){H(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:B(e.id),headCellRenderer:A,rowCellValueRenderer:(t=e.id,"entity.label"===t?L:_.Z)});var t})),V=(0,h.Z)({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},emptyData:{marginBottom:"30px"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}});var W=n(27604),G=n(22983);const q=e=>{let{canUpdate:t,canRemove:n,handleEditRelation:r,handleRemoveRelation:o}=e;return a().createElement(a().Fragment,null,t&&a().createElement(d.Tooltip,{title:f().text("Edit")},a().createElement(d.IconButton,{onClick:r},a().createElement(W.Z,null))),n&&a().createElement(d.Tooltip,{title:f().text("Remove")},a().createElement(d.IconButton,{onClick:o},a().createElement(G.Z,null))))};q.propTypes={canUpdate:m().bool,canRemove:m().bool,handleEditRelation:m().func,handleRemoveRelation:m().func};const $=q;function Y(){return Y=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},Y.apply(this,arguments)}const Q=e=>{let{mode:t,columnsData:n,connections:r,metadata:l,sorting:s,onSort:u,filters:d,onFilter:p,onEditRelation:m,onRemoveRelation:g,basicTableRef:f,allowOnlyCreateNew:h}=e;const b=(0,o.useMemo)((()=>((e,t,n)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,r)=>{let{id:o}=r;return(0,i.assoc)(o,((e,t,n)=>{let{entity:r,relation:o}=t;switch(e){case"entity.label":return{entity:r,entityType:(0,w.nt9)(n,r.entityType)};case"relation.label":return o.relationLabel||(0,w.Lmx)(n,o.relationType);case"relation.activeness.startDate":return o.startDate;case"relation.activeness.endDate":return o.endDate;default:return((e,t)=>(0,i.pipe)((0,i.path)(["object","attributes"]),(0,w.tT_)(e))(t))(z(e),o)}})(o,e,n),t)}),{}),(0,i.assoc)("connection",e))(t))))(r,n,l)),[r,n,l]),y=(0,o.useMemo)((()=>F(n)),[n]),v=V(),E=(0,o.useCallback)((e=>a().createElement(T,Y({},e,{isSorted:!!s&&s.field===e.columnData.id}))),[s]),[x,O]=(0,o.useState)(null),{canRemove:C,canUpdate:S}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a,allowOnlyCreateNew:l}=e;const i=(0,w.xvW)(r);if(c.N5.mode.selectors.getIsEditableMode(n)&&r&&(!l||i)){const{relation:{relationType:e}}=r,l=(0,w.$qe)(r),i=(0,w.V3K)(t,e);return{canRemove:o&&!l&&(0,w.Edd)(n,i),canUpdate:a&&!l&&(0,w.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:t,onRemoveRelation:g,onEditRelation:m,metadata:l,allowOnlyCreateNew:h,connection:(0,i.path)([x,"connection"],b)}),P=(0,o.useCallback)((e=>O(e)),[]),N=(0,o.useCallback)((()=>m((0,i.path)([x,"connection"],b))),[x,m,b]),R=(0,o.useCallback)((()=>g((0,i.path)([x,"connection","relation","relationUri"],b))),[x,g,b]),I=C||S?a().createElement($,{handleEditRelation:N,handleRemoveRelation:R,canRemove:C,canUpdate:S}):void 0;return a().createElement("div",{className:v.tableContainer},a().createElement(k.Z,{autosizing:!0,maxHeight:477,columnsData:y,rowsData:b,sorting:s,onSort:u,filters:d,onFilter:p,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:E,onRowHover:P,hoverRowIndex:x,hoveredRowRightContent:I,classes:{hoveredRowRightContentWrapper:v["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:v["row-cell__buttons-container"]},ref:f,resizeDebounceDelay:150}))};Q.propTypes={mode:m().string,columnsData:R.uz,connections:m().arrayOf(w.Rjq),metadata:w.pGS,filters:m().objectOf(R.Dq),onFilter:m().func,sorting:R.nI,onSort:m().func,onEditRelation:m().func,onRemoveRelation:m().func,basicTableRef:m().shape({current:m().object}),allowOnlyCreateNew:m().bool};const X=Q;var K=n(93416),J=n(75512),ee=n(30553),te=n(32152),ne=n(1876),re=n(60894),oe=n(43054),ae=n(8818);const le=(0,h.Z)((()=>({popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ie=e=>{let{className:t,showInactive:n,onShowInactiveChange:r}=e;const l=le(),i=(0,o.useRef)(),[s,c]=(0,o.useState)(!1),u=()=>c((e=>!e));return a().createElement(a().Fragment,null,a().createElement(ae.k,{className:t,ref:i,tooltipTitle:f().text("More"),icon:oe.Z,onClick:u,size:"L"}),a().createElement(d.Popover,{open:s,classes:{paper:l.popupContent},anchorEl:i.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(d.FormControlLabel,{classes:{label:l.checkboxControlLabel},control:a().createElement(d.Checkbox,{className:l.checkboxControlCheckbox,checked:n||!1,onChange:e=>r(e.target.checked)}),label:f().text("Show inactive Relationships")})))},se=(0,h.Z)({header:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},moreButton:{marginLeft:"-6px"}}),ce=e=>{let{title:t,total:n,searchQuery:r,onChangeSearchQuery:o,filtersEnabled:l,onToggleFilters:i,columnsData:s,selectedColumns:c,onChangeColumns:u,showInactive:p,onChangeShowInactive:m}=e;const g=se();return a().createElement(K.Z,{title:t,className:g.header},a().createElement(J.Z,{widthToHide:500},a().createElement(ee.Z,{height:24,margin:16}),a().createElement(d.Typography,{className:g.totalCaption,variant:"caption"},n>1?f().text("${count} entities",{count:n}):f().text("${count} entity",{count:n}))),a().createElement(te.i,{query:r,onChange:o}),a().createElement(ne.Z,{enabled:l,onClick:i}),a().createElement(ee.Z,{height:24,margin:4}),a().createElement(re.Z,{columnsData:s,selectedColumns:c,onChangeColumns:u}),a().createElement(ie,{className:g.moreButton,showInactive:p,onShowInactiveChange:m}))};ce.propTypes={title:m().string,total:m().number,columnsData:R.uz,selectedColumns:m().arrayOf(m().string),onChangeColumns:m().func,searchQuery:m().string,onChangeSearchQuery:m().func,filtersEnabled:m().bool,onToggleFilters:m().func,showInactive:m().bool,onChangeShowInactive:m().func};const ue=ce;var de=n(26180),pe=n(31276);function me(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){ge(e,t,n[t])}))}return e}function ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fe="CHANGE_SEARCH_QUERY",he="CHANGE_SHOW_INACTIVE",be=me({},de.ZP.actions,{changeSearchQuery:(0,pe.zD)(fe),changeShowInactive:(0,pe.zD)(he)}),ye=(e,t)=>{switch(t.type){case fe:return me({},e,{searchQuery:t.payload,page:0});case he:return me({},e,{showInactive:t.payload});default:return de.ZP.reducer(e,t)}};var ve=n(26481),Ee=n(37152),xe=n(52016),we=n(10237),Oe=n(11013),Ce=n(58662),Se=n(99136);const Pe=[10,25,50,100],Ne=[{id:"entity.label",get label(){return f().text("Entity label")},dataTypeDefinition:{type:w.oS0.TYPE_STRING},hideable:!1},{id:"relation.label",get label(){return f().text("Directional label")},dataTypeDefinition:{type:w.oS0.TYPE_STRING}},{id:"relation.activeness.startDate",get label(){return f().text("Start date")},dataTypeDefinition:w.PY2.startDate},{id:"relation.activeness.endDate",get label(){return f().text("End date")},dataTypeDefinition:w.PY2.endDate}],Te=(0,i.pipe)(w.Tde,(0,i.concat)("relation.")),ke=(0,i.pipe)((0,i.map)((e=>({id:Te(e.uri),label:e.label,dataTypeDefinition:(0,w.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),Re=(0,i.pipe)(((e,t)=>{let{content:{inRelations:n=[],outRelations:r=[]}}=e,{relationTypes:o}=t;return(0,i.pipe)(U,(0,i.chain)((e=>(0,i.pipe)((0,i.find)((0,i.propEq)("uri",e)),w.DK$)(o))))([...n,...r])}),ke,(0,i.concat)(Ne));var Ie=n(99341);function De(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){je(e,t,n[t])}))}return e}function je(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ze=e=>e.uri||e,Le=e=>t=>Ze(t)===e,Me=(0,i.curry)(((e,t)=>{const n=(t,r)=>{let o=Ze(r),a=!1;o.startsWith("!")&&(o=o.slice(1),a=!0);const l=e[o]&&(0,w.uGe)(w.BDP.READ,e[o]),s=t.find(Le(o))||!l?t:t.concat(r.uri?De({},r,{uri:o}):o);return a?s:(0,i.keys)(e).reduce(((t,r)=>e[r].extendsTypeURI!==o||t.find(Le(r))?t:n(t,r)),s)};return t.reduce(n,[])})),Ae=(0,i.curry)(((e,t)=>{const n=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.reduce(((n,r)=>{const o=Ze(r),a=(0,i.path)([o,t,"objectTypeUri"],e);return!a||n.find(Le(a))?n:n.concat(a)}),[])};return De({},t,{entityTypes:[...n("startObject",t.inRelations),...n("endObject",t.outRelations)]})})),_e=(0,i.indexBy)((0,i.prop)("uri")),Ue=(0,i.curry)(((e,t)=>{const n=_e(e.relationTypes),r=_e(e.entityTypes),o=e=>(0,i.evolve)({inRelations:Me(n),outRelations:Me(n),entityTypes:Me(r),nextEntry:o},e);return(0,i.pipe)((0,i.unless)((0,i.either)((0,i.prop)("nextEntry"),(0,i.prop)("entityTypes")),Ae(n)),o)(t)})),He=(0,h.Z)({addArea:{display:"flex",alignItems:"center",height:"48px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},noData:{fontSize:"13px",paddingLeft:"20px",marginBottom:"20px",marginTop:"10px",color:"rgba(0,0,0,0.54)"}}),ze=(0,i.pluck)("id",Ne),[Be]=ze;function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ve=(0,i.memoizeWith)(((e,t)=>t.id),((e,t)=>(0,i.evolve)({content:Ue(e)},t))),We=(0,s.connect)(((e,t)=>{const{config:n}=t;return{connections:c.ZP.selectors.getConnectionsWithDraftsByViewId(e,n.id),total:c.ZP.selectors.getTotalByViewId(e,n.id),entity:c.ZP.selectors.getEntity(e),metadata:c.ZP.selectors.getMetadata(e),mode:c.ZP.selectors.getMode(e),relationToAdd:c.ZP.selectors.getRelationToAddByViewId(e,n.id),relationsToEdit:c.ZP.selectors.getRelationsToEditByViewId(e,n.id),checkIfCanAddRelations:c.ZP.selectors.getCheckIfCanAddRelations(e,n.content)}}),void 0,((e,t,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){Fe(e,t,n[t])}))}return e}({},e,t,n,{config:Ve(e.metadata,n.config)})))((e=>{let{className:t,config:n,entity:r,metadata:l,connections:s=[],total:u=0,mode:p,relationToAdd:m,relationsToEdit:g=[],checkIfCanAddRelations:h,dispatch:b,readOnlyMode:y}=e;const E={searchQuery:"",filters:null,visibleColumns:ze,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||Be},page:0,rowsPerPage:n.max||15,showInactive:!1},x=He(),O=(0,o.useContext)(ve.j)?p:w.fO_.VIEWING,[C,S]=(0,o.useReducer)(ye,E),P=(0,i.pipe)(be.changeSearchQuery,S),N=(0,i.pipe)(be.changeShowInactive,S);(0,o.useEffect)((()=>{P("")}),[null==r?void 0:r.uri]);const{visibleColumns:T,searchQuery:k,filters:R,sorting:I,page:D,rowsPerPage:j,showInactive:Z}=C,L=(0,o.useMemo)((()=>Re(n,l)),[n,l]),M=(0,o.useMemo)((()=>T.map((e=>L.find((0,i.propEq)("id",e))))),[T,L]),A=(0,o.useMemo)((()=>((e,t,n)=>{const r=w.wSh.fromFalsy(e).map(w.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome(""),o=(0,Ie.Tz)(n,t);return(new w.MEy).addClause(r).addClause(o).build()})(k,R,M)),[R,k]),{isLoading:_}=(0,Ee.a)({sorting:I,filter:A,page:D,rowsPerPage:j,config:n,entity:r,relationActivityFilter:Z?w.Ng6.ALL:w.Ng6.ACTIVE_ONLY,mode:p}),U=(0,o.useMemo)((()=>{return e=E.rowsPerPage,Pe.filter((t=>t!==e)).concat(e).sort(i.subtract);var e}),[]),{handleRowsPerPageChange:H,handlePageChange:z}=(0,o.useMemo)((()=>({handleRowsPerPageChange:(0,i.pipe)(be.changeRowsPerPage,S),handlePageChange:(0,i.pipe)(be.changePage,S)})),[]),B=(0,o.useCallback)((()=>{const e=(0,w.vlo)({config:n,mode:O,metadata:l,parentEntityUri:void 0});(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),b)(e)}),[n,O,l,b]),F=(0,o.useCallback)((e=>{b(c.N5.relations.actions.closeRelationEditor(n.id,e)),b(c.N5.relations.actions.removeRelation(n.id,e));const t=s.find((t=>c.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=c.N5.relations.selectors.getEntityUriFromConnection(t);(0,w.ZiX)(r)&&b(c.N5.modifiedEntities.actions.entityDeleted(r))}),[n,s,b]),V=r&&h&&!y,W=m?[m,...g]:g,{canUpdate:G,canDelete:q}=(0,xe.l)(),$=G(n)&&!y,Y=q(n)&&!y,Q=(0,o.useRef)(null);return a().createElement(we.Z,{className:t},a().createElement(ue,{title:n.caption,total:u,columnsData:L,selectedColumns:T,onChangeColumns:(0,i.pipe)(be.changeColumns,S),searchQuery:k,onChangeSearchQuery:P,filtersEnabled:!!R,onToggleFilters:(0,i.pipe)(be.toggleFilters,S),showInactive:Z,onChangeShowInactive:N}),V&&a().createElement("div",{className:x.addArea},a().createElement(v,{onClick:B})),W.map((e=>a().createElement(Oe.Z,{key:c.N5.relations.selectors.getRelationUriFromConnection(e),connection:e,config:n,mode:O,metadata:l}))),a().createElement("div",{style:{position:"relative"}},a().createElement(X,{mode:O,columnsData:M,connections:s,metadata:l,filters:R,onFilter:(0,i.pipe)(be.changeFilter,S),sorting:I,onSort:(0,i.pipe)(be.toggleSort,S),onEditRelation:$?(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),b):null,onRemoveRelation:Y?F:null,basicTableRef:Q,allowOnlyCreateNew:n.allowOnlyCreateNew}),s.length?a().createElement(Ce.Z,{count:u,rowsPerPageOptions:U,rowsPerPage:j,onChangeRowsPerPage:H,page:D,onChangePage:z,basicTableRef:Q}):a().createElement(d.Typography,{className:x.noData},f().text("No data found")),_&&a().createElement(Se.Z,null)))}));var Ge=n(36138),qe=n(22664),$e=n(585);const Ye=(0,Ge.createGenerateClassName)({productionPrefix:"relTable",disableGlobal:!0}),Qe=e=>{let{config:t,store:n,onResize:o=i.identity,className:c,readOnlyMode:u}=e;return a().createElement(s.Provider,{store:n},a().createElement(I.m.Provider,{value:t.id},a().createElement(Ge.StylesProvider,{generateClassName:Ye},a().createElement(qe.MuiPickersUtilsProvider,{utils:r.Z},a().createElement(l.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(We,{config:t,className:c,readOnlyMode:u}),a().createElement($e.Z,null)))))}},96330:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[9211],{27815:(e,t,n)=>{n.d(t,{Z:()=>O});var r=n(24328),o=n.n(r),a=n(87918),l=n.n(a),i=n(71153),s=n.n(i),c=n(17440),u=n(52730),d=n(59431),p=n(90088),m=n(94079),g=n(92575),f=n(37285),h=n(96808),b=n(7785),y=n(79692);function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){E(e,t,n[t])}))}return e}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const x={input:e=>v({},e,{fontSize:"14px"}),menuPortal:e=>v({},e,{zIndex:1300})},w=(0,y.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},dropDownInput:{width:"100%",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.03)",borderTop:"4px"},option:{fontSize:"14px",height:"32px"},noOptionsMessage:{fontSize:"14px"}});const O=e=>{let{entityType:t,selectedAttributes:n,className:a,onChange:i,title:y,disableUnderline:v,menuPlacement:E="bottom"}=e;const O=(0,u.useSelector)(d.ZP.selectors.getMetadata),C=w(),S=(0,r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.reduce(((e,r)=>{if(r.hidden)return e;const o=`${n&&n+" / "}${r.label}`;e.push({label:r.label,value:r.uri,attrType:r,chipLabel:o,level:t});const a=(0,p.EUG)(O,r);return e.concat(a?S(a,t+1,o):[])}),[])}),[O]),P=(0,r.useMemo)((()=>S((null==t?void 0:t.attributes)||[])),[t,S]);return o().createElement("div",{className:s()(C.root,a)},o().createElement(m.Typography,{className:C.title,variant:"subtitle1"},y||l().text("Attribute")),o().createElement(g.Z,{value:n,options:P,TextFieldProps:{InputProps:{disableUnderline:v},classes:{root:C.dropDownInput}},components:{DropdownIndicator:h.Z,MultiValue:e=>{let{data:t}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["data"]);return o().createElement(f.Z,n,t.chipLabel)},Option:e=>{let{isFocused:t,isSelected:n,data:r,label:a,innerProps:l}=e;return o().createElement("div",l,o().createElement(b.Z,{checked:n,level:r.level,data:r,label:a,labelInText:a,isFocused:t}))}},onChange:(0,c.pipe)((0,c.defaultTo)([]),i),styles:x,classes:C,menuPlacement:E,menuPortalTarget:document.body}))}},10237:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(27556),o=n(13980),a=n.n(o),l=n(24328),i=n.n(l);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,n(79692).Z)((e=>({"basic-view__paper":s({display:"flex",flexDirection:"column"},e.basicView)})));function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(this,arguments)}const p=(0,l.forwardRef)(((e,t)=>{let{children:n,className:o}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children","className"]);const l=u();return i().createElement(r.Z,d({ref:t,className:o,classes:{root:l["basic-view__paper"]}},a),n)}));p.displayName="BasicView",p.propTypes={children:a().node,className:a().string};const m=p},39621:(e,t,n)=>{n.d(t,{Z:()=>g});var r=n(24328),o=n.n(r),a=n(17440),l=n(87918),i=n.n(l),s=n(6782),c=n(94079),u=n(31517),d=n(31276);const p=(0,n(79692).Z)({root:{display:"flex",flex:1},input:{height:"100%",paddingLeft:"12px",paddingRight:"8px",fontSize:"14px"},inputNumber:{minWidth:"60px",marginRight:10,height:"100%",backgroundColor:"rgba(0, 0, 0, 0.03)"},inputUnit:{width:"100%"}}),m=[i().text("minutes"),i().text("hours"),i().text("days"),i().text("weeks"),i().text("months"),i().text("years")],g=e=>{let{interval:[t,n],onChange:r,onFocus:l}=e;const i=p(),g=(0,a.pipe)(d.NA,parseInt,(e=>[e,n]),r),f=(0,a.pipe)((e=>{let{value:n}=e;return[t,n]}),r);return o().createElement("div",{className:i.root},o().createElement(c.TextField,{type:"number",value:t||"",onChange:g,inputProps:{min:1,onFocus:l},InputProps:{classes:{root:i.input}},className:i.inputNumber}),o().createElement(u.Z,{label:"",placeholder:(0,s.Z)(n),className:i.inputUnit,value:{value:n,label:(0,s.Z)(n)},options:m.map((e=>({value:e,label:(0,s.Z)(e)}))),onChange:f,TextFieldProps:{inputProps:{onFocus:l},InputProps:{classes:{root:i.input}}}}))}},2256:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(24328),o=n.n(r);class a extends o().Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e}),console.error(e)}render(){const{children:e,error:t}=this.props;return this.state.error?t:e}}},85451:(e,t,n)=>{n.d(t,{Z:()=>x});var r=n(24328),o=n.n(r),a=n(52730),l=n(87918),i=n.n(l),s=n(17440),c=n(71153),u=n.n(c),d=n(94079),p=n(92575),m=n(96808),g=n(90088),f=n(59431),h=n(79692);function b(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){y(e,t,n[t])}))}return e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const v={input:e=>b({},e,{fontSize:"14px"}),loadingMessage:e=>b({},e,{fontSize:"14px"}),menuPortal:e=>b({},e,{zIndex:1300})},E=(0,h.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},dropDownInput:{width:"100%",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.03)",borderTop:"4px"},option:{fontSize:"14px",height:"32px"}}),x=e=>{let{selectedUsers:t,onChange:n,className:l,disableUnderline:c}=e;const h=E(),b=e=>({value:e,label:e}),y=e=>e.map(b),x=(0,a.useSelector)(f.ZP.selectors.getTenant),w=(0,a.useSelector)(f.ZP.selectors.getServicesPath),O=(0,r.useRef)();return o().createElement("div",{className:u()(h.root,l)},o().createElement(d.Typography,{className:h.title,variant:"subtitle1"},i().text("User")),o().createElement(p.Z,{value:y(t),onChange:(0,s.pipe)((0,s.defaultTo)([]),(0,s.pluck)("value"),n),defaultOptions:!0,getOptions:e=>(O.current||(O.current=(0,g.kz_)({tenant:x,servicesPath:w})),O.current.then((0,s.pipe)((0,s.prop)("array"),(0,s.pluck)("username"),(e=>t=>e?t.filter((t=>g.P6Y.strings.search(t,e))):t)(e),y))),TextFieldProps:{InputProps:{disableUnderline:c},className:h.dropDownInput},components:{DropdownIndicator:m.Z},styles:v,classes:h,menuPortalTarget:document.body}))}},31537:(e,t,n)=>{let r;n.d(t,{I:()=>r}),function(e){e.MODEL_UPDATED="MODEL_UPDATED",e.ENTITY_REMOVED="ENTITY_REMOVED",e.ENTITY_CREATED="ENTITY_CREATED",e.ENTITY_CHANGED="ENTITY_CHANGED",e.ENTITIES_MERGED="ENTITIES_MERGED",e.ENTITIES_SPLITTED="ENTITIES_SPLITTED",e.ENTITY_LOST_MERGE="ENTITY_LOST_MERGE",e.RELATIONSHIP_CREATED="RELATIONSHIP_CREATED",e.RELATIONSHIP_REMOVED="RELATIONSHIP_REMOVED",e.RELATIONSHIP_CHANGED="RELATIONSHIP_CHANGED",e.POTENTIAL_MATCHES_FOUND="POTENTIAL_MATCHES_FOUND",e.NOT_MATCHES_SET="NOT_MATCHES_SET",e.NOT_MATCHES_RESET="NOT_MATCHES_RESET",e.PERIODIC_TASK_SCHEDULED="PERIODIC_TASK_SCHEDULED",e.ENTITIES_MERGED_MANUALLY="ENTITIES_MERGED_MANUALLY",e.POTENTIAL_MATCHES_REMOVED="POTENTIAL_MATCHES_REMOVED",e.ENTITIES_MERGED_ON_THE_FLY="ENTITIES_MERGED_ON_THE_FLY",e.USER_LOGIN="USER_LOGIN",e.USER_LOGOUT="USER_LOGOUT",e.USER_SEARCH="USER_SEARCH",e.USER_PROFILE_VIEW="USER_PROFILE_VIEW",e.COMMENT_ADDED="COMMENT_ADDED",e.COMMENT_UPDATED="COMMENT_UPDATED",e.COMMENT_DELETED="COMMENT_DELETED",e.ANALYTICS_ATTRIBUTES_CHANGED="ANALYTICS_ATTRIBUTES_CHANGED",e.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE="SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE",e.GROUP_CREATED="GROUP_CREATED",e.GROUP_REMOVED="GROUP_REMOVED",e.GROUP_CHANGED="GROUP_CHANGED"}(r||(r={}))},34606:(e,t,n)=>{n.d(t,{te:()=>d,Io:()=>p,rx:()=>m,_V:()=>g,Xr:()=>f});var r=n(90088),o=n(17440),a=n(87918),l=n.n(a),i=n(31537);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=(0,o.path)(["data","type"]),d=e=>{const{items:t,label:n}=e,[r]=t||[];return u(r)||n},p=e=>{const{items:t,label:n}=e,r=e=>{return t=u(e)||n,(0,o.pipe)(o.values,(0,o.includes)(t))(i.I);var t},a=(0,o.filter)(r)(t);return t.length!==a.length&&console.error("Activities not implemented:",(0,o.reject)(r)(t)),s({},e,{items:a,itemsTotal:a.length})},m=e=>(0,o.pipe)((0,o.propOr)([],"items"),(0,o.groupBy)(u),o.values,(0,o.ifElse)((e=>{let{length:t}=e;return t>1}),(0,o.map)((t=>s({},e,{items:t,itemsTotal:t.length}))),(()=>[e])))(e),g=(e,t,n,a)=>{const l=(0,r.zeJ)(n,t),i=(0,r.PFL)(l),s=(0,r.mB6)({attributePresentations:a,dataTypeDefinition:i});return(0,o.isNil)(e)?"":"string"==typeof e?l?s(e):e:Object.entries(e).flatMap((e=>{let[o,l]=e;return l.map((e=>g(e.value,(0,r.tCm)(t,o),n,a)))})).join(", ")},f=e=>({[i.I.COMMENT_ADDED]:l().text("Comment added"),[i.I.COMMENT_DELETED]:l().text("Comment deleted"),[i.I.COMMENT_UPDATED]:l().text("Comment updated"),[i.I.ENTITIES_MERGED]:l().text("Profile merged"),[i.I.ENTITIES_MERGED_MANUALLY]:l().text("Profile merged manually"),[i.I.ENTITIES_MERGED_ON_THE_FLY]:l().text("Profile merged on the fly"),[i.I.ENTITIES_SPLITTED]:l().text("Profile un-merged"),[i.I.ENTITY_CHANGED]:l().text("Profile updated"),[i.I.ENTITY_CREATED]:l().text("Profile created"),[i.I.ENTITY_LOST_MERGE]:l().text("Profile lost merge"),[i.I.ENTITY_REMOVED]:l().text("Profile removed"),[i.I.GROUP_CHANGED]:l().text("Group updated"),[i.I.GROUP_CREATED]:l().text("Group created"),[i.I.GROUP_REMOVED]:l().text("Group removed"),[i.I.MODEL_UPDATED]:l().text("Model was updated"),[i.I.NOT_MATCHES_RESET]:l().text("Not matches reset"),[i.I.NOT_MATCHES_SET]:l().text("Not matches set"),[i.I.PERIODIC_TASK_SCHEDULED]:l().text("Periodic task was scheduled"),[i.I.POTENTIAL_MATCHES_FOUND]:l().text("Potential matches found"),[i.I.POTENTIAL_MATCHES_REMOVED]:l().text("Potential matches removed"),[i.I.RELATIONSHIP_CHANGED]:l().text("Relationship updated"),[i.I.RELATIONSHIP_CREATED]:l().text("Relationship created"),[i.I.RELATIONSHIP_REMOVED]:l().text("Relationship removed"),[i.I.USER_LOGIN]:l().text("Logged in"),[i.I.USER_LOGOUT]:l().text("Logged out"),[i.I.USER_PROFILE_VIEW]:l().text("Profile viewed"),[i.I.USER_SEARCH]:l().text("Searched"),[i.I.ANALYTICS_ATTRIBUTES_CHANGED]:l().text("Analytics attribute changed"),[i.I.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE]:l().text("SFDC connector synchronization issue")}[e]||"")},51843:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(24328),o=n.n(r),a=n(95038),l=n.n(a),i=n(87918),s=n.n(i),c=n(17440),u=n(90088),d=n(94079),p=n(96808),m=n(82943);const g=(0,n(79692).Z)({root:{flex:1},dropdownIndicator:{transition:"transform .15s ease"},inputRoot:{fontSize:"14px",height:46},input:{padding:"0 12px 0"},dateOptionLabel:{minWidth:"100px"},paper:{minWidth:"112px"}}),f=l().localeData().longDateFormat("L"),h=e=>{let{values:t,onChange:n,onFocus:a}=e;const l=f,i=(0,r.useRef)(null),[h,b]=(0,r.useState)(!1),y=g(),v=(0,r.useCallback)((()=>{b((e=>!e)),a()}),[a]),E=()=>{b(!1)};return o().createElement("div",{className:y.root},o().createElement(d.TextField,{fullWidth:!0,value:t.map((e=>((e,t)=>(0,c.isNil)(e)?`${t}`:`${(0,u.mB6)({dataTypeDefinition:{type:u.oS0.TYPE_ACTIVENESS_DATE}},e)}`)(e,l))).join(" — "),onClick:v,variant:"filled",ref:i,InputProps:{endAdornment:o().createElement(p.Z,{selectProps:{classes:y,menuIsOpen:h},innerProps:{}}),disableUnderline:(0,c.isNil)(t),readOnly:!0,classes:{root:y.inputRoot,input:y.input}},InputLabelProps:{shrink:!1},placeholder:s().text(`${l} — ${l}`)}),o().createElement(d.Menu,{variant:"menu",open:h,autoFocus:!1,classes:{paper:y.paper},anchorEl:i.current,onClose:E,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},elevation:2,getContentAnchorEl:null,MenuListProps:{autoFocusItem:h,style:{width:"100%"}}},o().createElement(m.Z,{values:t,onCancel:E,onApply:e=>{n(e),b(!1)},type:u.oS0.TYPE_ACTIVENESS_DATE})))}},67885:(e,t,n)=>{let r,o;n.d(t,{K:()=>r,o:()=>o}),function(e){e.WITHIN="within",e.AGO="ago",e.BETWEEN="between"}(r||(r={})),function(e){e.INIT="init",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}(o||(o={}))},96617:(e,t,n)=>{n.r(t),n.d(t,{HierarchyTreeView:()=>ur});var r={};n.r(r),n.d(r,{MIN_NODE_CONTENT_WIDTH:()=>Y,nodeContentRenderer:()=>B,rowHeight:()=>X,scaffoldBlockPxWidth:()=>Q,slideRegionSize:()=>K,treeNodeRenderer:()=>$});var o=n(8598),a=n(24328),l=n.n(a),i=n(44443),s=n(71153),c=n.n(s),u=n(17440),d=n(87918),p=n.n(d),m=n(94079),g=n(13980),f=n.n(g),h=n(83348),b=n(93416);function y(){return y=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},y.apply(this,arguments)}const v=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return l().createElement("svg",y({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),l().createElement("defs",null,l().createElement("path",{d:"M12 7c2.762 0 5 2.238 5 5s-2.238 5-5 5-5-2.238-5-5 2.238-5 5-5zm0 2a3 3 0 100 6 3 3 0 100-6zm8.94 2A8.994 8.994 0 0013 3.06V1h-2v2.06A8.994 8.994 0 003.06 11H1v2h2.06A8.994 8.994 0 0011 20.94V23h2v-2.06A8.994 8.994 0 0020.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z",id:"svg2250934887a"})),l().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},l().createElement("mask",{id:"svg2250934887b",fill:"#fff"},l().createElement("use",{xlinkHref:"#svg2250934887a"})),l().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2250934887b)",d:"M0 0h24v24H0z"})))};function E(){return E=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},E.apply(this,arguments)}const x=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return l().createElement("svg",E({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),l().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},l().createElement("path",{d:"M14.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm4 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm-17 1a1.5 1.5 0 110-3 1.5 1.5 0 010 3zM4 4a2 2 0 110-4 2 2 0 010 4zm1 16a2 2 0 110-4 2 2 0 010 4zm4.5-6a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm0-2a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm6 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3z",fill:"#000"})))};var w=n(79692);const O=(0,w.Z)((()=>({header:{padding:"0 4px 0 16px"},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"},icon:{width:"24px",height:"24px"},disabledIcon:{opacity:.54}}))),C=(0,h.Z)(m.IconButton),S=e=>{let{title:t,entityLabel:n="",onScrollToCurrentEntity:r,onGraphOpen:o,disabled:a=!1}=e;const i=O(),s=c()(i.icon,{[i.disabledIcon]:a});return l().createElement(b.Z,{title:t,className:i.header},l().createElement("div",{className:i.buttonsContainer},l().createElement(C,{tooltipTitle:p().text("Show Graph"),onClick:o,classes:{root:i.button,label:s},disabled:a,showForDisabled:!0},l().createElement(x,null)),l().createElement(C,{tooltipTitle:p().text("Scroll to ${node}",{node:n}),tooltipPlacement:"bottom-end",onClick:r,classes:{root:i.button,label:s},disabled:a,showForDisabled:!0},l().createElement(v,null))))};S.propTypes={title:f().string,entityLabel:f().string,total:f().number,onScrollToCurrentEntity:f().func,onGraphOpen:f().func,disabled:f().bool};const P=S;var N=n(52730),T=n(90088);const k=(0,w.Z)((e=>({textField:{marginLeft:e.spacing(),marginRight:e.spacing(),width:200},panel:{display:"flex",flexGrow:1,flexDirection:"column",minHeight:"372px",maxHeight:"507px"},treeWrapper:{flexGrow:1,height:0,marginTop:7},checkedNode:{backgroundColor:"rgba(0,114,206, 0.12)"},editorNode:{overflow:"hidden","&:hover":{backgroundColor:"transparent !important"},"&:hover div.rst__moveHandle":{visibility:"hidden"},"& div.rst__rowLabel":{paddingRight:0}}})));var R=n(12335);const I=(0,w.Z)((()=>({container:{display:"flex",flexDirection:"column",height:"100%"},root:{minHeight:"28px",display:"flex",padding:"0 18px","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"},wordBreak:"break-all"},tree:{flexGrow:1,height:0}})));var D=n(92898),j=n(21113),Z=n(30634),L=n(58600),M=n(14940);function A(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}function _(){return _=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_.apply(this,arguments)}function U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){H(e,t,n[t])}))}return e}function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class z extends a.Component{render(){const e=this.props,{scaffoldBlockPxWidth:t,toggleChildrenVisibility:n,connectDragPreview:r,connectDragSource:o,isDragging:a,canDrop:i,canDrag:s,node:c,title:u,subtitle:d,draggedNode:g,path:f,treeIndex:h,isSearchMatch:b,isSearchFocus:y,buttons:v,className:E,style:x,didDrop:w,treeId:O,isOver:C,parentNode:S,rowDirection:P}=e,N=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["scaffoldBlockPxWidth","toggleChildrenVisibility","connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","node","title","subtitle","draggedNode","path","treeIndex","isSearchMatch","isSearchFocus","buttons","className","style","didDrop","treeId","isOver","parentNode","rowDirection"]),T=u||c.title,k=d||c.subtitle,R="rtl"===P?"rst__rtl":null;let I;s&&(I="function"==typeof c.children&&c.expanded?l().createElement("div",{className:"rst__loadingHandle"},l().createElement("div",{className:"rst__loadingCircle"},[...new Array(12)].map(((e,t)=>l().createElement("div",{key:t,className:A("rst__loadingCirclePoint",R)}))))):o(l().createElement("div",{className:"rst__moveHandle"},l().createElement(m.Tooltip,{title:p().text("Drag node")},l().createElement(M.Z,null))),{dropEffect:"copy"}));const D=g&&j.ZP.isDescendant(g,c),Z=!w&&a,L=n&&!c.root&&!c.cycled&&(c.children&&c.children.length>0||c.pending);return l().createElement("div",_({style:{height:"100%"}},N,{key:c.nodeId}),L&&c.expanded&&!a&&l().createElement("div",{style:{width:t-2},className:A("rst__lineChildren",R)}),l().createElement("div",{className:A("rst__rowWrapper",R)},r(l().createElement("div",{className:A("rst__row",Z&&"rst__rowLandingPad",Z&&!i&&"rst__rowCancelPad",b&&"rst__rowSearchMatch",y&&"rst__rowSearchFocus",R,E),style:U({opacity:D?.5:1},x)},I,l().createElement("div",{className:A("rst__rowContents",!s&&"rst__rowContentsDragDisabled",R)},L?l().createElement("div",{className:"rst__buttonWrapper",onClick:()=>{n({node:c,path:f,treeIndex:h})}},l().createElement("div",{"aria-label":c.expanded?"Collapse":"Expand",className:A(c.expanded?"rst__collapseButton":"rst__expandButton",R)})):l().createElement("div",{className:A("rst__buttonWrapper","rst__noButton")}),l().createElement("div",{className:A("rst__rowLabel",R)},l().createElement("div",{className:A("rst__rowTitle",c.subtitle&&"rst__rowTitleWithSubtitle")},"function"==typeof T?T({node:c,path:f,treeIndex:h}):T),k&&l().createElement("span",{className:"rst__rowSubtitle"},"function"==typeof k?k({node:c,path:f,treeIndex:h}):k)),l().createElement("div",{className:"rst__rowToolbar"},v.map(((e,t)=>l().createElement("div",{key:t,className:"rst__toolbarButton"},e)))))),{offsetX:0,offsetY:0})))}}z.defaultProps={isSearchMatch:!1,isSearchFocus:!1,canDrag:!1,toggleChildrenVisibility:null,buttons:[],className:"",style:{},parentNode:null,draggedNode:null,canDrop:!1,title:null,subtitle:null,rowDirection:"ltr"},z.propTypes={node:f().shape({}).isRequired,title:f().oneOfType([f().func,f().node]),subtitle:f().oneOfType([f().func,f().node]),path:f().arrayOf(f().oneOfType([f().string,f().number])).isRequired,treeIndex:f().number.isRequired,treeId:f().string.isRequired,isSearchMatch:f().bool,isSearchFocus:f().bool,canDrag:f().bool,scaffoldBlockPxWidth:f().number.isRequired,toggleChildrenVisibility:f().func,buttons:f().arrayOf(f().node),className:f().string,style:f().shape({}),connectDragPreview:f().func.isRequired,connectDragSource:f().func.isRequired,parentNode:f().shape({}),isDragging:f().bool.isRequired,didDrop:f().bool.isRequired,draggedNode:f().shape({}),isOver:f().bool.isRequired,canDrop:f().bool,rowDirection:f().string};const B=z,F=(0,a.createContext)({generateTreeNodeProps:void 0});function V(){return V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(this,arguments)}function W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){G(e,t,n[t])}))}return e}function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}F.displayName="TreeThemeContext";class q extends a.Component{render(){const e=this.props,{children:t,listIndex:n,swapFrom:r,swapLength:o,swapDepth:i,scaffoldBlockPxWidth:s,lowerSiblingCounts:c,connectDropTarget:u,isOver:d,draggedNode:p,canDrop:m,treeIndex:g,treeId:f,getPrevRow:h,node:b,path:y,rowDirection:v}=e,E=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["children","listIndex","swapFrom","swapLength","swapDepth","scaffoldBlockPxWidth","lowerSiblingCounts","connectDropTarget","isOver","draggedNode","canDrop","treeIndex","treeId","getPrevRow","node","path","rowDirection"]),x="rtl"===v?"rst__rtl":null,w=c.length,O=[];let C;c.forEach(((e,t)=>{let a="";if(e>0?a=t===w-1?"rst__lineHalfHorizontalRight rst__lineFullVertical":"rst__lineFullVertical":t===w-1&&(a="rst__lineHalfVerticalTop rst__lineHalfHorizontalRight"),O.push(l().createElement("div",{key:`pre_${1+t}`,style:{width:s},className:A("rst__lineBlock",a,x)})),g!==n&&t===i){let e,a="";a=n===r+o-1?"rst__highlightBottomLeftCorner":g===r?"rst__highlightTopLeftCorner":"rst__highlightLineVertical",e="rtl"===v?{width:s,right:s*t}:{width:s,left:s*t},O.push(l().createElement("div",{key:t,style:e,className:A("rst__absoluteLineBlock",a,x)}))}}));const S=s*w;C="rtl"===v?{right:S}:{left:S},C=W({},C,{width:`calc(100% - ${S}px`});const P=`${S+Y}px`,N=W({},E.style,{width:P}),T=this.context&&this.context.generateTreeNodeProps&&this.context.generateTreeNodeProps(this.props);return u(l().createElement("div",V({},E,{className:A("rst__node",b.root&&"rst__root",x,T&&T.treeNodeClassName,!!p&&p.nodeId!==b.nodeId&&"rst_node_hover_disabled"),style:N}),O,l().createElement("div",{className:"rst__nodeContent",style:C},a.Children.map(t,(e=>(0,a.cloneElement)(e,{isOver:d,canDrop:m,draggedNode:p}))))))}}q.contextType=F,q.defaultProps={swapFrom:null,swapDepth:null,swapLength:null,canDrop:!1,draggedNode:null,rowDirection:"ltr"},q.propTypes={treeIndex:f().number.isRequired,treeId:f().string.isRequired,swapFrom:f().number,swapDepth:f().number,swapLength:f().number,scaffoldBlockPxWidth:f().number.isRequired,lowerSiblingCounts:f().arrayOf(f().number).isRequired,listIndex:f().number.isRequired,children:f().node.isRequired,connectDropTarget:f().func.isRequired,isOver:f().bool.isRequired,canDrop:f().bool,draggedNode:f().shape({}),getPrevRow:f().func.isRequired,node:f().shape({}).isRequired,path:f().arrayOf(f().oneOfType([f().string,f().number])).isRequired,rowDirection:f().string};const $=q,Y=250,Q=16,X=28,K=50,J=f().shape({nodeId:f().oneOfType([f().number,f().string]),children:f().arrayOf((()=>J)),showParents:f().bool,expanded:f().bool,pending:f().bool,cycled:f().bool}),ee=f().shape({nodeId:f().oneOfType([f().number,f().string]),entity:T.pyR,relation:T.uTS,relations:f().arrayOf(T.uTS),total:f().number,parent:f().arrayOf(f().string),directParentUri:f().string,children:f().arrayOf((()=>ee)),loading:f().bool,expanded:f().bool,showParents:f().bool,cycled:f().bool,pending:f().bool}),te=f().number,ne=f().shape({root:ee,graphTypes:f().string,entitiesMap:f().object,title:f().string,activenessDate:te,scrollTo:ee,loading:f().bool}),re=e=>{let{measure:t,registerChild:n,NodeRenderer:r,node:o,treeIndex:i}=e;return(0,a.useEffect)(t,[i]),l().createElement(r,{measure:t,registerChild:n,node:o})};re.propTypes={measure:f().func,registerChild:f().func,NodeRenderer:f().func,node:J,treeIndex:f().number};const oe=e=>{const t=(e=>document.querySelector(`[data-node-id="${e}"]`))(e);t?t.scrollIntoView({block:"nearest",inline:"start"}):setTimeout((()=>oe(e)),0)},ae=e=>{let{node:t}=e;return t.nodeId},le=e=>{let{node:t}=e;return t.title||null};function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){se(e,t,n[t])}))}return e}function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ce=(0,u.pick)(["nodeContentRenderer","treeNodeRenderer","scaffoldBlockPxWidth","rowHeight","slideRegionSize"],r),ue=e=>{let{NodeRenderer:t=le,root:n,scrollToNode:r,onChange:o,onRequestChildren:s,canDrag:c=!1,canDrop:d,onScroll:p=u.identity,onNodeMoved:m=u.identity,inlineRoot:g}=e;const f=I(),h=(0,a.useMemo)((()=>{const e=n&&n.children||[];return g?[(0,u.pipe)((0,u.omit)(["children"]),(0,u.assoc)("root",!0))(n),...e]:e}),[n,g]),b=(0,a.useRef)(null),y=(0,a.useRef)(null);y.current=h;const v=((e,t)=>{const n=(0,a.useCallback)((n=>{const r=j.ZP.getVisibleNodeInfoAtIndex({treeData:e.current,index:n,getNodeKey:t});return t({node:(0,u.propOr)({nodeId:-1},"node",r)})}),[t,e]),[r]=(0,a.useState)(new R.t1({fixedWidth:!0,defaultHeight:X,minHeight:X,keyMapper:n})),o=(0,a.useCallback)((()=>{r.clearAll()}),[]);return(0,a.useEffect)((()=>(window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)})),[o]),r})(y,ae);(0,D.q)((()=>{setTimeout((()=>{const e=E();e&&e.forceUpdateGrid()}),0)}),n),(0,a.useEffect)((()=>{if(n&&r){const e=j.ZP.find({treeData:h,getNodeKey:ae,searchFocusOffset:0,searchQuery:"",searchMethod:e=>{let{node:t}=e;return t===r}}),t=(0,u.path)(["matches",0,"treeIndex"],e),n=E();n&&null!=t&&(n.scrollToRow(t),setTimeout((()=>{oe(r.nodeId)}),500))}}),[n,h,r]);const E=()=>(0,u.path)(["current","wrappedInstance","current"],b),x=(0,a.useCallback)((e=>{o&&o(ie({},n,{children:g?e.slice(1):e}))}),[o,n,g]),w=(0,a.useCallback)((e=>{let{node:n,treeIndex:r}=e;return l().createElement(R.Z8,{cache:v,columnIndex:0,key:ae({node:n}),rowIndex:r,parent:E()},(e=>{let{NodeRenderer:t,node:n,treeIndex:r}=e;return e=>{let{measure:o,registerChild:a}=e;return l().createElement(re,{NodeRenderer:t,node:n,treeIndex:r,measure:o,registerChild:a})}})({NodeRenderer:t,node:n,treeIndex:r}))}),[t,v]),O=(0,a.useCallback)((e=>({title:w(e)})),[w]),C=(0,Z.D)(h),S=(0,a.useCallback)((e=>{const{prevPath:t,nextParentNode:r}=e;let o;if(t.length>1){const e=t.slice(0,-1),n=j.ZP.getNodeAtPath({treeData:C,getNodeKey:ae,path:e});n&&(o=n.node)}else o=n;m(ie({prevParentNode:o},e,{nextParentNode:r||n}))}),[m,n,C]),P=(0,a.useCallback)((e=>{let{node:t}=e;s(t)}),[s]),N=(0,a.useCallback)((()=>{v.clearAll()}),[v]);return n?l().createElement(i.Z,{skipOnMount:!0,handleWidth:!0,onResize:N},l().createElement("div",{className:f.container},!g&&l().createElement("div",{className:f.root},l().createElement(t,{node:n})),l().createElement("div",{className:f.tree},l().createElement(L.ZP,{isVirtualized:!0,canDrag:c,canDrop:d,treeData:h,theme:ce,generateNodeProps:O,rowHeight:v.rowHeight,reactVirtualizedListProps:{ref:b,scrollToAlignment:"end",onScroll:p},onMoveNode:S,onChange:x,onLazyLoadChildren:P,getNodeKey:ae})))):null};ue.propTypes={NodeRenderer:f().elementType,root:J,canDrag:f().oneOfType([f().bool,f().func]),canDrop:f().func,scrollToNode:f().object,onChange:f().func,onRequestChildren:f().func,onNodeMoved:f().func,onScroll:f().func,inlineRoot:f().bool,getNodeKey:f().func};const de=ue,pe=(0,w.Z)((()=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,width:0,minHeight:"15px"}}))),me=(0,w.Z)((()=>({loadingSpinner:{alignSelf:"center",maxHeight:"16px",marginRight:"16px"}})));var ge=n(37014);const fe=e=>{let{className:t,registerChild:n}=e;const r=pe(),o=me();return l().createElement("div",{className:c()(r.container,t),ref:n},l().createElement(ge.Z,{className:o.loadingSpinner}),l().createElement("div",{className:r.title},p().text("Loading...")))};fe.propTypes={className:f().string,registerChild:f().func};const he=fe;var be=n(59431),ye=n(66130),ve=n(33310);const Ee=(0,w.Z)((()=>({wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px"},avatarWithMultiParent:{cursor:"pointer"},number:{color:"rgba(0,0,0,0.54)",marginLeft:"13px"},multiParentIcon:{position:"absolute",top:"15px",left:"-3px",cursor:"pointer"},actionsBlock:{position:"absolute",right:"0",top:"2px",backgroundColor:"rgb(240,240,240)","&::after":{content:'""',position:"absolute",left:"-40px",top:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(240,240,240, 0.2), rgba(240,240,240, 1) 100%)",pointerEvents:"none"}},actionsBlockWithOpenMenu:{backgroundColor:"white","&::after":{background:"linear-gradient(to right, rgba(255,255,255, 0.2), rgba(255,255,255, 1) 100%)"}},actionsBlockForCheckedNode:{backgroundColor:"rgb(224,238,249)","&::after":{background:"linear-gradient(to right, rgba(224,238,249, 0.2), rgba(224,238,249, 1) 100%)"}},regularNodeCheckbox:{padding:0,marginRight:"16px",marginTop:"-4px",marginLeft:"-4px"},subtitle:{fontSize:"11px",letterSpacing:0,lineHeight:"13px",paddingLeft:"24px",paddingTop:"2px",paddingBottom:"4px",wordBreak:"break-word"},popper:{maxWidth:"345px",minWidth:"200px",boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",backgroundColor:"white",borderRadius:"2px"}})));var xe=n(96330);function we(){return we=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},we.apply(this,arguments)}const Oe=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return l().createElement("svg",we({width:"11",height:"11",viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),l().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},l().createElement("circle",{strokeOpacity:".54",stroke:"#000",fill:"#FFF",cx:"6",cy:"6",r:"5.5"}),l().createElement("path",{d:"M5.536 4.641L4.505 3.61H8v3.495L6.874 5.98 5.509 7.344a1.995 1.995 0 00-.581 1.548l-.407-.408a2 2 0 010-2.828l1.015-1.015z",fillOpacity:".87",fill:"#000"})))};var Ce=n(55400);const Se=(0,w.Z)((e=>({link:{cursor:"pointer",color:e.palette.primary.main,lineHeight:"15px"},selected:{fontWeight:"bold"}})));function Pe(){return Pe=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},Pe.apply(this,arguments)}const Ne=e=>{let{title:t,isSelected:n,link:r,onClick:o}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["title","isSelected","link","onClick"]);const i=Se();return l().createElement("span",Pe({},a,{className:c()(i.link,{[i.selected]:n})}),l().createElement(Ce.Z,{to:r,onClick:o},t))},Te=(0,w.Z)((()=>({avatar:{height:"16px",width:"16px",marginRight:"6px",flexShrink:"0"},multiParent:{position:"relative",background:"#ffffff",border:"1px solid rgba(0,0,0,0.12)",marginLeft:"-5px",marginTop:"10px",padding:"10px 11px 9px 6px","&:after,&:before":{bottom:"100%",left:"12px",border:"solid transparent",content:"' '",height:0,width:0,position:"absolute","pointer-events":"none"},"&:after":{borderColor:"rgba(255, 255, 255, 0)",borderBottomColor:"#ffffff",borderWidth:"6px",marginLeft:"-6px"},"&:before":{borderColor:"rgba(220, 216, 245, 0)",borderBottomColor:"rgba(0,0,0,0.12)",borderWidth:"7px",marginLeft:"-7px"}},parentContainer:{fontSize:"13px",lineHeight:"16px",display:"flex",marginBottom:"12px",alignItems:"center","&:last-child":{marginBottom:0}},loadingNode:{paddingTop:0}})));function ke(){return ke=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},ke.apply(this,arguments)}const Re=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return l().createElement("svg",ke({width:"10",height:"10",viewBox:"0 0 10 10",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),l().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".38"},l().createElement("path",{d:"M4.536 3.641L3.505 2.61H7v3.495L5.874 4.98 4.509 6.344a1.995 1.995 0 00-.581 1.548l-.407-.408a2 2 0 010-2.828l1.015-1.015z",fill:"#000"})))},Ie=e=>{let{showParents:t,additionalParents:n}=e;const r=Te(),o=(0,N.useDispatch)();return t&&n.length>0?l().createElement("div",{className:r.multiParent},n.map(((e,t)=>l().createElement("div",{key:t,className:r.parentContainer},e.pending?l().createElement(he,{className:r.loadingNode}):l().createElement(l().Fragment,null,l().createElement(Re,{className:r.avatar}),l().createElement(Ne,{title:e.title,link:e.entityLink,onClick:()=>o(be.ui.actions.openEntity({uri:e.entityUri,viewId:e.viewId}))})))))):null},De=(0,w.Z)((()=>({details:{margin:"1px 0 8px 24px"},loadingNode:{paddingTop:0},detailLine:{display:"flex"},detail:{flexGrow:1,width:0,wordWrap:"break-word",lineHeight:"16px",paddingLeft:"8px",textIndent:"-8px"},detailLabel:{color:"rgba(0, 0, 0, 0.6)",whiteSpace:"nowrap",lineHeight:"16px",letterSpacing:0,marginRight:"5px"},detailValue:{fontSize:"0.75rem",letterSpacing:0}})));var je=n(72768);function Ze(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}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){Me(e,t,n[t])}))}return e}function Me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ae=(e,t)=>{const{sortField:n,sortOrder:r,graphTypes:o}=e,a=(0,T.GyU)(e.root,{childrenProcessing:(0,T.MjG)({sortField:n,sortOrder:r,typesLabelsMap:(0,T.ORg)(t)}),nodeProcessing:(0,u.pipe)(Ve,Ge,qe)});return Le({},e,{root:a,entitiesMap:Ye(a),title:((0,T.jrr)(t,o)||{}).label})};let _e=0;const Ue=()=>_e++,He=e=>e?[].concat(e):[],ze=e=>(0,u.path)(["entity","uri"],e),Be=e=>e?(0,T.VGB)(e):[],Fe=(e,t)=>{const n=(0,u.prop)("relation",e);if(Array.isArray(n)){const r=He(e.parent),o=(0,u.findIndex)((0,u.equals)(t),r);return(0,u.path)([o],n)}return n},Ve=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.formatted?e:Le({},e,{nodeId:Ue(),parent:He(e.parent),directParentUri:ze(t),pending:!e.children&&e.total>0,formatted:!0,relations:Be(e.relation),relation:Fe(e,ze(t))})},We=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{children:n,parent:r,traversedRelations:o,untraversedRelations:a,cycled:l,formatted:i,relation:s}=e,c=Ze(e,["children","parent","traversedRelations","untraversedRelations","cycled","formatted","relation"]);if(i)return e;const u=o+a-1,d=ze(t),p={nodeId:Ue(),cycled:l,entity:c,parent:He(r),directParentUri:d,total:u,pending:!l&&!n&&u>0,formatted:!0,relations:Be(s),relation:Fe(e,d)};return n&&(p.children=n,p.pending=!l&&u>n.length),p},Ge=e=>{const t=e.children||[];return t.some((t=>(0,u.path)(["entity","uri"],t)===e.entity.uri||t.uri===e.entity.uri))||e.cycled||!e.parent.includes(e.entity.uri)?e:Le({},e,{children:t.concat(Le({},e,{nodeId:Ue(),directParentUri:e.entity.uri,total:0,children:[],cycled:!0}))})},qe=(0,u.when)((0,u.both)((0,u.has)("children"),(0,u.complement)((0,u.prop)("pending"))),(0,u.assoc)("expanded",!0)),$e=e=>{let{nodeId:t,relation:n,formatted:r,directParentUri:o,pending:a,children:l,total:i}=e;return Ze(e,["nodeId","relation","formatted","directParentUri","pending","children","total"])},Ye=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=ze(e);return n&&(t[n]=$e(e)),e.children&&e.children.forEach((e=>Ye(e,t))),t},Qe=e=>Object.keys(e).reduce(((t,n)=>{const r=We(e[n]);return t[n]=$e(r),t}),{}),Xe=(e,t)=>{let{entities:n,relations:r}=e;if(Array.isArray(n)){const e=n.reduce(((e,t)=>(e[t.uri]=t,e)),{});return(r||[]).forEach((n=>{const r=t?"startObject":"endObject",o=e[n[t?"endObject":"startObject"].objectURI],a=e[n[r].objectURI];o.children=o.children||[],o.children.includes(a)||o.children.push(a),a.parent=a.parent||[],a.relation||(a.relation=n),a.parent.includes(o.uri)||a.parent.push(o.uri)})),e}},Ke=(0,u.curry)(((e,t)=>(0,u.pipe)(Xe,Qe)(t,e))),Je=()=>({nodeId:Ue(),relation:{uri:(0,T.ncP)(),attributes:{}}}),et=be.N5.trees.actions,tt=e=>{let{parentUri:t,parentId:n,graphTypes:r,activenessDate:o,id:a,isReversed:l}=e;return(e,i)=>{const{sortField:s,sortOrder:c}=be.ZP.selectors.getTree(i(),a),d=be.ZP.selectors.getMetadata(i());return e(et.childrenLoading({id:a,parentId:n,nodeId:Ue()})),(0,T.ZYI)({uri:t,graphTypes:r,activenessDate:o}).then((r=>{const{children:o}=(e=>{let{json:t,parentUri:n,sortField:r,sortOrder:o,metadata:a,isReversed:l}=e;const i=Xe(t,l),s=i&&(e=>{const t=[{node:e,parent:null}],n=[];for(const e of t){const{node:r,parent:o}=e;n.includes(r)?o.children=o.children.map((e=>e===r?Le({},r,{cycled:!0,children:[]}):e)):(n.push(r),r.children&&t.push(...r.children.map((e=>({node:e,parent:r})))))}return e})(i[n]);return(0,T.GyU)(s,{nodeProcessing:(0,u.pipe)(We,Ge),childrenProcessing:(0,T.MjG)({sortField:r,sortOrder:o,typesLabelsMap:(0,T.ORg)(a)})})})({json:r,parentUri:t,sortField:s,sortOrder:c,metadata:d,isReversed:l}),i=Ke(l,r);e(et.childrenLoaded({id:a,children:o,parentId:n})),e(et.entitiesMappingLoaded({id:a,entitiesSubMap:i}))}))}},nt=e=>{let{id:t,uri:n}=e;return e=>{e(et.currentEntityShownInTree({id:t,uri:n})),setTimeout((()=>{e(et.resetScrollToNode(t))}),0)}},rt=(0,u.pipe)(T.kiP,(0,u.any)((0,u.prop)("secondaryLabelPattern")));function ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const at=be.N5.trees.actions,lt=(0,u.has)("attributes"),it=e=>{let{node:t,checkedNodes:n}=e;return(0,u.has)(t.nodeId,n)},st=(0,u.has)("editingMode"),ct=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return st(e)||(0,u.has)("children",e)&&e.children.some(ct)},ut=e=>{let{id:t,node:n}=e;return e=>{const{nodeId:r,relation:o}=n,a=Array.isArray(o)?o[0]:o;return lt(a)?Promise.resolve(o):(0,T._vs)(a.uri).then((n=>{const 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){ot(e,t,n[t])}))}return e}({},a,n);return e(at.treeNodeChanged({id:t,node:{nodeId:r,relation:o}})),Promise.resolve(o)}))}},dt=e=>e.loading||(0,u.has)("children",e)&&e.children.some(dt),pt=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;return t&&e},mt=(0,u.pick)(["startDate","endDate"]),gt=[{uri:"typeName",type:T.oS0.TYPE_STRING,label:p().text("Relationship")},...T.ViP],ft=e=>{let{showDetails:t,metadata:n,relation:r={}}=e;const o=De(),a=mt(r);return a.typeName=(0,u.prop)("label",(0,T.V3K)(n,r.type)),t&&r?l().createElement("div",{className:o.details},lt(r)?gt.map((e=>a[e.uri]&&l().createElement("div",{key:e.uri,className:o.detailLine},l().createElement("div",{className:o.detail},l().createElement(m.Typography,{variant:"caption",gutterBottom:!0,className:o.detailLabel},e.label+": "),l().createElement("span",{className:o.detailValue},l().createElement(je.Z,{value:a[e.uri],dataTypeDefinition:e})))))):l().createElement(he,{key:"loading-details",className:o.loadingNode})):null};ft.propTypes={showDetails:f().bool,relation:T.uTS,metadata:T.pGS};const ht=ft;var bt=n(27604),yt=n(82726),vt=n(86602),Et=n(74443),xt=n(22983),wt=n(8818),Ot=n(55847);const Ct=(0,w.Z)((()=>({addButton:{marginRight:"11px"},editButton:{marginRight:"13px"}}))),St=e=>{let{className:t,show:n,showDetails:r,onToggleRelationDetails:o,onMenuOpen:a,onMenuClose:i,onStartEditing:s,onAddParent:c,onAddChild:d,onDelete:m}=e;const g=Ct(),f=[c&&{text:p().text("Add Parent"),onClick:c},d&&{text:p().text("Add Child"),onClick:d}].filter(u.identity);return n&&(o||s||c||d||m)?l().createElement("div",{className:t},o&&l().createElement(wt.k,{tooltipTitle:r?p().text("Hide details"):p().text("View details"),tooltipPlacement:"bottom-end",size:"S",icon:r?vt.Z:yt.Z,onClick:o}),f.length>0&&l().createElement(Ot.Z,{buttonComponent:wt.k,buttonProps:{icon:Et.Z,size:"S",tooltipTitle:p().text("Add node"),className:g.addButton},menuId:"tree-node-actions",menuItems:f,onMenuOpen:a,onMenuClose:i}),s&&l().createElement(wt.k,{tooltipTitle:p().text("Edit node"),size:"S",icon:bt.Z,onClick:s,className:g.editButton}),m&&l().createElement(wt.k,{tooltipTitle:p().text("Delete node"),size:"S",icon:xt.Z,onClick:m})):null};St.propTypes={show:f().bool,showDetails:f().bool,className:f().string,onMenuOpen:f().func,onMenuClose:f().func,onStartEditing:f().func,onAddParent:f().func,onAddChild:f().func,onDelete:f().func,onToggleRelationDetails:f().func};const Pt=St,Nt=(0,u.prop)("graph"),Tt=(0,u.pipe)(Nt,(0,u.path)(["options","reverseRelations"])),kt=(0,u.pipe)(Nt,(0,u.prop)("type")),Rt=(0,u.pipe)((0,u.prop)("sortOrder"),T.de5),It=(0,u.pipe)((0,u.prop)("sortBy"),T.VO3),Dt=(0,u.pipe)((0,u.prop)("attributes"),(0,u.defaultTo)([]),(0,u.includes)("secondaryLabel"));function jt(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){Zt(e,t,n[t])}))}return e}function Zt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Lt=be.N5.trees.actions,Mt=(e,t,n)=>{const r=(0,T.nt9)(t,n)||{},o=(0,T.VD3)(t,r,"typeGraphIcon");return o&&(0,T.vPL)(e,o)},At=(e,t,n)=>{let{relation:r}=e;return!!r&&(0,T.Z5t)(n,(0,T.V3K)(t,r.type))},_t=(0,u.curry)(((e,t,n,r)=>{const{entity:o={}}=r,a=Tt(t)?"parent"===e:"child"===e,l=o.type,i=kt(t);if(i){const e=(0,T.jrr)(n,i),t=(0,T.SxO)(e)||[],r=(0,T.lhE)(n,u.__,l);return t.map((0,T.V3K)(n)).filter(u.identity).map(a?T.MaZ:T.GGR).some(r)}return!0})),Ut=_t("parent"),Ht=_t("child"),zt=(e,t,n)=>{let{relation:r}=e;return!!r&&(0,T.Edd)(n,(0,T.V3K)(t,r.type))},Bt=e=>{let{node:t,metadata:n,absoluteImagePath:r,currentEntityUri:o,mode:a,config:l={},uiPath:i,showSecondaryLabel:s,onParentsRequested:c,dispatch:d}=e;const{entity:p,children:m,total:g,pending:f,showParents:h,nodeId:b}=t,{id:y}=l,v=((e,t)=>ze(e)===t)(t,o),E=(0,T.KIu)(a),x={onToggleShowParents:e=>{d(Lt.treeNodeChanged({id:y,node:{nodeId:b,showParents:!h}})),e&&c(t)}},w=jt(E?{onStartEditing:At(t,n,a)?()=>d((e=>{let{id:t,node:n}=e;return e=>{const{nodeId:r}=n;e(at.treeNodeChanged({id:t,node:{nodeId:r,loading:!0}})),e(ut({id:t,node:n})).then((()=>{e(at.treeNodeEditingStarted({id:t,node:n}))}))}})({id:y,node:t})):null,onAddParent:Ut(l,n,t)?()=>d(Lt.treeNodeNewParentEditingStarted({id:y,node:t,newNode:Je()})):null,onAddChild:Ht(l,n,t)?()=>d((e=>{let{id:t,node:n,newNode:r,isReversed:o}=e;return(e,a)=>{if(e(at.treeNodeNewChildEditingStarted({id:t,node:n,newNode:r})),n.pending){const r=a(),{activenessDate:l,graphTypes:i}=be.ZP.selectors.getTree(r,t);e(tt({parentUri:n.entity.uri,parentId:n.nodeId,graphTypes:i,activenessDate:l,id:t,isReversed:o}))}}})({id:y,isReversed:Tt(l),node:t,newNode:Je()})):null,onDelete:zt(t,n,a)?()=>{const e=(0,u.path)(["relation","uri"],t);e&&d(Lt.treeRelationRemoved({relationUri:e})),d(Lt.treeNodeRemoved({id:y,nodeId:b}))}:null}:{onToggleRelationDetails:()=>d((e=>{let{id:t,node:n}=e;return e=>{const{nodeId:r,showDetails:o,relation:a}=n,l={nodeId:r,showDetails:!o};e(at.treeNodeChanged({id:t,node:l})),!o&&!lt(a)&&a&&e(ut({id:t,node:n}))}})({id:y,node:t}))},x);return jt({title:(0,T.idV)(p.label),subtitle:s?p.secondaryLabel:void 0,number:m&&!f?m.length:g,icon:Mt(r,n,p.type),isSelectedNode:v,entityLink:(0,T.ChB)({uiPath:i,uri:p.uri}),entityUri:p.uri,viewId:y,showDetails:t.showDetails&&!E},(0,u.reject)(u.isNil,w))},Ft=e=>{let{node:t,entitiesMap:n,metadata:r,config:o,absoluteImagePath:a,uiPath:l}=e;const{entity:i,directParentUri:s}=t;return(0,u.pathOr)([],[i.uri,"parent"],n).filter((e=>e!==s)).map((e=>{const t=(0,u.prop)(e,n);return t?Bt({node:t,config:o,metadata:r,absoluteImagePath:a,uiPath:l}):{pending:!0}}))},Vt=(0,a.createContext)({config:{},entitiesMap:{},onToggleNodeCheckbox:()=>{},onParentsRequested:()=>{},checkedNodes:{},canSelect:!1});Vt.displayName="NodeContext";var Wt=n(85229);const Gt=e=>{e.target.src=xe},qt=e=>{let{node:t={},registerChild:n,measure:r=u.identity}=e;const o=Ee(),i=(0,a.useRef)(),s=pe(),d=(0,N.useDispatch)(),{config:p,entitiesMap:g,onToggleNodeCheckbox:f,checkedNodes:h,canSelect:b,onParentsRequested:y,showSecondaryLabel:v}=(0,a.useContext)(Vt),E=(0,N.useSelector)(be.ZP.selectors.getAbsoluteImagePath),x=(0,N.useSelector)(be.ZP.selectors.getMetadata),{uri:w}=(0,N.useSelector)(be.ZP.selectors.getEntity),O=(0,N.useSelector)(be.ZP.selectors.getMode),C=(0,N.useSelector)(be.ZP.selectors.getUIPath),{title:S,subtitle:P,number:k,icon:R,relation:I,showDetails:D,additionalParents:j=[],showParents:Z,isSelectedNode:L,nodeId:M,entityLink:A,viewId:_,entityUri:U,onStartEditing:H,onAddParent:z,onAddChild:B,onToggleRelationDetails:F,onDelete:V,onToggleShowParents:W}=(e=>{let{node:t,entitiesMap:n,metadata:r,absoluteImagePath:o,currentEntityUri:a,mode:l,config:i,uiPath:s,showSecondaryLabel:c,onParentsRequested:u,dispatch:d}=e;return jt({},t,{relation:Array.isArray(t.relation)?t.relation[0]:t.relation},Bt({node:t,metadata:r,absoluteImagePath:o,currentEntityUri:a,mode:l,config:i,uiPath:s,showSecondaryLabel:c,onParentsRequested:u,dispatch:d}),{additionalParents:Ft({node:t,config:i,entitiesMap:n,metadata:r,absoluteImagePath:o,uiPath:s})})})({node:t,entitiesMap:g,metadata:x,absoluteImagePath:E,currentEntityUri:w,mode:O,config:p,uiPath:C,showSecondaryLabel:v,onParentsRequested:y,dispatch:d}),{isLoading:G,entityDetails:q,showEntityDetails:$,hideEntityDetails:Y}=(e=>{const[t,n]=(0,a.useState)(null),[r,o]=(0,a.useState)(!1),l=(0,a.useRef)(null),i=(0,Wt._)(),s=(0,a.useCallback)((()=>i(Promise.resolve())),[i]),c=(0,a.useCallback)((()=>{l.current=setTimeout((()=>{o(!0),i((0,T.HvW)(e)).then(n).finally((()=>o(!1)))}),1e3)}),[e,i]),u=(0,a.useCallback)((()=>{s(),clearTimeout(l.current),o(!1),n(null)}),[s]);return(0,a.useEffect)((()=>()=>clearTimeout(l.current)),[]),{isLoading:r,entityDetails:t,showEntityDetails:c,hideEntityDetails:u}})(U),Q=Boolean(q)||G,X=j.some((e=>e.pending)),[K,J]=(0,a.useState)(!1),ee=(0,a.useCallback)((()=>J(!0)),[]),te=(0,a.useCallback)((()=>J(!1)),[]),[ne,re]=(0,a.useState)(!1),oe=(0,a.useCallback)((()=>re(!0)),[]),ae=(0,a.useCallback)((()=>{re(!1),J(!1)}),[]),le=j.length>0,ie=le&&W?W.bind(null,X):void 0,se=((0,a.useCallback)((e=>f({checked:e.target.checked,node:t})),[t,f]),it({node:t,checkedNodes:h})),ce=(0,a.useCallback)((()=>{d(be.ui.actions.openEntity({uri:U,viewId:_}))}),[_,U,d]);return(0,a.useEffect)(r,[!1,le,P,!!F,D,k,Z,D&<(I),Z&&X,r]),l().createElement("div",{className:o.wrapper,"data-node-id":M,onMouseEnter:ee,onMouseLeave:te,ref:n},l().createElement("div",{ref:i,className:s.container},l().createElement(m.Avatar,{className:c()(o.avatar,{[o.avatarWithMultiParent]:le}),src:R||xe,onError:Gt,onClick:ie}),le&&l().createElement(Oe,{className:o.multiParentIcon,onClick:ie}),l().createElement("div",{className:s.title},l().createElement(Ne,{title:S,isSelected:L,link:A,onClick:ce,onMouseEnter:$,onMouseLeave:Y}),!!k&&l().createElement("span",{className:o.number},k),l().createElement(Pt,{show:K||ne,className:c()(o.actionsBlock,{[o.actionsBlockWithOpenMenu]:ne&&!se,[o.actionsBlockForCheckedNode]:ne&&se}),showDetails:D,onToggleRelationDetails:I&&F,onMenuOpen:oe,onMenuClose:ae,onStartEditing:H,onAddChild:B,onAddParent:z,onDelete:V}))),l().createElement(Ie,{showParents:Z,additionalParents:j}),P&&l().createElement("div",{className:o.subtitle},P),F&&l().createElement(ht,{showDetails:D,metadata:x,relation:I}),l().createElement(ye.Z,{anchorEl:i.current,className:o.popper,open:Q,modal:!1,placement:"top-start"},l().createElement(ve.Z,{entity:q,variant:G?"loading":"normal"})))};qt.propTypes={node:ee,registerChild:f().func,measure:f().func};const $t=(0,a.memo)(qt);var Yt=n(20562),Qt=n(47137),Xt=n(11564),Kt=n(26579),Jt=n(81077),en=n(91262),tn=n(27185);function nn(){return nn=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},nn.apply(this,arguments)}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}const an=e=>e.value,ln=(e,t)=>t.find((0,u.propEq)("value",e)),sn=e=>{let{value:t,relationTypes:n=[],isChild:r,onChange:o=u.identity,metadata:i}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["value","relationTypes","isChild","onChange","metadata"]);const c=(0,a.useMemo)((()=>((e,t,n)=>{const r={},o=(0,u.pipe)(T.PjQ,(0,u.tap)((e=>r[e]=(0,u.propOr)(0,e,r)+1))),a=(0,u.ascend)((0,u.prop)("label")),l=(e,t)=>{const n=(0,T.nt9)(e,t);return rn({},n,{typeIcon:(0,T.VD3)(e,n,"typeIcon")})};return e.map((e=>{let{uri:r,label:a,startObject:i,endObject:s}=e;return{label:{directionalLabel:o(t?s:i),typeLabel:a},value:r,startObject:rn({},i,{objectType:l(n,i.objectTypeURI)}),endObject:rn({},s,{objectType:l(n,s.objectTypeURI)})}})).map((0,u.evolve)({label:e=>{let{directionalLabel:t,typeLabel:n}=e;return t?r[t]>1?`${t} (${n})`:t:n}})).sort(a)})(n,r,i)),[n,r,i]);return l().createElement(tn.Z,nn({value:ln(t,c),options:c,onChange:(0,u.pipe)(an,o)},s))};sn.propTypes={className:f().string,value:f().string,relationTypes:f().arrayOf(T.IYE),isChild:f().bool,metadata:T.pGS,onChange:f().func};const cn=sn,un=(0,u.curry)(((e,t,n,r)=>{const o=(0,T.lhE)(n,u.__,t.type),a=e?T.MaZ:T.GGR;return(0,u.pipe)(a,o)(r)})),dn=(0,w.Z)((()=>({editorContainer:{width:"calc(100% - 34px)",minWidth:"185px",backgroundColor:"rgba(0,0,0,0.03)",padding:"16px 16px 8px 16px"},dense:{marginBottom:0},item:{marginBottom:"20px"},actionButtons:{display:"flex",justifyContent:"flex-end"}})));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){mn(e,t,n[t])}))}return e}function mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gn=be.N5.trees.actions,fn=e=>{let{node:t={},measure:n,registerChild:r}=e;const o=dn(),s=(0,N.useDispatch)(),{relatedEntity:d,relation:{uri:g}={},editingMode:f,initialConnection:h}=t,b=f===T.wwy.addingParent,{config:y}=(0,a.useContext)(Vt),v=y.id,E=Tt(y)||!1,x=E?b:!b,w=(0,N.useSelector)((e=>be.ZP.selectors.getTreeEditingConnection(e,v,g))),O=(0,N.useSelector)((e=>(0,T.NZI)(w,be.ZP.selectors.getProfileErrors(e)))),C=(0,N.useSelector)(be.ZP.selectors.getProfileErrors),{relation:S,entity:P}=w,{attributes:k,type:R,crosswalks:I=[]}=S,D=(0,a.useMemo)((()=>pn({attributes:k},(0,T.p2l)(S))),[k,S]),j=(0,N.useSelector)((e=>be.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),Z=(0,N.useSelector)(be.ZP.selectors.getMetadata),L=(0,N.useSelector)(be.ZP.selectors.getMode),M=kt(y),A=(0,T.jrr)(Z,M)||{},_=(0,a.useMemo)((()=>((e,t,n,r)=>(0,u.pipe)(T.SxO,(0,u.defaultTo)([]),(0,u.map)((0,T.V3K)(n)),(0,u.reject)(u.isNil),(0,u.filter)(un(e,t,n)))(r))(x,d,Z,A)),[x,d,Z,A]),U=(0,a.useMemo)((()=>P&&P.uri?_.filter((0,T.eHk)(x,P,d,Z)):_),[P,_,x,d,Z]),H=(0,a.useMemo)((()=>(0,T.jWj)(x,Z,R?[(0,T.V3K)(Z,R)]:_)),[x,Z,R,_]),z=(0,a.useCallback)((e=>{s(gn.treeNodeRelationTypeChanged({id:v,node:t,relationTypeUri:e}))}),[t,v,s]),B=(0,a.useCallback)((e=>{s(gn.treeNodeEntityChanged({id:v,node:t,entity:e}))}),[t,v,s]);(0,a.useEffect)((()=>{R||1!==_.length||z(_[0].uri)}),[R,_,z]),(0,Yt.D)((()=>{!R&&U.length>=1&&z(U[0].uri)}),[R,P,U,z]),(0,a.useEffect)(n,[v,w,C,R,_,!!z,P,U,n]);const F=(0,a.useMemo)((()=>(0,T.xF8)(Z,R)),[R,Z]),V=(0,a.useMemo)((()=>P&&{entityUri:P.uri,entityType:P.type,entityLabel:(0,T.idV)(P.label)}),[P]),W=(0,a.useCallback)((e=>(0,u.pipe)(be.N5.actions.addAttributes,s)(e.map((e=>pn({},e,{viewId:v}))))),[v,s]),G=(0,a.useCallback)((e=>(0,u.pipe)(be.N5.actions.modifyAttribute,s)(pn({},e,{viewId:v}))),[v,s]),q=(0,a.useCallback)((e=>(0,u.pipe)(be.N5.actions.removeAttribute,s)(pn({},e,{viewId:v}))),[v,s]),$=(0,a.useCallback)((()=>{const e=(0,T.Bxm)(Z,w);return s(be.N5.errors.actions.errorsSet(e)),0===e.length}),[w,Z,s]),Y=(0,a.useCallback)((()=>{s((e=>{let{id:t,node:n}=e;return e=>{e((0,u.cond)([[(0,u.equals)(T.wwy.addingParent),(0,u.always)(at.treeNodeNewParentEditingCanceled)],[(0,u.equals)(T.wwy.addingChild),(0,u.always)(at.treeNodeNewChildEditingCanceled)],[(0,u.equals)(T.wwy.editing),(0,u.always)(at.treeNodeEditingCanceled)]])(n.editingMode)({id:t,node:n}))}})({id:v,node:t}))}),[t,v,s]),Q=(0,a.useCallback)((()=>{$()&&s((e=>{let{id:t,node:n,isReversed:r}=e;return(e,o)=>{const a=be.ZP.selectors.getTreeEditingConnection(o(),t,n.relation.uri);let l;switch(n.editingMode){case T.wwy.addingParent:case T.wwy.addingChild:l=at.treeRelationCreated;break;case T.wwy.editing:l=at.treeRelationChanged}e(l((0,T.OT5)({node:n,connection:a,isReversed:r}))),e((0,u.cond)([[(0,u.equals)(T.wwy.addingParent),(0,u.always)(at.treeNodeNewParentEditingApplied)],[(0,u.equals)(T.wwy.addingChild),(0,u.always)(at.treeNodeNewChildEditingApplied)],[(0,u.equals)(T.wwy.editing),(0,u.always)(at.treeNodeEditingApplied)]])(n.editingMode)({id:t,node:n}))}})({id:v,isReversed:E,node:t}))}),[t,v,E,s,$]),X=!(0,u.equals)(h,w)&&R,K=(0,T.e$p)(O),J=(0,a.useContext)(Qt.M),ee=(0,a.useMemo)((()=>(0,u.allPass)([(0,u.pipe)((0,u.prop)("uri"),T.O27),(0,u.propEq)("parentUri",g),(0,u.propEq)("attributeTypeUri",R)])(J.error)),[g,R,J]),{ref:te,errorClassName:ne}=(0,Xt.B)({highlightedError:ee?J:null,isSimple:!0});return l().createElement("div",{className:o.editorContainer,ref:r},l().createElement(i.Z,{handleHeight:!0,onResize:n}),1!==_.length&&l().createElement(cn,{isChild:x,relationTypes:U,className:o.item,value:R,metadata:Z,onChange:z}),l().createElement("div",{ref:te,className:ne},l().createElement(Kt.Z,{errorMessage:K,className:o.item},l().createElement(Jt.Z,{key:R,className:c()({[o.dense]:K}),entity:V||{},entityTypesUris:H,max:y.max||20,globalSearchRequestOptions:j,mode:L,onChange:B,metadata:Z,attributeTypesSelectionStrategy:T.wcJ}))),R&&l().createElement(en.Z,{className:o.item,attrTypes:F,entity:D,showEmptyEditors:!1,crosswalks:I,mode:L,parentUri:g,onAddAttributes:W,onChangeAttribute:G,onDeleteAttribute:q}),l().createElement("div",{className:o.actionButtons},l().createElement(m.Button,{onClick:Y},p().text("Cancel")),l().createElement(m.Button,{color:"primary",disabled:!X,onClick:Q},p().text("Apply"))))};fn.propTypes={node:ee,registerChild:f().func,measure:f().func};const hn=(0,a.memo)(fn),bn="loading",yn="regular",vn="editor",En=(0,u.cond)([[st,(0,u.always)(vn)],[e=>e.loading,(0,u.always)(bn)],[u.T,(0,u.always)(yn)]]),xn=e=>class{static build(e){const{node:t}=e;switch(En(t)){case bn:return l().createElement(he,e);case yn:return l().createElement($t,e);case vn:return l().createElement(hn,e)}}}.build(e);xn.propTypes={node:ee,onToggleShowParents:f().func};const wn=xn,On=e=>{let{className:t,config:n,tree:r={},onChildrenRequested:o,onParentsRequested:i,onTreeChanged:s,onTreeScroll:u,onNodeMoved:d,onToggleNodeCheckbox:p,checkedNodes:m,mode:g}=e;const f=k(),h=(0,T.KIu)(g),b=(0,N.useSelector)(be.ZP.selectors.getMetadata),y=(0,a.useMemo)((()=>({config:n,entitiesMap:r.entitiesMap,onToggleNodeCheckbox:p,checkedNodes:m,canSelect:h,onParentsRequested:i,showSecondaryLabel:pt(r.showSecondaryLabel,Dt(n))})),[m,n,h,p,r.entitiesMap,r.showSecondaryLabel,i]),v=(0,a.useMemo)((()=>({generateTreeNodeProps:e=>{let{node:t}=e;return{treeNodeClassName:c()({[f.checkedNode]:it({node:t,checkedNodes:m}),[f.editorNode]:st(t)})}}})),[m,f]),E=(0,a.useCallback)((e=>{let{node:t}=e;return h&&!st(t)&&!dt(t)&&zt(t,b,g)}),[h,b,g]),x=(0,a.useCallback)((e=>{let{nextParent:t,node:o}=e;const a=!Tt(n),l=null===t?r.root:t;return l&&!l.loading&&Ht(n,b,l)&&(0,T.eHk)(a,o.entity,l.entity,b,(0,T.V3K)(b,o.relation.type))}),[n,b,r.root]);return l().createElement("div",{className:c()(f.panel,t)},l().createElement("div",{className:f.treeWrapper},l().createElement(F.Provider,{value:v},l().createElement(Vt.Provider,{value:y},l().createElement(de,{NodeRenderer:wn,onChange:s,canDrag:E,canDrop:x,root:r.root,scrollToNode:r.scrollTo,onScroll:u,onRequestChildren:o,onNodeMoved:d,inlineRoot:!!r.root&&st(r.root)})))))};On.propTypes={className:f().string,tree:ne,onChildrenRequested:f().func,onParentsRequested:f().func,onTreeChanged:f().func,onTreeScroll:f().func,onNodeMoved:f().func,onToggleNodeCheckbox:f().func,checkedNodes:f().object,mode:f().string,config:f().object};const Cn=(0,a.memo)(On);var Sn=n(10237),Pn=n(99136);function Nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tn=be.N5.trees.actions;var kn=n(43775);const Rn=e=>{let{value:t,onChange:n,graphTypes:r,className:o}=e;return l().createElement(kn.Z,{classes:{root:o},value:t,onChange:n,options:r.map((e=>{let{uri:t,label:n}=e;return{value:t,label:n}}))})};Rn.propTypes={value:f().string,onChange:f().func,graphTypes:f().arrayOf(T.mNm),className:f().string};const In=Rn;var Dn=n(8459);function jn(){return jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}const Zn=e=>{let{value:t,onChange: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={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["value","onChange"]);const o=(0,u.pipe)((e=>e&&e.getTime()),n);return l().createElement(Dn.Z,jn({value:t,label:p().text("Effective date"),onChange:o,margin:"dense"},r))};Zn.propTypes={value:te,onChange:f().func};const Ln=Zn;var Mn=n(36444),An=n(70595),_n=n(90324);const Un="23px",Hn=(0,w.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:Un,paddingRight:Un,minWidth:"245px",maxWidth:"308px",width:"40%"},title:{marginBottom:"30px"},sortControls:{display:"flex",alignItems:"center"},sortSelectorRoot:{flex:1,padding:"13px 16px",fontSize:"0.85rem"},sortSelectorMenuItem:{fontSize:"0.85rem"},sortOrderButton:{flexShrink:0,margin:"0 8px 0 7px"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{backgroundColor:"rgba(0,0,0,0.1)",margin:"19px -23px"}})));var zn=n(79026);const Bn=(0,h.Z)(m.FormControlLabel),Fn=[{label:p().text("Relationship type label"),value:T._R1.relationTypeLabel},{label:p().text("Entity label"),value:T._R1.entityLabel}],Vn=e=>{let{className:t,sortField:n,sortOrder:r,onSort:o,showSecondaryLabel:i,showSecondaryLabelDisabledReason:s,onShowSecondaryLabelChange:u}=e;const d=Hn(),g=(0,a.useRef)(),[f,h]=(0,a.useState)(!1),b=r===T.wUm.asc,y=()=>h((e=>!e));return l().createElement(l().Fragment,null,l().createElement(m.Button,{ref:g,classes:{root:c()(d.triggerButton,t)},onClick:y},l().createElement(Mn.Z,null)),l().createElement(m.Popover,{open:f,classes:{paper:d.popupContent},anchorEl:g.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},u&&l().createElement(l().Fragment,null,l().createElement(m.Typography,{className:d.viewOptionsTitle,variant:"h6"},p().text("View options")),l().createElement(Bn,{tooltipTitle:s,showForDisabled:!!s,classes:{root:d.checkboxControlRoot,label:d.checkboxControlLabel},control:l().createElement(m.Checkbox,{className:d.checkboxControlCheckbox,checked:i||!1,onChange:e=>u(e.target.checked)}),label:p().text("Display secondary label"),disabled:!!s}),l().createElement(m.Divider,{className:d.divider})),l().createElement(m.Typography,{className:d.title,variant:"h6"},p().text("Sort by")),l().createElement("div",{className:d.sortControls},l().createElement(zn.Z,{entries:Fn,TextFieldProps:{variant:"filled"},classes:{root:d.sortSelectorRoot,menuItem:d.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:n,onChange:e=>{o({sortField:e,sortOrder:r})},MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),l().createElement(wt.k,{tooltipTitle:b?p().text("Ascending"):p().text("Descending"),icon:b?_n.Z:An.Z,onClick:()=>{o({sortField:n,sortOrder:b?T.wUm.desc:T.wUm.asc})},className:d.sortOrderButton,size:"L"}))))};Vn.propTypes={className:f().string,sortField:f().string,sortOrder:f().string,onSort:f().func,showSecondaryLabel:f().bool,showSecondaryLabelDisabledReason:f().string,onShowSecondaryLabelChange:f().func};const Wn=Vn,Gn=(0,w.Z)((()=>({text:{fontSize:"12px",lineHeight:"14px",letterSpacing:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},textContainer:{maxWidth:"calc(100% - 13px)"},separator:{marginLeft:"4px",marginRight:"4px"}})));function qn(){return qn=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},qn.apply(this,arguments)}const $n=e=>{let{items:t=[]}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["items"]);const r=Gn();return l().createElement(m.Breadcrumbs,qn({"aria-label":p().text("Breadcrumb"),expandText:p().text("Show path"),classes:{li:r.textContainer,separator:c()(r.text,r.separator)}},n),t.map(((e,t,n)=>{const{label:o,href:a,onClick:i}=e,s=t===n.length-1?"textPrimary":"textSecondary";return i||a?l().createElement(m.Link,{key:t,color:s,classes:{root:r.text},href:a,onClick:i},o):l().createElement(m.Typography,{key:t,href:a,color:s,classes:{root:r.text}},o)})))},Yn=f().shape({label:f().string.isRequired,href:f().string,onClick:f().func});$n.propTypes={items:f().arrayOf(Yn)};const Qn=$n,Xn=be.N5.trees.actions,Kn=["showSecondaryLabel"],Jn=(0,u.pipe)((0,u.filter)((0,u.anyPass)([(0,u.has)("root"),...Kn.map((e=>(0,u.has)(e)))])),(0,u.map)((0,u.pick)(Kn)),(0,u.reject)(u.isEmpty)),er=be.N5.trees.actions,tr=(0,w.Z)((e=>({view:{width:"100%"},linearIndicator:{top:"42px"},filtersBar:{paddingLeft:"24px",display:"flex",alignItems:"center",marginTop:"2px",marginBottom:"12px",height:"46px"},errorMessage:{fontSize:"13px",marginLeft:"24px",marginRight:"16px",lineHeight:"1.4",color:e.palette.text.secondary},activenessDate:{flex:1,margin:0},filterSortButton:{flexShrink:0,margin:"0 6px 0 12px"},breadcrumbs:{padding:"8px 24px",backgroundColor:"rgba(0,0,0,0.03)"},graphTypeSelector:{margin:"0 10px 15px 24px",overflow:"hidden"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}})));function nr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const rr=be.N5.trees.actions,or=(0,N.connect)(((e,t)=>({tree:be.ZP.selectors.getTree(e,t.config.id),total:be.ZP.selectors.getTreeTotal(e,t.config.id),entity:be.ZP.selectors.getEntity(e),metadata:be.ZP.selectors.getMetadata(e),mode:be.ZP.selectors.getMode(e)})),void 0)((e=>{let{config:t,tree:n,metadata:r,entity:o={},mode:i,className:s}=e;const{id:d,caption:g,graph:f,showPath:h}=t,{uri:b,type:y}=o,v=(0,a.useRef)(Date.now()),{activenessDate:E=v.current,sortField:x,sortOrder:w,loading:O,errorMessage:C,showSecondaryLabel:S}=n||{},k=Tt(t),R=Dt(t),I=pt(S,R),[D,j]=(0,a.useState)(f.type),L=(0,a.useMemo)((()=>((0,T.mmY)(r,y),[])),[r,y]),M=rt(r,D),A=(0,N.useDispatch)(),_=(0,a.useCallback)((e=>{let{sortField:t,sortOrder:n}=e;A(rr.treeSorted({id:d,typesLabelsMap:(0,T.ORg)(r),sortField:t,sortOrder:n})),A((e=>(t,n)=>{const r=be.ZP.selectors.getTree(n(),e),o=(0,u.path)(["root","children",0,"entity","uri"],r);o&&t(nt({id:e,uri:o}))})(d))}),[d,r,A]),U=(0,a.useCallback)((0,T.DsO)((()=>A((e=>(t,n)=>{const r=n(),o=be.ZP.selectors.getTrees(r),a=Jn(o);t(Xn.treesStateSaved({id:e,state:a}))})(d))),500),[d,A]),H=(0,a.useCallback)((e=>{A(rr.treeSecondaryLabelShown({id:d,show:e})),U()}),[d,A,U]);(0,a.useEffect)((()=>{x&&w||_({sortField:It(t),sortOrder:Rt(t)})}),[_,x,w,t]),(e=>{let{entityUri:t,id:n,graphTypes:r,activenessDate:o,isReversed:l,enabled:i}=e;const s=(0,Wt._)({cancelOnUnmount:!1}),c=(0,N.useDispatch)(),d=(0,N.useSelector)(be.ZP.selectors.getMetadata),m=(0,N.useSelector)((e=>be.ZP.selectors.getTree(e,n)))||{},{root:g,isReversed:f,graphTypes:h}=m,b=(0,Z.D)(o)||o,y=(0,a.useCallback)((()=>setTimeout((()=>c(nt({id:n,uri:t}))),100)),[n,t,c]),v=!!g,E=(0,N.useSelector)(be.ZP.selectors.getEntity);(0,Yt.D)((()=>{const e=(0,T.XTh)((0,u.pick)(["uri","label","secondaryLabel","type"],E),{[n]:m});e.length&&c(Tn.treeChanged({id:n,tree:e[0].root}))}),[null==E?void 0:E.updatedTime]),(0,a.useEffect)((()=>{i&&v&&y()}),[i,y,v]),(0,a.useEffect)((()=>{if(i){const e=e=>Tn.treeLoaded({id:n,tree:e,graphTypes:r,activenessDate:o,isReversed:l}),a=(0,u.pipe)(Ae,e,c);(!(0,T.fbl)(g,t)||f!==l||b!==o||h!==r||ct(g))&&(c(Tn.treeLoading(n)),s((0,T.IMU)({uri:t,graphTypes:r,activenessDate:o,isReversed:l})).then((e=>a(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){Nn(e,t,n[t])}))}return e}({},e,{graphTypes:r}),d))).then((e=>y())).catch((e=>{c(Tn.treeLoadedWithError({id:n,errorMessage:(0,T.xU7)(e,p().text("Something went wrong"))})),console.warn(e)})))}}),[t,g,r,o,n,d,l,i,s,c,y,f,h,b])})({id:d,entityUri:b,graphTypes:D,activenessDate:E,isReversed:k,enabled:b&&(0,T.uzs)(i)&&!(0,T.ZiX)(b)}),(e=>{var t,n;let{id:r,entityUri:o,graphTypes:l,activenessDate:i,isReversed:s}=e;const c=(0,N.useDispatch)(),d=(0,N.useSelector)(be.ZP.selectors.getMetadata),p=(0,N.useSelector)((e=>be.ZP.selectors.getModifiedEntity(e,o))),{root:m}=(0,N.useSelector)((e=>be.ZP.selectors.getTree(e,r)))||{},g=(null==m||null===(t=m.entity)||void 0===t?void 0:t.uri)===o||(null==m?void 0:m.editingMode)===T.wwy.addingParent&&(null==m||null===(n=m.children)||void 0===n?void 0:n.some((e=>{let{entity:t}=e;return(null==t?void 0:t.uri)===o})));(0,a.useEffect)((()=>{if(p&&(0,T.ZiX)(o)&&!g){const e=e=>er.treeLoaded({id:r,tree:e,graphTypes:l,activenessDate:i,isReversed:s});(0,u.pipe)(Ae,e,c)({root:{entity:p,total:0},graphTypes:l},d)}}),[i,c,o,l,r,s,d,p,g])})({id:d,entityUri:b,graphTypes:D,activenessDate:E,isReversed:k});const z=(0,a.useCallback)((e=>A(tt({parentUri:e.entity.uri,parentId:e.nodeId,graphTypes:D,activenessDate:E,id:d,isReversed:k}))),[D,E,d,A,k]),B=(0,a.useCallback)((e=>A((e=>{let{uri:t,graphTypes:n,activenessDate:r,id:o,isReversed:a}=e;return e=>{const l=(0,u.pipe)(Ke(a),(e=>et.entitiesMappingLoaded({id:o,entitiesSubMap:e})),e);return(0,T.ZYI)({uri:t,graphTypes:n,activenessDate:r}).then(l)}})({uri:e.entity.uri,graphTypes:D,activenessDate:E,id:d,isReversed:k}))),[D,E,d,k,A]),F=(0,a.useCallback)((e=>{A(rr.treeChanged({id:d,tree:e}))}),[A,d]),V=(0,a.useCallback)((e=>{A(rr.activenessDateChanged({id:d,activenessDate:e}))}),[A,d]),W=(0,a.useCallback)((e=>{A(nt({id:d,uri:b}))}),[A,d,b]),G=(0,a.useCallback)((e=>{const{node:t,nextParentNode:n}=e,{entity:r}=n||{},{relation:o,entity:a}=t;o?A(rr.treeRelationRepointed({entity:a,relation:o,newParent:r,isReversed:k})):console.error("relation not found:"+JSON.stringify(e))}),[A,k]),[q,$]=(0,a.useState)({}),Y=(0,a.useCallback)((e=>{let{checked:t,node:n}=e;$(t?e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){nr(e,t,n[t])}))}return e}({},e,{[n.nodeId]:n}):(0,u.omit)([n.nodeId]))}),[]),Q=(0,a.useCallback)((()=>{A(be.ui.actions.openGraph({viewId:d,graphType:D,entityUri:b}))}),[A,d,D,b]),X=(0,a.useCallback)((()=>$({})),[]);(0,a.useEffect)(X,[i]);const K=tr(),J=(0,a.useMemo)((()=>(0,T.aNC)((n||{}).root,b).map((e=>({label:(0,T.idV)((0,u.path)(["entity","label"],e))})))),[n,b]);return l().createElement(Sn.Z,{className:c()(K.view,s)},l().createElement(P,{title:g,onScrollToCurrentEntity:W,entityLabel:(0,T.idV)(o.label),onGraphOpen:Q,disabled:O}),O&&l().createElement(Pn.Z,{className:K.linearIndicator}),L.length>0&&l().createElement(In,{className:K.graphTypeSelector,value:D,onChange:j,graphTypes:L}),l().createElement("div",{className:K.filtersBar},l().createElement(Ln,{className:K.activenessDate,value:E,onChange:V,fullWidth:!0}),l().createElement(Wn,{sortField:x,sortOrder:w,className:K.filterSortButton,onSort:_,showSecondaryLabel:I,onShowSecondaryLabelChange:R?H:void 0,showSecondaryLabelDisabledReason:M?"":p().text("Entity types in this hierarchy don't have any secondary label pattern defined.")})),h&&J.length>0&&l().createElement(Qn,{items:J,className:K.breadcrumbs}),C?l().createElement(m.Typography,{className:K.errorMessage},C):l().createElement(Cn,{config:t,tree:n,onTreeChanged:F,mode:i,onNodeMoved:G,onParentsRequested:B,onChildrenRequested:z,onToggleNodeCheckbox:Y,checkedNodes:q}))}));var ar=n(36138),lr=n(22664),ir=n(39450),sr=n(585);const cr=(0,ar.createGenerateClassName)({productionPrefix:"hierarchyTree",disableGlobal:!0}),ur=e=>{let{config:t,store:n,onResize:r=u.identity,className:a}=e;return l().createElement(N.Provider,{store:n},l().createElement(ir.m.Provider,{value:t.id},l().createElement(ar.StylesProvider,{generateClassName:cr},l().createElement(lr.MuiPickersUtilsProvider,{utils:o.Z},l().createElement(i.Z,{handleHeight:!0,onResize:(e,t)=>r(Math.floor(e),Math.floor(t))}),t&&l().createElement(or,{config:t,className:a}),l().createElement(sr.Z,null)))))}},99496:(e,t,n)=>{n.d(t,{_n:()=>Za,tM:()=>Ya});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),s=n(36138),c=n(44443),u=n(22664),d=n(24605),p=n(39450),m=n(97094),g=n(60115),f=n(585),h=n(90088),b=n(87918),y=n.n(b),v=n(3096),E=n.n(v),x=n(59431),w=n(60641),O=n(7718),C=n(3515),S=n(17554),P=n(61756),N=n(57730),T=n(76536),k=n(26481),R=n(49759),I=n(94150),D=n(26005),j=n(72249),Z=n(47137),L=n(99136),M=n(30268),A=n(21077),_=n(67268),U=n(71153),H=n.n(U),z=n(8962);const B=o().createContext(null);B.displayName="SingleAttributeContext";var F=n(60995),V=n(10237),W=n(58662),G=n(94079),q=n(93416),$=n(75512),Y=n(30553),Q=n(81149),X=n(32152),K=n(36444),J=n(79692);const ee=(0,J.Z)((()=>({triggerButton:{minWidth:0,color:"rgba(0,0,0,0.54)",width:"36px"},popupContent:{paddingTop:"19px",paddingBottom:"23px",paddingLeft:"23px",paddingRight:"23px",maxWidth:"180px",width:"40%"},checkboxControlRoot:{marginTop:"6px",marginLeft:"-12px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),te=e=>{let{className:t}=e;const n=ee(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(B),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(G.Button,{ref:a,classes:{root:H()(n.triggerButton,t)},onClick:u},o().createElement(K.Z,null)),o().createElement(G.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(G.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(G.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:y().text("Show inactive values")})))},ne=(0,J.Z)((()=>({root:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},ovIcon:{marginTop:"2px",marginLeft:"5px"}}))),re=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=ne(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:d,attributeType:p}=(0,r.useContext)(B);return o().createElement(q.Z,{title:t,className:l.root},o().createElement($.Z,{widthToHide:500},o().createElement(Y.Z,{height:24,margin:16}),o().createElement(G.Typography,{className:l.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),o().createElement(Q.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:d,attributeType:p}),o().createElement(X.i,{query:i,onChange:e=>{s(e),c(0)}}),a&&o().createElement(te,null))};var oe=n(65549),ae=n(93140),le=n(76134),ie=n(96698);const se=(0,J.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 -16px 8px",backgroundColor:"rgba(0,0,0,0.12)"},ovFalse:e.inactive,noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px 8px 0"}}))),ce=h.nIW,ue=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ue(n,t)})))):h.P6Y.strings.search(String(e),t),de=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(h.XtP,(0,i.filter)((e=>{let{value:t}=e;return ue(t,l)})))(t,n,r),c=(0,i.filter)(h.OXP,s);return{[(0,h.xy8)(r)]:{[ce(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function pe(){return pe=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},pe.apply(this,arguments)}function me(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){ge(e,t,n[t])}))}return e}function ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fe=[],he=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s,noDataText:c}=e;const u=se(),{uri:d,required:m,cardinality:g,name:f}=n,b=(0,a.useDispatch)(),v=(0,r.useContext)(p.m),E=(0,a.useSelector)(x.ZP.selectors.getEntity),w=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,E.uri)||{})),O=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),C=(0,a.useSelector)((e=>(0,h.tQX)(l,n,x.ZP.selectors.getProfileErrors(e)))),S=(0,a.useSelector)(x.ZP.selectors.getMode),P=(0,h.xy8)(n),N=(0,i.pipe)((0,i.pathOr)(fe,[P,f]),(0,i.map)((0,i.prop)("uri")))(E),T=(0,i.pathOr)(fe,[P,f],w),k=T.map((0,i.prop)("uri")),R=(0,h.ZiX)(E.uri),I=(0,r.useRef)((0,h.gjI)({parentUri:l,attributeType:n})),D=(0,h.O27)(T),j=m&&D,Z=j?[I.current]:T.filter((0,i.pipe)((0,i.prop)("uri"),h.ZiX)),L=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,b)(e.map((e=>me({},e,{viewId:v}))))),[v,b]),M=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.modifyAttribute,b)(me({},e,{viewId:v}))),[v,b]),A=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,b)(me({},e,{viewId:v}))),[v,b]),_=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,b),[b]),U=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return L(j&&!(0,h.YkM)(n.type)?[e,e]:[e])}),[L,l,n,j]),z=(0,h.Vg3)({attributeType:n,mode:S}),B={attributeType:n,errors:O,crosswalks:w.crosswalks,mode:S,onAddAttributes:L,onChangeAttribute:M,onDeactivateError:_,showNonOv:s},F=0===Z.length&&0===t.length;return o().createElement("div",null,o().createElement(ae.Z,{cardinality:g}),o().createElement(le.Z,{message:C}),z&&o().createElement(G.Button,{color:"primary",onClick:U,className:u.moreButton},o().createElement(oe.Z,{classes:{root:u.icon}}),o().createElement("div",{className:u.buttonLabel},y().text("Add"))),Z.map(((e,t)=>o().createElement(ie.Z,pe({key:e.uri},B,{attributeValue:e,lazy:j&&!m,showEmptyEditors:R,ownError:(0,h.ADq)(e,t,d,O),onDeleteAttribute:A})))),Z.length>0&&t.length>0&&o().createElement(G.Divider,{className:u.divider}),t.map((e=>{const t=T.find((0,i.propEq)("uri",e.uri)),n=t||e,r=N.includes(n.uri)&&!k.includes(n.uri),a=!r&&t&&!((e,t)=>{const n=(0,i.is)(Object,e.value)||(0,i.is)(Object,t.value)?(0,i.over)((0,i.lensPath)(["value"]),(0,h.vKJ)({valueTransformer:(0,i.unless)(h.OXP,(0,i.omit)(["value"])),deleteEmptyComplex:!0})):i.identity;return(0,i.equals)(n(e),n(t))})(t,e),l=(0,i.cond)([[(0,i.always)(r),(0,i.always)("deleted")],[(0,i.always)(a),(0,i.always)("edited")]])();return o().createElement("div",{key:n.uri,className:H()({[u.ovFalse]:!(0,h.OXP)(n)})},o().createElement(ie.Z,pe({},B,{attributeValue:n,ownError:(0,h.ADq)(n,null,d,O),onDeleteAttribute:A,state:l})))})),F&&o().createElement(G.Typography,{className:u.noData},c))};var be=n(81303);const ye=e=>{let{values:t,attributeType:n,showInactive:r}=e;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(be.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r}))))},ve=(0,J.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),Ee=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=ve(),{values:u,totalVisibleValues:d,page:p,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:b}=(0,r.useContext)(B),v=(0,a.useSelector)(x.ZP.selectors.getEntityUri),E=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),O=(0,a.useSelector)(x.ZP.selectors.getPivotingAttributes),C=0!==u.length,S=t["text-empty"]||y().text("No data found");return o().createElement(F.J.Provider,{value:O},o().createElement(V.Z,{className:H()(c.root,n)},o().createElement(re,{totalVisibleValues:d,caption:l,showInactiveValuesMenu:s}),o().createElement(G.Box,{className:c.content},(()=>{if(g)return o().createElement(L.Z,null);if(h){if(E&&C){const e={values:u,attributeType:h,showInactive:b};return o().createElement(ye,e)}if(w){const e={values:u,attributeType:h,parentUri:v,showInactive:b,noDataText:S};return o().createElement(he,e)}}return o().createElement(G.Typography,{className:c.noData},S)})()),f&&o().createElement(W.Z,{count:d,page:p,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var xe=n(85229),we=n(20562);function Oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ce=(e,t,n)=>{const{attributeUri:o,max:l=15}=e,s=(0,a.useSelector)(x.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[d,p]=(0,r.useState)(null),[m,g]=(0,r.useState)(!1),f=(0,xe._)(),b=(0,r.useRef)(null),y=(0,a.useDispatch)(),v=(0,a.useSelector)(x.ZP.selectors.getApiPath),E=(0,a.useSelector)(x.ZP.selectors.getTenant),w=n?x.ZP.selectors.getEntityWithDiff:x.ZP.selectors.getEntityWithoutDiff,O=(0,a.useSelector)(w),C=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),S=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),P=(0,a.useSelector)(x.ZP.selectors.getHistoryDiff),N=O.uri,T=ce(o),k=(0,h.xy8)(o);b.current=(0,h.JQy)(O,N,T);const R=(0,r.useMemo)((()=>(0,h.zeJ)(s,o)),[s,o]),{globalFilter:I}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:D}=t,j=(0,r.useCallback)((()=>{if(R&&(0,h.Uty)(R)&&!(0,h.ZiX)(N)&&(0,h.YOQ)(o)){g(!0);const{page:e,showInactive:n}=t,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["page","showInactive"]),a=(0,h.biM)(O)||S?de:h.KbL;f(a(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){Oe(e,t,n[t])}))}return e}({metadata:s,entity:O,apiPath:v,tenant:E,parentUri:N,defaultMaxValues:l,attributeTypeUri:o,offset:l*e,globalFilter:I,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([k],e),n=(0,i.pathOr)([],[T],t);S||y(x.N5.actions.processNextPageOfAttributeValues({parentUri:N,attributeTypeUri:o,attributeTypeName:T,values:n})),u(n.map((e=>{var t;return(null===(t=b.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),p((0,i.path)(["paging",o],t))})).finally((()=>{g(!1)}))}else u([]),p(null)}),[v,N,E,o,l,s,t,I,R,S,P]);(0,r.useEffect)((()=>{j()}),[j]),(0,we.D)((()=>{C&&j()}),[C]);const Z=(0,i.partition)(h.OXP),[,L]=Z(b.current||[]),M=D?[]:L,A=D?"totalValues":"totalOvValues",_=(0,i.ifElse)((0,i.has)(A),(0,i.prop)(A),(0,i.always)(c.length))(d),U=l<_,H=null!=d&&d.totalValues?d.totalValues-_:M.length;return{values:c,isLoading:m,hasPaging:U,totalVisibleValues:_,attributeType:R,totalNonVisibleValues:H,nonVisibleValues:M}};function Se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pe=n(37152),Ne=n(31274),Te=n(79026),ke=n(8818),Re=n(90324),Ie=n(70595);const De=o().createContext(null);De.displayName="RelationsViewStateContext";const je=(0,J.Z)((e=>({button:{color:e.palette.text.secondary,width:"36px",minWidth:"36px"},popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{backgroundColor:"rgba(0,0,0,0.1)",margin:"19px -23px"},title:{marginBottom:"30px"},sortControls:{display:"flex",alignItems:"center"},sortSelectorRoot:{flex:1,padding:"13px 16px",fontSize:"0.85rem"},sortSelectorMenuItem:{fontSize:"0.85rem"},sortOrderButton:{flexShrink:0,margin:"0 8px 0 7px"}}))),Ze=e=>{let{className:t}=e;const n=je(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:d,sortOptions:p}=(0,r.useContext)(De),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),b=!(0,h.O27)(p),v="asc"===s;return o().createElement(o().Fragment,null,o().createElement(G.Button,{ref:a,classes:{root:H()(n.button,t)},onClick:f},o().createElement(K.Z,null)),o().createElement(G.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(G.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(G.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),b&&o().createElement(o().Fragment,null,o().createElement(G.Divider,{className:n.divider}),o().createElement(G.Typography,{className:n.title,variant:"h6"},y().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Te.Z,{entries:p,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:d,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),o().createElement(ke.k,{tooltipTitle:v?y().text("Ascending"):y().text("Descending"),icon:v?Re.Z:Ie.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Ze.displayName="FilterButton";const Le=Ze,Me=(0,J.Z)({header:{padding:"0 6px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"}});var Ae=n(61932),_e=n(55847);const Ue=o().createContext(null);function He(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){ze(e,t,n[t])}))}return e}function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Be=Math.pow(2,31)-1,Fe=(0,J.Z)((()=>({tenant:{backgroundColor:"#0000EE",cursor:"pointer",position:"absolute",top:"8px",left:"22px",width:"10px",height:"10px",color:"white",fontSize:"10px",fontWeight:"bold",userSelect:"text",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},button:{position:"relative"},badge:{fontSize:"10px",height:"14px",minWidth:"14px",width:"14px",fontWeight:"bold",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px",top:"4px"}})));var Ve=n(81137);const We=e=>{let{label:t}=e;const n=Fe();return o().createElement(G.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(Ae.Z,null))},Ge=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(x.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(Ue),i=(0,a.useSelector)(x.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,d]=(0,r.useState)(null),p=(0,a.useSelector)(x.ZP.selectors.getDtssPath),m=(0,a.useSelector)(x.ZP.selectors.getTenant),g=[He({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:Be})],f=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,h.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,h.QXb)({entityUri:i,content:g,dtssPath:p,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return He({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,p,m,o,t]),b=(0,r.useCallback)((()=>{(0,h.MOC)({entityUri:i,content:g,dtssPath:p,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(x.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong")))))),d(null)}),[i,p,m,o,f,l,u,d]);(0,r.useEffect)((()=>{f()}),[f]);const v=(0,r.useCallback)((()=>d(null)),[]),E=(0,r.useCallback)((e=>d(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:b,onCancelConfirmation:v,onImportClick:E}})(),s=Fe(),c=1===e.length,u=c?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return o().createElement(o().Fragment,null,!!e.length&&o().createElement(o().Fragment,null,c?o().createElement("div",{className:s.button},o().createElement(ke.k,{size:"L",icon:Ae.Z,tooltipTitle:y().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:H()(s.tenant)},u)):o().createElement(_e.Z,{menuId:"importDT-table-actions",buttonComponent:ke.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>o().createElement(We,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(Ve.Z,{open:!!t,title:y().text("Confirmation"),content:y().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:y().text("Cancel"),saveCaption:y().text("Import"),onDiscard:l,onSave:n})))},qe=e=>{let{title:t,total:n}=e;const a=Me(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(De);return o().createElement(q.Z,{title:t||"",className:a.header},n>0&&o().createElement($.Z,{widthToHide:400},o().createElement(Y.Z,{height:24,margin:16}),o().createElement(G.Typography,{className:a.totalCaption,variant:"caption"},n>1?y().text("${count} items",{count:n}):y().text("${count} item",{count:n}))),o().createElement(X.i,{query:l,onChange:i}),o().createElement(Ge,null),o().createElement(Le,null))};var $e=n(11013),Ye=n(27604),Qe=n(22983),Xe=n(31254),Ke=n(31039);const Je=(0,J.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px"},label:{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},secondaryLabel:{color:"rgba(255, 255, 255, 0.7)",fontSize:"10px",marginTop:"4px",fontWeight:500,lineHeight:"11px"},progress:{marginTop:"4px",color:"#FFFFFF"}})));function et(){return et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},et.apply(this,arguments)}const tt=e=>{let{label:t,entity:n,children:l}=e,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["label","entity","children"]);const c=Je(),u=(0,xe._)(),d=(0,a.useSelector)(x.ZP.selectors.getTenant),p=(0,a.useSelector)(x.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,b]=(0,r.useState)(null);(0,r.useEffect)((()=>{b(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&!(0,h.ZiX)(null==n?void 0:n.entityUri)&&(0,i.isNil)(f)){const e=(0,i.ifElse)(h.biM,(e=>(0,h.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:d,dtssPath:p})),(e=>(0,h.XkT)(e.entityUri)));g(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;b(t)})).finally((()=>{g(!1)}))}}),[p,n,d,u,f]),v=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),m&&o().createElement(G.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),f&&o().createElement("div",{className:c.secondaryLabel},f));return o().createElement(G.Tooltip,et({onOpen:y,title:v,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},nt=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,h.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,h.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,h.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,h.Lmx)(t,null==r?void 0:r.relationType)}};var rt=n(77277);const ot=(0,J.Z)((()=>({container:{display:"flex"}})));function at(){return at=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},at.apply(this,arguments)}const lt=e=>{let{acceptRelation:t,ignoreRelation: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={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["acceptRelation","ignoreRelation"]);const a=ot();return o().createElement("div",{className:a.container},o().createElement(rt.Z,at({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),o().createElement(rt.Z,at({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},it=(0,J.Z)((e=>({container:{display:"flex",flexDirection:"column",marginBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"24px",padding:"0 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},editButtonsContent:{marginLeft:"auto",flex:"0 0 40px"},editButtons:{padding:0},removed:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary,margin:"0 5px"}}))),st=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:l,onRemoveRelation:i,onEditRelation:s,onAcceptRelation:c,onIgnoreRelation:u,renderRelationArrowButton:d}=e;const p=it(),{entity:m,relation:g}=t,f=(0,h.$qe)(t),b=(0,h.xr3)(t),v=(0,h.iJH)(t),{entityType:E,entityLabel:w,preparedUri:O,relationLabel:C}=nt(t,n),S=(0,h.Fn9)(g)&&(0,h.Fn9)(m),P=(0,a.useSelector)(x.ZP.selectors.getMode),{canRemove:N,canUpdate:T}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===h.ARY.Editing||n===h.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,h.$qe)(r),i=(0,h.V3K)(t,e);return{canRemove:o&&!l&&(0,h.Edd)(n,i),canUpdate:a&&!l&&(0,h.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:P,onRemoveRelation:i,onEditRelation:s,metadata:n,connection:t}),k=(0,r.useCallback)((()=>i(t.relation.relationUri)),[i,t]),R=(0,r.useCallback)((()=>s(t)),[s,t]),I=(0,r.useCallback)((()=>{c(t)}),[c,t]),D=(0,r.useCallback)((()=>u(t)),[u,t]),j=(N||T)&&l&&!t.suggested?o().createElement(o().Fragment,null,T&&o().createElement(ke.k,{icon:Ye.Z,size:"XS",onClick:R,tooltipTitle:y().text("Edit")}),N&&o().createElement(ke.k,{icon:Qe.Z,size:"XS",onClick:k,tooltipTitle:y().text("Remove")})):void 0,Z=t.suggested?o().createElement(lt,{acceptRelation:I,ignoreRelation:D,size:"small",disabled:v}):void 0,L=v?y().text("ignored"):y().text("edited");return o().createElement("div",{className:H()(p.container,{[p.rowInactive]:!S},{[p.removed]:f||v})},o().createElement("div",{className:p.row},d&&d(),o().createElement(Xe.Z,{className:p.entityAvatar,entityType:E}),o().createElement(Ke.Z,{value:O,className:p.entityLabelContainer},o().createElement(tt,{label:w,entity:m},o().createElement("span",{className:p.entityLabel},w)),(b||v)&&o().createElement(G.Typography,{variant:"caption",className:p.editedLabel},"(",L,")"),C&&o().createElement("span",{className:p.relationLabel},`, ${C}`)),o().createElement("div",{className:p.editButtonsContent},j),Z))}));st.displayName="EditableRelationItem";const ct=st,ut=(e,t)=>{const n=(e,t)=>(t?(0,h.VGB)(t):[]).map((t=>({type:t,direction:e===h.Nsj.IN?h.Nsj.IN:h.Nsj.OUT})));return n(h.Nsj.IN,e).concat(n(h.Nsj.OUT,t))[0]};function dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pt=n(98989),mt=n(83543);const gt=(0,J.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),ft=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=gt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,h.xvW)(n)?null:a?o().createElement(mt.Z,c):o().createElement(pt.Z,c)},ht=(0,J.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),bt=e=>{let{config:t,connection:n,children:l}=e;const i=ht(),{showInactive:s}=(0,r.useContext)(De),{connections:c,showSecondLevel:u,toggleShowSecondLevel:d,loadRelations:p,loading:m,total:g}=(e=>{let{config:t,connection:n,relationActivityFilter:o}=e;const l=(0,a.useDispatch)(),[i,s]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),{contentSecondLevel:d}=t,{entity:p}=n,m=(0,a.useSelector)((e=>x.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,p.entityUri)))||[],g=(0,a.useSelector)((e=>x.ZP.selectors.getTotalByViewId(e,t.id,p.entityUri))),{activityFilter:f}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions)||{},b=(0,r.useCallback)((()=>{const e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){dt(e,t,n[t])}))}return e}({},d,{returnObjects:!0,returnDates:!0,activeness:{relation:o||h.Ng6.ALL,entity:f}});u(!0),(0,h.N6e)(p.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(x.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:p.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,d,l,p.entityUri,f,o]),y=(0,r.useCallback)((()=>{i||n.connections||b(),s((e=>!e))}),[b,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:y,loadRelations:b,loading:c,total:g}})({config:t,connection:n,relationActivityFilter:s?h.Ng6.ALL:h.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,h.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(ft,{onClick:d,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Ne.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(Yt,{isLoading:m,config:t,loadRelations:p,connections:c,total:g,parentEntityUri:n.entity.entityUri}))))},yt=(0,J.Z)((e=>({moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px",marginLeft:"16px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},divider:{margin:"0 0 8px",backgroundColor:"rgba(0,0,0,0.12)"},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),vt=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const d=(0,a.useSelector)(x.ZP.selectors.getMetadata),p=(0,a.useSelector)((e=>x.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>x.ZP.selectors.getRelationsToEditByViewId(e,l.id))),g=(0,a.useSelector)(x.ZP.selectors.getEntity),f=(0,a.useSelector)((e=>x.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),b=(0,a.useDispatch)(),v=yt(),E=(0,r.useCallback)((()=>{const e=(0,h.vlo)({config:l,mode:s,metadata:d,parentEntityUri:u});(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),b)(e)}),[l,s,d,b,u]),w=(0,r.useCallback)((e=>{b(x.N5.relations.actions.closeRelationEditor(l.id,e)),b(x.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>x.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=x.N5.relations.selectors.getEntityUriFromConnection(t);(0,h.ZiX)(r)&&b(x.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,b]),O=l.content,C=ut(O.inRelations,O.outRelations),S=(0,r.useCallback)((e=>{const t=(0,i.pipe)((0,i.omit)(["suggested"]),(0,i.evolve)({relation:{relationType:(0,i.always)(C.type),object:(0,i.evolve)({type:(0,i.always)(C.type),attributes:(0,i.always)(null)})}}))(e);b(x.N5.relations.actions.addRelation(l.id,t))}),[b,l,C]),P=(0,r.useCallback)((e=>{b(x.N5.relations.actions.ignoreRelation(l.id,{relationType:C.type,relationDirection:C.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[b,l,C]),[N,T]=(0,i.partition)(h.xvW,n),k=g&&f,R=0===N.length&&0===T.length,I=e=>{var t,n;const r=m.find((t=>{var n,r;return(null==t||null===(n=t.relation)||void 0===n?void 0:n.relationUri)===(null==e||null===(r=e.relation)||void 0===r?void 0:r.relationUri)})),a=!l.allowOnlyCreateNew||(0,h.xvW)(e),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(bt,{config:l,connection:e,key:c},(t=>r?o().createElement($e.Z,{connection:r,config:l,mode:s,metadata:d}):o().createElement(ct,{renderRelationArrowButton:t,connection:e,metadata:d,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),b),onAcceptRelation:S,onIgnoreRelation:P})))},D=k&&(!p||p&&p.parentEntityUri===u),j=p&&p.parentEntityUri===u;return o().createElement("div",{className:t},D&&o().createElement(G.Button,{color:"primary",onClick:E,className:v.moreButton},o().createElement(oe.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},y().text("Add"))),j&&o().createElement($e.Z,{connection:p,config:l,mode:s,metadata:d}),N.map(I),N.length>0&&T.length>0&&o().createElement(G.Divider,{className:v.divider}),T.map(I),R&&o().createElement(G.Typography,{className:v.noData},c))};var Et=n(19603),xt=n(94646),wt=n(78101),Ot=n(80931);const Ct=(0,J.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function St(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){Pt(e,t,n[t])}))}return e}function Pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Nt=e=>{let{connection:t,className:n}=e;const l=Ct(),{relation:s}=t,c=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(x.ZP.selectors.getMetadata),d=(0,r.useMemo)((()=>(0,h.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),p=(0,r.useMemo)((()=>St({attributes:St({},x.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,h.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,h.fyF)(d,p)),[d,p]).filter((e=>{let{values:t}=e;return!(0,h.O27)(t)})).length>0,g=(0,r.useMemo)((()=>(0,h.R$r)(p.attributes)),[p]),{getCommentsCount:f}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const b=(0,r.useMemo)((()=>(0,h.wp9)(h.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return m?o().createElement(wt.A.Provider,{value:b},o().createElement(Ot.Z,{className:H()(l.attributesList,n),entity:p,attrTypes:d})):o().createElement("div",{className:H()(l.attributesList,n)},y().text("No attributes"))};var Tt=n(86602),kt=n(82726);const Rt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(ke.k,{className:r,tooltipTitle:t?y().text("Hide attributes of the relationship"):y().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Tt.Z:kt.Z,onClick:n})},It=(0,J.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"16px",padding:"3px 11px 3px 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",wordBreak:"break-all",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},showDetails:{marginLeft:"auto",paddingRight:"5px"},attributesList:{paddingLeft:"46px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0},suggestedWrapper:{backgroundColor:e.suggested},commentsContainer:{marginLeft:"auto",alignItems:"center","& + $showDetails":{marginLeft:"4px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"},labelWrapper:{display:"flex",alignItems:"center"}}))),Dt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=It(),u=t.suggested,{entity:d,relation:p}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityType:b,entityLabel:y,preparedUri:v,relationLabel:E}=nt(t,f),w=(0,h.Fn9)(p)&&(0,h.Fn9)(d),O=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),C=d&&p&&(0,h.wp9)(h.q7e.RELATION,{entityUri:O,connection:t})||[];return o().createElement("div",{className:H()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:H()(c.row,Et.U)},n&&n(),o().createElement("div",{className:c.labelWrapper},o().createElement(Xe.Z,{className:c.entityAvatar,entityType:b}),o().createElement(Ke.Z,{value:v,className:c.entityLabelContainer},o().createElement(tt,{label:y,entity:d},o().createElement("span",{className:c.entityLabel},y)),E&&o().createElement("span",{className:c.relationLabel},`, ${E}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(C)&&o().createElement(xt.Z,{className:c.commentsContainer,uri:(0,h.gjS)(p),relatedObjectUris:C,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(lt,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(Rt,{show:m,onToggle:()=>{g((e=>!e))},className:c.showDetails}))),m&&o().createElement(Nt,{connection:t}))}));Dt.displayName="RelationItem";const jt=Dt;var Zt=n(52691),Lt=n(16208);const Mt=e=>e.filter((e=>5===e.value)).length,At=e=>e.filter((e=>1===e.value)).length,_t=e=>0===e.length?"0%":Mt(e)/e.length*100+"%",Ut=e=>0===e.length?"0%":At(e)/e.length*100+"%",Ht=(0,J.Z)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end"},averageRating:{marginBottom:"7px",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px",color:e.palette.text.primary},scale:{display:"flex",marginBottom:"6px",width:"128px",height:"4px"},likesScale:{height:"100%",backgroundColor:"#8CC152"},dislikesScale:{height:"100%",backgroundColor:"rgb(255, 112, 112)"},counts:{display:"flex"},likesCount:{marginRight:"32px"},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:"rgba(0,0,0,0.38)"}}))),zt=e=>{let{ratings:t,className:n}=e;const r=Ht();return o().createElement("div",{className:H()(r.wrapper,n)},o().createElement(G.Typography,{className:r.averageRating},(e=>(0,i.pipe)((0,i.pluck)("value"),i.mean,(0,i.defaultTo)(0))(e))(t).toFixed(1)),o().createElement("div",{className:r.scale},o().createElement("div",{className:r.likesScale,style:{width:_t(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Ut(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:H()(r.likesCount,r.count)},o().createElement(Zt.Z,{className:r.icon}),Mt(t)),o().createElement("div",{className:r.count},o().createElement(Lt.Z,{className:r.icon}),At(t))))},Bt=(0,J.Z)((e=>({wrapper:{display:"flex"},button:{fontSize:"14px",textTransform:"none",color:e.palette.text.secondary},likeButton:{marginLeft:"-12px",marginRight:"8px"},isActive:{color:e.palette.text.primary}}))),Ft=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Bt(),i=(0,a.useSelector)(x.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:y().text("Has left the practice"),onClick:()=>r(y().text("Has left the practice"))},{text:y().text("Has moved away"),onClick:()=>r(y().text("Has moved away"))},{text:y().text("Has passed away"),onClick:()=>r(y().text("Has passed away"))},{text:y().text("Has retired"),onClick:()=>r(y().text("Has retired"))},{text:y().text("Other"),onClick:()=>r(y().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(G.Button,{onClick:n,variant:"text",size:"small",className:H()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(_e.Z,{buttonProps:{endIcon:o().createElement(mt.Z,null),variant:"text",size:"small",className:H()(l.button,{[l.isActive]:1===(null==s?void 0:s.value)})},buttonContent:1===(null==s?void 0:s.value)?s.comment:"Disagree",menuItems:c,menuId:"disagree-dropdown-menu-button"}))},Vt=(0,J.Z)((e=>({wrapper:{padding:"6px 16px 6px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{wordBreak:"break-all",textDecoration:"none"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"18px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 8px 6px 16px",backgroundColor:e.suggested},commentsContainer:{alignSelf:"center","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),Wt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Vt(),d=t.suggested,[p,m]=(0,r.useState)(!1),{entity:g,relation:f}=t,b=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityLabel:y,entityType:v,preparedUri:E,relationLabel:w}=nt(t,b),O=(null==f?void 0:f.ratings)||[],C=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),S=g&&f&&(0,h.wp9)(h.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:H()(u.wrapper,{[u.suggestedWrapper]:d})},o().createElement(G.Box,{display:"flex",minHeight:"44px",className:Et.U},o().createElement(G.Box,{display:"flex",alignItems:"center"},o().createElement(G.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(Xe.Z,{entityType:v,className:u.entityTypeIcon})),o().createElement(G.Box,{display:"flex",flexDirection:"column"},o().createElement(Ke.Z,{value:E,className:u.entityLabelContainer},o().createElement(tt,{label:y,entity:g},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!d&&o().createElement(Ft,{ratings:O,onAgree:()=>{(0,h.Buf)(null==f?void 0:f.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,h.Buf)(null==f?void 0:f.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(xt.Z,{className:u.commentsContainer,uri:(0,h.gjS)(f),relatedObjectUris:S,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),d&&o().createElement(lt,{acceptRelation:s(t),ignoreRelation:c(t)}),!d&&o().createElement(o().Fragment,null,o().createElement(zt,{ratings:O,className:u.ratings}),o().createElement(Rt,{show:p,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),p&&o().createElement(Nt,{connection:t,className:u.relationAttributes}))},Gt=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:s}=e;const{isComplex:c,content:u}=i,{ignoreRelation:d,acceptRelation:p}=((e,t,n)=>{const r=ut(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,h.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===h.Nsj.IN,u=c?a.entityUri:n,d=c?n:a.entityUri;(0,h.DsR)({startEntityUri:u,endEntityUri:d,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong"))))}))}}})(u,l,s),m=(0,r.useMemo)((()=>(0,h.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(C.h);return(0,r.useEffect)((()=>{g(m)}),[g,m]),o().createElement("div",{className:t},n.map((e=>{var t,n;const r=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return o().createElement(bt,{config:i,connection:e,key:r},(t=>c?o().createElement(Wt,{loadRelations:l,connection:e,acceptRelation:p,ignoreRelation:d,renderRelationArrowButton:t}):o().createElement(jt,{acceptRelation:p,ignoreRelation:d,connection:e,renderRelationArrowButton:t})))})))};Gt.displayName="RelationsList";const qt=Gt,$t=(0,J.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Yt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=$t(),{selectors:u}=x.ZP,d=(0,a.useSelector)(u.getEntity),p=(0,a.useSelector)(u.getMode),m=n["text-empty"]||y().text("No data found");return t?o().createElement(L.Z,null):(0,h.KIu)(p)?o().createElement(vt,{connections:l,className:c.list,key:null==d?void 0:d.uri,config:n,mode:p,noDataText:m,parentEntityUri:s}):i>0?o().createElement(qt,{config:n,loadRelations:r,connections:l,className:c.list,key:null==d?void 0:d.uri,mainEnityUri:d.uri}):o().createElement(G.Typography,{className:c.noData},m)},Qt=(0,J.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:0},content:{position:"relative",display:"flex",flexGrow:1,flexDirection:"column",minHeight:0},pagination:{height:"52px",flexGrow:0,flexShrink:0}}),Xt=e=>{let{config:t,className:n}=e;const l=Qt(),{page:s,setPage:c,rowsPerPage:u,sortOrder:d,sortOption:p,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(De),{selectors:b}=x.ZP,y=(0,a.useSelector)((e=>b.getConnectionsWithDraftsByViewId(e,t.id))),v=(0,a.useSelector)(b.getEntity),E=(0,a.useSelector)((e=>b.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(b.getMode),O=(0,r.useMemo)((()=>({order:d,field:p})),[d,p]);(0,r.useEffect)((()=>{f("")}),[null==v?void 0:v.uri]);const C=(0,r.useMemo)((()=>(e=>{const t=h.wSh.fromFalsy(e).map(h.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new h.MEy).addClause(t).build()})(g)),[g]),{isLoading:S,reload:P}=(0,Pe.a)({sorting:O,filter:C,page:s,rowsPerPage:u,config:t,entity:v,relationActivityFilter:m?h.Ng6.ALL:h.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,h.Px$)(y)),[y]),T=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Ne.X.Provider,{value:N},o().createElement(V.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Ue.Provider,{value:T},o().createElement(qe,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(Yt,{isLoading:S,config:t,loadRelations:P,connections:y,total:E}),E>u&&o().createElement(W.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};Xt.displayName="RelationsView";const Kt=o().createContext(null);Kt.displayName="TableAttributeContext";var Jt=n(86361),en=n(26180),tn=n(31276);function nn(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){rn(e,t,n[t])}))}return e}function rn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const on="CHANGE_SEARCH_QUERY",an=nn({},en.ZP.actions,{changeSearchQuery:(0,tn.zD)(on)}),ln=(e,t)=>t.type===on?nn({},e,{searchQuery:t.payload,page:0}):en.ZP.reducer(e,t);var sn=n(92332),cn=n(67353);const un={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},dn=(0,J.Z)((()=>({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)",marginBottom:"15px"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},"row-cell--removed":{pointerEvents:"none","& > div":un}}))),pn=(0,cn.Z)((e=>{const t=dn();return o().createElement("div",{className:t.headCell},o().createElement(sn.default,e))}));var mn=n(64091);function gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fn=(e,t)=>{const{uri:n,label:r,children:o,name:a}=e;return(0,i.reject)(i.isNil,{id:(0,h.Tde)(n,t),label:r,dataTypeDefinition:(0,h.PFL)(e),children:null==o?void 0:o.map((e=>fn(e,t.concat({name:a}))))})},hn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),bn=e=>{if((0,h.vZp)(e)){const t=hn(e);return t.length>1?t.slice(0,-1):null}return null},yn=(0,i.map)((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){gn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:bn(e.id),headCellRenderer:pn,rowCellValueRenderer:mn.Z})));var vn=n(99341);function En(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xn=n(52016),wn=n(1876),On=n(60894);const Cn=(0,J.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Sn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=Cn();return o().createElement(q.Z,{title:t,className:u.header},o().createElement(X.i,{query:n,onChange:r}),o().createElement(wn.Z,{enabled:a,onClick:l}),o().createElement(Y.Z,{height:24,margin:4}),o().createElement(On.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};function Pn(){return Pn=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},Pn.apply(this,arguments)}const Nn=(0,n(32528).Z)(((e,t)=>{let{deletedUris:n}=e,{rowValue:{value:r}}=t;return{isRemoved:Boolean(n.find((e=>r.uri===e)))}}))((e=>{let{cell:t,CellValueRenderer:n,isRemoved:r,isSorted:a}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["cell","CellValueRenderer","isRemoved","isSorted"]);const i=dn();return o().createElement("div",{className:H()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,Pn({key:t,value:e},l)))))}));var Tn=n(85709);const kn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(ke.k,{tooltipTitle:y().text("Edit"),icon:Ye.Z,size:"L",onClick:t}),n&&o().createElement(ke.k,{tooltipTitle:y().text("Remove"),icon:Qe.Z,size:"L",onClick:n}))};function Rn(){return Rn=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},Rn.apply(this,arguments)}const In=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:d,onEdit:p,onDeleteAttribute:m,deletedUris:g}=e;const f=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,n)=>{let{id:r}=n;return(0,i.assoc)(r,((e,t)=>((e,t)=>(0,i.pipe)((0,i.path)(["value"]),(0,h.tT_)(e))(t))(hn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),b=(0,r.useMemo)((()=>yn(t)),[t]),y=dn(),v=(0,a.useSelector)(x.ZP.selectors.getMode),E=(0,h.KIu)(v),w=(0,a.useSelector)(x.ZP.selectors.getMetadata),O=(0,a.useSelector)(x.ZP.selectors.getEntityUri),C=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,O)||{})),{attributeType:S}=(0,r.useContext)(Kt),P=(0,r.useCallback)((e=>o().createElement(Nn,Rn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,T]=(0,r.useState)(null),{canUpdate:k,canDelete:R}=(0,xn.l)(),I=(0,r.useMemo)((()=>"number"!=typeof N||!E||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,E]),D="number"==typeof N&&(j=(0,i.path)([N],n),R(d)&&(0,h.xv5)({attributeType:S,mode:v,attributeValue:j,metadata:w,isReltioCrosswalk:(0,h.KVV)(C.crosswalks,j)}));var j;const Z="number"==typeof N&&(e=>k(d)&&(0,h.yv0)({attributeType:S,mode:v,attributeValue:e,isReltioCrosswalk:(0,h.KVV)(C.crosswalks,e)}))((0,i.path)([N],n)),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);Z&&p(e)}),[p,N,n,Z]),M=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!D)return;const t={parentUri:O,attributeType:S,uri:e.uri,value:e};m(t),T(null)}),[N,n,m,D,S,O]),A=I||!D&&!Z?void 0:o().createElement(kn,{onEdit:Z?L:void 0,onRemove:D?M:void 0}),_=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:y.tableContainer},o().createElement(Tn.Z,{autosizing:!0,maxHeight:477,columnsData:b,rowsData:f,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:T,hoverRowIndex:N,hoveredRowRightContent:A,context:_,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Dn=(0,J.Z)((()=>({actionButtons:{display:"flex",justifyContent:"flex-end",margin:"0 8px 10px","& > button":{fontSize:"14px",lineHeight:"16px",marginLeft:"8px",padding:"10px 8px",backgroundColor:"rgba(98, 2, 238, 0)"}}})));function jn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const d=Dn(),m=(0,a.useSelector)(x.ZP.selectors.getEntityUri),{attributeType:g}=(0,r.useContext)(Kt),f=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),b=(0,a.useSelector)(x.ZP.selectors.getMode),v=(0,a.useDispatch)(),E=(0,r.useContext)(p.m),w=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,v)(e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){jn(e,t,n[t])}))}return e}({},e,{viewId:E}))))),[E,v]),O=(0,h.ZiX)(m),C=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,m,g))),S=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,v),[v]);return o().createElement(o().Fragment,null,o().createElement(ie.Z,{expanded:!0,attributeValue:u,showEmptyEditors:O,onDeleteAttribute:s,onDeactivateError:S,onChangeAttribute:t,onAddAttributes:w,mode:b,crosswalks:f.crosswalks,errors:C,attributeType:g,ownError:(0,h.ADq)(u,null,g.uri,C)}),o().createElement("div",{className:d.actionButtons},o().createElement(G.Button,{onClick:()=>{n(u)}},y().text("Cancel")),o().createElement(G.Button,{color:"primary",disabled:!c,onClick:()=>{l(u)}},y().text("Apply"))))},Ln=(0,J.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",flex:1,overflow:"auto"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function Mn(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){An(e,t,n[t])}))}return e}function An(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=[],Un=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=Ln(),{values:u,page:d,setPage:m,isLoading:g,searchQuery:f,setSearchQuery:b,visibleColumns:v,onFilter:E,onSort:w,onToggleFilters:O,onChangeColumns:C,filters:S,sorting:P,totalVisibleValues:N,hasPaging:T,attributeType:k,showTable:R,allColumnsData:I}=(0,r.useContext)(Kt),{checkHasChanges:D,onChangeAttribute:j,onDeleteAttribute:Z,onAdd:M,onCancel:A,onApply:_,onStartEditing:U,modifiedValues:z,editingValues:B,deletedUris:F}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useSelector)(x.ZP.selectors.getMode);(0,r.useEffect)((()=>{o([]),t(null)}),[l]);const s=(0,a.useDispatch)(),c=(0,r.useContext)(p.m),{attributeType:u,values:d}=(0,r.useContext)(Kt),m=(0,a.useSelector)(x.ZP.selectors.getEntityUri),g=(0,a.useSelector)(x.ZP.selectors.getMetadata),f=(0,r.useCallback)((e=>{(0,i.pipe)(x.N5.actions.modifyAttribute,s)(Mn({},e,{viewId:c}))}),[c,s]),b=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(Mn({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,h.gjI)({parentUri:m,attributeType:u});t(e.uri),f(Mn({},e,{value:(0,h.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:g}),attributeType:u}))}),[m,u]),v=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),E=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=Mn({},e,{value:r,attributeType:u,uri:e.uri});o((e=>(0,i.without)([r],e))),f(t)}else{const n={value:e,attributeType:u,uri:e.uri};t(null),b(n)}}),[b,f,o,n]),w=(0,r.useCallback)((e=>{t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t}))}),[o,t]),O=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),C=(0,h.KIu)(l),S=(0,h.xy8)(u),P=(0,i.pathOr)(_n,[S,null==u?void 0:u.name],O),N=(0,r.useMemo)((()=>[...P.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(h.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>P.find((0,i.propEq)("uri",e.uri))||e))(d)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[P,n,e,d]),T=(0,r.useMemo)((()=>C?(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!P.find((0,i.propEq)("uri",e)))))(d):[]),[P,d]),k=P.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:f,onDeleteAttribute:b,onAdd:y,onCancel:E,onApply:w,onStartEditing:v,modifiedValues:N,editingValues:k,deletedUris:T}})(),$=(0,a.useSelector)(x.ZP.selectors.getMode),Y=(0,h.KIu)($),Q=Y?z:u,{canCreate:X}=(0,xn.l)(),K=X(t)&&k&&(0,h.Vg3)({attributeType:k,mode:$})&&!B.length,J=(0,r.useMemo)((()=>v.map((e=>I.find((0,i.propEq)("id",e))))),[v,I]);return o().createElement(V.Z,{className:H()(c.root,n)},R?o().createElement(o().Fragment,null,o().createElement(Sn,{title:l,total:N,columnsData:I,selectedColumns:v,onChangeColumns:C,searchQuery:f,onChangeSearchQuery:b,filtersEnabled:!!S,onToggleFilters:O}),o().createElement("div",{style:{position:"relative"}},Y&&o().createElement("div",{className:c.editor},K&&o().createElement(G.Button,{color:"primary",onClick:M,className:c.addButton},o().createElement(oe.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},y().text("Add"))),B.map((e=>o().createElement(Zn,{key:e.uri,attributeValue:e,onChangeAttribute:j,onDeleteAttribute:Z,onCancel:A,onApply:_,hasChanges:D(e)})))),J.length>0&&o().createElement(In,{columnsData:J,config:t,values:Q,filters:S,onFilter:E,sorting:P,onSort:w,onEdit:U,onDeleteAttribute:Z,deletedUris:F}),T&&o().createElement(W.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:s,page:d,onChangePage:m}),g&&o().createElement(L.Z,null))):o().createElement(o().Fragment,null,o().createElement(q.Z,{title:l,className:c.header}),o().createElement(G.Typography,{className:c.noData},y().text("No data"))))};var Hn=n(58600);function zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Bn=0;const Fn=()=>Bn++,Vn=e=>{const t={children:[],nodeId:Fn()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let o=t;for(let t=r.length-1;t>=0;t--){const a=r[t],l=e.entities[a.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:Fn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),o.children.push(s),o=s}}return t.children},Wn=(0,J.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.primary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.primary.main,lineHeight:"15px"},selected:{fontWeight:"bold"},wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"}})));var Gn=n(1242);const qn=o().createContext(null);var $n=n(55400);const Yn=e=>{e.target.src=Gn},Qn=e=>{let{node:t}=e;const n=Wn(),l=(0,a.useDispatch)(),i=t.entity.uri,s=(0,a.useSelector)(x.ZP.selectors.getAbsoluteImagePath),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,r.useContext)(qn),d=(0,a.useSelector)(x.ZP.selectors.getUIPath),{uri:p}=(0,a.useSelector)(x.ZP.selectors.getEntity),m=(0,h.ChB)({uiPath:d,uri:i}),g=i===p,f=(0,r.useCallback)((()=>{l(x.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:b},nodeId:y}=t,v=(0,h.nt9)(c,t.entity.type)||{},E=(0,h.VD3)(c,v,"typeGraphIcon"),w=E&&(0,h.vPL)(s,E);return o().createElement("div",{className:n.wrapper,"data-node-id":y},o().createElement("div",{className:n.container},o().createElement(G.Avatar,{className:H()(n.avatar),src:w||Gn,onError:Yn}),o().createElement("span",{className:H()(n.link,{[n.selected]:g})},o().createElement($n.Z,{to:m,onClick:f},b))))},Xn=((0,r.memo)(Qn),e=>{let{node:t}=e;return t.nodeId}),Kn=(0,J.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block"},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"50%",top:0,height:"50%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:"14px",left:"50%",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},row:{display:"flex"},rowContents:{position:"relative",borderLeft:"none",paddingLeft:"4px",flex:"1 1 auto",width:0,display:"flex",verticalAlign:"middle",boxSizing:"border-box"},buttonWrapper:{display:"flex",paddingTop:"13px",width:"12px",cursor:"pointer"},collapsedButton:{transform:"rotate(-90deg)"},expandedButton:{transform:"rotate(0deg)"},button:{transition:"transform .15s ease",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid rgba(0, 0, 0, 0.54)"},rowTitle:{flex:"1 1 auto",width:0,paddingRight:"11px"}})));function Jn(){return Jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jn.apply(this,arguments)}function er(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tr(){return tr=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},tr.apply(this,arguments)}const nr={nodeContentRenderer:e=>{const t=(0,i.omit)(["connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","draggedNode","isSearchMatch","isSearchFocus","buttons","didDrop","children","treeId","isOver","parentNode","rowDirection"],e),{scaffoldBlockPxWidth:n,toggleChildrenVisibility:r,node:a,title:l,path:s,treeIndex:c,style:u}=t,d=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),p=l,m=r&&!a.root&&a.children&&a.children.length>0,g=Kn();return o().createElement("div",tr({style:{height:"100%"}},d,{key:a.nodeId}),m&&a.expanded&&o().createElement("div",{style:{width:n-2},className:g.lineChildren}),o().createElement("div",{className:g.row,style:u},o().createElement("div",{className:g.rowContents},m&&o().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:a,path:s,treeIndex:c})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:H()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof p?p({node:a,path:s,treeIndex:c}):p))))},treeNodeRenderer:e=>{const t=(0,i.omit)(["listIndex","swapFrom","swapLength","swapDepth","draggedNode","getPrevRow","connectDropTarget","isOver","canDrop","treeIndex","treeId","path","rowDirection"],e),{children:n,scaffoldBlockPxWidth:r,lowerSiblingCounts:a,node:l}=t,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=Kn(),u=a.length,d=[];a.forEach(((e,t)=>{d.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},l.root&&o().createElement("div",{className:c.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:c.verticalLine}),o().createElement("div",{className:c.horizontalLineRight}))))}));const p=l.root?r-4:0,m=r*u-p,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,h=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){er(e,t,n[t])}))}return e}({},s.style,{width:f});return o().createElement("div",Jn({},s,{className:c.node,style:h}),d,o().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function rr(){return rr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rr.apply(this,arguments)}const or=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",rr({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},o().createElement("path",{d:"M14.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm4 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm-17 1a1.5 1.5 0 110-3 1.5 1.5 0 010 3zM4 4a2 2 0 110-4 2 2 0 010 4zm1 16a2 2 0 110-4 2 2 0 010 4zm4.5-6a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm0-2a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm6 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3z",fill:"#000"})))},ar=e=>{let{title:t,onGraphOpen:n}=e;const r=Wn();return o().createElement(q.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(ke.k,{className:r.button,tooltipTitle:y().text("Show Graph"),icon:or,onClick:n,size:"L"})))};var lr=n(9757);const ir=(0,J.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function sr(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){cr(e,t,n[t])}))}return e}function cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ur=e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),l=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{height:u,width:d,tooltip:p}=t,{html:m,visible:g,tooltip:f,customStyles:h,popup:b}=(0,lr.E)(t),y=ir(),v=f||p;(0,r.useEffect)((()=>{a.current&&m&&(a.current.innerHTML="",Array.from(m.childNodes).forEach((e=>{a.current.appendChild(e)})))}),[m]),(0,r.useEffect)((()=>{c(!!b)}),[b]),(0,r.useEffect)((()=>{s&&l.current&&(l.current.innerHTML="",b&&Array.from(b.childNodes).forEach((e=>{l.current.appendChild(e)})))}),[s,b]);const E=(0,i.reject)(i.isNil,{width:d,height:u});return g?o().createElement("div",{className:y.bodyWrapper},o().createElement(G.Dialog,{ref:l,open:!!b}),o().createElement(G.Tooltip,{title:v||""},o().createElement("div",{ref:a,style:sr({},E,h),className:H()(y.root,n)}))):null};var dr=n(14940);const pr=(0,J.Z)({dragHandleContainer:{position:"relative",width:"100%",height:"inherit"},dragHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $dragHandle":{visibility:"visible"},".react-grid-item.static &:hover $dragHandle":{visibility:"hidden"}},dragHandle:{position:"absolute",width:"100%",display:"flex",justifyContent:"center",top:"-3px",zIndex:11,cursor:"move",visibility:"hidden"},dragIcon:{transform:"translateX(-50%) rotate(90deg)",color:"rgba(0, 0, 0, 0.3)"}}),mr=e=>{const t=t=>{const n=pr();return o().createElement("div",{className:n.dragHandleContainer},o().createElement("div",{className:n.dragHandleVisibilityArea},o().createElement("div",{className:H()("viewDraggableHandle",n.dragHandle)},o().createElement(dr.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithDragHandle",t};var gr=n(2256);const fr=e=>{const t=t=>o().createElement(gr.Z,{error:o().createElement(A.ZP,{LogoRenderer:A.B9.ERROR,text:"",secondaryText:y().text("Something went wrong"),variant:A.tC.small})},o().createElement(e,t));return t.displayName="WithErrorBoundary",t},hr=(0,J.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var br=n(29103),yr=n(83911),vr=n(48747),Er=n(22385);const xr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),wr=(0,J.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Or=n(13074),Cr=n(24338);const Sr=(0,J.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Pr=Sr,Nr=e=>{let{totalImages:t}=e;const n=Pr(),r=t>1?y().text("photos"):y().text("photo");return o().createElement(G.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Tr(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){kr(e,t,n[t])}))}return e}function kr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,c.uri)||{})),d=(0,i.pathOr)([],["attributes",n.name],u),p=t.id;return o().createElement(o().Fragment,null,o().createElement(Cr.Z,{attributeValues:d,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(Tr({},e,{viewId:p})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(x.N5.actions.modifyAttribute,s)(Tr({},e,{viewId:p})),imageSize:jr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Nr,{totalImages:d.length}))},Ir=(0,J.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Dr=Ir,jr={imageMargin:4,imageWidth:162,imageHeight:162};var Zr=n(28741);const Lr=(0,J.Z)((e=>({root:{display:"flex",flexDirection:"column"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}})));var Mr=n(49734),Ar=n(98808),_r=n(93428),Ur=n(30885);function Hr(){return Hr=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},Hr.apply(this,arguments)}const zr=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,a.useSelector)(x.ZP.selectors.getEntity),{canMerge:d,canMark:m}=(0,h.hXd)(c,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:Ar.N.iconButton,onStartRequest:l},b=(0,r.useContext)(p.m),y=(0,r.useCallback)((()=>{i(),s(x.N5.entity.actions.loadEntity({viewId:b,uri:u.uri}))}),[s,u.uri,i,b]);return o().createElement(o().Fragment,null,d&&o().createElement(_r.H,Hr({},f,{onFinishRequest:y})),m&&o().createElement(Ur.i,Hr({},f,{onFinishRequest:i})))},Br=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const s=(0,a.useSelector)(x.ZP.selectors.getMetadata),c=(0,a.useSelector)(x.ZP.selectors.getEntity);return o().createElement(Mr.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:Et.U},o().createElement(xt.Z,{uri:(0,h.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,h.wp9)(h.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:h.q7e.POTENTIAL_MATCH}),o().createElement(zr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Fr={showTransitiveMatches:!0,showInactiveEntities:!1},Vr={order:h.KM9.asc,field:"score"};var Wr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Wr||(Wr={}));const Gr=e=>(0,i.pipe)(fr,mr)(e),qr=Gr((e=>{let{className:t}=e;const n=hr();return o().createElement(V.Z,{className:H()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),$r=Gr((e=>{let{className:t,config:n}=e;return o().createElement(z.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Yr=Gr((e=>{let{className:t,config:n}=e;const a=(e=>{const[t,n]=(0,r.useState)(""),[o,a]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),c=Ce(e,s,!0),u=(0,r.useCallback)((()=>{a(0),i((e=>!e))}),[]);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){Se(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},c)})(n);return o().createElement(B.Provider,{value:a},o().createElement(Ee,{config:n,className:t}))})),Qr=Gr((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(x.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,h.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>l?((e,t)=>(0,i.pipe)(((e,t)=>(0,h.WN0)(e,t)),(0,i.map)((e=>fn(e,[t]))),(0,i.chain)(h.HQx),(0,i.uniqBy)((0,i.prop)("id")))(e,t))(o,l):[]),[o,l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),h.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,d]=(0,r.useReducer)(ln,c),{searchQuery:p,filters:m,sorting:g,page:f}=u,b=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>h.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const o=e.find((0,i.propEq)("id",n));return(0,vn.su)(o,r)})))).orSome([]))(s,m);return e.length?e:null}),[m,s]),v=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:f,sorting:g,searchQuery:p})),[y,f,g,p]),{changeSearchQuery:E,changePage:w,toggleSort:O,changeFilter:C,toggleFilters:S,changeColumns:P}=(0,Jt.o)({actions:an,dispatch:d}),N=Ce(e,v,!1);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){En(e,t,n[t])}))}return e}({},u,{setSearchQuery:E,setPage:w,onSort:O,onFilter:C,onToggleFilters:S,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||p||b)&&l&&!l.hidden),allColumnsData:s},N)})(t);return o().createElement(Kt.Provider,{value:l},t&&o().createElement(Un,{config:t,className:n}))})),Xr=Gr((e=>{let{config:t,className:n}=e;const a=(e=>{var t;const n=(0,r.useMemo)((()=>Object.entries(e.sortOptions||{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[e.sortOptions]),o=Number(e.max)||15,[a,l]=(0,r.useState)(0),[i,s]=(0,r.useState)(e.sortOrder||"asc"),[c,u]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[d,p]=(0,r.useState)(""),[m,g]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{l(0),g((e=>!e))}),[]),h=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),b=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:d,changeSearchQuery:(0,r.useCallback)((e=>{l(0),p(e)}),[]),sortOrder:i,toggleSortOrder:h,sortOption:c,changeSortOption:b,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:m,toggleShowInactive:f}})(t);return o().createElement(De.Provider,{value:a},o().createElement(Xt,{config:t,className:n}))})),Kr=Gr(ur),Jr=Gr((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(x.ZP.selectors.getEntityUri),{treeData:s,setTreeData:c}=((e,t)=>{const n=(0,xe._)(),[o,l]=(0,r.useState)([]),s=(0,a.useSelector)(x.ZP.selectors.getEntity);return(0,we.D)((()=>{const e=o.map(((e,t)=>({tree:e,index:t}))).reduce(((e,t)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){zn(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,h.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],s),e);l(t.map((0,i.prop)("root")))}),[null==s?void 0:s.updatedTime]),(0,r.useEffect)((()=>((0,h.ZiX)(e)||n((0,h.RFJ)({uri:e,graphUri:t})).then(Vn).then(l).catch((e=>{console.warn(e)})),()=>{l([])})),[e,t,n]),{treeData:o,setTreeData:l}})(l,t.graph.type),u=Wn(),d=(0,a.useDispatch)(),{id:p,graph:m}=t,g=(0,r.useCallback)((()=>{d(x.ui.actions.openGraph({viewId:p,graphType:m.type,entityUri:l}))}),[d,p,m,l]),f=(0,r.useCallback)((e=>({title:o().createElement(Qn,{node:e.node})})),[]);return o().createElement(V.Z,{className:n},o().createElement(ar,{onGraphOpen:g,title:t.caption}),o().createElement(qn.Provider,{value:t},o().createElement("div",{className:u.treeContainer},o().createElement("div",{className:u.tree},o().createElement(Hn.ZP,{isVirtualized:!1,treeData:s,canDrag:!1,theme:nr,generateNodeProps:f,onChange:c,getNodeKey:Xn})))))})),eo=Gr((e=>{let{config:t,className:n}=e;const l=Lr(),s=(0,a.useSelector)(x.ZP.selectors.getEntity),c=(0,h.wwR)(s),[u,d]=(0,r.useState)(!1),m=(0,r.useCallback)((()=>{d(!0)}),[]),g=(0,r.useCallback)((()=>{d(!1)}),[]),{matches:f,entitiesMap:b,loadMatches:v,total:E}=(0,Zr.s)({enabled:!!c,entity:s,options:Fr,filter:"",page:0,sorting:Vr,rowsPerPage:3,onStartLoading:m,onFinishLoading:g}),w=(0,r.useCallback)((()=>{v()}),[v]),O=(0,a.useDispatch)(),S=(0,r.useContext)(p.m),P=(0,r.useCallback)((()=>{O(x.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:S}))}),[O,S]),N=(0,r.useMemo)((()=>(0,h.NVY)(c,(0,i.map)(h.ev7,f))),[c,f]),{getCommentsCount:T}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{T(N)}),[T,N]);const k=E>3&&!(0,i.isEmpty)(f),R=u?Wr.Loading:(0,i.isEmpty)(f)?Wr.NoData:Wr.Loaded;return o().createElement(Ne.X.Provider,{value:b},o().createElement(V.Z,{className:H()(l.root,n)},o().createElement(q.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},R===Wr.Loading&&o().createElement(L.Z,null),R===Wr.NoData&&o().createElement(G.Typography,{className:l.noData},y().text("No matches found")),R===Wr.Loaded&&f.map((e=>o().createElement(Br,{config:t,entitiesMap:b,match:e,onFinishRequest:w,onStartRequest:m,key:e.object.uri})))),k&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(G.Link,{component:"button",variant:"caption",onClick:P,underline:"none"},y().text("See all"))))))})),to=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,96617)).then((e=>({default:Gr(e.HierarchyTreeView)}))))),no=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,79417)).then((e=>({default:Gr(e.RelationshipsTableView)}))))),ro=Gr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=wr(),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,a.useSelector)(x.ZP.selectors.getEntity),d=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{markers:p,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,xe._)();return(0,r.useEffect)((()=>{i(!0),s((0,h.DBr)(t,[e],n)).then((e=>{a(e.filter(xr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,d),g=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(L.Z,null))),[s]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),b=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return d&&o().createElement(V.Z,{className:H()(s.root,i)},m&&o().createElement(L.Z,null),o().createElement(Er.Z,{size:"S",icon:n?yr.Z:br.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(vr.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:p,mapContainerClassName:s.fullHeight,mapKey:d,mapOptions:b}))})),oo=Gr((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Dr(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(x.ZP.selectors.getMode),d=(0,a.useSelector)(x.ZP.selectors.getEntityWithDiff),p=(0,a.useSelector)(x.ZP.selectors.getMetadata),m=(0,h.zeJ)(p,l),g=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],d),f=(0,i.path)(["attributes","paging",l],d),b=g.length,v=t["text-empty"]||y().text("No data found"),E=(0,r.useCallback)((e=>c(x.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(V.Z,{className:n},o().createElement(q.Z,{title:t.caption}),o().createElement("div",{className:s.container},(()=>{if(m){if((0,h.KIu)(u)){const e={attributeType:m,config:t,paging:f,requestNextPageOfAttributeValues:E};return o().createElement(Rr,e)}if(b>0){const e={attributeValues:g,attributeType:m,imageSize:jr,paging:f,parentUri:d.uri,requestNextPageOfAttributeValues:E};return o().createElement(o().Fragment,null,o().createElement(Or.Z,e),o().createElement(Nr,{totalImages:b}))}}return o().createElement(G.Typography,{className:s.noData},v)})()))}));class ao{}ao.ViewTypes=h.ZIY,ao.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case ao.ViewTypes.HierarchyTree:return o().createElement(to,{config:r,store:n,className:a});case ao.ViewTypes.HierarchyPaths:return o().createElement(Jr,{config:r,className:a});case ao.ViewTypes.RelationsTable:return o().createElement(no,{config:r,store:n,className:a});case ao.ViewTypes.Relations:return o().createElement(Xr,{config:r,className:a});case ao.ViewTypes.Attributes:return o().createElement($r,{className:a,config:r});case ao.ViewTypes.SingleAttribute:return o().createElement(Yr,{config:r,className:a});case ao.ViewTypes.AttributeTable:return o().createElement(Qr,{config:r,className:a});case ao.ViewTypes.Map:return o().createElement(ro,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case ao.ViewTypes.Custom:return o().createElement(Kr,{config:r,className:a});case ao.ViewTypes.ImageAttribute:return o().createElement(oo,{config:r,className:a});case ao.ViewTypes.PotentialMatches:return o().createElement(eo,{config:r,className:a})}},ao.getComponent=e=>ao.getComponentBy("class",e)||ao.getComponentBy("react-class",e)||o().createElement(qr,{className:e.className});const lo=ao,io=()=>null,so=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=hr();return o().createElement(r.Suspense,{fallback:o().createElement(io,null)},lo.getComponent({config:t,store:n,className:H()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));so.displayName="ViewComponent";const co=(0,J.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function uo(){return uo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uo.apply(this,arguments)}const po=["onConfigChanged","onRemove"],mo=e=>{var t;let{layoutItemConfig:n,views:l,className:s,children:c,style:u,isFullscreen:d,onToggleFullscreen:p,AutosizeComponent:m}=e,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const f=l.find((e=>{let{id:t}=e;return n.i===t})),b=co(),y=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{store:v}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const E=f.class===lo.ViewTypes.Custom;if(E&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===h.X1H.CLASSIC)return null;if(f.class===lo.ViewTypes.Map&&!y)return null;const w=(e=>{var t;return null===(t=Object.entries(h.ZIY).find((t=>{let[n,r]=t;return e===r})))||void 0===t?void 0:t[0]})(f.class);return o().createElement("div",uo({},(0,i.omit)(po,g),{"data-reltio-id":f.id,"data-reltio-class":w||"",style:u,className:H()(s,{[b.item]:!E})}),o().createElement("div",{className:H()({[b.fixedSizeContainer]:!m})},m,o().createElement(so,{store:v,config:f,isFullscreen:d,onToggleFullscreen:p,isAutosize:Boolean(m)})),c)},go=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(_.Z,{LayoutItem:mo,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var fo=n(87685);const ho=(0,J.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),bo=e=>{let{notification:t}=e;const n=ho({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(x.ZP.selectors.getAutoCloseInterval),s=t.autoHideDuration||i&&1e3*i||5e3,[c,u]=(0,r.useState)(),[d,p]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(x.ui.actions.closeNotification(t.id)),p(!1))}),[t]),g=(0,r.useCallback)((()=>{c.cancelAction&&l(c.cancelAction),u(void 0)}),[c]),f=(0,r.useCallback)((()=>{l(c.applyAction),u(void 0),l(x.ui.actions.closeNotification(t.id))}),[c,t]),h=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(G.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),p(!1)}},e.label)))),b=o().createElement(o().Fragment,null,o().createElement(Er.Z,{className:n.closeIcon,size:"S",icon:fo.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(G.Portal,{container:document.body},o().createElement(G.Snackbar,{autoHideDuration:s,open:d,classes:{root:n.snackbar},action:h,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:b})),o().createElement(Ve.Z,{open:!!c,title:null==c?void 0:c.confirmationText,content:null==c?void 0:c.confirmationDescription,onSave:f,onDiscard:g,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))},yo=()=>{const e=(0,a.useSelector)(x.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(bo,{key:e.id,notification:e})))):null};var vo=n(72753),Eo=n(43576),xo=n(64459),wo=n(3409),Oo=n(93873),Co=n(22860);function So(){return So=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},So.apply(this,arguments)}const Po=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",So({width:"19",height:"17",viewBox:"0 0 19 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M14 17v2H4v-2h10zm6-4v2H4v-2l12.884.001H17l.116-.002L20 13zm-8.457-2H4V9h5.82a8.465 8.465 0 001.723 2zM9.139 6.178l-.289.733.035.088L4 7V5l5.713-.002c-.22.375-.412.768-.574 1.18zM17 2.82a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091 6.451 6.451 0 00-6-4.091zm0 6.815a2.728 2.728 0 010-5.455 2.728 2.728 0 010 5.455zm0-4.365c-.905 0-1.636.73-1.636 1.636 0 .906.73 1.637 1.636 1.637.905 0 1.636-.731 1.636-1.637 0-.905-.73-1.636-1.636-1.636z",id:"svg1467685497a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",{transform:"translate(-4 -2.5)"},o().createElement("mask",{id:"svg1467685497b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg1467685497a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))};function No(){return No=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},No.apply(this,arguments)}const To=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",No({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM20 8H8v12h12V8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg2383396984a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("mask",{id:"svg2383396984b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2383396984a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2383396984b)",d:"M0 0h24v24H0z"})))},ko=(0,J.Z)({editingButtons:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}});function Ro(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){Io(e,t,n[t])}))}return e}function Io(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Do=e=>o().createElement(G.SvgIcon,e,o().createElement(Po,null)),jo=e=>o().createElement(G.SvgIcon,e,o().createElement(To,null)),Zo=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,h.KIu)(a))&&!!(r&&o||!(0,h.fnZ)(a))&&(0,h.uGe)(l,t)})),Lo=e=>{let{className:t,profileBandConfig:n}=e;const l=ko(),s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getCanUserStartProcessFromQuery),u=(0,a.useSelector)(x.ZP.selectors.getEntityWithoutDiff),d=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,u.uri))),p=(0,a.useSelector)(x.ZP.selectors.getMetadata),m=(0,a.useSelector)(x.ZP.selectors.isWorkflowEnabled),g=(0,a.useSelector)(x.ZP.selectors.getMode),f=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),b=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),v=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),E=(0,a.useSelector)(x.ZP.selectors.getProfileOperation),w=null==u?void 0:u.type,O=(0,r.useMemo)((()=>(0,h.nt9)(p,w)),[w,p]),C=E===h.OXy.Saving,S=E===h.OXy.Cloning||C,[P,N]=(0,r.useState)(!1),T=(0,r.useCallback)((()=>{N(!1)}),[]),k=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const o=(0,a.useSelector)(x.ZP.selectors.getEntityWithoutDiff),l=(0,a.useSelector)(x.ZP.selectors.getMetadata),s=(0,a.useDispatch)(),c=null==o?void 0:o.type,u=l.relationTypes,d=(0,r.useCallback)((0,h.Ian)(l,c),[l,c]),p=(0,h.nt9)(l,c),m=(0,r.useMemo)((()=>(0,i.when)((0,i.complement)(i.isNil),(0,i.pipe)((0,i.find)((0,i.pipe)((0,i.propOr)([],"entityTypeUris"),(0,i.either)((0,i.includes)(c),(0,i.includes)("*")))),(0,i.when)((0,i.complement)(i.isNil),(0,i.omit)(["entityTypeUris"]))))(t)),[t,c]),g=(0,r.useCallback)((()=>{if(m){const e=(0,i.pipe)((0,i.prop)("relationshipTypesToCopy"),(0,i.cond)([[i.isNil,(0,i.pipe)((0,i.always)(p),(0,i.propOr)([],"attributes"),(0,i.filter)(h.YkG),(0,i.map)(h.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(d))],[i.T,i.identity]]))(m);s(x.N5.entity.actions.entityCloneRequested({data:Ro({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,p,u,o.uri,d]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:T}),R=(0,r.useMemo)((()=>[{label:y().text("Editing"),value:h.fO_.EDITING,description:y().text("Edit profile directly"),icon:Eo.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:h.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:Do,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:h.fO_.VIEWING,description:y().text("Read or print profile"),icon:vo.Z,permission:"READ"}]),[]),I=(0,r.useMemo)((()=>[...k?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:jo,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:Qe.Z,onClick:()=>{window.confirm(y().text("Are you sure you want to delete this?"))&&s(x.N5.entity.actions.entityRemoveRequested({entityUri:u.uri}))},permission:"DELETE"}]),[s,u.uri,k]),D=!v&&!(0,h.biM)(u)&&!(e=>(0,h.uGe)(h.BDP.READ,e)&&!(0,h.uGe)(h.BDP.UPDATE,e)&&!(0,h.uGe)(h.BDP.DELETE,e)&&!(0,h.uGe)(h.BDP.INITIATE_CHANGE_REQUEST,e))(O),j=(0,h.ZiX)(null==u?void 0:u.uri),Z=(0,r.useMemo)((()=>Zo(R,O,j,m,c)),[R,O,m,c,j]),L=(0,r.useMemo)((()=>Zo(I,O,j,m,c)),[I,O,m,c,j]),M=(0,r.useCallback)((e=>{s(x.N5.mode.actions.modeUpdated(e))}),[s]),A=(0,r.useCallback)((()=>{s(x.N5.mode.actions.modeCancelEditing())}),[s]),_=(0,r.useCallback)((()=>{s(x.N5.actions.saveProfile())}),[s]);return o().createElement(o().Fragment,null,o().createElement(xo.Z,{className:H()(t,Et.U),entity:f&&d?d:u},o().createElement(G.Box,{display:"flex",alignItems:"center"},o().createElement(G.Box,{mr:3},f&&o().createElement(G.Box,{className:l.editingButtons},o().createElement(G.Button,{variant:"outlined",onClick:A,"data-reltio-id":"reltio-profile-cancel-editing",disabled:S},y().text("Cancel")),o().createElement(G.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:_,disabled:S},(0,h.fnZ)(g)?y().text("Suggest"):y().text("Save"))),v&&b?o().createElement(wo.Z,null):b&&o().createElement(Oo.a,null)),D&&o().createElement(Co.T,{optionsGroup:Z,buttonsGroup:L,value:g,onChange:M,disabled:S})),o().createElement(G.Box,{className:l.comments},o().createElement(xt.Z,{uri:u.uri,relatedObjectUris:(0,h.wp9)(h.q7e.ENTITY,{entityUri:u.uri}),objectType:h.q7e.ENTITY}))),!!k&&o().createElement(Ve.Z,{open:P,title:y().text("Do you want to create a clone of the profile?"),content:y().text("Cloning will create a copy of the current profile. You can modify the cloned profile in the next step. Are you sure you want to proceed?"),onSave:k,onDiscard:T,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))};var Mo=n(71820),Ao=n(85890),_o=n(26789),Uo=n(54362),Ho=n(6674),zo=n(91515),Bo=n(52043),Fo=n(17308),Vo=n(39827),Wo=n(80147),Go=n(76569);const qo=(0,J.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),$o=()=>{const{total:e}=(0,r.useContext)(I.O),t=qo();return o().createElement(G.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Go.Z,null))};var Yo=n(26313),Qo=n(9371),Xo=n(4426);const Ko=(0,J.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Jo=()=>{const e=Ko(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(C.h),i=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const s=(0,Yo.Q)(n);return o().createElement(Ne.X.Provider,{value:s},o().createElement(G.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Qo.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(G.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(Xo.Z,{className:e.showMoreIcon}),y().text("Show more"))))};var ea=n(39445);const ta=(0,J.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),na=()=>{const e=ta(),{tasks:t,loading:n}=(0,r.useContext)(I.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(L.Z,null),t&&t.map((e=>o().createElement(ea.s,{key:e.taskId,task:e}))))};function ra(){return ra=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},ra.apply(this,arguments)}const oa=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",ra({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),o().createElement("defs",null,o().createElement("path",{d:"M4 17.17L5.17 16H20V4H4v13.17zM20 2c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H6l-4 4V4c0-1.1.9-2 2-2h16zm-3 9H7v2h10v-2zm0-4H7v2h10V7z",id:"svg2697213709a"})),o().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o().createElement("g",null,o().createElement("g",{transform:"translate(-2 -2)"},o().createElement("mask",{id:"svg2697213709b",fill:"#fff"},o().createElement("use",{xlinkHref:"#svg2697213709a"})),o().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2697213709b)",d:"M0 0h24v24H0z"})))))},aa=()=>{const{commentsMap:e}=(0,r.useContext)(C.h),t=qo();return o().createElement(G.Badge,{badgeContent:(0,h.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(oa,null))};var la=n(10159);const ia=()=>o().createElement(la.Z,{text:y().text("Ready to go with the flow?"),secondaryText:y().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),sa=()=>o().createElement(la.Z,{text:y().text("Care to join the conversation?"),secondaryText:y().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function ca(){return ca=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},ca.apply(this,arguments)}const ua=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",ca({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{d:"M14.101 16A5.003 5.003 0 0016 18.987V20H2v-4h12.101zM22 18.987V20v-1.013zM4 17v2h2v-2H4zM16 4v1.013A5.004 5.004 0 0014.101 8H2V4h14zm6 0v1.013V4zM6 7V5H4v2h2zm8 3v4H2v-4h12zM4 11v2h2v-2H4zm12 4v-2h6v2c0 1.3-.84 2.4-2 2.82V22h-2v-4.18c-1.16-.42-2-1.52-2-2.82zm0-6c0-1.3.84-2.4 2-2.82V2h2v4.18c1.16.42 2 1.52 2 2.82v2h-6V9z",fill:"#000",fillOpacity:".54"}))},da=(0,J.Z)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),pa=()=>{const e=da(),t=(0,a.useSelector)(x.ZP.selectors.getDBConnectorSideViews);return o().createElement("div",{className:e.wrapper},t.map((t=>o().createElement(ur,{key:t.id,config:t,className:e.itemWrapper}))))};function ma(){return ma=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},ma.apply(this,arguments)}let ga;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(ga||(ga={}));const fa=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},ha=()=>{var e,t,n;const l=qo(),s=(0,a.useSelector)(x.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(x.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(x.ZP.selectors.isCollaborationSideViewEnabled),d=(0,a.useSelector)(x.ZP.selectors.isDBConnectorSideViewEnabled),p=(0,a.useSelector)(x.ZP.selectors.isCollaborationEnabled),m=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent),g=(0,a.useSelector)(x.ZP.selectors.getMetadata),f=(0,a.useSelector)(x.ZP.selectors.getEntity),b=(0,r.useContext)(I.O),v=(0,r.useContext)(C.h),[E,w]=(0,r.useState)(null),O=(0,r.useCallback)((e=>{w((t=>t===e?null:e))}),[]),S=(0,r.useCallback)((()=>{w(null)}),[]),P=null!==E,N=E===ga.History,{isHistoryEnabled:T,isProfilePersisted:k}=(0,Mo.C)({isHistoryTabActive:N,entity:f}),{historyFilter:R,onApplyFilter:D,isLoading:j,historicUris:Z,historyWithTotal:L,canLoadMore:M,onLoadMore:A}=(0,Ao.k6)({entity:f,enabled:T}),_=s&&c&&!(0,h.ZiX)(null==f?void 0:f.uri),U=u&&p,H=(0,h.mdt)(null==v?void 0:v.commentsMap),z=[{buttonProps:{id:ga.Workflow,icon:$o,tooltipTitle:y().text("Workflow")},content:null!=b&&b.total?o().createElement(na,null):o().createElement(ia,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:fa(null==b?void 0:b.total),rightContent:o().createElement(_o.G,null)},hidden:!_},{buttonProps:{id:ga.Collaboration,icon:aa,tooltipTitle:y().text("Collaboration")},content:H?o().createElement(Jo,null):o().createElement(sa,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:fa(H)},hidden:!U},{buttonProps:{id:ga.History,icon:Wo.Z,tooltipTitle:y().text("History")},content:k?o().createElement(Uo.Z,{isLoading:j,historyWithTotal:L,contributorsUris:Z,entityUri:null==f?void 0:f.uri,historyEvent:m,onLoadMore:A,canLoadMore:M}):o().createElement(Ho.Z,null),headerProps:{content:o().createElement(zo.Z,{total:k?((null==Z?void 0:Z.length)||0)+1:void 0,entityType:(0,h.nt9)(g,null==f?void 0:f.type),filter:R,onApplyFilter:D})}},{buttonProps:{id:ga.DBConnector,icon:ua,tooltipTitle:y().text("D&B Connector")},content:o().createElement(pa,null),headerProps:{mainTitle:y().text("D&B Connector")},hidden:!d}],B=(0,i.reject)((0,i.propEq)("hidden",!0))(z);return(0,r.useEffect)((()=>{var e;null!==(e=z[E])&&void 0!==e&&e.hidden&&S()}),[E,z,S,B]),o().createElement("div",{className:l.wrapper},o().createElement(Bo.h,{open:P,width:480},!(null!==(e=z[E])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(Fo.P,ma({},null===(t=z[E])||void 0===t?void 0:t.headerProps,{onClose:S})),null===(n=z[E])||void 0===n?void 0:n.content)),o().createElement(Vo.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(z),onButtonClick:O,activeIndexId:E}))};var ba=n(39781),ya=n(16715);const va="48px",Ea="1px solid rgba(0, 0, 0, .125)",xa=(0,J.Z)((e=>({accordion:{borderTop:Ea,borderBottom:Ea,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:va,minHeight:va,"&$accordionSummaryExpanded":{height:va,minHeight:va}},accordionSummaryHeading:{flex:1,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular},accordionSummaryExpanded:{},accordionSummaryContent:{display:"flex",alignItems:"center"},accordionDetails:{maxHeight:"21vh",overflow:"auto",paddingTop:0,paddingBottom:0,"& ul":{paddingLeft:"23px",marginTop:"3px"},"& li":{paddingLeft:"9px",paddingBottom:"8px"}},parents:{color:e.palette.text.primary},errorWrapper:{lineHeight:"18px",display:"flex",flexDirection:"column"},errorTitle:{display:"flex",alignItems:"center"},goToIcon:{marginLeft:"4px"},errorsAccordion:{backgroundColor:"#FFF4F6",borderColor:"#FFB8B3"},errorsAccordionDetails:{color:"#DD2C00"},warningsAccordion:{backgroundColor:"#FFF9ED",borderColor:"#FFDD91"},warningsAccordionDetails:{color:"#CC7500"},icon:{marginRight:"8px"},errorIcon:{fill:"#FF1744"},warningIcon:{fill:"#F9A825"}}))),wa=xa;var Oa=n(38016);const Ca=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=wa();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:d}=e;return o().createElement(G.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(G.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(Oa.Z,null)},i,o().createElement(G.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(G.AccordionDetails,{className:H()(l.accordionDetails,d)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));function Sa(){return Sa=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},Sa.apply(this,arguments)}Ca.displayName="ErrorsPanel";const Pa=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Sa({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.245 12.75c0 .825-.467 1.5-1.045 1.5H4.8c-.583 0-1.05-.675-1.05-1.5v-7.5c0-.832.467-1.5 1.05-1.5h8.4c.578 0 1.05.668 1.05 1.5l-.005 7.5zM9.75 9.96v1.642l3-2.805L9.75 6v1.598c-2.918.404-4.08 2.4-4.5 4.402 1.043-1.402 2.415-2.04 4.5-2.04z",fill:"#000",fillOpacity:".54"}))},Na=(0,i.omit)(["deactivated","path"]),Ta=(0,r.memo)((e=>{let{error:t}=e;const n=wa(),l=(0,a.useSelector)(x.ZP.selectors.getMetadata),s=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),c=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===h.NIO.missed&&r===h.zHr.local){const t=l||(0,h.zeJ)(e,a);return t?y().text("${attribute} is required",{attribute:t.label}):o}return o})(l,t),u=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[h.HAc.attributeValue,h.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t),{highlightError:d}=(0,r.useContext)(Z.M),p=t.uri||t.parentUri&&t.attributeTypeUri;return o().createElement("li",null,o().createElement("div",{className:n.errorWrapper},o().createElement("span",{className:n.errorTitle},c,p&&s&&o().createElement(ke.k,{icon:Pa,size:"XXS",onClick:()=>d(t),tooltipTitle:y().text("Go to error"),className:n.goToIcon})),u&&o().createElement("span",{className:n.parents},u)))}));Ta.displayName="Error";const ka=()=>{const e=wa(),t=(e=>{const t=(0,r.useRef)(e);return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&(0,i.equals)(e.map(Na),t.map(Na))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(x.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(h.IT0,t)),[t]),[s,c]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:y().text("${number} ${errors}",{number:n.length,errors:1===n.length?y().text("error"):y().text("errors")}),icon:o().createElement(ba.Z,{className:H()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:y().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?y().text("warning"):y().text("warnings")}),icon:o().createElement(ya.Z,{className:H()(e.icon,e.warningIcon)}),items:l,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,l,e]);(0,r.useEffect)((()=>{c("errors")}),[n]);const d=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(Ca,{panels:u,expandedPanelId:s,onToggle:d,ErrorComponent:Ta}):null},Ra=(0,J.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},scrollWrapper:{flexGrow:1,overflowY:"auto"},emptyState:{backgroundColor:"#FAFAFA",height:"100%"},profileWrapper:e=>{let{maxWidth:t}=e;return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,maxWidth:t?`${t}px`:"100%"}},profileContainer:{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"}}))),Ia={},Da=(0,r.memo)((e=>{var t;let{config:n,saveState:l,getSavedState:i}=e;const s=Ra({maxWidth:null==n?void 0:n.maxWidth}),c=(0,a.useDispatch)(),u=(0,r.useCallback)((()=>i().then((e=>e.layout?{}:e))),[i]),d=(0,r.useRef)(),p=(0,r.useCallback)((0,h.DsO)(l,1e3),[l]),m=(0,a.useSelector)(x.ZP.selectors.getEntity),g=null!=n&&n.nestedRoute?`/${n.nestedRoute}`:"",f=m?m.type:null,b=f&&n?f+g:null,{isLoaded:v,savedState:_=Ia,updateSavedState:U}=(0,w.w)({getSavedState:u,saveState:p,entityTypeUri:b}),[H,z]=(0,r.useState)([]),[B,F]=(0,r.useState)([]),V=(0,r.useMemo)((()=>E()(n)),[n]),W=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),G=(0,r.useMemo)((()=>(0,h.dvH)(m)),[m]),q=(0,O.C)({objectIds:G}),$=(0,r.useContext)(C.h),Y=(0,S.U)(),Q=(0,P.v)(null==n?void 0:n.workflow),X=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent);(0,N.a)({entity:m,historyEvent:X});const K=(0,T.u)(),J=(null===(t=(0,a.useSelector)(x.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"";(0,r.useEffect)((()=>{if(v){const e=V!==_.configHash,{views:t,layout:r}=(0,h.Mfk)({views:e||!_.views?n.views:_.views,layout:e?n.layout:_.layout});F(t),z(r)}}),[v,_,b]),(0,r.useEffect)((()=>{c(x.N5.views.actions.profileViewsSet(B))}),[c,B]),(0,r.useEffect)((()=>{n.sidePanelViews&&c(x.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>{d.current&&(d.current.scrollTop=0)}),[null==m?void 0:m.uri]),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(x.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(x.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,h.biM)(n),s=(0,a.useSelector)(x.ZP.selectors.getMode),c=(0,a.useSelector)(x.ZP.selectors.getProfileViews),u=c&&c.length>0,d=(0,r.useCallback)((0,h.DsO)((t=>{t&&e(x.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,h.ZiX)(o)&&s===h.ARY.Viewing&&u;d(e)}),[d,i,t,l,o,s,u])})();const ee=(0,r.useCallback)((e=>{U({layout:e,views:B,configHash:V}),z(e)}),[U,V,B]),te=d.current,ne=(0,r.useMemo)((()=>({element:te,priority:["top","bottom"]})),[te]);return o().createElement(k.j.Provider,{value:!0},o().createElement(R.s.Provider,{value:Y},o().createElement(C.h.Provider,{value:W?$:q},o().createElement(I.O.Provider,{value:Q},o().createElement(D.m.Provider,{value:K},o().createElement(j.l.Provider,{value:J},o().createElement(Z.R,null,o().createElement("div",{className:s.perspectiveView},(!v||!(null!=m&&m.uri))&&o().createElement(L.Z,null),v&&null!=m&&m.uri?o().createElement("div",{className:s.profileContainer},o().createElement("div",{className:s.profileWrapper},o().createElement(Lo,{profileBandConfig:n.profileBand}),!W&&o().createElement(ka,null),o().createElement("div",{ref:d,className:s.scrollWrapper},o().createElement(M.p.Provider,{value:ne},o().createElement(go,{layout:H,onLayoutChanged:ee,views:B})))),o().createElement(ha,null)):o().createElement("div",{className:s.emptyState},o().createElement(A.ZP,{LogoRenderer:A.B9.NO_DATA,text:y().text("No data to display."),variant:A.tC.embedded})),o().createElement(yo,null)))))))))}));Da.displayName="ProfilePerspectiveView";const ja=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),Za=e=>{let{config:t,store:n,onResize:b=i.identity,saveState:y,getSavedState:v,qxSandboxApi:E}=e;const x=(0,r.useCallback)((0,h.aYu)(v),[v]),{SnackbarRenderer:w,showSnackbarMessage:O}=(0,d.D)(),C=(0,r.useMemo)((()=>t&&(0,h.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(p.m.Provider,{value:null==C?void 0:C.id},o().createElement(m.S.Provider,{value:O},o().createElement(g.Y.Provider,{value:E},o().createElement(s.StylesProvider,{generateClassName:ja},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>b(Math.floor(e),Math.floor(t))}),C&&o().createElement(Da,{config:C,saveState:y,getSavedState:x}),o().createElement(f.Z,{showErrorFromStore:!0}),o().createElement(w,null))))))))};var La=n(82842),Ma=n(51229),Aa=n(91131);const _a=(0,J.Z)((e=>({titleContainer:{overflow:"hidden",fontSize:"16px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",alignItems:"center",display:"flex",minHeight:"48px",color:e.palette.text.secondary},link:{fontSize:"16px",fontWeight:"normal"},icon:{height:"18px",color:e.palette.text.secondary},totalCaption:{lineHeight:"inherit",fontSize:"14px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px"},totalNumber:{fontSize:"16px",color:"rgba(0,0,0,0.87)",marginRight:"5px",fontWeight:500}}))),Ua=e=>{let{total:t=0}=e;const n=_a(),l=(0,a.useDispatch)(),i=(0,r.useContext)(p.m),s=(0,r.useCallback)((()=>{l(x.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(q.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(G.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},y().text("Profile")),o().createElement(Aa.Z,{className:n.icon}),y().text("Tags")),o().createElement(Ma.Z,null),o().createElement(G.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var Ha=n(20404);const za=(0,J.Z)((e=>({toolbar:{display:"flex",flexShrink:0,background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"16px"},avatar:{color:"rgba(0, 0, 0, 0.38)",marginRight:"12px"},label:{fontSize:"20px",letterSpacing:"0.25px",lineHeight:"1.2",fontWeight:500,color:e.palette.text.primary,wordBreak:"break-word"}}))),Ba=e=>{let{label:t}=e;const n=za();return o().createElement(G.Toolbar,{className:n.toolbar},o().createElement(Ha.Z,{className:n.avatar}),o().createElement(G.Typography,{variant:"h6",className:n.label},t))};function Fa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Va(e,t,n[t])}))}return e}function Va(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wa=(0,J.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},tagsContainer:{display:"flex"},fullHeight:{flexGrow:1,height:0},tagsView:{margin:"16px",width:"100%",paddingTop:"4px"},listContainer:{flex:1,display:"flex",overflow:"hidden",position:"relative",flexDirection:"column",minHeight:"4px"},entitiesList:{overflowY:"auto",flexGrow:1},pagination:{flexGrow:0}}))),Ga=[25,50,100],qa=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=Wa(),[s,c]=(0,r.useState)(Ga[0]),[u,d]=(0,r.useState)(0),p=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{d(0)}),[t,n,p]);const{isLoading:m,total:g,entities:f}=(e=>{let{tag:t,entityUri:n,page:o=0,rowsPerPage:l=50}=e;const s=(0,a.useDispatch)(),c=(0,xe._)(),u=(0,xe._)(),[d,p]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,b]=(0,r.useState)([]),{requestEntities:v,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(x.ZP.selectors.getTenant),s=(0,a.useSelector)(x.ZP.selectors.getDtssPath),c=(0,r.useMemo)((()=>(0,h.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),d=!!c,p=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Fa({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return d?(0,h.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,h.E7G)(c))):(0,h.ZOr)(e,t)}),[d,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>p(u,Fa({offset:t,max:e},o))),[u,o,p]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(d?(0,h.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,h.j_Q)(u,e)).then((e=>e.total))}),[u,o,d,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(x.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong")))),g(0)}),[s]);return(0,r.useEffect)((()=>{c(E()).then(g).catch(w)}),[E,c,w]),(0,r.useEffect)((()=>{p(!0),u(v(l,o*l)).then(b).catch(w).finally((()=>p(!1)))}),[o,l,v,u,w]),{isLoading:d,total:m,entities:f}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),b=(0,r.useRef)(null);(0,r.useEffect)((()=>{b.current&&(b.current.scrollTop=0)}),[f]);const v=g>Ga[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(Ba,{label:t}),o().createElement("div",{className:H()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(V.Z,{className:l.tagsView},o().createElement(Ua,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(L.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:b},o().createElement(La.Z,{entities:f})),v&&o().createElement("div",{className:l.pagination},o().createElement(W.Z,{count:g,rowsPerPageOptions:Ga,rowsPerPage:s,page:u,onChangePage:d,onChangeRowsPerPage:c}))))))}));qa.displayName="TagPerspectiveView";const $a=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Ya=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(p.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:$a},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(qa,{tag:n,entityUri:r}),o().createElement(f.Z,{showErrorFromStore:!0}))))}},79417:(e,t,n)=>{n.r(t),n.d(t,{RelationshipsTableView:()=>Qe});var r=n(8598),o=n(24328),a=n.n(o),l=n(44443),i=n(17440),s=n(52730),c=n(59431),u=n(65549),d=n(94079),p=n(13980),m=n.n(p),g=n(87918),f=n.n(g),h=n(79692);const b=(0,h.Z)({addButton:{marginLeft:"12px",padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},label:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),y=e=>{let{onClick:t}=e;const n=b();return a().createElement(d.Button,{color:"primary",className:n.addButton,onClick:t},a().createElement(u.Z,{classes:{root:n.icon}}),a().createElement("div",{className:n.label},f().text("Add")))};y.propTypes={onClick:m().func};const v=y;var E=n(71153),x=n.n(E),w=n(90088);const O={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},C={color:"rgba(0,0,0,.54)"},S=(0,h.Z)((e=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},entityCell:{display:"flex",alignItems:"center",height:"100%"},entityLabel:{fontSize:"15px",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","$row-cell--removed &":O,"$row-cell--inactive &":C},entityAvatar:{transform:"scale(0.7)",margin:"0 10px"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > :not($entityCell)":O},"row-cell--inactive":C})));function P(){return P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P.apply(this,arguments)}const N=e=>{let{cell:t,CellValueRenderer:n,rowValue:{connection:r},isSorted:o}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["cell","CellValueRenderer","rowValue","isSorted"]);const i=S(),s=(0,w.$qe)(r),c=(0,w.Fn9)(r.relation)&&(0,w.Fn9)(r.entity);return a().createElement("div",{className:x()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:s,[i["row-cell--inactive"]]:!c},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,P({key:t,value:e},l)))))};N.propTypes={rowValue:m().object,cell:m().object,CellValueRenderer:m().elementType,isSorted:m().bool};const T=N;var k=n(85709),R=n(94656),I=n(39450),D=n(31254),j=n(95613);const Z=e=>{let{value:{entityType:t,entity:n}}=e;const r=(0,s.useDispatch)(),l=(0,o.useContext)(I.m),u=S(),d=(0,w.idV)(n.entityLabel),p=(0,w.wwR)({uri:n.entityUri,dataTenant:n.dataTenant});return a().createElement("div",{className:u.entityCell},a().createElement(D.Z,{className:u.entityAvatar,entityType:t}),a().createElement(j.Z,{value:d},a().createElement("span",{className:u.entityLabel,onClick:(0,i.pipe)((0,i.always)({uri:p,viewId:l}),c.ui.actions.openEntity,r)},d)))};Z.propTypes={value:m().shape({entity:m().shape({entityUri:m().string,entityLabel:m().string}),entityType:w.p8l})};const L=Z;var M=n(92332);const A=(0,n(67353).Z)((e=>{const t=S();return a().createElement("div",{className:t.headCell},a().createElement(M.default,e))}));var _=n(64091);const U=(0,i.pipe)((0,i.map)((e=>e.uri||e)),i.uniq);function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const z=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),B=e=>{if(e.startsWith("relation.attributes")){const t=z(e);return t.length>1?t.slice(0,-1):null}return null},F=(0,i.map)((e=>{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){H(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:B(e.id),headCellRenderer:A,rowCellValueRenderer:(t=e.id,"entity.label"===t?L:_.Z)});var t})),V=(0,h.Z)({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},emptyData:{marginBottom:"30px"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}});var W=n(27604),G=n(22983);const q=e=>{let{canUpdate:t,canRemove:n,handleEditRelation:r,handleRemoveRelation:o}=e;return a().createElement(a().Fragment,null,t&&a().createElement(d.Tooltip,{title:f().text("Edit")},a().createElement(d.IconButton,{onClick:r},a().createElement(W.Z,null))),n&&a().createElement(d.Tooltip,{title:f().text("Remove")},a().createElement(d.IconButton,{onClick:o},a().createElement(G.Z,null))))};q.propTypes={canUpdate:m().bool,canRemove:m().bool,handleEditRelation:m().func,handleRemoveRelation:m().func};const $=q;function Y(){return Y=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},Y.apply(this,arguments)}const Q=e=>{let{mode:t,columnsData:n,connections:r,metadata:l,sorting:s,onSort:u,filters:d,onFilter:p,onEditRelation:m,onRemoveRelation:g,basicTableRef:f,allowOnlyCreateNew:h}=e;const b=(0,o.useMemo)((()=>((e,t,n)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,r)=>{let{id:o}=r;return(0,i.assoc)(o,((e,t,n)=>{let{entity:r,relation:o}=t;switch(e){case"entity.label":return{entity:r,entityType:(0,w.nt9)(n,r.entityType)};case"relation.label":return o.relationLabel||(0,w.Lmx)(n,o.relationType);case"relation.activeness.startDate":return o.startDate;case"relation.activeness.endDate":return o.endDate;default:return((e,t)=>(0,i.pipe)((0,i.path)(["object","attributes"]),(0,w.tT_)(e))(t))(z(e),o)}})(o,e,n),t)}),{}),(0,i.assoc)("connection",e))(t))))(r,n,l)),[r,n,l]),y=(0,o.useMemo)((()=>F(n)),[n]),v=V(),E=(0,o.useCallback)((e=>a().createElement(T,Y({},e,{isSorted:!!s&&s.field===e.columnData.id}))),[s]),[x,O]=(0,o.useState)(null),{canRemove:C,canUpdate:S}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a,allowOnlyCreateNew:l}=e;const i=(0,w.xvW)(r);if(c.N5.mode.selectors.getIsEditableMode(n)&&r&&(!l||i)){const{relation:{relationType:e}}=r,l=(0,w.$qe)(r),i=(0,w.V3K)(t,e);return{canRemove:o&&!l&&(0,w.Edd)(n,i),canUpdate:a&&!l&&(0,w.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:t,onRemoveRelation:g,onEditRelation:m,metadata:l,allowOnlyCreateNew:h,connection:(0,i.path)([x,"connection"],b)}),P=(0,o.useCallback)((e=>O(e)),[]),N=(0,o.useCallback)((()=>m((0,i.path)([x,"connection"],b))),[x,m,b]),R=(0,o.useCallback)((()=>g((0,i.path)([x,"connection","relation","relationUri"],b))),[x,g,b]),I=C||S?a().createElement($,{handleEditRelation:N,handleRemoveRelation:R,canRemove:C,canUpdate:S}):void 0;return a().createElement("div",{className:v.tableContainer},a().createElement(k.Z,{autosizing:!0,maxHeight:477,columnsData:y,rowsData:b,sorting:s,onSort:u,filters:d,onFilter:p,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:E,onRowHover:P,hoverRowIndex:x,hoveredRowRightContent:I,classes:{hoveredRowRightContentWrapper:v["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:v["row-cell__buttons-container"]},ref:f,resizeDebounceDelay:150}))};Q.propTypes={mode:m().string,columnsData:R.uz,connections:m().arrayOf(w.Rjq),metadata:w.pGS,filters:m().objectOf(R.Dq),onFilter:m().func,sorting:R.nI,onSort:m().func,onEditRelation:m().func,onRemoveRelation:m().func,basicTableRef:m().shape({current:m().object}),allowOnlyCreateNew:m().bool};const X=Q;var K=n(93416),J=n(75512),ee=n(30553),te=n(32152),ne=n(1876),re=n(60894),oe=n(43054),ae=n(8818);const le=(0,h.Z)((()=>({popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ie=e=>{let{className:t,showInactive:n,onShowInactiveChange:r}=e;const l=le(),i=(0,o.useRef)(),[s,c]=(0,o.useState)(!1),u=()=>c((e=>!e));return a().createElement(a().Fragment,null,a().createElement(ae.k,{className:t,ref:i,tooltipTitle:f().text("More"),icon:oe.Z,onClick:u,size:"L"}),a().createElement(d.Popover,{open:s,classes:{paper:l.popupContent},anchorEl:i.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(d.FormControlLabel,{classes:{label:l.checkboxControlLabel},control:a().createElement(d.Checkbox,{className:l.checkboxControlCheckbox,checked:n||!1,onChange:e=>r(e.target.checked)}),label:f().text("Show inactive Relationships")})))},se=(0,h.Z)({header:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},moreButton:{marginLeft:"-6px"}}),ce=e=>{let{title:t,total:n,searchQuery:r,onChangeSearchQuery:o,filtersEnabled:l,onToggleFilters:i,columnsData:s,selectedColumns:c,onChangeColumns:u,showInactive:p,onChangeShowInactive:m}=e;const g=se();return a().createElement(K.Z,{title:t,className:g.header},a().createElement(J.Z,{widthToHide:500},a().createElement(ee.Z,{height:24,margin:16}),a().createElement(d.Typography,{className:g.totalCaption,variant:"caption"},n>1?f().text("${count} entities",{count:n}):f().text("${count} entity",{count:n}))),a().createElement(te.i,{query:r,onChange:o}),a().createElement(ne.Z,{enabled:l,onClick:i}),a().createElement(ee.Z,{height:24,margin:4}),a().createElement(re.Z,{columnsData:s,selectedColumns:c,onChangeColumns:u}),a().createElement(ie,{className:g.moreButton,showInactive:p,onShowInactiveChange:m}))};ce.propTypes={title:m().string,total:m().number,columnsData:R.uz,selectedColumns:m().arrayOf(m().string),onChangeColumns:m().func,searchQuery:m().string,onChangeSearchQuery:m().func,filtersEnabled:m().bool,onToggleFilters:m().func,showInactive:m().bool,onChangeShowInactive:m().func};const ue=ce;var de=n(26180),pe=n(31276);function me(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){ge(e,t,n[t])}))}return e}function ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fe="CHANGE_SEARCH_QUERY",he="CHANGE_SHOW_INACTIVE",be=me({},de.ZP.actions,{changeSearchQuery:(0,pe.zD)(fe),changeShowInactive:(0,pe.zD)(he)}),ye=(e,t)=>{switch(t.type){case fe:return me({},e,{searchQuery:t.payload,page:0});case he:return me({},e,{showInactive:t.payload});default:return de.ZP.reducer(e,t)}};var ve=n(26481),Ee=n(37152),xe=n(52016),we=n(10237),Oe=n(11013),Ce=n(58662),Se=n(99136);const Pe=[10,25,50,100],Ne=[{id:"entity.label",get label(){return f().text("Entity label")},dataTypeDefinition:{type:w.oS0.TYPE_STRING},hideable:!1},{id:"relation.label",get label(){return f().text("Directional label")},dataTypeDefinition:{type:w.oS0.TYPE_STRING}},{id:"relation.activeness.startDate",get label(){return f().text("Start date")},dataTypeDefinition:w.PY2.startDate},{id:"relation.activeness.endDate",get label(){return f().text("End date")},dataTypeDefinition:w.PY2.endDate}],Te=(0,i.pipe)(w.Tde,(0,i.concat)("relation.")),ke=(0,i.pipe)((0,i.map)((e=>({id:Te(e.uri),label:e.label,dataTypeDefinition:(0,w.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),Re=(0,i.pipe)(((e,t)=>{let{content:{inRelations:n=[],outRelations:r=[]}}=e,{relationTypes:o}=t;return(0,i.pipe)(U,(0,i.chain)((e=>(0,i.pipe)((0,i.find)((0,i.propEq)("uri",e)),w.DK$)(o))))([...n,...r])}),ke,(0,i.concat)(Ne));var Ie=n(99341);function De(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){je(e,t,n[t])}))}return e}function je(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ze=e=>e.uri||e,Le=e=>t=>Ze(t)===e,Me=(0,i.curry)(((e,t)=>{const n=(t,r)=>{let o=Ze(r),a=!1;o.startsWith("!")&&(o=o.slice(1),a=!0);const l=e[o]&&(0,w.uGe)(w.BDP.READ,e[o]),s=t.find(Le(o))||!l?t:t.concat(r.uri?De({},r,{uri:o}):o);return a?s:(0,i.keys)(e).reduce(((t,r)=>e[r].extendsTypeURI!==o||t.find(Le(r))?t:n(t,r)),s)};return t.reduce(n,[])})),Ae=(0,i.curry)(((e,t)=>{const n=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n.reduce(((n,r)=>{const o=Ze(r),a=(0,i.path)([o,t,"objectTypeUri"],e);return!a||n.find(Le(a))?n:n.concat(a)}),[])};return De({},t,{entityTypes:[...n("startObject",t.inRelations),...n("endObject",t.outRelations)]})})),_e=(0,i.indexBy)((0,i.prop)("uri")),Ue=(0,i.curry)(((e,t)=>{const n=_e(e.relationTypes),r=_e(e.entityTypes),o=e=>(0,i.evolve)({inRelations:Me(n),outRelations:Me(n),entityTypes:Me(r),nextEntry:o},e);return(0,i.pipe)((0,i.unless)((0,i.either)((0,i.prop)("nextEntry"),(0,i.prop)("entityTypes")),Ae(n)),o)(t)})),He=(0,h.Z)({addArea:{display:"flex",alignItems:"center",height:"48px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},noData:{fontSize:"13px",paddingLeft:"20px",marginBottom:"20px",marginTop:"10px",color:"rgba(0,0,0,0.54)"}}),ze=(0,i.pluck)("id",Ne),[Be]=ze;function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ve=(0,i.memoizeWith)(((e,t)=>t.id),((e,t)=>(0,i.evolve)({content:Ue(e)},t))),We=(0,s.connect)(((e,t)=>{const{config:n}=t;return{connections:c.ZP.selectors.getConnectionsWithDraftsByViewId(e,n.id),total:c.ZP.selectors.getTotalByViewId(e,n.id),entity:c.ZP.selectors.getEntity(e),metadata:c.ZP.selectors.getMetadata(e),mode:c.ZP.selectors.getMode(e),relationToAdd:c.ZP.selectors.getRelationToAddByViewId(e,n.id),relationsToEdit:c.ZP.selectors.getRelationsToEditByViewId(e,n.id),checkIfCanAddRelations:c.ZP.selectors.getCheckIfCanAddRelations(e,n.content)}}),void 0,((e,t,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){Fe(e,t,n[t])}))}return e}({},e,t,n,{config:Ve(e.metadata,n.config)})))((e=>{let{className:t,config:n,entity:r,metadata:l,connections:s=[],total:u=0,mode:p,relationToAdd:m,relationsToEdit:g=[],checkIfCanAddRelations:h,dispatch:b,readOnlyMode:y}=e;const E={searchQuery:"",filters:null,visibleColumns:ze,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||Be},page:0,rowsPerPage:n.max||15,showInactive:!1},x=He(),O=(0,o.useContext)(ve.j)?p:w.fO_.VIEWING,[C,S]=(0,o.useReducer)(ye,E),P=(0,i.pipe)(be.changeSearchQuery,S),N=(0,i.pipe)(be.changeShowInactive,S);(0,o.useEffect)((()=>{P("")}),[null==r?void 0:r.uri]);const{visibleColumns:T,searchQuery:k,filters:R,sorting:I,page:D,rowsPerPage:j,showInactive:Z}=C,L=(0,o.useMemo)((()=>Re(n,l)),[n,l]),M=(0,o.useMemo)((()=>T.map((e=>L.find((0,i.propEq)("id",e))))),[T,L]),A=(0,o.useMemo)((()=>((e,t,n)=>{const r=w.wSh.fromFalsy(e).map(w.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome(""),o=(0,Ie.Tz)(n,t);return(new w.MEy).addClause(r).addClause(o).build()})(k,R,M)),[R,k]),{isLoading:_}=(0,Ee.a)({sorting:I,filter:A,page:D,rowsPerPage:j,config:n,entity:r,relationActivityFilter:Z?w.Ng6.ALL:w.Ng6.ACTIVE_ONLY,mode:p}),U=(0,o.useMemo)((()=>{return e=E.rowsPerPage,Pe.filter((t=>t!==e)).concat(e).sort(i.subtract);var e}),[]),{handleRowsPerPageChange:H,handlePageChange:z}=(0,o.useMemo)((()=>({handleRowsPerPageChange:(0,i.pipe)(be.changeRowsPerPage,S),handlePageChange:(0,i.pipe)(be.changePage,S)})),[]),B=(0,o.useCallback)((()=>{const e=(0,w.vlo)({config:n,mode:O,metadata:l,parentEntityUri:void 0});(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),b)(e)}),[n,O,l,b]),F=(0,o.useCallback)((e=>{b(c.N5.relations.actions.closeRelationEditor(n.id,e)),b(c.N5.relations.actions.removeRelation(n.id,e));const t=s.find((t=>c.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=c.N5.relations.selectors.getEntityUriFromConnection(t);(0,w.ZiX)(r)&&b(c.N5.modifiedEntities.actions.entityDeleted(r))}),[n,s,b]),V=r&&h&&!y,W=m?[m,...g]:g,{canUpdate:G,canDelete:q}=(0,xe.l)(),$=G(n)&&!y,Y=q(n)&&!y,Q=(0,o.useRef)(null);return a().createElement(we.Z,{className:t},a().createElement(ue,{title:n.caption,total:u,columnsData:L,selectedColumns:T,onChangeColumns:(0,i.pipe)(be.changeColumns,S),searchQuery:k,onChangeSearchQuery:P,filtersEnabled:!!R,onToggleFilters:(0,i.pipe)(be.toggleFilters,S),showInactive:Z,onChangeShowInactive:N}),V&&a().createElement("div",{className:x.addArea},a().createElement(v,{onClick:B})),W.map((e=>a().createElement(Oe.Z,{key:c.N5.relations.selectors.getRelationUriFromConnection(e),connection:e,config:n,mode:O,metadata:l}))),a().createElement("div",{style:{position:"relative"}},a().createElement(X,{mode:O,columnsData:M,connections:s,metadata:l,filters:R,onFilter:(0,i.pipe)(be.changeFilter,S),sorting:I,onSort:(0,i.pipe)(be.toggleSort,S),onEditRelation:$?(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),b):null,onRemoveRelation:Y?F:null,basicTableRef:Q,allowOnlyCreateNew:n.allowOnlyCreateNew}),s.length?a().createElement(Ce.Z,{count:u,rowsPerPageOptions:U,rowsPerPage:j,onChangeRowsPerPage:H,page:D,onChangePage:z,basicTableRef:Q}):a().createElement(d.Typography,{className:x.noData},f().text("No data found")),_&&a().createElement(Se.Z,null)))}));var Ge=n(36138),qe=n(22664),$e=n(585);const Ye=(0,Ge.createGenerateClassName)({productionPrefix:"relTable",disableGlobal:!0}),Qe=e=>{let{config:t,store:n,onResize:o=i.identity,className:c,readOnlyMode:u}=e;return a().createElement(s.Provider,{store:n},a().createElement(I.m.Provider,{value:t.id},a().createElement(Ge.StylesProvider,{generateClassName:Ye},a().createElement(qe.MuiPickersUtilsProvider,{utils:r.Z},a().createElement(l.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(We,{config:t,className:c,readOnlyMode:u}),a().createElement($e.Z,null)))))}},96330:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
2
2
|
//# sourceMappingURL=9211.js.map
|