@reltio/remotes 1.4.1506 → 1.4.1507

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/2758.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[2758],{52758:(e,t,n)=>{n.d(t,{vC:()=>Tl,_n:()=>al,tM:()=>xl});var r=n(24328),o=n.n(r),a=n(52730),l=n(8598),i=n(17440),c=n(36138),s=n(44443),u=n(22664),p=n(24605),d=n(87451),m=n(39450),g=n(97094),f=n(60115),h=n(585),b=n(16657),y=n(49885),v=n(87918),x=n.n(v),E=n(76536),w=n(41564),C=n(7718),S=n(57730),O=n(26481),P=n(94150),N=n(26005),k=n(72249),Z=n(47137),T=n(99136),R=n(21077),j=n(30268),D=n(67268),I=n(71153),A=n.n(I),M=n(8962);const L=o().createContext(null);L.displayName="SingleAttributeContext";var z=n(60995),U=n(10237),H=n(58662),V=n(94079),F=n(93416),B=n(55299),W=n(98448),q=n(75512),G=n(30553),_=n(66410),$=n(32152),X=n(36444),Q=n(79692);const Y=(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"}}))),K=e=>{let{className:t}=e;const n=Y(),a=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:c,toggleShowInactive:s}=(0,r.useContext)(L),u=()=>i((e=>!e));return o().createElement(o().Fragment,null,o().createElement(V.Button,{ref:a,classes:{root:A()(n.triggerButton,t)},onClick:u},o().createElement(X.Z,null)),o().createElement(V.Popover,{open:l,classes:{paper:n.popupContent},anchorEl:a.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(V.FormControlLabel,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:o().createElement(V.Checkbox,{className:n.checkboxControlCheckbox,checked:c,onChange:e=>s(e.target.checked)}),label:x().text("Show inactive values")})))},J=(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"}}))),ee=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:a,isEditableMode:l}=e;const i=J(),{searchQuery:c,setSearchQuery:s,setPage:u,totalNonVisibleValues:p,nonVisibleValues:d,attributeType:m}=(0,r.useContext)(L),g=l&&(null==m?void 0:m.required);return o().createElement(F.Z,{title:t,className:i.root},g&&o().createElement(B.Z,null),o().createElement(W.Z,{description:null==m?void 0:m.description}),o().createElement(q.Z,{widthToHide:500},o().createElement(G.Z,{height:24,margin:16}),o().createElement(V.Typography,{className:i.totalCaption,variant:"caption"},x().number(n)," ",1===n?x().text("item"):x().text("items"))),o().createElement(_.Z,{nonOvTotal:p,className:i.ovIcon,nonOvValues:d,attributeType:m}),o().createElement($.i,{query:c,onChange:e=>{s(e),u(0)}}),a&&o().createElement(K,null))};var te=n(65549),ne=n(11564),re=n(93140),oe=n(76134),ae=n(96698),le=n(48852);const ie=b.nIW,ce=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ce(n,t)})))):b.P6Y.strings.search(String(e),t),se=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:o=1/0,offset:a=0,searchQuery:l=""}=e;const c=(0,i.pipe)(b.XtP,(0,i.filter)((e=>{let{value:t}=e;return ce(t,l)})))(t,n,r),s=(0,i.filter)(b.OXP,c);return{[(0,b.xy8)(r)]:{[ie(r)]:s.slice(a,a+o),paging:{[r]:{totalOvValues:s.length,totalValues:c.length}}}}},ue=(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"}})));function pe(){return pe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(this,arguments)}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){me(e,t,n[t])}))}return e}function me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ge=[],fe=(0,le.l)(Z.M,((e,t)=>{let{parentUri:n,attributeType:r}=t;const{error:o}=e||{};return{highlightedError:(0,b.Wah)(o,n,r.uri)?e:null}}),(e=>{let{values:t,attributeType:n,parentUri:l,showInactive:c,noDataText:s,highlightedError:u}=e;const p=ue(),{uri:d,required:g,cardinality:f,name:h}=n,v=(0,a.useDispatch)(),E=(0,r.useContext)(m.m),w=(0,a.useSelector)(y.ZP.selectors.getEntity),C=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,w.uri)||{})),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,l,n))),O=(0,a.useSelector)((e=>(0,b.tQX)(l,n,y.ZP.selectors.getProfileErrors(e)))),P=(0,a.useSelector)(y.ZP.selectors.getMode),N=(0,b.xy8)(n),k=(0,i.pipe)((0,i.pathOr)(ge,[N,h]),(0,i.map)((0,i.prop)("uri")))(w),Z=(0,i.pathOr)(ge,[N,h],C),T=Z.map((0,i.prop)("uri")),R=(0,b.ZiX)(w.uri),j=(0,r.useMemo)((()=>(0,b.gjI)({parentUri:l,attributeType:n})),[l,n]),{ref:D,errorClassName:I}=(0,ne.B)({highlightedError:u,isSimple:!0}),M=(0,b.O27)(Z),L=g&&M,z=L?[j]:Z.filter((0,i.pipe)((0,i.prop)("uri"),b.ZiX)),U=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,v)(e.map((e=>de({},e,{viewId:E}))))),[E,v]),H=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,v)(de({},e,{viewId:E}))),[E,v]),F=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,v)(de({},e,{viewId:E}))),[E,v]),B=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,v),[v]),W=(0,r.useCallback)((()=>{const e={parentUri:l,attributeType:n};return U(L&&!(0,b.YkM)(n.type)?[e,e]:[e])}),[U,l,n,L]),q=(0,b.Vg3)({attributeType:n,mode:P}),G={attributeType:n,errors:S,crosswalks:C.crosswalks,mode:P,onAddAttributes:U,onChangeAttribute:H,onDeactivateError:B,showNonOv:c},_=0===z.length&&0===t.length;return!(0,i.isEmpty)(C)&&o().createElement("div",{ref:D,className:I},o().createElement(re.Z,{cardinality:f}),o().createElement(oe.Z,{message:O}),q&&o().createElement(V.Button,{color:"primary",onClick:W,className:p.moreButton},o().createElement(te.Z,{classes:{root:p.icon}}),o().createElement("div",{className:p.buttonLabel},x().text("Add"))),z.map(((e,t)=>o().createElement(ae.Z,pe({key:e.uri},G,{attributeValue:e,lazy:L&&!g,showEmptyEditors:R,ownError:(0,b.ADq)(e,t,d,S),onDeleteAttribute:F})))),z.length>0&&t.length>0&&o().createElement(V.Divider,{className:p.divider}),t.map((e=>{const t=Z.find((0,i.propEq)("uri",e.uri)),n=t||e,r=k.includes(n.uri)&&!T.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:A()({[p.ovFalse]:!(0,b.OXP)(n)})},o().createElement(ae.Z,pe({},G,{attributeValue:n,ownError:(0,b.ADq)(n,null,d,S),onDeleteAttribute:F,state:l})))})),_&&o().createElement(V.Typography,{className:p.noData},s))}));var he=n(81303);const be=e=>{let{values:t,attributeType:n,showInactive:r}=e;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(he.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r}))))},ye=(0,Q.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"hidden",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),ve=15,xe=e=>{let{config:t,className:n}=e;const{caption:l,max:i=ve,showInactiveValuesMenu:c}=t,s=ye(),{values:u,totalVisibleValues:p,page:d,setPage:m,isLoading:g,hasPaging:f,attributeType:h,showInactive:b}=(0,r.useContext)(L),v=(0,a.useSelector)(y.ZP.selectors.getEntityUri),E=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),w=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),C=(0,a.useSelector)(y.ZP.selectors.getPivotingAttributes),S=0!==u.length,O=t["text-empty"]||x().text("No data found");return o().createElement(z.J.Provider,{value:C},o().createElement(U.Z,{className:A()(s.root,n)},o().createElement(ee,{totalVisibleValues:p,caption:l,showInactiveValuesMenu:c,isEditableMode:w}),o().createElement(V.Box,{className:s.content},(()=>{if(g)return o().createElement(T.Z,null);if(h){if(E&&S){const e={values:u,attributeType:h,showInactive:b};return o().createElement(be,e)}if(w){const e={values:u,attributeType:h,parentUri:v,showInactive:b,noDataText:O};return o().createElement(fe,e)}}return o().createElement(V.Typography,{className:s.noData},O)})()),f&&o().createElement(H.Z,{count:p,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:m,classes:{root:s.pagination}})))};var Ee=n(85229),we=n(20562);function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Se=(e,t)=>{const{attributeUri:n,max:o=15}=e,l=(0,a.useSelector)(y.ZP.selectors.getMetadata),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),[d,m]=(0,r.useState)(!1),g=(0,Ee._)(),f=(0,r.useRef)(null),h=(0,a.useDispatch)(),v=(0,a.useSelector)(y.ZP.selectors.getApiPath),E=(0,a.useSelector)(y.ZP.selectors.getTenant),w=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),C=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),S=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),O=(0,a.useSelector)(y.ZP.selectors.getHistoryDiff),P=w.uri,N=ie(n),k=(0,b.xy8)(n);f.current=(0,b.JQy)(w,P,N);const Z=(0,r.useMemo)((()=>(0,b.zeJ)(l,n)),[l,n]),{globalFilter:T}=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:R}=t,j=(0,r.useCallback)((()=>{if(Z&&(0,b.Uty)(Z)&&!(0,b.ZiX)(P)&&(0,b.YOQ)(n)){m(!0);const{page:e,showInactive:r}=t,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,["page","showInactive"]),c=(0,b.biM)(w)||S?se:b.KbL;g(c(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){Ce(e,t,n[t])}))}return e}({metadata:l,entity:w,apiPath:v,tenant:E,parentUri:P,defaultMaxValues:o,attributeTypeUri:n,offset:o*e,globalFilter:T,options:r?"":void 0},a))).then((e=>{const t=(0,i.path)([k],e),r=(0,i.pathOr)([],[N],t);S||h(y.N5.actions.processNextPageOfAttributeValues({parentUri:P,attributeTypeUri:n,attributeTypeName:N,values:r})),s(r.map((e=>{var t;return(null===(t=f.current)||void 0===t?void 0:t.find((0,i.propEq)("uri",e.uri)))||e}))),p((0,i.path)(["paging",n],t))})).catch((e=>{console.error(e),s([]),h(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))})).finally((()=>{m(!1)}))}else s([]),p(null)}),[v,P,E,n,o,l,t,T,Z,S,O]);(0,r.useEffect)((()=>{j()}),[j]),(0,we.D)((()=>{C&&j()}),[C]);const D=(0,i.partition)(b.OXP),[,I]=D(f.current||[]),A=R?[]:I,M=R?"totalValues":"totalOvValues",L=(0,i.ifElse)((0,i.has)(M),(0,i.prop)(M),(0,i.always)(c.length))(u),z=o<L,U=null!=u&&u.totalValues?u.totalValues-L:A.length;return{values:c,isLoading:d,hasPaging:z,totalVisibleValues:L,attributeType:Z,totalNonVisibleValues:U,nonVisibleValues:A}};function Oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Pe=n(37152),Ne=n(3185),ke=n(31274),Ze=n(79026),Te=n(8818),Re=n(90324),je=n(70595);const De=o().createContext(null);De.displayName="RelationsViewStateContext";const Ie=(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"}}))),Ae=e=>{let{className:t}=e;const n=Ie(),a=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:c,toggleSortOrder:s,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(De),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),h=!(0,b.O27)(d),y="asc"===c;return o().createElement(o().Fragment,null,o().createElement(V.Button,{ref:a,classes:{root:A()(n.button,t)},onClick:f},o().createElement(X.Z,null)),o().createElement(V.Popover,{open:m,classes:{paper:n.popupContent},anchorEl:a.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(V.FormControlLabel,{classes:{label:n.checkboxControlLabel},control:o().createElement(V.Checkbox,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:x().text("Show inactive Relationships")}),h&&o().createElement(o().Fragment,null,o().createElement(V.Divider,{className:n.divider}),o().createElement(V.Typography,{className:n.title,variant:"h6"},x().text("Sort by")),o().createElement("div",{className:n.sortControls},o().createElement(Ze.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(Te.k,{tooltipTitle:y?x().text("Ascending"):x().text("Descending"),icon:y?Re.Z:je.Z,onClick:s,className:n.sortOrderButton,size:"L"})))))};Ae.displayName="FilterButton";const Me=Ae,Le=(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 ze=n(61932),Ue=n(55847);const He=o().createContext(null);function Ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Fe(e,t,n[t])}))}return e}function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Be=Math.pow(2,31)-1,We=(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 qe=n(81137);const Ge=e=>{let{label:t}=e;const n=We();return o().createElement(V.Badge,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},o().createElement(ze.Z,null))},_e=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,a.useSelector)(y.ZP.selectors.getDataTenants),n=(0,a.useDispatch)(),{config:o,reloadRelations:l}=(0,r.useContext)(He),i=(0,a.useSelector)(y.ZP.selectors.getEntityUri),[c,s]=(0,r.useState)([]),[u,p]=(0,r.useState)(null),d=(0,a.useSelector)(y.ZP.selectors.getDtssPath),m=(0,a.useSelector)(y.ZP.selectors.getTenant),g=[Ve({},o.content,{offset:0,max:null!==(e=o.maxDtssImport)&&void 0!==e?e:Be})],f=(0,r.useCallback)((()=>{s([]),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 Ve({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(s)}),[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(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong")))))),p(null)}),[i,d,m,o,f,l,u,p]);(0,r.useEffect)((()=>{f()}),[f]);const v=(0,r.useCallback)((()=>p(null)),[]),E=(0,r.useCallback)((e=>p(e)),[]);return{tenants:c,selectedTenant:u,onConfirmImport:h,onCancelConfirmation:v,onImportClick:E}})(),c=We(),s=1===e.length,u=s?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,s?o().createElement("div",{className:c.button},o().createElement(Te.k,{size:"L",icon:ze.Z,tooltipTitle:x().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),o().createElement("div",{className:A()(c.tenant)},u)):o().createElement(Ue.Z,{menuId:"importDT-table-actions",buttonComponent:Te.k,buttonProps:{tooltipTitle:x().text("Import connections"),size:"L",icon:()=>o().createElement(Ge,{label:u})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),o().createElement(qe.Z,{open:!!t,title:x().text("Confirmation"),content:x().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:x().text("Cancel"),saveCaption:x().text("Import"),onDiscard:l,onSave:n})))},$e=e=>{let{title:t,total:n}=e;const a=Le(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(De);return o().createElement(F.Z,{title:t||"",className:a.header},n>0&&o().createElement(q.Z,{widthToHide:400},o().createElement(G.Z,{height:24,margin:16}),o().createElement(V.Typography,{className:a.totalCaption,variant:"caption"},n>1?x().text("${count} items",{count:n}):x().text("${count} item",{count:n}))),o().createElement($.i,{query:l,onChange:i}),o().createElement(_e,null),o().createElement(Me,null))};var Xe=n(11013),Qe=n(27604),Ye=n(22983),Ke=n(34e3),Je=n(31039);const et=(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 tt(){return tt=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},tt.apply(this,arguments)}const nt=e=>{let{label:t,entity:n,children:l}=e,c=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 s=et(),u=(0,Ee._)(),p=(0,a.useSelector)(y.ZP.selectors.getTenant),d=(0,a.useSelector)(y.ZP.selectors.getDtssPath),[m,g]=(0,r.useState)(!1),[f,h]=(0,r.useState)(null);(0,r.useEffect)((()=>{h(null)}),[n]);const v=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&!(0,b.ZiX)(null==n?void 0: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]),x=o().createElement("div",{className:s.tooltipContent},o().createElement("div",{className:s.label},t),m&&o().createElement(V.CircularProgress,{size:16,classes:{colorPrimary:s.progress}}),f&&o().createElement("div",{className:s.secondaryLabel},f));return o().createElement(V.Tooltip,tt({onOpen:v,title:x,disableFocusListener:!0,classes:{tooltip:s.tooltip}},c),l)},rt=(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 ot=n(77277);const at=(0,Q.Z)((()=>({container:{display:"flex"}})));function lt(){return lt=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},lt.apply(this,arguments)}const it=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=at();return o().createElement("div",{className:a.container},o().createElement(ot.Z,lt({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Accept")),o().createElement(ot.Z,lt({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),x().text("Ignore")))},ct=(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"}}))),st=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:l,onRemoveRelation:i,onEditRelation:c,onAcceptRelation:s,onIgnoreRelation:u,renderRelationArrowButton:p}=e;const d=ct(),{entity:m,relation:g}=t,f=(0,b.$qe)(t),h=(0,b.xr3)(t),v=(0,b.iJH)(t),{entityType:E,entityLabel:w,preparedUri:C,relationLabel:S}=rt(t,n),O=(0,b.Fn9)(g)&&(0,b.Fn9)(m),P=(0,a.useSelector)(y.ZP.selectors.getMode),{canRemove:N,canUpdate:k}=(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:P,onRemoveRelation:i,onEditRelation:c,metadata:n,connection:t}),Z=(0,r.useCallback)((()=>i(t.relation.relationUri)),[i,t]),T=(0,r.useCallback)((()=>c(t)),[c,t]),R=(0,r.useCallback)((()=>{s(t)}),[s,t]),j=(0,r.useCallback)((()=>u(t)),[u,t]),D=(N||k)&&l&&!t.suggested?o().createElement(o().Fragment,null,k&&o().createElement(Te.k,{icon:Qe.Z,size:"XS",onClick:T,tooltipTitle:x().text("Edit")}),N&&o().createElement(Te.k,{icon:Ye.Z,size:"XS",onClick:Z,tooltipTitle:x().text("Remove")})):void 0,I=t.suggested?o().createElement(it,{acceptRelation:R,ignoreRelation:j,size:"small",disabled:v}):void 0,M=v?x().text("ignored"):x().text("edited");return o().createElement("div",{className:A()(d.container,{[d.rowInactive]:!O},{[d.removed]:f||v})},o().createElement("div",{className:d.row},p&&p(),o().createElement(Ke.Z,{className:d.entityAvatar,entityType:E}),o().createElement(Je.Z,{value:C,className:d.entityLabelContainer},o().createElement(nt,{label:w,entity:m},o().createElement("span",{className:d.entityLabel},w)),(h||v)&&o().createElement(V.Typography,{variant:"caption",className:d.editedLabel},"(",M,")"),S&&o().createElement("span",{className:d.relationLabel},`, ${S}`)),o().createElement("div",{className:d.editButtonsContent},D),I))}));st.displayName="EditableRelationItem";const ut=st,pt=(0,i.when)(b.Kn2,(0,i.prop)("uri")),dt=(e,t)=>{const n=(e,t)=>(t?(0,b.VGB)(t):[]).map((t=>({type:pt(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 mt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gt=n(98989),ft=n(83543);const ht=(0,Q.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),bt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:a}=e;const l=ht(),{parentEntityUri:i}=n,{contentSecondLevel:c}=r,s={onClick:t,className:l.arrowIcon};return i||!c||(0,b.xvW)(n)?null:a?o().createElement(ft.Z,s):o().createElement(gt.Z,s)},yt=(0,Q.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),vt=e=>{let{config:t,connection:n,children:l}=e;const i=yt(),{showInactive:c}=(0,r.useContext)(De),{connections:s,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,c]=(0,r.useState)(!1),[s,u]=(0,r.useState)(!1),{contentSecondLevel:p}=t,{entity:d}=n,m=(0,a.useSelector)((e=>y.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,d.entityUri)))||[],g=(0,a.useSelector)((e=>y.ZP.selectors.getTotalByViewId(e,t.id,d.entityUri))),{activityFilter:f}=(0,a.useSelector)(y.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){mt(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(y.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:d.entityUri,id:t.id,total:r})),u(!1)}))}),[t.id,p,l,d.entityUri,f,o]),v=(0,r.useCallback)((()=>{i||n.connections||h(),c((e=>!e))}),[h,n.connections,i]);return{connections:m,showSecondLevel:i,toggleShowSecondLevel:v,loadRelations:h,loading:s,total:g}})({config:t,connection:n,relationActivityFilter:c?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY}),f=(0,r.useMemo)((()=>(0,b.Px$)(s)),[s]);return o().createElement(o().Fragment,null,l((()=>o().createElement(bt,{onClick:p,connection:n,config:t,showSecondLevel:u}))),u&&o().createElement(ke.X.Provider,{value:f},o().createElement("div",{className:i.secondLevelContent},o().createElement(Yt,{isLoading:m,config:t,loadRelations:d,connections:s,total:g,parentEntityUri:n.entity.entityUri}))))},xt=(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"}}))),Et=e=>{let{className:t,connections:n=[],config:l,mode:c,noDataText:s,parentEntityUri:u}=e;const p=(0,a.useSelector)(y.ZP.selectors.getMetadata),d=(0,a.useSelector)((e=>y.ZP.selectors.getRelationToAddByViewId(e,l.id))),m=(0,a.useSelector)((e=>y.ZP.selectors.getRelationsToEditByViewId(e,l.id))),g=(0,a.useSelector)(y.ZP.selectors.getEntity),f=(0,a.useSelector)((e=>y.ZP.selectors.getCheckIfCanAddRelations(e,l.content))),h=(0,a.useDispatch)(),v=xt(),E=(0,r.useCallback)((()=>{const e=(0,b.vlo)({config:l,mode:c,metadata:p,parentEntityUri:u});(0,i.pipe)(y.N5.relations.actions.openRelationEditor(l.id),h)(e)}),[l,c,p,h,u]),w=(0,r.useCallback)((e=>{h(y.N5.relations.actions.closeRelationEditor(l.id,e)),h(y.N5.relations.actions.removeRelation(l.id,e));const t=n.find((t=>y.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=y.N5.relations.selectors.getEntityUriFromConnection(t);(0,b.ZiX)(r)&&h(y.N5.modifiedEntities.actions.entityDeleted(r))}),[l,n,h]),C=l.content,S=dt(C.inRelations,C.outRelations),O=(0,r.useCallback)((e=>{const t=(0,i.pipe)((0,i.omit)(["suggested"]),(0,i.evolve)({relation:{relationType:(0,i.always)(S.type),object:(0,i.evolve)({type:(0,i.always)(S.type),attributes:(0,i.always)(null)})}}))(e);h(y.N5.relations.actions.addRelation(l.id,t))}),[h,l,S]),P=(0,r.useCallback)((e=>{h(y.N5.relations.actions.ignoreRelation(l.id,{relationType:S.type,relationDirection:S.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[h,l,S]),[N,k]=(0,i.partition)(b.xvW,n),Z=g&&f,T=0===N.length&&0===k.length,R=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),s=`${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(vt,{config:l,connection:e,key:s},(t=>r?o().createElement(Xe.Z,{connection:r,config:l,mode:c,metadata:p}):o().createElement(ut,{renderRelationArrowButton:t,connection:e,metadata:p,showControls:a,onRemoveRelation:w,onEditRelation:(0,i.pipe)(y.N5.relations.actions.openRelationEditor(l.id),h),onAcceptRelation:O,onIgnoreRelation:P})))},j=Z&&(!d||d&&d.parentEntityUri===u),D=d&&d.parentEntityUri===u;return o().createElement("div",{className:t},j&&o().createElement(V.Button,{color:"primary",onClick:E,className:v.moreButton},o().createElement(te.Z,{classes:{root:v.icon}}),o().createElement("div",{className:v.buttonLabel},x().text("Add"))),D&&o().createElement(Xe.Z,{connection:d,config:l,mode:c,metadata:p}),N.map(R),N.length>0&&k.length>0&&o().createElement(V.Divider,{className:v.divider}),k.map(R),T&&o().createElement(V.Typography,{className:v.noData},s))};var wt=n(19603),Ct=n(94646),St=n(78101),Ot=n(80931);const Pt=(0,Q.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Nt(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){kt(e,t,n[t])}))}return e}function kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zt=e=>{let{connection:t,className:n}=e;const l=Pt(),{relation:c}=t,s=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),p=(0,r.useMemo)((()=>(0,b.xF8)(u,null==c?void 0:c.relationType)),[null==c?void 0:c.relationType,u]),d=(0,r.useMemo)((()=>Nt({attributes:Nt({},y.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)(w.h);(0,r.useEffect)((()=>{!(0,i.isEmpty)(g)&&f(g)}),[f,g]);const h=(0,r.useMemo)((()=>(0,b.wp9)(b.q7e.RELATION,{entityUri:s,connection:t})),[t,s]);return m?o().createElement(St.A.Provider,{value:h},o().createElement(Ot.Z,{className:A()(l.attributesList,n),entity:d,attrTypes:p})):o().createElement("div",{className:A()(l.attributesList,n)},x().text("No attributes"))};var Tt=n(86602),Rt=n(82726);const jt=e=>{let{show:t,onToggle:n,className:r}=e;return o().createElement(Te.k,{className:r,tooltipTitle:t?x().text("Hide attributes of the relationship"):x().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Tt.Z:Rt.Z,onClick:n})},Dt=(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"}}))),It=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:l,ignoreRelation:c}=e;const s=Dt(),u=t.suggested,{entity:p,relation:d}=t,[m,g]=(0,r.useState)(!1),f=(0,a.useSelector)(y.ZP.selectors.getMetadata),{entityType:h,entityLabel:v,preparedUri:x,relationLabel:E}=rt(t,f),w=(0,b.Fn9)(d)&&(0,b.Fn9)(p),C=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),S=p&&d&&(0,b.wp9)(b.q7e.RELATION,{entityUri:C,connection:t})||[];return o().createElement("div",{className:A()(s.container,{[s.rowInactive]:!w},{[s.suggestedWrapper]:u})},o().createElement("div",{className:A()(s.row,wt.U)},n&&n(),o().createElement("div",{className:s.labelWrapper},o().createElement(Ke.Z,{className:s.entityAvatar,entityType:h}),o().createElement(Je.Z,{value:x,className:s.entityLabelContainer},o().createElement(nt,{label:v,entity:p},o().createElement("span",{className:s.entityLabel},v)),E&&o().createElement("span",{className:s.relationLabel},`, ${E}`))),o().createElement("div",{className:s.additionalButtonsWrapper},!(0,i.isEmpty)(S)&&o().createElement(Ct.Z,{className:s.commentsContainer,uri:(0,b.gjS)(d),relatedObjectUris:S,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),u&&o().createElement(it,{size:"small",acceptRelation:l(t),ignoreRelation:c(t)}),!u&&o().createElement(jt,{show:m,onToggle:()=>{g((e=>!e))},className:s.showDetails}))),m&&o().createElement(Zt,{connection:t}))}));It.displayName="RelationItem";const At=It;var Mt=n(52691),Lt=n(16208);const zt=e=>e.filter((e=>5===e.value)).length,Ut=e=>e.filter((e=>1===e.value)).length,Ht=e=>0===e.length?"0%":zt(e)/e.length*100+"%",Vt=e=>0===e.length?"0%":Ut(e)/e.length*100+"%",Ft=(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)"}}))),Bt=e=>{let{ratings:t,className:n}=e;const r=Ft();return o().createElement("div",{className:A()(r.wrapper,n)},o().createElement(V.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:Ht(t)}}),o().createElement("div",{className:r.dislikesScale,style:{width:Vt(t)}})),o().createElement("div",{className:r.counts},o().createElement("div",{className:A()(r.likesCount,r.count)},o().createElement(Mt.Z,{className:r.icon}),zt(t)),o().createElement("div",{className:r.count},o().createElement(Lt.Z,{className:r.icon}),Ut(t))))},Wt=(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}}))),qt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Wt(),i=(0,a.useSelector)(y.ZP.selectors.getUserName),c=t.find((e=>{let{user:t}=e;return t===i})),s=[{text:x().text("Has left the practice"),onClick:()=>r(x().text("Has left the practice"))},{text:x().text("Has moved away"),onClick:()=>r(x().text("Has moved away"))},{text:x().text("Has passed away"),onClick:()=>r(x().text("Has passed away"))},{text:x().text("Has retired"),onClick:()=>r(x().text("Has retired"))},{text:x().text("Other"),onClick:()=>r(x().text("Other"))}];return o().createElement("div",{className:l.wrapper},o().createElement(V.Button,{onClick:n,variant:"text",size:"small",className:A()(l.button,l.likeButton,{[l.isActive]:5===(null==c?void 0:c.value)})},"Agree"),o().createElement(Ue.Z,{buttonProps:{endIcon:o().createElement(ft.Z,null),variant:"text",size:"small",className:A()(l.button,{[l.isActive]:1===(null==c?void 0:c.value)})},buttonContent:1===(null==c?void 0:c.value)?c.comment:"Disagree",menuItems:s,menuId:"disagree-dropdown-menu-button"}))},Gt=(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"}}))),_t=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:l,acceptRelation:c,ignoreRelation:s}=e;const u=Gt(),p=t.suggested,[d,m]=(0,r.useState)(!1),{entity:g,relation:f}=t,h=(0,a.useSelector)(y.ZP.selectors.getMetadata),{entityLabel:v,entityType:x,preparedUri:E,relationLabel:w}=rt(t,h),C=(null==f?void 0:f.ratings)||[],S=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant),O=g&&f&&(0,b.wp9)(b.q7e.RELATION,{entityUri:S,connection:t})||[];return o().createElement("div",{className:A()(u.wrapper,{[u.suggestedWrapper]:p})},o().createElement(V.Box,{display:"flex",minHeight:"44px",className:wt.U},o().createElement(V.Box,{display:"flex",alignItems:"center"},o().createElement(V.Box,{display:"flex",alignItems:"center"},l&&l(),o().createElement(Ke.Z,{entityType:x,className:u.entityTypeIcon})),o().createElement(V.Box,{display:"flex",flexDirection:"column"},o().createElement(Je.Z,{value:E,className:u.entityLabelContainer},o().createElement(nt,{label:v,entity:g},o().createElement("span",{className:u.entityLabel},v))),w&&o().createElement("span",{className:u.relationLabel},w),!p&&o().createElement(qt,{ratings:C,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(Ct.Z,{className:u.commentsContainer,uri:(0,b.gjS)(f),relatedObjectUris:O,objectType:b.q7e.RELATION,allowOnlyOneComment:!0}),p&&o().createElement(it,{acceptRelation:c(t),ignoreRelation:s(t)}),!p&&o().createElement(o().Fragment,null,o().createElement(Bt,{ratings:C,className:u.ratings}),o().createElement(jt,{show:d,onToggle:()=>{m((e=>!e))},className:u.showDetailsButton})))),d&&o().createElement(Zt,{connection:t,className:u.relationAttributes}))},$t=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:c}=e;const{isComplex:s,content:u}=i,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=dt(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(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:a,relation:l}=e,{startDate:i,endDate:c}=l,s=r.direction===b.Nsj.IN,u=s?a.entityUri:n,p=s?n:a.entityUri;(0,b.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:c}).then(t).catch((e=>{o(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong"))))}))}}})(u,l,c),m=(0,r.useMemo)((()=>(0,b.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(w.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(vt,{config:i,connection:e,key:r},(t=>s?o().createElement(_t,{loadRelations:l,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t}):o().createElement(At,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};$t.displayName="RelationsList";const Xt=$t,Qt=(0,Q.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Yt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:c}=e;const s=Qt(),{selectors:u}=y.ZP,p=(0,a.useSelector)(u.getEntity),d=(0,a.useSelector)(u.getMode),m=n["text-empty"]||x().text("No data found");return t?o().createElement(T.Z,null):(0,b.KIu)(d)?o().createElement(Et,{connections:l,className:s.list,key:null==p?void 0:p.uri,config:n,mode:d,noDataText:m,parentEntityUri:c}):i>0?o().createElement(Xt,{config:n,loadRelations:r,connections:l,className:s.list,key:null==p?void 0:p.uri,mainEnityUri:p.uri}):o().createElement(V.Typography,{className:s.noData},m)},Kt=(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}}),Jt=e=>{let{config:t,className:n}=e;const l=Kt(),{page:c,setPage:s,rowsPerPage:u,sortOrder:p,sortOption:d,showInactive:m,searchQuery:g,changeSearchQuery:f}=(0,r.useContext)(De),{selectors:h}=y.ZP,v=(0,a.useSelector)((e=>h.getConnectionsWithDraftsByViewId(e,t.id))),x=(0,a.useSelector)(h.getEntity),E=(0,a.useSelector)((e=>h.getTotalByViewId(e,t.id))),w=(0,a.useSelector)(h.getMode),C=(0,r.useMemo)((()=>({order:p,field:d})),[p,d]);(0,r.useEffect)((()=>{f("")}),[null==x?void 0:x.uri]);const S=(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,Pe.a)({sorting:C,filter:S,page:c,rowsPerPage:u,config:t,entity:x,relationActivityFilter:m?b.Ng6.ALL:b.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,b.Px$)(v)),[v]),k=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,i.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return o().createElement(Ne.u.Provider,{value:x},o().createElement(ke.X.Provider,{value:N},o().createElement(U.Z,{className:n},o().createElement("div",{className:l.container},o().createElement(He.Provider,{value:k},o().createElement($e,{title:t.caption,total:E})),o().createElement("div",{className:l.content},o().createElement(Yt,{isLoading:O,config:t,loadRelations:P,connections:v,total:E}),E>u&&o().createElement(H.Z,{classes:{root:l.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:u,page:c,onChangePage:s}))))))};Jt.displayName="RelationsView";const en=o().createContext(null);en.displayName="TableAttributeContext";var tn=n(86361),nn=n(26180),rn=n(31276);function on(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){an(e,t,n[t])}))}return e}function an(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ln="CHANGE_SEARCH_QUERY",cn=on({},nn.ZP.actions,{changeSearchQuery:(0,rn.zD)(ln)}),sn=(e,t)=>t.type===ln?on({},e,{searchQuery:t.payload,page:0}):nn.ZP.reducer(e,t);var un=n(92332),pn=n(67353);function dn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){mn(e,t,n[t])}))}return e}function mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},fn=(0,Q.Z)((()=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},rowCell:{fontSize:"13px",overflow:"hidden"},blobWrapper:{position:"relative",overflowY:"auto",overflowX:"hidden",whiteSpace:"pre",maxHeight:"100px",boxSizing:"border-box",padding:"15px 25px 0 25px"},defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"15px 25px 0 25px"},updateAttribute:dn({padding:"0 4px",marginLeft:"-4px"},b.zXF[b.Y1q.updateAttribute]),insertAttribute:dn({},b.zXF[b.Y1q.insertAttribute]),deleteAttribute:dn({padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},b.zXF[b.Y1q.deleteAttribute]),description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > div":gn}}))),hn=(0,pn.Z)((e=>{const t=fn(),{description:n}=(null==e?void 0:e.headCellData)||{};return o().createElement("div",{className:t.headCell},o().createElement(un.default,e),o().createElement(W.Z,{description:n,className:t.description}))}));var bn=n(72768),yn=n(95613);const vn=e=>{let{value:t,historyClassName:n}=e;const r=fn();return o().createElement("div",{className:r.blobWrapper,onScroll:rn.UW},o().createElement("span",{className:r[n]},t))},xn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const a=fn(),{value:l,uri:c}=t,{appearance:s}=(0,r.useContext)(N.m),u=(0,i.pipe)(b.IFm,b.o_F)(c,s);if(n.type===b.oS0.TYPE_BLOB)return o().createElement(vn,{value:l,historyClassName:u});{const e=o().createElement(bn.Z,{value:l,dataTypeDefinition:n});return o().createElement(yn.Z,{value:e},o().createElement("div",{className:a.defaultWrapper},o().createElement("span",{className:a[u]},e)))}};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}const wn=(e,t)=>{const{uri:n,label:r,children:o,name:a,description:l}=e;return(0,i.reject)(i.isNil,{id:(0,b.Tde)(n,t),label:r,description:l,dataTypeDefinition:(0,b.PFL)(e),children:null==o?void 0:o.map((e=>wn(e,t.concat({name:a}))))})},Cn=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),Sn=e=>{if((0,b.vZp)(e)){const t=Cn(e);return t.length>1?t.slice(0,-1):null}return null},On=(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){En(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:Sn(e.id),headCellRenderer:hn,rowCellValueRenderer:xn})));var Pn=n(37754);function Nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kn=n(1876),Zn=n(60894);const Tn=(0,Q.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Rn=e=>{let{title:t}=e;const n=Tn(),l=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),{attributeType:i,searchQuery:c,setSearchQuery:s,filters:u,onToggleFilters:p,allColumnsData:d,visibleColumns:m,onChangeColumns:g}=(0,r.useContext)(en),f=l&&(null==i?void 0:i.required);return o().createElement(F.Z,{title:t,className:n.header},f&&o().createElement(B.Z,null),o().createElement(W.Z,{description:null==i?void 0:i.description}),o().createElement($.i,{query:c,onChange:s}),o().createElement(kn.Z,{enabled:!!u,onClick:p}),o().createElement(G.Z,{height:24,margin:4}),o().createElement(Zn.Z,{columnsData:d,selectedColumns:m,onChangeColumns:g}))};function jn(){return jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}const Dn=(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=fn();return o().createElement("div",{className:A()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,jn({key:t,value:e},l)))))}));var In=n(52016),An=n(85709);const Mn=(0,Q.Z)((()=>({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)",marginBottom:"15px"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}}))),Ln=e=>{let{onEdit:t,onRemove:n}=e;return o().createElement(o().Fragment,null,t&&o().createElement(Te.k,{tooltipTitle:x().text("Edit"),icon:Qe.Z,size:"L",onClick:t}),n&&o().createElement(Te.k,{tooltipTitle:x().text("Remove"),icon:Ye.Z,size:"L",onClick:n}))};function zn(){return zn=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},zn.apply(this,arguments)}const Un=e=>{let{columnsData:t,values:n,sorting:l,onSort:c,filters:s,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.xIV)(e))(t))(Cn(e),t))(r,e),t)}),{}),(0,i.assoc)("value",e))(t))))(n,t)),[n,t]),h=(0,r.useMemo)((()=>On(t)),[t]),v=Mn(),x=(0,a.useSelector)(y.ZP.selectors.getMode),E=(0,b.KIu)(x),w=(0,a.useSelector)(y.ZP.selectors.getMetadata),C=(0,a.useSelector)(y.ZP.selectors.getEntityUri),S=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,C)||{})),{attributeType:O}=(0,r.useContext)(en),P=(0,r.useCallback)((e=>o().createElement(Dn,zn({},e,{isSorted:!!l&&l.field===e.columnData.id}))),[l]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:T}=(0,In.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!E||g.includes((0,i.pipe)((0,i.path)([N]),(0,i.prop)("uri"))(n))),[N,g,n,E]),j="number"==typeof N&&(D=(0,i.path)([N],n),T(p)&&(0,b.xv5)({attributeType:O,mode:x,attributeValue:D,metadata:w,isReltioCrosswalk:(0,b.KVV)(S.crosswalks,D)}));var D;const I="number"==typeof N&&(e=>Z(p)&&(0,b.yv0)({attributeType:O,mode:x,attributeValue:e,isReltioCrosswalk:(0,b.KVV)(S.crosswalks,e)}))((0,i.path)([N],n)),A=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);I&&d(e)}),[d,N,n,I]),M=(0,r.useCallback)((()=>{const e=(0,i.path)([N],n);if(!j)return;const t={parentUri:C,attributeType:O,uri:e.uri,value:e};m(t),k(null)}),[N,n,m,j,O,C]),L=R||!j&&!I?void 0:o().createElement(Ln,{onEdit:I?A:void 0,onRemove:j?M:void 0}),z=(0,r.useMemo)((()=>({deletedUris:g})),[g]);return o().createElement("div",{className:v.tableContainer},o().createElement(An.Z,{autosizing:!0,maxHeight:477,columnsData:h,rowsData:f,sorting:l,onSort:c,filters:s,onFilter:u,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:k,hoverRowIndex:N,hoveredRowRightContent:L,context:z,classes:{hoveredRowRightContentWrapper:v["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:v["row-cell__buttons-container"]}}))};function Hn(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){Vn(e,t,n[t])}))}return e}function Vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fn=[],Bn=(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 Wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:l,onDeleteAttribute:c,hasChanges:s,attributeValue:u}=e;const p=Bn(),d=(0,a.useDispatch)(),g=(0,r.useContext)(m.m),{attributeType:f}=(0,r.useContext)(en),h=(0,a.useSelector)(y.ZP.selectors.getEntityUri),v=(0,a.useSelector)(y.ZP.selectors.getMode),E=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,h)||{})),w=(0,b.YkG)(f)&&(0,b.ZiX)((0,b.bwT)(u)),C=(0,a.useSelector)((e=>w?y.ZP.selectors.getModifiedEntities(e):void 0)),S=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,h,f))),O=(0,b.ZiX)(h),P=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.addAttributes,d)(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){Wn(e,t,n[t])}))}return e}({},e,{viewId:g}))))),[g,d]),N=(0,r.useCallback)((0,i.pipe)(y.N5.errors.actions.errorDeactivated,d),[d]);return o().createElement(o().Fragment,null,o().createElement(ae.Z,{expanded:!0,attributeValue:u,showEmptyEditors:O,onDeleteAttribute:c,onDeactivateError:N,onChangeAttribute:t,onAddAttributes:P,mode:v,crosswalks:E.crosswalks,errors:S,attributeType:f,ownError:(0,b.ADq)(u,null,f.uri,S)}),o().createElement("div",{className:p.actionButtons},o().createElement(V.Button,{onClick:()=>n(u)},x().text("Cancel")),o().createElement(V.Button,{color:"primary",disabled:!s,onClick:()=>l(u,C)},x().text("Apply"))))};var Gn=n(54198);const _n=e=>(null==e?void 0:e.type)===b.NIO.missed,$n=(0,i.curry)(((e,t)=>e.find((0,i.pipe)((0,i.prop)("uri"),(0,i.either)((0,b.sOy)(t.parentUri),(0,i.equals)(t.uri)))))),Xn=(0,Q.Z)((()=>({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"}}))),Qn=e=>{let{config:t,editingValues:n,modifiedValues:l,onChangeAttribute:c,onDeleteAttribute:s,onAdd:u,onCancel:p,onApply:d,onStartEditing:m,onReset:g,checkHasChanges:f,highlightedError:h,highlightedAttributeError:v}=e;const E=Xn(),{attributeType:w}=(0,r.useContext)(en),C=(0,a.useSelector)(y.ZP.selectors.getMode),{canCreate:S}=(0,In.l)();(e=>{let{onStartEditing:t,modifiedValues:n,highlightedError:o,highlightedAttributeError:l}=e;const{attributeType:c}=(0,r.useContext)(en),s=(0,a.useSelector)(y.ZP.selectors.getEntityUri),u=(0,a.useSelector)((e=>y.ZP.selectors.getActiveErrorsForAttributesPager(e,s,c))),p=(0,r.useRef)(!0),d=(0,Gn.u)(),m=(0,r.useMemo)((()=>u.find((0,i.both)(_n,(e=>(0,b.Wah)(e,s,c.uri))))),[u,s,c.uri]);(0,r.useEffect)((()=>{m&&1===n.length&&t(n[0])}),[m]),(0,r.useEffect)((()=>{p.current&&u.length&&((0,i.pipe)((0,i.map)($n(n)),(0,i.reject)(i.isNil),(0,i.forEach)(t))(u),p.current=!1)}),[u]),(0,r.useEffect)((()=>{_n(o)&&1===n.length&&t(n[0])}),[o]),(0,r.useEffect)((()=>{if(l){const e=$n(n,l);e&&t(e)}}),[l]),(0,r.useEffect)((()=>{const e=d((e=>{e.type===y.N5.constants.ProfileActions.SAVE_PROFILE&&(p.current=!0)}));return()=>e()}),[d])})({onStartEditing:m,modifiedValues:l,highlightedError:h,highlightedAttributeError:v});const O=S(t)&&w&&(0,b.Vg3)({attributeType:w,mode:C})&&!n.length;return(0,r.useEffect)((()=>()=>g()),[g]),o().createElement("div",{className:E.editor},O&&o().createElement(V.Button,{color:"primary",onClick:u,className:E.addButton},o().createElement(te.Z,{classes:{root:E.icon}}),o().createElement("div",{className:E.buttonLabel},x().text("Add"))),n.map((e=>o().createElement(qn,{key:e.uri,attributeValue:e,onChangeAttribute:c,onDeleteAttribute:s,onCancel:p,onApply:d,hasChanges:f(e)}))))},Yn=(0,le.l)(Z.M,((e,t)=>{let{entityUri:n,attributeType:r}=t;const{error:o}=e||{},a=(0,b.Wah)(o,n,r.uri);return{highlightedError:a?e:null,highlightedAttributeError:o&&!a&&(0,b.nsY)(r,o)&&(0,b.vyG)(n,o)?e:null}}),(e=>{let{config:t,highlightedError:n,highlightedAttributeError:l}=e;const c=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),{values:s,visibleColumns:u,onFilter:p,onSort:d,filters:g,sorting:f,allColumnsData:h}=(0,r.useContext)(en),{onDeleteAttribute:v,onStartEditing:x,onChangeAttribute:E,onAdd:w,onCancel:C,onApply:S,onReset:O,checkHasChanges:P,modifiedValues:N,editingValues:k,deletedUris:Z}=(()=>{const[e,t]=(0,r.useState)(),[n,o]=(0,r.useState)([]),l=(0,a.useDispatch)(),c=(0,a.useSelector)(y.ZP.selectors.getMode),s=(0,a.useSelector)(y.ZP.selectors.getEntityUri),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),p=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,s)||{})),d=(0,r.useContext)(m.m),{attributeType:g,values:f}=(0,r.useContext)(en),h=(0,b.KIu)(c),v=(0,b.xy8)(g),x=(0,i.pathOr)(Fn,[v,null==g?void 0:g.name],p),E=(0,r.useMemo)((()=>(0,b.gjI)({parentUri:s,attributeType:g})),[s,g]),w=(0,b.O27)(x),C=g.required&&w,S=(0,r.useMemo)((()=>C?[E]:x),[E,x,C]),O=(0,r.useMemo)((()=>[...S.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=>S.find((0,i.propEq)("uri",e.uri))||e))(f)].map((e=>{var t;return null!==(t=n.find((0,i.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[S,n,e,f]),P=(0,r.useMemo)((()=>(0,i.pipe)((0,i.map)((0,i.prop)("uri")),(0,i.filter)((e=>!S.find((0,i.propEq)("uri",e)))))(h?f:[])),[S,f,h]),N=S.filter((t=>{let{uri:r}=t;return r===e||n.find((0,i.propEq)("uri",r))})),k=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.modifyAttribute,l)(Hn({},e,{viewId:d}))),[d,l]),Z=(0,r.useCallback)((e=>(0,i.pipe)(y.N5.actions.removeAttribute,l)(Hn({},e,{viewId:d}))),[d,l]),T=(0,r.useCallback)((()=>{const e=(0,b.gjI)({parentUri:s,attributeType:g});t(e.uri),k(Hn({},e,{value:(0,b.GPx)({attributeTypes:g.attributes,parentUri:e.uri,mode:c,metadata:u}),attributeType:g}))}),[s,g,u,c,k]),R=(0,r.useCallback)((e=>{o((t=>t.find((0,i.propEq)("uri",e.uri))?t:[...t,e]))}),[o]),j=(0,r.useCallback)((e=>{const r=n.find((0,i.propEq)("uri",e.uri));if(r){const t={attributeType:g,value:r,uri:e.uri};o((e=>(0,i.without)([r],e))),w||k(t)}else{const n={value:e,attributeType:g,uri:e.uri};t(null),Z(n)}l(y.N5.errors.actions.errorsSet([]))}),[Z,k,o,w,n,g,l]),D=(0,r.useCallback)(((e,t)=>{const n=(0,b.q5j)(u,g,e,t).map((n=>Hn({},n,{path:(0,b.Z9i)({entityUri:s,metadata:u,entitiesMap:t||{[s]:(0,b.PeS)(g,e)}},n.uri||n.parentUri)})));return l(y.N5.errors.actions.errorsSet(n)),0===n.length}),[l,s,g,u]),I=(0,r.useCallback)(((e,n)=>{D(e,n)&&(t(null),o((t=>{const n=t.find((0,i.propEq)("uri",e.uri));return n?(0,i.without)([n],t):t})))}),[o,t,D]),A=(0,r.useCallback)((()=>{o([]),t(null)}),[]);return{checkHasChanges:e=>n.find((0,i.propEq)("uri",e.uri))!==e,onChangeAttribute:k,onDeleteAttribute:Z,onAdd:T,onCancel:j,onApply:I,onStartEditing:R,onReset:A,modifiedValues:O,editingValues:N,deletedUris:P}})(),{ref:T,errorClassName:R}=(0,ne.B)({highlightedError:n,isSimple:!0}),j=c?N:s,D=(0,r.useMemo)((()=>u.map((e=>h.find((0,i.propEq)("id",e))))),[u,h]);return o().createElement("div",{ref:T,className:R},c&&o().createElement(Qn,{config:t,editingValues:k,modifiedValues:N,onChangeAttribute:E,onDeleteAttribute:v,onAdd:w,onReset:O,onCancel:C,onApply:S,onStartEditing:x,checkHasChanges:P,highlightedError:null==n?void 0:n.error,highlightedAttributeError:null==l?void 0:l.error}),D.length>0&&o().createElement(Un,{columnsData:D,config:t,values:j,filters:g,onFilter:p,sorting:f,onSort:d,onEdit:x,onDeleteAttribute:v,deletedUris:Z}))})),Kn=(0,Q.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",overflow:"hidden"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"}}))),Jn=15,er=e=>{let{config:t,className:n}=e;const{caption:l,max:i=Jn}=t,c=Kn(),s=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{totalVisibleValues:u,attributeType:p,showTable:d,hasPaging:m,isLoading:g,page:f,setPage:h}=(0,r.useContext)(en);return o().createElement(U.Z,{className:A()(c.root,n)},d?o().createElement(o().Fragment,null,o().createElement(Rn,{title:l}),o().createElement("div",{className:c.content},o().createElement(Yn,{config:t,attributeType:p,entityUri:s}),m&&o().createElement(H.Z,{count:u,rowsPerPageOptions:[],rowsPerPage:i,page:f,onChangePage:h}),g&&o().createElement(T.Z,null))):o().createElement(o().Fragment,null,o().createElement(F.Z,{title:l,className:c.header},o().createElement(W.Z,{description:null==p?void 0:p.description})),o().createElement(V.Typography,{className:c.noData},x().text("No data"))))};var tr=n(58600);function nr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let rr=0;const or=()=>rr++,ar=e=>{const t={children:[],nodeId:or()};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,c={entity:l,children:[],nodeId:or(),expanded:!0,rootIndex:i?n+1:void 0};i&&(c.root=i),o.children.push(c),o=c}}return t.children};var lr=n(5598);const ir=(0,Q.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.primary.main,lineHeight:"15px"},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"},errorMessage:{fontSize:"13px",margin:"0 16px 0",lineHeight:"1.4",color:e.palette.text.secondary}})));var cr=n(1242);const sr=o().createContext(null),ur=e=>{e.target.src=cr},pr=e=>{let{node:t}=e;const{entity:{label:n,uri:l},nodeId:i}=t,c=ir(),s=(0,a.useSelector)(y.ZP.selectors.getAbsoluteImagePath),u=(0,a.useSelector)(y.ZP.selectors.getMetadata),{uri:p}=(0,a.useSelector)(y.ZP.selectors.getEntity),[d,m]=(0,r.useState)(),g=(0,r.useContext)(sr),f=l===p,h=(0,b.nt9)(u,t.entity.type)||{},v=(0,b.VD3)(u,h,"typeGraphIcon"),x=v&&(0,b.vPL)(s,v);return o().createElement("div",{className:c.wrapper,"data-node-id":i},o().createElement("div",{ref:m,className:c.container},o().createElement(V.Avatar,{alt:"Node icon",className:A()(c.avatar),src:x||cr,onError:ur}),o().createElement(lr.Z,{isSelected:f,title:n,entityUri:l,viewId:g.id,anchorEl:d})))},dr=((0,r.memo)(pr),e=>{let{node:t}=e;return t.nodeId}),mr=(0,Q.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block","&:after":{content:"''",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)",width:"1px",left:"50%",bottom:"0",height:`calc(100% - ${br.rowHeight}px)`}},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"calc(50% - 1px)",top:0,height:br.rowHeight/2+"px",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:br.rowHeight/2+"px",left:"calc(50% - 1px)",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 gr(){return gr=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},gr.apply(this,arguments)}function fr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hr(){return hr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hr.apply(this,arguments)}const br={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:c,treeIndex:s,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=mr();return o().createElement("div",hr({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:c,treeIndex:s})}},o().createElement("div",{"aria-label":a.expanded?"Collapse":"Expand",className:A()(g.button,a.expanded?g.expandedButton:g.collapsedButton)})),o().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:a,path:c,treeIndex:s}):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,c=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"]),s=mr(),u=a.length,p=[];a.forEach(((e,t)=>{p.push(o().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:s.lineBlock},l.root&&o().createElement("div",{className:s.rootIndex},l.rootIndex,"."),t===u-1&&0!==t&&o().createElement(o().Fragment,null,o().createElement("div",{className:s.verticalLine}),o().createElement("div",{className:s.horizontalLineRight}))))}));const d=l.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,h=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){fr(e,t,n[t])}))}return e}({},c.style,{width:f});return o().createElement("div",gr({},c,{className:s.node,style:h}),p,o().createElement("div",{className:s.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function yr(){return yr=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},yr.apply(this,arguments)}const vr=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",yr({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"})))},xr=e=>{let{title:t,onGraphOpen:n}=e;const a=ir(),{showNavigateToGraph:l}=(0,r.useContext)(d.Y);return o().createElement(F.Z,{title:t,className:a.header},l&&o().createElement("div",{className:a.buttonsContainer},o().createElement(Te.k,{className:a.button,tooltipTitle:x().text("Show Graph"),icon:vr,onClick:n,size:"L"})))},Er=e=>dr({node:e});var wr=n(9757);const Cr=(0,Q.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function Sr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){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,className:n}=e;const a=(0,r.useRef)(),l=(0,r.useRef)(),[c,s]=(0,r.useState)(!1),{height:u,width:p,tooltip:d}=t,{html:m,visible:g,tooltip:f,customStyles:h,popup:b}=(0,wr.E)(t),y=Cr(),v=f||d;(0,r.useEffect)((()=>{a.current&&m&&(a.current.innerHTML="",Array.from(m.childNodes).forEach((e=>{a.current.appendChild(e)})))}),[m]),(0,r.useEffect)((()=>{s(!!b)}),[b]),(0,r.useEffect)((()=>{c&&l.current&&(l.current.innerHTML="",b&&Array.from(b.childNodes).forEach((e=>{l.current.appendChild(e)})))}),[c,b]);const x=(0,i.reject)(i.isNil,{width:p,height:u});return g?o().createElement("div",{className:y.bodyWrapper},o().createElement(V.Dialog,{ref:l,open:!!b}),o().createElement(V.Tooltip,{title:v||""},o().createElement("div",{ref:a,style:Sr({},x,h),className:A()(y.root,n)}))):null};var Nr=n(14940);const kr=(0,Q.Z)({dragHandleContainer:{position:"relative",width:"100%",height:"inherit"},dragHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $dragHandle":{visibility:"visible"},".react-grid-item.static &:hover $dragHandle":{visibility:"hidden"}},dragHandle:{position:"absolute",width:"100%",display:"flex",justifyContent:"center",top:"-3px",zIndex:11,cursor:"move",visibility:"hidden"},dragIcon:{transform:"translateX(-50%) rotate(90deg)",color:"rgba(0, 0, 0, 0.3)"}}),Zr=e=>{const t=t=>{const n=kr();return o().createElement("div",{className:n.dragHandleContainer},o().createElement("div",{className:n.dragHandleVisibilityArea},o().createElement("div",{className:A()("viewDraggableHandle",n.dragHandle)},o().createElement(Nr.Z,{className:n.dragIcon}))),o().createElement(e,t))};return t.displayName="WithDragHandle",t};var Tr=n(2256);const Rr=e=>{const t=t=>o().createElement(Tr.Z,{error:o().createElement(R.ZP,{LogoRenderer:R.B9.ERROR,text:"",secondaryText:x().text("Something went wrong"),variant:R.tC.small})},o().createElement(e,t));return t.displayName="WithErrorBoundary",t},jr=(0,Q.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var Dr=n(29103),Ir=n(83911),Ar=n(95299),Mr=n(22385);const Lr=(0,i.pipe)((0,i.path)(["point","lat"]),(0,i.both)((0,i.gt)(90),(0,i.lt)(-90))),zr=(0,Q.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Ur=n(13074),Hr=n(24338);const Vr=(0,Q.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Fr=Vr,Br=e=>{let{totalImages:t}=e;const n=Fr(),r=t>1?x().text("photos"):x().text("photo");return o().createElement(V.Typography,{variant:"caption",className:n.caption},`${t} ${r}`)};function Wr(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){qr(e,t,n[t])}))}return e}function qr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Gr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:l}=e;const c=(0,a.useDispatch)(),s=(0,a.useSelector)(y.ZP.selectors.getEntity),u=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,s.uri)||{})),p=(0,i.pathOr)([],["attributes",n.name],u),d=t.id;return o().createElement(o().Fragment,null,o().createElement(Hr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,i.pipe)(y.N5.actions.removeAttribute,c)(Wr({},e,{viewId:d})),parentUri:u.uri,onChangeAttribute:e=>(0,i.pipe)(y.N5.actions.modifyAttribute,c)(Wr({},e,{viewId:d})),imageSize:Xr,paging:r,requestNextPageOfAttributeValues:l}),o().createElement(Br,{totalImages:p.length}))},_r=(0,Q.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),$r=_r,Xr={imageMargin:4,imageWidth:162,imageHeight:162};var Qr=n(28741),Yr=n(49734),Kr=n(98808),Jr=n(93428),eo=n(30885);function to(){return to=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},to.apply(this,arguments)}const no=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const c=(0,a.useDispatch)(),s=(0,a.useSelector)(y.ZP.selectors.getMetadata),u=(0,a.useSelector)(y.ZP.selectors.getEntity),{canMerge:p,canMark:d}=(0,b.hXd)(s,t,n.object,u,n.matchRules),g=(0,r.useMemo)((()=>[n.object]),[n.object]),f={entity:u,entities:g,mode:Kr.N.iconButton,onStartRequest:l},h=(0,r.useContext)(m.m),v=(0,r.useCallback)((()=>{i(),c(y.N5.entity.actions.loadEntity({viewId:h,uri:u.uri}))}),[c,u.uri,i,h]);return o().createElement(o().Fragment,null,p&&o().createElement(Jr.H,to({},f,{onFinishRequest:v})),d&&o().createElement(eo.i,to({},f,{onFinishRequest:i})))},ro=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const c=(0,a.useSelector)(y.ZP.selectors.getMetadata),s=(0,a.useSelector)(y.ZP.selectors.getEntity);return o().createElement(Yr.M,{match:r,entity:s,entitiesMap:n,metadata:c,className:wt.U},o().createElement(Ct.Z,{uri:(0,b.E_P)(s.uri,r.object.uri),relatedObjectUris:(0,b.wp9)(b.q7e.POTENTIAL_MATCH,{entityUri:s.uri,matchEntityUri:r.object.uri}),objectType:b.q7e.POTENTIAL_MATCH}),o().createElement(no,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},oo=(0,Q.Z)((e=>({root:{display:"flex",flexDirection:"column",minHeight:"52px"},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)"}}))),ao={showTransitiveMatches:!0,showInactiveEntities:!1},lo={order:b.KM9.asc,field:"score"};var io;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(io||(io={}));const co=e=>(0,i.pipe)(Rr,Zr)(e),so=co((e=>{let{className:t}=e;const n=jr();return o().createElement(U.Z,{className:A()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),uo=co((e=>{let{className:t,config:n}=e;return o().createElement(M.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),po=co((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),c=(0,r.useMemo)((()=>({page:o,searchQuery:t,showInactive:l})),[o,t,l]),s=Se(e,c),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){Oe(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:a,page:o,toggleShowInactive:u,showInactive:l},s)})(n);return o().createElement(L.Provider,{value:a},o().createElement(xe,{config:n,className:t}))})),mo=co((e=>{let{config:t,className:n}=e;const l=(e=>{var t;const{attributeUri:n}=e,o=(0,a.useSelector)(y.ZP.selectors.getMetadata),l=(0,r.useMemo)((()=>(0,b.zeJ)(o,n)),[o,n]),c=(0,r.useMemo)((()=>l?((e,t)=>(0,i.pipe)(((e,t)=>(0,b.WN0)(e,t)),(0,i.map)((e=>wn(e,[t]))),(0,i.chain)(b.HQx),(0,i.uniqBy)((0,i.prop)("id")))(e,t))(o,l):[]),[o,l]),s=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:c.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})),[c]),[u,p]=(0,r.useReducer)(sn,s),{searchQuery:d,filters:m,sorting:g,page:f}=u,h=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),v=(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,Pn.su)(o,r)})))).orSome([]))(c,m);return e.length?e:null}),[m,c]),x=(0,r.useMemo)((()=>(0,i.reject)(i.isNil,{filters:v,page:f,sorting:g,searchQuery:d})),[v,f,g,d]),{changeSearchQuery:E,changePage:w,toggleSort:C,changeFilter:S,toggleFilters:O,changeColumns:P}=(0,tn.o)({actions:cn,dispatch:p}),N=Se(e,x);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){Nn(e,t,n[t])}))}return e}({},u,{setSearchQuery:E,setPage:w,onSort:C,onFilter:S,onToggleFilters:O,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||v||d||h)&&l&&!l.hidden),allColumnsData:c},N)})(t);return o().createElement(en.Provider,{value:l},t&&o().createElement(er,{config:t,className:n}))})),go=co((e=>{let{config:t,className:n}=e;const l=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,b.fS6)(l,t),s=(e=>{var t;const n=(0,r.useMemo)((()=>(0,i.pipe)(Object.entries,(0,i.map)((e=>{let[t,n]=e;return{value:t,label:n}})),(0,i.unless)((e=>(0,b.O27)(e)||e.some((0,i.propEq)("value","name"))),(0,i.append)({label:x().text("Name"),value:"name"})))(e.sortOptions||{})),[e.sortOptions]),o=Number(e.max)||15,[a,l]=(0,r.useState)(0),[c,s]=(0,r.useState)(e.sortOrder||"asc"),[u,p]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[d,m]=(0,r.useState)(""),[g,f]=(0,r.useState)(!1),h=(0,r.useCallback)((()=>{l(0),f((e=>!e))}),[]),y=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),v=(0,r.useCallback)((e=>{l(0),p(e)}),[]);return{searchQuery:d,changeSearchQuery:(0,r.useCallback)((e=>{l(0),m(e)}),[]),sortOrder:c,toggleSortOrder:y,sortOption:u,changeSortOption:v,sortOptions:n,page:a,setPage:l,rowsPerPage:o,showInactive:g,toggleShowInactive:h}})(c);return o().createElement(De.Provider,{value:s},o().createElement(Jt,{config:c,className:n}))})),fo=co(Pr),ho=co((e=>{let{config:t,className:n}=e;const{id:l,caption:c,graph:u}=t,p=null==u?void 0:u.type,d=ir(),m=(0,a.useDispatch)(),g=(0,a.useSelector)(y.ZP.selectors.getEntityUri),{treeData:f,setTreeData:h,errorMessage:v}=((e,t)=>{const n=(0,Ee._)(),[o,l]=(0,r.useState)([]),[c,s]=(0,r.useState)(null),u=(0,a.useSelector)(y.ZP.selectors.getEntity);return(0,we.D)((()=>{const e=o.map(((e,t)=>({tree:e,index:t}))).reduce(((e,t)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){nr(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,b.XTh)((0,i.pick)(["uri","label","secondaryLabel","type"],u),e);l(t.map((0,i.prop)("root")))}),[null==u?void 0:u.updatedTime]),(0,r.useEffect)((()=>((0,b.ZiX)(e)||(s(null),n((0,b.RFJ)({uri:e,graphUri:t})).then(ar).then(l).catch((e=>{console.warn(e),s((0,b.xU7)(e,x().text("Something went wrong")))}))),()=>{l([])})),[e,t,n]),{treeData:o,setTreeData:l,errorMessage:c}})(g,p),{onResize:E,getRowHeight:w,clearHeightsCache:C}=(()=>{const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)((()=>{t({})}),[]);return{onResize:(0,r.useCallback)((e=>(n,r)=>{t((t=>t[Er(e)]!==r?(0,i.assoc)(Er(e),r,t):t))}),[]),getRowHeight:(0,r.useCallback)((t=>{let{node:n}=t;return e[Er(n)]?Math.max(e[Er(n)],br.rowHeight):br.rowHeight}),[e]),clearHeightsCache:n}})(),S=(0,r.useCallback)((()=>{m(y.ui.actions.openGraph({viewId:l,graphType:p,entityUri:g}))}),[m,l,p,g]),O=(0,r.useCallback)((e=>({title:o().createElement(s.Z,{handleHeight:!0,refreshMode:"debounce",refreshRate:100,onResize:E(e.node)},o().createElement(pr,{node:e.node}))})),[E]);return(0,r.useEffect)((()=>{C()}),[C,g]),o().createElement(U.Z,{className:n},o().createElement(xr,{onGraphOpen:S,title:c}),o().createElement(sr.Provider,{value:t},o().createElement("div",{className:d.treeContainer},o().createElement("div",{className:d.tree},v?o().createElement(V.Typography,{className:d.errorMessage},v):o().createElement(tr.ZP,{isVirtualized:!1,treeData:f,canDrag:!1,theme:br,generateNodeProps:O,onChange:h,getNodeKey:dr,rowHeight:w})))))})),bo=co((e=>{let{config:t,className:n}=e;const l=oo(),c=(0,a.useSelector)(y.ZP.selectors.getEntity),s=(0,b.wwR)(c),[u,p]=(0,r.useState)(!1),d=(0,r.useCallback)((()=>{p(!0)}),[]),g=(0,r.useCallback)((()=>{p(!1)}),[]),{matches:f,entitiesMap:h,loadMatches:v}=(0,Qr.s)({enabled:!!s,entity:c,options:ao,filter:"",page:0,sorting:lo,rowsPerPage:3,onStartLoading:d,onFinishLoading:g}),E=(0,r.useCallback)((()=>{v()}),[v]),C=(0,a.useDispatch)(),S=(0,r.useContext)(m.m),O=(0,r.useCallback)((()=>{C(y.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:S}))}),[C,S]),P=(0,r.useMemo)((()=>(0,b.NVY)(s,(0,i.map)(b.ev7,f))),[s,f]),{getCommentsCount:N}=(0,r.useContext)(w.h);(0,r.useEffect)((()=>{N(P)}),[N,P]);const k=!(0,i.isEmpty)(f),Z=u?io.Loading:(0,i.isEmpty)(f)?io.NoData:io.Loaded;return o().createElement(ke.X.Provider,{value:h},o().createElement(U.Z,{className:A()(l.root,n)},o().createElement(F.Z,{title:t.caption}),o().createElement("div",{className:l.matchesContainer},Z===io.Loading&&o().createElement(T.Z,null),Z===io.NoData&&o().createElement(V.Typography,{className:l.noData},x().text("No matches found")),Z===io.Loaded&&f.map((e=>o().createElement(ro,{config:t,entitiesMap:h,match:e,onFinishRequest:E,onStartRequest:d,key:e.object.uri})))),k&&o().createElement(o().Fragment,null,o().createElement("div",{className:l.footer},o().createElement(V.Link,{component:"button",variant:"caption",onClick:O,underline:"none"},x().text("See all"))))))})),yo=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,91032)).then((e=>({default:co(e.HierarchyTreeView)}))))),vo=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,79417)).then((e=>({default:co(e.RelationshipsTableView)}))))),xo=co((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const c=zr(),s=(0,a.useSelector)(y.ZP.selectors.getMetadata),u=(0,a.useSelector)(y.ZP.selectors.getEntity),p=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{markers:d,loading:m}=((e,t,n)=>{const[o,a]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),c=(0,Ee._)();return(0,r.useEffect)((()=>{i(!0),c((0,b.DBr)(t,[e],n)).then((e=>{a(e.filter(Lr))})).catch((()=>{a([])})).finally((()=>{i(!1)}))}),[e,t,n,c]),{markers:o,loading:l}})(u,s,p),g=(0,r.useMemo)((()=>o().createElement("div",{className:c.fullHeight},o().createElement(T.Z,null))),[c]),f=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return p&&o().createElement(U.Z,{className:A()(c.root,i)},m&&o().createElement(T.Z,null),o().createElement(Mr.Z,{size:"S",icon:n?Ir.Z:Dr.Z,onClick:()=>l(t.id),className:c.fullscreenBtn}),o().createElement(Ar.Z,{loadingElement:g,defaultZoom:1,defaultCenter:f,markers:d,mapContainerClassName:c.fullHeight,mapKey:p,mapOptions:h}))})),Eo=co((e=>{let{config:t,className:n}=e;const{attributeUri:l}=t,c=$r(),s=(0,a.useDispatch)(),u=(0,a.useSelector)(y.ZP.selectors.getMode),p=(0,a.useSelector)(y.ZP.selectors.getEntityWithDiff),d=(0,a.useSelector)(y.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,v=t["text-empty"]||x().text("No data found"),E=(0,r.useCallback)((e=>s(y.N5.actions.requestNextPageOfAttributeValues(e))),[s]);return o().createElement(U.Z,{className:n},o().createElement(F.Z,{title:t.caption},o().createElement(W.Z,{description:null==m?void 0:m.description})),o().createElement("div",{className:c.container},(()=>{if(m){if((0,b.KIu)(u)){const e={attributeType:m,config:t,paging:f,requestNextPageOfAttributeValues:E};return o().createElement(Gr,e)}if(h>0){const e={attributeValues:g,attributeType:m,imageSize:Xr,paging:f,parentUri:p.uri,requestNextPageOfAttributeValues:E};return o().createElement(o().Fragment,null,o().createElement(Ur.Z,e),o().createElement(Br,{totalImages:h}))}}return o().createElement(V.Typography,{className:c.noData},v)})()))}));class wo{}wo.ViewTypes=b.ZIY,wo.getComponentBy=(e,t)=>{let{store:n,config:r,className:a,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case wo.ViewTypes.HierarchyTree:return o().createElement(yo,{config:r,store:n,className:a});case wo.ViewTypes.HierarchyPaths:return o().createElement(ho,{config:r,className:a});case wo.ViewTypes.RelationsTable:return o().createElement(vo,{config:r,store:n,className:a});case wo.ViewTypes.Relations:return o().createElement(go,{config:r,className:a});case wo.ViewTypes.Attributes:return o().createElement(uo,{className:a,config:r});case wo.ViewTypes.SingleAttribute:return o().createElement(po,{config:r,className:a});case wo.ViewTypes.AttributeTable:return o().createElement(mo,{config:r,className:a});case wo.ViewTypes.Map:return o().createElement(xo,{config:r,isFullscreen:l,onToggleFullscreen:i,className:a});case wo.ViewTypes.Custom:return o().createElement(fo,{config:r,className:a});case wo.ViewTypes.ImageAttribute:return o().createElement(Eo,{config:r,className:a});case wo.ViewTypes.PotentialMatches:return o().createElement(bo,{config:r,className:a})}},wo.getComponent=e=>wo.getComponentBy("class",e)||wo.getComponentBy("react-class",e)||o().createElement(so,{className:e.className});const Co=wo,So=()=>null,Oo=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:a,isAutosize:l,onToggleFullscreen:i}=e;const c=jr();return o().createElement(r.Suspense,{fallback:o().createElement(So,null)},Co.getComponent({config:t,store:n,className:A()(c.component,{[c.fullHeight]:!l}),isFullscreen:a,onToggleFullscreen:i}))}));Oo.displayName="ViewComponent";const Po=(0,Q.Z)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"}})));function No(){return No=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},No.apply(this,arguments)}const ko=["onConfigChanged","onRemove"],Zo=e=>{var t;let{layoutItemConfig:n,views:l,className:c,children:s,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=Po(),v=(0,a.useSelector)(y.ZP.selectors.getGoogleMapKey),{store:x}=(0,r.useContext)(a.ReactReduxContext);if(!f)return null;const E=f.class===Co.ViewTypes.Custom;if(E&&(null==f||null===(t=f.action)||void 0===t?void 0:t.platform)===b.X1H.CLASSIC)return null;if(f.class===Co.ViewTypes.Map&&!v)return null;const w=(e=>{var t;return null===(t=Object.entries(b.ZIY).find((t=>{let[n,r]=t;return e===r})))||void 0===t?void 0:t[0]})(f.class);return o().createElement("div",No({},(0,i.omit)(ko,g),{"data-reltio-id":f.id,"data-reltio-class":w||"",style:u,className:A()(c,{[h.item]:!E})}),o().createElement("div",{className:A()({[h.fixedSizeContainer]:!m})},m,o().createElement(Oo,{store:x,config:f,isFullscreen:p,onToggleFullscreen:d,isAutosize:Boolean(m)})),s)},To=(0,Q.Z)({scrollWrapper:{flexGrow:1,overflow:"auto"},scrollableContent:e=>{let{maxWidth:t,scrollbarWidth:n}=e;return{minWidth:t&&t<1024?t-n:1024}}}),Ro=e=>{let{views:t,layout:n,entityUri:a,maxWidth:l,onLayoutChanged:i}=e;const c=(0,r.useRef)(),s=(u=c.current)?u.offsetWidth-u.clientWidth:0;var u;const p=c.current,d=To({maxWidth:l,scrollbarWidth:s}),m=(0,r.useMemo)((()=>({element:p,priority:["left","right","top","bottom"]})),[p]);return(0,r.useEffect)((()=>{c.current&&(c.current.scrollTop=0)}),[a]),o().createElement("div",{ref:c,className:d.scrollWrapper},o().createElement("div",{className:d.scrollableContent},o().createElement(j.p.Provider,{value:m},o().createElement(D.Z,{LayoutItem:Zo,views:t,layout:n,onLayoutChanged:i,draggableHandle:".viewDraggableHandle"}))))};var jo=n(87685);const Do=(0,Q.Z)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),Io=e=>{let{notification:t}=e;const n=Do({}),l=(0,a.useDispatch)(),i=(0,a.useSelector)(y.ZP.selectors.getAutoCloseInterval),c=t.autoHideDuration||i&&1e3*i||5e3,[s,u]=(0,r.useState)(),[p,d]=(0,r.useState)(!0),m=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(l(y.ui.actions.closeNotification(t.id)),d(!1))}),[t]),g=(0,r.useCallback)((()=>{s.cancelAction&&l(s.cancelAction),u(void 0)}),[s]),f=(0,r.useCallback)((()=>{l(s.applyAction),u(void 0),l(y.ui.actions.closeNotification(t.id))}),[s,t]),h=o().createElement(o().Fragment,null,t.actions.map((e=>o().createElement(V.Button,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?u(e):l(e.applyAction),d(!1)}},e.label)))),b=o().createElement(o().Fragment,null,o().createElement(Mr.Z,{className:n.closeIcon,size:"S",icon:jo.default,onClick:m}),t.text);return o().createElement(o().Fragment,null,o().createElement(V.Portal,{container:document.body},o().createElement(V.Snackbar,{autoHideDuration:c,open:p,classes:{root:n.snackbar},action:h,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:b})),o().createElement(qe.Z,{open:!!s,title:null==s?void 0:s.confirmationText,content:null==s?void 0:s.confirmationDescription,onSave:f,onDiscard:g,saveCaption:x().text("Proceed"),discardCaption:x().text("Cancel")}))},Ao=()=>{const e=(0,a.useSelector)(y.ZP.selectors.getNotifications);return e?o().createElement(o().Fragment,null,e.slice(-1).map((e=>o().createElement(Io,{key:e.id,notification:e})))):null};var Mo=n(72753),Lo=n(43576),zo=n(64459),Uo=n(3409),Ho=n(79618),Vo=n(22860);function Fo(){return Fo=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},Fo.apply(this,arguments)}const Bo=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",Fo({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 Wo(){return Wo=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},Wo.apply(this,arguments)}const qo=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",Wo({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"})))},Go=(0,Q.Z)({editingButtons:{display:"flex","& button + button":{minWidth:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}});function _o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){$o(e,t,n[t])}))}return e}function $o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xo=e=>o().createElement(V.SvgIcon,e,o().createElement(Bo,null)),Qo=e=>o().createElement(V.SvgIcon,e,o().createElement(qo,null)),Yo=(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)})),Ko=e=>{let{className:t,profileBandConfig:n}=e;const l=Go(),c=(0,a.useDispatch)(),s=(0,a.useSelector)(y.ZP.selectors.getCanUserStartProcessFromQuery),u=(0,a.useSelector)(y.ZP.selectors.getEntityWithoutDiff),p=(0,a.useSelector)((e=>y.ZP.selectors.getModifiedEntity(e,u.uri))),d=(0,a.useSelector)(y.ZP.selectors.getMetadata),m=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),g=(0,a.useSelector)(y.ZP.selectors.getMode),f=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),h=(0,a.useSelector)(y.ZP.selectors.getIsViewMode),v=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),E=(0,a.useSelector)(y.ZP.selectors.getProfileOperation),w=null==u?void 0:u.type,C=(0,r.useMemo)((()=>(0,b.nt9)(d,w)),[w,d]),S=E===b.OXy.Saving,O=E===b.OXy.Cloning||S,[P,N]=(0,r.useState)(!1),k=(0,r.useCallback)((()=>{N(!1)}),[]),Z=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const o=(0,a.useSelector)(y.ZP.selectors.getEntityWithoutDiff),l=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,a.useDispatch)(),s=null==o?void 0:o.type,u=l.relationTypes,p=(0,r.useCallback)((0,b.Ian)(l,s),[l,s]),d=(0,b.nt9)(l,s),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)(s),(0,i.includes)("*")))),(0,i.when)((0,i.complement)(i.isNil),(0,i.omit)(["entityTypeUris"]))))(t)),[t,s]),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);c(y.N5.entity.actions.entityCloneRequested({data:_o({},(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:k}),T=(0,r.useMemo)((()=>[{label:x().text("Editing"),value:b.fO_.EDITING,description:x().text("Edit profile directly"),icon:Lo.Z,permission:"UPDATE"},{label:x().text("Suggesting"),value:b.fO_.SUGGESTING,description:x().text("Suggest changes and initiate a workflow review"),icon:Xo,permission:"INITIATE_CHANGE_REQUEST"},{label:x().text("Viewing"),value:b.fO_.VIEWING,description:x().text("Read or print profile"),icon:Mo.Z,permission:"READ"}]),[]),R=(0,r.useMemo)((()=>[...Z?[{label:x().text("Clone"),value:"Clone",description:x().text("Create a copy of the profile"),icon:Qo,onClick:()=>N(!0),permission:"CREATE"}]:[],{label:x().text("Delete"),value:"Delete",description:x().text("Permanently delete profile"),icon:Ye.Z,onClick:()=>{window.confirm(x().text("Are you sure you want to delete this?"))&&c(y.N5.entity.actions.entityRemoveRequested({entityUri:u.uri}))},permission:"DELETE"}]),[c,u.uri,Z]),j=!v&&!(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))(C),D=(0,b.ZiX)(null==u?void 0:u.uri),I=(0,r.useMemo)((()=>Yo(T,C,D,m,s)),[T,C,m,s,D]),M=(0,r.useMemo)((()=>Yo(R,C,D,m,s)),[R,C,m,s,D]),L=(0,r.useCallback)((e=>{c(y.N5.mode.actions.modeUpdated(e))}),[c]),z=(0,r.useCallback)((()=>{c(y.N5.mode.actions.modeCancelEditing())}),[c]),U=(0,r.useCallback)((()=>{c(y.N5.actions.saveProfile())}),[c]);return o().createElement(o().Fragment,null,o().createElement(zo.Z,{className:A()(t,wt.U),entity:f&&p?p:u},o().createElement(V.Box,{display:"flex",alignItems:"center"},o().createElement(V.Box,{mr:3},f&&o().createElement(V.Box,{className:l.editingButtons},o().createElement(V.Button,{variant:"outlined",onClick:z,"data-reltio-id":"reltio-profile-cancel-editing",disabled:O},x().text("Cancel")),o().createElement(V.Button,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:U,disabled:O},(0,b.fnZ)(g)?x().text("Suggest"):x().text("Save"))),v&&h?o().createElement(Uo.Z,null):h&&o().createElement(Ho.a,null)),j&&o().createElement(Vo.T,{optionsGroup:I,buttonsGroup:M,value:g,onChange:L,disabled:O})),o().createElement(V.Box,{className:l.comments},o().createElement(Ct.Z,{uri:u.uri,relatedObjectUris:(0,b.wp9)(b.q7e.ENTITY,{entityUri:u.uri}),objectType:b.q7e.ENTITY}))),!!Z&&o().createElement(qe.Z,{open:P,title:x().text("Do you want to create a clone of the profile?"),content:x().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:Z,onDiscard:k,saveCaption:x().text("Proceed"),discardCaption:x().text("Cancel")}))};var Jo=n(71820),ea=n(44021),ta=n(26789),na=n(54362),ra=n(6674),oa=n(91515),aa=n(52043),la=n(17308),ia=n(39827),ca=n(80147),sa=n(76569);const ua=(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"}}),pa=()=>{const{total:e}=(0,r.useContext)(P.O),t=ua();return o().createElement(V.Badge,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(sa.Z,null))};var da=n(26313),ma=n(9371),ga=n(4426);const fa=(0,Q.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),ha=()=>{const e=fa(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(w.h),i=(0,a.useSelector)(y.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(i)}),[t,i]);const c=(0,da.Q)(n);return o().createElement(ke.X.Provider,{value:c},o().createElement(V.Box,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:a}=e;return o().createElement(ma.J,{key:a,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&o().createElement(V.Link,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},o().createElement(ga.Z,{className:e.showMoreIcon}),x().text("Show more"))))};var ba=n(46626);const ya=(0,Q.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),va=()=>{const e=ya(),{tasks:t,loading:n}=(0,r.useContext)(P.O);return o().createElement("div",{className:e.wrapper},n&&o().createElement(T.Z,null),t&&t.map((e=>o().createElement(ba.s,{key:e.taskId,task:e}))))};function xa(){return xa=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},xa.apply(this,arguments)}const Ea=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",xa({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"})))))},wa=()=>{const{commentsMap:e}=(0,r.useContext)(w.h),t=ua();return o().createElement(V.Badge,{badgeContent:(0,b.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},o().createElement(Ea,null))};var Ca=n(10159);const Sa=()=>o().createElement(Ca.Z,{text:x().text("Ready to go with the flow?"),secondaryText:x().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),Oa=()=>o().createElement(Ca.Z,{text:x().text("Care to join the conversation?"),secondaryText:x().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function Pa(){return Pa=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},Pa.apply(this,arguments)}const Na=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",Pa({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{d:"M14.101 16A5.003 5.003 0 0016 18.987V20H2v-4h12.101zM22 18.987V20v-1.013zM4 17v2h2v-2H4zM16 4v1.013A5.004 5.004 0 0014.101 8H2V4h14zm6 0v1.013V4zM6 7V5H4v2h2zm8 3v4H2v-4h12zM4 11v2h2v-2H4zm12 4v-2h6v2c0 1.3-.84 2.4-2 2.82V22h-2v-4.18c-1.16-.42-2-1.52-2-2.82zm0-6c0-1.3.84-2.4 2-2.82V2h2v4.18c1.16.42 2 1.52 2 2.82v2h-6V9z",fill:"#000",fillOpacity:".54"}))},ka=(0,Q.Z)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),Za=()=>{const e=ka(),t=(0,a.useSelector)(y.ZP.selectors.getDBConnectorSideViews);return o().createElement("div",{className:e.wrapper},t.map((t=>o().createElement(Pr,{key:t.id,config:t,className:e.itemWrapper}))))};function Ta(){return Ta=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},Ta.apply(this,arguments)}let Ra;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(Ra||(Ra={}));const ja=e=>{if(e)return 1===e?x().text("${total} item",{total:e}):x().text("${total} items",{total:e})},Da=e=>{var t,n,l;let{commentId:c}=e;const s=ua(),u=(0,a.useSelector)(y.ZP.selectors.isWorkflowSideViewEnabled),p=(0,a.useSelector)(y.ZP.selectors.isWorkflowEnabled),d=(0,a.useSelector)(y.ZP.selectors.isCollaborationSideViewEnabled),m=(0,a.useSelector)(y.ZP.selectors.isDBConnectorSideViewEnabled),g=(0,a.useSelector)(y.ZP.selectors.isCollaborationEnabled),f=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),h=(0,a.useSelector)(y.ZP.selectors.getMetadata),v=(0,a.useSelector)(y.ZP.selectors.getEntity),E=(0,r.useContext)(P.O),C=(0,r.useContext)(w.h),[S,O]=(0,r.useState)(c?Ra.Collaboration:null),N=(0,r.useCallback)((e=>{O((t=>t===e?null:e))}),[]),k=(0,r.useCallback)((()=>{O(null)}),[]),Z=null!==S,T=S===Ra.History,{isHistoryEnabled:R,isProfilePersisted:j}=(0,Jo.C)({isHistoryTabActive:T,entity:v}),{historyFilter:D,onApplyFilter:I,isLoading:A,historicUris:M,historyWithTotal:L,canLoadMore:z,onLoadMore:U}=(0,ea.k6)({entity:v,enabled:R}),H=u&&p&&!(0,b.ZiX)(null==v?void 0:v.uri),V=d&&g,F=(0,b.mdt)(null==C?void 0:C.commentsMap),B=[{buttonProps:{id:Ra.Workflow,icon:pa,tooltipTitle:x().text("Workflow")},content:null!=E&&E.total?o().createElement(va,null):o().createElement(Sa,null),headerProps:{mainTitle:x().text("Workflow"),secondTitle:ja(null==E?void 0:E.total),rightContent:o().createElement(ta.G,null)},hidden:!H},{buttonProps:{id:Ra.Collaboration,icon:wa,tooltipTitle:x().text("Collaboration")},content:F?o().createElement(ha,null):o().createElement(Oa,null),headerProps:{mainTitle:x().text("Collaboration"),secondTitle:ja(F)},hidden:!V},{buttonProps:{id:Ra.History,icon:ca.Z,tooltipTitle:x().text("History")},content:j?o().createElement(na.Z,{isLoading:A,historyWithTotal:L,contributorsUris:M,entityUri:null==v?void 0:v.uri,historyEvent:f,onLoadMore:U,canLoadMore:z}):o().createElement(ra.Z,null),headerProps:{content:o().createElement(oa.Z,{total:j?((null==M?void 0:M.length)||0)+1:void 0,entityType:(0,b.nt9)(h,null==v?void 0:v.type),filter:D,onApplyFilter:I})}},{buttonProps:{id:Ra.DBConnector,icon:Na,tooltipTitle:x().text("D&B Connector")},content:o().createElement(Za,null),headerProps:{mainTitle:x().text("D&B Connector")},hidden:!m}],W=(0,i.reject)((0,i.propEq)("hidden",!0))(B);return(0,r.useEffect)((()=>{var e;null!==(e=B[S])&&void 0!==e&&e.hidden&&k()}),[S,B,k,W]),o().createElement("div",{className:s.wrapper},o().createElement(aa.h,{open:Z,width:480},!(null!==(t=B[S])&&void 0!==t&&t.hidden)&&o().createElement(o().Fragment,null,o().createElement(la.P,Ta({},null===(n=B[S])||void 0===n?void 0:n.headerProps,{onClose:k})),null===(l=B[S])||void 0===l?void 0:l.content)),o().createElement(ia.G,{buttonsProps:(0,i.pipe)((0,i.reject)((0,i.propEq)("hidden",!0)),(0,i.pluck)("buttonProps"))(B),onButtonClick:N,activeIndexId:S}))};var Ia=n(39781),Aa=n(16715);const Ma="48px",La="1px solid rgba(0, 0, 0, .125)",za=(0,Q.Z)((e=>({accordion:{borderTop:La,borderBottom:La,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:Ma,minHeight:Ma,"&$accordionSummaryExpanded":{height:Ma,minHeight:Ma}},accordionSummaryHeading:{flex:1,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular},accordionSummaryExpanded:{},accordionSummaryContent:{display:"flex",alignItems:"center"},accordionDetails:{maxHeight:"21vh",overflow:"auto",paddingTop:0,paddingBottom:0,"& ul":{paddingLeft:"23px",marginTop:"3px"},"& li":{paddingLeft:"9px",paddingBottom:"8px"}},parents:{color:e.palette.text.primary},errorWrapper:{lineHeight:"18px",display:"flex",flexDirection:"column"},errorTitle:{display:"flex",alignItems:"center"},attributeTypesPath:{color:e.palette.text.secondary},goToIcon:{marginLeft:"4px"},errorsAccordion:{backgroundColor:"#FFF4F6",borderColor:"#FFB8B3"},errorsAccordionDetails:{color:"#DD2C00"},warningsAccordion:{backgroundColor:"#FFF9ED",borderColor:"#FFDD91"},warningsAccordionDetails:{color:"#CC7500"},icon:{marginRight:"8px"},errorIcon:{fill:"#FF1744"},warningIcon:{fill:"#F9A825"}}))),Ua=za;var Ha=n(38016);const Va=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:a}=e;const l=Ua();return t.length>0?o().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:c,items:s,accordionClassName:u,accordionDetailsClassName:p}=e;return o().createElement(V.Accordion,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},o().createElement(V.AccordionSummary,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:o().createElement(Ha.Z,null)},i,o().createElement(V.Typography,{className:l.accordionSummaryHeading},c)),o().createElement(V.AccordionDetails,{className:A()(l.accordionDetails,p)},o().createElement("ul",null,s.map(((e,t)=>o().createElement(a,{key:t,error:e}))))))}))):null}));function Fa(){return Fa=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},Fa.apply(this,arguments)}Va.displayName="ErrorsPanel";const Ba=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",Fa({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),o().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.245 12.75c0 .825-.467 1.5-1.045 1.5H4.8c-.583 0-1.05-.675-1.05-1.5v-7.5c0-.832.467-1.5 1.05-1.5h8.4c.578 0 1.05.668 1.05 1.5l-.005 7.5zM9.75 9.96v1.642l3-2.805L9.75 6v1.598c-2.918.404-4.08 2.4-4.5 4.402 1.043-1.402 2.415-2.04 4.5-2.04z",fill:"#000",fillOpacity:".54"}))},Wa=(0,i.omit)(["deactivated","path"]),qa=(0,r.memo)((e=>{let{error:t}=e;const n=Ua(),l=(0,a.useSelector)(y.ZP.selectors.getMetadata),c=(0,a.useSelector)(y.ZP.selectors.getIsEditableMode),s=((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?x().text("${attribute} is required",{attribute:t.label}):o}return o})(l,t),u=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[b.HAc.attributeValue,b.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(i.identity).join(" / ")})(t),p=(e=>{let{path:t}=e;return null==t?void 0:t.filter((e=>{let{type:t}=e;return t===b.HAc.attributeValue})).map((0,i.either)((0,i.path)(["valueType","label"]),(0,i.path)(["valueType","name"]))).filter(i.identity).join(" > ")})(t),{highlightError:d}=(0,r.useContext)(Z.M),m=t.uri||t.parentUri&&t.attributeTypeUri;return o().createElement("li",null,o().createElement("div",{className:n.errorWrapper},p&&o().createElement("span",{className:n.attributeTypesPath},p),o().createElement("span",{className:n.errorTitle},s,m&&c&&o().createElement(Te.k,{icon:Ba,size:"XXS",onClick:()=>d(t),tooltipTitle:x().text("Go to error"),className:n.goToIcon})),u&&o().createElement("span",{className:n.parents},u)))}));qa.displayName="Error";const Ga=()=>{const e=Ua(),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(Wa),t.map(Wa))}(e,t.current)||(t.current=e),t.current})((0,a.useSelector)(y.ZP.selectors.getProfileErrors)),[n,l]=(0,r.useMemo)((()=>(0,i.partition)(b.IT0,t)),[t]),[c,s]=(0,r.useState)(null),u=(0,r.useMemo)((()=>[{id:"errors",title:x().text("${number} ${errors}",{number:n.length,errors:1===n.length?x().text("error"):x().text("errors")}),icon:o().createElement(Ia.Z,{className:A()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:x().text("${number} ${warnings}",{number:l.length,warnings:1===l.length?x().text("warning"):x().text("warnings")}),icon:o().createElement(Aa.Z,{className:A()(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)((()=>{s("errors")}),[n]);const p=(0,r.useCallback)((e=>(t,n)=>{s(n?e:null)}),[]);return u.length>0?o().createElement(Va,{panels:u,expandedPanelId:c,onToggle:p,ErrorComponent:qa}):null};var _a=n(3096),$a=n.n(_a),Xa=n(60641);function Qa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ya={};var Ka=n(61756),Ja=n(4109);function el(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tl=(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},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"}}))),nl=(0,r.memo)((e=>{var t;let{config:n,saveState:l,getSavedState:i,commentId:c}=e;const{maxWidth:s,profileBand:u,workflow:p}=n||{},d=tl({maxWidth:s}),m=(0,a.useSelector)(y.ZP.selectors.getEntity),g=(0,a.useSelector)(y.ZP.selectors.getHistoryEvent),f=(0,a.useSelector)(y.ZP.selectors.getIsHistoryModeEnabled),h=(null===(t=(0,a.useSelector)(y.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"",v=(0,a.useSelector)(y.ZP.selectors.getMode),j=(0,a.useDispatch)(),D=(0,E.u)(),I=(e=>{const t=(0,Ka.v)(e),n=(0,Ja.b)();return(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){el(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(p),{type:A,uri:M}=m||{},L=(0,r.useMemo)((()=>(0,b.dvH)(m)),[m]),z=(0,r.useContext)(w.h),U=(0,C.C)({objectIds:L}),{views:H,layout:V,isLoaded:F,handleLayoutChange:B}=(e=>{let{config:t,entityTypeUri:n,saveState:o,getSavedState:a}=e;const[l,i]=(0,r.useState)([]),[c,s]=(0,r.useState)([]),{canRead:u}=(0,In.l)(),p=(0,r.useMemo)((()=>{const e=t.views.filter(u),n=(0,b.sFD)(t.layout,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){Qa(e,t,n[t])}))}return e}({},t,{views:e,layout:n})}),[t,u]),d=(0,r.useMemo)((()=>$a()(p)),[p]),m=null!=p&&p.nestedRoute?`/${p.nestedRoute}`:"",g=n&&p?n+m:null,f=(0,r.useCallback)((()=>a().then((e=>e.layout?{}:e))),[a]),h=(0,r.useCallback)((0,b.DsO)(o,1e3),[o]),{isLoaded:y,savedState:v=Ya,updateSavedState:x}=(0,Xa.w)({getSavedState:f,saveState:h,entityTypeUri:g}),E=(0,r.useCallback)((e=>{x({layout:e,views:c,configHash:d}),i(e)}),[x,d,c]);return(0,r.useEffect)((()=>{if(y){const e=d!==v.configHash,{views:t,layout:n}=(0,b.Mfk)({views:e||!v.views?p.views:v.views,layout:e?p.layout:v.layout});s(t),i(n)}}),[y,v,g]),{views:c,layout:l,isLoaded:y,handleLayoutChange:E}})({config:n,entityTypeUri:A,saveState:l,getSavedState:i});(0,S.a)({entity:m,historyEvent:g}),(()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(y.ZP.selectors.getValidateReadMode),n=(0,a.useSelector)(y.ZP.selectors.getEntity)||{},{uri:o,updatedTime:l}=n,i=(0,b.biM)(n),c=(0,a.useSelector)(y.ZP.selectors.getMode),s=(0,a.useSelector)(y.ZP.selectors.getProfileViews),u=s&&s.length>0,p=(0,r.useCallback)((0,b.DsO)((t=>{t&&e(y.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!i&&o&&!(0,b.ZiX)(o)&&c===b.ARY.Viewing&&u;p(e)}),[p,i,t,l,o,c,u])})(),(0,r.useEffect)((()=>{j(y.N5.views.actions.profileViewsSet(H))}),[j,H]),(0,r.useEffect)((()=>{n.sidePanelViews&&j(y.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]);const W=v===b.ARY.Viewing&&(0,b.ZiX)(M);return o().createElement(O.j.Provider,{value:!0},o().createElement(w.e,{collaboration:f?z:U},o().createElement(P.O.Provider,{value:I},o().createElement(N.m.Provider,{value:D},o().createElement(k.l.Provider,{value:h},o().createElement(Z.R,null,o().createElement("div",{className:d.perspectiveView},(!F||!M)&&o().createElement(T.Z,null),F&&M?o().createElement("div",{className:d.profileContainer},o().createElement("div",{className:d.profileWrapper},o().createElement(Ko,{profileBandConfig:u}),!f&&o().createElement(Ga,null),!W&&o().createElement(Ro,{maxWidth:s,views:H,layout:V,entityUri:M,onLayoutChanged:B})),o().createElement(Da,{commentId:c})):o().createElement("div",{className:d.emptyState},o().createElement(R.ZP,{LogoRenderer:R.B9.NO_DATA,text:x().text("No data to display."),variant:R.tC.embedded})),o().createElement(Ao,null))))))))}));function rl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}nl.displayName="ProfilePerspectiveView";const ol=(0,c.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0});b.oss.register("profile",((e,t)=>{const n=e=>(0,i.sort)(((e,t)=>e.x>t.x||e.x===t.x&&e.y>t.y?1:-1),e),r=(0,i.map)((e=>(0,i.evolve)({layout:(0,i.pipe)(n,(0,i.map)((0,i.ifElse)((0,i.propEq)("autosizing",!0),(0,i.omit)(["y","height","minHeight","maxHeight"]),(0,i.omit)(["y","minHeight","maxHeight"]))))},e)));return(0,b.l22)(r(e),r(t))}));const al=e=>{let{config:t,store:n,onResize:v=i.identity,saveState:x,getSavedState:E,qxSandboxApi:w,commentId:C}=e;const S=(0,r.useCallback)((0,b.aYu)(E),[E]),{SnackbarRenderer:O,showSnackbarMessage:P}=(0,p.D)(),N=(0,r.useMemo)((()=>t&&(0,b.Vr9)(t)),[t]),k=(0,r.useContext)(d.Y),Z=y.ZP.selectors.getShowAttributeDescription(n.getState()),T=(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){rl(e,t,n[t])}))}return e}({},k,{showDescription:Z})),[k,Z]);return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:null==N?void 0:N.id},o().createElement(g.S.Provider,{value:P},o().createElement(f.Y.Provider,{value:w},o().createElement(c.StylesProvider,{generateClassName:ol},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(d.Y.Provider,{value:T},o().createElement(o().Fragment,null,o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>v(Math.floor(e),Math.floor(t))}),N&&o().createElement(nl,{config:N,saveState:x,getSavedState:S,commentId:C}),o().createElement(h.Z,{showErrorFromStore:!0}),o().createElement(O,null)))))))))};var ll=n(82842),il=n(51229),cl=n(91131);const sl=(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}}))),ul=e=>{let{total:t=0}=e;const n=sl(),l=(0,a.useDispatch)(),i=(0,r.useContext)(m.m),c=(0,r.useCallback)((()=>{l(y.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return o().createElement(F.Z,{title:""},o().createElement("div",{className:n.titleContainer},o().createElement(V.Link,{component:"button",variant:"caption",className:n.link,onClick:c,underline:"none"},x().text("Profile")),o().createElement(cl.Z,{className:n.icon}),x().text("Tags")),o().createElement(il.Z,null),o().createElement(V.Typography,{className:n.totalCaption,variant:"caption"},o().createElement("span",{className:n.totalNumber},x().number(t,"0,0")),x().text("total profiles")))};var pl=n(20404);const dl=(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"}}))),ml=e=>{let{label:t}=e;const n=dl();return o().createElement(V.Toolbar,{className:n.toolbar},o().createElement(pl.Z,{className:n.avatar}),o().createElement(V.Typography,{variant:"h6",className:n.label},t))};function gl(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){fl(e,t,n[t])}))}return e}function fl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const hl=(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}}))),bl=[25,50,100],yl=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const l=hl(),[c,s]=(0,r.useState)(bl[0]),[u,p]=(0,r.useState)(0),d=(0,a.useSelector)(y.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 c=(0,a.useDispatch)(),s=(0,Ee._)(),u=(0,Ee._)(),[p,d]=(0,r.useState)(!1),[m,g]=(0,r.useState)(0),[f,h]=(0,r.useState)([]),{requestEntities:v,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const o=(0,a.useSelector)(y.ZP.selectors.getGlobalSearchRequestOptions),l=(0,a.useSelector)(y.ZP.selectors.getTenant),c=(0,a.useSelector)(y.ZP.selectors.getDtssPath),s=(0,r.useMemo)((()=>(0,b.Do$)(t)),[t]),u=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),p=!!s,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=gl({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:s,dtssPath:c}).then((0,i.map)((0,b.E7G)(s))):(0,b.ZOr)(e,t)}),[p,s,l,c]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(u,gl({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:s,dtssPath:c}):(0,b.j_Q)(u,e)).then((e=>e.total))}),[u,o,p,s,l,c])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{c(y.ui.actions.errorSet((0,b.xU7)(e,x().text("Something went wrong")))),g(0)}),[c]);return(0,r.useEffect)((()=>{s(E()).then(g).catch(w)}),[E,s,w]),(0,r.useEffect)((()=>{d(!0),u(v(l,o*l)).then(h).catch(w).finally((()=>d(!1)))}),[o,l,v,u,w]),{isLoading:p,total:m,entities:f}})({tag:t,entityUri:n,page:u,rowsPerPage:c}),h=(0,r.useRef)(null);(0,r.useEffect)((()=>{h.current&&(h.current.scrollTop=0)}),[f]);const v=g>bl[0];return o().createElement("div",{className:l.perspectiveView},o().createElement(ml,{label:t}),o().createElement("div",{className:A()(l.tagsContainer,{[l.fullHeight]:v})},o().createElement(U.Z,{className:l.tagsView},o().createElement(ul,{total:g}),o().createElement("div",{className:l.listContainer},m&&o().createElement(T.Z,null),g>0&&o().createElement("div",{className:l.entitiesList,ref:h},o().createElement(ll.Z,{entities:f})),v&&o().createElement("div",{className:l.pagination},o().createElement(H.Z,{count:g,rowsPerPageOptions:bl,rowsPerPage:c,page:u,onChangePage:p,onChangeRowsPerPage:s}))))))}));yl.displayName="TagPerspectiveView";const vl=(0,c.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),xl=e=>{let{config:t,tag:n,entityUri:r,store:l,onResize:u=i.identity}=e;return o().createElement(a.Provider,{store:l},o().createElement(m.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:vl},o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>u(Math.floor(e),Math.floor(t))}),t&&o().createElement(yl,{tag:n,entityUri:r}),o().createElement(h.Z,{showErrorFromStore:!0}))))};var El=n(65321);const wl=(0,Q.Z)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),Cl=()=>{const e=wl(),t=(0,a.useSelector)(y.ZP.selectors.getEntity),{tasks:n}=(0,r.useContext)(P.O),l=(0,r.useMemo)((()=>null==n?void 0:n.find((e=>e.objectURIs.includes((0,b.$Rg)(t.uri))))),[t.uri,n]);return o().createElement(zo.Z,{entity:t},o().createElement("div",{className:e.actionsWrapper},l&&o().createElement(El.o,{task:l})))},Sl=(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},perspectiveContainer:{display:"flex",flexGrow:1,overflow:"hidden"},attributesWrapper:{margin:"15px",flexGrow:1,overflowY:"auto",backgroundColor:"#FAFAFA"},contentWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1}})));function Ol(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pl={processTypes:["dataChangeRequestReview"]},Nl=(0,r.memo)((()=>{const e=Sl(),t=(0,a.useDispatch)(),n=(e=>{const t=(0,a.useDispatch)(),n=(0,a.useSelector)(y.ZP.selectors.getEntityUri),o=(0,Ka.v)(e),l=(0,r.useCallback)((e=>{"Reject"===e&&t(y.ui.actions.openPerspective({perspectiveId:null,viewId:null})),"Approve"===e&&t(y.ui.actions.openEntity({uri:(0,b.$Rg)(n),viewId:null}))}),[t,n]);return(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ol(e,t,n[t])}))}return e}({},o,{onActionSuccess:l})),[o,l])})(Pl),l=(0,a.useSelector)(y.ZP.selectors.getEntity);(0,r.useEffect)((()=>{t(y.N5.sidePanelViews.actions.sidePanelViewsLoaded([{id:"common",views:[{point:"com.reltio.plugins.ui.view",id:"com.reltio.plugins.entity.side.WorkflowsView",class:"com.reltio.plugins.entity.side.WorkflowsView"}]}]))}),[t]);const i=!n.loading&&!!l.uri;return o().createElement(P.O.Provider,{value:n},o().createElement("div",{className:e.perspectiveView},!i&&o().createElement(T.Z,null),o().createElement("div",{className:e.perspectiveContainer},i?o().createElement(o().Fragment,null,o().createElement("div",{className:e.contentWrapper},o().createElement(Cl,null),o().createElement("div",{className:e.attributesWrapper},o().createElement(M.Z,null))),o().createElement(Da,null)):o().createElement(R.ZP,{LogoRenderer:R.B9.NO_DATA,text:x().text("No data to display."),variant:R.tC.embedded}))))}));function kl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Nl.displayName="DCRReviewPerspectiveView";const Zl=(0,c.createGenerateClassName)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0}),Tl=e=>{let{config:t,store:n,onResize:p=i.identity}=e;const g=(0,r.useContext)(d.Y),f=y.ZP.selectors.getShowAttributeDescription(n.getState()),b=(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){kl(e,t,n[t])}))}return e}({},g,{showDescription:f})),[g,f]);return o().createElement(a.Provider,{store:n},o().createElement(m.m.Provider,{value:t.id},o().createElement(c.StylesProvider,{generateClassName:Zl},o().createElement(u.MuiPickersUtilsProvider,{utils:l.Z},o().createElement(d.Y.Provider,{value:b},o().createElement(s.Z,{handleHeight:!0,onResize:(e,t)=>p(Math.floor(e),Math.floor(t))}),o().createElement(Nl,null),o().createElement(h.Z,{showErrorFromStore:!0}))))))}},79417:(e,t,n)=>{n.r(t),n.d(t,{RelationshipsTableView:()=>qe});var r=n(8598),o=n(24328),a=n.n(o),l=n(44443),i=n(17440),c=n(52730),s=n(49885),u=n(16657),p=n(65549),d=n(94079),m=n(13980),g=n.n(m),f=n(87918),h=n.n(f),b=n(79692);const y=(0,b.Z)({addButton:{marginLeft:"12px",padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},label:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),v=e=>{let{onClick:t}=e;const n=y();return a().createElement(d.Button,{color:"primary",className:n.addButton,onClick:t},a().createElement(p.Z,{classes:{root:n.icon}}),a().createElement("div",{className:n.label},h().text("Add")))};v.propTypes={onClick:g().func};const x=v;var E=n(71153),w=n.n(E);const C={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},S={color:"rgba(0,0,0,.54)"},O=(0,b.Z)((e=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},entityCell:{display:"flex",alignItems:"center",height:"100%"},entityLabel:{fontSize:"15px",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","$row-cell--removed &":C,"$row-cell--inactive &":S},entityAvatar:{transform:"scale(0.7)",margin:"0 10px"},rowCell:{fontSize:"13px",overflow:"hidden"},description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > :not($entityCell)":C},"row-cell--inactive":S})));function P(){return P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P.apply(this,arguments)}const N=e=>{let{cell:t,CellValueRenderer:n,rowValue:{connection:r},isSorted:o}=e,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["cell","CellValueRenderer","rowValue","isSorted"]);const i=O(),c=(0,u.$qe)(r),s=(0,u.Fn9)(r.relation)&&(0,u.Fn9)(r.entity);return a().createElement("div",{className:w()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:c,[i["row-cell--inactive"]]:!s},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,P({key:t,value:e},l)))))};N.propTypes={rowValue:g().object,cell:g().object,CellValueRenderer:g().elementType,isSorted:g().bool};const k=N;var Z=n(85709),T=n(94656),R=n(39450),j=n(34e3),D=n(95613);const I=e=>{let{value:{entityType:t,entity:n}}=e;const r=(0,c.useDispatch)(),l=(0,o.useContext)(R.m),p=O(),d=(0,u.idV)(n.entityLabel),m=(0,u.wwR)({uri:n.entityUri,dataTenant:n.dataTenant});return a().createElement("div",{className:p.entityCell},a().createElement(j.Z,{className:p.entityAvatar,entityType:t}),a().createElement(D.Z,{value:d},a().createElement("span",{className:p.entityLabel,onClick:(0,i.pipe)((0,i.always)({uri:m,viewId:l}),s.ui.actions.openEntity,r)},d)))};I.propTypes={value:g().shape({entity:g().shape({entityUri:g().string,entityLabel:g().string}),entityType:u.p8l})};const A=I;var M=n(92332),L=n(98448);const z=(0,n(67353).Z)((e=>{const t=O(),{description:n}=(null==e?void 0:e.headCellData)||{};return a().createElement("div",{className:t.headCell},a().createElement(M.default,e),a().createElement(L.Z,{description:n,className:t.description}))}));var U=n(64091);const H=(0,i.pipe)((0,i.map)((e=>e.uri||e)),i.uniq);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 F=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),B=e=>{if(e.startsWith("relation.attributes")){const t=F(e);return t.length>1?t.slice(0,-1):null}return null},W=(0,i.map)((e=>{return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){V(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:B(e.id),headCellRenderer:z,rowCellValueRenderer:(t=e.id,"entity.label"===t?A:U.Z)});var t})),q=(0,b.Z)({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},emptyData:{marginBottom:"30px"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}});var G=n(27604),_=n(22983);const $=e=>{let{canUpdate:t,canRemove:n,handleEditRelation:r,handleRemoveRelation:o}=e;return a().createElement(a().Fragment,null,t&&a().createElement(d.Tooltip,{title:h().text("Edit")},a().createElement(d.IconButton,{onClick:r},a().createElement(G.Z,null))),n&&a().createElement(d.Tooltip,{title:h().text("Remove")},a().createElement(d.IconButton,{onClick:o},a().createElement(_.Z,null))))};$.propTypes={canUpdate:g().bool,canRemove:g().bool,handleEditRelation:g().func,handleRemoveRelation:g().func};const X=$;function Q(){return Q=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},Q.apply(this,arguments)}const Y=e=>{let{mode:t,columnsData:n,connections:r,metadata:l,sorting:c,onSort:p,filters:d,onFilter:m,onEditRelation:g,onRemoveRelation:f,basicTableRef:h,allowOnlyCreateNew:b}=e;const y=(0,o.useMemo)((()=>((e,t,n)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,r)=>{let{id:o}=r;return(0,i.assoc)(o,((e,t,n)=>{let{entity:r,relation:o}=t;switch(e){case"entity.label":return{entity:r,entityType:(0,u.nt9)(n,r.entityType)};case"relation.label":return o.relationLabel||(0,u.Lmx)(n,o.relationType);case"relation.activeness.startDate":return o.startDate;case"relation.activeness.endDate":return o.endDate;default:return((e,t)=>(0,i.pipe)((0,i.path)(["object","attributes"]),(0,u.tT_)(e))(t))(F(e),o)}})(o,e,n),t)}),{}),(0,i.assoc)("connection",e))(t))))(r,n,l)),[r,n,l]),v=(0,o.useMemo)((()=>W(n)),[n]),x=q(),E=(0,o.useCallback)((e=>a().createElement(k,Q({},e,{isSorted:!!c&&c.field===e.columnData.id}))),[c]),[w,C]=(0,o.useState)(null),{canRemove:S,canUpdate:O}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:o,onEditRelation:a,allowOnlyCreateNew:l}=e;const i=(0,u.xvW)(r);if(s.N5.mode.selectors.getIsEditableMode(n)&&r&&(!l||i)){const{relation:{relationType:e}}=r,l=(0,u.$qe)(r),i=(0,u.V3K)(t,e);return{canRemove:o&&!l&&(0,u.Edd)(n,i),canUpdate:a&&!l&&(0,u.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:t,onRemoveRelation:f,onEditRelation:g,metadata:l,allowOnlyCreateNew:b,connection:(0,i.path)([w,"connection"],y)}),P=(0,o.useCallback)((e=>C(e)),[]),N=(0,o.useCallback)((()=>g((0,i.path)([w,"connection"],y))),[w,g,y]),T=(0,o.useCallback)((()=>f((0,i.path)([w,"connection","relation","relationUri"],y))),[w,f,y]),R=S||O?a().createElement(X,{handleEditRelation:N,handleRemoveRelation:T,canRemove:S,canUpdate:O}):void 0;return a().createElement("div",{className:x.tableContainer},a().createElement(Z.Z,{autosizing:!0,maxHeight:477,columnsData:v,rowsData:y,sorting:c,onSort:p,filters:d,onFilter:m,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:E,onRowHover:P,hoverRowIndex:w,hoveredRowRightContent:R,classes:{hoveredRowRightContentWrapper:x["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:x["row-cell__buttons-container"]},ref:h,resizeDebounceDelay:150}))};Y.propTypes={mode:g().string,columnsData:T.uz,connections:g().arrayOf(u.Rjq),metadata:u.pGS,filters:g().objectOf(T.Dq),onFilter:g().func,sorting:T.nI,onSort:g().func,onEditRelation:g().func,onRemoveRelation:g().func,basicTableRef:g().shape({current:g().object}),allowOnlyCreateNew:g().bool};const K=Y;var J=n(93416),ee=n(75512),te=n(30553),ne=n(32152),re=n(1876),oe=n(60894),ae=n(43054),le=n(8818);const ie=(0,b.Z)((()=>({popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ce=e=>{let{className:t,showInactive:n,onShowInactiveChange:r}=e;const l=ie(),i=(0,o.useRef)(),[c,s]=(0,o.useState)(!1),u=()=>s((e=>!e));return a().createElement(a().Fragment,null,a().createElement(le.k,{className:t,ref:i,tooltipTitle:h().text("More"),icon:ae.Z,onClick:u,size:"L"}),a().createElement(d.Popover,{open:c,classes:{paper:l.popupContent},anchorEl:i.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(d.FormControlLabel,{classes:{label:l.checkboxControlLabel},control:a().createElement(d.Checkbox,{className:l.checkboxControlCheckbox,checked:n||!1,onChange:e=>r(e.target.checked)}),label:h().text("Show inactive Relationships")})))},se=(0,b.Z)({header:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},moreButton:{marginLeft:"-6px"}}),ue=e=>{let{title:t,total:n,searchQuery:r,onChangeSearchQuery:o,filtersEnabled:l,onToggleFilters:i,columnsData:c,selectedColumns:s,onChangeColumns:u,showInactive:p,onChangeShowInactive:m}=e;const g=se();return a().createElement(J.Z,{title:t,className:g.header},a().createElement(ee.Z,{widthToHide:500},a().createElement(te.Z,{height:24,margin:16}),a().createElement(d.Typography,{className:g.totalCaption,variant:"caption"},n>1?h().text("${count} entities",{count:n}):h().text("${count} entity",{count:n}))),a().createElement(ne.i,{query:r,onChange:o}),a().createElement(re.Z,{enabled:l,onClick:i}),a().createElement(te.Z,{height:24,margin:4}),a().createElement(oe.Z,{columnsData:c,selectedColumns:s,onChangeColumns:u}),a().createElement(ce,{className:g.moreButton,showInactive:p,onShowInactiveChange:m}))};ue.propTypes={title:g().string,total:g().number,columnsData:T.uz,selectedColumns:g().arrayOf(g().string),onChangeColumns:g().func,searchQuery:g().string,onChangeSearchQuery:g().func,filtersEnabled:g().bool,onToggleFilters:g().func,showInactive:g().bool,onChangeShowInactive:g().func};const pe=ue;var de=n(26180),me=n(31276);function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){fe(e,t,n[t])}))}return e}function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const he="CHANGE_SEARCH_QUERY",be="CHANGE_SHOW_INACTIVE",ye=ge({},de.ZP.actions,{changeSearchQuery:(0,me.zD)(he),changeShowInactive:(0,me.zD)(be)}),ve=(e,t)=>{switch(t.type){case he:return ge({},e,{searchQuery:t.payload,page:0});case be:return ge({},e,{showInactive:t.payload});default:return de.ZP.reducer(e,t)}};var xe=n(26481),Ee=n(87451),we=n(37152),Ce=n(52016),Se=n(10237),Oe=n(11013),Pe=n(58662),Ne=n(99136);const ke=[10,25,50,100],Ze=[{id:"entity.label",get label(){return h().text("Entity label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING},hideable:!1},{id:"relation.label",get label(){return h().text("Directional label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING}},{id:"relation.activeness.startDate",get label(){return h().text("Start date")},dataTypeDefinition:u.PY2.startDate},{id:"relation.activeness.endDate",get label(){return h().text("End date")},dataTypeDefinition:u.PY2.endDate}],Te=(0,i.pipe)(u.Tde,(0,i.concat)("relation.")),Re=(0,i.pipe)((0,i.map)((e=>({id:Te(e.uri),label:e.label,description:e.description,dataTypeDefinition:(0,u.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),je=(0,i.pipe)(((e,t)=>{let{content:{inRelations:n=[],outRelations:r=[]}}=e,{relationTypes:o}=t;return(0,i.pipe)(H,(0,i.chain)((e=>(0,i.pipe)((0,i.find)((0,i.propEq)("uri",e)),u.DK$)(o))))([...n,...r])}),Re,(0,i.concat)(Ze));var De=n(37754);const Ie=(0,b.Z)({addArea:{display:"flex",alignItems:"center",height:"48px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},noData:{fontSize:"13px",paddingLeft:"20px",marginBottom:"20px",marginTop:"10px",color:"rgba(0,0,0,0.54)"}});function Ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Me=(0,i.pluck)("id",Ze),[Le]=Me;function ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ue=(0,i.memoizeWith)(((e,t)=>t.id),u.fS6),He=(0,c.connect)(((e,t)=>{const{config:n}=t;return{connections:s.ZP.selectors.getConnectionsWithDraftsByViewId(e,n.id),total:s.ZP.selectors.getTotalByViewId(e,n.id),entity:s.ZP.selectors.getEntity(e),metadata:s.ZP.selectors.getMetadata(e),mode:s.ZP.selectors.getMode(e),relationToAdd:s.ZP.selectors.getRelationToAddByViewId(e,n.id),relationsToEdit:s.ZP.selectors.getRelationsToEditByViewId(e,n.id),checkIfCanAddRelations:s.ZP.selectors.getCheckIfCanAddRelations(e,n.content)}}),void 0,((e,t,n)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ze(e,t,n[t])}))}return e}({},e,t,n,{config:Ue(e.metadata,n.config)})))((e=>{let{className:t,config:n,entity:r,metadata:l,connections:p=[],total:m=0,mode:g,relationToAdd:f,relationsToEdit:b=[],checkIfCanAddRelations:y,dispatch:v,readOnlyMode:E}=e;const w={searchQuery:"",filters:null,visibleColumns:Me,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||Le},page:0,rowsPerPage:n.max||15,showInactive:!1},C=Ie(),S=(0,o.useContext)(xe.j)?g:u.fO_.VIEWING,[O,P]=(0,o.useReducer)(ve,w),N=(0,i.pipe)(ye.changeSearchQuery,P),k=(0,i.pipe)(ye.changeShowInactive,P),Z=(0,o.useContext)(Ee.Y),T=(0,c.useSelector)(s.ZP.selectors.getShowAttributeDescription),R=(0,o.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ae(e,t,n[t])}))}return e}({},Z,{showDescription:T})),[Z,T]);(0,o.useEffect)((()=>{N("")}),[null==r?void 0:r.uri]);const{visibleColumns:j,searchQuery:D,filters:I,sorting:A,page:M,rowsPerPage:L,showInactive:z}=O,U=(0,o.useMemo)((()=>je(n,l)),[n,l]),H=(0,o.useMemo)((()=>j.map((e=>U.find((0,i.propEq)("id",e))))),[j,U]),V=(0,o.useMemo)((()=>((e,t,n)=>{const r=u.wSh.fromFalsy(e).map(u.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome(""),o=(0,De.Tz)(n,t);return(new u.MEy).addClause(r).addClause(o).build()})(D,I,H)),[I,D]),{isLoading:F}=(0,we.a)({sorting:A,filter:V,page:M,rowsPerPage:L,config:n,entity:r,relationActivityFilter:z?u.Ng6.ALL:u.Ng6.ACTIVE_ONLY,mode:g}),B=(0,o.useMemo)((()=>{return e=w.rowsPerPage,ke.filter((t=>t!==e)).concat(e).sort(i.subtract);var e}),[]),{handleRowsPerPageChange:W,handlePageChange:q}=(0,o.useMemo)((()=>({handleRowsPerPageChange:(0,i.pipe)(ye.changeRowsPerPage,P),handlePageChange:(0,i.pipe)(ye.changePage,P)})),[]),G=(0,o.useCallback)((()=>{const e=(0,u.vlo)({config:n,mode:S,metadata:l,parentEntityUri:void 0});(0,i.pipe)(s.N5.relations.actions.openRelationEditor(n.id),v)(e)}),[n,S,l,v]),_=(0,o.useCallback)((e=>{v(s.N5.relations.actions.closeRelationEditor(n.id,e)),v(s.N5.relations.actions.removeRelation(n.id,e));const t=p.find((t=>s.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=s.N5.relations.selectors.getEntityUriFromConnection(t);(0,u.ZiX)(r)&&v(s.N5.modifiedEntities.actions.entityDeleted(r))}),[n,p,v]),$=r&&y&&!E,X=f?[f,...b]:b,{canUpdate:Q,canDelete:Y}=(0,Ce.l)(),J=Q(n)&&!E,ee=Y(n)&&!E,te=(0,o.useRef)(null);return a().createElement(Ee.Y.Provider,{value:R},a().createElement(Se.Z,{className:t},a().createElement(pe,{title:n.caption,total:m,columnsData:U,selectedColumns:j,onChangeColumns:(0,i.pipe)(ye.changeColumns,P),searchQuery:D,onChangeSearchQuery:N,filtersEnabled:!!I,onToggleFilters:(0,i.pipe)(ye.toggleFilters,P),showInactive:z,onChangeShowInactive:k}),$&&a().createElement("div",{className:C.addArea},a().createElement(x,{onClick:G})),X.map((e=>a().createElement(Oe.Z,{key:s.N5.relations.selectors.getRelationUriFromConnection(e),connection:e,config:n,mode:S,metadata:l}))),a().createElement("div",{style:{position:"relative"}},a().createElement(K,{mode:S,columnsData:H,connections:p,metadata:l,filters:I,onFilter:(0,i.pipe)(ye.changeFilter,P),sorting:A,onSort:(0,i.pipe)(ye.toggleSort,P),onEditRelation:J?(0,i.pipe)(s.N5.relations.actions.openRelationEditor(n.id),v):null,onRemoveRelation:ee?_:null,basicTableRef:te,allowOnlyCreateNew:n.allowOnlyCreateNew}),p.length?a().createElement(Pe.Z,{count:m,rowsPerPageOptions:B,rowsPerPage:L,onChangeRowsPerPage:W,page:M,onChangePage:q,basicTableRef:te}):a().createElement(d.Typography,{className:C.noData},h().text("No data found")),F&&a().createElement(Ne.Z,null))))}));var Ve=n(36138),Fe=n(22664),Be=n(585);const We=(0,Ve.createGenerateClassName)({productionPrefix:"relTable",disableGlobal:!0}),qe=e=>{let{config:t,store:n,onResize:o=i.identity,className:s,readOnlyMode:u}=e;return a().createElement(c.Provider,{store:n},a().createElement(R.m.Provider,{value:t.id},a().createElement(Ve.StylesProvider,{generateClassName:We},a().createElement(Fe.MuiPickersUtilsProvider,{utils:r.Z},a().createElement(l.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(He,{config:t,className:s,readOnlyMode:u}),a().createElement(Be.Z,null)))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
2
- //# sourceMappingURL=2758.js.map