@reltio/remotes 1.4.1237 → 1.4.1240
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/4361.js +1 -1
- package/4361.js.map +1 -1
- package/5709.js +1 -1
- package/5709.js.map +1 -1
- package/5953.js +1 -1
- package/5953.js.map +1 -1
- package/6217.js +1 -1
- package/6217.js.map +1 -1
- package/7018.js +2 -0
- package/7018.js.map +1 -0
- package/8208.js +1 -1
- package/8208.js.map +1 -1
- package/package.json +1 -1
- package/remoteEntry.js +1 -1
- package/remoteEntry.js.map +1 -1
- package/7770.js +0 -2
- package/7770.js.map +0 -1
package/6217.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6217],{27815:(e,t,n)=>{n.d(t,{Z:()=>S});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),p=n(59431),d=n(57941),m=n(94079),g=n(92575),f=n(37285),b=n(96808),h=n(7785),y=n(79692);function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){v(e,t,n[t])}))}return e}function v(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=>E({},e,{fontSize:"14px"}),menuPortal:e=>E({},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 S=e=>{let{entityType:t,selectedAttributes:n,className:a,onChange:i,title:y,disableUnderline:E,menuPlacement:v="bottom"}=e;const S=(0,u.useSelector)(p.ZP.selectors.getMetadata),C=w(),O=(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,d.EUG)(S,r);return e.concat(a?O(a,t+1,o):[])}),[])}),[S]),P=(0,r.useMemo)((()=>O((null==t?void 0:t.attributes)||[])),[t,O]);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:E},classes:{root:C.dropDownInput}},components:{DropdownIndicator:b.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(h.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:v,menuPortalTarget:document.body}))}},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),p=n(31276);const d=(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=d(),g=(0,a.pipe)(p.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}}}}))}},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),p=n(94079),d=n(92575),m=n(96808),g=n(57941),f=n(59431),b=n(79692);function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){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 E={input:e=>h({},e,{fontSize:"14px"}),loadingMessage:e=>h({},e,{fontSize:"14px"}),menuPortal:e=>h({},e,{zIndex:1300})},v=(0,b.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 b=v(),h=e=>({value:e,label:e}),y=e=>e.map(h),x=(0,a.useSelector)(f.ZP.selectors.getTenant),w=(0,a.useSelector)(f.ZP.selectors.getServicesPath),S=(0,r.useRef)();return o().createElement("div",{className:u()(b.root,l)},o().createElement(p.Typography,{className:b.title,variant:"subtitle1"},i().text("User")),o().createElement(d.Z,{value:y(t),onChange:(0,s.pipe)((0,s.defaultTo)([]),(0,s.pluck)("value"),n),defaultOptions:!0,getOptions:e=>(S.current||(S.current=(0,g.kz_)({tenant:x,servicesPath:w})),S.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:b.dropDownInput},components:{DropdownIndicator:m.Z},styles:E,classes:b,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:()=>c,VV:()=>u,rx:()=>p,_V:()=>d,Xr:()=>m});var r=n(17440),o=n(87918),a=n.n(o),l=n(31537);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const s=(0,r.path)(["data","type"]),c=e=>{const{items:t,label:n}=e,[r]=t||[];return s(r)||n},u=(0,r.pipe)(c,(e=>(0,r.pipe)(r.values,(0,r.includes)(e))(l.I))),p=e=>(0,r.pipe)((0,r.propOr)([],"items"),(0,r.groupBy)(s),r.values,(0,r.ifElse)((e=>{let{length:t}=e;return t>1}),(0,r.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){i(e,t,n[t])}))}return e}({},e,{items:t,itemsTotal:t.length}))),(()=>[e])))(e),d=e=>(0,r.isNil)(e)?"":"string"==typeof e?e:Array.isArray(e)?e.map(d).join(", "):(0,r.is)(Object,e)?d("value"in e?e.value:Object.values(e)):e.toString(),m=e=>({[l.I.COMMENT_ADDED]:a().text("Comment added"),[l.I.COMMENT_DELETED]:a().text("Comment deleted"),[l.I.COMMENT_UPDATED]:a().text("Comment updated"),[l.I.ENTITIES_MERGED]:a().text("Profile merged"),[l.I.ENTITIES_MERGED_MANUALLY]:a().text("Profile merged manually"),[l.I.ENTITIES_MERGED_ON_THE_FLY]:a().text("Profile merged on the fly"),[l.I.ENTITIES_SPLITTED]:a().text("Profile un-merged"),[l.I.ENTITY_CHANGED]:a().text("Profile updated"),[l.I.ENTITY_CREATED]:a().text("Profile created"),[l.I.ENTITY_LOST_MERGE]:a().text("Profile lost merge"),[l.I.ENTITY_REMOVED]:a().text("Profile removed"),[l.I.GROUP_CHANGED]:a().text("Group updated"),[l.I.GROUP_CREATED]:a().text("Group created"),[l.I.GROUP_REMOVED]:a().text("Group removed"),[l.I.MODEL_UPDATED]:a().text("Model was updated"),[l.I.NOT_MATCHES_RESET]:a().text("Not matches reset"),[l.I.NOT_MATCHES_SET]:a().text("Not matches set"),[l.I.PERIODIC_TASK_SCHEDULED]:a().text("Periodic task was scheduled"),[l.I.POTENTIAL_MATCHES_FOUND]:a().text("Potential matches found"),[l.I.POTENTIAL_MATCHES_REMOVED]:a().text("Potential matches removed"),[l.I.RELATIONSHIP_CHANGED]:a().text("Relationship updated"),[l.I.RELATIONSHIP_CREATED]:a().text("Relationship created"),[l.I.RELATIONSHIP_REMOVED]:a().text("Relationship removed"),[l.I.USER_LOGIN]:a().text("Logged in"),[l.I.USER_LOGOUT]:a().text("Logged out"),[l.I.USER_PROFILE_VIEW]:a().text("Profile viewed"),[l.I.USER_SEARCH]:a().text("Searched"),[l.I.ANALYTICS_ATTRIBUTES_CHANGED]:a().text("Analytics attribute changed"),[l.I.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE]:a().text("SFDC connector synchronization issue")}[e]||"")},51843:(e,t,n)=>{n.d(t,{Z:()=>b});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(57941),p=n(94079),d=n(96808),m=n(37699);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"),b=e=>{let{values:t,onChange:n,onFocus:a}=e;const l=f,i=(0,r.useRef)(null),[b,h]=(0,r.useState)(!1),y=g(),E=(0,r.useCallback)((()=>{h((e=>!e)),a()}),[a]),v=()=>{h(!1)};return o().createElement("div",{className:y.root},o().createElement(p.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:E,variant:"filled",ref:i,InputProps:{endAdornment:o().createElement(d.Z,{selectProps:{classes:y,menuIsOpen:b},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(p.Menu,{variant:"menu",open:b,autoFocus:!1,classes:{paper:y.paper},anchorEl:i.current,onClose:v,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},elevation:2,getContentAnchorEl:null,MenuListProps:{autoFocusItem:b,style:{width:"100%"}}},o().createElement(m.Z,{values:t,onCancel:v,onApply:e=>{n(e),h(!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={}))},35198:(e,t,n)=>{n.d(t,{_:()=>Sa,t:()=>Ua});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),p=n(24605),d=n(39450),m=n(97094),g=n(60115),f=n(585),b=n(57941),h=n(87918),y=n.n(h),E=n(3096),v=n.n(E),x=n(59431),w=n(60641),S=n(7718),C=n(3515),O=n(17554),P=n(61756),N=n(57730),T=n(76536),I=n(26481),k=n(49759),D=n(94150),Z=n(26005),R=n(99136),A=n(30268),j=n(21077),L=n(67268),M=n(71153),U=n.n(M),H=n(8962);const _=o().createContext(null);_.displayName="SingleAttributeContext";var F=n(60995),V=n(10237),z=n(58662),B=n(94079),W=n(93416),G=n(75512),q=n(30553),Y=n(91181),$=n(32152),X=n(36444),Q=n(79692);const K=(0,Q.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"}}))),J=e=>{let{className:t}=e;const n=K(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(_),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(B.Button,{ref:a,classes:{root:U()(n.triggerButton,t)},onClick:u},o().createElement(X.Z,null)),o().createElement(B.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(B.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(B.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:y().text("Show inactive values")})))},ee=(0,Q.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"}}))),te=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=ee(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(_);return o().createElement(W.Z,{title:y().text(t),className:l.root},o().createElement(G.Z,{widthToHide:500},o().createElement(q.Z,{height:24,margin:16}),o().createElement(B.Typography,{className:l.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),o().createElement(Y.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),o().createElement($.i,{query:i,onChange:e=>{s(e),c(0)}}),a&&o().createElement(J,null))};var ne=n(65549),re=n(93140),oe=n(76134),ae=n(96698);const le=(0,Q.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"}}))),ie=b.nIW,se=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return se(n,t)})))):b.P6Y.strings.search(String(e),t),ce=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(b.XtP,(0,i.filter)((e=>{let{value:t}=e;return se(t,l)})))(t,n,r),c=(0,i.filter)(b.OXP,s);return{[(0,b.xy8)(r)]:{[ie(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function ue(){return ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ue.apply(this,arguments)}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){de(e,t,n[t])}))}return e}function de(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const me=[],ge=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s,noDataText:c}=e;const u=le(),{uri:p,required:m,cardinality:g,name:f}=n,h=(0,a.useDispatch)(),E=(0,r.useContext)(d.m),v=(0,a.useSelector)(x.ZP.selectors.getEntity),w=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,v.uri)||{})),S=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),C=(0,a.useSelector)((e=>(0,b.tQX)(l,n,x.ZP.selectors.getProfileErrors(e)))),O=(0,a.useSelector)(x.ZP.selectors.getMode),P=(0,b.xy8)(n),N=(0,i.pipe)((0,i.pathOr)(me,[P,f]),(0,i.map)((0,i.prop)("uri")))(v),T=(0,i.pathOr)(me,[P,f],w),I=T.map((0,i.prop)("uri")),k=(0,b.ZiX)(v.uri),D=(0,r.useRef)((0,b.gjI)({parentUri:l,attributeType:n})),Z=(0,b.O27)(T),R=m&&Z,A=R?[D.current]:T.filter((0,i.pipe)((0,i.prop)("uri"),b.ZiX)),j=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,h)(e.map((e=>pe({},e,{viewId:E}))))),[E,h]),L=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.modifyAttribute,h)(pe({},e,{viewId:E}))),[E,h]),M=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,h)(pe({},e,{viewId:E}))),[E,h]),H=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,h),[h]),_=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return j(R&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[j,l,n,R]),F=(0,b.Vg3)({attributeType:n,mode:O}),V={attributeType:n,errors:S,crosswalks:w.crosswalks,mode:O,onAddAttributes:j,onChangeAttribute:L,onDeactivateError:H,showNonOv:s},z=0===A.length&&0===t.length;return o().createElement("div",null,o().createElement(re.Z,{cardinality:g}),o().createElement(oe.Z,{message:C}),F&&o().createElement(B.Button,{color:"primary",onClick:_,className:u.moreButton},o().createElement(ne.Z,{classes:{root:u.icon}}),o().createElement("div",{className:u.buttonLabel},y().text("Add"))),A.map(((e,t)=>o().createElement(ae.Z,ue({key:e.uri},V,{attributeValue:e,lazy:R&&!m,showEmptyEditors:k,ownError:(0,b.ADq)(e,t,p,S),onDeleteAttribute:M})))),A.length>0&&t.length>0&&o().createElement(B.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)&&!I.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,b.vKJ)({valueTransformer:(0,i.unless)(b.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:U()({[u.ovFalse]:!(0,b.OXP)(n)})},o().createElement(ae.Z,ue({},V,{attributeValue:n,ownError:(0,b.ADq)(n,null,p,S),onDeleteAttribute:M,state:l})))})),z&&o().createElement(B.Typography,{className:u.noData},c))};var fe=n(81303);const be=e=>{let{values:t,attributeType:n,showInactive:r}=e;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(fe.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r}))))},he=(0,Q.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}}))),ye=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=he(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:b,showInactive:h}=(0,r.useContext)(_),E=(0,a.useSelector)(x.ZP.selectors.getEntityUri),v=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),S=(0,a.useSelector)(x.ZP.selectors.getPivotingAttributes),C=0!==u.length,O=t["text-empty"]||y().text("No data found");return o().createElement(F.J.Provider,{value:S},o().createElement(V.Z,{className:U()(c.root,n)},o().createElement(te,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s}),o().createElement(B.Box,{className:c.content},(()=>{if(g)return o().createElement(R.Z,null);if(b){if(v&&C){const e={values:u,attributeType:b,showInactive:h};return o().createElement(be,e)}if(w){const e={values:u,attributeType:b,parentUri:E,showInactive:h,noDataText:O};return o().createElement(ge,e)}}return o().createElement(B.Typography,{className:c.noData},O)})()),f&&o().createElement(z.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var Ee=n(67218),ve=n(20562);function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const we=(e,t,n)=>{const{attributeUri:o,max:l=15}=e,s=(0,a.useSelector)(x.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[p,d]=(0,r.useState)(null),[m,g]=(0,r.useState)(!1),f=(0,Ee._)(),h=(0,r.useRef)(null),y=(0,a.useDispatch)(),E=(0,a.useSelector)(x.ZP.selectors.getApiPath),v=(0,a.useSelector)(x.ZP.selectors.getTenant),w=n?x.ZP.selectors.getEntityWithDiff:x.ZP.selectors.getEntityWithoutDiff,S=(0,a.useSelector)(w),C=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),O=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),P=(0,a.useSelector)(x.ZP.selectors.getHistoryDiff),N=S.uri,T=ie(o),I=(0,b.xy8)(o);h.current=(0,b.JQy)(S,N,T);const k=(0,r.useMemo)((()=>(0,b.zeJ)(s,o)),[s,o]),{globalFilter:D}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:Z}=t,R=(0,r.useCallback)((()=>{if(k&&(0,b.Uty)(k)&&!(0,b.ZiX)(N)&&(0,b.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,b.biM)(S)||O?ce:b.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){xe(e,t,n[t])}))}return e}({metadata:s,entity:S,apiPath:E,tenant:v,parentUri:N,defaultMaxValues:l,attributeTypeUri:o,offset:l*e,globalFilter:D,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([I],e),n=(0,i.pathOr)([],[T],t);O||y(x.N5.actions.processNextPageOfAttributeValues({parentUri:N,attributeTypeUri:o,attributeTypeName:T,values:n})),u(n.map((e=>{var t;return(null===(t=h.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),d((0,i.path)(["paging",o],t))})).finally((()=>{g(!1)}))}else u([]),d(null)}),[E,N,v,o,l,s,t,D,k,O,P]);(0,r.useEffect)((()=>{R()}),[R]),(0,ve.D)((()=>{C&&R()}),[C]);const A=(0,i.partition)(b.OXP),[,j]=A(h.current||[]),L=Z?[]:j,M=Z?"totalValues":"totalOvValues",U=(0,i.ifElse)((0,i.has)(M),(0,i.prop)(M),(0,i.always)(c.length))(p),H=l<U,_=null!=p&&p.totalValues?p.totalValues-U:L.length;return{values:c,isLoading:m,hasPaging:H,totalVisibleValues:U,attributeType:k,totalNonVisibleValues:_,nonVisibleValues:L}};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 Ce=n(37152),Oe=n(31274),Pe=n(79026),Ne=n(8818),Te=n(90324),Ie=n(70595);const ke=o().createContext(null);ke.displayName="RelationsViewStateContext";const De=(0,Q.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=De(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(ke),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),h=!(0,b.O27)(d),E="asc"===s;return o().createElement(o().Fragment,null,o().createElement(B.Button,{ref:a,classes:{root:U()(n.button,t)},onClick:f},o().createElement(X.Z,null)),o().createElement(B.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(B.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(B.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),h&&o().createElement(o().Fragment,null,o().createElement(B.Divider,{className:n.divider}),o().createElement(B.Typography,{className:n.title,variant:"h6"},y().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Pe.Z,{entries:d,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:p,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),o().createElement(Ne.k,{tooltipTitle:E?y().text("Ascending"):y().text("Descending"),icon:E?Te.Z:Ie.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Ze.displayName="FilterButton";const Re=Ze,Ae=(0,Q.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 je=n(61932),Le=n(55847);const Me=o().createContext(null);function Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){He(e,t,n[t])}))}return e}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _e=Math.pow(2,31)-1,Fe=(0,Q.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 ze=e=>{let{label:t}=e;const n=Fe();return o().createElement(B.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(je.Z,null))},Be=()=>{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)(Me),i=(0,a.useSelector)(x.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(x.ZP.selectors.getDtssPath),m=(0,a.useSelector)(x.ZP.selectors.getTenant),g=[Ue({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:_e})],f=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,b.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,b.QXb)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Ue({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,d,m,o,t]),h=(0,r.useCallback)((()=>{(0,b.MOC)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))))),p(null)}),[i,d,m,o,f,l,u,p]);(0,r.useEffect)((()=>{f()}),[f]);const E=(0,r.useCallback)((()=>p(null)),[]),v=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:h,onCancelConfirmation:E,onImportClick:v}})(),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(Ne.k,{size:"L",icon:je.Z,tooltipTitle:y().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:U()(s.tenant)},u)):o().createElement(Le.Z,{menuId:"importDT-table-actions",buttonComponent:Ne.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>o().createElement(ze,{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})))},We=e=>{let{title:t,total:n}=e;const a=Ae(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(ke);return o().createElement(W.Z,{title:t||"",className:a.header},n>0&&o().createElement(G.Z,{widthToHide:400},o().createElement(q.Z,{height:24,margin:16}),o().createElement(B.Typography,{className:a.totalCaption,variant:"caption"},n>1?y().text("${count} items",{count:n}):y().text("${count} item",{count:n}))),o().createElement($.i,{query:l,onChange:i}),o().createElement(Be,null),o().createElement(Re,null))};var Ge=n(11013),qe=n(27604),Ye=n(22983),$e=n(31254),Xe=n(31039);const Qe=(0,Q.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 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 Je=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=Qe(),u=(0,Ee._)(),p=(0,a.useSelector)(x.ZP.selectors.getTenant),d=(0,a.useSelector)(x.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&(0,i.isNil)(f)){const e=(0,i.ifElse)(b.biM,(e=>(0,b.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,b.XkT)(e.entityUri)));g(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{g(!1)}))}}),[d,n,p,u,f]),E=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),m&&o().createElement(B.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),f&&o().createElement("div",{className:c.secondaryLabel},f));return o().createElement(B.Tooltip,Ke({onOpen:y,title:E,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},et=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,b.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,b.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,b.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,b.Lmx)(t,null==r?void 0:r.relationType)}};var tt=n(77277);const nt=(0,Q.Z)((()=>({container:{display:"flex"}})));function rt(){return rt=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},rt.apply(this,arguments)}const ot=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=nt();return o().createElement("div",{className:a.container},o().createElement(tt.Z,rt({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),o().createElement(tt.Z,rt({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},at=(0,Q.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"}}))),lt=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:a,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=at(),{entity:d,relation:m}=t,g=(0,b.$qe)(t),f=(0,b.xr3)(t),h=(0,b.iJH)(t),{entityType:E,entityLabel:v,preparedUri:x,relationLabel:w}=et(t,n),S=(0,b.Fn9)(m)&&(0,b.Fn9)(d),{canRemove:C,canUpdate:O}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===b.ARY.Editing||n===b.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,b.$qe)(r),i=(0,b.V3K)(t,e);return{canRemove:o&&!l&&(0,b.Edd)(n,i),canUpdate:a&&!l&&(0,b.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:b.ARY.Editing,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),P=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),N=(0,r.useCallback)((()=>i(t)),[i,t]),T=(0,r.useCallback)((()=>{s(t)}),[s,t]),I=(0,r.useCallback)((()=>c(t)),[c,t]),k=(C||O)&&a&&!t.suggested?o().createElement(o().Fragment,null,O&&o().createElement(Ne.k,{icon:qe.Z,size:"XS",onClick:N,tooltipTitle:y().text("Edit")}),C&&o().createElement(Ne.k,{icon:Ye.Z,size:"XS",onClick:P,tooltipTitle:y().text("Remove")})):void 0,D=t.suggested?o().createElement(ot,{acceptRelation:T,ignoreRelation:I,size:"small",disabled:h}):void 0,Z=h?y().text("ignored"):y().text("edited");return o().createElement("div",{className:U()(p.container,{[p.rowInactive]:!S},{[p.removed]:g||h})},o().createElement("div",{className:p.row},u&&u(),o().createElement($e.Z,{className:p.entityAvatar,entityType:E}),o().createElement(Xe.Z,{value:x,className:p.entityLabelContainer},o().createElement(Je,{label:v,entity:d},o().createElement("span",{className:p.entityLabel},v)),(f||h)&&o().createElement(B.Typography,{variant:"caption",className:p.editedLabel},"(",Z,")"),w&&o().createElement("span",{className:p.relationLabel},`, ${w}`)),o().createElement("div",{className:p.editButtonsContent},k),D))}));lt.displayName="EditableRelationItem";const it=lt,st=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:t,direction:e===b.Nsj.IN?b.Nsj.IN:b.Nsj.OUT})));return n(b.Nsj.IN,e).concat(n(b.Nsj.OUT,t))[0]};function ct(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ut=n(98989),pt=n(83543);const dt=(0,Q.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),mt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=dt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,b.xvW)(n)?null:a?o().createElement(pt.Z,c):o().createElement(ut.Z,c)},gt=(0,Q.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),ft=e=>{let{config:t,connection:n,children:l}=e;const i=gt(),{showInactive:s}=(0,r.useContext)(ke),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,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:p}=t,{entity:d}=n,m=(0,a.useSelector)((e=>x.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,d.entityUri)))||[],g=(0,a.useSelector)((e=>x.ZP.selectors.getTotalByViewId(e,t.id,d.entityUri))),{activityFilter:f}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions)||{},h=(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){ct(e,t,n[t])}))}return e}({},p,{returnObjects:!0,returnDates:!0,activeness:{relation:o||b.Ng6.ALL,entity:f}});u(!0),(0,b.N6e)(d.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(x.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:d.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,p,l,d.entityUri,f,o]),y=(0,r.useCallback)((()=>{i||n.connections||h(),s((e=>!e))}),[h,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:y,loadRelations:h,loading:c,total:g}})({config:t,connection:n,relationActivityFilter:s?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,b.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(mt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Oe.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(qt,{isLoading:m,config:t,loadRelations:d,connections:c,total:g,parentEntityUri:n.entity.entityUri}))))},bt=(0,Q.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"}}))),ht=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,a.useSelector)(x.ZP.selectors.getMetadata),d=(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))),h=(0,a.useDispatch)(),E=bt(),v=(0,r.useCallback)((()=>{const e=(0,b.vlo)({config:l,mode:s,metadata:p,parentEntityUri:u});(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),h)(e)}),[l,s,p,h,u]),w=(0,r.useCallback)((e=>{h(x.N5.relations.actions.closeRelationEditor(l.id,e)),h(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,b.ZiX)(r)&&h(x.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,h]),S=l.content,C=st(S.inRelations,S.outRelations),O=(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);h(x.N5.relations.actions.addRelation(l.id,t))}),[h,l,C]),P=(0,r.useCallback)((e=>{h(x.N5.relations.actions.ignoreRelation(l.id,{relationType:C.type,relationDirection:C.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[h,l,C]),[N,T]=(0,i.partition)(b.xvW,n),I=g&&f,k=0===N.length&&0===T.length,D=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,b.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(ft,{config:l,connection:e,key:c},(t=>r?o().createElement(Ge.Z,{connection:r,config:l,mode:s,metadata:p}):o().createElement(it,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),h),onAcceptRelation:O,onIgnoreRelation:P})))},Z=I&&(!d||d&&d.parentEntityUri===u),R=d&&d.parentEntityUri===u;return o().createElement("div",{className:t},Z&&o().createElement(B.Button,{color:"primary",onClick:v,className:E.moreButton},o().createElement(ne.Z,{classes:{root:E.icon}}),o().createElement("div",{className:E.buttonLabel},y().text("Add"))),R&&o().createElement(Ge.Z,{connection:d,config:l,mode:s,metadata:p}),N.map(D),N.length>0&&T.length>0&&o().createElement(B.Divider,{className:E.divider}),T.map(D),k&&o().createElement(B.Typography,{className:E.noData},c))};var yt=n(19603),Et=n(94646),vt=n(78101),xt=n(80931);const wt=(0,Q.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){Ct(e,t,n[t])}))}return e}function Ct(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ot=e=>{let{connection:t,className:n}=e;const l=wt(),{relation:s}=t,c=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(x.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,b.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),d=(0,r.useMemo)((()=>St({attributes:St({},x.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,b.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,b.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,b.O27)(t)})).length>0,g=(0,r.useMemo)((()=>(0,b.R$r)(d.attributes)),[d]),{getCommentsCount:f}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const h=(0,r.useMemo)((()=>(0,b.wp9)(b.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return m?o().createElement(vt.A.Provider,{value:h},o().createElement(xt.Z,{className:U()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:U()(l.attributesList,n)},y().text("No attributes"))};var Pt=n(86602),Nt=n(82726);const Tt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Ne.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?Pt.Z:Nt.Z,onClick:n})},It=(0,Q.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"}}))),kt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=It(),u=t.suggested,{entity:p,relation:d}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityType:h,entityLabel:y,preparedUri:E,relationLabel:v}=et(t,f),w=(0,b.Fn9)(d)&&(0,b.Fn9)(p),S=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),C=p&&d&&(0,b.wp9)(b.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:U()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:U()(c.row,yt.U)},n&&n(),o().createElement("div",{className:c.labelWrapper},o().createElement($e.Z,{className:c.entityAvatar,entityType:h}),o().createElement(Xe.Z,{value:E,className:c.entityLabelContainer},o().createElement(Je,{label:y,entity:p},o().createElement("span",{className:c.entityLabel},y)),v&&o().createElement("span",{className:c.relationLabel},`, ${v}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(C)&&o().createElement(Et.Z,{className:c.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:C,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(ot,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(Tt,{show:m,onToggle:()=>{g((e=>!e))},className:c.showDetails}))),m&&o().createElement(Ot,{connection:t}))}));kt.displayName="RelationItem";const Dt=kt;var Zt=n(52691),Rt=n(16208);const At=e=>e.filter((e=>5===e.value)).length,jt=e=>e.filter((e=>1===e.value)).length,Lt=e=>0===e.length?"0%":At(e)/e.length*100+"%",Mt=e=>0===e.length?"0%":jt(e)/e.length*100+"%",Ut=(0,Q.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)"}}))),Ht=e=>{let{ratings:t,className:n}=e;const r=Ut();return o().createElement("div",{className:U()(r.wrapper,n)},o().createElement(B.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:Lt(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Mt(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:U()(r.likesCount,r.count)},o().createElement(Zt.Z,{className:r.icon}),At(t)),o().createElement("div",{className:r.count},o().createElement(Rt.Z,{className:r.icon}),jt(t))))},_t=(0,Q.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=_t(),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(B.Button,{onClick:n,variant:"text",size:"small",className:U()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(Le.Z,{buttonProps:{endIcon:o().createElement(pt.Z,null),variant:"text",size:"small",className:U()(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,Q.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"}}))),zt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Vt(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:g,relation:f}=t,h=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityLabel:y,entityType:E,preparedUri:v,relationLabel:w}=et(t,h),S=(null==f?void 0:f.ratings)||[],C=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),O=g&&f&&(0,b.wp9)(b.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:U()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(B.Box,{display:"flex",minHeight:"44px",className:yt.U},o().createElement(B.Box,{display:"flex",alignItems:"center"},o().createElement(B.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement($e.Z,{entityType:E,className:u.entityTypeIcon})),o().createElement(B.Box,{display:"flex",flexDirection:"column"},o().createElement(Xe.Z,{value:v,className:u.entityLabelContainer},o().createElement(Je,{label:y,entity:g},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(Ft,{ratings:S,onAgree:()=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(O)&&o().createElement(Et.Z,{className:u.commentsContainer,uri:(0,b.gjS)(f),relatedObjectUris:O,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(ot,{acceptRelation:s(t),ignoreRelation:c(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(Ht,{ratings:S,className:u.ratings}),o().createElement(Tt,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(Ot,{connection:t,className:u.relationAttributes}))},Bt=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:s}=e;const{isComplex:c,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=st(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,b.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===b.Nsj.IN,u=c?a.entityUri:n,p=c?n:a.entityUri;(0,b.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))}}})(u,l,s),m=(0,r.useMemo)((()=>(0,b.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(ft,{config:i,connection:e,key:r},(t=>c?o().createElement(zt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Dt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Bt.displayName="RelationsList";const Wt=Bt,Gt=(0,Q.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),qt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=Gt(),{selectors:u}=x.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||y().text("No data found");return t?o().createElement(R.Z,null):(0,b.KIu)(d)?o().createElement(ht,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:s}):i>0?o().createElement(Wt,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(B.Typography,{className:c.noData},m)},Yt=(0,Q.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}}),$t=e=>{let{config:t,className:n}=e;const l=Yt(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(ke),{selectors:h}=x.ZP,y=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),E=(0,a.useSelector)(h.getEntity),v=(0,a.useSelector)((e=>h.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(h.getMode),S=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{f("")}),[null==E?void 0:E.uri]);const C=(0,r.useMemo)((()=>(e=>{const t=b.wSh.fromFalsy(e).map(b.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new b.MEy).addClause(t).build()})(g)),[g]),{isLoading:O,reload:P}=(0,Ce.a)({sorting:S,filter:C,page:s,rowsPerPage:u,config:t,entity:E,relationActivityFilter:m?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,b.Px$)(y)),[y]),T=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Oe.X.Provider,{value:N},o().createElement(V.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Me.Provider,{value:T},o().createElement(We,{title:t.caption,total:v})),o().createElement("div",{className:l.content},o().createElement(qt,{isLoading:O,config:t,loadRelations:P,connections:y,total:v}),v>u&&o().createElement(z.Z,{classes:{root:l.pagination},count:v,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};$t.displayName="RelationsView";const Xt=o().createContext(null);Xt.displayName="SingleAttributeContext";var Qt=n(86361),Kt=n(26180),Jt=n(31276);function en(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){tn(e,t,n[t])}))}return e}function tn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const nn="CHANGE_SEARCH_QUERY",rn=en({},Kt.ZP.actions,{changeSearchQuery:(0,Jt.zD)(nn)}),on=(e,t)=>t.type===nn?en({},e,{searchQuery:t.payload,page:0}):Kt.ZP.reducer(e,t);var an=n(92332),ln=n(67353);const sn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},cn=(0,Q.Z)((()=>({tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},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":sn}}))),un=(0,ln.Z)((e=>{const t=cn();return o().createElement("div",{className:t.headCell},o().createElement(an.default,e))}));var pn=n(64091);function dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mn=(0,i.pipe)((0,i.map)((e=>({id:(0,b.Tde)(e.uri),label:e.label,dataTypeDefinition:(0,b.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),gn=(0,i.pipe)(b.DK$,mn),fn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),bn=e=>{if((0,b.vZp)(e)){const t=fn(e);return t.length>1?t.slice(0,-1):null}return null},hn=(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){dn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:bn(e.id),headCellRenderer:un,rowCellValueRenderer:pn.Z})));var yn=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 vn=n(52016),xn=n(1876),wn=n(60894);const Sn=(0,Q.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Cn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=Sn();return o().createElement(W.Z,{title:t,className:u.header},o().createElement($.i,{query:n,onChange:r}),o().createElement(xn.Z,{enabled:a,onClick:l}),o().createElement(q.Z,{height:24,margin:4}),o().createElement(wn.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};function On(){return On=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},On.apply(this,arguments)}const Pn=(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=cn();return o().createElement("div",{className:U()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,On({key:t,value:e},l)))))}));var Nn=n(85709);const Tn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Ne.k,{tooltipTitle:y().text("Edit"),icon:qe.Z,size:"L",onClick:t}),n&&o().createElement(Ne.k,{tooltipTitle:y().text("Remove"),icon:Ye.Z,size:"L",onClick:n}))};function In(){return In=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},In.apply(this,arguments)}const kn=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:d,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,b.tT_)(e))(t))(fn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>hn(t)),[t]),y=cn(),E=(0,a.useSelector)(x.ZP.selectors.getMode),v=(0,b.KIu)(E),w=(0,a.useSelector)(x.ZP.selectors.getMetadata),S=(0,a.useSelector)(x.ZP.selectors.getEntityUri),C=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,S)||{})),{attributeType:O}=(0,r.useContext)(Xt),P=(0,r.useCallback)((e=>o().createElement(Pn,In({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,T]=(0,r.useState)(null),{canUpdate:I,canDelete:k}=(0,vn.l)(),D=(0,r.useMemo)((()=>"number"!=typeof N||!v||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,v]),Z="number"==typeof N&&(R=(0,i.path)([N],n),k(p)&&(0,b.xv5)({attributeType:O,mode:E,attributeValue:R,metadata:w,isReltioCrosswalk:(0,b.KVV)(C.crosswalks,R)}));var R;const A="number"==typeof N&&(e=>I(p)&&(0,b.yv0)({attributeType:O,mode:E,attributeValue:e,isReltioCrosswalk:(0,b.KVV)(C.crosswalks,e)}))((0,i.path)([N],n)),j=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);A&&d(e)}),[d,N,n,A]),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!Z)return;const t={parentUri:S,attributeType:O,uri:e.uri,value:e};m(t),T(null)}),[N,n,m,Z,O,S]),M=D||!Z&&!A?void 0:o().createElement(Tn,{onEdit:A?j:void 0,onRemove:Z?L:void 0}),U=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:y.tableContainer},o().createElement(Nn.Z,{columnsData:h,rowsData:f,sorting:l,onSort:s,filters:c,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:P,onRowHover:T,hoverRowIndex:N,hoveredRowRightContent:M,context:U,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Dn=(0,Q.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 Zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const p=Dn(),m=(0,a.useSelector)(x.ZP.selectors.getEntityUri),{attributeType:g}=(0,r.useContext)(Xt),f=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),h=(0,a.useSelector)(x.ZP.selectors.getMode),E=(0,a.useDispatch)(),v=(0,r.useContext)(d.m),w=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,E)(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){Zn(e,t,n[t])}))}return e}({},e,{viewId:v}))))),[v,E]),S=(0,b.ZiX)(m),C=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,m,g))),O=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,E),[E]);return o().createElement(o().Fragment,null,o().createElement(ae.Z,{expanded:!0,attributeValue:u,showEmptyEditors:S,onDeleteAttribute:s,onDeactivateError:O,onChangeAttribute:t,onAddAttributes:w,mode:h,crosswalks:f.crosswalks,errors:C,attributeType:g,ownError:(0,b.ADq)(u,null,g.uri,C)}),o().createElement("div",{className:p.actionButtons},o().createElement(B.Button,{onClick:()=>{n(u)}},y().text("Cancel")),o().createElement(B.Button,{color:"primary",disabled:!c,onClick:()=>{l(u)}},y().text("Apply"))))},An=(0,Q.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 jn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ln(e,t,n[t])}))}return e}function Ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Mn=[],Un=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=An(),{values:u,page:p,setPage:m,isLoading:g,searchQuery:f,setSearchQuery:h,visibleColumns:E,onFilter:v,onSort:w,onToggleFilters:S,onChangeColumns:C,filters:O,sorting:P,totalVisibleValues:N,hasPaging:T,attributeType:I,showTable:k}=(0,r.useContext)(Xt),D=(0,r.useMemo)((()=>gn(I)),[I]),{checkHasChanges:Z,onChangeAttribute:A,onDeleteAttribute:j,onAdd:L,onCancel:M,onApply:H,onStartEditing:_,modifiedValues:F,editingValues:G,deletedUris:q}=(()=>{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)(d.m),{attributeType:u,values:p}=(0,r.useContext)(Xt),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)(jn({},e,{viewId:c}))}),[c,s]),h=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(jn({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:m,attributeType:u});t(e.uri),f(jn({},e,{value:(0,b.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:g}),attributeType:u}))}),[m,u]),E=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),v=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=jn({},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),h(n)}}),[h,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]),S=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),C=(0,b.KIu)(l),O=(0,b.xy8)(u),P=(0,i.pathOr)(Mn,[O,null==u?void 0:u.name],S),N=(0,r.useMemo)((()=>[...P.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(b.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>P.find((0,i.propEq)("uri",e.uri))||e))(p)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[P,n,e,p]),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)))))(p):[]),[P,p]),I=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:h,onAdd:y,onCancel:v,onApply:w,onStartEditing:E,modifiedValues:N,editingValues:I,deletedUris:T}})(),Y=(0,a.useSelector)(x.ZP.selectors.getMode),$=(0,b.KIu)(Y),X=$?F:u,{canCreate:Q}=(0,vn.l)(),K=Q(t)&&I&&(0,b.Vg3)({attributeType:I,mode:Y})&&!G.length,J=(0,r.useMemo)((()=>E.map((e=>D.find((0,i.propEq)("id",e))))),[E,D]);return o().createElement(V.Z,{className:U()(c.root,n)},k?o().createElement(o().Fragment,null,o().createElement(Cn,{title:l,total:N,columnsData:D,selectedColumns:E,onChangeColumns:C,searchQuery:f,onChangeSearchQuery:h,filtersEnabled:!!O,onToggleFilters:S}),o().createElement("div",{style:{position:"relative"}},$&&o().createElement("div",{className:c.editor},K&&o().createElement(B.Button,{color:"primary",onClick:L,className:c.addButton},o().createElement(ne.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},y().text("Add"))),G.map((e=>o().createElement(Rn,{key:e.uri,attributeValue:e,onChangeAttribute:A,onDeleteAttribute:j,onCancel:M,onApply:H,hasChanges:Z(e)})))),o().createElement(kn,{columnsData:J,config:t,values:X,filters:O,onFilter:v,sorting:P,onSort:w,onEdit:_,onDeleteAttribute:j,deletedUris:q}),T&&o().createElement(z.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:s,page:p,onChangePage:m}),g&&o().createElement(R.Z,null))):o().createElement(o().Fragment,null,o().createElement(W.Z,{title:l,className:c.header}),o().createElement(B.Typography,{className:c.noData},y().text("No data"))))};var Hn=n(58600);function _n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Fn=0;const Vn=()=>Fn++,zn=e=>{const t={children:[],nodeId:Vn()};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:Vn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),o.children.push(s),o=s}}return t.children},Bn=(0,Q.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.secondary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.secondary.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 Wn=n(1242);const Gn=o().createContext(null);var qn=n(55400);const Yn=e=>{e.target.src=Wn},$n=e=>{let{node:t}=e;const n=Bn(),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)(Gn),p=(0,a.useSelector)(x.ZP.selectors.getUIPath),{uri:d}=(0,a.useSelector)(x.ZP.selectors.getEntity),m=(0,b.ChB)({uiPath:p,uri:i}),g=i===d,f=(0,r.useCallback)((()=>{l(x.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:h},nodeId:y}=t,E=(0,b.nt9)(c,t.entity.type)||{},v=(0,b.VD3)(c,E,"typeGraphIcon"),w=v&&(0,b.vPL)(s,v);return o().createElement("div",{className:n.wrapper,"data-node-id":y},o().createElement("div",{className:n.container},o().createElement(B.Avatar,{className:U()(n.avatar),src:w||Wn,onError:Yn}),o().createElement("span",{className:U()(n.link,{[n.selected]:g})},o().createElement(qn.Z,{to:m,onClick:f},h))))},Xn=((0,r.memo)($n),e=>{let{node:t}=e;return t.nodeId}),Qn=(0,Q.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 Kn(){return Kn=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},Kn.apply(this,arguments)}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}function er(){return er=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},er.apply(this,arguments)}const tr={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,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),d=l,m=r&&!a.root&&a.children&&a.children.length>0,g=Qn();return o().createElement("div",er({style:{height:"100%"}},p,{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:U()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:s,treeIndex:c}):d))))},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=Qn(),u=a.length,p=[];a.forEach(((e,t)=>{p.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 d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,b=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}({},s.style,{width:f});return o().createElement("div",Kn({},s,{className:c.node,style:b}),p,o().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function nr(){return nr=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},nr.apply(this,arguments)}const rr=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",nr({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"})))},or=e=>{let{title:t,onGraphOpen:n}=e;const r=Bn();return o().createElement(W.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Ne.k,{className:r.button,tooltipTitle:y().text("Show Graph"),icon:rr,onClick:n,size:"L"})))};var ar=n(33165);const lr=(0,Q.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function ir(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){sr(e,t,n[t])}))}return e}function sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cr=n(14940);const ur=(0,Q.Z)({resizableHandleContainer:{position:"relative",width:"100%",height:"inherit"},resizableHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $resizableHandle":{visibility:"visible"},".react-grid-item.static &:hover $resizableHandle":{visibility:"hidden"}},resizableHandle:{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)"}}),pr=e=>{const t=t=>{const n=ur();return o().createElement("div",{className:n.resizableHandleContainer},o().createElement("div",{className:n.resizableHandleVisibilityArea},o().createElement("div",{className:U()("viewDraggableHandle",n.resizableHandle)},o().createElement(cr.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithResizableHandle",t},dr=(0,Q.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var mr=n(29103),gr=n(83911),fr=n(48747),br=n(22385);const hr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),yr=(0,Q.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Er=n(13074),vr=n(24338);const xr=(0,Q.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),wr=xr,Sr=e=>{let{totalImages:t}=e;const n=wr(),r=t>1?y().text("photos"):y().text("photo");return o().createElement(B.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Cr(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){Or(e,t,n[t])}))}return e}function Or(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pr=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)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(vr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(Cr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(x.N5.actions.modifyAttribute,s)(Cr({},e,{viewId:d})),imageSize:Ir,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Sr,{totalImages:p.length}))},Nr=(0,Q.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Tr=Nr,Ir={imageMargin:4,imageWidth:162,imageHeight:162};var kr=n(28741);const Dr=(0,Q.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 Zr=n(49734),Rr=n(98808),Ar=n(93428),jr=n(30885);function Lr(){return Lr=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},Lr.apply(this,arguments)}const Mr=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:p,canMark:m}=(0,b.hXd)(c,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:Rr.N.iconButton,onStartRequest:l},h=(0,r.useContext)(d.m),y=(0,r.useCallback)((()=>{i(),s(x.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[s,u.uri,i,h]);return o().createElement(o().Fragment,null,p&&o().createElement(Ar.H,Lr({},f,{onFinishRequest:y})),m&&o().createElement(jr.i,Lr({},f,{onFinishRequest:i})))},Ur=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(Zr.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:yt.U},o().createElement(Et.Z,{uri:(0,b.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,b.wp9)(b.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:b.q7e.POTENTIAL_MATCH}),o().createElement(Mr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Hr={showTransitiveMatches:!0,showInactiveEntities:!1},_r={order:"asc",field:"score"};var Fr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Fr||(Fr={}));const Vr=pr((e=>{let{className:t}=e;const n=dr();return o().createElement(V.Z,{className:U()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),zr=pr((e=>{let{className:t,config:n}=e;return o().createElement(H.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Br=pr((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=we(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(_.Provider,{value:a},o().createElement(ye,{config:n,className:t}))})),Wr=pr((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,b.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>gn(l)),[l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),b.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(on,c),{searchQuery:d,filters:m,sorting:g,page:f}=u,h=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>b.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,yn.su)(o,r)})))).orSome([]))(s,m);return e.length?e:null}),[m,s]),E=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:f,sorting:g,searchQuery:d})),[y,f,g,d]),{changeSearchQuery:v,changePage:w,toggleSort:S,changeFilter:C,toggleFilters:O,changeColumns:P}=(0,Qt.o)({actions:rn,dispatch:p}),N=we(e,E,!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:v,setPage:w,onSort:S,onFilter:C,onToggleFilters:O,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||d||h)&&l&&!l.hidden)},N)})(t);return o().createElement(Xt.Provider,{value:l},t&&o().createElement(Un,{config:t,className:n}))})),Gr=pr((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=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),[p,d]=(0,r.useState)(""),[m,g]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{l(0),g((e=>!e))}),[]),b=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),h=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:p,changeSearchQuery:(0,r.useCallback)((e=>{l(0),d(e)}),[]),sortOrder:i,toggleSortOrder:b,sortOption:c,changeSortOption:h,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:m,toggleShowInactive:f}})(t);return o().createElement(ke.Provider,{value:a},o().createElement($t,{config:t,className:n}))})),qr=pr((e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),{height:l,width:s,tooltip:c}=t,{html:u,visible:p,tooltip:d,customStyles:m}=(0,ar.E)(t),g=lr(),f=d||c;(0,r.useEffect)((()=>{a.current&&u&&(a.current.innerHTML="",u.childNodes.forEach((e=>{a.current.appendChild(e)})))}),[u]);const b=(0,i.reject)(i.isNil,{width:s,height:l});return p?o().createElement("div",{className:g.bodyWrapper},o().createElement(B.Tooltip,{title:f||""},o().createElement("div",{ref:a,style:ir({},b,m),className:U()(g.root,n)}))):null})),Yr=pr((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,Ee._)(),[o,l]=(0,r.useState)([]),s=(0,a.useSelector)(x.ZP.selectors.getEntity);return(0,ve.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){_n(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.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,b.ZiX)(e)||n((0,b.RFJ)({uri:e,graphUri:t})).then(zn).then(l).catch((e=>{console.warn(e)})),()=>{l([])})),[e,t,n]),{treeData:o,setTreeData:l}})(l,t.graph.type),u=Bn(),p=(0,a.useDispatch)(),{id:d,graph:m}=t,g=(0,r.useCallback)((()=>{p(x.ui.actions.openGraph({viewId:d,graphType:m.type}))}),[p,d,m]),f=(0,r.useCallback)((e=>({title:o().createElement($n,{node:e.node})})),[]);return o().createElement(V.Z,{className:n},o().createElement(or,{onGraphOpen:g,title:t.caption}),o().createElement(Gn.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:tr,generateNodeProps:f,onChange:c,getNodeKey:Xn})))))})),$r=pr((e=>{let{config:t,className:n}=e;const l=Dr(),s=(0,a.useSelector)(x.ZP.selectors.getEntity),c=(0,b.wwR)(s),[u,p]=(0,r.useState)(!1),m=(0,r.useCallback)((()=>{p(!0)}),[]),g=(0,r.useCallback)((()=>{p(!1)}),[]),{matches:f,entitiesMap:h,loadMatches:E,total:v}=(0,kr.s)({enabled:!!c,entity:s,options:Hr,filter:"",page:0,sorting:_r,rowsPerPage:3,onStartLoading:m,onFinishLoading:g}),w=(0,r.useCallback)((()=>{E()}),[E]),S=(0,a.useDispatch)(),O=(0,r.useContext)(d.m),P=(0,r.useCallback)((()=>{S(x.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:O}))}),[S,O]),N=(0,r.useMemo)((()=>(0,b.NVY)(c,(0,i.map)(b.ev7,f))),[c,f]),{getCommentsCount:T}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{T(N)}),[T,N]);const I=v>3&&!(0,i.isEmpty)(f),k=u?Fr.Loading:(0,i.isEmpty)(f)?Fr.NoData:Fr.Loaded;return o().createElement(Oe.X.Provider,{value:h},o().createElement(V.Z,{className:U()(l.root,n)},o().createElement(W.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},k===Fr.Loading&&o().createElement(R.Z,null),k===Fr.NoData&&o().createElement(B.Typography,{className:l.noData},y().text("No matches found")),k===Fr.Loaded&&f.map((e=>o().createElement(Ur,{config:t,entitiesMap:h,match:e,onFinishRequest:w,onStartRequest:m,key:e.object.uri})))),I&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(B.Link,{component:"button",variant:"caption",onClick:P,underline:"none"},y().text("See all"))))))})),Xr=(0,r.lazy)((()=>n.e(6596).then(n.bind(n,46596)).then((e=>({default:pr(e.HierarchyTreeView)}))))),Qr=(0,r.lazy)((()=>n.e(4361).then(n.bind(n,14361)).then((e=>({default:pr(e.RelationshipsTableView)}))))),Kr=pr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=yr(),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,a.useSelector)(x.ZP.selectors.getEntity),p=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,Ee._)();return(0,r.useEffect)((()=>{i(!0),s((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(hr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,p),g=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(R.Z,null))),[s]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(V.Z,{className:U()(s.root,i)},m&&o().createElement(R.Z,null),o().createElement(br.Z,{size:"S",icon:n?gr.Z:mr.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(fr.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:d,mapContainerClassName:s.fullHeight,mapKey:p,mapOptions:h}))})),Jr=pr((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Tr(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(x.ZP.selectors.getMode),p=(0,a.useSelector)(x.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(x.ZP.selectors.getMetadata),m=(0,b.zeJ)(d,l),g=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],p),f=(0,i.path)(["attributes","paging",l],p),h=g.length,E=t["text-empty"]||y().text("No data found"),v=(0,r.useCallback)((e=>c(x.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(V.Z,{className:n},o().createElement(W.Z,{title:t.caption}),o().createElement("div",{className:s.container},(()=>{if(m){if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:f,requestNextPageOfAttributeValues:v};return o().createElement(Pr,e)}if(h>0){const e={attributeValues:g,attributeType:m,imageSize:Ir,paging:f,parentUri:p.uri,requestNextPageOfAttributeValues:v};return o().createElement(o().Fragment,null,o().createElement(Er.Z,e),o().createElement(Sr,{totalImages:h}))}}return o().createElement(B.Typography,{className:s.noData},E)})()))}));class eo{}eo.ViewTypes=b.ZIY,eo.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case eo.ViewTypes.HierarchyTree:return o().createElement(Xr,{config:r,store:n,className:a});case eo.ViewTypes.HierarchyPaths:return o().createElement(Yr,{config:r,className:a});case eo.ViewTypes.RelationsTable:return o().createElement(Qr,{config:r,store:n,className:a});case eo.ViewTypes.Relations:return o().createElement(Gr,{config:r,className:a});case eo.ViewTypes.Attributes:return o().createElement(zr,{className:a,config:r});case eo.ViewTypes.SingleAttributeView:return o().createElement(Br,{config:r,className:a});case eo.ViewTypes.TableAttributeView:return o().createElement(Wr,{config:r,className:a});case eo.ViewTypes.MapView:return o().createElement(Kr,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case eo.ViewTypes.CustomView:return o().createElement(qr,{config:r,className:a});case eo.ViewTypes.ImageAttributeView:return o().createElement(Jr,{config:r,className:a});case eo.ViewTypes.PotentialMatchesView:return o().createElement($r,{config:r,className:a})}},eo.getComponent=e=>eo.getComponentBy("class",e)||eo.getComponentBy("react-class",e)||o().createElement(Vr,{className:e.className});const to=eo,no=()=>null,ro=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=dr();return o().createElement(r.Suspense,{fallback:o().createElement(no,null)},to.getComponent({config:t,store:n,className:U()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));ro.displayName="ViewComponent";const oo=(0,Q.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function ao(){return ao=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},ao.apply(this,arguments)}const lo=["onConfigChanged","onRemove"],io=e=>{var t;let{layoutItemConfig:n,views:l,className:s,children:c,style:u,isFullscreen:p,onToggleFullscreen:d,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})),h=oo(),y=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{store:E}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const v=f.class===to.ViewTypes.CustomView;return v&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===b.X1H.CLASSIC?null:f.class!==to.ViewTypes.MapView||y?o().createElement("div",ao({},(0,i.omit)(lo,g),{style:u,className:U()(s,{[h.item]:!v})}),o().createElement("div",{className:U()({[h.fixedSizeContainer]:!m})},m,o().createElement(ro,{store:E,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),c):null},so=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(L.Z,{LayoutItem:io,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var co=n(72753),uo=n(43576),po=n(57304),mo=n(3409),go=n(93873),fo=n(22860);function bo(){return bo=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},bo.apply(this,arguments)}const ho=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",bo({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 yo(){return yo=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},yo.apply(this,arguments)}const Eo=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",yo({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"})))},vo=(0,Q.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 xo(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){wo(e,t,n[t])}))}return e}function wo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const So=e=>o().createElement(B.SvgIcon,e,o().createElement(ho,null)),Co=e=>o().createElement(B.SvgIcon,e,o().createElement(Eo,null)),Oo=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,b.KIu)(a))&&!!(r&&o||!(0,b.fnZ)(a))&&(0,b.uGe)(l,t)})),Po=e=>{let{className:t,profileBandConfig:n}=e;const l=vo(),s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getCanUserStartProcessFromQuery),u=(0,a.useSelector)(x.ZP.selectors.getEntityWithoutDiff),p=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,u.uri))),d=(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),h=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),E=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),v=(0,a.useSelector)(x.ZP.selectors.getProfileOperation),w=null==u?void 0:u.type,S=(0,r.useMemo)((()=>(0,b.nt9)(d,w)),[w,d]),C=v===b.OXy.Saving,O=v===b.OXy.Cloning||C,[P,N]=(0,r.useState)(!1),T=(0,r.useCallback)((()=>{N(!1)}),[]),I=(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,p=(0,r.useCallback)((0,b.Ian)(l,c),[l,c]),d=(0,b.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)(d),(0,i.propOr)([],"attributes"),(0,i.filter)(b.YkG),(0,i.map)(b.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(p))],[i.T,i.identity]]))(m);s(x.N5.entity.actions.entityCloneRequested({data:xo({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,d,u,o.uri,p]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:T}),k=(0,r.useMemo)((()=>[{label:y().text("Editing"),value:b.fO_.EDITING,description:y().text("Edit profile directly"),icon:uo.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:b.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:So,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:b.fO_.VIEWING,description:y().text("Suggest changes and initiate a workflow review"),icon:co.Z,permission:"READ"}]),[]),D=(0,r.useMemo)((()=>[...I?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:Co,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:Ye.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,I]),Z=!E&&!(0,b.biM)(u)&&!(e=>(0,b.uGe)(b.BDP.READ,e)&&!(0,b.uGe)(b.BDP.UPDATE,e)&&!(0,b.uGe)(b.BDP.DELETE,e)&&!(0,b.uGe)(b.BDP.INITIATE_CHANGE_REQUEST,e))(S),R=(0,b.ZiX)(null==u?void 0:u.uri),A=(0,r.useMemo)((()=>Oo(k,S,R,m,c)),[k,S,m,c,R]),j=(0,r.useMemo)((()=>Oo(D,S,R,m,c)),[D,S,m,c,R]),L=(0,r.useCallback)((e=>{s(x.N5.mode.actions.modeUpdated(e))}),[s]),M=(0,r.useCallback)((()=>{s(x.N5.mode.actions.modeCancelEditing())}),[s]),H=(0,r.useCallback)((()=>{s(x.N5.actions.saveProfile())}),[s]);return o().createElement(o().Fragment,null,o().createElement(po.Z,{className:U()(t,yt.U),entity:f&&p?p:u,showEntityId:null==n?void 0:n.showEntityId},o().createElement(B.Box,{display:"flex",alignItems:"center"},o().createElement(B.Box,{mr:3},f&&o().createElement(B.Box,{className:l.editingButtons},o().createElement(B.Button,{variant:"outlined",onClick:M,"data-reltio-id":"reltio-profile-cancel-editing",disabled:O},y().text("Cancel")),o().createElement(B.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:H,disabled:O},(0,b.fnZ)(g)?y().text("Suggest"):y().text("Save"))),E&&h?o().createElement(mo.Z,null):h&&o().createElement(go.a,null)),Z&&o().createElement(fo.T,{optionsGroup:A,buttonsGroup:j,value:g,onChange:L,disabled:O})),o().createElement(B.Box,{className:l.comments},o().createElement(Et.Z,{uri:u.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:u.uri}),objectType:b.q7e.ENTITY}))),!!I&&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:I,onDiscard:T,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))};var No=n(71820),To=n(85890),Io=n(26789),ko=n(54362),Do=n(6674),Zo=n(91515),Ro=n(52043),Ao=n(17308),jo=n(39827),Lo=n(80147),Mo=n(76569);const Uo=(0,Q.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),Ho=()=>{const{total:e}=(0,r.useContext)(D.O),t=Uo();return o().createElement(B.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Mo.Z,null))};var _o=n(26313),Fo=n(9371),Vo=n(4426);const zo=(0,Q.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Bo=()=>{const e=zo(),{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,_o.Q)(n);return o().createElement(Oe.X.Provider,{value:s},o().createElement(B.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(Fo.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(B.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(Vo.Z,{className:e.showMoreIcon}),y().text("Show more"))))};var Wo=n(34120);const Go=(0,Q.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),qo=()=>{const e=Go(),{tasks:t,loading:n}=(0,r.useContext)(D.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(R.Z,null),t&&t.map((e=>o().createElement(Wo.s,{key:e.taskId,task:e}))))};function Yo(){return Yo=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},Yo.apply(this,arguments)}const $o=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Yo({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"})))))},Xo=()=>{const{commentsMap:e}=(0,r.useContext)(C.h),t=Uo();return o().createElement(B.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement($o,null))};var Qo=n(10159);const Ko=()=>o().createElement(Qo.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.")}),Jo=()=>o().createElement(Qo.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 ea(){return ea=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},ea.apply(this,arguments)}let ta;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History"}(ta||(ta={}));const na=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},ra=()=>{var e,t,n;const l=Uo(),s=(0,a.useSelector)(x.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(x.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(x.ZP.selectors.isCollaborationSideViewEnabled),p=(0,a.useSelector)(x.ZP.selectors.isCollaborationEnabled),d=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent),m=(0,a.useSelector)(x.ZP.selectors.getMetadata),g=(0,a.useSelector)(x.ZP.selectors.getEntity),f=(0,r.useContext)(D.O),h=(0,r.useContext)(C.h),[E,v]=(0,r.useState)(null),w=(0,r.useCallback)((e=>{v((t=>t===e?null:e))}),[]),S=(0,r.useCallback)((()=>{v(null)}),[]),O=null!==E,P=E===ta.History,{isHistoryEnabled:N,isProfilePersisted:T}=(0,No.C)({isHistoryTabActive:P,entity:g}),{historyFilter:I,onApplyFilter:k,isLoading:Z,historicUris:R,historyWithTotal:A,canLoadMore:j,onLoadMore:L}=(0,To.k6)({entity:g,enabled:N}),M=s&&c&&!(0,b.ZiX)(null==g?void 0:g.uri),U=u&&p,H=(0,b.mdt)(null==h?void 0:h.commentsMap),_=[{buttonProps:{id:ta.Workflow,icon:Ho,tooltipTitle:y().text("Workflow")},content:null!=f&&f.total?o().createElement(qo,null):o().createElement(Ko,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:na(null==f?void 0:f.total),rightContent:o().createElement(Io.G,null)},hidden:!M},{buttonProps:{id:ta.Collaboration,icon:Xo,tooltipTitle:y().text("Collaboration")},content:H?o().createElement(Bo,null):o().createElement(Jo,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:na(H)},hidden:!U},{buttonProps:{id:ta.History,icon:Lo.Z,tooltipTitle:y().text("History")},content:T?o().createElement(ko.Z,{isLoading:Z,historyWithTotal:A,contributorsUris:R,entityUri:null==g?void 0:g.uri,historyEvent:d,onLoadMore:L,canLoadMore:j}):o().createElement(Do.Z,null),headerProps:{content:o().createElement(Zo.Z,{total:T?((null==R?void 0:R.length)||0)+1:void 0,entityType:(0,b.nt9)(m,null==g?void 0:g.type),filter:I,onApplyFilter:k})}}],F=(0,i.reject)((0,i.propEq)("hidden",!0))(_);return(0,r.useEffect)((()=>{var e;null!==(e=_[E])&&void 0!==e&&e.hidden&&S()}),[E,_,S,F]),o().createElement("div",{className:l.wrapper},o().createElement(Ro.h,{open:O,width:480},!(null!==(e=_[E])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(Ao.P,ea({},null===(t=_[E])||void 0===t?void 0:t.headerProps,{onClose:S})),null===(n=_[E])||void 0===n?void 0:n.content)),o().createElement(jo.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(_),onButtonClick:w,activeIndexId:E}))};var oa=n(39781),aa=n(16715);const la="48px",ia="1px solid rgba(0, 0, 0, .125)",sa=(0,Q.Z)((e=>({accordion:{borderTop:ia,borderBottom:ia,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:la,minHeight:la,"&$accordionSummaryExpanded":{height:la,minHeight:la}},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},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"}}))),ca=sa;var ua=n(38016);const pa=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=ca();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(B.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(B.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(ua.Z,null)},i,o().createElement(B.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(B.AccordionDetails,{className:U()(l.accordionDetails,p)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));pa.displayName="ErrorsPanel";const da=(0,i.omit)(["deactivated","path"]),ma=(0,r.memo)((e=>{let{error:t}=e;const n=ca(),r=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===b.NIO.missed&&r===b.zHr.local){const t=l||(0,b.zeJ)(e,a);return t?y().text("${attribute} is required",{attribute:t.label}):o}return o})((0,a.useSelector)(x.ZP.selectors.getMetadata),t),l=(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[b.HAc.attributeValue,b.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t);return o().createElement("li",null,o().createElement("span",null,r),l&&o().createElement(o().Fragment,null,o().createElement("br",null),o().createElement("span",{className:n.parents},l)))}));ma.displayName="Error";const ga=()=>{const e=ca(),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(da),t.map(da))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(x.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(b.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(oa.Z,{className:U()(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(aa.Z,{className:U()(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 p=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(pa,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:ma}):null},fa=(0,Q.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"}})));var ba=n(87685);const ha=(0,Q.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),ya=e=>{let{notification:t}=e;const n=ha({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(x.ZP.selectors.getAutoCloseInterval),s=t.autoHideDuration||i&&1e3*i||5e3,[c,u]=(0,r.useState)(),[p,d]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(x.ui.actions.closeNotification(t.id)),d(!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]),b=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(B.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),d(!1)}},e.label)))),h=o().createElement(o().Fragment,null,o().createElement(br.Z,{className:n.closeIcon,size:"S",icon:ba.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(B.Portal,{container:document.body},o().createElement(B.Snackbar,{autoHideDuration:s,open:p,classes:{root:n.snackbar},action:b,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:h})),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")}))},Ea=()=>{const e=(0,a.useSelector)(x.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(ya,{key:e.id,notification:e})))):null},va={},xa=(0,r.memo)((e=>{let{config:t,saveState:n,getSavedState:l}=e;const i=fa({maxWidth:null==t?void 0:t.maxWidth}),s=(0,a.useDispatch)(),c=(0,r.useCallback)((()=>l().then((e=>e.layout?{}:e))),[l]),u=(0,r.useRef)(),p=(0,r.useCallback)((0,b.DsO)(n,1e3),[n]),d=(0,a.useSelector)(x.ZP.selectors.getEntity),m=d?d.type:null,{isLoaded:g,savedState:f=va,updateSavedState:h}=(0,w.w)({getSavedState:c,saveState:p,entityTypeUri:m}),[E,L]=(0,r.useState)([]),[M,U]=(0,r.useState)([]),H=(0,r.useMemo)((()=>v()(t)),[t]),_=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),F=(0,r.useMemo)((()=>(0,b.dvH)(d)),[d]),V=(0,S.C)({objectIds:F}),z=(0,r.useContext)(C.h),B=(0,O.U)(),W=(0,P.v)(null==t?void 0:t.workflow),G=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent);(0,N.a)({entity:d,historyEvent:G});const q=(0,T.u)();(0,r.useEffect)((()=>{if(g){const e=H!==f.configHash,{views:n,layout:r}=(0,b.Mfk)({views:e||!f.views?t.views:f.views,layout:e?t.layout:f.layout});U(n),L(r)}}),[g,f,m]),(0,r.useEffect)((()=>{s(x.N5.views.actions.profileViewsSet(M))}),[s,M]),(0,r.useEffect)((()=>{t.sidePanelViews&&s(x.N5.sidePanelViews.actions.sidePanelViewsLoaded(t.sidePanelViews))}),[t]),(0,r.useEffect)((()=>{u.current&&(u.current.scrollTop=0)}),[null==d?void 0:d.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,b.biM)(n),s=(0,a.useSelector)(x.ZP.selectors.getMode),c=(0,a.useSelector)(x.ZP.selectors.getProfileViews),u=c&&c.length>0,p=(0,r.useCallback)((0,b.DsO)((t=>{t&&e(x.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,b.ZiX)(o)&&s===b.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,s,u])})();const Y=(0,r.useCallback)((e=>{h({layout:e,views:M,configHash:H}),L(e)}),[h,H,M]),$=u.current,X=(0,r.useMemo)((()=>({element:$,priority:["top","bottom"]})),[$]);return o().createElement(I.j.Provider,{value:!0},o().createElement(k.s.Provider,{value:B},o().createElement(C.h.Provider,{value:_?z:V},o().createElement(D.O.Provider,{value:W},o().createElement(Z.m.Provider,{value:q},o().createElement("div",{className:i.perspectiveView},(!g||!(null!=d&&d.uri))&&o().createElement(R.Z,null),g&&null!=d&&d.uri?o().createElement("div",{className:i.profileContainer},o().createElement("div",{className:i.profileWrapper},o().createElement(Po,{profileBandConfig:t.profileBand}),!_&&o().createElement(ga,null),o().createElement("div",{ref:u,className:i.scrollWrapper},o().createElement(A.p.Provider,{value:X},o().createElement(so,{layout:E,onLayoutChanged:Y,views:M})))),o().createElement(ra,null)):o().createElement("div",{className:i.emptyState},o().createElement(j.ZP,{LogoRenderer:j.B9.NO_DATA,text:y().text("No data to display."),variant:j.tC.embedded})),o().createElement(Ea,null)))))))}));xa.displayName="ProfilePerspectiveView";const wa=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),Sa=e=>{let{config:t,store:n,onResize:h=i.identity,saveState:y,getSavedState:E,qxSandboxApi:v}=e;const x=(0,r.useCallback)((0,b.aYu)(E),[E]),{SnackbarRenderer:w,showSnackbarMessage:S}=(0,p.D)(),C=(0,r.useMemo)((()=>t&&(0,b.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(d.m.Provider,{value:null==C?void 0:C.id},o().createElement(m.S.Provider,{value:S},o().createElement(g.Y.Provider,{value:v},o().createElement(s.StylesProvider,{generateClassName:wa},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>h(Math.floor(e),Math.floor(t))}),C&&o().createElement(xa,{config:C,saveState:y,getSavedState:x}),o().createElement(f.Z,{showErrorFromStore:!0}),o().createElement(w,null))))))))};var Ca=n(82842),Oa=n(51229),Pa=n(91131);const Na=(0,Q.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}}))),Ta=e=>{let{total:t=0}=e;const n=Na(),l=(0,a.useDispatch)(),i=(0,r.useContext)(d.m),s=(0,r.useCallback)((()=>{l(x.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(W.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(B.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},y().text("Profile")),o().createElement(Pa.Z,{className:n.icon}),y().text("Tags")),o().createElement(Oa.Z,null),o().createElement(B.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var Ia=n(20404);const ka=(0,Q.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"}}))),Da=e=>{let{label:t}=e;const n=ka();return o().createElement(B.Toolbar,{className:n.toolbar},o().createElement(Ia.Z,{className:n.avatar}),o().createElement(B.Typography,{variant:"h6",className:n.label},t))};function Za(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){Ra(e,t,n[t])}))}return e}function Ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Aa=(0,Q.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}}))),ja=[25,50,100],La=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=Aa(),[s,c]=(0,r.useState)(ja[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);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,Ee._)(),u=(0,Ee._)(),[p,d]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,h]=(0,r.useState)([]),{requestEntities:E,requestTotal:v}=(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,b.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!c,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Za({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,b.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,i.assoc)("dataTenant",c))):(0,b.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,Za({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,b.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,b.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))),g(0)}),[s]);return(0,r.useEffect)((()=>{c(v()).then(g).catch(w)}),[v,c,w]),(0,r.useEffect)((()=>{d(!0),u(E(l,o*l)).then(h).catch(w).finally((()=>d(!1)))}),[o,l,E,u,w]),{isLoading:p,total:m,entities:f}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),h=(0,r.useRef)(null);(0,r.useEffect)((()=>{h.current&&(h.current.scrollTop=0)}),[f]);const E=g>ja[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(Da,{label:t}),o().createElement("div",{className:U()(l.tagsContainer,{[l.fullHeight]:E})},o().createElement(V.Z,{className:l.tagsView},o().createElement(Ta,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(R.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(Ca.Z,{entities:f})),E&&o().createElement("div",{className:l.pagination},o().createElement(z.Z,{count:g,rowsPerPageOptions:ja,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));La.displayName="TagPerspectiveView";const Ma=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Ua=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(d.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:Ma},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(La,{tag:n,entityUri:r}),o().createElement(f.Z,{showErrorFromStore:!0}))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6217],{27815:(e,t,n)=>{n.d(t,{Z:()=>S});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),p=n(59431),d=n(57941),m=n(94079),g=n(92575),f=n(37285),b=n(96808),h=n(7785),y=n(79692);function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){v(e,t,n[t])}))}return e}function v(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=>E({},e,{fontSize:"14px"}),menuPortal:e=>E({},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 S=e=>{let{entityType:t,selectedAttributes:n,className:a,onChange:i,title:y,disableUnderline:E,menuPlacement:v="bottom"}=e;const S=(0,u.useSelector)(p.ZP.selectors.getMetadata),C=w(),O=(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,d.EUG)(S,r);return e.concat(a?O(a,t+1,o):[])}),[])}),[S]),P=(0,r.useMemo)((()=>O((null==t?void 0:t.attributes)||[])),[t,O]);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:E},classes:{root:C.dropDownInput}},components:{DropdownIndicator:b.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(h.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:v,menuPortalTarget:document.body}))}},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),p=n(31276);const d=(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=d(),g=(0,a.pipe)(p.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}}}}))}},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),p=n(94079),d=n(92575),m=n(96808),g=n(57941),f=n(59431),b=n(79692);function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){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 E={input:e=>h({},e,{fontSize:"14px"}),loadingMessage:e=>h({},e,{fontSize:"14px"}),menuPortal:e=>h({},e,{zIndex:1300})},v=(0,b.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 b=v(),h=e=>({value:e,label:e}),y=e=>e.map(h),x=(0,a.useSelector)(f.ZP.selectors.getTenant),w=(0,a.useSelector)(f.ZP.selectors.getServicesPath),S=(0,r.useRef)();return o().createElement("div",{className:u()(b.root,l)},o().createElement(p.Typography,{className:b.title,variant:"subtitle1"},i().text("User")),o().createElement(d.Z,{value:y(t),onChange:(0,s.pipe)((0,s.defaultTo)([]),(0,s.pluck)("value"),n),defaultOptions:!0,getOptions:e=>(S.current||(S.current=(0,g.kz_)({tenant:x,servicesPath:w})),S.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:b.dropDownInput},components:{DropdownIndicator:m.Z},styles:E,classes:b,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:()=>c,VV:()=>u,rx:()=>p,_V:()=>d,Xr:()=>m});var r=n(17440),o=n(87918),a=n.n(o),l=n(31537);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const s=(0,r.path)(["data","type"]),c=e=>{const{items:t,label:n}=e,[r]=t||[];return s(r)||n},u=(0,r.pipe)(c,(e=>(0,r.pipe)(r.values,(0,r.includes)(e))(l.I))),p=e=>(0,r.pipe)((0,r.propOr)([],"items"),(0,r.groupBy)(s),r.values,(0,r.ifElse)((e=>{let{length:t}=e;return t>1}),(0,r.map)((t=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){i(e,t,n[t])}))}return e}({},e,{items:t,itemsTotal:t.length}))),(()=>[e])))(e),d=e=>(0,r.isNil)(e)?"":"string"==typeof e?e:Array.isArray(e)?e.map(d).join(", "):(0,r.is)(Object,e)?d("value"in e?e.value:Object.values(e)):e.toString(),m=e=>({[l.I.COMMENT_ADDED]:a().text("Comment added"),[l.I.COMMENT_DELETED]:a().text("Comment deleted"),[l.I.COMMENT_UPDATED]:a().text("Comment updated"),[l.I.ENTITIES_MERGED]:a().text("Profile merged"),[l.I.ENTITIES_MERGED_MANUALLY]:a().text("Profile merged manually"),[l.I.ENTITIES_MERGED_ON_THE_FLY]:a().text("Profile merged on the fly"),[l.I.ENTITIES_SPLITTED]:a().text("Profile un-merged"),[l.I.ENTITY_CHANGED]:a().text("Profile updated"),[l.I.ENTITY_CREATED]:a().text("Profile created"),[l.I.ENTITY_LOST_MERGE]:a().text("Profile lost merge"),[l.I.ENTITY_REMOVED]:a().text("Profile removed"),[l.I.GROUP_CHANGED]:a().text("Group updated"),[l.I.GROUP_CREATED]:a().text("Group created"),[l.I.GROUP_REMOVED]:a().text("Group removed"),[l.I.MODEL_UPDATED]:a().text("Model was updated"),[l.I.NOT_MATCHES_RESET]:a().text("Not matches reset"),[l.I.NOT_MATCHES_SET]:a().text("Not matches set"),[l.I.PERIODIC_TASK_SCHEDULED]:a().text("Periodic task was scheduled"),[l.I.POTENTIAL_MATCHES_FOUND]:a().text("Potential matches found"),[l.I.POTENTIAL_MATCHES_REMOVED]:a().text("Potential matches removed"),[l.I.RELATIONSHIP_CHANGED]:a().text("Relationship updated"),[l.I.RELATIONSHIP_CREATED]:a().text("Relationship created"),[l.I.RELATIONSHIP_REMOVED]:a().text("Relationship removed"),[l.I.USER_LOGIN]:a().text("Logged in"),[l.I.USER_LOGOUT]:a().text("Logged out"),[l.I.USER_PROFILE_VIEW]:a().text("Profile viewed"),[l.I.USER_SEARCH]:a().text("Searched"),[l.I.ANALYTICS_ATTRIBUTES_CHANGED]:a().text("Analytics attribute changed"),[l.I.SFDC_CONNECTOR_SYNCHRONIZATION_ISSUE]:a().text("SFDC connector synchronization issue")}[e]||"")},51843:(e,t,n)=>{n.d(t,{Z:()=>b});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(57941),p=n(94079),d=n(96808),m=n(37699);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"),b=e=>{let{values:t,onChange:n,onFocus:a}=e;const l=f,i=(0,r.useRef)(null),[b,h]=(0,r.useState)(!1),y=g(),E=(0,r.useCallback)((()=>{h((e=>!e)),a()}),[a]),v=()=>{h(!1)};return o().createElement("div",{className:y.root},o().createElement(p.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:E,variant:"filled",ref:i,InputProps:{endAdornment:o().createElement(d.Z,{selectProps:{classes:y,menuIsOpen:b},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(p.Menu,{variant:"menu",open:b,autoFocus:!1,classes:{paper:y.paper},anchorEl:i.current,onClose:v,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},elevation:2,getContentAnchorEl:null,MenuListProps:{autoFocusItem:b,style:{width:"100%"}}},o().createElement(m.Z,{values:t,onCancel:v,onApply:e=>{n(e),h(!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={}))},35198:(e,t,n)=>{n.d(t,{_:()=>Sa,t:()=>Ua});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),p=n(24605),d=n(39450),m=n(97094),g=n(60115),f=n(585),b=n(57941),h=n(87918),y=n.n(h),E=n(3096),v=n.n(E),x=n(59431),w=n(60641),S=n(7718),C=n(3515),O=n(17554),P=n(61756),N=n(57730),T=n(76536),I=n(26481),k=n(49759),D=n(94150),Z=n(26005),R=n(99136),A=n(30268),j=n(21077),L=n(67268),M=n(71153),U=n.n(M),H=n(8962);const _=o().createContext(null);_.displayName="SingleAttributeContext";var z=n(60995),F=n(10237),V=n(58662),B=n(94079),W=n(93416),G=n(75512),q=n(30553),Y=n(91181),$=n(32152),X=n(36444),Q=n(79692);const K=(0,Q.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"}}))),J=e=>{let{className:t}=e;const n=K(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(_),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(B.Button,{ref:a,classes:{root:U()(n.triggerButton,t)},onClick:u},o().createElement(X.Z,null)),o().createElement(B.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(B.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(B.Checkbox,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:y().text("Show inactive values")})))},ee=(0,Q.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"}}))),te=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a}=e;const l=ee(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:p,attributeType:d}=(0,r.useContext)(_);return o().createElement(W.Z,{title:y().text(t),className:l.root},o().createElement(G.Z,{widthToHide:500},o().createElement(q.Z,{height:24,margin:16}),o().createElement(B.Typography,{className:l.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),o().createElement(Y.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:p,attributeType:d}),o().createElement($.i,{query:i,onChange:e=>{s(e),c(0)}}),a&&o().createElement(J,null))};var ne=n(65549),re=n(93140),oe=n(76134),ae=n(96698);const le=(0,Q.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"}}))),ie=b.nIW,se=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return se(n,t)})))):b.P6Y.strings.search(String(e),t),ce=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const s=(0,i.pipe)(b.XtP,(0,i.filter)((e=>{let{value:t}=e;return se(t,l)})))(t,n,r),c=(0,i.filter)(b.OXP,s);return{[(0,b.xy8)(r)]:{[ie(r)]:c.slice(a,a+o),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}};function ue(){return ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ue.apply(this,arguments)}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){de(e,t,n[t])}))}return e}function de(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const me=[],ge=e=>{let{values:t,attributeType:n,parentUri:l,showInactive:s,noDataText:c}=e;const u=le(),{uri:p,required:m,cardinality:g,name:f}=n,h=(0,a.useDispatch)(),E=(0,r.useContext)(d.m),v=(0,a.useSelector)(x.ZP.selectors.getEntity),w=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,v.uri)||{})),S=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),C=(0,a.useSelector)((e=>(0,b.tQX)(l,n,x.ZP.selectors.getProfileErrors(e)))),O=(0,a.useSelector)(x.ZP.selectors.getMode),P=(0,b.xy8)(n),N=(0,i.pipe)((0,i.pathOr)(me,[P,f]),(0,i.map)((0,i.prop)("uri")))(v),T=(0,i.pathOr)(me,[P,f],w),I=T.map((0,i.prop)("uri")),k=(0,b.ZiX)(v.uri),D=(0,r.useRef)((0,b.gjI)({parentUri:l,attributeType:n})),Z=(0,b.O27)(T),R=m&&Z,A=R?[D.current]:T.filter((0,i.pipe)((0,i.prop)("uri"),b.ZiX)),j=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,h)(e.map((e=>pe({},e,{viewId:E}))))),[E,h]),L=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.modifyAttribute,h)(pe({},e,{viewId:E}))),[E,h]),M=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,h)(pe({},e,{viewId:E}))),[E,h]),H=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,h),[h]),_=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return j(R&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[j,l,n,R]),z=(0,b.Vg3)({attributeType:n,mode:O}),F={attributeType:n,errors:S,crosswalks:w.crosswalks,mode:O,onAddAttributes:j,onChangeAttribute:L,onDeactivateError:H,showNonOv:s},V=0===A.length&&0===t.length;return o().createElement("div",null,o().createElement(re.Z,{cardinality:g}),o().createElement(oe.Z,{message:C}),z&&o().createElement(B.Button,{color:"primary",onClick:_,className:u.moreButton},o().createElement(ne.Z,{classes:{root:u.icon}}),o().createElement("div",{className:u.buttonLabel},y().text("Add"))),A.map(((e,t)=>o().createElement(ae.Z,ue({key:e.uri},F,{attributeValue:e,lazy:R&&!m,showEmptyEditors:k,ownError:(0,b.ADq)(e,t,p,S),onDeleteAttribute:M})))),A.length>0&&t.length>0&&o().createElement(B.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)&&!I.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,b.vKJ)({valueTransformer:(0,i.unless)(b.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:U()({[u.ovFalse]:!(0,b.OXP)(n)})},o().createElement(ae.Z,ue({},F,{attributeValue:n,ownError:(0,b.ADq)(n,null,p,S),onDeleteAttribute:M,state:l})))})),V&&o().createElement(B.Typography,{className:u.noData},c))};var fe=n(81303);const be=e=>{let{values:t,attributeType:n,showInactive:r}=e;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(fe.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r}))))},he=(0,Q.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}}))),ye=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=he(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:b,showInactive:h}=(0,r.useContext)(_),E=(0,a.useSelector)(x.ZP.selectors.getEntityUri),v=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),S=(0,a.useSelector)(x.ZP.selectors.getPivotingAttributes),C=0!==u.length,O=t["text-empty"]||y().text("No data found");return o().createElement(z.J.Provider,{value:S},o().createElement(F.Z,{className:U()(c.root,n)},o().createElement(te,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:s}),o().createElement(B.Box,{className:c.content},(()=>{if(g)return o().createElement(R.Z,null);if(b){if(v&&C){const e={values:u,attributeType:b,showInactive:h};return o().createElement(be,e)}if(w){const e={values:u,attributeType:b,parentUri:E,showInactive:h,noDataText:O};return o().createElement(ge,e)}}return o().createElement(B.Typography,{className:c.noData},O)})()),f&&o().createElement(V.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:c.pagination}})))};var Ee=n(67218),ve=n(20562);function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const we=(e,t,n)=>{const{attributeUri:o,max:l=15}=e,s=(0,a.useSelector)(x.ZP.selectors.getMetadata),[c,u]=(0,r.useState)([]),[p,d]=(0,r.useState)(null),[m,g]=(0,r.useState)(!1),f=(0,Ee._)(),h=(0,r.useRef)(null),y=(0,a.useDispatch)(),E=(0,a.useSelector)(x.ZP.selectors.getApiPath),v=(0,a.useSelector)(x.ZP.selectors.getTenant),w=n?x.ZP.selectors.getEntityWithDiff:x.ZP.selectors.getEntityWithoutDiff,S=(0,a.useSelector)(w),C=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),O=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),P=(0,a.useSelector)(x.ZP.selectors.getHistoryDiff),N=S.uri,T=ie(o),I=(0,b.xy8)(o);h.current=(0,b.JQy)(S,N,T);const k=(0,r.useMemo)((()=>(0,b.zeJ)(s,o)),[s,o]),{globalFilter:D}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:Z}=t,R=(0,r.useCallback)((()=>{if(k&&(0,b.Uty)(k)&&!(0,b.ZiX)(N)&&(0,b.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,b.biM)(S)||O?ce:b.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){xe(e,t,n[t])}))}return e}({metadata:s,entity:S,apiPath:E,tenant:v,parentUri:N,defaultMaxValues:l,attributeTypeUri:o,offset:l*e,globalFilter:D,options:n?"":void 0},r))).then((e=>{const t=(0,i.path)([I],e),n=(0,i.pathOr)([],[T],t);O||y(x.N5.actions.processNextPageOfAttributeValues({parentUri:N,attributeTypeUri:o,attributeTypeName:T,values:n})),u(n.map((e=>{var t;return(null===(t=h.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),d((0,i.path)(["paging",o],t))})).finally((()=>{g(!1)}))}else u([]),d(null)}),[E,N,v,o,l,s,t,D,k,O,P]);(0,r.useEffect)((()=>{R()}),[R]),(0,ve.D)((()=>{C&&R()}),[C]);const A=(0,i.partition)(b.OXP),[,j]=A(h.current||[]),L=Z?[]:j,M=Z?"totalValues":"totalOvValues",U=(0,i.ifElse)((0,i.has)(M),(0,i.prop)(M),(0,i.always)(c.length))(p),H=l<U,_=null!=p&&p.totalValues?p.totalValues-U:L.length;return{values:c,isLoading:m,hasPaging:H,totalVisibleValues:U,attributeType:k,totalNonVisibleValues:_,nonVisibleValues:L}};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 Ce=n(37152),Oe=n(31274),Pe=n(79026),Ne=n(8818),Te=n(90324),Ie=n(70595);const ke=o().createContext(null);ke.displayName="RelationsViewStateContext";const De=(0,Q.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=De(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(ke),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),h=!(0,b.O27)(d),E="asc"===s;return o().createElement(o().Fragment,null,o().createElement(B.Button,{ref:a,classes:{root:U()(n.button,t)},onClick:f},o().createElement(X.Z,null)),o().createElement(B.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(B.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(B.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),h&&o().createElement(o().Fragment,null,o().createElement(B.Divider,{className:n.divider}),o().createElement(B.Typography,{className:n.title,variant:"h6"},y().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Pe.Z,{entries:d,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:p,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),o().createElement(Ne.k,{tooltipTitle:E?y().text("Ascending"):y().text("Descending"),icon:E?Te.Z:Ie.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Ze.displayName="FilterButton";const Re=Ze,Ae=(0,Q.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 je=n(61932),Le=n(55847);const Me=o().createContext(null);function Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){He(e,t,n[t])}))}return e}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _e=Math.pow(2,31)-1,ze=(0,Q.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 Fe=n(81137);const Ve=e=>{let{label:t}=e;const n=ze();return o().createElement(B.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(je.Z,null))},Be=()=>{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)(Me),i=(0,a.useSelector)(x.ZP.selectors.getEntityUri),[s,c]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(x.ZP.selectors.getDtssPath),m=(0,a.useSelector)(x.ZP.selectors.getTenant),g=[Ue({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:_e})],f=(0,r.useCallback)((()=>{c([]),o.importFromDT&&!(0,b.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,b.QXb)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Ue({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(c)}),[i,d,m,o,t]),h=(0,r.useCallback)((()=>{(0,b.MOC)({entityUri:i,content:g,dtssPath:d,customerTenant:m,dataTenant:u.id}).then((()=>{l(),f()})).catch((e=>n(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))))),p(null)}),[i,d,m,o,f,l,u,p]);(0,r.useEffect)((()=>{f()}),[f]);const E=(0,r.useCallback)((()=>p(null)),[]),v=(0,r.useCallback)((e=>p(e)),[]);return{tenants:s,selectedTenant:u,onConfirmImport:h,onCancelConfirmation:E,onImportClick:v}})(),s=ze(),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(Ne.k,{size:"L",icon:je.Z,tooltipTitle:y().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:U()(s.tenant)},u)):o().createElement(Le.Z,{menuId:"importDT-table-actions",buttonComponent:Ne.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>o().createElement(Ve,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(Fe.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})))},We=e=>{let{title:t,total:n}=e;const a=Ae(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(ke);return o().createElement(W.Z,{title:t||"",className:a.header},n>0&&o().createElement(G.Z,{widthToHide:400},o().createElement(q.Z,{height:24,margin:16}),o().createElement(B.Typography,{className:a.totalCaption,variant:"caption"},n>1?y().text("${count} items",{count:n}):y().text("${count} item",{count:n}))),o().createElement($.i,{query:l,onChange:i}),o().createElement(Be,null),o().createElement(Re,null))};var Ge=n(11013),qe=n(27604),Ye=n(22983),$e=n(31254),Xe=n(31039);const Qe=(0,Q.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 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 Je=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=Qe(),u=(0,Ee._)(),p=(0,a.useSelector)(x.ZP.selectors.getTenant),d=(0,a.useSelector)(x.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const y=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&(0,i.isNil)(f)){const e=(0,i.ifElse)(b.biM,(e=>(0,b.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:p,dtssPath:d})),(e=>(0,b.XkT)(e.entityUri)));g(!0),u(e(n)).then((e=>{let{secondaryLabel:t}=e;h(t)})).finally((()=>{g(!1)}))}}),[d,n,p,u,f]),E=o().createElement("div",{className:c.tooltipContent},o().createElement("div",{className:c.label},t),m&&o().createElement(B.CircularProgress,{size:16,classes:{colorPrimary:c.progress}}),f&&o().createElement("div",{className:c.secondaryLabel},f));return o().createElement(B.Tooltip,Ke({onOpen:y,title:E,disableFocusListener:!0,classes:{tooltip:c.tooltip}},s),l)},et=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,b.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,b.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,b.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,b.Lmx)(t,null==r?void 0:r.relationType)}};var tt=n(77277);const nt=(0,Q.Z)((()=>({container:{display:"flex"}})));function rt(){return rt=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},rt.apply(this,arguments)}const ot=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=nt();return o().createElement("div",{className:a.container},o().createElement(tt.Z,rt({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),o().createElement(tt.Z,rt({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},at=(0,Q.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"}}))),lt=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:a,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=at(),{entity:d,relation:m}=t,g=(0,b.$qe)(t),f=(0,b.xr3)(t),h=(0,b.iJH)(t),{entityType:E,entityLabel:v,preparedUri:x,relationLabel:w}=et(t,n),S=(0,b.Fn9)(m)&&(0,b.Fn9)(d),{canRemove:C,canUpdate:O}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a}=e;if((n===b.ARY.Editing||n===b.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,b.$qe)(r),i=(0,b.V3K)(t,e);return{canRemove:o&&!l&&(0,b.Edd)(n,i),canUpdate:a&&!l&&(0,b.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:b.ARY.Editing,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),P=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),N=(0,r.useCallback)((()=>i(t)),[i,t]),T=(0,r.useCallback)((()=>{s(t)}),[s,t]),I=(0,r.useCallback)((()=>c(t)),[c,t]),k=(C||O)&&a&&!t.suggested?o().createElement(o().Fragment,null,O&&o().createElement(Ne.k,{icon:qe.Z,size:"XS",onClick:N,tooltipTitle:y().text("Edit")}),C&&o().createElement(Ne.k,{icon:Ye.Z,size:"XS",onClick:P,tooltipTitle:y().text("Remove")})):void 0,D=t.suggested?o().createElement(ot,{acceptRelation:T,ignoreRelation:I,size:"small",disabled:h}):void 0,Z=h?y().text("ignored"):y().text("edited");return o().createElement("div",{className:U()(p.container,{[p.rowInactive]:!S},{[p.removed]:g||h})},o().createElement("div",{className:p.row},u&&u(),o().createElement($e.Z,{className:p.entityAvatar,entityType:E}),o().createElement(Xe.Z,{value:x,className:p.entityLabelContainer},o().createElement(Je,{label:v,entity:d},o().createElement("span",{className:p.entityLabel},v)),(f||h)&&o().createElement(B.Typography,{variant:"caption",className:p.editedLabel},"(",Z,")"),w&&o().createElement("span",{className:p.relationLabel},`, ${w}`)),o().createElement("div",{className:p.editButtonsContent},k),D))}));lt.displayName="EditableRelationItem";const it=lt,st=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:t,direction:e===b.Nsj.IN?b.Nsj.IN:b.Nsj.OUT})));return n(b.Nsj.IN,e).concat(n(b.Nsj.OUT,t))[0]};function ct(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ut=n(98989),pt=n(83543);const dt=(0,Q.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),mt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=dt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,b.xvW)(n)?null:a?o().createElement(pt.Z,c):o().createElement(ut.Z,c)},gt=(0,Q.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),ft=e=>{let{config:t,connection:n,children:l}=e;const i=gt(),{showInactive:s}=(0,r.useContext)(ke),{connections:c,showSecondLevel:u,toggleShowSecondLevel:p,loadRelations:d,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:p}=t,{entity:d}=n,m=(0,a.useSelector)((e=>x.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,d.entityUri)))||[],g=(0,a.useSelector)((e=>x.ZP.selectors.getTotalByViewId(e,t.id,d.entityUri))),{activityFilter:f}=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions)||{},h=(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){ct(e,t,n[t])}))}return e}({},p,{returnObjects:!0,returnDates:!0,activeness:{relation:o||b.Ng6.ALL,entity:f}});u(!0),(0,b.N6e)(d.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(x.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:d.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,p,l,d.entityUri,f,o]),y=(0,r.useCallback)((()=>{i||n.connections||h(),s((e=>!e))}),[h,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:y,loadRelations:h,loading:c,total:g}})({config:t,connection:n,relationActivityFilter:s?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,b.Px$)(c)),[c]);return o().createElement(o().Fragment,null,l((()=>o().createElement(mt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(Oe.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(qt,{isLoading:m,config:t,loadRelations:d,connections:c,total:g,parentEntityUri:n.entity.entityUri}))))},bt=(0,Q.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"}}))),ht=e=>{let{className:t,connections:n=[],config:l,mode:s,noDataText:c,parentEntityUri:u}=e;const p=(0,a.useSelector)(x.ZP.selectors.getMetadata),d=(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))),h=(0,a.useDispatch)(),E=bt(),v=(0,r.useCallback)((()=>{const e=(0,b.vlo)({config:l,mode:s,metadata:p,parentEntityUri:u});(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),h)(e)}),[l,s,p,h,u]),w=(0,r.useCallback)((e=>{h(x.N5.relations.actions.closeRelationEditor(l.id,e)),h(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,b.ZiX)(r)&&h(x.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,h]),S=l.content,C=st(S.inRelations,S.outRelations),O=(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);h(x.N5.relations.actions.addRelation(l.id,t))}),[h,l,C]),P=(0,r.useCallback)((e=>{h(x.N5.relations.actions.ignoreRelation(l.id,{relationType:C.type,relationDirection:C.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[h,l,C]),[N,T]=(0,i.partition)(b.xvW,n),I=g&&f,k=0===N.length&&0===T.length,D=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,b.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(ft,{config:l,connection:e,key:c},(t=>r?o().createElement(Ge.Z,{connection:r,config:l,mode:s,metadata:p}):o().createElement(it,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(x.N5.relations.actions.openRelationEditor(l.id),h),onAcceptRelation:O,onIgnoreRelation:P})))},Z=I&&(!d||d&&d.parentEntityUri===u),R=d&&d.parentEntityUri===u;return o().createElement("div",{className:t},Z&&o().createElement(B.Button,{color:"primary",onClick:v,className:E.moreButton},o().createElement(ne.Z,{classes:{root:E.icon}}),o().createElement("div",{className:E.buttonLabel},y().text("Add"))),R&&o().createElement(Ge.Z,{connection:d,config:l,mode:s,metadata:p}),N.map(D),N.length>0&&T.length>0&&o().createElement(B.Divider,{className:E.divider}),T.map(D),k&&o().createElement(B.Typography,{className:E.noData},c))};var yt=n(19603),Et=n(94646),vt=n(78101),xt=n(80931);const wt=(0,Q.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){Ct(e,t,n[t])}))}return e}function Ct(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ot=e=>{let{connection:t,className:n}=e;const l=wt(),{relation:s}=t,c=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(x.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,b.xF8)(u,null==s?void 0:s.relationType)),[null==s?void 0:s.relationType,u]),d=(0,r.useMemo)((()=>St({attributes:St({},x.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,b.p2l)((null==t?void 0:t.relation)||{}))),[t]),m=(0,r.useMemo)((()=>(0,b.fyF)(p,d)),[p,d]).filter((e=>{let{values:t}=e;return!(0,b.O27)(t)})).length>0,g=(0,r.useMemo)((()=>(0,b.R$r)(d.attributes)),[d]),{getCommentsCount:f}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const h=(0,r.useMemo)((()=>(0,b.wp9)(b.q7e.RELATION,{entityUri:c,connection:t})),[t,c]);return m?o().createElement(vt.A.Provider,{value:h},o().createElement(xt.Z,{className:U()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:U()(l.attributesList,n)},y().text("No attributes"))};var Pt=n(86602),Nt=n(82726);const Tt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Ne.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?Pt.Z:Nt.Z,onClick:n})},It=(0,Q.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"}}))),kt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:s}=e;const c=It(),u=t.suggested,{entity:p,relation:d}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityType:h,entityLabel:y,preparedUri:E,relationLabel:v}=et(t,f),w=(0,b.Fn9)(d)&&(0,b.Fn9)(p),S=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),C=p&&d&&(0,b.wp9)(b.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:U()(c.container,{[c.rowInactive]:!w},{[c.suggestedWrapper]:u})},o().createElement("div",{className:U()(c.row,yt.U)},n&&n(),o().createElement("div",{className:c.labelWrapper},o().createElement($e.Z,{className:c.entityAvatar,entityType:h}),o().createElement(Xe.Z,{value:E,className:c.entityLabelContainer},o().createElement(Je,{label:y,entity:p},o().createElement("span",{className:c.entityLabel},y)),v&&o().createElement("span",{className:c.relationLabel},`, ${v}`))),o().createElement("div",{className:c.additionalButtonsWrapper},!(0,i.isEmpty)(C)&&o().createElement(Et.Z,{className:c.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:C,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(ot,{size:"small",acceptRelation:l(t),ignoreRelation:s(t)}),!u&&o().createElement(Tt,{show:m,onToggle:()=>{g((e=>!e))},className:c.showDetails}))),m&&o().createElement(Ot,{connection:t}))}));kt.displayName="RelationItem";const Dt=kt;var Zt=n(52691),Rt=n(16208);const At=e=>e.filter((e=>5===e.value)).length,jt=e=>e.filter((e=>1===e.value)).length,Lt=e=>0===e.length?"0%":At(e)/e.length*100+"%",Mt=e=>0===e.length?"0%":jt(e)/e.length*100+"%",Ut=(0,Q.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)"}}))),Ht=e=>{let{ratings:t,className:n}=e;const r=Ut();return o().createElement("div",{className:U()(r.wrapper,n)},o().createElement(B.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:Lt(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Mt(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:U()(r.likesCount,r.count)},o().createElement(Zt.Z,{className:r.icon}),At(t)),o().createElement("div",{className:r.count},o().createElement(Rt.Z,{className:r.icon}),jt(t))))},_t=(0,Q.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}}))),zt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=_t(),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(B.Button,{onClick:n,variant:"text",size:"small",className:U()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),o().createElement(Le.Z,{buttonProps:{endIcon:o().createElement(pt.Z,null),variant:"text",size:"small",className:U()(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"}))},Ft=(0,Q.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"}}))),Vt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:s,ignoreRelation:c}=e;const u=Ft(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:g,relation:f}=t,h=(0,a.useSelector)(x.ZP.selectors.getMetadata),{entityLabel:y,entityType:E,preparedUri:v,relationLabel:w}=et(t,h),S=(null==f?void 0:f.ratings)||[],C=(0,a.useSelector)(x.ZP.selectors.getEntityUriWithDataTenant),O=g&&f&&(0,b.wp9)(b.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:U()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(B.Box,{display:"flex",minHeight:"44px",className:yt.U},o().createElement(B.Box,{display:"flex",alignItems:"center"},o().createElement(B.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement($e.Z,{entityType:E,className:u.entityTypeIcon})),o().createElement(B.Box,{display:"flex",flexDirection:"column"},o().createElement(Xe.Z,{value:v,className:u.entityLabelContainer},o().createElement(Je,{label:y,entity:g},o().createElement("span",{className:u.entityLabel},y))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(zt,{ratings:S,onAgree:()=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,b.Buf)(null==f?void 0:f.relationUri,{comment:e,value:1}).then(n)}}))),o().createElement("div",{className:u.additionalButtonsWrapper},!(0,i.isEmpty)(O)&&o().createElement(Et.Z,{className:u.commentsContainer,uri:(0,b.gjS)(f),relatedObjectUris:O,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(ot,{acceptRelation:s(t),ignoreRelation:c(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(Ht,{ratings:S,className:u.ratings}),o().createElement(Tt,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(Ot,{connection:t,className:u.relationAttributes}))},Bt=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:s}=e;const{isComplex:c,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=st(e.inRelations,e.outRelations),o=(0,a.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:a}=e;(0,b.iiD)(n,{relatedEntityUri:a.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===b.Nsj.IN,u=c?a.entityUri:n,p=c?n:a.entityUri;(0,b.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{o(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong"))))}))}}})(u,l,s),m=(0,r.useMemo)((()=>(0,b.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(ft,{config:i,connection:e,key:r},(t=>c?o().createElement(Vt,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(Dt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};Bt.displayName="RelationsList";const Wt=Bt,Gt=(0,Q.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),qt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:s}=e;const c=Gt(),{selectors:u}=x.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||y().text("No data found");return t?o().createElement(R.Z,null):(0,b.KIu)(d)?o().createElement(ht,{connections:l,className:c.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:s}):i>0?o().createElement(Wt,{config:n,loadRelations:r,connections:l,className:c.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(B.Typography,{className:c.noData},m)},Yt=(0,Q.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}}),$t=e=>{let{config:t,className:n}=e;const l=Yt(),{page:s,setPage:c,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(ke),{selectors:h}=x.ZP,y=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),E=(0,a.useSelector)(h.getEntity),v=(0,a.useSelector)((e=>h.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(h.getMode),S=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{f("")}),[null==E?void 0:E.uri]);const C=(0,r.useMemo)((()=>(e=>{const t=b.wSh.fromFalsy(e).map(b.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new b.MEy).addClause(t).build()})(g)),[g]),{isLoading:O,reload:P}=(0,Ce.a)({sorting:S,filter:C,page:s,rowsPerPage:u,config:t,entity:E,relationActivityFilter:m?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,b.Px$)(y)),[y]),T=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Oe.X.Provider,{value:N},o().createElement(F.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(Me.Provider,{value:T},o().createElement(We,{title:t.caption,total:v})),o().createElement("div",{className:l.content},o().createElement(qt,{isLoading:O,config:t,loadRelations:P,connections:y,total:v}),v>u&&o().createElement(V.Z,{classes:{root:l.pagination},count:v,rowsPerPageOptions:[],rowsPerPage:u,page:s,onChangePage:c})))))};$t.displayName="RelationsView";const Xt=o().createContext(null);Xt.displayName="SingleAttributeContext";var Qt=n(86361),Kt=n(26180),Jt=n(31276);function en(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){tn(e,t,n[t])}))}return e}function tn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const nn="CHANGE_SEARCH_QUERY",rn=en({},Kt.ZP.actions,{changeSearchQuery:(0,Jt.zD)(nn)}),on=(e,t)=>t.type===nn?en({},e,{searchQuery:t.payload,page:0}):Kt.ZP.reducer(e,t);var an=n(92332),ln=n(67353);const sn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},cn=(0,Q.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":sn}}))),un=(0,ln.Z)((e=>{const t=cn();return o().createElement("div",{className:t.headCell},o().createElement(an.default,e))}));var pn=n(64091);function dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mn=(0,i.pipe)((0,i.map)((e=>({id:(0,b.Tde)(e.uri),label:e.label,dataTypeDefinition:(0,b.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),gn=(0,i.pipe)(b.DK$,mn),fn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),bn=e=>{if((0,b.vZp)(e)){const t=fn(e);return t.length>1?t.slice(0,-1):null}return null},hn=(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){dn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:bn(e.id),headCellRenderer:un,rowCellValueRenderer:pn.Z})));var yn=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 vn=n(52016),xn=n(1876),wn=n(60894);const Sn=(0,Q.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Cn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:a,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=Sn();return o().createElement(W.Z,{title:t,className:u.header},o().createElement($.i,{query:n,onChange:r}),o().createElement(xn.Z,{enabled:a,onClick:l}),o().createElement(q.Z,{height:24,margin:4}),o().createElement(wn.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};function On(){return On=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},On.apply(this,arguments)}const Pn=(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=cn();return o().createElement("div",{className:U()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,On({key:t,value:e},l)))))}));var Nn=n(85709);const Tn=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Ne.k,{tooltipTitle:y().text("Edit"),icon:qe.Z,size:"L",onClick:t}),n&&o().createElement(Ne.k,{tooltipTitle:y().text("Remove"),icon:Ye.Z,size:"L",onClick:n}))};function In(){return In=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},In.apply(this,arguments)}const kn=e=>{let{columnsData:t,values:n,sorting:l,onSort:s,filters:c,onFilter:u,config:p,onEdit:d,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,b.tT_)(e))(t))(fn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>hn(t)),[t]),y=cn(),E=(0,a.useSelector)(x.ZP.selectors.getMode),v=(0,b.KIu)(E),w=(0,a.useSelector)(x.ZP.selectors.getMetadata),S=(0,a.useSelector)(x.ZP.selectors.getEntityUri),C=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,S)||{})),{attributeType:O}=(0,r.useContext)(Xt),P=(0,r.useCallback)((e=>o().createElement(Pn,In({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,T]=(0,r.useState)(null),{canUpdate:I,canDelete:k}=(0,vn.l)(),D=(0,r.useMemo)((()=>"number"!=typeof N||!v||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,v]),Z="number"==typeof N&&(R=(0,i.path)([N],n),k(p)&&(0,b.xv5)({attributeType:O,mode:E,attributeValue:R,metadata:w,isReltioCrosswalk:(0,b.KVV)(C.crosswalks,R)}));var R;const A="number"==typeof N&&(e=>I(p)&&(0,b.yv0)({attributeType:O,mode:E,attributeValue:e,isReltioCrosswalk:(0,b.KVV)(C.crosswalks,e)}))((0,i.path)([N],n)),j=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);A&&d(e)}),[d,N,n,A]),L=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!Z)return;const t={parentUri:S,attributeType:O,uri:e.uri,value:e};m(t),T(null)}),[N,n,m,Z,O,S]),M=D||!Z&&!A?void 0:o().createElement(Tn,{onEdit:A?j:void 0,onRemove:Z?L:void 0}),U=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:y.tableContainer},o().createElement(Nn.Z,{autosizing:!0,maxHeight:477,columnsData:h,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:M,context:U,classes:{hoveredRowRightContentWrapper:y["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:y["row-cell__buttons-container"]}}))},Dn=(0,Q.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 Zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:s,hasChanges:c,attributeValue:u}=e;const p=Dn(),m=(0,a.useSelector)(x.ZP.selectors.getEntityUri),{attributeType:g}=(0,r.useContext)(Xt),f=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),h=(0,a.useSelector)(x.ZP.selectors.getMode),E=(0,a.useDispatch)(),v=(0,r.useContext)(d.m),w=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.addAttributes,E)(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){Zn(e,t,n[t])}))}return e}({},e,{viewId:v}))))),[v,E]),S=(0,b.ZiX)(m),C=(0,a.useSelector)((e=>x.ZP.selectors.getActiveErrorsForAttributesPager(e,m,g))),O=(0,r.useCallback)((0,i.pipe)(x.N5.errors.actions.errorDeactivated,E),[E]);return o().createElement(o().Fragment,null,o().createElement(ae.Z,{expanded:!0,attributeValue:u,showEmptyEditors:S,onDeleteAttribute:s,onDeactivateError:O,onChangeAttribute:t,onAddAttributes:w,mode:h,crosswalks:f.crosswalks,errors:C,attributeType:g,ownError:(0,b.ADq)(u,null,g.uri,C)}),o().createElement("div",{className:p.actionButtons},o().createElement(B.Button,{onClick:()=>{n(u)}},y().text("Cancel")),o().createElement(B.Button,{color:"primary",disabled:!c,onClick:()=>{l(u)}},y().text("Apply"))))},An=(0,Q.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 jn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ln(e,t,n[t])}))}return e}function Ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Mn=[],Un=e=>{let{config:t,className:n}=e;const{caption:l,max:s}=t,c=An(),{values:u,page:p,setPage:m,isLoading:g,searchQuery:f,setSearchQuery:h,visibleColumns:E,onFilter:v,onSort:w,onToggleFilters:S,onChangeColumns:C,filters:O,sorting:P,totalVisibleValues:N,hasPaging:T,attributeType:I,showTable:k}=(0,r.useContext)(Xt),D=(0,r.useMemo)((()=>gn(I)),[I]),{checkHasChanges:Z,onChangeAttribute:A,onDeleteAttribute:j,onAdd:L,onCancel:M,onApply:H,onStartEditing:_,modifiedValues:z,editingValues:G,deletedUris:q}=(()=>{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)(d.m),{attributeType:u,values:p}=(0,r.useContext)(Xt),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)(jn({},e,{viewId:c}))}),[c,s]),h=(0,r.useCallback)((e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(jn({},e,{viewId:c}))),[c,s]),y=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:m,attributeType:u});t(e.uri),f(jn({},e,{value:(0,b.GPx)({attributeTypes:u.attributes,parentUri:e.uri,mode:l,metadata:g}),attributeType:u}))}),[m,u]),E=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),v=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t=jn({},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),h(n)}}),[h,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]),S=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,m)||{})),C=(0,b.KIu)(l),O=(0,b.xy8)(u),P=(0,i.pathOr)(Mn,[O,null==u?void 0:u.name],S),N=(0,r.useMemo)((()=>[...P.filter((0,i.pipe)((0,i.prop)("uri"),(0,i.both)(b.ZiX,(0,i.pipe)((0,i.equals)(e),i.not)))),...(0,i.map)((e=>P.find((0,i.propEq)("uri",e.uri))||e))(p)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[P,n,e,p]),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)))))(p):[]),[P,p]),I=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:h,onAdd:y,onCancel:v,onApply:w,onStartEditing:E,modifiedValues:N,editingValues:I,deletedUris:T}})(),Y=(0,a.useSelector)(x.ZP.selectors.getMode),$=(0,b.KIu)(Y),X=$?z:u,{canCreate:Q}=(0,vn.l)(),K=Q(t)&&I&&(0,b.Vg3)({attributeType:I,mode:Y})&&!G.length,J=(0,r.useMemo)((()=>E.map((e=>D.find((0,i.propEq)("id",e))))),[E,D]);return o().createElement(F.Z,{className:U()(c.root,n)},k?o().createElement(o().Fragment,null,o().createElement(Cn,{title:l,total:N,columnsData:D,selectedColumns:E,onChangeColumns:C,searchQuery:f,onChangeSearchQuery:h,filtersEnabled:!!O,onToggleFilters:S}),o().createElement("div",{style:{position:"relative"}},$&&o().createElement("div",{className:c.editor},K&&o().createElement(B.Button,{color:"primary",onClick:L,className:c.addButton},o().createElement(ne.Z,{classes:{root:c.icon}}),o().createElement("div",{className:c.buttonLabel},y().text("Add"))),G.map((e=>o().createElement(Rn,{key:e.uri,attributeValue:e,onChangeAttribute:A,onDeleteAttribute:j,onCancel:M,onApply:H,hasChanges:Z(e)})))),o().createElement(kn,{columnsData:J,config:t,values:X,filters:O,onFilter:v,sorting:P,onSort:w,onEdit:_,onDeleteAttribute:j,deletedUris:q}),T&&o().createElement(V.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:s,page:p,onChangePage:m}),g&&o().createElement(R.Z,null))):o().createElement(o().Fragment,null,o().createElement(W.Z,{title:l,className:c.header}),o().createElement(B.Typography,{className:c.noData},y().text("No data"))))};var Hn=n(58600);function _n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let zn=0;const Fn=()=>zn++,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},Bn=(0,Q.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.secondary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.secondary.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 Wn=n(1242);const Gn=o().createContext(null);var qn=n(55400);const Yn=e=>{e.target.src=Wn},$n=e=>{let{node:t}=e;const n=Bn(),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)(Gn),p=(0,a.useSelector)(x.ZP.selectors.getUIPath),{uri:d}=(0,a.useSelector)(x.ZP.selectors.getEntity),m=(0,b.ChB)({uiPath:p,uri:i}),g=i===d,f=(0,r.useCallback)((()=>{l(x.ui.actions.openEntity({uri:i,viewId:u.id}))}),[l,u,i]),{entity:{label:h},nodeId:y}=t,E=(0,b.nt9)(c,t.entity.type)||{},v=(0,b.VD3)(c,E,"typeGraphIcon"),w=v&&(0,b.vPL)(s,v);return o().createElement("div",{className:n.wrapper,"data-node-id":y},o().createElement("div",{className:n.container},o().createElement(B.Avatar,{className:U()(n.avatar),src:w||Wn,onError:Yn}),o().createElement("span",{className:U()(n.link,{[n.selected]:g})},o().createElement(qn.Z,{to:m,onClick:f},h))))},Xn=((0,r.memo)($n),e=>{let{node:t}=e;return t.nodeId}),Qn=(0,Q.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 Kn(){return Kn=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},Kn.apply(this,arguments)}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}function er(){return er=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},er.apply(this,arguments)}const tr={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,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),d=l,m=r&&!a.root&&a.children&&a.children.length>0,g=Qn();return o().createElement("div",er({style:{height:"100%"}},p,{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:U()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:s,treeIndex:c}):d))))},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=Qn(),u=a.length,p=[];a.forEach(((e,t)=>{p.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 d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,b=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}({},s.style,{width:f});return o().createElement("div",Kn({},s,{className:c.node,style:b}),p,o().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function nr(){return nr=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},nr.apply(this,arguments)}const rr=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",nr({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"})))},or=e=>{let{title:t,onGraphOpen:n}=e;const r=Bn();return o().createElement(W.Z,{title:t,className:r.header},o().createElement("div",{className:r.buttonsContainer},o().createElement(Ne.k,{className:r.button,tooltipTitle:y().text("Show Graph"),icon:rr,onClick:n,size:"L"})))};var ar=n(33165);const lr=(0,Q.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function ir(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){sr(e,t,n[t])}))}return e}function sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cr=n(14940);const ur=(0,Q.Z)({resizableHandleContainer:{position:"relative",width:"100%",height:"inherit"},resizableHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $resizableHandle":{visibility:"visible"},".react-grid-item.static &:hover $resizableHandle":{visibility:"hidden"}},resizableHandle:{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)"}}),pr=e=>{const t=t=>{const n=ur();return o().createElement("div",{className:n.resizableHandleContainer},o().createElement("div",{className:n.resizableHandleVisibilityArea},o().createElement("div",{className:U()("viewDraggableHandle",n.resizableHandle)},o().createElement(cr.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithResizableHandle",t},dr=(0,Q.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var mr=n(29103),gr=n(83911),fr=n(48747),br=n(22385);const hr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),yr=(0,Q.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Er=n(13074),vr=n(24338);const xr=(0,Q.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),wr=xr,Sr=e=>{let{totalImages:t}=e;const n=wr(),r=t>1?y().text("photos"):y().text("photo");return o().createElement(B.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Cr(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){Or(e,t,n[t])}))}return e}function Or(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pr=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)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(vr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(x.N5.actions.removeAttribute,s)(Cr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(x.N5.actions.modifyAttribute,s)(Cr({},e,{viewId:d})),imageSize:Ir,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Sr,{totalImages:p.length}))},Nr=(0,Q.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Tr=Nr,Ir={imageMargin:4,imageWidth:162,imageHeight:162};var kr=n(28741);const Dr=(0,Q.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 Zr=n(49734),Rr=n(98808),Ar=n(93428),jr=n(30885);function Lr(){return Lr=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},Lr.apply(this,arguments)}const Mr=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:p,canMark:m}=(0,b.hXd)(c,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:Rr.N.iconButton,onStartRequest:l},h=(0,r.useContext)(d.m),y=(0,r.useCallback)((()=>{i(),s(x.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[s,u.uri,i,h]);return o().createElement(o().Fragment,null,p&&o().createElement(Ar.H,Lr({},f,{onFinishRequest:y})),m&&o().createElement(jr.i,Lr({},f,{onFinishRequest:i})))},Ur=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(Zr.M,{match:r,entity:c,entitiesMap:n,metadata:s,className:yt.U},o().createElement(Et.Z,{uri:(0,b.E_P)(c.uri,r.object.uri),relatedObjectUris:(0,b.wp9)(b.q7e.POTENTIAL_MATCH,{entityUri:c.uri,matchEntityUri:r.object.uri}),objectType:b.q7e.POTENTIAL_MATCH}),o().createElement(Mr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Hr={showTransitiveMatches:!0,showInactiveEntities:!1},_r={order:"asc",field:"score"};var zr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(zr||(zr={}));const Fr=pr((e=>{let{className:t}=e;const n=dr();return o().createElement(F.Z,{className:U()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),Vr=pr((e=>{let{className:t,config:n}=e;return o().createElement(H.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Br=pr((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=we(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(_.Provider,{value:a},o().createElement(ye,{config:n,className:t}))})),Wr=pr((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,b.zeJ)(o,n)),[o,n]),s=(0,r.useMemo)((()=>gn(l)),[l]),c=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:s.filter((0,i.pipe)((0,i.prop)("dataTypeDefinition"),b.YkM,i.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[s]),[u,p]=(0,r.useReducer)(on,c),{searchQuery:d,filters:m,sorting:g,page:f}=u,h=(0,a.useSelector)(x.ZP.selectors.getIsEditableMode),y=(0,r.useMemo)((()=>{const e=((e,t)=>b.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,yn.su)(o,r)})))).orSome([]))(s,m);return e.length?e:null}),[m,s]),E=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:y,page:f,sorting:g,searchQuery:d})),[y,f,g,d]),{changeSearchQuery:v,changePage:w,toggleSort:S,changeFilter:C,toggleFilters:O,changeColumns:P}=(0,Qt.o)({actions:rn,dispatch:p}),N=we(e,E,!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:v,setPage:w,onSort:S,onFilter:C,onToggleFilters:O,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||y||d||h)&&l&&!l.hidden)},N)})(t);return o().createElement(Xt.Provider,{value:l},t&&o().createElement(Un,{config:t,className:n}))})),Gr=pr((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=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),[p,d]=(0,r.useState)(""),[m,g]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{l(0),g((e=>!e))}),[]),b=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),h=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:p,changeSearchQuery:(0,r.useCallback)((e=>{l(0),d(e)}),[]),sortOrder:i,toggleSortOrder:b,sortOption:c,changeSortOption:h,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:m,toggleShowInactive:f}})(t);return o().createElement(ke.Provider,{value:a},o().createElement($t,{config:t,className:n}))})),qr=pr((e=>{let{config:t,className:n}=e;const a=(0,r.useRef)(),{height:l,width:s,tooltip:c}=t,{html:u,visible:p,tooltip:d,customStyles:m}=(0,ar.E)(t),g=lr(),f=d||c;(0,r.useEffect)((()=>{a.current&&u&&(a.current.innerHTML="",u.childNodes.forEach((e=>{a.current.appendChild(e)})))}),[u]);const b=(0,i.reject)(i.isNil,{width:s,height:l});return p?o().createElement("div",{className:g.bodyWrapper},o().createElement(B.Tooltip,{title:f||""},o().createElement("div",{ref:a,style:ir({},b,m),className:U()(g.root,n)}))):null})),Yr=pr((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,Ee._)(),[o,l]=(0,r.useState)([]),s=(0,a.useSelector)(x.ZP.selectors.getEntity);return(0,ve.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){_n(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.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,b.ZiX)(e)||n((0,b.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=Bn(),p=(0,a.useDispatch)(),{id:d,graph:m}=t,g=(0,r.useCallback)((()=>{p(x.ui.actions.openGraph({viewId:d,graphType:m.type}))}),[p,d,m]),f=(0,r.useCallback)((e=>({title:o().createElement($n,{node:e.node})})),[]);return o().createElement(F.Z,{className:n},o().createElement(or,{onGraphOpen:g,title:t.caption}),o().createElement(Gn.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:tr,generateNodeProps:f,onChange:c,getNodeKey:Xn})))))})),$r=pr((e=>{let{config:t,className:n}=e;const l=Dr(),s=(0,a.useSelector)(x.ZP.selectors.getEntity),c=(0,b.wwR)(s),[u,p]=(0,r.useState)(!1),m=(0,r.useCallback)((()=>{p(!0)}),[]),g=(0,r.useCallback)((()=>{p(!1)}),[]),{matches:f,entitiesMap:h,loadMatches:E,total:v}=(0,kr.s)({enabled:!!c,entity:s,options:Hr,filter:"",page:0,sorting:_r,rowsPerPage:3,onStartLoading:m,onFinishLoading:g}),w=(0,r.useCallback)((()=>{E()}),[E]),S=(0,a.useDispatch)(),O=(0,r.useContext)(d.m),P=(0,r.useCallback)((()=>{S(x.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:O}))}),[S,O]),N=(0,r.useMemo)((()=>(0,b.NVY)(c,(0,i.map)(b.ev7,f))),[c,f]),{getCommentsCount:T}=(0,r.useContext)(C.h);(0,r.useEffect)((()=>{T(N)}),[T,N]);const I=v>3&&!(0,i.isEmpty)(f),k=u?zr.Loading:(0,i.isEmpty)(f)?zr.NoData:zr.Loaded;return o().createElement(Oe.X.Provider,{value:h},o().createElement(F.Z,{className:U()(l.root,n)},o().createElement(W.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},k===zr.Loading&&o().createElement(R.Z,null),k===zr.NoData&&o().createElement(B.Typography,{className:l.noData},y().text("No matches found")),k===zr.Loaded&&f.map((e=>o().createElement(Ur,{config:t,entitiesMap:h,match:e,onFinishRequest:w,onStartRequest:m,key:e.object.uri})))),I&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(B.Link,{component:"button",variant:"caption",onClick:P,underline:"none"},y().text("See all"))))))})),Xr=(0,r.lazy)((()=>n.e(6596).then(n.bind(n,46596)).then((e=>({default:pr(e.HierarchyTreeView)}))))),Qr=(0,r.lazy)((()=>n.e(4361).then(n.bind(n,14361)).then((e=>({default:pr(e.RelationshipsTableView)}))))),Kr=pr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const s=yr(),c=(0,a.useSelector)(x.ZP.selectors.getMetadata),u=(0,a.useSelector)(x.ZP.selectors.getEntity),p=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,Ee._)();return(0,r.useEffect)((()=>{i(!0),s((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(hr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:o,loading:l}})(u,c,p),g=(0,r.useMemo)((()=>o().createElement("div",{className:s.fullHeight},o().createElement(R.Z,null))),[s]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(F.Z,{className:U()(s.root,i)},m&&o().createElement(R.Z,null),o().createElement(br.Z,{size:"S",icon:n?gr.Z:mr.Z,onClick:()=>l(t.id),className:s.fullscreenBtn}),o().createElement(fr.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:d,mapContainerClassName:s.fullHeight,mapKey:p,mapOptions:h}))})),Jr=pr((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,s=Tr(),c=(0,a.useDispatch)(),u=(0,a.useSelector)(x.ZP.selectors.getMode),p=(0,a.useSelector)(x.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(x.ZP.selectors.getMetadata),m=(0,b.zeJ)(d,l),g=(0,i.pathOr)([],["attributes",null==m?void 0:m.name],p),f=(0,i.path)(["attributes","paging",l],p),h=g.length,E=t["text-empty"]||y().text("No data found"),v=(0,r.useCallback)((e=>c(x.N5.actions.requestNextPageOfAttributeValues(e))),[c]);return o().createElement(F.Z,{className:n},o().createElement(W.Z,{title:t.caption}),o().createElement("div",{className:s.container},(()=>{if(m){if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:f,requestNextPageOfAttributeValues:v};return o().createElement(Pr,e)}if(h>0){const e={attributeValues:g,attributeType:m,imageSize:Ir,paging:f,parentUri:p.uri,requestNextPageOfAttributeValues:v};return o().createElement(o().Fragment,null,o().createElement(Er.Z,e),o().createElement(Sr,{totalImages:h}))}}return o().createElement(B.Typography,{className:s.noData},E)})()))}));class eo{}eo.ViewTypes=b.ZIY,eo.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case eo.ViewTypes.HierarchyTree:return o().createElement(Xr,{config:r,store:n,className:a});case eo.ViewTypes.HierarchyPaths:return o().createElement(Yr,{config:r,className:a});case eo.ViewTypes.RelationsTable:return o().createElement(Qr,{config:r,store:n,className:a});case eo.ViewTypes.Relations:return o().createElement(Gr,{config:r,className:a});case eo.ViewTypes.Attributes:return o().createElement(Vr,{className:a,config:r});case eo.ViewTypes.SingleAttributeView:return o().createElement(Br,{config:r,className:a});case eo.ViewTypes.TableAttributeView:return o().createElement(Wr,{config:r,className:a});case eo.ViewTypes.MapView:return o().createElement(Kr,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case eo.ViewTypes.CustomView:return o().createElement(qr,{config:r,className:a});case eo.ViewTypes.ImageAttributeView:return o().createElement(Jr,{config:r,className:a});case eo.ViewTypes.PotentialMatchesView:return o().createElement($r,{config:r,className:a})}},eo.getComponent=e=>eo.getComponentBy("class",e)||eo.getComponentBy("react-class",e)||o().createElement(Fr,{className:e.className});const to=eo,no=()=>null,ro=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const s=dr();return o().createElement(r.Suspense,{fallback:o().createElement(no,null)},to.getComponent({config:t,store:n,className:U()(s.component,{[s.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));ro.displayName="ViewComponent";const oo=(0,Q.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function ao(){return ao=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},ao.apply(this,arguments)}const lo=["onConfigChanged","onRemove"],io=e=>{var t;let{layoutItemConfig:n,views:l,className:s,children:c,style:u,isFullscreen:p,onToggleFullscreen:d,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})),h=oo(),y=(0,a.useSelector)(x.ZP.selectors.getGoogleMapKey),{store:E}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const v=f.class===to.ViewTypes.CustomView;return v&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===b.X1H.CLASSIC?null:f.class!==to.ViewTypes.MapView||y?o().createElement("div",ao({},(0,i.omit)(lo,g),{style:u,className:U()(s,{[h.item]:!v})}),o().createElement("div",{className:U()({[h.fixedSizeContainer]:!m})},m,o().createElement(ro,{store:E,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),c):null},so=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:a}=e;return o().createElement(L.Z,{LayoutItem:io,views:t,layout:n,layoutOptions:r,onLayoutChanged:a,draggableHandle:".viewDraggableHandle"})};var co=n(72753),uo=n(43576),po=n(57304),mo=n(3409),go=n(93873),fo=n(22860);function bo(){return bo=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},bo.apply(this,arguments)}const ho=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",bo({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 yo(){return yo=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},yo.apply(this,arguments)}const Eo=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",yo({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"})))},vo=(0,Q.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 xo(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){wo(e,t,n[t])}))}return e}function wo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const So=e=>o().createElement(B.SvgIcon,e,o().createElement(ho,null)),Co=e=>o().createElement(B.SvgIcon,e,o().createElement(Eo,null)),Oo=(e,t,n,r,o)=>e.filter((e=>{let{value:a,permission:l}=e;return!(n&&!(0,b.KIu)(a))&&!!(r&&o||!(0,b.fnZ)(a))&&(0,b.uGe)(l,t)})),Po=e=>{let{className:t,profileBandConfig:n}=e;const l=vo(),s=(0,a.useDispatch)(),c=(0,a.useSelector)(x.ZP.selectors.getCanUserStartProcessFromQuery),u=(0,a.useSelector)(x.ZP.selectors.getEntityWithoutDiff),p=(0,a.useSelector)((e=>x.ZP.selectors.getModifiedEntity(e,u.uri))),d=(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),h=(0,a.useSelector)(x.ZP.selectors.getIsViewMode),E=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),v=(0,a.useSelector)(x.ZP.selectors.getProfileOperation),w=null==u?void 0:u.type,S=(0,r.useMemo)((()=>(0,b.nt9)(d,w)),[w,d]),C=v===b.OXy.Saving,O=v===b.OXy.Cloning||C,[P,N]=(0,r.useState)(!1),T=(0,r.useCallback)((()=>{N(!1)}),[]),I=(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,p=(0,r.useCallback)((0,b.Ian)(l,c),[l,c]),d=(0,b.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)(d),(0,i.propOr)([],"attributes"),(0,i.filter)(b.YkG),(0,i.map)(b.ZaZ))],[(0,i.includes)("*"),(0,i.pipe)((0,i.always)(u||[]),(0,i.map)((0,i.prop)("uri")),(0,i.filter)(p))],[i.T,i.identity]]))(m);s(x.N5.entity.actions.entityCloneRequested({data:xo({},(0,i.pick)(["attributeReplacementMapping"],m),{relationshipTypesToCopy:e}),entityUri:o.uri}))}n()}),[m,n,d,u,o.uri,p]);return m?g:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:T}),k=(0,r.useMemo)((()=>[{label:y().text("Editing"),value:b.fO_.EDITING,description:y().text("Edit profile directly"),icon:uo.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:b.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:So,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:b.fO_.VIEWING,description:y().text("Suggest changes and initiate a workflow review"),icon:co.Z,permission:"READ"}]),[]),D=(0,r.useMemo)((()=>[...I?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:Co,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:Ye.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,I]),Z=!E&&!(0,b.biM)(u)&&!(e=>(0,b.uGe)(b.BDP.READ,e)&&!(0,b.uGe)(b.BDP.UPDATE,e)&&!(0,b.uGe)(b.BDP.DELETE,e)&&!(0,b.uGe)(b.BDP.INITIATE_CHANGE_REQUEST,e))(S),R=(0,b.ZiX)(null==u?void 0:u.uri),A=(0,r.useMemo)((()=>Oo(k,S,R,m,c)),[k,S,m,c,R]),j=(0,r.useMemo)((()=>Oo(D,S,R,m,c)),[D,S,m,c,R]),L=(0,r.useCallback)((e=>{s(x.N5.mode.actions.modeUpdated(e))}),[s]),M=(0,r.useCallback)((()=>{s(x.N5.mode.actions.modeCancelEditing())}),[s]),H=(0,r.useCallback)((()=>{s(x.N5.actions.saveProfile())}),[s]);return o().createElement(o().Fragment,null,o().createElement(po.Z,{className:U()(t,yt.U),entity:f&&p?p:u,showEntityId:null==n?void 0:n.showEntityId},o().createElement(B.Box,{display:"flex",alignItems:"center"},o().createElement(B.Box,{mr:3},f&&o().createElement(B.Box,{className:l.editingButtons},o().createElement(B.Button,{variant:"outlined",onClick:M,"data-reltio-id":"reltio-profile-cancel-editing",disabled:O},y().text("Cancel")),o().createElement(B.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:H,disabled:O},(0,b.fnZ)(g)?y().text("Suggest"):y().text("Save"))),E&&h?o().createElement(mo.Z,null):h&&o().createElement(go.a,null)),Z&&o().createElement(fo.T,{optionsGroup:A,buttonsGroup:j,value:g,onChange:L,disabled:O})),o().createElement(B.Box,{className:l.comments},o().createElement(Et.Z,{uri:u.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:u.uri}),objectType:b.q7e.ENTITY}))),!!I&&o().createElement(Fe.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:I,onDiscard:T,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))};var No=n(71820),To=n(85890),Io=n(26789),ko=n(54362),Do=n(6674),Zo=n(91515),Ro=n(52043),Ao=n(17308),jo=n(39827),Lo=n(80147),Mo=n(76569);const Uo=(0,Q.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),Ho=()=>{const{total:e}=(0,r.useContext)(D.O),t=Uo();return o().createElement(B.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Mo.Z,null))};var _o=n(26313),zo=n(9371),Fo=n(4426);const Vo=(0,Q.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),Bo=()=>{const e=Vo(),{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,_o.Q)(n);return o().createElement(Oe.X.Provider,{value:s},o().createElement(B.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(zo.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(B.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(Fo.Z,{className:e.showMoreIcon}),y().text("Show more"))))};var Wo=n(34120);const Go=(0,Q.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),qo=()=>{const e=Go(),{tasks:t,loading:n}=(0,r.useContext)(D.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(R.Z,null),t&&t.map((e=>o().createElement(Wo.s,{key:e.taskId,task:e}))))};function Yo(){return Yo=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},Yo.apply(this,arguments)}const $o=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["styles"]);return o().createElement("svg",Yo({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"})))))},Xo=()=>{const{commentsMap:e}=(0,r.useContext)(C.h),t=Uo();return o().createElement(B.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement($o,null))};var Qo=n(10159);const Ko=()=>o().createElement(Qo.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.")}),Jo=()=>o().createElement(Qo.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 ea(){return ea=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},ea.apply(this,arguments)}let ta;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History"}(ta||(ta={}));const na=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},ra=()=>{var e,t,n;const l=Uo(),s=(0,a.useSelector)(x.ZP.selectors.isWorkflowSideViewEnabled),c=(0,a.useSelector)(x.ZP.selectors.isWorkflowEnabled),u=(0,a.useSelector)(x.ZP.selectors.isCollaborationSideViewEnabled),p=(0,a.useSelector)(x.ZP.selectors.isCollaborationEnabled),d=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent),m=(0,a.useSelector)(x.ZP.selectors.getMetadata),g=(0,a.useSelector)(x.ZP.selectors.getEntity),f=(0,r.useContext)(D.O),h=(0,r.useContext)(C.h),[E,v]=(0,r.useState)(null),w=(0,r.useCallback)((e=>{v((t=>t===e?null:e))}),[]),S=(0,r.useCallback)((()=>{v(null)}),[]),O=null!==E,P=E===ta.History,{isHistoryEnabled:N,isProfilePersisted:T}=(0,No.C)({isHistoryTabActive:P,entity:g}),{historyFilter:I,onApplyFilter:k,isLoading:Z,historicUris:R,historyWithTotal:A,canLoadMore:j,onLoadMore:L}=(0,To.k6)({entity:g,enabled:N}),M=s&&c&&!(0,b.ZiX)(null==g?void 0:g.uri),U=u&&p,H=(0,b.mdt)(null==h?void 0:h.commentsMap),_=[{buttonProps:{id:ta.Workflow,icon:Ho,tooltipTitle:y().text("Workflow")},content:null!=f&&f.total?o().createElement(qo,null):o().createElement(Ko,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:na(null==f?void 0:f.total),rightContent:o().createElement(Io.G,null)},hidden:!M},{buttonProps:{id:ta.Collaboration,icon:Xo,tooltipTitle:y().text("Collaboration")},content:H?o().createElement(Bo,null):o().createElement(Jo,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:na(H)},hidden:!U},{buttonProps:{id:ta.History,icon:Lo.Z,tooltipTitle:y().text("History")},content:T?o().createElement(ko.Z,{isLoading:Z,historyWithTotal:A,contributorsUris:R,entityUri:null==g?void 0:g.uri,historyEvent:d,onLoadMore:L,canLoadMore:j}):o().createElement(Do.Z,null),headerProps:{content:o().createElement(Zo.Z,{total:T?((null==R?void 0:R.length)||0)+1:void 0,entityType:(0,b.nt9)(m,null==g?void 0:g.type),filter:I,onApplyFilter:k})}}],z=(0,i.reject)((0,i.propEq)("hidden",!0))(_);return(0,r.useEffect)((()=>{var e;null!==(e=_[E])&&void 0!==e&&e.hidden&&S()}),[E,_,S,z]),o().createElement("div",{className:l.wrapper},o().createElement(Ro.h,{open:O,width:480},!(null!==(e=_[E])&&void 0!==e&&e.hidden)&&o().createElement(o().Fragment,null,o().createElement(Ao.P,ea({},null===(t=_[E])||void 0===t?void 0:t.headerProps,{onClose:S})),null===(n=_[E])||void 0===n?void 0:n.content)),o().createElement(jo.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(_),onButtonClick:w,activeIndexId:E}))};var oa=n(39781),aa=n(16715);const la="48px",ia="1px solid rgba(0, 0, 0, .125)",sa=(0,Q.Z)((e=>({accordion:{borderTop:ia,borderBottom:ia,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:la,minHeight:la,"&$accordionSummaryExpanded":{height:la,minHeight:la}},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},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"}}))),ca=sa;var ua=n(38016);const pa=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=ca();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(B.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(B.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(ua.Z,null)},i,o().createElement(B.Typography,{className:l.accordionSummaryHeading},s)),o().createElement(B.AccordionDetails,{className:U()(l.accordionDetails,p)},o().createElement("ul",null,c.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));pa.displayName="ErrorsPanel";const da=(0,i.omit)(["deactivated","path"]),ma=(0,r.memo)((e=>{let{error:t}=e;const n=ca(),r=((e,t)=>{let{type:n,source:r,message:o,attributeTypeUri:a="",attributeType:l}=t;if(n===b.NIO.missed&&r===b.zHr.local){const t=l||(0,b.zeJ)(e,a);return t?y().text("${attribute} is required",{attribute:t.label}):o}return o})((0,a.useSelector)(x.ZP.selectors.getMetadata),t),l=(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[b.HAc.attributeValue,b.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t);return o().createElement("li",null,o().createElement("span",null,r),l&&o().createElement(o().Fragment,null,o().createElement("br",null),o().createElement("span",{className:n.parents},l)))}));ma.displayName="Error";const ga=()=>{const e=ca(),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(da),t.map(da))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(x.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(b.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(oa.Z,{className:U()(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(aa.Z,{className:U()(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 p=(0,r.useCallback)((e=>(t,n)=>{c(n?e:null)}),[]);return u.length>0?o().createElement(pa,{panels:u,expandedPanelId:s,onToggle:p,ErrorComponent:ma}):null},fa=(0,Q.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"}})));var ba=n(87685);const ha=(0,Q.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),ya=e=>{let{notification:t}=e;const n=ha({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(x.ZP.selectors.getAutoCloseInterval),s=t.autoHideDuration||i&&1e3*i||5e3,[c,u]=(0,r.useState)(),[p,d]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(x.ui.actions.closeNotification(t.id)),d(!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]),b=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(B.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),d(!1)}},e.label)))),h=o().createElement(o().Fragment,null,o().createElement(br.Z,{className:n.closeIcon,size:"S",icon:ba.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(B.Portal,{container:document.body},o().createElement(B.Snackbar,{autoHideDuration:s,open:p,classes:{root:n.snackbar},action:b,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:h})),o().createElement(Fe.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")}))},Ea=()=>{const e=(0,a.useSelector)(x.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(ya,{key:e.id,notification:e})))):null},va={},xa=(0,r.memo)((e=>{let{config:t,saveState:n,getSavedState:l}=e;const i=fa({maxWidth:null==t?void 0:t.maxWidth}),s=(0,a.useDispatch)(),c=(0,r.useCallback)((()=>l().then((e=>e.layout?{}:e))),[l]),u=(0,r.useRef)(),p=(0,r.useCallback)((0,b.DsO)(n,1e3),[n]),d=(0,a.useSelector)(x.ZP.selectors.getEntity),m=d?d.type:null,{isLoaded:g,savedState:f=va,updateSavedState:h}=(0,w.w)({getSavedState:c,saveState:p,entityTypeUri:m}),[E,L]=(0,r.useState)([]),[M,U]=(0,r.useState)([]),H=(0,r.useMemo)((()=>v()(t)),[t]),_=(0,a.useSelector)(x.ZP.selectors.getIsHistoryModeEnabled),z=(0,r.useMemo)((()=>(0,b.dvH)(d)),[d]),F=(0,S.C)({objectIds:z}),V=(0,r.useContext)(C.h),B=(0,O.U)(),W=(0,P.v)(null==t?void 0:t.workflow),G=(0,a.useSelector)(x.ZP.selectors.getHistoryEvent);(0,N.a)({entity:d,historyEvent:G});const q=(0,T.u)();(0,r.useEffect)((()=>{if(g){const e=H!==f.configHash,{views:n,layout:r}=(0,b.Mfk)({views:e||!f.views?t.views:f.views,layout:e?t.layout:f.layout});U(n),L(r)}}),[g,f,m]),(0,r.useEffect)((()=>{s(x.N5.views.actions.profileViewsSet(M))}),[s,M]),(0,r.useEffect)((()=>{t.sidePanelViews&&s(x.N5.sidePanelViews.actions.sidePanelViewsLoaded(t.sidePanelViews))}),[t]),(0,r.useEffect)((()=>{u.current&&(u.current.scrollTop=0)}),[null==d?void 0:d.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,b.biM)(n),s=(0,a.useSelector)(x.ZP.selectors.getMode),c=(0,a.useSelector)(x.ZP.selectors.getProfileViews),u=c&&c.length>0,p=(0,r.useCallback)((0,b.DsO)((t=>{t&&e(x.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,b.ZiX)(o)&&s===b.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,s,u])})();const Y=(0,r.useCallback)((e=>{h({layout:e,views:M,configHash:H}),L(e)}),[h,H,M]),$=u.current,X=(0,r.useMemo)((()=>({element:$,priority:["top","bottom"]})),[$]);return o().createElement(I.j.Provider,{value:!0},o().createElement(k.s.Provider,{value:B},o().createElement(C.h.Provider,{value:_?V:F},o().createElement(D.O.Provider,{value:W},o().createElement(Z.m.Provider,{value:q},o().createElement("div",{className:i.perspectiveView},(!g||!(null!=d&&d.uri))&&o().createElement(R.Z,null),g&&null!=d&&d.uri?o().createElement("div",{className:i.profileContainer},o().createElement("div",{className:i.profileWrapper},o().createElement(Po,{profileBandConfig:t.profileBand}),!_&&o().createElement(ga,null),o().createElement("div",{ref:u,className:i.scrollWrapper},o().createElement(A.p.Provider,{value:X},o().createElement(so,{layout:E,onLayoutChanged:Y,views:M})))),o().createElement(ra,null)):o().createElement("div",{className:i.emptyState},o().createElement(j.ZP,{LogoRenderer:j.B9.NO_DATA,text:y().text("No data to display."),variant:j.tC.embedded})),o().createElement(Ea,null)))))))}));xa.displayName="ProfilePerspectiveView";const wa=(0,s.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0}),Sa=e=>{let{config:t,store:n,onResize:h=i.identity,saveState:y,getSavedState:E,qxSandboxApi:v}=e;const x=(0,r.useCallback)((0,b.aYu)(E),[E]),{SnackbarRenderer:w,showSnackbarMessage:S}=(0,p.D)(),C=(0,r.useMemo)((()=>t&&(0,b.Vr9)(t)),[t]);return o().createElement(a.Provider,{store:n},o().createElement(d.m.Provider,{value:null==C?void 0:C.id},o().createElement(m.S.Provider,{value:S},o().createElement(g.Y.Provider,{value:v},o().createElement(s.StylesProvider,{generateClassName:wa},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(o().Fragment,null,o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>h(Math.floor(e),Math.floor(t))}),C&&o().createElement(xa,{config:C,saveState:y,getSavedState:x}),o().createElement(f.Z,{showErrorFromStore:!0}),o().createElement(w,null))))))))};var Ca=n(82842),Oa=n(51229),Pa=n(91131);const Na=(0,Q.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}}))),Ta=e=>{let{total:t=0}=e;const n=Na(),l=(0,a.useDispatch)(),i=(0,r.useContext)(d.m),s=(0,r.useCallback)((()=>{l(x.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(W.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(B.Link,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},y().text("Profile")),o().createElement(Pa.Z,{className:n.icon}),y().text("Tags")),o().createElement(Oa.Z,null),o().createElement(B.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var Ia=n(20404);const ka=(0,Q.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"}}))),Da=e=>{let{label:t}=e;const n=ka();return o().createElement(B.Toolbar,{className:n.toolbar},o().createElement(Ia.Z,{className:n.avatar}),o().createElement(B.Typography,{variant:"h6",className:n.label},t))};function Za(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){Ra(e,t,n[t])}))}return e}function Ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Aa=(0,Q.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}}))),ja=[25,50,100],La=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=Aa(),[s,c]=(0,r.useState)(ja[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(x.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{p(0)}),[t,n,d]);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,Ee._)(),u=(0,Ee._)(),[p,d]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,h]=(0,r.useState)([]),{requestEntities:E,requestTotal:v}=(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,b.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!c,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Za({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return p?(0,b.uqV)({filters:e,options:t,customerTenant:l,dataTenant:c,dtssPath:s}).then((0,i.map)((0,i.assoc)("dataTenant",c))):(0,b.ZOr)(e,t)}),[p,c,l,s]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,Za({offset:t,max:e},o))),[u,o,d]),requestTotal:(0,r.useCallback)((()=>{const e=o;return(p?(0,b.J$m)({filters:u,options:e,customerTenant:l,dataTenant:c,dtssPath:s}):(0,b.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,c,l,s])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{s(x.ui.actions.errorSet((0,b.xU7)(e,y().text("Something went wrong")))),g(0)}),[s]);return(0,r.useEffect)((()=>{c(v()).then(g).catch(w)}),[v,c,w]),(0,r.useEffect)((()=>{d(!0),u(E(l,o*l)).then(h).catch(w).finally((()=>d(!1)))}),[o,l,E,u,w]),{isLoading:p,total:m,entities:f}})({tag:t,entityUri:n,page:u,rowsPerPage:s}),h=(0,r.useRef)(null);(0,r.useEffect)((()=>{h.current&&(h.current.scrollTop=0)}),[f]);const E=g>ja[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(Da,{label:t}),o().createElement("div",{className:U()(l.tagsContainer,{[l.fullHeight]:E})},o().createElement(F.Z,{className:l.tagsView},o().createElement(Ta,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(R.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(Ca.Z,{entities:f})),E&&o().createElement("div",{className:l.pagination},o().createElement(V.Z,{count:g,rowsPerPageOptions:ja,rowsPerPage:s,page:u,onChangePage:p,onChangeRowsPerPage:c}))))))}));La.displayName="TagPerspectiveView";const Ma=(0,s.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Ua=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(d.m.Provider,{value:t.id},o().createElement(s.StylesProvider,{generateClassName:Ma},o().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(La,{tag:n,entityUri:r}),o().createElement(f.Z,{showErrorFromStore:!0}))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
2
2
|
//# sourceMappingURL=6217.js.map
|