@reltio/remotes 1.4.1049 → 1.4.1052

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/6833.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[6833],{66833:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Vo});var r=n(24328),a=n.n(r),o=n(52730),l=(n(8598),n(17440)),i=n(36138),s=(n(22664),n(18435));const c=a().createContext({getCurrentPerspectiveId:()=>"",setEntityUri:()=>{},showPerspective:()=>{}});var u=n(87918),p=n.n(u),m=n(3096),d=n.n(m),g=n(89810),f=n(11326),b=n(36852),h=n(58142),y=n(10),E=n(27938),v=n(35722),x=n(589),w=n(80231),S=n(89575),C=n(14834),P=n(62228),O=n(87378),N=n(79002),Z=n(17822),k=n(71153),T=n.n(k),R=n(15177);const I=a().createContext(null);I.displayName="SingleAttributeContext";var j=n(80687),D=n(1730),L=n(42011),A=n(95544),M=n(90436),U=n(52194),F=n(10742),H=n(55310),V=n(37457),z=n(46804),W=n(79784),_=n(77277),B=n(36444),G=n(5806),q=n(21324),$=n(79692);const Q=(0,$.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"}}))),X=e=>{let{className:t}=e;const n=Q(),o=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(I),u=()=>i((e=>!e));return a().createElement(a().Fragment,null,a().createElement(_.Z,{ref:o,classes:{root:T()(n.triggerButton,t)},onClick:u},a().createElement(B.Z,null)),a().createElement(W.ZP,{open:l,classes:{paper:n.popupContent},anchorEl:o.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(G.Z,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:a().createElement(q.Z,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:p().text("Show inactive values")})))},Y=(0,$.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"}}))),K=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:o}=e;const l=Y(),{searchQuery:i,setSearchQuery:s,setPage:c,totalNonVisibleValues:u,nonVisibleValues:m,attributeType:d}=(0,r.useContext)(I);return a().createElement(U.Z,{title:p().text(t),className:l.root},a().createElement(F.Z,{widthToHide:500},a().createElement(H.Z,{height:24,margin:16}),a().createElement(M.Z,{className:l.totalCaption,variant:"caption"},p().number(n)," ",1===n?p().text("item"):p().text("items"))),a().createElement(V.Z,{nonOvTotal:u,className:l.ovIcon,nonOvValues:m,attributeType:d}),a().createElement(z.i,{query:i,onChange:e=>{s(e),c(0)}}),o&&a().createElement(X,null))};var J=n(65549),ee=n(85256),te=n(12212),ne=n(63928),re=n(55401),ae=n(30410);const oe=(0,$.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}))),le=s.nIW,ie=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ie(n,t)})))):s.P6Y.strings.search(String(e),t),se=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:a=1/0,offset:o=0,searchQuery:i=""}=e;const c=(0,l.pipe)(s.XtP,(0,l.filter)((e=>{let{value:t}=e;return ie(t,i)})))(t,n,r),u=(0,l.filter)(s.OXP,c);return{[(0,s.xy8)(r)]:{[le(r)]:u.slice(o,o+a),paging:{[r]:{totalOvValues:u.length,totalValues:c.length}}}}};function ce(){return ce=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},ce.apply(this,arguments)}function ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){pe(e,t,n[t])}))}return e}function pe(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=[],de=e=>{let{values:t,attributeType:n,parentUri:i,showInactive:c}=e;const u=oe(),{uri:m,required:d,cardinality:f,name:b}=n,h=(0,o.useDispatch)(),y=(0,r.useContext)(te.m),E=(0,o.useSelector)(g.ZP.selectors.getEntity),v=(0,o.useSelector)((e=>g.ZP.selectors.getModifiedEntity(e,E.uri)||{})),x=(0,o.useSelector)((e=>g.ZP.selectors.getActiveErrorsForAttributesPager(e,i,n))),w=(0,o.useSelector)((e=>(0,s.tQX)(i,n,g.ZP.selectors.getProfileErrors(e)))),S=(0,o.useSelector)(g.ZP.selectors.getMode),C=(0,s.xy8)(n),P=(0,l.pipe)((0,l.pathOr)(me,[C,b]),(0,l.map)((0,l.prop)("uri")))(E),O=(0,l.pathOr)(me,[C,b],v),N=O.map((0,l.prop)("uri")),Z=(0,s.ZiX)(E.uri),k=(0,r.useRef)((0,s.gjI)({parentUri:i,attributeType:n})),R=(0,s.O27)(O),I=d&&R,j=I?[k.current]:O.filter((0,l.pipe)((0,l.prop)("uri"),s.ZiX)),D=(0,r.useCallback)((e=>(0,l.pipe)(g.N5.actions.addAttributes,h)(e.map((e=>ue({},e,{viewId:y}))))),[y,h]),L=(0,r.useCallback)((e=>(0,l.pipe)(g.N5.actions.modifyAttribute,h)(ue({},e,{viewId:y}))),[y,h]),A=(0,r.useCallback)((e=>(0,l.pipe)(g.N5.actions.removeAttribute,h)(ue({},e,{viewId:y}))),[y,h]),M=(0,r.useCallback)((0,l.pipe)(g.N5.errors.actions.errorDeactivated,h),[h]),U=(0,r.useCallback)((()=>{const e={parentUri:i,attributeType:n};return D(I&&!(0,s.YkM)(n.type)?[e,e]:[e])}),[D,i,n,I]),F=(0,s.Vg3)({attributeType:n,mode:S}),H={attributeType:n,errors:x,crosswalks:v.crosswalks,mode:S,onAddAttributes:D,onChangeAttribute:L,onDeactivateError:M,showNonOv:c};return a().createElement("div",null,a().createElement(ne.Z,{cardinality:f}),a().createElement(re.Z,{message:w}),F&&a().createElement(_.Z,{color:"primary",onClick:U,className:u.moreButton},a().createElement(J.Z,{classes:{root:u.icon}}),a().createElement("div",{className:u.buttonLabel},p().text("Add"))),j.map(((e,t)=>a().createElement(ae.Z,ce({key:e.uri},H,{attributeValue:e,lazy:I&&!d,showEmptyEditors:Z,ownError:(0,s.ADq)(e,t,m,x),onDeleteAttribute:A})))),j.length>0&&t.length>0&&a().createElement(ee.Z,{className:u.divider}),t.map((e=>{const t=O.find((0,l.propEq)("uri",e.uri)),n=t||e,r=P.includes(n.uri)&&!N.includes(n.uri),o=!r&&t&&!((e,t)=>{const n=(0,l.is)(Object,e.value)||(0,l.is)(Object,t.value)?(0,l.over)((0,l.lensPath)(["value"]),(0,s.vKJ)({valueTransformer:(0,l.unless)(s.OXP,(0,l.omit)(["value"])),deleteEmptyComplex:!0})):l.identity;return(0,l.equals)(n(e),n(t))})(t,e),i=(0,l.cond)([[(0,l.always)(r),(0,l.always)("deleted")],[(0,l.always)(o),(0,l.always)("edited")]])();return a().createElement("div",{key:n.uri,className:T()({[u.ovFalse]:!(0,s.OXP)(n)})},a().createElement(ae.Z,ce({},H,{attributeValue:n,ownError:(0,s.ADq)(n,null,m,x),onDeleteAttribute:A,state:i})))})))};var ge=n(11013);const fe=(0,$.Z)((e=>({ovFalse:e.inactive}))),be=e=>{let{values:t,attributeType:n,showInactive:r}=e;const o=fe();return a().createElement(a().Fragment,null,t.map((e=>a().createElement("div",{key:e.uri,className:T()({[o.ovFalse]:!(0,s.OXP)(e)})},a().createElement(ge.Z,{attributeValue:e,attributeType:n,showNonOv:r})))))},he=(0,$.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),ye=e=>{let{config:t,className:n}=e;const{caption:l,max:i,showInactiveValuesMenu:s}=t,c=he(),{values:u,totalVisibleValues:m,page:d,setPage:f,isLoading:b,hasPaging:h,attributeType:y,showInactive:E}=(0,r.useContext)(I),v=(0,o.useSelector)(g.ZP.selectors.getEntityUri),x=(0,o.useSelector)(g.ZP.selectors.getIsViewMode),w=(0,o.useSelector)(g.ZP.selectors.getIsEditableMode),S=(0,o.useSelector)(g.ZP.selectors.getPivotingAttributes),C=0!==u.length;return a().createElement(j.J.Provider,{value:S},a().createElement(D.Z,{className:T()(c.root,n)},a().createElement(K,{totalVisibleValues:m,caption:l,showInactiveValuesMenu:s}),a().createElement(A.Z,{className:c.content},(()=>{if(b)return a().createElement(O.Z,null);if(y){if(x&&C){const e={values:u,attributeType:y,showInactive:E};return a().createElement(be,e)}if(w){const e={values:u,attributeType:y,parentUri:v,showInactive:E};return a().createElement(de,e)}}return a().createElement(M.Z,{className:c.noData},p().text("No data"))})()),h&&a().createElement(L.Z,{count:m,page:d,rowsPerPage:i,rowsPerPageOptions:[],onChangePage:f,classes:{root:c.pagination}})))};var Ee=n(29627),ve=n(55962);function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const we=(e,t,n)=>{const{attributeUri:a,max:i=15}=e,c=(0,o.useSelector)(g.ZP.selectors.getMetadata),[u,p]=(0,r.useState)([]),[m,d]=(0,r.useState)(null),[f,b]=(0,r.useState)(!1),h=(0,Ee._)(),y=(0,r.useRef)(null),E=(0,o.useDispatch)(),v=(0,o.useSelector)(g.ZP.selectors.getApiPath),x=(0,o.useSelector)(g.ZP.selectors.getTenant),w=n?g.ZP.selectors.getEntityWithDiff:g.ZP.selectors.getEntityWithoutDiff,S=(0,o.useSelector)(w),C=(0,o.useSelector)(g.ZP.selectors.getIsViewMode),P=(0,o.useSelector)(g.ZP.selectors.getIsHistoryModeEnabled),O=(0,o.useSelector)(g.ZP.selectors.getHistoryDiff),N=S.uri,Z=le(a),k=(0,s.xy8)(a);y.current=(0,s.JQy)(S,N,Z);const T=(0,r.useMemo)((()=>(0,s.zeJ)(c,a)),[c,a]),{globalFilter:R}=(0,o.useSelector)(g.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:I}=t,j=(0,r.useCallback)((()=>{if(T&&(0,s.Uty)(T)&&!(0,s.ZiX)(N)&&(0,s.YOQ)(a)){b(!0);const{page:e,showInactive:n}=t,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["page","showInactive"]),o=(0,s.biM)(S)||P?se:s.KbL;h(o(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){xe(e,t,n[t])}))}return e}({metadata:c,entity:S,apiPath:v,tenant:x,parentUri:N,defaultMaxValues:i,attributeTypeUri:a,offset:i*e,globalFilter:R,options:n?"":void 0},r))).then((e=>{const t=(0,l.path)([k],e),n=(0,l.pathOr)([],[Z],t);P||E(g.N5.actions.processNextPageOfAttributeValues({parentUri:N,attributeTypeUri:a,attributeTypeName:Z,values:n})),p(n.map((e=>{var t;return(null===(t=y.current)||void 0===t?void 0:t.find((0,l.propEq)("uri",e.uri)))||e}))),d((0,l.path)(["paging",a],t))})).finally((()=>{b(!1)}))}else p([]),d(null)}),[v,N,x,a,i,c,t,R,T,P,O]);(0,r.useEffect)((()=>{j()}),[j]),(0,ve.D)((()=>{C&&j()}),[C]);const D=(0,l.partition)(s.OXP),[,L]=D(y.current||[]),A=I?[]:L,M=I?"totalValues":"totalOvValues",U=(0,l.ifElse)((0,l.has)(M),(0,l.prop)(M),(0,l.always)(u.length))(m),F=i<U,H=null!=m&&m.totalValues?m.totalValues-U:A.length;return{values:u,isLoading:f,hasPaging:F,totalVisibleValues:U,attributeType:T,totalNonVisibleValues:H,nonVisibleValues:A}};function Se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ce=n(80225),Pe=n(63929),Oe=n(1128),Ne=n(39475),Ze=n(90324),ke=n(70595);const Te=a().createContext(null);Te.displayName="RelationsViewStateContext";const Re=(0,$.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"}}))),Ie=e=>{let{className:t}=e;const n=Re(),o=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:c,toggleSortOrder:u,sortOption:m,changeSortOption:d,sortOptions:g}=(0,r.useContext)(Te),[f,b]=(0,r.useState)(!1),h=()=>b((e=>!e)),y=!(0,s.O27)(g),E="asc"===c;return a().createElement(a().Fragment,null,a().createElement(_.Z,{ref:o,classes:{root:T()(n.button,t)},onClick:h},a().createElement(B.Z,null)),a().createElement(W.ZP,{open:f,classes:{paper:n.popupContent},anchorEl:o.current,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(G.Z,{classes:{label:n.checkboxControlLabel},control:a().createElement(q.Z,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:p().text("Show inactive Relationships")}),y&&a().createElement(a().Fragment,null,a().createElement(ee.Z,{className:n.divider}),a().createElement(M.Z,{className:n.title,variant:"h6"},p().text("Sort by")),a().createElement("div",{className:n.sortControls},a().createElement(Oe.Z,{entries:g,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:m,onChange:d,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),a().createElement(Ne.k,{tooltipTitle:E?p().text("Ascending"):p().text("Descending"),icon:E?Ze.Z:ke.Z,onClick:u,className:n.sortOrderButton,size:"L"})))))};Ie.displayName="FilterButton";const je=Ie,De=(0,$.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 Le=n(61932),Ae=n(98538);const Me=a().createContext(null);function Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){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=Math.pow(2,31)-1,Ve=(0,$.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 ze=n(22118),We=n(26739);const _e=e=>{let{label:t}=e;const n=Ve();return a().createElement(We.Z,{classes:{anchorOriginTopRightRectangle:n.badgePosition,badge:n.badge},badgeContent:t},a().createElement(Le.Z,null))},Be=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:l,onImportClick:i}=(()=>{var e;const t=(0,o.useSelector)(g.ZP.selectors.getDataTenants),n=(0,o.useDispatch)(),{config:a,reloadRelations:l}=(0,r.useContext)(Me),i=(0,o.useSelector)(g.ZP.selectors.getEntityUri),[c,u]=(0,r.useState)([]),[m,d]=(0,r.useState)(null),f=(0,o.useSelector)(g.ZP.selectors.getDtssPath),b=(0,o.useSelector)(g.ZP.selectors.getTenant),h=[Ue({},a.content,{offset:0,max:null!==(e=a.maxDtssImport)&&void 0!==e?e:He})],y=(0,r.useCallback)((()=>{u([]),a.importFromDT&&!(0,s.ZiX)(i)&&Promise.all((t||[]).map((e=>(0,s.QXb)({entityUri:i,content:h,dtssPath:f,customerTenant:b,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return Ue({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(u)}),[i,f,b,a,t]),E=(0,r.useCallback)((()=>{(0,s.MOC)({entityUri:i,content:h,dtssPath:f,customerTenant:b,dataTenant:m.id}).then((()=>{l(),y()})).catch((e=>n(g.ui.actions.errorSet((0,s.xU7)(e,p().text("Something went wrong")))))),d(null)}),[i,f,b,a,y,l,m,d]);(0,r.useEffect)((()=>{y()}),[y]);const v=(0,r.useCallback)((()=>d(null)),[]),x=(0,r.useCallback)((e=>d(e)),[]);return{tenants:c,selectedTenant:m,onConfirmImport:E,onCancelConfirmation:v,onImportClick:x}})(),c=Ve(),u=1===e.length,m=u?0===e[0].label.indexOf("DT:")?e[0].label[3]:e[0].label[0]:e.length;return a().createElement(a().Fragment,null,!!e.length&&a().createElement(a().Fragment,null,u?a().createElement("div",{className:c.button},a().createElement(Ne.k,{size:"L",icon:Le.Z,tooltipTitle:p().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>i(e[0])}),a().createElement("div",{className:T()(c.tenant)},m)):a().createElement(Ae.Z,{menuId:"importDT-table-actions",buttonComponent:Ne.k,buttonProps:{tooltipTitle:p().text("Import connections"),size:"L",icon:()=>a().createElement(_e,{label:m})},menuItems:e.map((e=>({onClick:()=>{i(e)},text:e.label})))}),a().createElement(ze.Z,{open:!!t,title:p().text("Confirmation"),content:p().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:p().text("Cancel"),saveCaption:p().text("Import"),onDiscard:l,onSave:n})))},Ge=e=>{let{title:t,total:n}=e;const o=De(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(Te);return a().createElement(U.Z,{title:t||"",className:o.header},n>0&&a().createElement(F.Z,{widthToHide:400},a().createElement(H.Z,{height:24,margin:16}),a().createElement(M.Z,{className:o.totalCaption,variant:"caption"},n>1?p().text("${count} items",{count:n}):p().text("${count} item",{count:n}))),a().createElement(z.i,{query:l,onChange:i}),a().createElement(Be,null),a().createElement(je,null))};var qe=n(821),$e=n(27604),Qe=n(22983),Xe=n(42662),Ye=n(18527),Ke=n(4614),Je=n(80030);const et=(0,$.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:i}=e,c=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["label","entity","children"]);const u=et(),p=(0,Ee._)(),m=(0,o.useSelector)(g.ZP.selectors.getTenant),d=(0,o.useSelector)(g.ZP.selectors.getDtssPath),[f,b]=(0,r.useState)(!1),[h,y]=(0,r.useState)(null);(0,r.useEffect)((()=>{y(null)}),[n]);const E=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&(0,l.isNil)(h)){const e=(0,l.ifElse)(s.biM,(e=>(0,s.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:m,dtssPath:d})),(e=>(0,s.XkT)(e.entityUri)));b(!0),p(e(n)).then((e=>{let{secondaryLabel:t}=e;y(t)})).finally((()=>{b(!1)}))}}),[d,n,m,p,h]),v=a().createElement("div",{className:u.tooltipContent},a().createElement("div",{className:u.label},t),f&&a().createElement(Ke.Z,{size:16,classes:{colorPrimary:u.progress}}),h&&a().createElement("div",{className:u.secondaryLabel},h));return a().createElement(Je.ZP,tt({onOpen:E,title:v,disableFocusListener:!0,classes:{tooltip:u.tooltip}},c),i)},rt=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,s.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,s.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,s.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,s.Lmx)(t,null==r?void 0:r.relationType)}},at=(0,$.Z)((()=>({container:{display:"flex"}})));function ot(){return ot=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},ot.apply(this,arguments)}const lt=e=>{let{acceptRelation:t,ignoreRelation:n}=e,r=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["acceptRelation","ignoreRelation"]);const o=at();return a().createElement("div",{className:o.container},a().createElement(_.Z,ot({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),p().text("Accept")),a().createElement(_.Z,ot({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),p().text("Ignore")))},it=(0,$.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:o,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:c,onIgnoreRelation:u,renderRelationArrowButton:m}=e;const d=it(),{entity:g,relation:f}=t,b=(0,s.$qe)(t),h=(0,s.xr3)(t),y=(0,s.iJH)(t),{entityType:E,entityLabel:v,preparedUri:x,relationLabel:w}=rt(t,n),S=(0,s.Fn9)(f)&&(0,s.Fn9)(g),{canRemove:C,canUpdate:P}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:a,onEditRelation:o}=e;if((n===s.ARY.Editing||n===s.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,s.$qe)(r),i=(0,s.V3K)(t,e);return{canRemove:a&&!l&&(0,s.Edd)(n,i),canUpdate:o&&!l&&(0,s.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:s.ARY.Editing,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),O=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),N=(0,r.useCallback)((()=>i(t)),[i,t]),Z=(0,r.useCallback)((()=>{c(t)}),[c,t]),k=(0,r.useCallback)((()=>u(t)),[u,t]),R=(C||P)&&o&&!t.suggested?a().createElement(a().Fragment,null,P&&a().createElement(Ne.k,{icon:$e.Z,size:"XS",onClick:N,tooltipTitle:p().text("Edit")}),C&&a().createElement(Ne.k,{icon:Qe.Z,size:"XS",onClick:O,tooltipTitle:p().text("Remove")})):void 0,I=t.suggested?a().createElement(lt,{acceptRelation:Z,ignoreRelation:k,size:"small",disabled:y}):void 0,j=y?p().text("ignored"):p().text("edited");return a().createElement("div",{className:T()(d.container,{[d.rowInactive]:!S},{[d.removed]:b||y})},a().createElement("div",{className:d.row},m&&m(),a().createElement(Xe.Z,{className:d.entityAvatar,entityType:E}),a().createElement(Ye.Z,{value:x,className:d.entityLabelContainer},a().createElement(nt,{label:v,entity:g},a().createElement("span",{className:d.entityLabel},v)),(h||y)&&a().createElement(M.Z,{variant:"caption",className:d.editedLabel},"(",j,")"),w&&a().createElement("span",{className:d.relationLabel},`, ${w}`)),a().createElement("div",{className:d.editButtonsContent},R),I))})),ct=(e,t)=>{const n=(e,t)=>(t?(0,s.VGB)(t):[]).map((t=>({type:t,direction:e===s.Nsj.IN?s.Nsj.IN:s.Nsj.OUT})));return n(s.Nsj.IN,e).concat(n(s.Nsj.OUT,t))[0]};function ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pt=n(98989),mt=n(83543);const dt=(0,$.Z)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),gt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:o}=e;const l=dt(),{parentEntityUri:i}=n,{contentSecondLevel:c}=r,u={onClick:t,className:l.arrowIcon};return i||!c||(0,s.xvW)(n)?null:o?a().createElement(mt.Z,u):a().createElement(pt.Z,u)},ft=(0,$.Z)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),bt=e=>{let{config:t,connection:n,children:l}=e;const i=ft(),{showInactive:c}=(0,r.useContext)(Te),{connections:u,showSecondLevel:p,toggleShowSecondLevel:m,loadRelations:d,loading:f,total:b}=(e=>{let{config:t,connection:n,relationActivityFilter:a}=e;const l=(0,o.useDispatch)(),[i,c]=(0,r.useState)(!1),[u,p]=(0,r.useState)(!1),[m,d]=(0,r.useState)(0),{contentSecondLevel:f}=t,{entity:b}=n,h=(0,o.useSelector)((e=>g.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,b.entityUri)))||[],{activityFilter:y}=(0,o.useSelector)(g.ZP.selectors.getGlobalSearchRequestOptions)||{},E=(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){ut(e,t,n[t])}))}return e}({},f,{returnObjects:!0,returnDates:!0,activeness:{relation:a||s.Ng6.ALL,entity:y}});p(!0),(0,s.N6e)(b.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&l(g.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:b.entityUri,id:t.id})),d(r),p(!1)}))}),[t.id,f,l,b.entityUri,y,a]),v=(0,r.useCallback)((()=>{i||n.connections||E(),c((e=>!e))}),[E,n.connections,i]);return{connections:h,showSecondLevel:i,toggleShowSecondLevel:v,loadRelations:E,loading:u,total:m}})({config:t,connection:n,relationActivityFilter:c?s.Ng6.ALL:s.Ng6.ACTIVE_ONLY}),h=(0,r.useMemo)((()=>(0,s.Px$)(u)),[u]);return a().createElement(a().Fragment,null,l((()=>a().createElement(gt,{onClick:m,connection:n,config:t,showSecondLevel:p}))),p&&a().createElement(Pe.X.Provider,{value:h},a().createElement("div",{className:i.secondLevelContent},a().createElement(qt,{isLoading:f,config:t,loadRelations:d,connections:u,total:b,parentEntityUri:n.entity.entityUri}))))},ht=(0,$.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"}}))),yt=e=>{let{className:t,connections:n=[],config:i,mode:c,noDataText:u,parentEntityUri:m}=e;const d=(0,o.useSelector)(g.ZP.selectors.getMetadata),f=(0,o.useSelector)((e=>g.ZP.selectors.getRelationToAddByViewId(e,i.id))),b=(0,o.useSelector)((e=>g.ZP.selectors.getRelationsToEditByViewId(e,i.id))),h=(0,o.useSelector)(g.ZP.selectors.getEntity),y=(0,o.useSelector)((e=>g.ZP.selectors.getCheckIfCanAddRelations(e,i.content))),E=(0,o.useDispatch)(),v=ht(),x=(0,r.useCallback)((()=>{const e=(0,s.vlo)({config:i,mode:c,metadata:d,parentEntityUri:m});(0,l.pipe)(g.N5.relations.actions.openRelationEditor(i.id),E)(e)}),[i,c,d,E,m]),w=(0,r.useCallback)((e=>{E(g.N5.relations.actions.closeRelationEditor(i.id,e)),E(g.N5.relations.actions.removeRelation(i.id,e));const t=n.find((t=>g.N5.relations.selectors.getRelationUriFromConnection(t)===e)),r=g.N5.relations.selectors.getEntityUriFromConnection(t);(0,s.ZiX)(r)&&E(g.N5.modifiedEntities.actions.entityDeleted(r))}),[i,n,E]),S=i.content,C=ct(S.inRelations,S.outRelations),P=(0,r.useCallback)((e=>{const t=(0,l.pipe)((0,l.omit)(["suggested"]),(0,l.evolve)({relation:{relationType:(0,l.always)(C.type),object:(0,l.evolve)({type:(0,l.always)(C.type),attributes:(0,l.always)(null)})}}))(e);E(g.N5.relations.actions.addRelation(i.id,t))}),[E,i,C]),O=(0,r.useCallback)((e=>{E(g.N5.relations.actions.ignoreRelation(i.id,{relationType:C.type,relationDirection:C.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[E,i,C]),[N,Z]=(0,l.partition)(s.xvW,n),k=h&&y,T=0===N.length&&0===Z.length,R=e=>{var t,n;const r=b.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)})),o=!i.allowOnlyCreateNew||(0,s.xvW)(e),u=`${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 a().createElement(bt,{config:i,connection:e,key:u},(t=>r?a().createElement(qe.Z,{connection:r,config:i,mode:c,metadata:d}):a().createElement(st,{renderRelationArrowButton:t,connection:e,metadata:d,showControls:o,onRemoveRelation:w,onEditRelation:(0,l.pipe)(g.N5.relations.actions.openRelationEditor(i.id),E),onAcceptRelation:P,onIgnoreRelation:O})))},I=k&&(!f||f&&f.parentEntityUri===m),j=f&&f.parentEntityUri===m;return a().createElement("div",{className:t},I&&a().createElement(_.Z,{color:"primary",onClick:x,className:v.moreButton},a().createElement(J.Z,{classes:{root:v.icon}}),a().createElement("div",{className:v.buttonLabel},p().text("Add"))),j&&a().createElement(qe.Z,{connection:f,config:i,mode:c,metadata:d}),N.map(R),N.length>0&&Z.length>0&&a().createElement(ee.Z,{className:v.divider}),Z.map(R),T&&a().createElement(M.Z,{className:v.noData},u))};var Et=n(62901),vt=n(72316),xt=n(38309),wt=n(89978);const St=(0,$.Z)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Ct(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pt(e,t,n[t])}))}return e}function Pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ot=e=>{let{connection:t,className:n}=e;const i=St(),{relation:c}=t,u=(0,o.useSelector)(g.ZP.selectors.getEntityUri),m=(0,o.useSelector)(g.ZP.selectors.getMetadata),d=(0,r.useMemo)((()=>(0,s.xF8)(m,null==c?void 0:c.relationType)),[null==c?void 0:c.relationType,m]),f=(0,r.useMemo)((()=>Ct({attributes:Ct({},g.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,s.p2l)((null==t?void 0:t.relation)||{}))),[t]),b=(0,r.useMemo)((()=>(0,s.fyF)(d,f)),[d,f]).filter((e=>{let{values:t}=e;return!(0,s.O27)(t)})).length>0,y=(0,r.useMemo)((()=>(0,s.R$r)(f.attributes)),[f]),{getCommentsCount:E}=(0,r.useContext)(h.h);(0,r.useEffect)((()=>{!(0,l.isEmpty)(y)&&E(y)}),[E,y]);const v=(0,r.useMemo)((()=>(0,s.wp9)(s.q7e.RELATION,{entityUri:u,connection:t})),[t,u]);return b?a().createElement(xt.A.Provider,{value:v},a().createElement(wt.Z,{className:T()(i.attributesList,n),entity:f,attrTypes:d})):a().createElement("div",{className:T()(i.attributesList,n)},p().text("No attributes"))};var Nt=n(86680),Zt=n(82726);const kt=e=>{let{show:t,onToggle:n,className:r}=e;return a().createElement(Ne.k,{className:r,tooltipTitle:t?p().text("Hide attributes of the relationship"):p().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?Nt.Z:Zt.Z,onClick:n})},Tt=(0,$.Z)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"flex-start",flexDirection:"row",minHeight:"16px",padding:"3px 16px 0 "},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"},showDetails:{marginLeft:"auto"},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"},suggestedLabelWrapper:{marginTop:"6px"},labelWrapper:{display:"flex"}}))),Rt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:i,ignoreRelation:c}=e;const u=Tt(),p=t.suggested,{entity:m,relation:d}=t,[f,b]=(0,r.useState)(!1),h=(0,o.useSelector)(g.ZP.selectors.getMetadata),{entityType:y,entityLabel:E,preparedUri:v,relationLabel:x}=rt(t,h),w=(0,s.Fn9)(d)&&(0,s.Fn9)(m),S=(0,o.useSelector)(g.ZP.selectors.getEntityUri),C=m&&d&&(0,s.wp9)(s.q7e.RELATION,{entityUri:S,connection:t})||[];return a().createElement("div",{className:T()(u.container,{[u.rowInactive]:!w},{[u.suggestedWrapper]:p})},a().createElement("div",{className:T()(u.row,Et.U)},n&&n(),a().createElement("div",{className:T()(u.labelWrapper,{[u.suggestedLabelWrapper]:p})},a().createElement(Xe.Z,{className:u.entityAvatar,entityType:y}),a().createElement(Ye.Z,{value:v,className:u.entityLabelContainer},a().createElement(nt,{label:E,entity:m},a().createElement("span",{className:u.entityLabel},E)),x&&a().createElement("span",{className:u.relationLabel},`, ${x}`))),a().createElement("div",{className:u.additionalButtonsWrapper},!(0,l.isEmpty)(C)&&a().createElement(vt.Z,{className:u.commentsContainer,uri:null==d?void 0:d.relationUri,relatedObjectUris:C,objectType:s.q7e.RELATION,allowOnlyOneComment:!0}),p&&a().createElement(lt,{size:"small",acceptRelation:i(t),ignoreRelation:c(t)}),!p&&a().createElement(kt,{show:f,onToggle:()=>{b((e=>!e))},className:u.showDetails}))),f&&a().createElement(Ot,{connection:t}))}));var It=n(52691),jt=n(16208);const Dt=e=>e.filter((e=>5===e.value)).length,Lt=e=>e.filter((e=>1===e.value)).length,At=e=>0===e.length?"0%":Dt(e)/e.length*100+"%",Mt=e=>0===e.length?"0%":Lt(e)/e.length*100+"%",Ut=(0,$.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)"}}))),Ft=e=>{let{ratings:t,className:n}=e;const r=Ut();return a().createElement("div",{className:T()(r.wrapper,n)},a().createElement(M.Z,{className:r.averageRating},(e=>(0,l.pipe)((0,l.pluck)("value"),l.mean,(0,l.defaultTo)(0))(e))(t).toFixed(1)),a().createElement("div",{className:r.scale},a().createElement("div",{className:r.likesScale,style:{width:At(t)}}),a().createElement("div",{className:r.dislikesScale,style:{width:Mt(t)}})),a().createElement("div",{className:r.counts},a().createElement("div",{className:T()(r.likesCount,r.count)},a().createElement(It.Z,{className:r.icon}),Dt(t)),a().createElement("div",{className:r.count},a().createElement(jt.Z,{className:r.icon}),Lt(t))))},Ht=(0,$.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}}))),Vt=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const l=Ht(),i=(0,o.useSelector)(g.ZP.selectors.getUserName),s=t.find((e=>{let{user:t}=e;return t===i})),c=[{text:p().text("Has left the practice"),onClick:()=>r(p().text("Has left the practice"))},{text:p().text("Has moved away"),onClick:()=>r(p().text("Has moved away"))},{text:p().text("Has passed away"),onClick:()=>r(p().text("Has passed away"))},{text:p().text("Has retired"),onClick:()=>r(p().text("Has retired"))},{text:p().text("Other"),onClick:()=>r(p().text("Other"))}];return a().createElement("div",{className:l.wrapper},a().createElement(_.Z,{onClick:n,variant:"text",size:"small",className:T()(l.button,l.likeButton,{[l.isActive]:5===(null==s?void 0:s.value)})},"Agree"),a().createElement(Ae.Z,{buttonProps:{endIcon:a().createElement(mt.Z,null),variant:"text",size:"small",className:T()(l.button,{[l.isActive]:1===(null==s?void 0:s.value)})},buttonContent:1===(null==s?void 0:s.value)?s.comment:"Disagree",menuItems:c,menuId:"disagree-dropdown-menu-button"}))},zt=(0,$.Z)((e=>({wrapper:{padding:"6px 16px 3px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},entityLabelContainer:{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 16px 3px",backgroundColor:e.suggested},commentsContainer:{marginTop:"21px","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"}}))),Wt=e=>{let{connection:t,loadRelations:n,renderRelationArrowButton:i,acceptRelation:c,ignoreRelation:u}=e;const p=zt(),m=t.suggested,[d,f]=(0,r.useState)(!1),{entity:b,relation:h}=t,y=(0,o.useSelector)(g.ZP.selectors.getMetadata),{entityLabel:E,entityType:v,preparedUri:x,relationLabel:w}=rt(t,y),S=(null==h?void 0:h.ratings)||[],C=(0,o.useSelector)(g.ZP.selectors.getEntityUri),P=b&&h&&(0,s.wp9)(s.q7e.RELATION,{entityUri:C,connection:t})||[];return a().createElement("div",{className:T()(p.wrapper,{[p.suggestedWrapper]:m})},a().createElement(A.Z,{display:"flex",minHeight:"62px",className:Et.U},a().createElement(A.Z,{display:"flex",alignItems:"flex-start"},a().createElement(A.Z,{display:"flex",alignItems:"center"},i&&i(),a().createElement(Xe.Z,{entityType:v,className:p.entityTypeIcon})),a().createElement(A.Z,{display:"flex",flexDirection:"column"},a().createElement(Ye.Z,{value:x,className:p.entityLabelContainer},a().createElement(nt,{label:E,entity:b},a().createElement("span",{className:p.entityLabel},E))),w&&a().createElement("span",{className:p.relationLabel},w),!m&&a().createElement(Vt,{ratings:S,onAgree:()=>{(0,s.Buf)(null==h?void 0:h.relationUri,{comment:"",value:5}).then(n)},onDisagree:e=>{(0,s.Buf)(null==h?void 0:h.relationUri,{comment:e,value:1}).then(n)}}))),a().createElement("div",{className:p.additionalButtonsWrapper},!(0,l.isEmpty)(P)&&a().createElement(vt.Z,{className:p.commentsContainer,uri:null==h?void 0:h.relationUri,relatedObjectUris:P,objectType:s.q7e.RELATION,allowOnlyOneComment:!0}),m&&a().createElement(lt,{acceptRelation:c(t),ignoreRelation:u(t)}),!m&&a().createElement(a().Fragment,null,a().createElement(Ft,{ratings:S,className:p.ratings}),a().createElement(kt,{show:d,onToggle:()=>{f((e=>!e))},className:p.showDetailsButton})))),d&&a().createElement(Ot,{connection:t,className:p.relationAttributes}))},_t=e=>{let{className:t,connections:n=[],loadRelations:l,config:i,mainEnityUri:c}=e;const{isComplex:u,content:m}=i,{ignoreRelation:d,acceptRelation:f}=((e,t,n)=>{const r=ct(e.inRelations,e.outRelations),a=(0,o.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:o}=e;(0,s.iiD)(n,{relatedEntityUri:o.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{a(g.ui.actions.errorSet((0,s.xU7)(e,p().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:o,relation:l}=e,{startDate:i,endDate:c}=l,u=r.direction===s.Nsj.IN,m=u?o.entityUri:n,d=u?n:o.entityUri;(0,s.DsR)({startEntityUri:m,endEntityUri:d,relationType:r.type,attributes:null,startDate:i,endDate:c}).then(t).catch((e=>{a(g.ui.actions.errorSet((0,s.xU7)(e,p().text("Something went wrong"))))}))}}})(m,l,c),b=(0,r.useMemo)((()=>(0,s.w3p)(n)),[n]),{getCommentsCount:y}=(0,r.useContext)(h.h);return(0,r.useEffect)((()=>{y(b)}),[y,b]),a().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 a().createElement(bt,{config:i,connection:e,key:r},(t=>u?a().createElement(Wt,{loadRelations:l,connection:e,acceptRelation:f,ignoreRelation:d,renderRelationArrowButton:t}):a().createElement(Rt,{acceptRelation:f,ignoreRelation:d,connection:e,renderRelationArrowButton:t})))})))};_t.displayName="RelationsList";const Bt=_t,Gt=(0,$.Z)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),qt=e=>{let{isLoading:t,config:n,loadRelations:r,connections:l,total:i,parentEntityUri:c}=e;const u=Gt(),{selectors:m}=g.ZP,d=(0,o.useSelector)(m.getEntity),f=(0,o.useSelector)(m.getMode),b=n["text-empty"]||p().text("No data found");return t?a().createElement(O.Z,null):(0,s.KIu)(f)?a().createElement(yt,{connections:l,className:u.list,key:null==d?void 0:d.uri,config:n,mode:f,noDataText:b,parentEntityUri:c}):i>0?a().createElement(Bt,{config:n,loadRelations:r,connections:l,className:u.list,key:null==d?void 0:d.uri,mainEnityUri:d.uri}):a().createElement(M.Z,{className:u.noData},b)},$t=(0,$.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}}),Qt=e=>{let{config:t,className:n}=e;const i=$t(),{page:c,setPage:u,rowsPerPage:p,sortOrder:m,sortOption:d,showInactive:f,searchQuery:b,changeSearchQuery:h}=(0,r.useContext)(Te),{selectors:y}=g.ZP,E=(0,o.useSelector)((e=>y.getConnectionsWithDraftsByViewId(e,t.id))),v=(0,o.useSelector)(y.getEntity),x=(0,o.useSelector)((e=>y.getTotalByViewId(e,t.id))),w=(0,o.useSelector)(y.getMode),S=(0,r.useMemo)((()=>({order:m,field:d})),[m,d]);(0,r.useEffect)((()=>{h("")}),[null==v?void 0:v.uri]);const C=(0,r.useMemo)((()=>(e=>{const t=s.wSh.fromFalsy(e).map(s.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new s.MEy).addClause(t).build()})(b)),[b]),{isLoading:P,reload:O}=(0,Ce.a)({sorting:S,filter:C,page:c,rowsPerPage:p,config:t,entity:v,relationActivityFilter:f?s.Ng6.ALL:s.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,s.Px$)(E)),[E]),Z=(0,r.useMemo)((()=>({reloadRelations:O,config:(0,l.pick)(["content","importFromDT","maxDtssImport"],t)})),[O,t]);return a().createElement(Pe.X.Provider,{value:N},a().createElement(D.Z,{className:n},a().createElement("div",{className:i.container},a().createElement(Me.Provider,{value:Z},a().createElement(Ge,{title:t.caption,total:x})),a().createElement("div",{className:i.content},a().createElement(qt,{isLoading:P,config:t,loadRelations:O,connections:E,total:x}),x>p&&a().createElement(L.Z,{classes:{root:i.pagination},count:x,rowsPerPageOptions:[],rowsPerPage:p,page:c,onChangePage:u})))))};Qt.displayName="RelationsView";const Xt=a().createContext(null);Xt.displayName="SingleAttributeContext";var Yt=n(17569),Kt=n(75975),Jt=n(79573);function en(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){tn(e,t,n[t])}))}return e}function tn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const nn="CHANGE_SEARCH_QUERY",rn=en({},Kt.ZP.actions,{changeSearchQuery:(0,Jt.zD)(nn)}),an=(e,t)=>t.type===nn?en({},e,{searchQuery:t.payload,page:0}):Kt.ZP.reducer(e,t);var on=n(92332),ln=n(25843);const sn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},cn=(0,$.Z)((()=>({tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},rowCell:{fontSize:"13px",overflow:"hidden"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},"row-cell--removed":{pointerEvents:"none","& > div":sn}}))),un=(0,ln.Z)((e=>{const t=cn();return a().createElement("div",{className:t.headCell},a().createElement(on.default,e))}));var pn=n(46728);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 dn=(0,l.pipe)((0,l.map)((e=>({id:(0,s.Tde)(e.uri),label:e.label,dataTypeDefinition:(0,s.PFL)(e)}))),(0,l.uniqBy)((0,l.prop)("id"))),gn=(0,l.pipe)(s.DK$,dn),fn=(0,l.pipe)((0,l.split)("."),(0,l.slice)(2,1/0)),bn=e=>{if((0,s.vZp)(e)){const t=fn(e);return t.length>1?t.slice(0,-1):null}return null},hn=(0,l.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){mn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:bn(e.id),headCellRenderer:un,rowCellValueRenderer:pn.Z})));var yn=n(9377);function En(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vn=n(47081),xn=n(33903),wn=n(54238);const Sn=(0,$.Z)((()=>({header:{padding:"0 4px 0 16px"}}))),Cn=e=>{let{title:t,searchQuery:n,onChangeSearchQuery:r,filtersEnabled:o,onToggleFilters:l,columnsData:i,selectedColumns:s,onChangeColumns:c}=e;const u=Sn();return a().createElement(U.Z,{title:t,className:u.header},a().createElement(z.i,{query:n,onChange:r}),a().createElement(xn.Z,{enabled:o,onClick:l}),a().createElement(H.Z,{height:24,margin:4}),a().createElement(wn.Z,{columnsData:i,selectedColumns:s,onChangeColumns:c}))};function Pn(){return Pn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pn.apply(this,arguments)}const On=(0,n(30488).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:o}=e,l=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["cell","CellValueRenderer","isRemoved","isSorted"]);const i=cn();return a().createElement("div",{className:T()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,Pn({key:t,value:e},l)))))}));var Nn=n(45108);const Zn=e=>{let{onEdit:t,onRemove:n}=e;return a().createElement(a().Fragment,null,t&&a().createElement(Ne.k,{tooltipTitle:p().text("Edit"),icon:$e.Z,size:"L",onClick:t}),n&&a().createElement(Ne.k,{tooltipTitle:p().text("Remove"),icon:Qe.Z,size:"L",onClick:n}))};function kn(){return kn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kn.apply(this,arguments)}const Tn=e=>{let{columnsData:t,values:n,sorting:i,onSort:c,filters:u,onFilter:p,config:m,onEdit:d,onDeleteAttribute:f,deletedUris:b}=e;const h=(0,r.useMemo)((()=>((e,t)=>e.map((e=>(0,l.pipe)((0,l.reduce)(((t,n)=>{let{id:r}=n;return(0,l.assoc)(r,((e,t)=>((e,t)=>(0,l.pipe)((0,l.path)(["value"]),(0,s.tT_)(e))(t))(fn(e),t))(r,e),t)}),{}),(0,l.assoc)("value",e))(t))))(n,t)),[n,t]),y=(0,r.useMemo)((()=>hn(t)),[t]),E=cn(),v=(0,o.useSelector)(g.ZP.selectors.getMode),x=(0,s.KIu)(v),w=(0,o.useSelector)(g.ZP.selectors.getMetadata),S=(0,o.useSelector)(g.ZP.selectors.getEntityUri),C=(0,o.useSelector)((e=>g.ZP.selectors.getModifiedEntity(e,S)||{})),{attributeType:P}=(0,r.useContext)(Xt),O=(0,r.useCallback)((e=>a().createElement(On,kn({},e,{isSorted:!!i&&i.field===e.columnData.id}))),[i]),[N,Z]=(0,r.useState)(null),{canUpdate:k,canDelete:T}=(0,vn.l)(),R=(0,r.useMemo)((()=>"number"!=typeof N||!x||b.includes((0,l.pipe)((0,l.path)([N]),(0,l.prop)("uri"))(n))),[N,b,n]),I="number"==typeof N&&(j=(0,l.path)([N],n),T(m)&&(0,s.xv5)({attributeType:P,mode:v,attributeValue:j,metadata:w,isReltioCrosswalk:(0,s.KVV)(C.crosswalks,j)}));var j;const D="number"==typeof N&&(e=>k(m)&&(0,s.yv0)({attributeType:P,mode:v,attributeValue:e,isReltioCrosswalk:(0,s.KVV)(C.crosswalks,e)}))((0,l.path)([N],n)),L=(0,r.useCallback)((()=>{const e=(0,l.path)([N],n);D&&d(e)}),[d,N,n,D]),A=(0,r.useCallback)((()=>{const e=(0,l.path)([N],n);if(!I)return;const t={parentUri:S,attributeType:P,uri:e.uri,value:e};f(t)}),[N,n,f,I]),M=R||!I&&!D?void 0:a().createElement(Zn,{onEdit:D?L:void 0,onRemove:I?A:void 0}),U=(0,r.useMemo)((()=>({deletedUris:b})),[b]);return a().createElement("div",{className:E.tableContainer},a().createElement(Nn.Z,{columnsData:y,rowsData:h,sorting:i,onSort:c,filters:u,onFilter:p,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:O,onRowHover:Z,hoverRowIndex:N,hoveredRowRightContent:M,context:U,classes:{hoveredRowRightContentWrapper:E["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:E["row-cell__buttons-container"]}}))},Rn=(0,$.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 In(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jn=e=>{let{onChangeAttribute:t,onCancel:n,onApply:i,onDeleteAttribute:c,hasChanges:u,attributeValue:m}=e;const d=Rn(),f=(0,o.useSelector)(g.ZP.selectors.getEntityUri),{attributeType:b}=(0,r.useContext)(Xt),h=(0,o.useSelector)((e=>g.ZP.selectors.getModifiedEntity(e,f)||{})),y=(0,o.useSelector)(g.ZP.selectors.getMode),E=(0,o.useDispatch)(),v=(0,r.useContext)(te.m),x=(0,r.useCallback)((e=>(0,l.pipe)(g.N5.actions.addAttributes,E)(e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){In(e,t,n[t])}))}return e}({},e,{viewId:v}))))),[v,E]),w=(0,s.ZiX)(f),S=(0,o.useSelector)((e=>g.ZP.selectors.getActiveErrorsForAttributesPager(e,f,b))),C=(0,r.useCallback)((0,l.pipe)(g.N5.errors.actions.errorDeactivated,E),[E]);return a().createElement(a().Fragment,null,a().createElement(ae.Z,{attributeValue:m,showEmptyEditors:w,onDeleteAttribute:c,onDeactivateError:C,onChangeAttribute:t,onAddAttributes:x,mode:y,crosswalks:h.crosswalks,errors:S,attributeType:b,ownError:(0,s.ADq)(m,null,b.uri,S)}),a().createElement("div",{className:d.actionButtons},a().createElement(_.Z,{onClick:()=>{n(m)}},p().text("Cancel")),a().createElement(_.Z,{color:"primary",disabled:!u,onClick:()=>{i(m)}},p().text("Apply"))))},Dn=(0,$.Z)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",flex:1,overflow:"auto"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},tableContainer:{height:"477px",display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"},addButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},editor:{padding:"4px 16px"}})));function Ln(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 Mn=[],Un=e=>{let{config:t,className:n}=e;const{caption:i,max:c}=t,u=Dn(),{values:m,page:d,setPage:f,isLoading:b,searchQuery:h,setSearchQuery:y,visibleColumns:E,onFilter:v,onSort:x,onToggleFilters:w,onChangeColumns:S,filters:C,sorting:P,totalVisibleValues:N,hasPaging:Z,attributeType:k,showTable:R}=(0,r.useContext)(Xt),I=(0,r.useMemo)((()=>gn(k)),[k]),{checkHasChanges:j,onChangeAttribute:A,onDeleteAttribute:F,onAdd:H,onCancel:V,onApply:z,onStartEditing:W,modifiedValues:B,editingValues:G,deletedUris:q}=(()=>{const[e,t]=(0,r.useState)(),[n,a]=(0,r.useState)([]),i=(0,o.useSelector)(g.ZP.selectors.getMode);(0,r.useEffect)((()=>{a([]),t(null)}),[i]);const c=(0,o.useDispatch)(),u=(0,r.useContext)(te.m),{attributeType:p,values:m}=(0,r.useContext)(Xt),d=(0,o.useSelector)(g.ZP.selectors.getEntityUri),f=(0,o.useSelector)(g.ZP.selectors.getMetadata),b=(0,r.useCallback)((e=>{(0,l.pipe)(g.N5.actions.modifyAttribute,c)(Ln({},e,{viewId:u}))}),[u,c]),h=(0,r.useCallback)((e=>(0,l.pipe)(g.N5.actions.removeAttribute,c)(Ln({},e,{viewId:u}))),[u,c]),y=(0,r.useCallback)((()=>{const e=(0,s.gjI)({parentUri:d,attributeType:p});t(e.uri),b(Ln({},e,{value:(0,s.GPx)({attributeTypes:p.attributes,parentUri:e.uri,mode:i,metadata:f}),attributeType:p}))}),[d,p]),E=(0,r.useCallback)((e=>{a((t=>t.find((0,l.propEq)("uri",e.uri))?t:[...t,e]))}),[a]),v=(0,r.useCallback)((e=>{const r=n.find((0,l.propEq)("uri",e.uri));if(r){const t=Ln({},e,{value:r,attributeType:p,uri:e.uri});a((e=>(0,l.without)([r],e))),b(t)}else{const n={value:e,attributeType:p,uri:e.uri};t(null),h(n)}}),[h,b,a,n]),x=(0,r.useCallback)((e=>{t(null),a((t=>{const n=t.find((0,l.propEq)("uri",e.uri));return n?(0,l.without)([n],t):t}))}),[a,t]),w=(0,o.useSelector)((e=>g.ZP.selectors.getModifiedEntity(e,d)||{})),S=(0,s.KIu)(i),C=(0,s.xy8)(p),P=(0,l.pathOr)(Mn,[C,null==p?void 0:p.name],w),O=(0,r.useMemo)((()=>[...P.filter((0,l.pipe)((0,l.prop)("uri"),(0,l.both)(s.ZiX,(0,l.pipe)((0,l.equals)(e),l.not)))),...(0,l.map)((e=>P.find((0,l.propEq)("uri",e.uri))||e))(m)].map((e=>{var t;return null!==(t=n.find((0,l.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[P,n,e,m]),N=(0,r.useMemo)((()=>S?(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.filter)((e=>!P.find((0,l.propEq)("uri",e)))))(m):[]),[P,m]),Z=P.filter((t=>{let{uri:r}=t;return r===e||n.find((0,l.propEq)("uri",r))}));return{checkHasChanges:e=>n.find((0,l.propEq)("uri",e.uri))!==e,onChangeAttribute:b,onDeleteAttribute:h,onAdd:y,onCancel:v,onApply:x,onStartEditing:E,modifiedValues:O,editingValues:Z,deletedUris:N}})(),$=(0,o.useSelector)(g.ZP.selectors.getMode),Q=(0,s.KIu)($),X=Q?B:m,{canCreate:Y}=(0,vn.l)(),K=Y(t)&&k&&(0,s.Vg3)({attributeType:k,mode:$})&&!G.length,ee=(0,r.useMemo)((()=>E.map((e=>I.find((0,l.propEq)("id",e))))),[E,I]);return a().createElement(D.Z,{className:T()(u.root,n)},R?a().createElement(a().Fragment,null,a().createElement(Cn,{title:i,total:N,columnsData:I,selectedColumns:E,onChangeColumns:S,searchQuery:h,onChangeSearchQuery:y,filtersEnabled:!!C,onToggleFilters:w}),a().createElement("div",{style:{position:"relative"}},Q&&a().createElement("div",{className:u.editor},K&&a().createElement(_.Z,{color:"primary",onClick:H,className:u.addButton},a().createElement(J.Z,{classes:{root:u.icon}}),a().createElement("div",{className:u.buttonLabel},p().text("Add"))),G.map((e=>a().createElement(jn,{key:e.uri,attributeValue:e,onChangeAttribute:A,onDeleteAttribute:F,onCancel:V,onApply:z,hasChanges:j(e)})))),a().createElement(Tn,{columnsData:ee,config:t,values:X,filters:C,onFilter:v,sorting:P,onSort:x,onEdit:W,onDeleteAttribute:F,deletedUris:q}),Z&&a().createElement(L.Z,{count:N,rowsPerPageOptions:[],rowsPerPage:c,page:d,onChangePage:f}),b&&a().createElement(O.Z,null))):a().createElement(a().Fragment,null,a().createElement(U.Z,{title:i,className:u.header}),a().createElement(M.Z,{className:u.noData},p().text("No data"))))};var Fn=n(37163);let Hn=0;const Vn=()=>Hn++,zn=e=>{const t={children:[],nodeId:Vn()};if(e.parentPaths)for(let n=0;n<e.parentPaths.length;n++){const r=e.parentPaths[n];let a=t;for(let t=r.length-1;t>=0;t--){const o=r[t],l=e.entities[o.entityUri],i=t===r.length-1,s={entity:l,children:[],nodeId:Vn(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),a.children.push(s),a=s}}return t.children};var Wn=n(43434);const _n=(0,$.Z)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.secondary.main,lineHeight:"15px"},link:{cursor:"pointer",color:e.palette.secondary.main,lineHeight:"15px"},selected:{fontWeight:"bold"},wrapper:{width:"100%"},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"}})));var Bn=n(1242);const Gn=a().createContext(null);var qn=n(48685);const $n=e=>{e.target.src=Bn},Qn=e=>{let{node:t}=e;const n=_n(),l=(0,o.useDispatch)(),i=t.entity.uri,c=(0,o.useSelector)(g.ZP.selectors.getAbsoluteImagePath),u=(0,o.useSelector)(g.ZP.selectors.getMetadata),p=(0,r.useContext)(Gn),m=(0,o.useSelector)(g.ZP.selectors.getUIPath),{uri:d}=(0,o.useSelector)(g.ZP.selectors.getEntity),f=(0,s.ChB)({uiPath:m,uri:i}),b=i===d,h=(0,r.useCallback)((()=>{l(g.ui.actions.openEntity({uri:i,viewId:p.id}))}),[l,p,i]),{entity:{label:y},nodeId:E}=t,v=(0,s.nt9)(u,t.entity.type)||{},x=(0,s.VD3)(u,v,"typeGraphIcon"),w=x&&(0,s.vPL)(c,x);return a().createElement("div",{className:n.wrapper,"data-node-id":E},a().createElement("div",{className:n.container},a().createElement(Wn.Z,{className:T()(n.avatar),src:w||Bn,onError:$n}),a().createElement("span",{className:T()(n.link,{[n.selected]:b})},a().createElement(qn.Z,{to:f,onClick:h},y))))},Xn=((0,r.memo)(Qn),e=>{let{node:t}=e;return t.nodeId}),Yn=(0,$.Z)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block"},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"50%",top:0,height:"50%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:"14px",left:"50%",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},row:{display:"flex"},rowContents:{position:"relative",borderLeft:"none",paddingLeft:"4px",flex:"1 1 auto",width:0,display:"flex",verticalAlign:"middle",boxSizing:"border-box"},buttonWrapper:{display:"flex",paddingTop:"13px",width:"12px",cursor:"pointer"},collapsedButton:{transform:"rotate(-90deg)"},expandedButton:{transform:"rotate(0deg)"},button:{transition:"transform .15s ease",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid rgba(0, 0, 0, 0.54)"},rowTitle:{flex:"1 1 auto",width:0,paddingRight:"11px"}})));function Kn(){return Kn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kn.apply(this,arguments)}function Jn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function er(){return er=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},er.apply(this,arguments)}const tr={nodeContentRenderer:e=>{const t=(0,l.omit)(["connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","draggedNode","isSearchMatch","isSearchFocus","buttons","didDrop","children","treeId","isOver","parentNode","rowDirection"],e),{scaffoldBlockPxWidth:n,toggleChildrenVisibility:r,node:o,title:i,path:s,treeIndex:c,style:u}=t,p=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["scaffoldBlockPxWidth","toggleChildrenVisibility","node","title","path","treeIndex","style"]),m=i,d=r&&!o.root&&o.children&&o.children.length>0,g=Yn();return a().createElement("div",er({style:{height:"100%"}},p,{key:o.nodeId}),d&&o.expanded&&a().createElement("div",{style:{width:n-2},className:g.lineChildren}),a().createElement("div",{className:g.row,style:u},a().createElement("div",{className:g.rowContents},d&&a().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:o,path:s,treeIndex:c})}},a().createElement("div",{"aria-label":o.expanded?"Collapse":"Expand",className:T()(g.button,o.expanded?g.expandedButton:g.collapsedButton)})),a().createElement("div",{className:g.rowTitle},"function"==typeof m?m({node:o,path:s,treeIndex:c}):m))))},treeNodeRenderer:e=>{const t=(0,l.omit)(["listIndex","swapFrom","swapLength","swapDepth","draggedNode","getPrevRow","connectDropTarget","isOver","canDrop","treeIndex","treeId","path","rowDirection"],e),{children:n,scaffoldBlockPxWidth:r,lowerSiblingCounts:o,node:i}=t,s=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,["children","scaffoldBlockPxWidth","lowerSiblingCounts","node"]),c=Yn(),u=o.length,p=[];o.forEach(((e,t)=>{p.push(a().createElement("div",{key:`pre_${1+t}`,style:{width:r},className:c.lineBlock},i.root&&a().createElement("div",{className:c.rootIndex},i.rootIndex,"."),t===u-1&&0!==t&&a().createElement(a().Fragment,null,a().createElement("div",{className:c.verticalLine}),a().createElement("div",{className:c.horizontalLineRight}))))}));const m=i.root?r-4:0,d=r*u-m,g={left:d,width:`calc(100% - ${d}px`},f=`${d+250}px`,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Jn(e,t,n[t])}))}return e}({},s.style,{width:f});return a().createElement("div",Kn({},s,{className:c.node,style:b}),p,a().createElement("div",{className:c.nodeContent,style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function nr(){return nr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nr.apply(this,arguments)}const rr=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",nr({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",fillOpacity:".54"},a().createElement("path",{d:"M14.5 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm4 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm-17 1a1.5 1.5 0 110-3 1.5 1.5 0 010 3zM4 4a2 2 0 110-4 2 2 0 010 4zm1 16a2 2 0 110-4 2 2 0 010 4zm4.5-6a4.5 4.5 0 110-9 4.5 4.5 0 010 9zm0-2a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm6 5a1.5 1.5 0 110-3 1.5 1.5 0 010 3z",fill:"#000"})))},ar=e=>{let{title:t,onGraphOpen:n}=e;const r=_n();return a().createElement(U.Z,{title:t,className:r.header},a().createElement("div",{className:r.buttonsContainer},a().createElement(Ne.k,{className:r.button,tooltipTitle:p().text("Show Graph"),icon:rr,onClick:n,size:"L"})))};var or=n(80233);const lr=(0,$.Z)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));let ir,sr;function cr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ur(e,t,n[t])}))}return e}function ur(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.WORKFLOW="workflow",e.WORKFLOW_START_PROCESS_FROM_QUERY="workflow/startProcessFromQuery",e.API="api",e.GET_ENTITY_URI="getEntityUri",e.GET_ENTITY="getEntity",e.GET_API_PATH="getApiPath",e.WORKFLOW_GET_WORKFLOW_PATH="workflow/getWorkflowPath",e.GET_SEARCH_QUERY="getSearchQuery",e.GET_TENANT="getTenant",e.GET_USER="getUser",e.GET_PERSPECTIVE="getPerspective",e.SET_PERSPECTIVE="setPerspective",e.SET_ENTITY_URI="setEntityUri",e.ALERT="alert",e.CONFIRM="confirm",e.PROMPT="prompt",e.OPEN_WINDOW="openWindow",e.GET_CONFIGURATION="getConfiguration",e.GET_UI_CONFIGURATION="getUiConfiguration",e.OPEN_SEARCH="openSearch",e.WORKFLOW_CHECK_PERMISSION="workflow/checkPermission"}(ir||(ir={})),function(e){e.SET_HTML="setHtml",e.LOG="log",e.SET_VISIBILITY="setVisibility",e.MESSAGE="message",e.SET_ENABLED="setEnabled",e.SET_TOOLTIP="setToolTip",e.SET_LABEL="setLabel",e.SET_HEIGHT="setHeight",e.SET_WIDTH="setWidth",e.RETURN_PROCESSED_API_RESPONSE="returnProcessedApiResponse",e.RETURN_PROCESSED_API_REQUEST="returnProcessedApiRequest",e.REQUEST="request"}(sr||(sr={}));const pr=(e,t)=>{const{url:n}=e;return n?(!(null==t?void 0:t.some((e=>{const t=e.match(/^(?:([^:?#]+):)?(?:\/\/((?:(([^:@?]*)(?::([^:@?]*))?)?@)?((?:\[[0-9A-Fa-f:]+)|(?:[^:?#]*))(?::(\d*))?))?((((?:[^?#]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/),r=t[1],a=t[6],o=`${r}://${a}`,l=new RegExp("^"+e+"$"),i=e.replace(/\/*$/,"");return i===n||a&&a===i||a&&o===i||i&&0===i.indexOf("/")&&n&&0===n.indexOf(i)||i&&l.test(n)})))||0===((null==t?void 0:t.length)||0))&&{errorMessage:"Not enough permissions"}:{errorMessage:"URL is empty"}};var mr=n(36571);function dr(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){gr(e,t,n[t])}))}return e}function gr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fr=(e,t)=>{let{files:n,permissions:a}=e;const[l,i]=(0,r.useState)(),[u,p]=(0,r.useState)([]),[m,d]=(0,r.useState)(!0),[f,b]=(0,r.useState)(null),[h,y]=(0,r.useState)(null),[E,v]=(0,r.useState)(""),x=(0,o.useDispatch)(),w=(0,o.useSelector)(g.ZP.selectors.getMetadata),S=(0,o.useSelector)(g.ZP.selectors.getEntity)||{},C=`${(0,o.useSelector)(g.ZP.selectors.getUIPath)}worker_api.js`,P=(0,o.useSelector)(g.ZP.selectors.getTenant),O=(0,o.useSelector)(g.ZP.selectors.getApiPath),N=(0,o.useSelector)(g.ZP.selectors.getWorkflowPath),Z=(0,o.useSelector)(g.ZP.selectors.getUser),k=(0,o.useSelector)(g.ZP.selectors.getEntityUri),T=(0,o.useSelector)(g.ZP.selectors.getWorkflowEnvironmentUrl),R=(0,r.useContext)(c),I=(0,mr.Z)(),{type:j,data:D}=(0,o.useSelector)(g.ZP.selectors.getSearchProviderData)||{},L=e=>x(g.ui.actions.openSearch(e)),A=(e,n,r)=>{if(e){const o=[],l=e=>{const t=e.getAttribute("ui-actions"),r=e.getAttribute("ui-tooltip"),a=e.getAttribute("id")||e.getAttribute("name");t&&(t.split(",").forEach((t=>{const r=()=>{const e={action:"event",type:"uiAction",data:{type:t,id:a}};n.postMessage(e)};e.addEventListener(t,r),o.push((()=>{e.removeEventListener(t,r)}))})),e.removeAttribute("ui-actions")),r&&b(r),e.childNodes.forEach((e=>{1===e.nodeType&&l(e)}))},c=e=>{const t=document.createElement("div");t.innerHTML=e||r,l(t),p(o),i(t)};switch(e.action===sr.SET_HTML&&r!==e.params.html&&c(e.params.html),e.action){case sr.LOG:console.log(e.params);break;case sr.SET_VISIBILITY:"visible"===e.params?(d(!0),c()):d(!1);break;case sr.SET_TOOLTIP:b(e.params),c();break;case sr.SET_HEIGHT:y((t=>dr({},t||{},{height:e.params})));break;case sr.SET_WIDTH:y((t=>dr({},t||{},{width:e.params})));break;case sr.SET_ENABLED:y((t=>{const n=dr({},t||{});return e.params?delete n["pointer-events"]:n["pointer-events"]="none",n}));break;case sr.MESSAGE:v(e.params);break;case sr.REQUEST:(e=>{let{name:t,paramObject:n,permissions:r,worker:a,metadata:o,config:l,apiPath:i,user:c,workflowPath:u,entity:p,tenant:m,entityUri:d,query:g,openSearch:f,environment:b,getCurrentPerspectiveId:h,showPerspective:y,workflowCheckPermission:E,setEntityUri:v}=e;const x=e=>{e.then((e=>{a.postMessage(cr({action:"response",result:{data:e}},n.params))})).catch((()=>{a.postMessage(cr({action:"response",result:{data:{},headers:"",status:0}},n.params))}))};switch(t){case ir.API:{const e=((e,t)=>{const n=pr(e,t);return n?new Promise((e=>e(n))):(0,s.SL_)({url:e.url,method:e.method,data:e.data,headers:e.headers})})(n.params,r);x(e);break}case ir.WORKFLOW:{const e=((e,t,n,r)=>{const{url:a}=e,o=pr(e,t);if(o)return new Promise((e=>e(o)));const l=a.includes("http:")||a.includes("https:");return n||l?(0,s.oUH)({url:a,method:e.method||"GET",data:e.data,tenant:r,headers:e.headers,workflowPath:n}):new Promise((e=>e({errorMessage:"Workflow path is not defined"})))})(n.params,r,u,m);x(e);break}case ir.WORKFLOW_START_PROCESS_FROM_QUERY:{const e=((e,t,n,r,a)=>{if(!e.processDefinitionId)return new Promise((e=>e({errorMessage:"processDefinitionId is empty"})));if(!e.searchString)return new Promise((e=>e({errorMessage:"searchString is empty"})));if(!n)return new Promise((e=>e({errorMessage:"Workflow path is not defined"})));const o=pr(cr({url:"/processInstances/_generateFromQuery"},e),t);return o?new Promise((e=>e(o))):(0,s.FuV)({workflowPath:n,processType:e.processDefinitionId,searchString:e.searchString,tenant:r,environment:a})})(n.params,r,u,m,b);x(e);break}case ir.GET_CONFIGURATION:a.postMessage(cr({action:"response",result:o},n.params));break;case ir.GET_UI_CONFIGURATION:{const e=cr({},l,{action:cr({},l.action)});e.action.permissions&&delete e.action.permissions,a.postMessage(cr({action:"response",result:e},n.params));break}case ir.SET_ENTITY_URI:v(d,(()=>a.postMessage(cr({action:"response",result:p},n.params))));break;case ir.SET_PERSPECTIVE:y(n.params.perspective),a.postMessage(cr({action:"response",result:h()},n.params));break;case ir.GET_PERSPECTIVE:h&&a.postMessage(cr({action:"response",result:h()},n.params));break;case ir.WORKFLOW_CHECK_PERMISSION:a.postMessage(cr({action:"response",result:E(n.params.permission)},n.params));break;case ir.GET_SEARCH_QUERY:a.postMessage(cr({action:"response",result:g},n.params));break;case ir.OPEN_SEARCH:f({viewId:l.id,searchState:n.params.searchState});break;case ir.GET_ENTITY_URI:a.postMessage(cr({action:"response",result:d},n.params));break;case ir.GET_ENTITY:a.postMessage(cr({action:"response",result:p},n.params));break;case ir.GET_API_PATH:a.postMessage(cr({action:"response",result:i},n.params));break;case ir.WORKFLOW_GET_WORKFLOW_PATH:a.postMessage(cr({action:"response",result:u},n.params));break;case ir.GET_TENANT:a.postMessage(cr({action:"response",result:m},n.params));break;case ir.GET_USER:a.postMessage(cr({action:"response",result:c},n.params));break;case ir.ALERT:window.alert(n.params.text);break;case ir.CONFIRM:window.confirm(n.params.text);break;case ir.PROMPT:window.prompt(n.params.text,n.params.defaultText||"");break;case ir.OPEN_WINDOW:window.open(n.params.url,"_blank")}})(dr({name:e.params.name,paramObject:e,permissions:a,worker:n,metadata:w,config:t,user:Z,apiPath:O,tenant:P,workflowPath:N,entity:S,entityUri:k,environment:T,query:"search"===j?null==D?void 0:D.query:null,openSearch:L,workflowCheckPermission:I},R))}}};return(0,r.useEffect)((()=>{const e=((e,t,n)=>{const r=`\n importScripts("${e}");\n importScripts("${t.join('","')}");\n postMessage({action:'loaded'});`;let a;try{const e=window.webkitURL||window.URL;a=new Worker(e.createObjectURL(new Blob([r],{type:"application/javascript"})))}catch(e){a=new Worker("data:application/javascript,"+encodeURIComponent(r))}if(a){let e="";a.addEventListener("message",(t=>{if("loaded"!==t.data.action){const r=JSON.parse(t.data);n(r,a,e),"setHtml"===r.action&&(e=r.params.html)}}))}return a})(C,n,A);return()=>{e.terminate()}}),[]),(0,r.useEffect)((()=>()=>{u.forEach((e=>e()))}),[u]),{html:l,visible:m,tooltip:f,customStyles:h,message:E,onClosePopup:()=>v("")}};function br(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){hr(e,t,n[t])}))}return e}function hr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yr=n(14940);const Er=(0,$.Z)({resizableHandleContainer:{position:"relative",width:"100%"},resizableHandleVisibilityArea:{position:"absolute",top:0,left:0,width:"100%",height:"24px",zIndex:11,"&:hover $resizableHandle":{visibility:"visible"},".react-grid-item.static &:hover $resizableHandle":{visibility:"hidden"}},resizableHandle:{position:"absolute",width:"100%",display:"flex",justifyContent:"center",top:"-3px",zIndex:11,cursor:"move",visibility:"hidden"},dragIcon:{transform:"translateX(-50%) rotate(90deg)",color:"rgba(0, 0, 0, 0.3)"}}),vr=e=>{const t=t=>{const n=Er();return a().createElement("div",{className:n.resizableHandleContainer},a().createElement("div",{className:n.resizableHandleVisibilityArea},a().createElement("div",{className:T()("viewDraggableHandle",n.resizableHandle)},a().createElement(yr.Z,{className:n.dragIcon}))),a().createElement(e,t))};return t.displayName="WithResizableHandle",t},xr=(0,$.Z)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var wr=n(29103),Sr=n(83911),Cr=n(62116),Pr=n(40435);const Or=(0,l.pipe)((0,l.path)(["point","lat"]),(0,l.both)((0,l.gt)(90),(0,l.lt)(-90))),Nr=(0,$.Z)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var Zr=n(61347),kr=n(66078);const Tr=(0,$.Z)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),Rr=Tr,Ir=e=>{let{totalImages:t}=e;const n=Rr(),r=t>1?p().text("photos"):p().text("photo");return a().createElement(M.Z,{variant:"caption",className:n.caption},`${t} ${r}`)};function jr(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){Dr(e,t,n[t])}))}return e}function Dr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Lr=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:i}=e;const s=(0,o.useDispatch)(),c=(0,o.useSelector)(g.ZP.selectors.getEntity),u=(0,o.useSelector)((e=>g.ZP.selectors.getModifiedEntity(e,c.uri)||{})),p=(0,l.pathOr)([],["attributes",n.name],u),m=t.id;return a().createElement(a().Fragment,null,a().createElement(kr.Z,{attributeValues:p,attributeType:n,onDeleteAttribute:e=>(0,l.pipe)(g.N5.actions.removeAttribute,s)(jr({},e,{viewId:m})),parentUri:u.uri,onChangeAttribute:e=>(0,l.pipe)(g.N5.actions.modifyAttribute,s)(jr({},e,{viewId:m})),imageSize:Ur,paging:r,requestNextPageOfAttributeValues:i}),a().createElement(Ir,{totalImages:p.length}))},Ar=(0,$.Z)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),Mr=Ar,Ur={imageMargin:4,imageWidth:162,imageHeight:162};var Fr=n(86689),Hr=n(23044);const Vr=(0,$.Z)((e=>({root:{display:"flex",flexDirection:"column"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}})));var zr=n(20200),Wr=n(25601),_r=n(84236),Br=n(48376);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)}const qr=e=>{let{config:t,match:n,onStartRequest:l,onFinishRequest:i}=e;const c=(0,o.useDispatch)(),u=(0,o.useSelector)(g.ZP.selectors.getMetadata),p=(0,o.useSelector)(g.ZP.selectors.getEntity),{canMerge:m,canMark:d}=(0,s.hXd)(u,t,n.object,p,n.matchRules),f=(0,r.useMemo)((()=>[n.object]),[n.object]),b={entity:p,entities:f,mode:Wr.N.iconButton,onStartRequest:l},h=(0,r.useContext)(te.m),y=(0,r.useCallback)((()=>{i(),c(g.N5.entity.actions.loadEntity({viewId:h,uri:p.uri}))}),[c,p.uri,i,h]);return a().createElement(a().Fragment,null,m&&a().createElement(_r.H,Gr({},b,{onFinishRequest:y})),d&&a().createElement(Br.i,Gr({},b,{onFinishRequest:i})))},$r=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:l,onStartRequest:i}=e;const c=(0,o.useSelector)(g.ZP.selectors.getMetadata),u=(0,o.useSelector)(g.ZP.selectors.getEntity);return a().createElement(zr.M,{match:r,entity:u,entitiesMap:n,metadata:c,className:Et.U},a().createElement(vt.Z,{uri:(0,s.E_P)(u.uri,r.object.uri),relatedObjectUris:(0,s.wp9)(s.q7e.POTENTIAL_MATCH,{entityUri:u.uri,matchEntityUri:r.object.uri}),objectType:s.q7e.POTENTIAL_MATCH}),a().createElement(qr,{match:r,config:t,onStartRequest:i,onFinishRequest:l}))},Qr={showTransitiveMatches:!0,showInactiveEntities:!1},Xr={order:"asc",field:"score"};var Yr;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Yr||(Yr={}));const Kr=vr((e=>{let{className:t}=e;const n=xr();return a().createElement(D.Z,{className:T()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),Jr=vr((e=>{let{className:t,config:n}=e;return a().createElement(R.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),ea=vr((e=>{let{className:t,config:n}=e;const o=(e=>{const[t,n]=(0,r.useState)(""),[a,o]=(0,r.useState)(0),[l,i]=(0,r.useState)(!1),s=(0,r.useMemo)((()=>({page:a,searchQuery:t,showInactive:l})),[a,t,l]),c=we(e,s,!0),u=(0,r.useCallback)((()=>{o(0),i((e=>!e))}),[]);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Se(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:o,page:a,toggleShowInactive:u,showInactive:l},c)})(n);return a().createElement(I.Provider,{value:o},a().createElement(ye,{config:n,className:t}))})),ta=vr((e=>{let{config:t,className:n}=e;const i=(e=>{var t;const{attributeUri:n}=e,a=(0,o.useSelector)(g.ZP.selectors.getMetadata),i=(0,r.useMemo)((()=>(0,s.zeJ)(a,n)),[a,n]),c=(0,r.useMemo)((()=>gn(i)),[i]),u=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:c.filter((0,l.pipe)((0,l.prop)("dataTypeDefinition"),s.YkM,l.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[c]),[p,m]=(0,r.useReducer)(an,u),{searchQuery:d,filters:f,sorting:b,page:h}=p,y=(0,r.useMemo)((()=>{const e=((e,t)=>s.wSh.fromNull(t).map((t=>Object.entries(t).map((t=>{let[n,r]=t;const a=e.find((0,l.propEq)("id",n));return(0,yn.su)(a,r)})))).orSome([]))(c,f);return e.length?e:null}),[f,c]),E=(0,r.useMemo)((()=>(0,l.reject)(l.isNil,{filters:y,page:h,sorting:b,searchQuery:d})),[y,h,b,d]),{changeSearchQuery:v,changePage:x,toggleSort:w,changeFilter:S,toggleFilters:C,changeColumns:P}=(0,Yt.o)({actions:rn,dispatch:m}),O=we(e,E,!1);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){En(e,t,n[t])}))}return e}({},p,{setSearchQuery:v,setPage:x,onSort:w,onFilter:S,onToggleFilters:C,onChangeColumns:P,showTable:Boolean(((null==O||null===(t=O.values)||void 0===t?void 0:t.length)||y||d)&&i&&!i.hidden)},O)})(t);return a().createElement(Xt.Provider,{value:i},t&&a().createElement(Un,{config:t,className:n}))})),na=vr((e=>{let{config:t,className:n}=e;const o=(e=>{var t;const n=(0,r.useMemo)((()=>Object.entries(e.sortOptions||{}).map((e=>{let[t,n]=e;return{value:t,label:n}}))),[e.sortOptions]),a=e.max||15,[o,l]=(0,r.useState)(0),[i,s]=(0,r.useState)(e.sortOrder||"asc"),[c,u]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[p,m]=(0,r.useState)(""),[d,g]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{l(0),g((e=>!e))}),[]),b=(0,r.useCallback)((()=>{l(0),s((e=>"asc"===e?"desc":"asc"))}),[]),h=(0,r.useCallback)((e=>{l(0),u(e)}),[]);return{searchQuery:p,changeSearchQuery:(0,r.useCallback)((e=>{l(0),m(e)}),[]),sortOrder:i,toggleSortOrder:b,sortOption:c,changeSortOption:h,sortOptions:n,page:o,setPage:l,rowsPerPage:a,showInactive:d,toggleShowInactive:f}})(t);return a().createElement(Te.Provider,{value:o},a().createElement(Qt,{config:t,className:n}))})),ra=vr((e=>{let{config:t,className:n}=e;const o=(0,r.useRef)(),[i,s]=(0,r.useState)(null),{height:c,width:u,tooltip:p}=t,{html:m,visible:d,tooltip:g,customStyles:f,onClosePopup:b,message:h}=fr(t.action,t),y=lr(),E=g||p;if((0,r.useEffect)((()=>{o.current&&m&&(o.current.innerHTML="",m.childNodes.forEach((e=>{o.current.appendChild(e)})),s(o.current))}),[m]),!d)return null;const v=(0,l.reject)(l.isNil,{width:u,height:c}),x=a().createElement("div",{ref:o,style:br({},v,f),className:T()(y.root,n)});return a().createElement("div",{className:y.bodyWrapper},E?a().createElement(Je.ZP,{title:E},x):x,a().createElement(or.Z,{placement:"bottom",anchorEl:i,open:!!h,onClose:b},h))})),aa=vr((e=>{let{config:t,className:n}=e;const l=(0,o.useSelector)(g.ZP.selectors.getEntityUri),{treeData:i,setTreeData:c}=((e,t)=>{const n=(0,Ee._)(),[a,o]=(0,r.useState)([]);return(0,r.useEffect)((()=>((0,s.ZiX)(e)||n((0,s.RFJ)({uri:e,graphUri:t})).then(zn).then(o).catch((e=>{console.warn(e)})),()=>{o([])})),[e,t,n]),{treeData:a,setTreeData:o}})(l,t.graph.type),u=_n(),p=(0,o.useDispatch)(),{id:m,graph:d}=t,f=(0,r.useCallback)((()=>{p(g.ui.actions.openGraph({viewId:m,graphType:d.type}))}),[p,m,d]),b=(0,r.useCallback)((e=>({title:a().createElement(Qn,{node:e.node})})),[]);return a().createElement(D.Z,{className:n},a().createElement(ar,{onGraphOpen:f,title:t.caption}),a().createElement(Gn.Provider,{value:t},a().createElement("div",{className:u.treeContainer},a().createElement("div",{className:u.tree},a().createElement(Fn.ZP,{isVirtualized:!1,treeData:i,canDrag:!1,theme:tr,generateNodeProps:b,onChange:c,getNodeKey:Xn})))))})),oa=vr((e=>{let{config:t,className:n}=e;const i=Vr(),c=(0,o.useSelector)(g.ZP.selectors.getEntity),u=null==c?void 0:c.uri,[m,d]=(0,r.useState)(!1),f=(0,r.useCallback)((()=>{d(!0)}),[]),b=(0,r.useCallback)((()=>{d(!1)}),[]),{matches:y,entitiesMap:E,loadMatches:v,total:x}=(0,Hr.s)({enabled:!!u,entity:c,options:Qr,filter:"",page:0,sorting:Xr,rowsPerPage:3,onStartLoading:f,onFinishLoading:b}),w=(0,r.useCallback)((()=>{v()}),[v]),S=(0,o.useDispatch)(),C=(0,r.useContext)(te.m),P=(0,r.useCallback)((()=>{S(g.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:C}))}),[S,C]),N=(0,r.useMemo)((()=>(0,s.NVY)(u,(0,l.map)(s.ev7,y))),[u,y]),{getCommentsCount:Z}=(0,r.useContext)(h.h);(0,r.useEffect)((()=>{Z(N)}),[Z,N]);const k=x>3&&!(0,l.isEmpty)(y),R=m?Yr.Loading:(0,l.isEmpty)(y)?Yr.NoData:Yr.Loaded;return a().createElement(Pe.X.Provider,{value:E},a().createElement(D.Z,{className:T()(i.root,n)},a().createElement(U.Z,{title:t.caption}),a().createElement("div",{className:i.matchesContainer},R===Yr.Loading&&a().createElement(O.Z,null),R===Yr.NoData&&a().createElement(M.Z,{className:i.noData},p().text("No matches found")),R===Yr.Loaded&&y.map((e=>a().createElement($r,{config:t,entitiesMap:E,match:e,onFinishRequest:w,onStartRequest:f,key:e.object.uri})))),k&&a().createElement(a().Fragment,null,a().createElement("div",{className:i.footer},a().createElement(Fr.Z,{component:"button",variant:"caption",onClick:P,underline:"none"},p().text("See all"))))))})),la=(0,r.lazy)((()=>n.e(590).then(n.bind(n,10590)).then((e=>({default:vr(e.HierarchyTreeView)}))))),ia=(0,r.lazy)((()=>n.e(3431).then(n.bind(n,83431)).then((e=>({default:vr(e.RelationshipsTableView)}))))),sa=vr((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:l,className:i}=e;const c=Nr(),u=(0,o.useSelector)(g.ZP.selectors.getMetadata),p=(0,o.useSelector)(g.ZP.selectors.getEntity),m=(0,o.useSelector)(g.ZP.selectors.getGoogleMapKey),{markers:d,loading:f}=((e,t,n)=>{const[a,o]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),c=(0,Ee._)();return(0,r.useEffect)((()=>{i(!0),c((0,s.DBr)(t,[e],n)).then((e=>{o(e.filter(Or))})).catch((()=>{o([])})).finally((()=>{i(!1)}))}),[e,t,n,c]),{markers:a,loading:l}})(p,u,m),b=(0,r.useMemo)((()=>a().createElement("div",{className:c.fullHeight},a().createElement(O.Z,null))),[c]),h=(0,r.useMemo)((()=>({lat:0,lng:0})),[]);return m&&a().createElement(D.Z,{className:T()(c.root,i)},f&&a().createElement(O.Z,null),a().createElement(Pr.Z,{size:"S",icon:n?Sr.Z:wr.Z,onClick:()=>l(t.id),className:c.fullscreenBtn}),a().createElement(Cr.Z,{loadingElement:b,defaultZoom:1,defaultCenter:h,markers:d,mapContainerClassName:c.fullHeight,mapKey:m}))})),ca=vr((e=>{let{config:t,className:n}=e;const{attributeUri:i}=t,c=Mr(),u=(0,o.useDispatch)(),m=(0,o.useSelector)(g.ZP.selectors.getMode),d=(0,o.useSelector)(g.ZP.selectors.getEntityWithDiff),f=(0,o.useSelector)(g.ZP.selectors.getMetadata),b=(0,s.zeJ)(f,i),h=(0,l.pathOr)([],["attributes",null==b?void 0:b.name],d),y=(0,l.path)(["attributes","paging",i],d),E=h.length,v=t["text-empty"]||p().text("No data found"),x=(0,r.useCallback)((e=>u(g.N5.actions.requestNextPageOfAttributeValues(e))),[u]);return a().createElement(D.Z,{className:n},a().createElement(U.Z,{title:t.caption}),a().createElement("div",{className:c.container},(()=>{if(b){if((0,s.KIu)(m)){const e={attributeType:b,config:t,paging:y,requestNextPageOfAttributeValues:x};return a().createElement(Lr,e)}if(E>0){const e={attributeValues:h,attributeType:b,imageSize:Ur,paging:y,parentUri:d.uri,requestNextPageOfAttributeValues:x};return a().createElement(a().Fragment,null,a().createElement(Zr.Z,e),a().createElement(Ir,{totalImages:E}))}}return a().createElement(M.Z,{className:c.noData},v)})()))}));class ua{}ua.ViewTypes=s.ZIY,ua.getComponentBy=(e,t)=>{let{store:n,config:r,className:o,isFullscreen:l,onToggleFullscreen:i}=t;switch(r[e]){case ua.ViewTypes.HierarchyTree:return a().createElement(la,{config:r,store:n,className:o});case ua.ViewTypes.HierarchyPaths:return a().createElement(aa,{config:r,className:o});case ua.ViewTypes.RelationsTable:return a().createElement(ia,{config:r,store:n,className:o});case ua.ViewTypes.Relations:return a().createElement(na,{config:r,className:o});case ua.ViewTypes.Attributes:return a().createElement(Jr,{className:o,config:r});case ua.ViewTypes.SingleAttributeView:return a().createElement(ea,{config:r,className:o});case ua.ViewTypes.TableAttributeView:return a().createElement(ta,{config:r,className:o});case ua.ViewTypes.MapView:return a().createElement(sa,{config:r,isFullscreen:l,onToggleFullscreen:i,className:o});case ua.ViewTypes.CustomView:return a().createElement(ra,{config:r,className:o});case ua.ViewTypes.ImageAttributeView:return a().createElement(ca,{config:r,className:o});case ua.ViewTypes.PotentialMatchesView:return a().createElement(oa,{config:r,className:o})}},ua.getComponent=e=>ua.getComponentBy("class",e)||ua.getComponentBy("react-class",e)||a().createElement(Kr,{className:e.className});const pa=ua,ma=()=>null,da=(0,r.memo)((e=>{let{config:t,store:n,isFullscreen:o,isAutosize:l,onToggleFullscreen:i}=e;const s=xr();return a().createElement(r.Suspense,{fallback:a().createElement(ma,null)},pa.getComponent({config:t,store:n,className:T()(s.component,{[s.fullHeight]:!l}),isFullscreen:o,onToggleFullscreen:i}))}));da.displayName="ViewComponent";const ga=(0,$.Z)((e=>({item:e.basicView})));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)}const ba=["onConfigChanged","onRemove"],ha=e=>{let{layoutItemConfig:t,views:n,className:i,children:s,style:c,isFullscreen:u,onToggleFullscreen:p,AutosizeComponent:m}=e,d=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["layoutItemConfig","views","className","children","style","isFullscreen","onToggleFullscreen","AutosizeComponent"]);const g=n.find((e=>{let{id:n}=e;return t.i===n})),f=ga(),{store:b}=(0,r.useContext)(o.ReactReduxContext);if(!g)return null;const h=g.class===pa.ViewTypes.CustomView;return a().createElement("div",fa({},(0,l.omit)(ba,d),{style:c,className:T()(i,{[f.item]:!h})}),a().createElement("div",null,m,a().createElement(da,{store:b,config:g,isFullscreen:u,onToggleFullscreen:p,isAutosize:Boolean(m)})),s)},ya=e=>{let{views:t,layout:n,layoutOptions:r,onLayoutChanged:o}=e;return a().createElement(Z.Z,{LayoutItem:ha,views:t,layout:n,layoutOptions:r,onLayoutChanged:o,draggableHandle:".viewDraggableHandle"})};var Ea=n(33109),va=n(75647),xa=n(76368),wa=n(36777),Sa=n(72379),Ca=n(72753),Pa=n(43576);function Oa(){return Oa=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},Oa.apply(this,arguments)}const Na=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",Oa({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),a().createElement("defs",null,a().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"})),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},a().createElement("g",{transform:"translate(-4 -2.5)"},a().createElement("mask",{id:"svg1467685497b",fill:"#fff"},a().createElement("use",{xlinkHref:"#svg1467685497a"})),a().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1467685497b)",d:"M0 0h24v24H0z"}))))},Za=(0,$.Z)({editingButtons:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"}}),ka=e=>a().createElement(Sa.Z,e,a().createElement(Na,null)),Ta=(e,t,n,r,a)=>e.filter((e=>{let{value:o,permission:l}=e;return!(n&&!(0,s.KIu)(o))&&!!(r&&a||!(0,s.fnZ)(o))&&(0,s.uGe)(l,t)})),Ra=e=>{let{className:t}=e;const n=Za(),l=(0,o.useDispatch)(),i=(0,o.useSelector)(g.ZP.selectors.getCanUserStartProcessFromQuery),c=(0,o.useSelector)(g.ZP.selectors.getEntityWithoutDiff),u=(0,o.useSelector)((e=>g.ZP.selectors.getModifiedEntity(e,c.uri))),m=(0,o.useSelector)(g.ZP.selectors.getMetadata),d=(0,o.useSelector)(g.ZP.selectors.isWorkflowEnabled),f=(0,o.useSelector)(g.ZP.selectors.getMode),b=(0,o.useSelector)(g.ZP.selectors.getIsEditableMode),h=(0,o.useSelector)(g.ZP.selectors.getIsViewMode),y=(0,o.useSelector)(g.ZP.selectors.getIsHistoryModeEnabled),E=(0,o.useSelector)(g.ZP.selectors.getProfileOperation)===s.OXy.Saving,v=null==c?void 0:c.type,x=(0,r.useMemo)((()=>[{label:p().text("Editing"),value:s.fO_.EDITING,description:p().text("Edit profile directly"),icon:Pa.Z,permission:"UPDATE"},{label:p().text("Suggesting"),value:s.fO_.SUGGESTING,description:p().text("Suggest changes and initiate a workflow review"),icon:ka,permission:"INITIATE_CHANGE_REQUEST"},{label:p().text("Viewing"),value:s.fO_.VIEWING,description:p().text("Suggest changes and initiate a workflow review"),icon:Ca.Z,permission:"READ"}]),[]),w=(0,r.useMemo)((()=>[{label:p().text("Delete"),value:"Delete",description:p().text("Permanently delete profile"),icon:Qe.Z,onClick:()=>{window.confirm(p().text("Are you sure you want to delete this?"))&&l(g.N5.entity.actions.entityRemoveRequested({entityUri:c.uri}))},permission:"DELETE"}]),[l,c.uri]),S=(0,r.useMemo)((()=>(0,s.nt9)(m,v)||{}),[m,v]),C=!y&&!(0,s.biM)(c)&&!(e=>(0,s.uGe)(s.BDP.READ,e)&&!(0,s.uGe)(s.BDP.UPDATE,e)&&!(0,s.uGe)(s.BDP.DELETE,e)&&!(0,s.uGe)(s.BDP.INITIATE_CHANGE_REQUEST,e))(S),P=(0,s.ZiX)(null==c?void 0:c.uri),O=(0,r.useMemo)((()=>Ta(x,S,P,d,i)),[x,S,d,i,P]),N=(0,r.useMemo)((()=>Ta(w,S,P,d,i)),[w,S,d,i,P]),Z=(0,r.useCallback)((e=>{l(g.N5.mode.actions.modeUpdated(e))}),[l]),k=(0,r.useCallback)((()=>{l(g.N5.mode.actions.modeCancelEditing())}),[l]),R=(0,r.useCallback)((()=>{l(g.N5.actions.saveProfile())}),[l]);return a().createElement(Ea.Z,{className:T()(t,Et.U),entity:b&&u?u:c},a().createElement(A.Z,{display:"flex",alignItems:"center"},a().createElement(A.Z,{mr:3},b&&a().createElement(A.Z,{className:n.editingButtons},a().createElement(_.Z,{variant:"outlined",onClick:k,"data-reltio-id":"reltio-profile-cancel-editing",disabled:E},p().text("Cancel")),a().createElement(_.Z,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:R,disabled:E},(0,s.fnZ)(f)?p().text("Suggest"):p().text("Save"))),y&&h?a().createElement(va.Z,null):h&&a().createElement(xa.a,null)),C&&a().createElement(wa.T,{optionsGroup:O,buttonsGroup:N,value:f,onChange:Z,disabled:E})),a().createElement(A.Z,{className:n.comments},a().createElement(vt.Z,{uri:c.uri,relatedObjectUris:(0,s.wp9)(s.q7e.ENTITY,{entityUri:c.uri}),objectType:s.q7e.ENTITY})))};var Ia=n(69409),ja=n(85457),Da=n(37778),La=n(32158),Aa=n(95085),Ma=n(70675),Ua=n(11821),Fa=n(98273),Ha=n(28101),Va=n(80147),za=n(76569);const Wa=(0,$.Z)({wrapper:{display:"flex",overflow:"hidden",marginLeft:"auto",flexShrink:0},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}}),_a=()=>{const{total:e}=(0,r.useContext)(C.O),t=Wa();return a().createElement(We.Z,{badgeContent:e,classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},a().createElement(za.Z,null))};var Ba=n(89925),Ga=n(4426);const qa=(0,$.Z)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),$a=()=>{const e=qa(),{getComments:t,comments:n,pageToken:l}=(0,r.useContext)(h.h),i=(0,o.useSelector)(g.ZP.selectors.getEntityUri);return(0,r.useEffect)((()=>{t(i)}),[t,i]),a().createElement(A.Z,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:o}=e;return a().createElement(Ba.J,{key:o,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),l&&a().createElement(Fr.Z,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(i,l)},underline:"none"},a().createElement(Ga.Z,{className:e.showMoreIcon}),p().text("Show more")))};var Qa=n(37193);const Xa=(0,$.Z)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Ya=()=>{const e=Xa(),{tasks:t,loading:n}=(0,r.useContext)(C.O);return a().createElement("div",{className:e.wrapper},n&&a().createElement(O.Z,null),t&&t.map((e=>a().createElement(Qa.s,{key:e.taskId,task:e}))))};function Ka(){return Ka=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},Ka.apply(this,arguments)}const Ja=e=>{let{styles:t={}}=e,n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["styles"]);return a().createElement("svg",Ka({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),a().createElement("defs",null,a().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"})),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},a().createElement("g",null,a().createElement("g",{transform:"translate(-2 -2)"},a().createElement("mask",{id:"svg2697213709b",fill:"#fff"},a().createElement("use",{xlinkHref:"#svg2697213709a"})),a().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2697213709b)",d:"M0 0h24v24H0z"})))))},eo=()=>{const{commentsMap:e}=(0,r.useContext)(h.h),t=Wa();return a().createElement(We.Z,{badgeContent:(0,s.mdt)(e),classes:{anchorOriginTopRightRectangle:t.badgePosition,badge:t.badge}},a().createElement(Ja,null))};var to=n(15422);const no=()=>a().createElement(to.Z,{text:p().text("Ready to go with the flow?"),secondaryText:p().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")}),ro=()=>a().createElement(to.Z,{text:p().text("Care to join the conversation?"),secondaryText:p().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")});function ao(){return ao=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ao.apply(this,arguments)}let oo;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History"}(oo||(oo={}));const lo=e=>{if(e)return 1===e?p().text("${total} item",{total:e}):p().text("${total} items",{total:e})},io=()=>{var e,t,n;const i=Wa(),c=(0,o.useSelector)(g.ZP.selectors.isWorkflowSideViewEnabled),u=(0,o.useSelector)(g.ZP.selectors.isWorkflowEnabled),m=(0,o.useSelector)(g.ZP.selectors.isCollaborationSideViewEnabled),d=(0,o.useSelector)(g.ZP.selectors.isCollaborationEnabled),f=(0,o.useSelector)(g.ZP.selectors.getHistoryEvent),b=(0,o.useSelector)(g.ZP.selectors.getMetadata),y=(0,o.useSelector)(g.ZP.selectors.getEntity),E=(0,r.useContext)(C.O),v=(0,r.useContext)(h.h),[x,w]=(0,r.useState)(null),S=(0,r.useCallback)((e=>{w((t=>t===e?null:e))}),[]),P=(0,r.useCallback)((()=>{w(null)}),[]),O=null!==x,N=x===oo.History,{isHistoryEnabled:Z,isProfilePersisted:k}=(0,Ia.C)({isHistoryTabActive:N,entity:y}),{historyFilter:T,onApplyFilter:R,onClearFilter:I,isLoading:j,historicUris:D,historyWithTotal:L,canLoadMore:A,onLoadMore:M}=(0,ja.k)({entity:y,enabled:Z}),U=c&&u&&!(0,s.ZiX)(null==y?void 0:y.uri),F=m&&d,H=(0,s.mdt)(null==v?void 0:v.commentsMap),V=[{buttonProps:{id:oo.Workflow,icon:_a,tooltipTitle:p().text("Workflow")},content:null!=E&&E.total?a().createElement(Ya,null):a().createElement(no,null),headerProps:{mainTitle:p().text("Workflow"),secondTitle:lo(null==E?void 0:E.total),rightContent:a().createElement(Da.G,null)},hidden:!U},{buttonProps:{id:oo.Collaboration,icon:eo,tooltipTitle:p().text("Collaboration")},content:H?a().createElement($a,null):a().createElement(ro,null),headerProps:{mainTitle:p().text("Collaboration"),secondTitle:lo(H)},hidden:!F},{buttonProps:{id:oo.History,icon:Va.Z,tooltipTitle:p().text("History")},content:k?a().createElement(La.Z,{isLoading:j,historyWithTotal:L,contributorsUris:D,entityUri:null==y?void 0:y.uri,historyEvent:f,onLoadMore:M,canLoadMore:A}):a().createElement(Aa.Z,null),headerProps:{content:a().createElement(Ma.Z,{total:k?((null==D?void 0:D.length)||0)+1:void 0,entityType:(0,s.nt9)(b,null==y?void 0:y.type),filter:T,onApplyFilter:R,onClearFilter:I})}}],z=(0,l.reject)((0,l.propEq)("hidden",!0))(V);return(0,r.useEffect)((()=>{var e;null!==(e=V[x])&&void 0!==e&&e.hidden&&P()}),[x,V,P,z]),a().createElement("div",{className:i.wrapper},a().createElement(Ua.h,{open:O,width:480},!(null!==(e=V[x])&&void 0!==e&&e.hidden)&&a().createElement(a().Fragment,null,a().createElement(Fa.P,ao({},null===(t=V[x])||void 0===t?void 0:t.headerProps,{onClose:P})),null===(n=V[x])||void 0===n?void 0:n.content)),a().createElement(Ha.G,{buttonsProps:(0,l.pipe)((0,l.reject)((0,l.propEq)("hidden",!0)),(0,l.pluck)("buttonProps"))(V),onButtonClick:S,activeIndexId:x}))};var so=n(39781),co=n(16715);const uo="48px",po="1px solid rgba(0, 0, 0, .125)",mo=(0,$.Z)((e=>({accordion:{borderTop:po,borderBottom:po,boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:uo,minHeight:uo,"&$accordionSummaryExpanded":{height:uo,minHeight:uo}},accordionSummaryHeading:{flex:1,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular},accordionSummaryExpanded:{},accordionSummaryContent:{display:"flex",alignItems:"center"},accordionDetails:{maxHeight:"21vh",overflow:"auto",paddingTop:0,paddingBottom:0,"& ul":{paddingLeft:"23px",marginTop:"3px"},"& li":{paddingLeft:"9px",paddingBottom:"8px"}},parents:{color:e.palette.text.primary},errorsAccordion:{backgroundColor:"#FFF4F6",borderColor:"#FFB8B3"},errorsAccordionDetails:{color:"#DD2C00"},warningsAccordion:{backgroundColor:"#FFF9ED",borderColor:"#FFDD91"},warningsAccordionDetails:{color:"#CC7500"},icon:{marginRight:"8px"},errorIcon:{fill:"#FF1744"},warningIcon:{fill:"#F9A825"}}))),go=mo;var fo=n(27616),bo=n(8284),ho=n(70660),yo=n(38016);const Eo=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:o}=e;const l=go();return t.length>0?a().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return a().createElement(fo.Z,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},a().createElement(bo.Z,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:a().createElement(yo.Z,null)},i,a().createElement(M.Z,{className:l.accordionSummaryHeading},s)),a().createElement(ho.Z,{className:T()(l.accordionDetails,p)},a().createElement("ul",null,c.map(((e,t)=>a().createElement(o,{key:t,error:e}))))))}))):null}));Eo.displayName="ErrorsPanel";const vo=(0,l.omit)(["deactivated","path"]),xo=(0,r.memo)((e=>{let{error:t}=e;const n=go(),r=((e,t)=>{let{type:n,source:r,message:a,attributeTypeUri:o="",attributeType:l}=t;if(n===s.NIO.missed&&r===s.zHr.local){const t=l||(0,s.zeJ)(e,o);return t?p().text("${attribute} is required",{attribute:t.label}):a}return a})((0,o.useSelector)(g.ZP.selectors.getMetadata),t),i=(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[s.HAc.attributeValue,s.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(l.identity).join(" / ")})(t);return a().createElement("li",null,a().createElement("span",null,r),i&&a().createElement(a().Fragment,null,a().createElement("br",null),a().createElement("span",{className:n.parents},i)))}));xo.displayName="Error";const wo=()=>{const e=go(),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,l.equals)(e.map(vo),t.map(vo))}(e,t.current)||(t.current=e),t.current})((0,o.useSelector)(g.ZP.selectors.getProfileErrors)),[n,i]=(0,r.useMemo)((()=>(0,l.partition)(s.IT0,t)),[t]),[c,u]=(0,r.useState)(null),m=(0,r.useMemo)((()=>[{id:"errors",title:p().text("${number} ${errors}",{number:n.length,errors:1===n.length?p().text("error"):p().text("errors")}),icon:a().createElement(so.Z,{className:T()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:p().text("${number} ${warnings}",{number:i.length,warnings:1===i.length?p().text("warning"):p().text("warnings")}),icon:a().createElement(co.Z,{className:T()(e.icon,e.warningIcon)}),items:i,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,i,e]);(0,r.useEffect)((()=>{u("errors")}),[n]);const d=(0,r.useCallback)((e=>(t,n)=>{u(n?e:null)}),[]);return m.length>0?a().createElement(Eo,{panels:m,expandedPanelId:c,onToggle:d,ErrorComponent:xo}):null},So=(0,$.Z)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},scrollWrapper:{flexGrow:1,overflowY:"auto"},emptyState:{backgroundColor:"#FAFAFA",height:"100%"},profileWrapper:e=>{let{maxWidth:t}=e;return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,maxWidth:t?`${t}px`:"100%"}},profileContainer:{display:"flex",overflow:"hidden",flexGrow:1},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}})));(0,r.memo)((e=>{let{config:t,saveState:n,getSavedState:l}=e;const i=So({maxWidth:null==t?void 0:t.maxWidth}),c=(0,o.useDispatch)(),u=(0,r.useRef)(),m=(0,r.useCallback)((0,s.DsO)(n,5e3),[n]),{isLoaded:Z,savedState:k}=(0,f.a)(l),[T,R]=(0,r.useState)([]),[I,j]=(0,r.useState)([]),D=(0,r.useMemo)((()=>d()(t)),[t]),L=(0,o.useSelector)(g.ZP.selectors.getEntity),A=(0,o.useSelector)(g.ZP.selectors.getIsHistoryModeEnabled),M=(0,r.useMemo)((()=>(0,s.dvH)(L)),[L]),U=(0,b.C)({objectIds:M}),F=(0,r.useContext)(h.h),H=(0,y.U)(),V=(0,E.v)(null==t?void 0:t.workflow),z=(0,o.useSelector)(g.ZP.selectors.getHistoryEvent);(0,v.a)({entity:L,historyEvent:z});const W=(0,x.u)();(0,r.useEffect)((()=>{if(Z){const e=D!==k.configHash,{views:n,layout:r}=(0,s.Mfk)({views:e||!k.views?t.views:k.views,layout:e?t.layout:k.layout});j(n),R(r)}}),[Z]),(0,r.useEffect)((()=>{c(g.N5.views.actions.profileViewsSet(I))}),[c,I]),(0,r.useEffect)((()=>{u.current&&(u.current.scrollTop=0)}),[null==L?void 0:L.uri]),(()=>{const e=(0,o.useDispatch)(),t=(0,o.useSelector)(g.ZP.selectors.getValidateReadMode),n=(0,o.useSelector)(g.ZP.selectors.getEntity)||{},{uri:a,updatedTime:l}=n,i=(0,s.biM)(n),c=(0,o.useSelector)(g.ZP.selectors.getMode),u=(0,o.useSelector)(g.ZP.selectors.getProfileViews),p=u&&u.length>0;(0,r.useEffect)((()=>{t&&!i&&a&&!(0,s.ZiX)(a)&&c===s.ARY.Viewing&&p&&e(g.N5.actions.validateProfile())}),[e,i,t,l,a,c,p])})();const _=(0,r.useCallback)((e=>{m({layout:e,views:I,configHash:D}),R(e)}),[m,D,I]);return a().createElement(w.j.Provider,{value:!0},a().createElement(S.s.Provider,{value:H},a().createElement(h.h.Provider,{value:A?F:U},a().createElement(C.O.Provider,{value:V},a().createElement(P.m.Provider,{value:W},a().createElement("div",{className:i.perspectiveView},(!Z||!(null!=L&&L.uri))&&a().createElement(O.Z,null),Z&&null!=L&&L.uri?a().createElement("div",{className:i.profileContainer},a().createElement("div",{className:i.profileWrapper},a().createElement(Ra,null),!A&&a().createElement(wo,null),a().createElement("div",{ref:u,className:i.scrollWrapper},a().createElement(ya,{layout:T,onLayoutChanged:_,views:I}))),a().createElement(io,null)):a().createElement("div",{className:i.emptyState},a().createElement(N.ZP,{LogoRenderer:N.B9.NO_DATA,text:p().text("No data to display."),variant:N.tC.embedded}))))))))})).displayName="ProfilePerspectiveView",(0,i.createGenerateClassName)({productionPrefix:"profilePerspective",disableGlobal:!0});var Co=n(44443),Po=n(97333),Oo=n(66072),No=n(79935),Zo=n(91131);const ko=(0,$.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}}))),To=e=>{let{total:t=0}=e;const n=ko(),l=(0,o.useDispatch)(),i=(0,r.useContext)(te.m),s=(0,r.useCallback)((()=>{l(g.ui.actions.openPerspective({perspectiveId:"profile",viewId:i}))}),[l,i]);return a().createElement(U.Z,{title:""},a().createElement("div",{className:n.titleContainer},a().createElement(Fr.Z,{component:"button",variant:"caption",className:n.link,onClick:s,underline:"none"},p().text("Profile")),a().createElement(Zo.Z,{className:n.icon}),p().text("Tags")),a().createElement(No.Z,null),a().createElement(M.Z,{className:n.totalCaption,variant:"caption"},a().createElement("span",{className:n.totalNumber},p().number(t,"0,0")),p().text("total profiles")))};var Ro=n(20404),Io=n(15223);const jo=(0,$.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"}}))),Do=e=>{let{label:t}=e;const n=jo();return a().createElement(Io.Z,{className:n.toolbar},a().createElement(Ro.Z,{className:n.avatar}),a().createElement(M.Z,{variant:"h6",className:n.label},t))};function Lo(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){Ao(e,t,n[t])}))}return e}function Ao(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Mo=(0,$.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}}))),Uo=[25,50,100],Fo=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const i=Mo(),[c,u]=(0,r.useState)(Uo[0]),[m,d]=(0,r.useState)(0),f=(0,o.useSelector)(g.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{d(0)}),[t,n,f]);const{isLoading:b,total:h,entities:y}=(e=>{let{tag:t,entityUri:n,page:a=0,rowsPerPage:i=50}=e;const c=(0,o.useDispatch)(),u=(0,Ee._)(),m=(0,Ee._)(),[d,f]=(0,r.useState)(!1),[b,h]=(0,r.useState)(0),[y,E]=(0,r.useState)([]),{requestEntities:v,requestTotal:x}=(e=>{let{entityUri:t,tag:n}=e;const a=(0,o.useSelector)(g.ZP.selectors.getGlobalSearchRequestOptions),i=(0,o.useSelector)(g.ZP.selectors.getTenant),c=(0,o.useSelector)(g.ZP.selectors.getDtssPath),u=(0,r.useMemo)((()=>(0,s.Do$)(t)),[t]),p=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),m=!!u,d=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Lo({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return m?(0,s.uqV)({filters:e,options:t,customerTenant:i,dataTenant:u,dtssPath:c}).then((0,l.map)((0,l.assoc)("dataTenant",u))):(0,s.ZOr)(e,t)}),[m,u,i,c]);return{requestEntities:(0,r.useCallback)(((e,t)=>d(p,Lo({offset:t,max:e},a))),[p,a,d]),requestTotal:(0,r.useCallback)((()=>{const e=a;return(m?(0,s.J$m)({filters:p,options:e,customerTenant:i,dataTenant:u,dtssPath:c}):(0,s.j_Q)(p,e)).then((e=>e.total))}),[p,a,m,u,i,c])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{c(g.ui.actions.errorSet((0,s.xU7)(e,p().text("Something went wrong")))),h(0)}),[c]);return(0,r.useEffect)((()=>{u(x()).then(h).catch(w)}),[x,u,w]),(0,r.useEffect)((()=>{f(!0),m(v(i,a*i)).then(E).catch(w).finally((()=>f(!1)))}),[a,i,v,m,w]),{isLoading:d,total:b,entities:y}})({tag:t,entityUri:n,page:m,rowsPerPage:c}),E=(0,r.useRef)(null);(0,r.useEffect)((()=>{E.current&&(E.current.scrollTop=0)}),[y]);const v=h>Uo[0];return a().createElement("div",{className:i.perspectiveView},a().createElement(Do,{label:t}),a().createElement("div",{className:T()(i.tagsContainer,{[i.fullHeight]:v})},a().createElement(D.Z,{className:i.tagsView},a().createElement(To,{total:h}),a().createElement("div",{className:i.listContainer},b&&a().createElement(O.Z,null),h>0&&a().createElement("div",{className:i.entitiesList,ref:E},a().createElement(Oo.Z,{entities:y})),v&&a().createElement("div",{className:i.pagination},a().createElement(L.Z,{count:h,rowsPerPageOptions:Uo,rowsPerPage:c,page:m,onChangePage:d,onChangeRowsPerPage:u}))))))}));Fo.displayName="TagPerspectiveView";const Ho=(0,i.createGenerateClassName)({productionPrefix:"tagPerspective",disableGlobal:!0}),Vo=e=>{let{config:t,tag:n,entityUri:r,store:s,onResize:c=l.identity}=e;return a().createElement(o.Provider,{store:s},a().createElement(te.m.Provider,{value:t.id},a().createElement(i.StylesProvider,{generateClassName:Ho},a().createElement(Co.Z,{handleHeight:!0,onResize:(e,t)=>c(Math.floor(e),Math.floor(t))}),t&&a().createElement(Fo,{tag:n,entityUri:r}),a().createElement(Po.Z,{showErrorFromStore:!0}))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);