@reltio/remotes 1.4.1662 → 1.4.1663
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/1039.js +1 -1
- package/1088.js +1 -1
- package/1088.js.map +1 -1
- package/1146.js +1 -1
- package/1148.js +1 -1
- package/1334.js +1 -1
- package/1425.js +1 -1
- package/1572.js +1 -1
- package/1664.js +1 -1
- package/1707.js +1 -1
- package/1790.js +1 -1
- package/1840.js +1 -1
- package/2066.js +1 -1
- package/2300.js +1 -1
- package/2400.js +1 -1
- package/2966.js +1 -1
- package/3096.js +1 -1
- package/3348.js +1 -1
- package/3373.js +1 -1
- package/3381.js +1 -1
- package/3383.js +1 -1
- package/3463.js +1 -1
- package/3469.js +1 -1
- package/3538.js +1 -1
- package/3639.js +1 -1
- package/3854.js +1 -1
- package/3854.js.map +1 -1
- package/3912.js +1 -1
- package/415.js +1 -1
- package/4212.js +1 -1
- package/4390.js +1 -1
- package/446.js +1 -1
- package/4481.js +1 -1
- package/4583.js +1 -1
- package/4609.js +1 -1
- package/4610.js +1 -1
- package/4680.js +1 -1
- package/4780.js +1 -1
- package/4806.js +1 -1
- package/4838.js +1 -1
- package/50.js +1 -1
- package/5039.js +1 -1
- package/5053.js +1 -1
- package/5108.js +1 -1
- package/5177.js +1 -1
- package/5292.js +1 -1
- package/5368.js +1 -1
- package/5383.js +1 -1
- package/5617.js +1 -1
- package/5738.js +1 -1
- package/5738.js.map +1 -1
- package/5939.js +1 -1
- package/6287.js +1 -1
- package/636.js +1 -1
- package/658.js +1 -1
- package/{9831.css → 6774.css} +1 -1
- package/{9831.css.map → 6774.css.map} +1 -1
- package/6774.js +2 -0
- package/6774.js.map +1 -0
- package/6799.js +1 -1
- package/6844.js +1 -1
- package/6860.js +1 -1
- package/6903.js +1 -1
- package/7119.js +1 -1
- package/7128.js +1 -1
- package/7151.js +1 -1
- package/7340.js +1 -1
- package/735.js +1 -1
- package/7363.js +1 -1
- package/7422.js +1 -1
- package/7605.js +1 -1
- package/7626.js +1 -1
- package/7744.js +1 -1
- package/7896.js +1 -1
- package/820.js +1 -1
- package/8207.js +1 -1
- package/8216.js +1 -1
- package/8418.js +1 -1
- package/8462.js +1 -1
- package/8565.js +1 -1
- package/8741.js +1 -1
- package/9016.js +1 -1
- package/9050.js +1 -1
- package/9283.js +1 -1
- package/9309.js +1 -1
- package/9328.js +1 -1
- package/9387.js +1 -1
- package/9719.js +1 -1
- package/9861.js +1 -1
- package/987.js +1 -1
- package/99.js +1 -1
- package/9960.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/remoteEntry.js +1 -1
- package/remoteEntry.js.map +1 -1
- package/9831.js +0 -2
- package/9831.js.map +0 -1
package/2300.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bff2e6cd-f7a0-4379-8b0f-01a3e32edc95",e._sentryDebugIdIdentifier="sentry-dbid-bff2e6cd-f7a0-4379-8b0f-01a3e32edc95")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"1.4.1663"},(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[2300],{812:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");t.Z=l},16e3:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M7.38 21.01c.49.49 1.28.49 1.77 0l8.31-8.31c.39-.39.39-1.02 0-1.41L9.15 2.98c-.49-.49-1.28-.49-1.77 0s-.49 1.28 0 1.77L14.62 12l-7.25 7.25c-.48.48-.48 1.28.01 1.76z"}),"ArrowForwardIosRounded");t.Z=l},74654:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");t.Z=l},70369:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Create");t.Z=l},13510:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}),"History");t.Z=l},36592:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2zm0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19v10z"}),"Inbox");t.Z=l},89025:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined");t.Z=l},93400:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 15c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm1-8h-2V7h2v2z"}),"InfoRounded");t.Z=l},944:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"ReportProblem");t.Z=l},71976:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z"}),"ThumbDown");t.Z=l},18876:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z"}),"ThumbUp");t.Z=l},32300:(e,t,n)=>{n.d(t,{vC:()=>li,Gv:()=>eo,_n:()=>Dl,tM:()=>$l});var r=n(24328),a=n.n(r),o=n(9366),l=n(50914),i=n(54426),s=n(40855),c=n(44443),u=n(41633),p=n(18408),d=n(63532),m=n(43751),g=n(14235),f=n(32479),h=n(31421),b=n(2507),y=n.n(b),v=n(45738),x=n(52730),E=n(589),w=n(96697),S=n(1824),C=n(36852),O=n(43407),P=n(35722),k=n(79002),N=n(61604),Z=n(80231),R=n(14834),T=n(62228),j=n(40006),I=n(43460),D=n(52708),L=n(87378),M=n(8007),A=n(14593),z=n(71153),V=n.n(z),U=n(153),H=n(56346);const F=a().createContext(null);F.displayName="SingleAttributeContext";var W=n(80687),B=n(82565),q=n(33945),_=n(83422),G=n(79312),Y=n(52194),Q=n(32701),$=n(12364),X=n(58003),K=n(55310),J=n(33043),ee=n(46804),te=n(47019),ne=n(38677),re=n(80653),ae=n(30721),oe=n(80852),le=n(72342);const ie=(0,le.makeStyles)((()=>({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"}}))),se=e=>{let{className:t}=e;const n=ie(),o=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(F),u=()=>i((e=>!e));return a().createElement(a().Fragment,null,a().createElement(ne.Z,{ref:o,classes:{root:V()(n.triggerButton,t)},onClick:u},a().createElement(re.Z,null)),a().createElement(te.ZP,{open:l,classes:{paper:n.popupContent},anchorEl:o.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(ae.Z,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:a().createElement(oe.Z,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:y().text("Show inactive values")})))},ce=(0,le.makeStyles)((()=>({root:{padding:"0 4px 0 16px"},rightMenuItems:{display:"flex",flex:"1 0 auto",justifyContent:"flex-end",alignItems:"center"},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"}}))),ue=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:o,isEditableMode:l}=e;const i=ce(),{searchQuery:s,setSearchQuery:c,setPage:u,totalNonVisibleValues:p,nonVisibleValues:d,attributeType:m}=(0,r.useContext)(F),g=l&&(null==m?void 0:m.required);return a().createElement(Y.Z,{title:t,className:i.root},g&&a().createElement(Q.Z,null),a().createElement($.Z,{description:null==m?void 0:m.description}),a().createElement(X.Z,{widthToHide:400},a().createElement(K.Z,{height:24,margin:16}),a().createElement(G.Z,{className:i.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),a().createElement(J.Z,{nonOvTotal:p,className:i.ovIcon,nonOvValues:d,attributeType:m}),a().createElement("div",{className:i.rightMenuItems},a().createElement(ee.i,{query:s,onChange:e=>{c(e),u(0)}}),o&&a().createElement(se,null)))};var pe=n(93553),de=n(56961),me=n(40941),ge=n(63928),fe=n(55401),he=n(11387),be=n(50548);const ye=h.nIW,ve=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ve(n,t)})))):h.P6Y.strings.search(String(e),t),xe=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:a=1/0,offset:o=0,searchQuery:i=""}=e;const s=(0,l.pipe)(h.XtP,(0,l.filter)((e=>{let{value:t}=e;return ve(t,i)})))(t,n,r),c=(0,l.filter)(h.OXP,s);return{[(0,h.xy8)(r)]:{[ye(r)]:c.slice(o,o+a),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}},Ee=(0,le.makeStyles)((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",borderColor:"rgba(0,0,0,0.12)"},ovFalse:e.inactive,noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px 8px 0"}})));function we(){return we=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},we.apply(this,arguments)}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ce(e,t,n[t])}))}return e}function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Oe=[],Pe=(0,be.l)(I.NY,((e,t)=>{let{parentUri:n,attributeType:r}=t;const{element:a,type:o}=e||{};return{highlightedError:(0,I.Ie)(o)&&(0,h.Wah)(a,n,r.uri)?e:null}}),(e=>{let{values:t,attributeType:n,parentUri:o,showInactive:i,noDataText:s,highlightedError:c}=e;const u=Ee(),{uri:p,required:m,cardinality:g,name:f}=n,b=(0,x.useDispatch)(),E=(0,r.useContext)(d.m),w=(0,x.useSelector)(v.ZP.selectors.getEntity),S=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,w.uri)||{})),C=(0,x.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,o,n))),O=(0,x.useSelector)((e=>(0,h.tQX)(o,n,v.ZP.selectors.getProfileErrors(e)))),P=(0,x.useSelector)(v.ZP.selectors.getMode),k=(0,h.xy8)(n),N=(0,l.pipe)((0,l.pathOr)(Oe,[k,f]),(0,l.map)((0,l.prop)("uri")))(w),Z=(0,l.pathOr)(Oe,[k,f],S),R=Z.map((0,l.prop)("uri")),T=(0,h.ZiX)(w.uri),j=(0,r.useMemo)((()=>(0,h.gjI)({parentUri:o,attributeType:(0,l.omit)(["defaultValue"],n)})),[o,n]),{ref:I,errorClassName:D}=(0,me.B)({highlightedError:c,isSimple:!0}),L=(0,h.O27)(Z),M=m&&L,A=M?[j]:Z.filter((0,l.pipe)((0,l.prop)("uri"),h.ZiX)),z=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.addAttributes,b)(e.map((e=>Se({},e,{viewId:E}))))),[E,b]),U=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.modifyAttribute,b)(Se({},e,{viewId:E}))),[E,b]),H=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.removeAttribute,b)(Se({},e,{viewId:E}))),[E,b]),F=(0,r.useCallback)((0,l.pipe)(v.N5.errors.actions.errorDeactivated,b),[b]),W=(0,r.useCallback)((()=>{const e=e=>({parentUri:o,attributeType:e});if(M&&!(0,h.YkM)(n.type)){const t=[e((0,l.omit)(["defaultValue"],n)),e(n)];return z(t)}return z([e(n)])}),[z,o,n,M]),B=(0,h.Vg3)({attributeType:n,mode:P}),q={attributeType:n,errors:C,crosswalks:S.crosswalks,mode:P,onAddAttributes:z,onChangeAttribute:U,onDeactivateError:F,showNonOv:i},_=0===A.length&&0===t.length;return!(0,l.isEmpty)(S)&&a().createElement("div",{ref:I,className:D},a().createElement(ge.Z,{cardinality:g}),a().createElement(fe.Z,{message:O}),B&&a().createElement(ne.Z,{color:"primary",onClick:W,className:u.moreButton},a().createElement(pe.Z,{classes:{root:u.icon}}),a().createElement("div",{className:u.buttonLabel},y().text("Add"))),A.map(((e,t)=>a().createElement(he.Z,we({key:e.uri},q,{attributeValue:e,lazy:M&&!m,showEmptyEditors:T,ownError:(0,h.ADq)(e,t,p,C),onDeleteAttribute:H,isEmptyEditor:M})))),A.length>0&&t.length>0&&a().createElement(de.Z,{className:u.divider}),t.map((e=>{const t=Z.find((0,l.propEq)("uri",e.uri)),n=t||e,r=N.includes(n.uri)&&!R.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,h.vKJ)({valueTransformer:(0,l.unless)(h.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:V()({[u.ovFalse]:!(0,h.OXP)(n)})},a().createElement(he.Z,we({},q,{attributeValue:n,ownError:(0,h.ADq)(n,null,p,C),onDeleteAttribute:H,state:i})))})),_&&a().createElement(G.Z,{className:u.noData},s))}));var ke=n(11013);const Ne=(0,le.makeStyles)((()=>({simpleAttribute:{fontSize:"13px",lineHeight:"15px",marginBottom:"4px"}}))),Ze=e=>{let{values:t,attributeType:n,showInactive:r}=e;const o=Ne(),l=!(0,h.YkM)(n);return a().createElement(a().Fragment,null,t.map((e=>a().createElement(ke.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r,className:V()({[o.simpleAttribute]:l})}))))},Re=(0,le.makeStyles)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"hidden",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),Te=15,je=e=>{let{config:t,className:n}=e;const{caption:o,max:l=Te,showInactiveValuesMenu:i}=t,s=Re(),{values:c,totalVisibleValues:u,page:p,setPage:d,isLoading:m,hasPaging:g,attributeType:f,showInactive:h}=(0,r.useContext)(F),b=(0,x.useSelector)(v.ZP.selectors.getEntityUri),E=(0,x.useSelector)(v.ZP.selectors.getIsViewMode),w=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),S=(0,x.useSelector)(v.ZP.selectors.getPivotingAttributes),C=0!==c.length,O=t["text-empty"]||y().text("No data found");return a().createElement(W.J.Provider,{value:S},a().createElement(B.Z,{className:V()(s.root,n)},a().createElement(ue,{totalVisibleValues:u,caption:o,showInactiveValuesMenu:i,isEditableMode:w}),a().createElement(_.Z,{className:s.content},(()=>{if(m)return a().createElement(L.Z,null);if(f){if(E&&C){const e={values:c,attributeType:f,showInactive:h};return a().createElement(Ze,e)}if(w){const e={values:c,attributeType:f,parentUri:b,showInactive:h,noDataText:O};return a().createElement(Pe,e)}}return a().createElement(G.Z,{className:s.noData},O)})()),g&&a().createElement(q.Z,{count:u,page:p,rowsPerPage:l,rowsPerPageOptions:[],onChangePage:d,classes:{root:s.pagination}})))};var Ie=n(19701),De=n(55962);function Le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Me=(e,t)=>{const{attributeUri:n,max:a=15}=e,o=(0,x.useSelector)(v.ZP.selectors.getMetadata),[i,s]=(0,r.useState)([]),[c,u]=(0,r.useState)(null),[p,d]=(0,r.useState)(!1),m=(0,Ie._)(),g=(0,r.useRef)(null),f=(0,x.useDispatch)(),b=(0,x.useSelector)(v.ZP.selectors.getApiPath),E=(0,x.useSelector)(v.ZP.selectors.getTenant),w=(0,x.useSelector)(v.ZP.selectors.getEntityWithDiff),S=(0,x.useSelector)(v.ZP.selectors.getIsViewMode),C=(0,x.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),O=(0,x.useSelector)(v.ZP.selectors.getHistoryDiff),P=w.uri,k=ye(n),N=(0,h.xy8)(n);g.current=(0,h.JQy)(w,P,k);const Z=(0,r.useMemo)((()=>(0,h.zeJ)(o,n)),[o,n]),{globalFilter:R}=(0,x.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:T}=t,j=(0,r.useCallback)((()=>{if(Z&&(0,h.Uty)(Z)&&!(0,h.ZiX)(P)&&(0,h.YOQ)(n)){d(!0);const{page:e,showInactive:r}=t,i=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"]),c=(0,h.biM)(w)||C?xe:h.KbL;m(c(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Le(e,t,n[t])}))}return e}({metadata:o,entity:w,apiPath:b,tenant:E,parentUri:P,defaultMaxValues:a,attributeTypeUri:n,offset:a*e,globalFilter:R,options:r?"":void 0},i))).then((e=>{const t=(0,l.path)([N],e),r=(0,l.pathOr)([],[k],t);C||f(v.N5.actions.processNextPageOfAttributeValues({parentUri:P,attributeTypeUri:n,attributeTypeName:k,values:r})),s(r.map((e=>{var t;return(null===(t=g.current)||void 0===t?void 0:t.find((0,l.propEq)("uri",e.uri)))||e}))),u((0,l.path)(["paging",n],t))})).catch((e=>{console.error(e),s([]),f(v.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong"))))})).finally((()=>{d(!1)}))}else s([]),u(null)}),[b,P,E,n,a,o,t,R,Z,C,O]);(0,r.useEffect)((()=>{j()}),[j]),(0,De.D)((()=>{S&&j()}),[S]);const I=(0,l.partition)(h.OXP),[,D]=I(g.current||[]),L=T?[]:D,M=T?"totalValues":"totalOvValues",A=(0,l.ifElse)((0,l.has)(M),(0,l.prop)(M),(0,l.always)(i.length))(c),z=a<A,V=null!=c&&c.totalValues?c.totalValues-A:L.length;return{values:i,isLoading:p,hasPaging:z,totalVisibleValues:A,attributeType:Z,totalNonVisibleValues:V,nonVisibleValues:L}};function Ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ze=n(80225),Ve=n(64047),Ue=n(10609),He=n(63929),Fe=n(1128),We=n(39475),Be=n(74654),qe=n(812);const _e=a().createContext(null);_e.displayName="RelationsViewStateContext";const Ge=(0,le.makeStyles)((e=>({button:{color:e.palette.text.secondary,width:"36px",minWidth:"36px"},popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{borderColor:"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"}}))),Ye=e=>{let{className:t}=e;const n=Ge(),o=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(_e),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),b=!(0,h.O27)(d),v="asc"===s;return a().createElement(a().Fragment,null,a().createElement(ne.Z,{ref:o,classes:{root:V()(n.button,t)},onClick:f},a().createElement(re.Z,null)),a().createElement(te.ZP,{open:m,classes:{paper:n.popupContent},anchorEl:o.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(ae.Z,{classes:{label:n.checkboxControlLabel},control:a().createElement(oe.Z,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),b&&a().createElement(a().Fragment,null,a().createElement(de.Z,{className:n.divider}),a().createElement(G.Z,{className:n.title,variant:"h6"},y().text("Sort by")),a().createElement("div",{className:n.sortControls},a().createElement(Fe.Z,{entries:d,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:p,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),a().createElement(We.k,{tooltipTitle:v?y().text("Ascending"):y().text("Descending"),icon:v?Be.Z:qe.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Ye.displayName="FilterButton";const Qe=Ye,$e=(0,le.makeStyles)({header:{padding:"0 6px 0 16px"},rightMenuItems:{display:"flex",flex:"1 0 auto",justifyContent:"flex-end",alignItems:"center"},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 Xe=n(76981),Ke=n(98538);const Je=a().createContext(null);function et(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){tt(e,t,n[t])}))}return e}function tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const nt=Math.pow(2,31)-1,rt=(0,le.makeStyles)((()=>({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 at=n(22118),ot=n(71001);const lt=e=>{let{label:t}=e;const n=rt();return a().createElement(ot.Z,{classes:{anchorOriginTopRightRectangular:n.badgePosition,badge:n.badge},badgeContent:t},a().createElement(Xe.Z,null))},it=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:o,onImportClick:l}=(()=>{var e;const t=(0,x.useSelector)(v.ZP.selectors.getDataTenants),n=(0,x.useDispatch)(),{config:a,reloadRelations:o}=(0,r.useContext)(Je),l=(0,x.useSelector)(v.ZP.selectors.getEntityUri),[i,s]=(0,r.useState)([]),[c,u]=(0,r.useState)(null),p=(0,x.useSelector)(v.ZP.selectors.getDtssPath),d=(0,x.useSelector)(v.ZP.selectors.getTenant),m=[et({},a.content,{offset:0,max:null!==(e=a.maxDtssImport)&&void 0!==e?e:nt})],g=(0,r.useCallback)((()=>{s([]),a.importFromDT&&!(0,h.ZiX)(l)&&Promise.all((t||[]).map((e=>(0,h.QXb)({entityUri:l,content:m,dtssPath:p,customerTenant:d,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return et({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(s)}),[l,p,d,a,t]),f=(0,r.useCallback)((()=>{(0,h.MOC)({entityUri:l,content:m,dtssPath:p,customerTenant:d,dataTenant:c.id}).then((()=>{o(),g()})).catch((e=>n(v.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong")))))),u(null)}),[l,p,d,a,g,o,c,u]);(0,r.useEffect)((()=>{g()}),[g]);const b=(0,r.useCallback)((()=>u(null)),[]),E=(0,r.useCallback)((e=>u(e)),[]);return{tenants:i,selectedTenant:c,onConfirmImport:f,onCancelConfirmation:b,onImportClick:E}})(),i=rt(),s=1===e.length,c=s?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,s?a().createElement("div",{className:i.button},a().createElement(We.k,{size:"L",icon:Xe.Z,tooltipTitle:y().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>l(e[0])}),a().createElement("div",{className:V()(i.tenant)},c)):a().createElement(Ke.Z,{menuId:"importDT-table-actions",buttonComponent:We.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>a().createElement(lt,{label:c})},menuItems:e.map((e=>({onClick:()=>{l(e)},text:e.label})))}),a().createElement(at.Z,{open:!!t,title:y().text("Confirmation"),content:y().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:y().text("Cancel"),saveCaption:y().text("Import"),onDiscard:o,onSave:n})))},st=e=>{let{title:t,total:n}=e;const o=$e(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(_e);return a().createElement(Y.Z,{title:t||"",className:o.header},n>0&&a().createElement(X.Z,{widthToHide:400},a().createElement(K.Z,{height:24,margin:16}),a().createElement(G.Z,{className:o.totalCaption,variant:"caption"},n>1?y().text("${count} items",{count:n}):y().text("${count} item",{count:n}))),a().createElement("div",{className:o.rightMenuItems},a().createElement(ee.i,{query:l,onChange:i}),a().createElement(it,null),a().createElement(Qe,null)))};var ct=n(79298),ut=n(29754),pt=n(6163),dt=n(96379),mt=n(18527),gt=n(90838),ft=n(23883);const ht=(0,le.makeStyles)((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 bt(){return bt=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},bt.apply(this,arguments)}const yt=e=>{let{label:t,entity:n,children:o}=e,i=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 s=ht(),c=(0,Ie._)(),u=(0,x.useSelector)(v.ZP.selectors.getTenant),p=(0,x.useSelector)(v.ZP.selectors.getDtssPath),[d,m]=(0,r.useState)(!1),[g,f]=(0,r.useState)(null);(0,r.useEffect)((()=>{f(null)}),[n]);const b=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&!(0,h.ZiX)(null==n?void 0:n.entityUri)&&(0,l.isNil)(g)){const e=(0,l.ifElse)(h.biM,(e=>(0,h.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:u,dtssPath:p})),(e=>(0,h.XkT)(e.entityUri)));m(!0),c(e(n)).then((e=>{let{secondaryLabel:t}=e;f(t)})).finally((()=>{m(!1)}))}}),[p,n,u,c,g]),y=a().createElement("div",{className:s.tooltipContent},a().createElement("div",{className:s.label},t),d&&a().createElement(gt.Z,{size:16,classes:{colorPrimary:s.progress}}),g&&a().createElement("div",{className:s.secondaryLabel},g));return a().createElement(ft.Z,bt({onOpen:b,title:y,disableFocusListener:!0,classes:{tooltip:s.tooltip}},i),o)},vt=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,h.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,h.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,h.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,h.Lmx)(t,null==r?void 0:r.relationType)}},xt=(0,le.makeStyles)((()=>({container:{display:"flex"}})));function Et(){return Et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Et.apply(this,arguments)}const wt=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=xt();return a().createElement("div",{className:o.container},a().createElement(ne.Z,Et({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),a().createElement(ne.Z,Et({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},St=(0,le.makeStyles)((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"}}))),Ct=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:o,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=St(),{entity:d,relation:m}=t,g=(0,h.$qe)(t),f=(0,h.xr3)(t),b=(0,h.iJH)(t),{entityType:E,entityLabel:w,preparedUri:S,relationLabel:C}=vt(t,n),O=(0,h.Fn9)(m)&&(0,h.Fn9)(d),P=(0,x.useSelector)(v.ZP.selectors.getMode),{canRemove:k,canUpdate:N}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:a,onEditRelation:o}=e;if((n===h.ARY.Editing||n===h.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,h.$qe)(r),i=(0,h.V3K)(t,e);return{canRemove:a&&!l&&(0,h.Edd)(n,i),canUpdate:o&&!l&&(0,h.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:P,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),Z=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),R=(0,r.useCallback)((()=>i(t)),[i,t]),T=(0,r.useCallback)((()=>{s(t)}),[s,t]),j=(0,r.useCallback)((()=>c(t)),[c,t]),I=(k||N)&&o&&!t.suggested?a().createElement(a().Fragment,null,N&&a().createElement(We.k,{icon:ut.Z,size:"XS",onClick:R,tooltipTitle:y().text("Edit")}),k&&a().createElement(We.k,{icon:pt.Z,size:"XS",onClick:Z,tooltipTitle:y().text("Remove")})):void 0,D=t.suggested?a().createElement(wt,{acceptRelation:T,ignoreRelation:j,size:"small",disabled:b}):void 0,L=b?y().text("ignored"):y().text("edited");return a().createElement("div",{className:V()(p.container,{[p.rowInactive]:!O},{[p.removed]:g||b})},a().createElement("div",{className:p.row},u&&u(),a().createElement(dt.Z,{className:p.entityAvatar,entityType:E}),a().createElement(mt.Z,{value:S,className:p.entityLabelContainer},a().createElement(yt,{label:w,entity:d},a().createElement("span",{className:p.entityLabel},w)),(f||b)&&a().createElement(G.Z,{variant:"caption",className:p.editedLabel},"(",L,")"),C&&a().createElement("span",{className:p.relationLabel},`, ${C}`)),a().createElement("div",{className:p.editButtonsContent},I),D))}));Ct.displayName="EditableRelationItem";const Ot=Ct,Pt=(0,l.when)(h.Kn2,(0,l.prop)("uri")),kt=(e,t)=>{const n=(e,t)=>(t?(0,h.VGB)(t):[]).map((t=>({type:Pt(t),direction:e===h.Nsj.IN?h.Nsj.IN:h.Nsj.OUT})));return n(h.Nsj.IN,e).concat(n(h.Nsj.OUT,t))[0]};function Nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Zt=n(89507),Rt=n(65643);const Tt=(0,le.makeStyles)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),jt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:o}=e;const l=Tt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,h.xvW)(n)?null:o?a().createElement(Rt.Z,c):a().createElement(Zt.Z,c)},It=(0,le.makeStyles)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),Dt=e=>{let{config:t,connection:n,children:o}=e;const l=It(),{showInactive:i}=(0,r.useContext)(_e),{connections:s,showSecondLevel:c,toggleShowSecondLevel:u,loadRelations:p,loading:d,total:m}=(e=>{let{config:t,connection:n,relationActivityFilter:a}=e;const o=(0,x.useDispatch)(),[l,i]=(0,r.useState)(!1),[s,c]=(0,r.useState)(!1),{contentSecondLevel:u}=t,{entity:p}=n,d=(0,x.useSelector)((e=>v.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,p.entityUri)))||[],m=(0,x.useSelector)((e=>v.ZP.selectors.getTotalByViewId(e,t.id,p.entityUri))),{activityFilter:g}=(0,x.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions)||{},f=(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){Nt(e,t,n[t])}))}return e}({},u,{returnObjects:!0,returnDates:!0,activeness:{relation:a||h.Ng6.ALL,entity:g}});c(!0),(0,h.N6e)(p.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&o(v.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:p.entityUri,id:t.id,total:r})),c(!1)}))}),[t.id,u,o,p.entityUri,g,a]),b=(0,r.useCallback)((()=>{l||n.connections||f(),i((e=>!e))}),[f,n.connections,l]);return{connections:d,showSecondLevel:l,toggleShowSecondLevel:b,loadRelations:f,loading:s,total:m}})({config:t,connection:n,relationActivityFilter:i?h.Ng6.ALL:h.Ng6.ACTIVE_ONLY}),g=(0,r.useMemo)((()=>(0,h.Px$)(s)),[s]);return a().createElement(a().Fragment,null,o((()=>a().createElement(jt,{onClick:u,connection:n,config:t,showSecondLevel:c}))),c&&a().createElement(He.X.Provider,{value:g},a().createElement("div",{className:l.secondLevelContent},a().createElement(xn,{isLoading:d,config:t,loadRelations:p,connections:s,total:m,parentEntityUri:n.entity.entityUri}))))},Lt=(0,le.makeStyles)((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",borderColor:"rgba(0,0,0,0.12)"},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Mt=e=>{let{className:t,connections:n=[],config:o,mode:i,noDataText:s,parentEntityUri:c}=e;const u=(0,x.useSelector)(v.ZP.selectors.getMetadata),p=(0,x.useSelector)((e=>v.ZP.selectors.getRelationToAddByViewId(e,o.id))),d=(0,x.useSelector)((e=>v.ZP.selectors.getRelationsToEditByViewId(e,o.id))),m=(0,x.useSelector)(v.ZP.selectors.getEntity),g=(0,x.useSelector)((e=>v.ZP.selectors.getCheckIfCanAddRelations(e,o.content))),f=(0,x.useDispatch)(),b=Lt(),E=(0,r.useCallback)((()=>{const e=(0,h.vlo)({config:o,mode:i,metadata:u,parentEntityUri:c});(0,l.pipe)(v.N5.relations.actions.openRelationEditor(o.id),f)(e)}),[o,i,u,f,c]),w=(0,r.useCallback)((e=>{f(v.N5.relations.actions.closeRelationEditor(o.id,e)),f(v.N5.relations.actions.removeRelation(o.id,e));const t=n.find((t=>(0,h.w1L)(t)===e)),r=(0,h.yV)(t);(0,h.ZiX)(r)&&f(v.N5.modifiedEntities.actions.entityDeleted(r))}),[o,n,f]),S=o.content,C=kt(S.inRelations,S.outRelations),O=(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);f(v.N5.relations.actions.addRelation(o.id,t))}),[f,o,C]),P=(0,r.useCallback)((e=>{f(v.N5.relations.actions.ignoreRelation(o.id,{relationType:C.type,relationDirection:C.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[f,o,C]),[k,N]=(0,l.partition)(h.xvW,n),Z=m&&g,R=0===k.length&&0===N.length,T=e=>{var t,n;const r=d.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)})),s=!o.allowOnlyCreateNew||(0,h.xvW)(e),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return a().createElement(Dt,{config:o,connection:e,key:c},(t=>r?a().createElement(ct.Z,{connection:r,config:o,mode:i,metadata:u}):a().createElement(Ot,{renderRelationArrowButton:t,connection:e,metadata:u,showControls:s,onRemoveRelation:w,onEditRelation:(0,l.pipe)(v.N5.relations.actions.openRelationEditor(o.id),f),onAcceptRelation:O,onIgnoreRelation:P})))},j=Z&&(!p||p&&p.parentEntityUri===c),I=p&&p.parentEntityUri===c;return a().createElement("div",{className:t},j&&a().createElement(ne.Z,{color:"primary",onClick:E,className:b.moreButton},a().createElement(pe.Z,{classes:{root:b.icon}}),a().createElement("div",{className:b.buttonLabel},y().text("Add"))),I&&a().createElement(ct.Z,{connection:p,config:o,mode:i,metadata:u}),k.map(T),k.length>0&&N.length>0&&a().createElement(de.Z,{className:b.divider}),N.map(T),R&&a().createElement(G.Z,{className:b.noData},s))};var At=n(62901),zt=n(72316),Vt=n(38309),Ut=n(89978);const Ht=(0,le.makeStyles)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Ft(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){Wt(e,t,n[t])}))}return e}function Wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bt=e=>{let{connection:t,className:n}=e;const o=Ht(),{relation:i}=t,s=(0,x.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),c=(0,x.useSelector)(v.ZP.selectors.getMetadata),u=(0,r.useMemo)((()=>(0,h.xF8)(c,null==i?void 0:i.relationType)),[null==i?void 0:i.relationType,c]),p=(0,r.useMemo)((()=>Ft({attributes:Ft({},(0,h.Ff)(t))},(0,h.p2l)((null==t?void 0:t.relation)||{}))),[t]),d=(0,r.useMemo)((()=>(0,h.fyF)(u,p)),[u,p]).filter((e=>{let{values:t}=e;return!(0,h.O27)(t)})).length>0,m=(0,r.useMemo)((()=>(0,h.R$r)(p.attributes)),[p]),{getCommentsCount:g}=(0,r.useContext)(S.h);(0,r.useEffect)((()=>{!(0,l.isEmpty)(m)&&g(m)}),[g,m]);const f=(0,r.useMemo)((()=>(0,h.wp9)(h.q7e.RELATION,{entityUri:s,connection:t})),[t,s]);return d?a().createElement(Vt.A.Provider,{value:f},a().createElement(Ut.Z,{className:V()(o.attributesList,n),entity:p,attrTypes:u})):a().createElement("div",{className:V()(o.attributesList,n)},y().text("No attributes"))};var qt=n(93400),_t=n(89025);const Gt=e=>{let{show:t,onToggle:n,className:r}=e;return a().createElement(We.k,{className:r,tooltipTitle:t?y().text("Hide attributes of the relationship"):y().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?qt.Z:_t.Z,onClick:n})},Yt=(0,le.makeStyles)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"16px",padding:"3px 11px 3px 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",wordBreak:"break-all",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},showDetails:{marginLeft:"auto",paddingRight:"5px"},attributesList:{paddingLeft:"46px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0},suggestedWrapper:{backgroundColor:e.suggested},commentsContainer:{marginLeft:"auto",alignItems:"center","& + $showDetails":{marginLeft:"4px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"},labelWrapper:{display:"flex",alignItems:"center"}}))),Qt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:o,ignoreRelation:i}=e;const s=Yt(),c=t.suggested,{entity:u,relation:p}=t,[d,m]=(0,r.useState)(!1),g=(0,x.useSelector)(v.ZP.selectors.getMetadata),{entityType:f,entityLabel:b,preparedUri:y,relationLabel:E}=vt(t,g),w=(0,h.Fn9)(p)&&(0,h.Fn9)(u),S=(0,x.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),C=u&&p&&(0,h.wp9)(h.q7e.RELATION,{entityUri:S,connection:t})||[];return a().createElement("div",{className:V()(s.container,{[s.rowInactive]:!w},{[s.suggestedWrapper]:c})},a().createElement("div",{className:V()(s.row,At.U)},n&&n(),a().createElement("div",{className:s.labelWrapper},a().createElement(dt.Z,{className:s.entityAvatar,entityType:f}),a().createElement(mt.Z,{value:y,className:s.entityLabelContainer},a().createElement(yt,{label:b,entity:u},a().createElement("span",{className:s.entityLabel},b)),E&&a().createElement("span",{className:s.relationLabel},`, ${E}`))),a().createElement("div",{className:s.additionalButtonsWrapper},!(0,l.isEmpty)(C)&&a().createElement(zt.Z,{className:s.commentsContainer,uri:(0,h.gjS)(p),relatedObjectUris:C,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),c&&a().createElement(wt,{size:"small",acceptRelation:o(t),ignoreRelation:i(t)}),!c&&a().createElement(Gt,{show:d,onToggle:()=>{m((e=>!e))},className:s.showDetails}))),d&&a().createElement(Bt,{connection:t}))}));Qt.displayName="RelationItem";const $t=Qt;var Xt=n(18876),Kt=n(71976),Jt=n(30750),en=n(80233),tn=n(60590),nn=n(11559),rn=n(65439);const an=e=>(0,l.pipe)((0,l.pluck)("value"),l.mean,(0,l.defaultTo)(0))(e).toFixed(1),on=e=>e.filter((e=>5===e.value)).length,ln=e=>e.filter((e=>1===e.value)).length,sn=e=>{if(0===e.length)return{percentOfLikes:0,percentOfDislikes:0};const t=on(e)/e.length*100,n=parseFloat(Number(t).toFixed(1));return{percentOfLikes:n,percentOfDislikes:parseFloat(Number(100-n).toFixed(1))}},cn=(0,le.makeStyles)((e=>({wrapper:{display:"flex",flexDirection:"column",padding:12,width:355,gap:12},info:{background:"rgba(0, 0, 0, 0.05)",display:"flex",padding:"6px 12px",fontSize:13,gap:16},axis:{position:"relative",display:"flex",justifyContent:"space-between",fontSize:12,color:e.palette.text.secondary,paddingTop:4,"&::before":{content:'""',position:"absolute",top:0,left:0,background:e.palette.divider,width:"1px",height:"4px"},"&::after":{content:'""',position:"absolute",top:0,right:0,background:e.palette.divider,width:"1px",height:"4px"}},scaleHistory:{display:"flex",justifyContent:"space-between"},title:{fontSize:13,display:"flex",alignItems:"center",color:e.palette.text.secondary,gap:8,"& .value":{color:e.palette.text.primary},"& .boldValue":{color:e.palette.text.primary,fontWeight:700}},greenBadge:{width:12,height:12,background:"rgb(151, 192, 97)"},redBadge:{width:12,height:12,background:"rgb(255, 112, 112)"},scale:{width:"100%",height:16,background:"rgba(255, 112, 112)","&.empty":{background:"#F9F9F9"}},scaleBar:{background:"rgba(151,192,97)"},icon:{width:"14px",height:"14px",color:"rgba(0,0,0,0.54)"},ratingsList:{borderTop:"1px solid #ccc",borderBottom:"1px solid #ccc",padding:"12px 0",maxHeight:140,boxSizing:"border-box",overflow:"auto"},rating:{display:"flex",padding:"4px 0px",alignItems:"center"},avatar:{width:24,height:24,marginRight:12,"& .icon":{fontSize:18}},userInfo:{overflow:"hidden"},user:{fontSize:13,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis"},ratingDateWrapper:{display:"flex",alignSelf:"start",marginLeft:"auto"},ratingDate:{fontSize:10,color:e.palette.text.secondary,marginRight:4},sourcesWrapper:{display:"flex",alignItems:"center",gap:4}}))),un=e=>{let{ratings:t,crosswalks:n,open:r,anchorEl:o,onClose:l}=e;const i=cn(),s=(e=>[...e].sort(((e,t)=>{const n=new Date(e.timestamp).getTime();return new Date(t.timestamp).getTime()-n})))(t),{percentOfLikes:c,percentOfDislikes:u}=sn(t),p=`${on(t)} (${c}%)`,d=`${ln(t)} (${u}%)`;return a().createElement(en.Z,{open:r,anchorEl:o,onClose:l,placement:"top-start",transition:!0},a().createElement("div",{className:i.wrapper},a().createElement("div",{className:i.info},a().createElement("span",{className:i.title},y().text("Score:"),a().createElement("span",{className:"boldValue"},an(t))),a().createElement("span",{className:i.title},y().text("No. of responses:"),a().createElement("span",{className:"value"},t.length))),a().createElement("div",null,a().createElement(Jt.Z,{variant:"determinate",value:c,classes:{bar:i.scaleBar},className:V()(i.scale,{empty:!t.length})}),a().createElement("div",{className:i.axis},a().createElement("span",null,"0"),a().createElement("span",null,"100%"))),a().createElement("div",{className:i.scaleHistory},a().createElement("span",{className:i.title},a().createElement("div",{className:i.greenBadge}),a().createElement(Xt.Z,{className:i.icon}),y().text("Agree:"),a().createElement("span",{className:"value"},p)),a().createElement("span",{className:i.title},a().createElement("div",{className:i.redBadge}),a().createElement(Kt.Z,{className:i.icon}),y().text("Disagree:"),a().createElement("span",{className:"value"},d))),!!s.length&&a().createElement("div",{className:i.ratingsList,"data-reltio-id":"reltio-ratings-list"},s.map(((e,t)=>{let{user:n,comment:r,timestamp:o,value:l}=e;return a().createElement("div",{key:t,className:i.rating,"data-reltio-id":"reltio-rating-item"},a().createElement(rn.Z,{className:i.avatar},a().createElement(nn.Z,{className:"icon"})),a().createElement("div",{className:i.userInfo},a().createElement("div",{className:i.user},n),a().createElement("div",{className:i.title},r||y().text("No comment"))),a().createElement("div",{className:i.ratingDateWrapper},a().createElement("span",{className:i.ratingDate},y().date(o,"L LT")),1===l?a().createElement(Kt.Z,{className:i.icon,"data-reltio-id":"reltio-dislike-icon"}):a().createElement(Xt.Z,{className:i.icon,"data-reltio-id":"reltio-like-icon"})))}))),a().createElement("div",{className:i.sourcesWrapper},a().createElement("span",{className:i.title},y().text("Sources:")),n.map(((e,t)=>a().createElement(tn.Z,{key:t,crosswalk:e}))))))},pn=(0,le.makeStyles)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end",width:128,cursor:"pointer"},averageRating:{marginBottom:4,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px",color:e.palette.text.primary},counts:{display:"flex",marginTop:4,gap:32},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:e.palette.text.secondary},scale:{height:3,width:"100%",background:"rgba(255, 112, 112)","&.empty":{background:"#F9F9F9"}},scaleBar:{background:"rgba(151,192,97)"}}))),dn=e=>{let{ratings:t,crosswalks:n,className:o}=e;const l=pn(),i=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{percentOfLikes:u}=sn(t);return a().createElement(a().Fragment,null,a().createElement("div",{"data-reltio-id":"reltio-ratings",className:V()(l.wrapper,o),ref:i,onClick:()=>c(!0)},a().createElement(G.Z,{className:l.averageRating},an(t)),a().createElement(Jt.Z,{variant:"determinate",value:u,classes:{bar:l.scaleBar},className:V()(l.scale,{empty:!t.length})}),a().createElement("div",{className:l.counts},a().createElement("div",{className:l.count},a().createElement(Xt.Z,{className:l.icon}),on(t)),a().createElement("div",{className:l.count},a().createElement(Kt.Z,{className:l.icon}),ln(t)))),a().createElement(un,{ratings:t,open:s,crosswalks:n,anchorEl:i.current,onClose:()=>c(!1)}))},mn=(0,le.makeStyles)((e=>({wrapper:{display:"flex",marginLeft:-8,gap:8},button:{minWidth:0,padding:8,fontSize:"14px",lineHeight:"16px",textTransform:"none",color:e.palette.text.secondary},isActive:{color:e.palette.text.primary}}))),gn=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const o=mn(),l=(0,x.useSelector)(v.ZP.selectors.getUserName),i=t.find((e=>{let{user:t}=e;return t===l})),s=[{text:y().text("Has left the practice"),onClick:()=>r(y().text("Has left the practice"))},{text:y().text("Has moved away"),onClick:()=>r(y().text("Has moved away"))},{text:y().text("Has passed away"),onClick:()=>r(y().text("Has passed away"))},{text:y().text("Has retired"),onClick:()=>r(y().text("Has retired"))},{text:y().text("Other"),onClick:()=>r(y().text("Other"))}];return a().createElement("div",{className:o.wrapper},a().createElement(ne.Z,{onClick:n,variant:"text",size:"small",className:V()(o.button,{[o.isActive]:5===(null==i?void 0:i.value)})},"Agree"),a().createElement(Ke.Z,{buttonProps:{endIcon:a().createElement(Rt.Z,null),variant:"text",size:"small",className:V()(o.button,{[o.isActive]:1===(null==i?void 0:i.value)})},buttonContent:1===(null==i?void 0:i.value)?i.comment:"Disagree",menuItems:s,menuId:"disagree-dropdown-menu-button"}))},fn=(0,le.makeStyles)((e=>({wrapper:{padding:"3px 16px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",lineHeight:"16px"},entityLabelContainer:{display:"flex",wordBreak:"break-all",textDecoration:"none"},relationLabel:{color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"8px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 8px 6px 16px",backgroundColor:e.suggested,minWidth:"fit-content"},commentsContainer:{alignSelf:"center",marginTop:"11px","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex",alignItems:"center"}}))),hn=e=>{var t;let{connection:n,loadRelations:o,renderRelationArrowButton:i,acceptRelation:s,ignoreRelation:c,showRating:u}=e;const p=fn(),d=n.suggested,[m,g]=(0,r.useState)(!1),{entity:f,relation:b}=n,y=(0,x.useSelector)(v.ZP.selectors.getMetadata),{entityLabel:E,entityType:w,preparedUri:S,relationLabel:C}=vt(n,y),O=(null==b?void 0:b.ratings)||[],P=(null==b||null===(t=b.object)||void 0===t?void 0:t.crosswalks)||[],k=(0,x.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),N=f&&b&&(0,h.wp9)(h.q7e.RELATION,{entityUri:k,connection:n})||[];return a().createElement("div",{className:V()(p.wrapper,{[p.suggestedWrapper]:d})},a().createElement(_.Z,{display:"flex",minHeight:"44px",className:At.U},a().createElement(_.Z,{display:"flex",alignItems:"center"},a().createElement(_.Z,{display:"flex",alignItems:"center"},i&&i(),a().createElement(dt.Z,{entityType:w,className:p.entityTypeIcon})),a().createElement(_.Z,{display:"flex",flexDirection:"column"},a().createElement(mt.Z,{value:S,className:p.entityLabelContainer},a().createElement(yt,{label:E,entity:f},a().createElement("span",{className:p.entityLabel},E))),C&&a().createElement("span",{className:p.relationLabel},C),!d&&u&&a().createElement(gn,{ratings:O,onAgree:()=>{(0,h.Buf)(null==b?void 0:b.relationUri,{comment:"",value:5}).then(o)},onDisagree:e=>{(0,h.Buf)(null==b?void 0:b.relationUri,{comment:e,value:1}).then(o)}}))),a().createElement("div",{className:p.additionalButtonsWrapper},!(0,l.isEmpty)(N)&&a().createElement(zt.Z,{className:p.commentsContainer,uri:(0,h.gjS)(b),relatedObjectUris:N,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),d&&a().createElement(wt,{acceptRelation:s(n),ignoreRelation:c(n)}),!d&&a().createElement(a().Fragment,null,u&&a().createElement(dn,{ratings:O,crosswalks:P,className:p.ratings}),a().createElement(Gt,{show:m,onToggle:()=>{g((e=>!e))},className:p.showDetailsButton})))),m&&a().createElement(Bt,{connection:n,className:p.relationAttributes}))},bn=e=>{let{className:t,connections:n=[],loadRelations:o,config:l,mainEnityUri:i}=e;const{isComplex:s,content:c,type:u}=l,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=kt(e.inRelations,e.outRelations),a=(0,x.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:o}=e;(0,h.iiD)(n,{relatedEntityUri:o.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{a(v.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:o,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===h.Nsj.IN,u=c?o.entityUri:n,p=c?n:o.entityUri;(0,h.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{a(v.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong"))))}))}}})(c,o,i),m=(0,r.useMemo)((()=>(0,h.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(S.h);return(0,r.useEffect)((()=>{g(m)}),[g,m]),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(Dt,{config:l,connection:e,key:r},(t=>s?a().createElement(hn,{loadRelations:o,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t,showRating:"rating"===u}):a().createElement($t,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};bn.displayName="RelationsList";const yn=bn,vn=(0,le.makeStyles)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"},linearIndicator:{top:"52px"}}))),xn=e=>{let{isLoading:t,config:n,loadRelations:r,connections:o,total:l,parentEntityUri:i}=e;const s=vn(),{selectors:c}=v.ZP,u=(0,x.useSelector)(c.getEntity),p=(0,x.useSelector)(c.getMode),d=n["text-empty"]||y().text("No data found");return t?a().createElement(L.Z,{className:s.linearIndicator}):n.content&&(0,h.KIu)(p)?a().createElement(Mt,{connections:o,className:s.list,key:null==u?void 0:u.uri,config:n,mode:p,noDataText:d,parentEntityUri:i}):n.content&&l>0?a().createElement(yn,{config:n,loadRelations:r,connections:o,className:s.list,key:null==u?void 0:u.uri,mainEnityUri:u.uri}):a().createElement(G.Z,{className:s.noData},d)},En=(0,le.makeStyles)({container:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:0},content:{display:"flex",flexGrow:1,flexDirection:"column",minHeight:0},pagination:{height:"52px",flexGrow:0,flexShrink:0}}),wn=e=>{let{config:t,className:n}=e;const o=En(),{page:i,setPage:s,rowsPerPage:c,sortOrder:u,sortOption:p,showInactive:d,searchQuery:m,changeSearchQuery:g}=(0,r.useContext)(_e),{selectors:f}=v.ZP,b=(0,x.useSelector)((e=>f.getConnectionsWithDraftsByViewId(e,t.id))),y=(0,x.useSelector)(f.getEntity),E=(0,x.useSelector)((e=>f.getTotalByViewId(e,t.id))),w=(0,x.useSelector)(f.getMode),S=(0,r.useMemo)((()=>({order:u,field:p})),[u,p]);(0,r.useEffect)((()=>{g("")}),[null==y?void 0:y.uri]);const C=(0,r.useMemo)((()=>(e=>{const t=h.wSh.fromFalsy(e).map(h.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new h.MEy).addClause(t).build()})(m)),[m]),{isLoading:O,reload:P}=(0,ze.a)({sorting:S,filter:C,page:i,rowsPerPage:c,config:t,entity:y,relationActivityFilter:d?h.Ng6.ALL:h.Ng6.ACTIVE_ONLY,mode:w}),k=(0,r.useMemo)((()=>(0,h.Px$)(b)),[b]),N=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,l.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return(0,Ve.I)(t.id),a().createElement(Ue.u.Provider,{value:y},a().createElement(He.X.Provider,{value:k},a().createElement(B.Z,{className:n},a().createElement("div",{className:o.container},a().createElement(Je.Provider,{value:N},a().createElement(st,{title:t.caption,total:E})),a().createElement("div",{className:o.content},a().createElement(xn,{isLoading:O,config:t,loadRelations:P,connections:b,total:E}),E>c&&a().createElement(q.Z,{classes:{root:o.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:c,page:i,onChangePage:s}))))))};wn.displayName="RelationsView";const Sn=a().createContext(null);Sn.displayName="TableAttributeContext";var Cn=n(17569),On=n(75975),Pn=n(79573);function kn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Nn(e,t,n[t])}))}return e}function Nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zn="CHANGE_SEARCH_QUERY",Rn=kn({},On.ZP.actions,{changeSearchQuery:(0,Pn.zD)(Zn)}),Tn=(e,t)=>t.type===Zn?kn({},e,{searchQuery:t.payload,page:0}):On.ZP.reducer(e,t);var jn=n(92332),In=n(25843);function Dn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ln(e,t,n[t])}))}return e}function Ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Mn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},An=(0,le.makeStyles)((()=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},rowCell:{fontSize:"13px",overflow:"hidden"},blobWrapper:{position:"relative",overflowY:"auto",overflowX:"hidden",whiteSpace:"pre",maxHeight:"100px",boxSizing:"border-box",padding:"15px 25px 0 25px"},defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"15px 25px 0 25px"},updateAttribute:Dn({padding:"0 4px",marginLeft:"-4px"},h.zXF[h.Y1q.updateAttribute]),insertAttribute:Dn({},h.zXF[h.Y1q.insertAttribute]),deleteAttribute:Dn({padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},h.zXF[h.Y1q.deleteAttribute]),description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > div":Mn}}))),zn=(0,In.Z)((e=>{const t=An(),{description:n}=(null==e?void 0:e.headCellData)||{};return a().createElement("div",{className:t.headCell},a().createElement(jn.default,e),a().createElement($.Z,{description:n,className:t.description}))}));var Vn=n(67586),Un=n(40007);const Hn=e=>{let{value:t,historyClassName:n}=e;const r=An();return a().createElement("div",{className:r.blobWrapper,onScroll:Pn.UW},a().createElement("span",{className:r[n]},t))},Fn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const o=An(),{value:i,uri:s}=t,{appearance:c}=(0,r.useContext)(T.m),u=(0,l.pipe)(h.IFm,h.o_F)(s,c);if(n.type===h.oS0.TYPE_BLOB)return a().createElement(Hn,{value:i,historyClassName:u});{const e=a().createElement(Vn.Z,{value:i,dataTypeDefinition:n});return a().createElement(Un.Z,{value:e},a().createElement("div",{className:o.defaultWrapper},a().createElement("span",{className:o[u]},e)))}};function Wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bn=(e,t)=>{const{uri:n,label:r,children:a,name:o,description:i}=e;return(0,l.reject)(l.isNil,{id:(0,h.Tde)(n,t),label:r,description:i,dataTypeDefinition:(0,h.PFL)(e),children:null==a?void 0:a.map((e=>Bn(e,t.concat({name:o}))))})},qn=(0,l.pipe)((0,l.split)("."),(0,l.slice)(2,1/0)),_n=e=>{if((0,h.vZp)(e)){const t=qn(e);return t.length>1?t.slice(0,-1):null}return null},Gn=(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){Wn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:_n(e.id),headCellRenderer:zn,rowCellValueRenderer:Fn})));var Yn=n(79575);function Qn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $n=n(33903),Xn=n(87825);const Kn=(0,le.makeStyles)((()=>({header:{padding:"0 12px 0 16px"},rightMenuItems:{display:"flex",flex:"1 0 auto",justifyContent:"flex-end",alignItems:"center"}}))),Jn=e=>{let{title:t}=e;const n=Kn(),o=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),{attributeType:l,searchQuery:i,setSearchQuery:s,filters:c,onToggleFilters:u,allColumnsData:p,visibleColumns:d,onChangeColumns:m}=(0,r.useContext)(Sn),g=o&&(null==l?void 0:l.required);return a().createElement(Y.Z,{title:t,className:n.header},g&&a().createElement(Q.Z,null),a().createElement($.Z,{description:null==l?void 0:l.description}),a().createElement("div",{className:n.rightMenuItems},a().createElement(ee.i,{query:i,onChange:s}),a().createElement($n.Z,{enabled:!!c,onClick:u}),a().createElement(K.Z,{height:24,margin:4}),a().createElement(Xn.Z,{columnsData:p,selectedColumns:d,onChangeColumns:m})))};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=(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=An();return a().createElement("div",{className:V()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,er({key:t,value:e},l)))))}));var nr=n(47081),rr=n(45108);const ar=(0,le.makeStyles)((()=>({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)",marginBottom:"15px"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}}))),or=e=>{let{onEdit:t,onRemove:n}=e;return a().createElement(a().Fragment,null,t&&a().createElement(We.k,{tooltipTitle:y().text("Edit"),icon:ut.Z,size:"L",onClick:t}),n&&a().createElement(We.k,{tooltipTitle:y().text("Remove"),icon:pt.Z,size:"L",onClick:n}))};function lr(){return lr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lr.apply(this,arguments)}const ir=e=>{let{columnsData:t,values:n,sorting:o,onSort:i,filters:s,onFilter:c,config:u,onEdit:p,onDeleteAttribute:d,deletedUris:m}=e;const g=(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,h.xIV)(e))(t))(qn(e),t))(r,e),t)}),{}),(0,l.assoc)("value",e))(t))))(n,t)),[n,t]),f=(0,r.useMemo)((()=>Gn(t)),[t]),b=ar(),y=(0,x.useSelector)(v.ZP.selectors.getMode),E=(0,h.KIu)(y),w=(0,x.useSelector)(v.ZP.selectors.getMetadata),S=(0,x.useSelector)(v.ZP.selectors.getEntityUri),C=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,S)||{})),{attributeType:O}=(0,r.useContext)(Sn),P=(0,r.useCallback)((e=>a().createElement(tr,lr({},e,{isSorted:!!o&&o.field===e.columnData.id}))),[o]),[k,N]=(0,r.useState)(null),{canUpdate:Z,canDelete:R}=(0,nr.l)(),T=(0,r.useMemo)((()=>"number"!=typeof k||!E||m.includes((0,l.pipe)((0,l.path)([k]),(0,l.prop)("uri"))(n))),[k,m,n,E]),j="number"==typeof k&&(I=(0,l.path)([k],n),R(u)&&(0,h.xv5)({attributeType:O,mode:y,attributeValue:I,metadata:w,isReltioCrosswalk:(0,h.KVV)(C.crosswalks,I)}));var I;const D="number"==typeof k&&(e=>Z(u)&&(0,h.yv0)({attributeType:O,mode:y,attributeValue:e,isReltioCrosswalk:(0,h.KVV)(C.crosswalks,e)}))((0,l.path)([k],n)),L=(0,r.useCallback)((()=>{const e=(0,l.path)([k],n);D&&p(e)}),[p,k,n,D]),M=(0,r.useCallback)((()=>{const e=(0,l.path)([k],n);if(!j)return;const t={parentUri:S,attributeType:O,uri:e.uri,value:e};d(t),N(null)}),[k,n,d,j,O,S]),A=T||!j&&!D?void 0:a().createElement(or,{onEdit:D?L:void 0,onRemove:j?M:void 0}),z=(0,r.useMemo)((()=>({deletedUris:m})),[m]);return a().createElement("div",{className:b.tableContainer},a().createElement(rr.Z,{autosizing:!0,maxHeight:477,columnsData:f,rowsData:g,sorting:o,onSort:i,filters:s,onFilter:c,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:N,hoverRowIndex:k,hoveredRowRightContent:A,context:z,classes:{hoveredRowRightContentWrapper:b["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:b["row-cell__buttons-container"]}}))};function sr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){cr(e,t,n[t])}))}return e}function cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ur=[],pr=(0,le.makeStyles)((()=>({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 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 mr=e=>{let{onChangeAttribute:t,onCancel:n,onApply:o,onDeleteAttribute:i,hasChanges:s,attributeValue:c}=e;const u=pr(),p=(0,x.useDispatch)(),m=(0,r.useContext)(d.m),{attributeType:g}=(0,r.useContext)(Sn),f=(0,x.useSelector)(v.ZP.selectors.getEntityUri),b=(0,x.useSelector)(v.ZP.selectors.getMode),E=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,f)||{})),w=(0,h.YkG)(g)&&(0,h.ZiX)((0,h.bwT)(c)),S=(0,x.useSelector)((e=>w?v.ZP.selectors.getModifiedEntities(e):void 0)),C=(0,x.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,f,g))),O=(0,h.ZiX)(f),P=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.addAttributes,p)(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){dr(e,t,n[t])}))}return e}({},e,{viewId:m}))))),[m,p]),k=(0,r.useCallback)((0,l.pipe)(v.N5.errors.actions.errorDeactivated,p),[p]);return a().createElement(a().Fragment,null,a().createElement(he.Z,{expanded:!0,attributeValue:c,showEmptyEditors:O,onDeleteAttribute:i,onDeactivateError:k,onChangeAttribute:t,onAddAttributes:P,mode:b,crosswalks:E.crosswalks,errors:C,attributeType:g,ownError:(0,h.ADq)(c,null,g.uri,C)}),a().createElement("div",{className:u.actionButtons},a().createElement(ne.Z,{onClick:()=>n(c)},y().text("Cancel")),a().createElement(ne.Z,{color:"primary",disabled:!s,onClick:()=>o(c,S),"data-reltio-id":"table-attribute-view-apply-button"},y().text("Apply"))))};var gr=n(98001);const fr=e=>(null==e?void 0:e.type)===h.NIO.missed,hr=(0,l.curry)(((e,t)=>e.find((0,l.pipe)((0,l.prop)("uri"),(0,l.either)((0,h.sOy)(t.parentUri),(0,l.equals)(t.uri)))))),br=(0,le.makeStyles)((()=>({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"}}))),yr=e=>{let{config:t,editingValues:n,modifiedValues:o,onChangeAttribute:i,onDeleteAttribute:s,onAdd:c,onCancel:u,onApply:p,onStartEditing:d,onReset:m,checkHasChanges:g,highlightedError:f,highlightedAttributeError:b}=e;const E=br(),{attributeType:w}=(0,r.useContext)(Sn),S=(0,x.useSelector)(v.ZP.selectors.getMode),{canCreate:C}=(0,nr.l)();(e=>{let{onStartEditing:t,modifiedValues:n,highlightedError:a,highlightedAttributeError:o}=e;const{attributeType:i}=(0,r.useContext)(Sn),s=(0,x.useSelector)(v.ZP.selectors.getEntityUri),c=(0,x.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,s,i))),u=(0,r.useRef)(!0),p=(0,gr.u)(),d=(0,r.useMemo)((()=>c.find((0,l.both)(fr,(e=>(0,h.Wah)(e,s,i.uri))))),[c,s,i.uri]);(0,r.useEffect)((()=>{if(null!=i&&i.required&&1===n.length&&(0,h.ZiX)(n[0].uri))return t(n[0])}),[i]),(0,r.useEffect)((()=>{d&&1===n.length&&t(n[0])}),[d]),(0,r.useEffect)((()=>{u.current&&c.length&&((0,l.pipe)((0,l.map)(hr(n)),(0,l.reject)(l.isNil),(0,l.forEach)(t))(c),u.current=!1)}),[c]),(0,r.useEffect)((()=>{fr(a)&&1===n.length&&t(n[0])}),[a]),(0,r.useEffect)((()=>{if(o){const e=hr(n,o);e&&t(e)}}),[o]),(0,r.useEffect)((()=>{const e=p((e=>{e.type===v.N5.constants.ProfileActions.SAVE_PROFILE&&(u.current=!0)}));return()=>e()}),[p])})({onStartEditing:d,modifiedValues:o,highlightedError:f,highlightedAttributeError:b});const O=C(t)&&w&&(0,h.Vg3)({attributeType:w,mode:S})&&!n.length;return(0,r.useEffect)((()=>()=>m()),[m]),a().createElement("div",{className:E.editor},O&&a().createElement(ne.Z,{color:"primary",onClick:c,className:E.addButton,"data-reltio-id":"table-attribute-view-add-button"},a().createElement(pe.Z,{classes:{root:E.icon}}),a().createElement("div",{className:E.buttonLabel},y().text("Add"))),n.map((e=>a().createElement(mr,{key:e.uri,attributeValue:e,onChangeAttribute:i,onDeleteAttribute:s,onCancel:u,onApply:p,hasChanges:g(e)}))))},vr=(0,be.l)(I.NY,((e,t)=>{let{entityUri:n,attributeType:r}=t;const{element:a,type:o}=e||{},l=(0,I.Ie)(o),i=l&&(0,h.Wah)(a,n,r.uri);return{highlightedError:i?e:null,highlightedAttributeError:a&&l&&!i&&(0,h.nsY)(r,a)&&(0,h.vyG)(n,a)?e:null}}),(e=>{let{config:t,entityUri:n,highlightedError:o,highlightedAttributeError:i}=e;const s=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),c=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,n)||{})),{values:u,visibleColumns:p,onFilter:m,onSort:g,filters:f,sorting:b,allColumnsData:y}=(0,r.useContext)(Sn),{onDeleteAttribute:E,onStartEditing:w,onChangeAttribute:S,onAdd:C,onCancel:O,onApply:P,onReset:k,checkHasChanges:N,modifiedValues:Z,editingValues:R,deletedUris:T}=(()=>{const[e,t]=(0,r.useState)(),[n,a]=(0,r.useState)([]),o=(0,x.useDispatch)(),i=(0,x.useSelector)(v.ZP.selectors.getMode),s=(0,x.useSelector)(v.ZP.selectors.getEntityUri),c=(0,x.useSelector)(v.ZP.selectors.getMetadata),u=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,s)||{})),p=(0,r.useContext)(d.m),{attributeType:m,values:g}=(0,r.useContext)(Sn),f=(0,h.KIu)(i),b=(0,h.xy8)(m),y=(0,l.pathOr)(ur,[b,null==m?void 0:m.name],u),E=(0,r.useMemo)((()=>(0,h.gjI)({parentUri:s,attributeType:m})),[s,m]),w=(0,h.O27)(y),S=m.required&&w,C=(0,r.useMemo)((()=>S?[E]:y),[E,y,S]),O=(0,r.useMemo)((()=>[...C.filter((0,l.pipe)((0,l.prop)("uri"),(0,l.both)(h.ZiX,(0,l.pipe)((0,l.equals)(e),l.not)))),...(0,l.map)((e=>C.find((0,l.propEq)("uri",e.uri))||e))(g)].map((e=>{var t;return null!==(t=n.find((0,l.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[C,n,e,g]),P=(0,r.useMemo)((()=>(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.filter)((e=>!C.find((0,l.propEq)("uri",e)))))(f?g:[])),[C,g,f]),k=C.filter((t=>{let{uri:r}=t;return r===e||n.find((0,l.propEq)("uri",r))})),N=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.modifyAttribute,o)(sr({},e,{viewId:p}))),[p,o]),Z=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.removeAttribute,o)(sr({},e,{viewId:p}))),[p,o]),R=(0,r.useCallback)((()=>{const e=(0,h.gjI)({parentUri:s,attributeType:m});t(e.uri),N({value:sr({},e,{value:(0,h.GPx)({attributeTypes:(0,h.BoX)(c,m),parentUri:e.uri,mode:i,metadata:c})}),uri:e.uri,attributeType:m})}),[s,m,c,i,N]),T=(0,r.useCallback)((e=>{a((t=>t.find((0,l.propEq)("uri",e.uri))?t:[...t,e]))}),[a]),j=(0,r.useCallback)((e=>{const r=n.find((0,l.propEq)("uri",e.uri));if(r){const t={attributeType:m,value:r,uri:e.uri};a((e=>(0,l.without)([r],e))),w||N(t)}else{const n={value:e,attributeType:m,uri:e.uri};t(null),Z(n)}o(v.N5.errors.actions.errorsSet([]))}),[Z,N,a,w,n,m,o]),I=(0,r.useCallback)(((e,t)=>{const n=(0,h.q5j)(c,m,e,t).map((n=>sr({},n,{path:(0,h.Z9i)({entityUri:s,metadata:c,entitiesMap:t||{[s]:(0,h.PeS)(m,e)}},n.uri||n.parentUri)})));return o(v.N5.errors.actions.errorsSet(n)),0===n.length}),[o,s,m,c]),D=(0,r.useCallback)(((e,n)=>{I(e,n)&&(t(null),a((t=>{const n=t.find((0,l.propEq)("uri",e.uri));return n?(0,l.without)([n],t):t})))}),[a,t,I]),L=(0,r.useCallback)((()=>{a([]),t(null)}),[]);return{checkHasChanges:e=>n.find((0,l.propEq)("uri",e.uri))!==e,onChangeAttribute:N,onDeleteAttribute:Z,onAdd:R,onCancel:j,onApply:D,onStartEditing:T,onReset:L,modifiedValues:O,editingValues:k,deletedUris:P}})(),{ref:j,errorClassName:I}=(0,me.B)({highlightedError:o,isSimple:!0}),D=s?Z:u,L=(0,r.useMemo)((()=>p.map((e=>y.find((0,l.propEq)("id",e))))),[p,y]);return a().createElement("div",{ref:j,className:I},s&&!(0,l.isEmpty)(c)&&a().createElement(yr,{config:t,editingValues:R,modifiedValues:Z,onChangeAttribute:S,onDeleteAttribute:E,onAdd:C,onReset:k,onCancel:O,onApply:P,onStartEditing:w,checkHasChanges:N,highlightedError:null==o?void 0:o.element,highlightedAttributeError:null==i?void 0:i.element}),L.length>0&&a().createElement(ir,{columnsData:L,config:t,values:D,filters:f,onFilter:m,sorting:b,onSort:g,onEdit:w,onDeleteAttribute:E,deletedUris:T}))})),xr=(0,le.makeStyles)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",overflow:"hidden"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"}}))),Er=15,wr=e=>{let{config:t,className:n}=e;const{caption:o,max:l=Er}=t,i=xr(),s=(0,x.useSelector)(v.ZP.selectors.getEntityUri),{totalVisibleValues:c,attributeType:u,showTable:p,hasPaging:d,isLoading:m,page:g,setPage:f}=(0,r.useContext)(Sn);return a().createElement(B.Z,{className:V()(i.root,n)},p?a().createElement(a().Fragment,null,a().createElement(Jn,{title:o}),a().createElement("div",{className:i.content},a().createElement(vr,{config:t,attributeType:u,entityUri:s}),d&&a().createElement(q.Z,{count:c,rowsPerPageOptions:[],rowsPerPage:l,page:g,onChangePage:f}),m&&a().createElement(L.Z,null))):a().createElement(a().Fragment,null,a().createElement(Y.Z,{title:o,className:i.header},a().createElement($.Z,{description:null==u?void 0:u.description})),a().createElement(G.Z,{className:i.noData},y().text("No data"))))};var Sr=n(37163);function Cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Or=0;const Pr=()=>Or++,kr=e=>{const t={children:[],nodeId:Pr()};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:Pr(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),a.children.push(s),a=s}}return t.children};var Nr=n(683);const Zr=(0,le.makeStyles)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.primary.main,lineHeight:"15px"},wrapper:{width:"100%"},hidePageSelectorWhenSmall:{"@media (min-width: 450px)":{"& .MuiInputBase-root":{display:"none"},"& .MuiTablePagination-selectLabel":{display:"none"}}},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"},errorMessage:{fontSize:"13px",margin:"0 16px 0",lineHeight:"1.4",color:e.palette.text.secondary},linearIndicator:{top:"42px"}})));var Rr=n(1242);const Tr=a().createContext(null),jr=e=>{e.target.src=Rr},Ir=e=>{let{node:t}=e;const{entity:{uri:n},nodeId:o}=t,l=(0,h.idV)(t.entity.label),i=Zr(),s=(0,x.useSelector)(v.ZP.selectors.getAbsoluteImagePath),c=(0,x.useSelector)(v.ZP.selectors.getMetadata),{uri:u}=(0,x.useSelector)(v.ZP.selectors.getEntity),[p,d]=(0,r.useState)(),m=(0,r.useContext)(Tr),g=n===u,f=(0,h.nt9)(c,t.entity.type),b=f?(0,h.VD3)(c,f,"typeGraphIcon"):null,y=b&&(0,h.vPL)(s,b);return a().createElement("div",{className:i.wrapper,"data-node-id":o},a().createElement("div",{ref:d,className:i.container},a().createElement(rn.Z,{alt:"Node icon",className:V()(i.avatar),src:y||Rr,onError:jr}),a().createElement(Nr.Z,{isSelected:g,title:l,entityUri:n,viewId:m.id,anchorEl:p})))},Dr=((0,r.memo)(Ir),e=>{let{node:t}=e;return t.nodeId}),Lr=(0,le.makeStyles)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block","&:after":{content:"''",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)",width:"1px",left:"50%",bottom:"0",height:`calc(100% - ${Vr.rowHeight}px)`}},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"calc(50% - 1px)",top:0,height:Vr.rowHeight/2+"px",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:Vr.rowHeight/2+"px",left:"calc(50% - 1px)",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},rootNode:{padding:"0 24px 0 13px"},longRootNode:{padding:"0 24px 0 5px"},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},nodeRootLongContent:{paddingLeft:"20px"},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 Mr(){return Mr=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},Mr.apply(this,arguments)}function Ar(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zr(){return zr=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},zr.apply(this,arguments)}const Vr={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"]),d=i,m=r&&!o.root&&o.children&&o.children.length>0,g=Lr();return a().createElement("div",zr({style:{height:"100%"}},p,{key:o.nodeId}),m&&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},m&&a().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:o,path:s,treeIndex:c})}},a().createElement("div",{"aria-label":o.expanded?"Collapse":"Expand",className:V()(g.button,o.expanded?g.expandedButton:g.collapsedButton)})),a().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:o,path:s,treeIndex:c}):d))))},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=Lr(),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 d=i.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,h=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ar(e,t,n[t])}))}return e}({},s.style,{width:f}),b=(null==i?void 0:i.rootIndex)>99&&i.root;return a().createElement("div",Mr({},s,{className:V()(c.node,{[c.longRootNode]:b,[c.rootNode]:i.root&&!b}),style:h}),p,a().createElement("div",{className:V()(c.nodeContent,{[c.nodeRootLongContent]:b}),style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function Ur(){return Ur=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},Ur.apply(this,arguments)}const Hr=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",Ur({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"})))},Fr=e=>{let{title:t,onGraphOpen:n}=e;const o=Zr(),{showNavigateToGraph:l}=(0,r.useContext)(O.Y);return a().createElement(Y.Z,{title:t,className:o.header},l&&a().createElement("div",{className:o.buttonsContainer},a().createElement(We.k,{className:o.button,tooltipTitle:y().text("Show Graph"),icon:Hr,onClick:n,size:"L"})))},Wr=e=>Dr({node:e});function Br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qr=[10,25];var _r=n(52241),Gr=n(69089);const Yr=(0,le.makeStyles)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function Qr(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){$r(e,t,n[t])}))}return e}function $r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xr=e=>{let{config:t,className:n}=e;const o=(0,r.useRef)(),i=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{height:u,width:p,tooltip:d}=t,{html:m,visible:g,tooltip:f,customStyles:h,popup:b}=(0,_r.E)(t),y=Yr(),v=f||d;(0,r.useEffect)((()=>{o.current&&m&&(o.current.innerHTML="",Array.from(m.childNodes).forEach((e=>{o.current.appendChild(e)})))}),[m]),(0,r.useEffect)((()=>{c(!!b)}),[b]),(0,r.useEffect)((()=>{s&&i.current&&(i.current.innerHTML="",b&&Array.from(b.childNodes).forEach((e=>{i.current.appendChild(e)})))}),[s,b]);const x=(0,l.reject)(l.isNil,{width:p,height:u});return g?a().createElement("div",{className:y.bodyWrapper},a().createElement(Gr.Z,{ref:i,open:!!b}),a().createElement(ft.Z,{title:v||""},a().createElement("div",{ref:o,style:Qr({},x,h),className:V()(y.root,n)}))):null};var Kr=n(7882);const Jr=e=>{const t=t=>a().createElement(Kr.Z,{error:a().createElement(k.ZP,{LogoRenderer:k.B9.ERROR,text:"",secondaryText:y().text("Something went wrong"),variant:k.tC.small})},a().createElement(e,t));return t.displayName="WithErrorBoundary",t},ea=(0,le.makeStyles)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var ta=n(25744),na=n(63436),ra=n(40702),aa=n(40435);const oa=(0,l.pipe)((0,l.path)(["point","lat"]),(0,l.both)((0,l.gt)(90),(0,l.lt)(-90))),la=(0,le.makeStyles)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var ia=n(61347),sa=n(66078);const ca=(0,le.makeStyles)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),ua=ca,pa=e=>{let{totalImages:t}=e;const n=ua(),r=t>1?y().text("photos"):y().text("photo");return a().createElement(G.Z,{variant:"caption",className:n.caption},`${t} ${r}`)};function da(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){ma(e,t,n[t])}))}return e}function ma(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ga=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:o}=e;const i=(0,x.useDispatch)(),s=(0,x.useSelector)(v.ZP.selectors.getEntity),c=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,s.uri)||{})),u=(0,l.pathOr)([],["attributes",n.name],c),p=t.id;return a().createElement(a().Fragment,null,a().createElement(sa.Z,{attributeValues:u,attributeType:n,onDeleteAttribute:e=>(0,l.pipe)(v.N5.actions.removeAttribute,i)(da({},e,{viewId:p})),parentUri:c.uri,onChangeAttribute:e=>(0,l.pipe)(v.N5.actions.modifyAttribute,i)(da({},e,{viewId:p})),imageSize:ba,paging:r,requestNextPageOfAttributeValues:o}),a().createElement(pa,{totalImages:u.length}))},fa=(0,le.makeStyles)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),ha=fa,ba={imageMargin:4,imageWidth:162,imageHeight:162};var ya=n(55485),va=n(23044),xa=n(20200),Ea=n(25601),wa=n(84236),Sa=n(48376);function Ca(){return Ca=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ca.apply(this,arguments)}const Oa=e=>{let{config:t,match:n,onStartRequest:o,onFinishRequest:l}=e;const i=(0,x.useDispatch)(),s=(0,x.useSelector)(v.ZP.selectors.getMetadata),c=(0,x.useSelector)(v.ZP.selectors.getEntity),{canMerge:u,canMark:p}=(0,h.hXd)(s,t,n.object,c,n.matchRules),m=(0,r.useMemo)((()=>[n.object]),[n.object]),g={entity:c,entities:m,mode:Ea.N.iconButton,onStartRequest:o},f=(0,r.useContext)(d.m),b=(0,r.useCallback)((()=>{l(),i(v.N5.entity.actions.loadEntity({viewId:f,uri:c.uri}))}),[i,c.uri,l,f]);return a().createElement(a().Fragment,null,u&&a().createElement(wa.H,Ca({},g,{onFinishRequest:b})),p&&a().createElement(Sa.i,Ca({},g,{onFinishRequest:l})))},Pa=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:o,onStartRequest:l}=e;const i=(0,x.useSelector)(v.ZP.selectors.getMetadata),s=(0,x.useSelector)(v.ZP.selectors.getEntity);return a().createElement(xa.M,{match:r,entity:s,entitiesMap:n,metadata:i,className:At.U},a().createElement(zt.Z,{uri:(0,h.E_P)(s.uri,r.object.uri),relatedObjectUris:(0,h.wp9)(h.q7e.POTENTIAL_MATCH,{entityUri:s.uri,matchEntityUri:r.object.uri}),objectType:h.q7e.POTENTIAL_MATCH}),a().createElement(Oa,{match:r,config:t,onStartRequest:l,onFinishRequest:o}))},ka=(0,le.makeStyles)((e=>({root:{display:"flex",flexDirection:"column",minHeight:"52px"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}}))),Na={showTransitiveMatches:!0,showInactiveEntities:!1},Za={order:h.KM9.asc,field:"score"};var Ra;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Ra||(Ra={}));const Ta=e=>(0,l.pipe)(Jr,U.Z)(e),ja=Ta((e=>{let{className:t}=e;const n=ea();return a().createElement(B.Z,{className:V()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),Ia=Ta((e=>{let{className:t,config:n}=e;return a().createElement(H.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Da=Ta((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=Me(e,s),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){Ae(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:o,page:a,toggleShowInactive:u,showInactive:l},c)})(n);return a().createElement(F.Provider,{value:o},a().createElement(je,{config:n,className:t}))})),La=Ta((e=>{let{config:t,className:n}=e;const o=(e=>{var t;const{attributeUri:n}=e,a=(0,x.useSelector)(v.ZP.selectors.getMetadata),o=(0,r.useMemo)((()=>(0,h.zeJ)(a,n)),[a,n]),i=(0,r.useMemo)((()=>o?((e,t)=>(0,l.pipe)(((e,t)=>(0,h.WN0)(e,t)),(0,l.map)((e=>Bn(e,[t]))),(0,l.chain)(h.HQx),(0,l.uniqBy)((0,l.prop)("id")))(e,t))(a,o):[]),[a,o]),s=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:i.filter((0,l.pipe)((0,l.prop)("dataTypeDefinition"),h.YkM,l.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[i]),[c,u]=(0,r.useReducer)(Tn,s),{searchQuery:p,filters:d,sorting:m,page:g}=c,f=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),b=(0,r.useMemo)((()=>{const e=((e,t)=>h.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([]))(i,d);return e.length?e:null}),[d,i]),y=(0,r.useMemo)((()=>(0,l.reject)(l.isNil,{filters:b,page:g,sorting:m,searchQuery:p})),[b,g,m,p]),{changeSearchQuery:E,changePage:w,toggleSort:S,changeFilter:C,toggleFilters:O,changeColumns:P}=(0,Cn.o)({actions:Rn,dispatch:u}),k=Me(e,y);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){Qn(e,t,n[t])}))}return e}({},c,{setSearchQuery:E,setPage:w,onSort:S,onFilter:C,onToggleFilters:O,onChangeColumns:P,showTable:Boolean(((null==k||null===(t=k.values)||void 0===t?void 0:t.length)||b||p||f)&&o&&!o.hidden),allColumnsData:i},k)})(t);return a().createElement(Sn.Provider,{value:o},t&&a().createElement(wr,{config:t,className:n}))})),Ma=Ta((e=>{let{config:t,className:n}=e;const o=(0,x.useSelector)(v.ZP.selectors.getMetadata),i=(0,r.useMemo)((()=>(0,h.fS6)(o,t)),[o,t]),s=(e=>{var t;const n=(0,r.useMemo)((()=>(0,l.pipe)(Object.entries,(0,l.map)((e=>{let[t,n]=e;return{value:t,label:n}})),(0,l.unless)((e=>(0,h.O27)(e)||e.some((0,l.propEq)("value","name"))),(0,l.append)({label:y().text("Name"),value:"name"})))(e.sortOptions||{})),[e.sortOptions]),a=Number(e.max)||15,[o,i]=(0,r.useState)(0),[s,c]=(0,r.useState)(e.sortOrder||"asc"),[u,p]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[d,m]=(0,r.useState)(""),[g,f]=(0,r.useState)(!1),b=(0,r.useCallback)((()=>{i(0),f((e=>!e))}),[]),v=(0,r.useCallback)((()=>{i(0),c((e=>"asc"===e?"desc":"asc"))}),[]),x=(0,r.useCallback)((e=>{i(0),p(e)}),[]);return{searchQuery:d,changeSearchQuery:(0,r.useCallback)((e=>{i(0),m(e)}),[]),sortOrder:s,toggleSortOrder:v,sortOption:u,changeSortOption:x,sortOptions:n,page:o,setPage:i,rowsPerPage:a,showInactive:g,toggleShowInactive:b}})(i);return a().createElement(_e.Provider,{value:s},a().createElement(wn,{config:i,className:n}))})),Aa=Ta(Xr),za=Ta((e=>{let{config:t,className:n}=e;const{id:o,caption:i,graph:s,_showNavigateToGraph:u}=t,p=null==s?void 0:s.type,d=Zr(),m=(0,x.useDispatch)(),g=(0,x.useSelector)(v.ZP.selectors.getEntityUri),{treeData:f,setTreeData:b,errorMessage:E,isLoading:w,rowsPerPage:S,count:C,onChangePage:P,onChangeRowsPerPage:k,page:N}=((e,t)=>{const n=(0,Ie._)(),[a,o]=(0,r.useState)(!1),[i,s]=(0,r.useState)([]),[c,u]=(0,r.useState)(null),[p,d]=(0,r.useState)(25),[m,g]=(0,r.useState)([]),[f,b]=(0,r.useState)(0);(0,r.useEffect)((()=>{g(i.slice(f*p,f*p+p))}),[f,p,i]),(0,r.useEffect)((()=>{b(0),d(25)}),[i]);const E=(0,r.useCallback)((e=>{d(e),b(0)}),[d]),w=(0,x.useSelector)(v.ZP.selectors.getEntity);return(0,De.D)((()=>{const e=i.map(((e,t)=>({tree:e,index:t}))).reduce(((e,t)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Cr(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,h.XTh)((0,l.pick)(["uri","label","secondaryLabel","type"],w),e);s(t.map((0,l.prop)("root")))}),[null==w?void 0:w.updatedTime]),(0,r.useEffect)((()=>((0,h.ZiX)(e)||(u(null),o(!0),n((0,h.RFJ)({uri:e,graphUri:t})).then(kr).then(s).catch((e=>{console.warn(e),u((0,h.xU7)(e,y().text("Something went wrong")))})).finally((()=>{o(!1)}))),()=>{s([])})),[e,t,n]),{isLoading:a,treeData:m,setTreeData:s,errorMessage:c,rowsPerPage:p,count:i.length,onChangePage:b,onChangeRowsPerPage:E,page:f}})(g,p),{onResize:Z,getRowHeight:R,clearHeightsCache:T}=(()=>{const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)((()=>{t({})}),[]);return{onResize:(0,r.useCallback)((e=>(n,r)=>{t((t=>t[Wr(e)]!==r?(0,l.assoc)(Wr(e),r,t):t))}),[]),getRowHeight:(0,r.useCallback)((t=>{let{node:n}=t;return e[Wr(n)]?Math.max(e[Wr(n)],Vr.rowHeight):Vr.rowHeight}),[e]),clearHeightsCache:n}})(),j=(0,r.useContext)(O.Y),I=void 0!==u?u:j.showNavigateToGraph,D=(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Br(e,t,n[t])}))}return e}({},j,{showNavigateToGraph:I})),[I,j]),M=(0,r.useCallback)((()=>{m(v.ui.actions.openGraph({viewId:o,graphType:p,entityUri:g}))}),[m,o,p,g]),A=(0,r.useCallback)((e=>({title:a().createElement(c.Z,{handleHeight:!0,refreshMode:"debounce",refreshRate:100,onResize:Z(e.node)},a().createElement(Ir,{node:e.node}))})),[Z]);return(0,r.useEffect)((()=>{T()}),[T,g]),a().createElement(O.Y.Provider,{value:D},a().createElement(B.Z,{className:n},a().createElement(Fr,{onGraphOpen:M,title:i}),w&&a().createElement(L.Z,{className:d.linearIndicator}),a().createElement(Tr.Provider,{value:t},a().createElement("div",{className:d.treeContainer},a().createElement("div",{className:d.tree},E?a().createElement(G.Z,{className:d.errorMessage},E):a().createElement(a().Fragment,null,a().createElement(Sr.ZP,{isVirtualized:!1,treeData:f,canDrag:!1,theme:Vr,generateNodeProps:A,onChange:b,getNodeKey:Dr,rowHeight:R})))),C>qr[1]?a().createElement(q.Z,{classes:{root:d.hidePageSelectorWhenSmall},count:C,onChangePage:P,page:N,rowsPerPage:S,onChangeRowsPerPage:k,rowsPerPageOptions:qr,labelRowsPerPage:y().text("Roots per page:")}):null)))})),Va=Ta((e=>{let{config:t,className:n}=e;const o=ka(),i=(0,x.useSelector)(v.ZP.selectors.getEntity),s=(0,h.wwR)(i),[c,u]=(0,r.useState)(!1),p=(0,r.useCallback)((()=>{u(!0)}),[]),m=(0,r.useCallback)((()=>{u(!1)}),[]),{matches:g,entitiesMap:f,loadMatches:b}=(0,va.s)({enabled:!!s,entity:i,options:Na,filter:"",page:0,sorting:Za,rowsPerPage:3,onStartLoading:p,onFinishLoading:m}),E=(0,r.useCallback)((()=>{b()}),[b]),w=(0,x.useDispatch)(),C=(0,r.useContext)(d.m),O=(0,r.useCallback)((()=>{w(v.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:C}))}),[w,C]),P=(0,r.useMemo)((()=>(0,h.NVY)(s,(0,l.map)(h.ev7,g))),[s,g]),{getCommentsCount:k}=(0,r.useContext)(S.h);(0,r.useEffect)((()=>{k(P)}),[k,P]);const N=!(0,l.isEmpty)(g),Z=c?Ra.Loading:(0,l.isEmpty)(g)?Ra.NoData:Ra.Loaded;return a().createElement(He.X.Provider,{value:f},a().createElement(B.Z,{className:V()(o.root,n)},a().createElement(Y.Z,{title:t.caption}),a().createElement("div",{className:o.matchesContainer},Z===Ra.Loading&&a().createElement(L.Z,null),Z===Ra.NoData&&a().createElement(G.Z,{className:o.noData},y().text("No matches found")),Z===Ra.Loaded&&g.map((e=>a().createElement(Pa,{config:t,entitiesMap:f,match:e,onFinishRequest:E,onStartRequest:p,key:e.object.uri})))),N&&a().createElement(a().Fragment,null,a().createElement("div",{className:o.footer},a().createElement(ya.Z,{component:"button",variant:"caption",onClick:O,underline:"none"},y().text("See all"))))))})),Ua=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,91572)).then((e=>({default:Ta(e.HierarchyTreeView)}))))),Ha=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,51317)).then((e=>({default:Ta(e.RelationshipsTableView)}))))),Fa=Ta((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:o,className:l}=e;const i=la(),s=(0,x.useSelector)(v.ZP.selectors.getMetadata),c=(0,x.useSelector)(v.ZP.selectors.getEntity),u=(0,x.useSelector)(v.ZP.selectors.getGoogleMapKey),{markers:p,loading:d}=((e,t,n)=>{const[a,o]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,Ie._)();return(0,r.useEffect)((()=>{i(!0),s((0,h.DBr)(t,[e],n)).then((e=>{o(e.filter(oa))})).catch((()=>{o([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:a,loading:l}})(c,s,u),m=(0,r.useMemo)((()=>a().createElement("div",{className:i.fullHeight},a().createElement(L.Z,null))),[i]),g=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),f=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return u&&a().createElement(B.Z,{className:V()(i.root,l)},d&&a().createElement(L.Z,null),a().createElement(aa.Z,{size:"S",icon:n?na.Z:ta.Z,onClick:()=>o(t.id),className:i.fullscreenBtn}),a().createElement(ra.Z,{loadingElement:m,defaultZoom:1,defaultCenter:g,markers:p,mapContainerClassName:i.fullHeight,mapKey:u,mapOptions:f}))})),Wa=Ta((e=>{let{config:t,className:n}=e;const{attributeUri:o}=t,i=ha(),s=(0,x.useDispatch)(),c=(0,x.useSelector)(v.ZP.selectors.getMode),u=(0,x.useSelector)(v.ZP.selectors.getEntityWithDiff),p=(0,x.useSelector)(v.ZP.selectors.getMetadata),d=o?(0,h.zeJ)(p,o):null,m=t["text-empty"]||y().text("No data found"),g=(0,r.useCallback)((e=>s(v.N5.actions.requestNextPageOfAttributeValues(e))),[s]);return a().createElement(B.Z,{className:n},a().createElement(Y.Z,{title:t.caption},a().createElement($.Z,{description:null==d?void 0:d.description})),a().createElement("div",{className:i.container},(()=>{if(d){const e=(0,l.pathOr)([],["attributes",d.name],u),n=(0,l.path)(["attributes","paging",o],u),r=e.length;if((0,h.KIu)(c)){const e={attributeType:d,config:t,paging:n,requestNextPageOfAttributeValues:g};return a().createElement(ga,e)}if(r>0){const t={attributeValues:e,attributeType:d,imageSize:ba,paging:n,parentUri:u.uri,requestNextPageOfAttributeValues:g};return a().createElement(a().Fragment,null,a().createElement(ia.Z,t),a().createElement(pa,{totalImages:r}))}}return a().createElement(G.Z,{className:i.noData},m)})()))}));class Ba{}Ba.ViewTypes=h.ZIY,Ba.getComponentBy=(e,t)=>{let{config:n,className:r,isFullscreen:o,onToggleFullscreen:l}=t;switch(n[e]){case Ba.ViewTypes.HierarchyTree:return a().createElement(Ua,{config:n,className:r});case Ba.ViewTypes.HierarchyPaths:return a().createElement(za,{config:n,className:r});case Ba.ViewTypes.RelationsTable:return a().createElement(Ha,{config:n,className:r});case Ba.ViewTypes.Relations:return a().createElement(Ma,{config:n,className:r});case Ba.ViewTypes.Attributes:return a().createElement(Ia,{className:r,config:n});case Ba.ViewTypes.SingleAttribute:return a().createElement(Da,{config:n,className:r});case Ba.ViewTypes.AttributeTable:return a().createElement(La,{config:n,className:r});case Ba.ViewTypes.Map:return a().createElement(Fa,{config:n,isFullscreen:o,onToggleFullscreen:l,className:r});case Ba.ViewTypes.Custom:return a().createElement(Aa,{config:n,className:r});case Ba.ViewTypes.ImageAttribute:return a().createElement(Wa,{config:n,className:r});case Ba.ViewTypes.PotentialMatches:return a().createElement(Va,{config:n,className:r})}},Ba.getComponent=e=>Ba.getComponentBy("class",e)||Ba.getComponentBy("react-class",e)||a().createElement(ja,{className:e.className});const qa=Ba,_a=()=>null,Ga=(0,r.memo)((e=>{let{config:t,isFullscreen:n,isAutosize:o,onToggleFullscreen:l}=e;const i=ea();return a().createElement(r.Suspense,{fallback:a().createElement(_a,null)},qa.getComponent({config:t,className:V()(i.component,{[i.fullHeight]:!o}),isFullscreen:n,onToggleFullscreen:l}))}));Ga.displayName="ViewComponent";const Ya=(0,le.makeStyles)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"},overflowContainer:{width:"100%",height:"100%",overflow:"hidden"}})));function Qa(){return Qa=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},Qa.apply(this,arguments)}const $a=["onConfigChanged","onRemove"],Xa=e=>{var t;let{layoutItemConfig:n,views:r,className:o,children:i,style:s,isFullscreen:c,onToggleFullscreen:u,AutosizeComponent:p}=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 m=r.find((e=>{let{id:t}=e;return n.i===t})),g=Ya(),f=(0,x.useSelector)(v.ZP.selectors.getGoogleMapKey);if(!m)return null;const b=m.class===qa.ViewTypes.Custom;if(b&&(null==m||null===(t=m.action)||void 0===t?void 0:t.platform)===h.X1H.CLASSIC)return null;if(m.class===qa.ViewTypes.Map&&!f)return null;const y=(e=>{var t;return null===(t=Object.entries(h.ZIY).find((t=>{let[n,r]=t;return e===r})))||void 0===t?void 0:t[0]})(m.class);return a().createElement("div",Qa({},(0,l.omit)($a,d),{"data-reltio-id":m.id,"data-reltio-class":y||"",style:s,className:V()(o,{[g.item]:!b,customView:b})}),a().createElement("div",{className:g.overflowContainer},a().createElement("div",{"data-reltio-id":"profile-view-container",className:V()({[g.fixedSizeContainer]:!p})},p,a().createElement(Ga,{config:m,isFullscreen:c,onToggleFullscreen:u,isAutosize:Boolean(p)})),i))},Ka=1024,Ja=(0,le.makeStyles)({scrollWrapper:{flexGrow:1,overflow:"auto"},scrollableContent:e=>{let{maxWidth:t,minWidth:n=Ka,scrollbarWidth:r}=e;return{minWidth:t&&t<n?t-r:n,height:"100%"}}}),eo=e=>{let{views:t,layout:n,frozen:o,entityUri:l,maxWidth:i,minWidth:s,onLayoutChanged:c}=e;const u=(0,r.useRef)(),p=(d=u.current)?d.offsetWidth-d.clientWidth:0;var d;const m=u.current,g=Ja({maxWidth:i,minWidth:s,scrollbarWidth:p}),f=(0,r.useMemo)((()=>({element:m,priority:["left","right","top","bottom"]})),[m]);return(0,r.useEffect)((()=>{u.current&&(u.current.scrollTop=0)}),[l]),a().createElement("div",{ref:u,className:g.scrollWrapper},a().createElement("div",{className:g.scrollableContent,"data-reltio-id":"reltio-profile-grid"},a().createElement(M.p.Provider,{value:f},a().createElement(A.Z,{LayoutItem:Xa,views:t,layout:n,onLayoutChanged:c,draggableHandle:".viewDraggableHandle",isStatic:o}))))};var to=n(10050),no=n(83820),ro=n(92679);const ao=(0,le.makeStyles)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),oo=e=>{let{notification:t}=e;const n=ao({}),o=(0,x.useDispatch)(),l=(0,x.useSelector)(v.ZP.selectors.getAutoCloseInterval),i=t.autoHideDuration||l&&1e3*l||5e3,[s,c]=(0,r.useState)(),[u,p]=(0,r.useState)(!0),d=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(o(v.ui.actions.closeNotification(t.id)),p(!1))}),[t]),m=(0,r.useCallback)((()=>{s.cancelAction&&o(s.cancelAction),c(void 0)}),[s]),g=(0,r.useCallback)((()=>{o(s.applyAction),c(void 0),o(v.ui.actions.closeNotification(t.id))}),[s,t]),f=a().createElement(a().Fragment,null,t.actions.map((e=>a().createElement(ne.Z,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?c(e):o(e.applyAction),p(!1)}},e.label)))),h=a().createElement(a().Fragment,null,a().createElement(aa.Z,{className:n.closeIcon,size:"S",icon:ro.default,onClick:d}),t.text);return a().createElement(a().Fragment,null,a().createElement(no.Z,{container:document.body},a().createElement(to.Z,{autoHideDuration:i,open:u,classes:{root:n.snackbar},action:f,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:h})),a().createElement(at.Z,{open:!!s,title:null==s?void 0:s.confirmationText,content:null==s?void 0:s.confirmationDescription,onSave:g,onDiscard:m,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))},lo=()=>{const e=(0,x.useSelector)(v.ZP.selectors.getNotifications);return e?a().createElement(a().Fragment,null,e.slice(-1).map((e=>a().createElement(oo,{key:e.id,notification:e})))):null};var io=n(15328),so=n(26436),co=n(70369),uo=n(50985),po=n(79386),mo=n(75647),go=n(76368),fo=n(36777),ho=n(97287);function bo(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){yo(e,t,n[t])}))}return e}function yo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vo(){return vo=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},vo.apply(this,arguments)}const xo=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",vo({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"}))))};function Eo(){return Eo=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},Eo.apply(this,arguments)}const wo=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",Eo({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),a().createElement("defs",null,a().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM20 8H8v12h12V8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg2383396984a"})),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},a().createElement("mask",{id:"svg2383396984b",fill:"#fff"},a().createElement("use",{xlinkHref:"#svg2383396984a"})),a().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2383396984b)",d:"M0 0h24v24H0z"})))},So=(0,le.makeStyles)({editingButtons:{display:"flex","& button + button":{minWidth:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"},menuButton:{marginLeft:8},cancelButton:{border:"1px solid rgba(0, 0, 0, 0.23)"}}),Co=e=>a().createElement(io.Z,e,a().createElement(xo,null)),Oo=e=>a().createElement(io.Z,e,a().createElement(wo,null)),Po=(e,t,n,r,a)=>e.filter((e=>{let{value:o,permission:l}=e;return!(n&&!(0,h.KIu)(o))&&!!(r&&a||!(0,h.fnZ)(o))&&(0,h.uGe)(l,t)})),ko=e=>{let{className:t,profileBandConfig:n,menuItems:o,showMenu:i=!0}=e;const s=So(),c=(0,x.useDispatch)(),u=(0,x.useSelector)(v.ZP.selectors.getCanUserStartProcessFromQuery),p=(0,x.useSelector)(v.ZP.selectors.getEntityWithoutDiff),d=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,p.uri))),m=(0,x.useSelector)(v.ZP.selectors.getMetadata),g=(0,x.useSelector)(v.ZP.selectors.isWorkflowEnabled),f=(0,x.useSelector)(v.ZP.selectors.getMode),b=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),E=(0,x.useSelector)(v.ZP.selectors.getIsViewMode),w=(0,x.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),S=(0,x.useSelector)(v.ZP.selectors.getProfileOperation),C=null==p?void 0:p.type,O=(0,r.useMemo)((()=>(0,h.nt9)(m,C)),[C,m]),P=S===h.OXy.Saving,k=S===h.OXy.Cloning||P,[N,Z]=(0,r.useState)(!1),R=(0,r.useCallback)((()=>{Z(!1)}),[]),T=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const a=(0,x.useSelector)(v.ZP.selectors.getEntityWithoutDiff),o=(0,x.useSelector)(v.ZP.selectors.getMetadata),i=(0,x.useDispatch)(),s=null==a?void 0:a.type,c=o.relationTypes,u=(0,r.useCallback)((0,h.Ian)(o,s),[o,s]),p=(0,h.nt9)(o,s),d=(0,r.useMemo)((()=>(0,l.when)((0,l.complement)(l.isNil),(0,l.pipe)((0,l.find)((0,l.pipe)((0,l.propOr)([],"entityTypeUris"),(0,l.either)((0,l.includes)(s),(0,l.includes)("*")))),(0,l.when)((0,l.complement)(l.isNil),(0,l.omit)(["entityTypeUris"]))))(t)),[t,s]),m=(0,r.useCallback)((()=>{if(d){const e=(0,l.pipe)((0,l.prop)("relationshipTypesToCopy"),(0,l.cond)([[l.isNil,(0,l.pipe)((0,l.always)(p),(0,l.propOr)([],"attributes"),(0,l.filter)(h.YkG),(0,l.map)(h.ZaZ))],[(0,l.includes)("*"),(0,l.pipe)((0,l.always)(c||[]),(0,l.map)((0,l.prop)("uri")),(0,l.filter)(u))],[l.T,l.identity]]))(d);i(v.N5.entity.actions.entityCloneRequested({data:bo({},(0,l.pick)(["attributeReplacementMapping"],d),{relationshipTypesToCopy:e}),entityUri:a.uri}))}n()}),[d,n,p,c,a.uri,u]);return d?m:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:R}),j=(0,r.useMemo)((()=>[{label:y().text("Editing"),value:h.fO_.EDITING,description:y().text("Edit profile directly"),icon:co.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:h.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:Co,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:h.fO_.VIEWING,description:y().text("Read or print profile"),icon:so.Z,permission:"READ"}]),[]),I=(0,r.useMemo)((()=>[...T?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:Oo,onClick:()=>Z(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:pt.Z,onClick:()=>{window.confirm(y().text("Are you sure you want to delete this?"))&&c(v.N5.entity.actions.entityRemoveRequested({entityUri:p.uri}))},permission:"DELETE"}]),[c,p.uri,T]),D=!w&&!(0,h.biM)(p)&&!(e=>(0,h.uGe)(h.BDP.READ,e)&&!(0,h.uGe)(h.BDP.UPDATE,e)&&!(0,h.uGe)(h.BDP.DELETE,e)&&!(0,h.uGe)(h.BDP.INITIATE_CHANGE_REQUEST,e))(O),L=(0,h.ZiX)(null==p?void 0:p.uri),M=(0,r.useMemo)((()=>Po(j,O,L,g,u)),[j,O,g,u,L]),A=(0,r.useMemo)((()=>Po(I,O,L,g,u)),[I,O,g,u,L]),z=(0,r.useCallback)((e=>{c(v.N5.mode.actions.modeUpdated(e))}),[c]),U=(0,r.useCallback)((()=>{c(v.N5.mode.actions.modeCancelEditing())}),[c]),H=(0,r.useCallback)((()=>{c(v.N5.actions.saveProfile())}),[c]);return a().createElement(a().Fragment,null,a().createElement(po.Z,{className:V()(t,At.U),entity:b&&d?d:p},a().createElement(_.Z,{display:"flex",alignItems:"center"},a().createElement(_.Z,{mr:3},b&&a().createElement(_.Z,{className:s.editingButtons},a().createElement(ne.Z,{variant:"outlined",className:s.cancelButton,onClick:U,"data-reltio-id":"reltio-profile-cancel-editing",disabled:k},y().text("Cancel")),a().createElement(ne.Z,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:H,disabled:k},(0,h.fnZ)(f)?y().text("Suggest"):y().text("Save"))),w&&E?a().createElement(mo.Z,null):E&&a().createElement(go.a,null)),D&&a().createElement(fo.T,{optionsGroup:M,buttonsGroup:A,value:f,onChange:z,disabled:k}),i&&a().createElement(Ke.Z,{menuId:"profile-header-menu",buttonComponent:aa.Z,buttonProps:{icon:uo.Z,size:"L","data-reltio-id":"reltio-profile-header-menu",className:s.menuButton},menuItems:o,MenuItemRenderer:ho.Z})),a().createElement(_.Z,{className:s.comments},a().createElement(zt.Z,{uri:p.uri,relatedObjectUris:(0,h.wp9)(h.q7e.ENTITY,{entityUri:p.uri}),objectType:h.q7e.ENTITY}))),!!T&&a().createElement(at.Z,{open:N,title:y().text("Do you want to create a clone of the profile?"),content:y().text("Cloning will create a copy of the current profile. You can modify the cloned profile in the next step. Are you sure you want to proceed?"),onSave:T,onDiscard:R,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))};var No=n(3466),Zo=n(11821),Ro=n(98273);const To=(0,le.makeStyles)({wrapper:{display:"flex",overflow:"hidden",flexShrink:0,marginLeft:"3px",height:"100%"},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}});function jo(){return jo=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},jo.apply(this,arguments)}let Io;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(Io||(Io={}));const Do=e=>{let{active:t,tabs:n,onClose:o}=e;const i=To(),s=!(0,l.isNil)(t),{content:c,headerProps:u,hidden:p}=n[t]||{};return(0,r.useEffect)((()=>{p&&o()}),[t,p,o]),a().createElement("div",{className:i.wrapper},a().createElement(Zo.h,{open:s},!p&&a().createElement(a().Fragment,null,a().createElement(Ro.P,jo({},u,{onClose:o})),c)))};var Lo=n(69409),Mo=n(7108),Ao=n(37778),zo=n(32158),Vo=n(95085),Uo=n(70675),Ho=n(13510);const Fo=(0,le.makeStyles)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),Wo=()=>{const e=Fo(),t=(0,x.useSelector)(v.ZP.selectors.getDBConnectorSideViews);return a().createElement("div",{className:e.wrapper},t.map((t=>a().createElement(Xr,{key:t.id,config:t,className:e.itemWrapper}))))};var Bo=n(36592);const qo=()=>{const{total:e}=(0,r.useContext)(R.O),t=To();return a().createElement(ot.Z,{badgeContent:e,classes:{anchorOriginTopRightRectangular:t.badgePosition,badge:t.badge}},a().createElement(Bo.Z,null))};function _o(){return _o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_o.apply(this,arguments)}const Go=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",_o({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"})))))},Yo=()=>{const{commentsMap:e}=(0,r.useContext)(S.h),t=To();return a().createElement(ot.Z,{badgeContent:(0,h.mdt)(e),classes:{anchorOriginTopRightRectangular:t.badgePosition,badge:t.badge}},a().createElement(Go,null))};function Qo(){return Qo=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},Qo.apply(this,arguments)}const $o=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",Qo({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),a().createElement("path",{d:"M14.101 16A5.003 5.003 0 0016 18.987V20H2v-4h12.101zM22 18.987V20v-1.013zM4 17v2h2v-2H4zM16 4v1.013A5.004 5.004 0 0014.101 8H2V4h14zm6 0v1.013V4zM6 7V5H4v2h2zm8 3v4H2v-4h12zM4 11v2h2v-2H4zm12 4v-2h6v2c0 1.3-.84 2.4-2 2.82V22h-2v-4.18c-1.16-.42-2-1.52-2-2.82zm0-6c0-1.3.84-2.4 2-2.82V2h2v4.18c1.16.42 2 1.52 2 2.82v2h-6V9z",fill:"#000",fillOpacity:".54"}))};var Xo=n(48211);const Ko=(0,le.makeStyles)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Jo=()=>{const e=Ko(),{tasks:t,loading:n}=(0,r.useContext)(R.O);return a().createElement("div",{className:e.wrapper},n&&a().createElement(L.Z,null),t&&t.map((e=>a().createElement(Xo.s,{key:e.taskId,task:e}))))};var el=n(15422);const tl=()=>a().createElement(el.Z,{text:y().text("Ready to go with the flow?"),secondaryText:y().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")});var nl=n(86868),rl=n(89925),al=n(85101);const ol=(0,le.makeStyles)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),ll=()=>{const e=ol(),{getComments:t,comments:n,pageToken:o}=(0,r.useContext)(S.h),l=(0,x.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(l)}),[t,l]);const i=(0,nl.Q)(n);return a().createElement(He.X.Provider,{value:i},a().createElement(_.Z,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:o}=e;return a().createElement(rl.J,{key:o,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),o&&a().createElement(ya.Z,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(l,o)},underline:"none"},a().createElement(al.Z,{className:e.showMoreIcon}),y().text("Show more"))))},il=()=>a().createElement(el.Z,{text:y().text("Care to join the conversation?"),secondaryText:y().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")}),sl=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},cl=(0,le.makeStyles)((()=>({profileContainer:{display:"flex",overflow:"hidden",flexGrow:1}}))),ul=(0,r.memo)((e=>{let{perspectiveId:t,commentId:n,hideHistory:o,children:i}=e;const s=cl(),{defaultTab:c,tabs:u}=(e=>{let{commentId:t,hideHistory:n,perspectiveId:o}=e;const l=(0,x.useSelector)(v.ZP.selectors.isWorkflowSideViewEnabled),i=(0,x.useSelector)(v.ZP.selectors.isWorkflowEnabled),s=(0,x.useSelector)(v.ZP.selectors.isCollaborationSideViewEnabled),c=(0,x.useSelector)(v.ZP.selectors.isDBConnectorSideViewEnabled),u=(0,x.useSelector)(v.ZP.selectors.isCollaborationEnabled),p=t?Io.Collaboration:void 0,d=(0,x.useSelector)(v.ZP.selectors.getHistoryEvent),m=(0,x.useSelector)(v.ZP.selectors.getMetadata),g=(0,x.useSelector)(v.ZP.selectors.getEntity),f=(0,r.useContext)(R.O),b=(0,r.useContext)(S.h),{isHistoryEnabled:E,isProfilePersisted:w}=(0,Lo.C)({perspectiveId:o,entity:g,historyButtonId:Io.History}),{historyFilter:C,onApplyFilter:O,isLoading:P,historicUris:k,historyWithTotal:N,canLoadMore:Z,onLoadMore:T}=(0,Mo.k6)({entity:g,enabled:E}),j=l&&i&&!(0,h.ZiX)(null==g?void 0:g.uri),I=s&&u,D=(0,h.mdt)(null==b?void 0:b.commentsMap);return{tabs:(0,r.useMemo)((()=>[{buttonProps:{id:Io.Workflow,icon:qo,tooltipTitle:y().text("Workflow")},content:null!=f&&f.total?a().createElement(Jo,null):a().createElement(tl,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:sl(null==f?void 0:f.total),rightContent:a().createElement(Ao.G,null)},hidden:!j},{buttonProps:{id:Io.Collaboration,icon:Yo,tooltipTitle:y().text("Collaboration")},content:D?a().createElement(ll,null):a().createElement(il,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:sl(D)},hidden:!I},{buttonProps:{id:Io.History,icon:Ho.Z,tooltipTitle:y().text("History")},content:w?a().createElement(zo.Z,{isLoading:P,historyWithTotal:N,contributorsUris:k,entityUri:null==g?void 0:g.uri,historyEvent:d,onLoadMore:T,canLoadMore:Z}):a().createElement(Vo.Z,null),headerProps:{content:a().createElement(Uo.Z,{total:w?((null==k?void 0:k.length)||0)+1:void 0,entityType:(0,h.nt9)(m,null==g?void 0:g.type),filter:C,onApplyFilter:O})},hidden:n},{buttonProps:{id:Io.DBConnector,icon:$o,tooltipTitle:y().text("D&B Connector")},content:a().createElement(Wo,null),headerProps:{mainTitle:y().text("D&B Connector")},hidden:!c}]),[null==f?void 0:f.total,j,D,I,w,P,N,k,null==g?void 0:g.uri,null==g?void 0:g.type,d,T,Z,m,C,O,c]),defaultTab:p}})({commentId:n,hideHistory:o,perspectiveId:t});return a().createElement("div",{className:s.profileContainer},a().createElement(No.n,{defaultTab:c,perspectiveId:t,buttonsProps:(0,l.pipe)((0,l.reject)((0,l.propEq)("hidden",!0)),(0,l.pluck)("buttonProps"))(u)},i,a().createElement(Do,{tabs:u})))}));ul.displayName="ProfilePerspectiveView";var pl=n(3096),dl=n.n(pl),ml=n(28220);function gl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fl={};var hl=n(27938),bl=n(54064);function yl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vl=n(43589),xl=n(944);const El=(0,le.makeStyles)((e=>({wrapper:{alignItems:"center",display:"flex",padding:"12px 16px",fontSize:"13px",lineHeight:"15px",fontWeight:e.typography.fontWeightRegular,color:e.palette.text.secondary},loadingWrapper:{display:"flex",backgroundColor:"rgba(238, 238, 238, 1)",color:e.palette.text.secondary,boxShadow:"inset 0px -1px 0px rgba(0, 0, 0, 0.12)"},errorWrapper:{display:"flex",backgroundColor:"rgba(255, 235, 238, 1)",color:e.palette.error.main},successWrapper:{display:"flex",backgroundColor:"rgba(239, 253, 227, 1)",color:e.palette.success.main,"& span, & b":{paddingRight:"4px"}},closeIcon:{color:e.palette.text.secondary,cursor:"pointer","&:hover":{background:"none"}},indicatorIcon:{padding:"0 14px"},link:{color:e.palette.primary.main,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular,cursor:"pointer"}}))),wl=El;let Sl;!function(e){e.loading="loading",e.success="success",e.error="error"}(Sl||(Sl={}));const Cl=e=>{let{onClose:t}=e;const n=wl();return a().createElement(We.k,{tooltipTitle:y().text("Close"),onClick:t,size:"S",className:n.closeIcon,icon:ro.default})},Ol=e=>{let{onClose:t}=e;const n=wl();return a().createElement("div",{className:V()(n.wrapper,n.loadingWrapper)},a().createElement(Cl,{onClose:t}),a().createElement(qt.Z,{className:V()(n.indicatorIcon)}),a().createElement(G.Z,null,y().text("Loading background process...")))},Pl=e=>{let{label:t,onClose:n,onRefresh:r}=e;const o=wl();return a().createElement("div",{className:V()(o.wrapper,o.successWrapper)},a().createElement(Cl,{onClose:n}),a().createElement(vl.Z,{className:V()(o.indicatorIcon)}),a().createElement("div",{"data-reltio-id":"background-update-success"},a().createElement("span",null,y().text("This Profile")),a().createElement("b",null,(0,h.idV)(t)),a().createElement("span",null,y().text("has been updated.")),a().createElement("span",{onClick:r,className:o.link},y().text("Click Here to Refresh the page")),a().createElement("span",null,y().text(" to retrieve the latest profile data."))))},kl=e=>{let{onClose:t}=e;const n=wl();return a().createElement("div",{className:V()(n.wrapper,n.errorWrapper)},a().createElement(Cl,{onClose:t}),a().createElement(xl.Z,{className:V()(n.indicatorIcon)}),a().createElement(G.Z,null,y().text("UI attempted to check for updates but no update received in the last 30 seconds. Try refreshing the page manually.")))},Nl=e=>{let{label:t,onClose:n,onRefresh:r,status:o}=e;switch(o){case Sl.loading:return a().createElement(Ol,{onClose:n});case Sl.success:return a().createElement(Pl,{label:t,onClose:n,onRefresh:r});case Sl.error:return a().createElement(kl,{onClose:n});default:return null}},Zl=(e,t)=>((e,t)=>"*"===(null==e?void 0:e[0])||!(0,l.isNil)(e)&&e.includes(t))(e,t),Rl=(0,le.makeStyles)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},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%"}},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}})));function Tl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jl=(0,r.memo)((e=>{var t;let{config:n,saveState:o,getSavedState:l,commentId:i}=e;const{maxWidth:s,profileBand:c,workflow:u,frozen:p}=n||{},m=Rl({maxWidth:s}),g=(0,x.useSelector)(v.ZP.selectors.getEntity),f=(0,x.useSelector)(v.ZP.selectors.getHistoryEvent),b=(0,x.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),M=(null===(t=(0,x.useSelector)(v.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"",A=(0,x.useSelector)(v.ZP.selectors.getMode),z=(0,x.useSelector)(v.ZP.selectors.getProfileErrors),V=(0,x.useDispatch)(),U=(0,E.u)(),H=(e=>{const t=(0,hl.v)(e),n=(0,bl.b)();return(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){yl(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(u),{isLoading:F}=(0,w.M)(),{type:W,uri:B,updatedTime:q}=g||{},{onRefreshProfile:_,onCloseBackgroundProcessIndicator:G,cancelUpdateProcess:Y,isOpenBackgroundProcessIndicator:Q,backgroundUpdateStatus:$}=(e=>{let{entityUri:t,entityTypeUri:n,entityUpdatedTime:a}=e;const o=(0,x.useDispatch)(),{autoUpdateInReadMode:l,entityTypes:i}=(0,x.useSelector)(v.ZP.selectors.getProfileCheckUpdate)||{},s=Zl(i,n),c=Zl(l,n),u=(0,r.useRef)(null),p=(0,Ie._)(),m=(0,gr.u)(),g=(0,r.useContext)(d.m),[f,b]=(0,r.useState)(!1),[y,E]=(0,r.useState)(Sl.loading),w=6e3;const S=(0,r.useCallback)((()=>{o(v.N5.entity.actions.loadEntity({viewId:g,uri:t})),b(!1)}),[o,t,g]),C=(0,r.useCallback)((()=>{b(!1)}),[]),O=(0,r.useCallback)((()=>{clearTimeout(u.current),b(!1),p(Promise.resolve())}),[p]),P=(0,r.useCallback)((e=>{p((0,h.GBJ)(t)).then((t=>{t.updatedTime>a&&(E(Sl.success),c?S():b(!0),e=-1)})).catch((()=>{})).finally((()=>{e<0||(e?(e-=1,u.current=setTimeout(P,w,e)):(E(Sl.error),b(!0)))}))}),[a,t,c,S,p,w]),k=(0,r.useCallback)((()=>{s&&(E(Sl.loading),b(!0),u.current=setTimeout(P,w,4))}),[P,s]);return(0,r.useEffect)((()=>{const e=m((e=>{e.type===v.N5.constants.ProfileActions.PROFILE_SAVED&&k()}));return()=>{e()}}),[m,p,k]),{onRefreshProfile:S,onCloseBackgroundProcessIndicator:C,cancelUpdateProcess:O,isOpenBackgroundProcessIndicator:f,backgroundUpdateStatus:y}})({entityUri:B,entityTypeUri:W,entityUpdatedTime:q}),X=(0,r.useMemo)((()=>(0,h.dvH)(g)),[g]),K=(0,r.useContext)(S.h),J=(0,C.C)({objectIds:X}),ee=(0,r.useContext)(O.Y),te=(0,x.useSelector)(v.ZP.selectors.getShowAttributeDescription),ne=(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Tl(e,t,n[t])}))}return e}({},ee,{showDescription:te})),[ee,te]),{views:re,layout:ae,isLoaded:oe,onLayoutReset:le,onResetUndo:ie,handleLayoutChange:se}=(e=>{let{config:t,entityTypeUri:n,saveState:a,getSavedState:o}=e;const[l,i]=(0,r.useState)([]),[s,c]=(0,r.useState)([]),{canRead:u}=(0,nr.l)(),p=(0,r.useMemo)((()=>{const e=t.views.filter(u),n=(0,h.sFD)(t.layout,e);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){gl(e,t,n[t])}))}return e}({},t,{views:e,layout:n})}),[t,u]),d=(0,r.useMemo)((()=>dl()(p)),[p]),m=null!=p&&p.nestedRoute?`/${p.nestedRoute}`:"",g=n&&p?n+m:null,f=(0,r.useCallback)((()=>o().then((e=>e.layout?{}:e))),[o]),b=(0,r.useCallback)((0,h.DsO)(a,1e3),[a]),{isLoaded:y,savedState:v=fl,updateSavedState:x}=(0,ml.w)({getSavedState:f,saveState:b,entityTypeUri:g}),E=(0,r.useCallback)((e=>{x({layout:e,views:s,configHash:d}),i(e)}),[x,d,s]),w=(0,r.useRef)(),S=(0,r.useCallback)((()=>{c(w.current.views),E(w.current.layout)}),[E]),C=(0,r.useCallback)((()=>{w.current={views:s,layout:l};const{views:e,layout:t}=(0,h.Mfk)({views:p.views,layout:p.layout});c(e),E(t)}),[p,l,s,E]);return(0,r.useEffect)((()=>{if(y){const e=d!==v.configHash,{views:t,layout:n}=(0,h.Mfk)({views:e||!v.views?p.views:v.views,layout:e?p.layout:v.layout});c(t),i(n)}}),[y,v,g]),{views:s,layout:l,isLoaded:y,onLayoutReset:C,onResetUndo:S,handleLayoutChange:E}})({config:n,entityTypeUri:W,saveState:o,getSavedState:l});(0,P.a)({entity:g,historyEvent:f}),(()=>{const e=(0,x.useDispatch)(),t=(0,x.useSelector)(v.ZP.selectors.getValidateReadMode),n=(0,x.useSelector)(v.ZP.selectors.getEntity)||{},{uri:a,updatedTime:o}=n,l=(0,h.biM)(n),i=(0,x.useSelector)(v.ZP.selectors.getMode),s=(0,x.useSelector)(v.ZP.selectors.getProfileViews),c=s&&s.length>0,u=(0,r.useCallback)((0,h.DsO)((t=>{t&&e(v.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!l&&a&&!(0,h.ZiX)(a)&&i===h.ARY.Viewing&&c;u(e)}),[u,l,t,o,a,i,c])})(),(0,r.useEffect)((()=>{V(v.N5.views.actions.profileViewsSet(re))}),[V,re]),(0,r.useEffect)((()=>{n.sidePanelViews&&V(v.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>()=>Y()),[B,A]);const ce=A===h.ARY.Viewing&&(0,h.ZiX)(B),ue=e=>a().createElement("div",{className:m.emptyState},a().createElement(k.ZP,{LogoRenderer:k.B9.NO_DATA,text:e,variant:k.tC.embedded})),{SnackbarRenderer:pe,resetLayout:de}=(0,N.w)({onLayoutReset:le,onResetUndo:ie}),me=(0,r.useMemo)((()=>[{primary:y().text("Reset layout"),secondary:y().text("Restore the default layout without saving any changes"),onClick:de}]),[de]);return a().createElement(O.Y.Provider,{value:ne},a().createElement(Z.j.Provider,{value:!0},a().createElement(S.e,{collaboration:b?K:J},a().createElement(R.O.Provider,{value:H},a().createElement(T.m.Provider,{value:U},a().createElement(j.l.Provider,{value:M},a().createElement(I.fy,null,a().createElement("div",{className:m.perspectiveView},oe&&B?a().createElement(ul,{commentId:i,perspectiveId:"profile"},a().createElement("div",{className:m.profileWrapper},a().createElement(ko,{profileBandConfig:c,showMenu:!p,menuItems:me}),F?ue(y().text("Loading")):a().createElement(a().Fragment,null,Q&&a().createElement(Nl,{label:g.label,onClose:G,onRefresh:_,status:$}),!b&&a().createElement(D.J,{attributesWithErrors:z}),!ce&&a().createElement(eo,{maxWidth:s,views:re,layout:ae,frozen:p,entityUri:B,onLayoutChanged:se})))):a().createElement(a().Fragment,null,a().createElement(L.Z,null),ue(y().text("No data to display."))),a().createElement(lo,null),a().createElement(pe,null)))))))))}));jl.displayName="ProfilePerspectiveView";const Il=(0,i.Z)({productionPrefix:"profilePerspective",disableGlobal:!0,seed:"prfl"});h.oss.register("profile",((e,t)=>{const n=e=>(0,l.sort)(((e,t)=>e.x>t.x||e.x===t.x&&e.y>t.y?1:-1),e),r=(0,l.map)((e=>(0,l.evolve)({layout:(0,l.pipe)(n,(0,l.map)((0,l.ifElse)((0,l.propEq)("autosizing",!0),(0,l.omit)(["y","height","minHeight","maxHeight"]),(0,l.omit)(["y","minHeight","maxHeight"]))))},e)));return(0,h.l22)(r(e),r(t))}));const Dl=e=>{let{config:t,onResize:n=l.identity,saveState:i,getSavedState:b,qxSandboxApi:y,commentId:v}=e;const x=(0,r.useCallback)((0,h.aYu)(b),[b]),{SnackbarRenderer:E,showSnackbarMessage:w}=(0,p.D)(),S=(0,r.useMemo)((()=>t&&(0,h.Vr9)(t)),[t]);return a().createElement(d.m.Provider,{value:null==S?void 0:S.id},a().createElement(m.S.Provider,{value:w},a().createElement(g.Y.Provider,{value:y},a().createElement(s.ZP,{generateClassName:Il},a().createElement(u._,{dateAdapter:o.Q},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>n(Math.floor(e),Math.floor(t))}),S&&a().createElement(jl,{config:S,saveState:i,getSavedState:x,commentId:v}),a().createElement(f.Z,{showErrorFromStore:!0}),a().createElement(E,null))))))};var Ll=n(5050),Ml=n(79935),Al=n(16e3);const zl=(0,le.makeStyles)((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}}))),Vl=e=>{let{total:t=0}=e;const n=zl(),o=(0,x.useDispatch)(),l=(0,r.useContext)(d.m),i=(0,r.useCallback)((()=>{o(v.ui.actions.openPerspective({perspectiveId:"profile",viewId:l}))}),[o,l]);return a().createElement(Y.Z,{title:""},a().createElement("div",{className:n.titleContainer},a().createElement(ya.Z,{component:"button",variant:"caption",className:n.link,onClick:i,underline:"none"},y().text("Profile")),a().createElement(Al.Z,{className:n.icon}),y().text("Tags")),a().createElement(Ml.Z,null),a().createElement(G.Z,{className:n.totalCaption,variant:"caption"},a().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var Ul=n(59916),Hl=n(26482);const Fl=(0,le.makeStyles)((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"}}))),Wl=e=>{let{label:t}=e;const n=Fl();return a().createElement(Hl.Z,{className:n.toolbar},a().createElement(Ul.Z,{className:n.avatar}),a().createElement(G.Z,{variant:"h6",className:n.label},t))};function Bl(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){ql(e,t,n[t])}))}return e}function ql(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _l=(0,le.makeStyles)((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}}))),Gl=[25,50,100],Yl=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const o=_l(),[i,s]=(0,r.useState)(Gl[0]),[c,u]=(0,r.useState)(0),p=(0,x.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{u(0)}),[t,n,p]);const{isLoading:d,total:m,entities:g}=(e=>{let{tag:t,entityUri:n,page:a=0,rowsPerPage:o=50}=e;const i=(0,x.useDispatch)(),s=(0,Ie._)(),c=(0,Ie._)(),[u,p]=(0,r.useState)(!1),[d,m]=(0,r.useState)(0),[g,f]=(0,r.useState)([]),{requestEntities:b,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const a=(0,x.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),o=(0,x.useSelector)(v.ZP.selectors.getTenant),i=(0,x.useSelector)(v.ZP.selectors.getDtssPath),s=(0,r.useMemo)((()=>(0,h.Do$)(t)),[t]),c=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),u=!!s,p=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Bl({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return u?(0,h.uqV)({filters:e,options:t,customerTenant:o,dataTenant:s,dtssPath:i}).then((0,l.map)((0,h.E7G)(s))):(0,h.ZOr)(e,t)}),[u,s,o,i]);return{requestEntities:(0,r.useCallback)(((e,t)=>p(c,Bl({offset:t,max:e},a))),[c,a,p]),requestTotal:(0,r.useCallback)((()=>{const e=a;return(u?(0,h.J$m)({filters:c,options:e,customerTenant:o,dataTenant:s,dtssPath:i}):(0,h.j_Q)(c,e)).then((e=>e.total))}),[c,a,u,s,o,i])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{i(v.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong")))),m(0)}),[i]);return(0,r.useEffect)((()=>{s(E()).then(m).catch(w)}),[E,s,w]),(0,r.useEffect)((()=>{p(!0),c(b(o,a*o)).then(f).catch(w).finally((()=>p(!1)))}),[a,o,b,c,w]),{isLoading:u,total:d,entities:g}})({tag:t,entityUri:n,page:c,rowsPerPage:i}),f=(0,r.useRef)(null);(0,r.useEffect)((()=>{f.current&&(f.current.scrollTop=0)}),[g]);const b=m>Gl[0];return a().createElement("div",{className:o.perspectiveView},a().createElement(Wl,{label:t}),a().createElement("div",{className:V()(o.tagsContainer,{[o.fullHeight]:b})},a().createElement(B.Z,{className:o.tagsView},a().createElement(Vl,{total:m}),a().createElement("div",{className:o.listContainer},d&&a().createElement(L.Z,null),m>0&&a().createElement("div",{className:o.entitiesList,ref:f},a().createElement(Ll.Z,{entities:g})),b&&a().createElement("div",{className:o.pagination},a().createElement(q.Z,{count:m,rowsPerPageOptions:Gl,rowsPerPage:i,page:c,onChangePage:u,onChangeRowsPerPage:s}))))))}));Yl.displayName="TagPerspectiveView";const Ql=(0,i.Z)({productionPrefix:"tagPerspective",disableGlobal:!0}),$l=e=>{let{config:t,tag:n,entityUri:r,onResize:o=l.identity}=e;return a().createElement(d.m.Provider,{value:t.id},a().createElement(s.ZP,{generateClassName:Ql},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(Yl,{tag:n,entityUri:r}),a().createElement(f.Z,{showErrorFromStore:!0})))};var Xl=n(39636);const Kl=(0,le.makeStyles)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),Jl=()=>{const e=Kl(),t=(0,x.useSelector)(v.ZP.selectors.getEntity),{tasks:n}=(0,r.useContext)(R.O),o=(0,r.useMemo)((()=>null==n?void 0:n.find((e=>e.objectURIs.includes((0,h.$Rg)(t.uri))))),[t.uri,n]);return a().createElement(po.Z,{entity:t},a().createElement("div",{className:e.actionsWrapper},o&&a().createElement(Xl.o,{task:o})))};function ei(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ti=(0,le.makeStyles)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},perspectiveContainer:{display:"flex",flexGrow:1,overflow:"hidden"},attributesWrapper:{margin:"15px",flexGrow:1,overflowY:"auto",backgroundColor:"#FAFAFA"},contentWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1}})));function ni(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ri={processTypes:["dataChangeRequestReview"]},ai=(0,r.memo)((()=>{const e=ti(),t=(0,x.useDispatch)(),n=(e=>{const t=(0,x.useDispatch)(),n=(0,x.useSelector)(v.ZP.selectors.getEntityUri),a=(0,hl.v)(e),o=(0,r.useCallback)((e=>{"Reject"===e&&t(v.ui.actions.openPerspective({perspectiveId:null,viewId:null})),"Approve"===e&&t(v.ui.actions.openEntity({uri:(0,h.$Rg)(n),viewId:null}))}),[t,n]);return(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ei(e,t,n[t])}))}return e}({},a,{onActionSuccess:o})),[a,o])})(ri),o=(0,x.useSelector)(v.ZP.selectors.getEntity),l=(0,r.useContext)(O.Y),i=(0,x.useSelector)(v.ZP.selectors.getShowAttributeDescription),s=(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ni(e,t,n[t])}))}return e}({},l,{showDescription:i})),[l,i]);(0,r.useEffect)((()=>{t(v.N5.sidePanelViews.actions.sidePanelViewsLoaded([{id:"common",views:[{point:"com.reltio.plugins.ui.view",id:"com.reltio.plugins.entity.side.WorkflowsView",class:"com.reltio.plugins.entity.side.WorkflowsView"}]}]))}),[t]);const c=!n.loading&&!!o.uri;return a().createElement(O.Y.Provider,{value:s},a().createElement(R.O.Provider,{value:n},a().createElement("div",{className:e.perspectiveView},!c&&a().createElement(L.Z,null),a().createElement("div",{className:e.perspectiveContainer},c?a().createElement(ul,{hideHistory:!0,perspectiveId:"dcrCard"},a().createElement("div",{className:e.contentWrapper},a().createElement(Jl,null),a().createElement("div",{className:e.attributesWrapper},a().createElement(H.Z,null)))):a().createElement(k.ZP,{LogoRenderer:k.B9.NO_DATA,text:y().text("No data to display."),variant:k.tC.embedded})))))}));ai.displayName="DCRReviewPerspectiveView";const oi=(0,i.Z)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0,seed:"dcr"}),li=e=>{let{config:t,onResize:n=l.identity}=e;return a().createElement(d.m.Provider,{value:t.id},a().createElement(s.ZP,{generateClassName:oi},a().createElement(u._,{dateAdapter:o.Q},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>n(Math.floor(e),Math.floor(t))}),a().createElement(ai,null),a().createElement(f.Z,{showErrorFromStore:!0}))))}},51317:(e,t,n)=>{n.r(t),n.d(t,{RelationshipsTableView:()=>Je});var r=n(9366),a=n(24328),o=n.n(a),l=n(44443),i=n(50914),s=n(52730),c=n(45738),u=n(31421),p=n(93553),d=n(38677),m=n(13980),g=n.n(m),f=n(2507),h=n.n(f),b=n(72342);const y=(0,b.makeStyles)({addButton:{marginLeft:"12px",padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},label:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),v=e=>{let{onClick:t}=e;const n=y();return o().createElement(d.Z,{color:"primary",className:n.addButton,onClick:t},o().createElement(p.Z,{classes:{root:n.icon}}),o().createElement("div",{className:n.label},h().text("Add")))};v.propTypes={onClick:g().func};const x=v;var E=n(71153),w=n.n(E);const S={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},C={color:"rgba(0,0,0,.54)"},O=(0,b.makeStyles)((e=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},entityCell:{display:"flex",alignItems:"center",height:"100%"},entityLabel:{fontSize:"15px",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","$row-cell--removed &":S,"$row-cell--inactive &":C},entityAvatar:{transform:"scale(0.7)",margin:"0 10px"},rowCell:{fontSize:"13px",overflow:"hidden"},description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > :not($entityCell)":S},"row-cell--inactive":C})));function P(){return P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P.apply(this,arguments)}const k=e=>{let{cell:t,CellValueRenderer:n,rowValue:{connection:r},isSorted:a}=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","rowValue","isSorted"]);const i=O(),s=(0,u.$qe)(r),c=(0,u.Fn9)(r.relation)&&(0,u.Fn9)(r.entity);return o().createElement("div",{className:w()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:s,[i["row-cell--inactive"]]:!c},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,P({key:t,value:e},l)))))};k.propTypes={rowValue:g().object,cell:g().object,CellValueRenderer:g().elementType,isSorted:g().bool};const N=k;var Z=n(45108),R=n(53862),T=n(63532),j=n(96379),I=n(40007);const D=e=>{let{value:{entityType:t,entity:n}}=e;const r=(0,s.useDispatch)(),l=(0,a.useContext)(T.m),p=O(),d=(0,u.idV)(n.entityLabel),m=(0,u.wwR)({uri:n.entityUri,dataTenant:n.dataTenant});return o().createElement("div",{className:p.entityCell},o().createElement(j.Z,{className:p.entityAvatar,entityType:t}),o().createElement(I.Z,{value:d},o().createElement("span",{className:p.entityLabel,onClick:(0,i.pipe)((0,i.always)({uri:m,viewId:l}),c.ui.actions.openEntity,r)},d)))};D.propTypes={value:g().shape({entity:g().shape({entityUri:g().string,entityLabel:g().string}),entityType:u.p8l})};const L=D;var M=n(92332),A=n(12364);const z=(0,n(25843).Z)((e=>{const t=O(),{description:n}=(null==e?void 0:e.headCellData)||{};return o().createElement("div",{className:t.headCell},o().createElement(M.default,e),o().createElement(A.Z,{description:n,className:t.description}))}));var V=n(46728);const U=(0,i.pipe)((0,i.map)((e=>e.uri||e)),i.uniq);function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const F=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),W=e=>{if(e.startsWith("relation.attributes")){const t=F(e);return t.length>1?t.slice(0,-1):null}return null},B=(0,i.map)((e=>{return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){H(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:W(e.id),headCellRenderer:z,rowCellValueRenderer:(t=e.id,"entity.label"===t?L:V.Z)});var t})),q=(0,b.makeStyles)({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},emptyData:{marginBottom:"30px"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}});var _=n(23883),G=n(87037),Y=n(29754),Q=n(6163);const $=e=>{let{canUpdate:t,canRemove:n,handleEditRelation:r,handleRemoveRelation:a}=e;return o().createElement(o().Fragment,null,t&&o().createElement(_.Z,{title:h().text("Edit")},o().createElement(G.Z,{onClick:r,size:"large"},o().createElement(Y.Z,null))),n&&o().createElement(_.Z,{title:h().text("Remove")},o().createElement(G.Z,{onClick:a,size:"large"},o().createElement(Q.Z,null))))};$.propTypes={canUpdate:g().bool,canRemove:g().bool,handleEditRelation:g().func,handleRemoveRelation:g().func};const X=$;function K(){return K=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K.apply(this,arguments)}const J=e=>{let{mode:t,columnsData:n,connections:r,metadata:l,sorting:s,onSort:p,filters:d,onFilter:m,onEditRelation:g,onRemoveRelation:f,basicTableRef:h,allowOnlyCreateNew:b}=e;const y=(0,a.useMemo)((()=>((e,t,n)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,r)=>{let{id:a}=r;return(0,i.assoc)(a,((e,t,n)=>{let{entity:r,relation:a}=t;switch(e){case"entity.label":return{entity:r,entityType:(0,u.nt9)(n,r.entityType)};case"relation.label":return a.relationLabel||(0,u.Lmx)(n,a.relationType);case"relation.activeness.startDate":return a.startDate;case"relation.activeness.endDate":return a.endDate;default:return((e,t)=>(0,i.pipe)((0,i.path)(["object","attributes"]),(0,u.tT_)(e))(t))(F(e),a)}})(a,e,n),t)}),{}),(0,i.assoc)("connection",e))(t))))(r,n,l)),[r,n,l]),v=(0,a.useMemo)((()=>B(n)),[n]),x=q(),E=(0,a.useCallback)((e=>o().createElement(N,K({},e,{isSorted:!!s&&s.field===e.columnData.id}))),[s]),[w,S]=(0,a.useState)(null),{canRemove:C,canUpdate:O}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:a,onEditRelation:o,allowOnlyCreateNew:l}=e;const i=(0,u.xvW)(r);if(c.N5.mode.selectors.getIsEditableMode(n)&&r&&(!l||i)){const{relation:{relationType:e}}=r,l=(0,u.$qe)(r),i=(0,u.V3K)(t,e);return{canRemove:a&&!l&&(0,u.Edd)(n,i),canUpdate:o&&!l&&(0,u.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:t,onRemoveRelation:f,onEditRelation:g,metadata:l,allowOnlyCreateNew:b,connection:(0,i.path)([w,"connection"],y)}),P=(0,a.useCallback)((e=>S(e)),[]),k=(0,a.useCallback)((()=>g((0,i.path)([w,"connection"],y))),[w,g,y]),R=(0,a.useCallback)((()=>f((0,i.path)([w,"connection","relation","relationUri"],y))),[w,f,y]),T=C||O?o().createElement(X,{handleEditRelation:k,handleRemoveRelation:R,canRemove:C,canUpdate:O}):void 0;return o().createElement("div",{className:x.tableContainer},o().createElement(Z.Z,{autosizing:!0,maxHeight:477,columnsData:v,rowsData:y,sorting:s,onSort:p,filters:d,onFilter:m,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:E,onRowHover:P,hoverRowIndex:w,hoveredRowRightContent:T,classes:{hoveredRowRightContentWrapper:x["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:x["row-cell__buttons-container"]},ref:h,resizeDebounceDelay:150}))};J.propTypes={mode:g().string,columnsData:R.uz,connections:g().arrayOf(u.Rjq),metadata:u.pGS,filters:g().objectOf(R.Dq),onFilter:g().func,sorting:R.nI,onSort:g().func,onEditRelation:g().func,onRemoveRelation:g().func,basicTableRef:g().shape({current:g().object}),allowOnlyCreateNew:g().bool};const ee=J;var te=n(79312),ne=n(52194),re=n(58003),ae=n(55310),oe=n(46804),le=n(33903),ie=n(87825),se=n(47019),ce=n(30721),ue=n(80852),pe=n(50985),de=n(39475);const me=(0,b.makeStyles)((()=>({popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ge=e=>{let{className:t,showInactive:n,onShowInactiveChange:r}=e;const l=me(),i=(0,a.useRef)(),[s,c]=(0,a.useState)(!1),u=()=>c((e=>!e));return o().createElement(o().Fragment,null,o().createElement(de.k,{className:t,ref:i,tooltipTitle:h().text("More"),icon:pe.Z,onClick:u,size:"L"}),o().createElement(se.ZP,{open:s,classes:{paper:l.popupContent},anchorEl:i.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(ce.Z,{classes:{label:l.checkboxControlLabel},control:o().createElement(ue.Z,{className:l.checkboxControlCheckbox,checked:n||!1,onChange:e=>r(e.target.checked)}),label:h().text("Show inactive Relationships")})))},fe=(0,b.makeStyles)({header:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},moreButton:{marginLeft:"-6px"},rightMenuItems:{display:"flex",flex:"1 0 auto",justifyContent:"flex-end",alignItems:"center"}}),he=e=>{let{title:t,total:n,searchQuery:r,onChangeSearchQuery:a,filtersEnabled:l,onToggleFilters:i,columnsData:s,selectedColumns:c,onChangeColumns:u,showInactive:p,onChangeShowInactive:d}=e;const m=fe();return o().createElement(ne.Z,{title:t,className:m.header},o().createElement(re.Z,{widthToHide:500},o().createElement(ae.Z,{height:24,margin:16}),o().createElement(te.Z,{className:m.totalCaption,variant:"caption"},n>1?h().text("${count} entities",{count:n}):h().text("${count} entity",{count:n}))),o().createElement("div",{className:m.rightMenuItems},o().createElement(oe.i,{query:r,onChange:a}),o().createElement(le.Z,{enabled:l,onClick:i}),o().createElement(ae.Z,{height:24,margin:4}),o().createElement(ie.Z,{columnsData:s,selectedColumns:c,onChangeColumns:u}),o().createElement(ge,{className:m.moreButton,showInactive:p,onShowInactiveChange:d})))};he.propTypes={title:g().string,total:g().number,columnsData:R.uz,selectedColumns:g().arrayOf(g().string),onChangeColumns:g().func,searchQuery:g().string,onChangeSearchQuery:g().func,filtersEnabled:g().bool,onToggleFilters:g().func,showInactive:g().bool,onChangeShowInactive:g().func};const be=he;var ye=n(75975),ve=n(79573);function xe(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){Ee(e,t,n[t])}))}return e}function Ee(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="CHANGE_SEARCH_QUERY",Se="CHANGE_SHOW_INACTIVE",Ce=xe({},ye.ZP.actions,{changeSearchQuery:(0,ve.zD)(we),changeShowInactive:(0,ve.zD)(Se)}),Oe=(e,t)=>{switch(t.type){case we:return xe({},e,{searchQuery:t.payload,page:0});case Se:return xe({},e,{showInactive:t.payload});default:return ye.ZP.reducer(e,t)}};var Pe=n(80231),ke=n(43407),Ne=n(80225),Ze=n(47081),Re=n(64047),Te=n(82565),je=n(79298),Ie=n(33945),De=n(87378);const Le=[10,25,50,100],Me=[{id:"entity.label",get label(){return h().text("Entity label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING},hideable:!1},{id:"relation.label",get label(){return h().text("Directional label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING}},{id:"relation.activeness.startDate",get label(){return h().text("Start date")},dataTypeDefinition:u.PY2.startDate},{id:"relation.activeness.endDate",get label(){return h().text("End date")},dataTypeDefinition:u.PY2.endDate}],Ae=(0,i.pipe)(u.Tde,(0,i.concat)("relation.")),ze=(0,i.pipe)((0,i.map)((e=>({id:Ae(e.uri),label:e.label,description:e.description,dataTypeDefinition:(0,u.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),Ve=(0,i.pipe)(((e,t)=>{let{content:{inRelations:n=[],outRelations:r=[]}}=e,{relationTypes:a}=t;return(0,i.pipe)(U,(0,i.chain)((e=>(0,i.pipe)((0,i.find)((0,i.propEq)("uri",e)),u.DK$)(a))))([...n,...r])}),ze,(0,i.concat)(Me));var Ue=n(79575);const He=(0,b.makeStyles)({addArea:{display:"flex",alignItems:"center",height:"48px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},noData:{fontSize:"13px",paddingLeft:"20px",marginBottom:"20px",marginTop:"10px",color:"rgba(0,0,0,0.54)"}});function 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 We=(0,i.pluck)("id",Me),[Be]=We;function qe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _e=(0,i.memoizeWith)(((e,t)=>t.id),u.fS6),Ge=(0,s.connect)(((e,t)=>{const{config:n}=t;return{connections:c.ZP.selectors.getConnectionsWithDraftsByViewId(e,n.id),total:c.ZP.selectors.getTotalByViewId(e,n.id),entity:c.ZP.selectors.getEntity(e),metadata:c.ZP.selectors.getMetadata(e),mode:c.ZP.selectors.getMode(e),relationToAdd:c.ZP.selectors.getRelationToAddByViewId(e,n.id),relationsToEdit:c.ZP.selectors.getRelationsToEditByViewId(e,n.id),checkIfCanAddRelations:c.ZP.selectors.getCheckIfCanAddRelations(e,n.content)}}),void 0,((e,t,n)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){qe(e,t,n[t])}))}return e}({},e,t,n,{config:_e(e.metadata,n.config)})))((e=>{let{className:t,config:n,entity:r,metadata:l,connections:p=[],total:d=0,mode:m,relationToAdd:g,relationsToEdit:f=[],checkIfCanAddRelations:b,dispatch:y,readOnlyMode:v}=e;const E={searchQuery:"",filters:null,visibleColumns:We,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||Be},page:0,rowsPerPage:n.max||15,showInactive:!1},w=He(),S=(0,a.useContext)(Pe.j)?m:u.fO_.VIEWING,[C,O]=(0,a.useReducer)(Oe,E),P=(0,i.pipe)(Ce.changeSearchQuery,O),k=(0,i.pipe)(Ce.changeShowInactive,O),N=(0,a.useContext)(ke.Y),Z=(0,s.useSelector)(c.ZP.selectors.getShowAttributeDescription),R=(0,a.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Fe(e,t,n[t])}))}return e}({},N,{showDescription:Z})),[N,Z]);(0,a.useEffect)((()=>{P("")}),[null==r?void 0:r.uri]);const{visibleColumns:T,searchQuery:j,filters:I,sorting:D,page:L,rowsPerPage:M,showInactive:A}=C,z=(0,a.useMemo)((()=>Ve(n,l)),[n,l]),V=(0,a.useMemo)((()=>T.map((e=>z.find((0,i.propEq)("id",e))))),[T,z]),U=(0,a.useMemo)((()=>((e,t,n)=>{const r=u.wSh.fromFalsy(e).map(u.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome(""),a=(0,Ue.Tz)(n,t);return(new u.MEy).addClause(r).addClause(a).build()})(j,I,V)),[I,j]),{isLoading:H}=(0,Ne.a)({sorting:D,filter:U,page:L,rowsPerPage:M,config:n,entity:r,relationActivityFilter:A?u.Ng6.ALL:u.Ng6.ACTIVE_ONLY,mode:m}),F=(0,a.useMemo)((()=>{return e=E.rowsPerPage,Le.filter((t=>t!==e)).concat(e).sort(i.subtract);var e}),[]),{handleRowsPerPageChange:W,handlePageChange:B}=(0,a.useMemo)((()=>({handleRowsPerPageChange:(0,i.pipe)(Ce.changeRowsPerPage,O),handlePageChange:(0,i.pipe)(Ce.changePage,O)})),[]),q=(0,a.useCallback)((()=>{const e=(0,u.vlo)({config:n,mode:S,metadata:l,parentEntityUri:void 0});(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),y)(e)}),[n,S,l,y]),_=(0,a.useCallback)((e=>{y(c.N5.relations.actions.closeRelationEditor(n.id,e)),y(c.N5.relations.actions.removeRelation(n.id,e));const t=p.find((t=>(0,u.w1L)(t)===e)),r=(0,u.yV)(t);(0,u.ZiX)(r)&&y(c.N5.modifiedEntities.actions.entityDeleted(r))}),[n,p,y]),G=r&&b&&!v,Y=g?[g,...f]:f,{canUpdate:Q,canDelete:$}=(0,Ze.l)(),X=Q(n)&&!v,K=$(n)&&!v,J=(0,a.useRef)(null);return(0,Re.I)(n.id),o().createElement(ke.Y.Provider,{value:R},o().createElement(Te.Z,{className:t},o().createElement(be,{title:n.caption,total:d,columnsData:z,selectedColumns:T,onChangeColumns:(0,i.pipe)(Ce.changeColumns,O),searchQuery:j,onChangeSearchQuery:P,filtersEnabled:!!I,onToggleFilters:(0,i.pipe)(Ce.toggleFilters,O),showInactive:A,onChangeShowInactive:k}),G&&o().createElement("div",{className:w.addArea},o().createElement(x,{onClick:q})),Y.map((e=>o().createElement(je.Z,{key:(0,u.w1L)(e),connection:e,config:n,mode:S,metadata:l}))),o().createElement("div",{style:{position:"relative"}},o().createElement(ee,{mode:S,columnsData:V,connections:p,metadata:l,filters:I,onFilter:(0,i.pipe)(Ce.changeFilter,O),sorting:D,onSort:(0,i.pipe)(Ce.toggleSort,O),onEditRelation:X?(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),y):null,onRemoveRelation:K?_:null,basicTableRef:J,allowOnlyCreateNew:n.allowOnlyCreateNew}),p.length?o().createElement(Ie.Z,{count:d,rowsPerPageOptions:F,rowsPerPage:M,onChangeRowsPerPage:W,page:L,onChangePage:B,basicTableRef:J}):o().createElement(te.Z,{className:w.noData},h().text("No data found")),H&&o().createElement(De.Z,null))))}));var Ye=n(40855),Qe=n(54426),$e=n(41633),Xe=n(32479);const Ke=(0,Qe.Z)({productionPrefix:"relTable",disableGlobal:!0,seed:"relT"}),Je=e=>{let{config:t,onResize:n=i.identity,className:a,readOnlyMode:s}=e;return o().createElement(T.m.Provider,{value:t.id},o().createElement(Ye.ZP,{generateClassName:Ke},o().createElement($e._,{dateAdapter:r.Q},o().createElement(l.Z,{handleHeight:!0,onResize:(e,t)=>n(Math.floor(e),Math.floor(t))}),t&&o().createElement(Ge,{config:t,className:a,readOnlyMode:s}),o().createElement(Xe.Z,null))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5e48399c-3d94-4644-b249-85328bac4659",e._sentryDebugIdIdentifier="sentry-dbid-5e48399c-3d94-4644-b249-85328bac4659")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"1.4.1664"},(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[2300],{812:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");t.Z=l},16e3:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M7.38 21.01c.49.49 1.28.49 1.77 0l8.31-8.31c.39-.39.39-1.02 0-1.41L9.15 2.98c-.49-.49-1.28-.49-1.77 0s-.49 1.28 0 1.77L14.62 12l-7.25 7.25c-.48.48-.48 1.28.01 1.76z"}),"ArrowForwardIosRounded");t.Z=l},74654:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");t.Z=l},70369:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Create");t.Z=l},13510:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}),"History");t.Z=l},36592:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2zm0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19v10z"}),"Inbox");t.Z=l},89025:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined");t.Z=l},93400:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 15c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1s1 .45 1 1v4c0 .55-.45 1-1 1zm1-8h-2V7h2v2z"}),"InfoRounded");t.Z=l},944:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"ReportProblem");t.Z=l},71976:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z"}),"ThumbDown");t.Z=l},18876:(e,t,n)=>{var r=n(71600);t.Z=void 0;var a=r(n(68671)),o=n(52322),l=(0,a.default)((0,o.jsx)("path",{d:"M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z"}),"ThumbUp");t.Z=l},32300:(e,t,n)=>{n.d(t,{vC:()=>li,Gv:()=>eo,_n:()=>Dl,tM:()=>$l});var r=n(24328),a=n.n(r),o=n(9366),l=n(50914),i=n(54426),s=n(40855),c=n(44443),u=n(41633),p=n(18408),d=n(63532),m=n(43751),g=n(14235),f=n(32479),h=n(31421),b=n(2507),y=n.n(b),v=n(45738),x=n(52730),E=n(589),w=n(96697),S=n(1824),C=n(36852),O=n(43407),P=n(35722),k=n(79002),N=n(61604),Z=n(80231),R=n(14834),T=n(62228),j=n(40006),I=n(43460),D=n(52708),L=n(87378),M=n(8007),A=n(14593),z=n(71153),V=n.n(z),U=n(153),H=n(56346);const F=a().createContext(null);F.displayName="SingleAttributeContext";var W=n(80687),B=n(82565),q=n(33945),_=n(83422),G=n(79312),Y=n(52194),Q=n(32701),$=n(12364),X=n(58003),K=n(55310),J=n(33043),ee=n(46804),te=n(47019),ne=n(38677),re=n(80653),ae=n(30721),oe=n(80852),le=n(72342);const ie=(0,le.makeStyles)((()=>({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"}}))),se=e=>{let{className:t}=e;const n=ie(),o=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(F),u=()=>i((e=>!e));return a().createElement(a().Fragment,null,a().createElement(ne.Z,{ref:o,classes:{root:V()(n.triggerButton,t)},onClick:u},a().createElement(re.Z,null)),a().createElement(te.ZP,{open:l,classes:{paper:n.popupContent},anchorEl:o.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(ae.Z,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:a().createElement(oe.Z,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:y().text("Show inactive values")})))},ce=(0,le.makeStyles)((()=>({root:{padding:"0 4px 0 16px"},rightMenuItems:{display:"flex",flex:"1 0 auto",justifyContent:"flex-end",alignItems:"center"},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"}}))),ue=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:o,isEditableMode:l}=e;const i=ce(),{searchQuery:s,setSearchQuery:c,setPage:u,totalNonVisibleValues:p,nonVisibleValues:d,attributeType:m}=(0,r.useContext)(F),g=l&&(null==m?void 0:m.required);return a().createElement(Y.Z,{title:t,className:i.root},g&&a().createElement(Q.Z,null),a().createElement($.Z,{description:null==m?void 0:m.description}),a().createElement(X.Z,{widthToHide:400},a().createElement(K.Z,{height:24,margin:16}),a().createElement(G.Z,{className:i.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),a().createElement(J.Z,{nonOvTotal:p,className:i.ovIcon,nonOvValues:d,attributeType:m}),a().createElement("div",{className:i.rightMenuItems},a().createElement(ee.i,{query:s,onChange:e=>{c(e),u(0)}}),o&&a().createElement(se,null)))};var pe=n(93553),de=n(56961),me=n(40941),ge=n(63928),fe=n(55401),he=n(11387),be=n(50548);const ye=h.nIW,ve=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ve(n,t)})))):h.P6Y.strings.search(String(e),t),xe=async e=>{let{metadata:t,entity:n,attributeTypeUri:r,defaultMaxValues:a=1/0,offset:o=0,searchQuery:i=""}=e;const s=(0,l.pipe)(h.XtP,(0,l.filter)((e=>{let{value:t}=e;return ve(t,i)})))(t,n,r),c=(0,l.filter)(h.OXP,s);return{[(0,h.xy8)(r)]:{[ye(r)]:c.slice(o,o+a),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}},Ee=(0,le.makeStyles)((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",borderColor:"rgba(0,0,0,0.12)"},ovFalse:e.inactive,noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px 8px 0"}})));function we(){return we=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},we.apply(this,arguments)}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ce(e,t,n[t])}))}return e}function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Oe=[],Pe=(0,be.l)(I.NY,((e,t)=>{let{parentUri:n,attributeType:r}=t;const{element:a,type:o}=e||{};return{highlightedError:(0,I.Ie)(o)&&(0,h.Wah)(a,n,r.uri)?e:null}}),(e=>{let{values:t,attributeType:n,parentUri:o,showInactive:i,noDataText:s,highlightedError:c}=e;const u=Ee(),{uri:p,required:m,cardinality:g,name:f}=n,b=(0,x.useDispatch)(),E=(0,r.useContext)(d.m),w=(0,x.useSelector)(v.ZP.selectors.getEntity),S=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,w.uri)||{})),C=(0,x.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,o,n))),O=(0,x.useSelector)((e=>(0,h.tQX)(o,n,v.ZP.selectors.getProfileErrors(e)))),P=(0,x.useSelector)(v.ZP.selectors.getMode),k=(0,h.xy8)(n),N=(0,l.pipe)((0,l.pathOr)(Oe,[k,f]),(0,l.map)((0,l.prop)("uri")))(w),Z=(0,l.pathOr)(Oe,[k,f],S),R=Z.map((0,l.prop)("uri")),T=(0,h.ZiX)(w.uri),j=(0,r.useMemo)((()=>(0,h.gjI)({parentUri:o,attributeType:(0,l.omit)(["defaultValue"],n)})),[o,n]),{ref:I,errorClassName:D}=(0,me.B)({highlightedError:c,isSimple:!0}),L=(0,h.O27)(Z),M=m&&L,A=M?[j]:Z.filter((0,l.pipe)((0,l.prop)("uri"),h.ZiX)),z=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.addAttributes,b)(e.map((e=>Se({},e,{viewId:E}))))),[E,b]),U=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.modifyAttribute,b)(Se({},e,{viewId:E}))),[E,b]),H=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.removeAttribute,b)(Se({},e,{viewId:E}))),[E,b]),F=(0,r.useCallback)((0,l.pipe)(v.N5.errors.actions.errorDeactivated,b),[b]),W=(0,r.useCallback)((()=>{const e=e=>({parentUri:o,attributeType:e});if(M&&!(0,h.YkM)(n.type)){const t=[e((0,l.omit)(["defaultValue"],n)),e(n)];return z(t)}return z([e(n)])}),[z,o,n,M]),B=(0,h.Vg3)({attributeType:n,mode:P}),q={attributeType:n,errors:C,crosswalks:S.crosswalks,mode:P,onAddAttributes:z,onChangeAttribute:U,onDeactivateError:F,showNonOv:i},_=0===A.length&&0===t.length;return!(0,l.isEmpty)(S)&&a().createElement("div",{ref:I,className:D},a().createElement(ge.Z,{cardinality:g}),a().createElement(fe.Z,{message:O}),B&&a().createElement(ne.Z,{color:"primary",onClick:W,className:u.moreButton},a().createElement(pe.Z,{classes:{root:u.icon}}),a().createElement("div",{className:u.buttonLabel},y().text("Add"))),A.map(((e,t)=>a().createElement(he.Z,we({key:e.uri},q,{attributeValue:e,lazy:M&&!m,showEmptyEditors:T,ownError:(0,h.ADq)(e,t,p,C),onDeleteAttribute:H,isEmptyEditor:M})))),A.length>0&&t.length>0&&a().createElement(de.Z,{className:u.divider}),t.map((e=>{const t=Z.find((0,l.propEq)("uri",e.uri)),n=t||e,r=N.includes(n.uri)&&!R.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,h.vKJ)({valueTransformer:(0,l.unless)(h.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:V()({[u.ovFalse]:!(0,h.OXP)(n)})},a().createElement(he.Z,we({},q,{attributeValue:n,ownError:(0,h.ADq)(n,null,p,C),onDeleteAttribute:H,state:i})))})),_&&a().createElement(G.Z,{className:u.noData},s))}));var ke=n(11013);const Ne=(0,le.makeStyles)((()=>({simpleAttribute:{fontSize:"13px",lineHeight:"15px",marginBottom:"4px"}}))),Ze=e=>{let{values:t,attributeType:n,showInactive:r}=e;const o=Ne(),l=!(0,h.YkM)(n);return a().createElement(a().Fragment,null,t.map((e=>a().createElement(ke.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r,className:V()({[o.simpleAttribute]:l})}))))},Re=(0,le.makeStyles)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",padding:"4px 16px 9px",overflow:"hidden",flexGrow:1},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"},pagination:{flexGrow:0,flexShrink:0}}))),Te=15,je=e=>{let{config:t,className:n}=e;const{caption:o,max:l=Te,showInactiveValuesMenu:i}=t,s=Re(),{values:c,totalVisibleValues:u,page:p,setPage:d,isLoading:m,hasPaging:g,attributeType:f,showInactive:h}=(0,r.useContext)(F),b=(0,x.useSelector)(v.ZP.selectors.getEntityUri),E=(0,x.useSelector)(v.ZP.selectors.getIsViewMode),w=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),S=(0,x.useSelector)(v.ZP.selectors.getPivotingAttributes),C=0!==c.length,O=t["text-empty"]||y().text("No data found");return a().createElement(W.J.Provider,{value:S},a().createElement(B.Z,{className:V()(s.root,n)},a().createElement(ue,{totalVisibleValues:u,caption:o,showInactiveValuesMenu:i,isEditableMode:w}),a().createElement(_.Z,{className:s.content},(()=>{if(m)return a().createElement(L.Z,null);if(f){if(E&&C){const e={values:c,attributeType:f,showInactive:h};return a().createElement(Ze,e)}if(w){const e={values:c,attributeType:f,parentUri:b,showInactive:h,noDataText:O};return a().createElement(Pe,e)}}return a().createElement(G.Z,{className:s.noData},O)})()),g&&a().createElement(q.Z,{count:u,page:p,rowsPerPage:l,rowsPerPageOptions:[],onChangePage:d,classes:{root:s.pagination}})))};var Ie=n(19701),De=n(55962);function Le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Me=(e,t)=>{const{attributeUri:n,max:a=15}=e,o=(0,x.useSelector)(v.ZP.selectors.getMetadata),[i,s]=(0,r.useState)([]),[c,u]=(0,r.useState)(null),[p,d]=(0,r.useState)(!1),m=(0,Ie._)(),g=(0,r.useRef)(null),f=(0,x.useDispatch)(),b=(0,x.useSelector)(v.ZP.selectors.getApiPath),E=(0,x.useSelector)(v.ZP.selectors.getTenant),w=(0,x.useSelector)(v.ZP.selectors.getEntityWithDiff),S=(0,x.useSelector)(v.ZP.selectors.getIsViewMode),C=(0,x.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),O=(0,x.useSelector)(v.ZP.selectors.getHistoryDiff),P=w.uri,k=ye(n),N=(0,h.xy8)(n);g.current=(0,h.JQy)(w,P,k);const Z=(0,r.useMemo)((()=>(0,h.zeJ)(o,n)),[o,n]),{globalFilter:R}=(0,x.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),{showInactive:T}=t,j=(0,r.useCallback)((()=>{if(Z&&(0,h.Uty)(Z)&&!(0,h.ZiX)(P)&&(0,h.YOQ)(n)){d(!0);const{page:e,showInactive:r}=t,i=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"]),c=(0,h.biM)(w)||C?xe:h.KbL;m(c(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Le(e,t,n[t])}))}return e}({metadata:o,entity:w,apiPath:b,tenant:E,parentUri:P,defaultMaxValues:a,attributeTypeUri:n,offset:a*e,globalFilter:R,options:r?"":void 0},i))).then((e=>{const t=(0,l.path)([N],e),r=(0,l.pathOr)([],[k],t);C||f(v.N5.actions.processNextPageOfAttributeValues({parentUri:P,attributeTypeUri:n,attributeTypeName:k,values:r})),s(r.map((e=>{var t;return(null===(t=g.current)||void 0===t?void 0:t.find((0,l.propEq)("uri",e.uri)))||e}))),u((0,l.path)(["paging",n],t))})).catch((e=>{console.error(e),s([]),f(v.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong"))))})).finally((()=>{d(!1)}))}else s([]),u(null)}),[b,P,E,n,a,o,t,R,Z,C,O]);(0,r.useEffect)((()=>{j()}),[j]),(0,De.D)((()=>{S&&j()}),[S]);const I=(0,l.partition)(h.OXP),[,D]=I(g.current||[]),L=T?[]:D,M=T?"totalValues":"totalOvValues",A=(0,l.ifElse)((0,l.has)(M),(0,l.prop)(M),(0,l.always)(i.length))(c),z=a<A,V=null!=c&&c.totalValues?c.totalValues-A:L.length;return{values:i,isLoading:p,hasPaging:z,totalVisibleValues:A,attributeType:Z,totalNonVisibleValues:V,nonVisibleValues:L}};function Ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ze=n(80225),Ve=n(64047),Ue=n(10609),He=n(63929),Fe=n(1128),We=n(39475),Be=n(74654),qe=n(812);const _e=a().createContext(null);_e.displayName="RelationsViewStateContext";const Ge=(0,le.makeStyles)((e=>({button:{color:e.palette.text.secondary,width:"36px",minWidth:"36px"},popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"},divider:{borderColor:"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"}}))),Ye=e=>{let{className:t}=e;const n=Ge(),o=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(_e),[m,g]=(0,r.useState)(!1),f=()=>g((e=>!e)),b=!(0,h.O27)(d),v="asc"===s;return a().createElement(a().Fragment,null,a().createElement(ne.Z,{ref:o,classes:{root:V()(n.button,t)},onClick:f},a().createElement(re.Z,null)),a().createElement(te.ZP,{open:m,classes:{paper:n.popupContent},anchorEl:o.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(ae.Z,{classes:{label:n.checkboxControlLabel},control:a().createElement(oe.Z,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),b&&a().createElement(a().Fragment,null,a().createElement(de.Z,{className:n.divider}),a().createElement(G.Z,{className:n.title,variant:"h6"},y().text("Sort by")),a().createElement("div",{className:n.sortControls},a().createElement(Fe.Z,{entries:d,TextFieldProps:{variant:"filled"},classes:{root:n.sortSelectorRoot,menuItem:n.sortSelectorMenuItem},fullWidth:!0,disableUnderline:!0,value:u,onChange:p,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"}}}),a().createElement(We.k,{tooltipTitle:v?y().text("Ascending"):y().text("Descending"),icon:v?Be.Z:qe.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Ye.displayName="FilterButton";const Qe=Ye,$e=(0,le.makeStyles)({header:{padding:"0 6px 0 16px"},rightMenuItems:{display:"flex",flex:"1 0 auto",justifyContent:"flex-end",alignItems:"center"},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 Xe=n(76981),Ke=n(98538);const Je=a().createContext(null);function et(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){tt(e,t,n[t])}))}return e}function tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const nt=Math.pow(2,31)-1,rt=(0,le.makeStyles)((()=>({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 at=n(22118),ot=n(71001);const lt=e=>{let{label:t}=e;const n=rt();return a().createElement(ot.Z,{classes:{anchorOriginTopRightRectangular:n.badgePosition,badge:n.badge},badgeContent:t},a().createElement(Xe.Z,null))},it=()=>{const{tenants:e,selectedTenant:t,onConfirmImport:n,onCancelConfirmation:o,onImportClick:l}=(()=>{var e;const t=(0,x.useSelector)(v.ZP.selectors.getDataTenants),n=(0,x.useDispatch)(),{config:a,reloadRelations:o}=(0,r.useContext)(Je),l=(0,x.useSelector)(v.ZP.selectors.getEntityUri),[i,s]=(0,r.useState)([]),[c,u]=(0,r.useState)(null),p=(0,x.useSelector)(v.ZP.selectors.getDtssPath),d=(0,x.useSelector)(v.ZP.selectors.getTenant),m=[et({},a.content,{offset:0,max:null!==(e=a.maxDtssImport)&&void 0!==e?e:nt})],g=(0,r.useCallback)((()=>{s([]),a.importFromDT&&!(0,h.ZiX)(l)&&Promise.all((t||[]).map((e=>(0,h.QXb)({entityUri:l,content:m,dtssPath:p,customerTenant:d,dataTenant:e.id}).then((t=>{let{hasNonImportedConnections:n}=t;return et({},e,{hasNonImportedConnections:n})}))))).then((e=>e.filter((e=>e.hasNonImportedConnections)))).then(s)}),[l,p,d,a,t]),f=(0,r.useCallback)((()=>{(0,h.MOC)({entityUri:l,content:m,dtssPath:p,customerTenant:d,dataTenant:c.id}).then((()=>{o(),g()})).catch((e=>n(v.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong")))))),u(null)}),[l,p,d,a,g,o,c,u]);(0,r.useEffect)((()=>{g()}),[g]);const b=(0,r.useCallback)((()=>u(null)),[]),E=(0,r.useCallback)((e=>u(e)),[]);return{tenants:i,selectedTenant:c,onConfirmImport:f,onCancelConfirmation:b,onImportClick:E}})(),i=rt(),s=1===e.length,c=s?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,s?a().createElement("div",{className:i.button},a().createElement(We.k,{size:"L",icon:Xe.Z,tooltipTitle:y().text("Import connections from ${label}",{label:e[0].label}),onClick:()=>l(e[0])}),a().createElement("div",{className:V()(i.tenant)},c)):a().createElement(Ke.Z,{menuId:"importDT-table-actions",buttonComponent:We.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>a().createElement(lt,{label:c})},menuItems:e.map((e=>({onClick:()=>{l(e)},text:e.label})))}),a().createElement(at.Z,{open:!!t,title:y().text("Confirmation"),content:y().text("Import connections from ${label}?",{label:null==t?void 0:t.label}),discardCaption:y().text("Cancel"),saveCaption:y().text("Import"),onDiscard:o,onSave:n})))},st=e=>{let{title:t,total:n}=e;const o=$e(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(_e);return a().createElement(Y.Z,{title:t||"",className:o.header},n>0&&a().createElement(X.Z,{widthToHide:400},a().createElement(K.Z,{height:24,margin:16}),a().createElement(G.Z,{className:o.totalCaption,variant:"caption"},n>1?y().text("${count} items",{count:n}):y().text("${count} item",{count:n}))),a().createElement("div",{className:o.rightMenuItems},a().createElement(ee.i,{query:l,onChange:i}),a().createElement(it,null),a().createElement(Qe,null)))};var ct=n(79298),ut=n(29754),pt=n(6163),dt=n(96379),mt=n(18527),gt=n(90838),ft=n(23883);const ht=(0,le.makeStyles)((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 bt(){return bt=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},bt.apply(this,arguments)}const yt=e=>{let{label:t,entity:n,children:o}=e,i=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 s=ht(),c=(0,Ie._)(),u=(0,x.useSelector)(v.ZP.selectors.getTenant),p=(0,x.useSelector)(v.ZP.selectors.getDtssPath),[d,m]=(0,r.useState)(!1),[g,f]=(0,r.useState)(null);(0,r.useEffect)((()=>{f(null)}),[n]);const b=(0,r.useCallback)((()=>{if(null!=n&&n.entityUri&&!(0,h.ZiX)(null==n?void 0:n.entityUri)&&(0,l.isNil)(g)){const e=(0,l.ifElse)(h.biM,(e=>(0,h.vTU)({entityUri:e.entityUri,dataTenant:e.dataTenant,customerTenant:u,dtssPath:p})),(e=>(0,h.XkT)(e.entityUri)));m(!0),c(e(n)).then((e=>{let{secondaryLabel:t}=e;f(t)})).finally((()=>{m(!1)}))}}),[p,n,u,c,g]),y=a().createElement("div",{className:s.tooltipContent},a().createElement("div",{className:s.label},t),d&&a().createElement(gt.Z,{size:16,classes:{colorPrimary:s.progress}}),g&&a().createElement("div",{className:s.secondaryLabel},g));return a().createElement(ft.Z,bt({onOpen:b,title:y,disableFocusListener:!0,classes:{tooltip:s.tooltip}},i),o)},vt=(e,t)=>{const{entity:n,relation:r}=e;return{entityType:(0,h.nt9)(t,null==n?void 0:n.entityType),entityLabel:(0,h.idV)(null==n?void 0:n.entityLabel),preparedUri:(0,h.wwR)({uri:null==n?void 0:n.entityUri,dataTenant:null==n?void 0:n.dataTenant}),relationLabel:(null==r?void 0:r.relationLabel)||(0,h.Lmx)(t,null==r?void 0:r.relationType)}},xt=(0,le.makeStyles)((()=>({container:{display:"flex"}})));function Et(){return Et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Et.apply(this,arguments)}const wt=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=xt();return a().createElement("div",{className:o.container},a().createElement(ne.Z,Et({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),a().createElement(ne.Z,Et({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},St=(0,le.makeStyles)((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"}}))),Ct=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:o,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=St(),{entity:d,relation:m}=t,g=(0,h.$qe)(t),f=(0,h.xr3)(t),b=(0,h.iJH)(t),{entityType:E,entityLabel:w,preparedUri:S,relationLabel:C}=vt(t,n),O=(0,h.Fn9)(m)&&(0,h.Fn9)(d),P=(0,x.useSelector)(v.ZP.selectors.getMode),{canRemove:k,canUpdate:N}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:a,onEditRelation:o}=e;if((n===h.ARY.Editing||n===h.ARY.Suggesting)&&r){const{relation:{relationType:e}}=r,l=(0,h.$qe)(r),i=(0,h.V3K)(t,e);return{canRemove:a&&!l&&(0,h.Edd)(n,i),canUpdate:o&&!l&&(0,h.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:P,onRemoveRelation:l,onEditRelation:i,metadata:n,connection:t}),Z=(0,r.useCallback)((()=>l(t.relation.relationUri)),[l,t]),R=(0,r.useCallback)((()=>i(t)),[i,t]),T=(0,r.useCallback)((()=>{s(t)}),[s,t]),j=(0,r.useCallback)((()=>c(t)),[c,t]),I=(k||N)&&o&&!t.suggested?a().createElement(a().Fragment,null,N&&a().createElement(We.k,{icon:ut.Z,size:"XS",onClick:R,tooltipTitle:y().text("Edit")}),k&&a().createElement(We.k,{icon:pt.Z,size:"XS",onClick:Z,tooltipTitle:y().text("Remove")})):void 0,D=t.suggested?a().createElement(wt,{acceptRelation:T,ignoreRelation:j,size:"small",disabled:b}):void 0,L=b?y().text("ignored"):y().text("edited");return a().createElement("div",{className:V()(p.container,{[p.rowInactive]:!O},{[p.removed]:g||b})},a().createElement("div",{className:p.row},u&&u(),a().createElement(dt.Z,{className:p.entityAvatar,entityType:E}),a().createElement(mt.Z,{value:S,className:p.entityLabelContainer},a().createElement(yt,{label:w,entity:d},a().createElement("span",{className:p.entityLabel},w)),(f||b)&&a().createElement(G.Z,{variant:"caption",className:p.editedLabel},"(",L,")"),C&&a().createElement("span",{className:p.relationLabel},`, ${C}`)),a().createElement("div",{className:p.editButtonsContent},I),D))}));Ct.displayName="EditableRelationItem";const Ot=Ct,Pt=(0,l.when)(h.Kn2,(0,l.prop)("uri")),kt=(e,t)=>{const n=(e,t)=>(t?(0,h.VGB)(t):[]).map((t=>({type:Pt(t),direction:e===h.Nsj.IN?h.Nsj.IN:h.Nsj.OUT})));return n(h.Nsj.IN,e).concat(n(h.Nsj.OUT,t))[0]};function Nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Zt=n(89507),Rt=n(65643);const Tt=(0,le.makeStyles)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),jt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:o}=e;const l=Tt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,h.xvW)(n)?null:o?a().createElement(Rt.Z,c):a().createElement(Zt.Z,c)},It=(0,le.makeStyles)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),Dt=e=>{let{config:t,connection:n,children:o}=e;const l=It(),{showInactive:i}=(0,r.useContext)(_e),{connections:s,showSecondLevel:c,toggleShowSecondLevel:u,loadRelations:p,loading:d,total:m}=(e=>{let{config:t,connection:n,relationActivityFilter:a}=e;const o=(0,x.useDispatch)(),[l,i]=(0,r.useState)(!1),[s,c]=(0,r.useState)(!1),{contentSecondLevel:u}=t,{entity:p}=n,d=(0,x.useSelector)((e=>v.ZP.selectors.getConnectionsWithDraftsByViewId(e,t.id,p.entityUri)))||[],m=(0,x.useSelector)((e=>v.ZP.selectors.getTotalByViewId(e,t.id,p.entityUri))),{activityFilter:g}=(0,x.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions)||{},f=(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){Nt(e,t,n[t])}))}return e}({},u,{returnObjects:!0,returnDates:!0,activeness:{relation:a||h.Ng6.ALL,entity:g}});c(!0),(0,h.N6e)(p.entityUri,[e]).then((e=>{const{connections:n,total:r}=e[0];n&&o(v.N5.relations.actions.secondLevelRelationsLoaded({connections:n,parentEntityUri:p.entityUri,id:t.id,total:r})),c(!1)}))}),[t.id,u,o,p.entityUri,g,a]),b=(0,r.useCallback)((()=>{l||n.connections||f(),i((e=>!e))}),[f,n.connections,l]);return{connections:d,showSecondLevel:l,toggleShowSecondLevel:b,loadRelations:f,loading:s,total:m}})({config:t,connection:n,relationActivityFilter:i?h.Ng6.ALL:h.Ng6.ACTIVE_ONLY}),g=(0,r.useMemo)((()=>(0,h.Px$)(s)),[s]);return a().createElement(a().Fragment,null,o((()=>a().createElement(jt,{onClick:u,connection:n,config:t,showSecondLevel:c}))),c&&a().createElement(He.X.Provider,{value:g},a().createElement("div",{className:l.secondLevelContent},a().createElement(xn,{isLoading:d,config:t,loadRelations:p,connections:s,total:m,parentEntityUri:n.entity.entityUri}))))},Lt=(0,le.makeStyles)((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",borderColor:"rgba(0,0,0,0.12)"},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"}}))),Mt=e=>{let{className:t,connections:n=[],config:o,mode:i,noDataText:s,parentEntityUri:c}=e;const u=(0,x.useSelector)(v.ZP.selectors.getMetadata),p=(0,x.useSelector)((e=>v.ZP.selectors.getRelationToAddByViewId(e,o.id))),d=(0,x.useSelector)((e=>v.ZP.selectors.getRelationsToEditByViewId(e,o.id))),m=(0,x.useSelector)(v.ZP.selectors.getEntity),g=(0,x.useSelector)((e=>v.ZP.selectors.getCheckIfCanAddRelations(e,o.content))),f=(0,x.useDispatch)(),b=Lt(),E=(0,r.useCallback)((()=>{const e=(0,h.vlo)({config:o,mode:i,metadata:u,parentEntityUri:c});(0,l.pipe)(v.N5.relations.actions.openRelationEditor(o.id),f)(e)}),[o,i,u,f,c]),w=(0,r.useCallback)((e=>{f(v.N5.relations.actions.closeRelationEditor(o.id,e)),f(v.N5.relations.actions.removeRelation(o.id,e));const t=n.find((t=>(0,h.w1L)(t)===e)),r=(0,h.yV)(t);(0,h.ZiX)(r)&&f(v.N5.modifiedEntities.actions.entityDeleted(r))}),[o,n,f]),S=o.content,C=kt(S.inRelations,S.outRelations),O=(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);f(v.N5.relations.actions.addRelation(o.id,t))}),[f,o,C]),P=(0,r.useCallback)((e=>{f(v.N5.relations.actions.ignoreRelation(o.id,{relationType:C.type,relationDirection:C.direction,entityUri:e.entity.entityUri,relationUri:e.relation.relationUri}))}),[f,o,C]),[k,N]=(0,l.partition)(h.xvW,n),Z=m&&g,R=0===k.length&&0===N.length,T=e=>{var t,n;const r=d.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)})),s=!o.allowOnlyCreateNew||(0,h.xvW)(e),c=`${null==e||null===(t=e.relation)||void 0===t?void 0:t.relationUri}-${null==e||null===(n=e.relation)||void 0===n?void 0:n.direction}`;return a().createElement(Dt,{config:o,connection:e,key:c},(t=>r?a().createElement(ct.Z,{connection:r,config:o,mode:i,metadata:u}):a().createElement(Ot,{renderRelationArrowButton:t,connection:e,metadata:u,showControls:s,onRemoveRelation:w,onEditRelation:(0,l.pipe)(v.N5.relations.actions.openRelationEditor(o.id),f),onAcceptRelation:O,onIgnoreRelation:P})))},j=Z&&(!p||p&&p.parentEntityUri===c),I=p&&p.parentEntityUri===c;return a().createElement("div",{className:t},j&&a().createElement(ne.Z,{color:"primary",onClick:E,className:b.moreButton},a().createElement(pe.Z,{classes:{root:b.icon}}),a().createElement("div",{className:b.buttonLabel},y().text("Add"))),I&&a().createElement(ct.Z,{connection:p,config:o,mode:i,metadata:u}),k.map(T),k.length>0&&N.length>0&&a().createElement(de.Z,{className:b.divider}),N.map(T),R&&a().createElement(G.Z,{className:b.noData},s))};var At=n(62901),zt=n(72316),Vt=n(38309),Ut=n(89978);const Ht=(0,le.makeStyles)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Ft(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){Wt(e,t,n[t])}))}return e}function Wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bt=e=>{let{connection:t,className:n}=e;const o=Ht(),{relation:i}=t,s=(0,x.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),c=(0,x.useSelector)(v.ZP.selectors.getMetadata),u=(0,r.useMemo)((()=>(0,h.xF8)(c,null==i?void 0:i.relationType)),[null==i?void 0:i.relationType,c]),p=(0,r.useMemo)((()=>Ft({attributes:Ft({},(0,h.Ff)(t))},(0,h.p2l)((null==t?void 0:t.relation)||{}))),[t]),d=(0,r.useMemo)((()=>(0,h.fyF)(u,p)),[u,p]).filter((e=>{let{values:t}=e;return!(0,h.O27)(t)})).length>0,m=(0,r.useMemo)((()=>(0,h.R$r)(p.attributes)),[p]),{getCommentsCount:g}=(0,r.useContext)(S.h);(0,r.useEffect)((()=>{!(0,l.isEmpty)(m)&&g(m)}),[g,m]);const f=(0,r.useMemo)((()=>(0,h.wp9)(h.q7e.RELATION,{entityUri:s,connection:t})),[t,s]);return d?a().createElement(Vt.A.Provider,{value:f},a().createElement(Ut.Z,{className:V()(o.attributesList,n),entity:p,attrTypes:u})):a().createElement("div",{className:V()(o.attributesList,n)},y().text("No attributes"))};var qt=n(93400),_t=n(89025);const Gt=e=>{let{show:t,onToggle:n,className:r}=e;return a().createElement(We.k,{className:r,tooltipTitle:t?y().text("Hide attributes of the relationship"):y().text("Show attributes of the relationship"),tooltipPlacement:"bottom-end",size:"XXS",icon:t?qt.Z:_t.Z,onClick:n})},Yt=(0,le.makeStyles)((e=>({container:{display:"flex",flexDirection:"column",paddingBottom:"2px"},row:{display:"flex",alignItems:"center",flexDirection:"row",minHeight:"16px",padding:"3px 11px 3px 16px"},rowInactive:{background:e.inactiveBackground},entityAvatar:{height:"12px",width:"12px",fontSize:"11px",marginRight:"8px"},entityLabelContainer:{textDecoration:"none",cursor:"pointer",wordBreak:"break-all",paddingRight:"8px"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},relationLabel:{color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},showDetails:{marginLeft:"auto",paddingRight:"5px"},attributesList:{paddingLeft:"46px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0},suggestedWrapper:{backgroundColor:e.suggested},commentsContainer:{marginLeft:"auto",alignItems:"center","& + $showDetails":{marginLeft:"4px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex"},labelWrapper:{display:"flex",alignItems:"center"}}))),Qt=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:o,ignoreRelation:i}=e;const s=Yt(),c=t.suggested,{entity:u,relation:p}=t,[d,m]=(0,r.useState)(!1),g=(0,x.useSelector)(v.ZP.selectors.getMetadata),{entityType:f,entityLabel:b,preparedUri:y,relationLabel:E}=vt(t,g),w=(0,h.Fn9)(p)&&(0,h.Fn9)(u),S=(0,x.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),C=u&&p&&(0,h.wp9)(h.q7e.RELATION,{entityUri:S,connection:t})||[];return a().createElement("div",{className:V()(s.container,{[s.rowInactive]:!w},{[s.suggestedWrapper]:c})},a().createElement("div",{className:V()(s.row,At.U)},n&&n(),a().createElement("div",{className:s.labelWrapper},a().createElement(dt.Z,{className:s.entityAvatar,entityType:f}),a().createElement(mt.Z,{value:y,className:s.entityLabelContainer},a().createElement(yt,{label:b,entity:u},a().createElement("span",{className:s.entityLabel},b)),E&&a().createElement("span",{className:s.relationLabel},`, ${E}`))),a().createElement("div",{className:s.additionalButtonsWrapper},!(0,l.isEmpty)(C)&&a().createElement(zt.Z,{className:s.commentsContainer,uri:(0,h.gjS)(p),relatedObjectUris:C,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),c&&a().createElement(wt,{size:"small",acceptRelation:o(t),ignoreRelation:i(t)}),!c&&a().createElement(Gt,{show:d,onToggle:()=>{m((e=>!e))},className:s.showDetails}))),d&&a().createElement(Bt,{connection:t}))}));Qt.displayName="RelationItem";const $t=Qt;var Xt=n(18876),Kt=n(71976),Jt=n(30750),en=n(80233),tn=n(60590),nn=n(11559),rn=n(65439);const an=e=>(0,l.pipe)((0,l.pluck)("value"),l.mean,(0,l.defaultTo)(0))(e).toFixed(1),on=e=>e.filter((e=>5===e.value)).length,ln=e=>e.filter((e=>1===e.value)).length,sn=e=>{if(0===e.length)return{percentOfLikes:0,percentOfDislikes:0};const t=on(e)/e.length*100,n=parseFloat(Number(t).toFixed(1));return{percentOfLikes:n,percentOfDislikes:parseFloat(Number(100-n).toFixed(1))}},cn=(0,le.makeStyles)((e=>({wrapper:{display:"flex",flexDirection:"column",padding:12,width:355,gap:12},info:{background:"rgba(0, 0, 0, 0.05)",display:"flex",padding:"6px 12px",fontSize:13,gap:16},axis:{position:"relative",display:"flex",justifyContent:"space-between",fontSize:12,color:e.palette.text.secondary,paddingTop:4,"&::before":{content:'""',position:"absolute",top:0,left:0,background:e.palette.divider,width:"1px",height:"4px"},"&::after":{content:'""',position:"absolute",top:0,right:0,background:e.palette.divider,width:"1px",height:"4px"}},scaleHistory:{display:"flex",justifyContent:"space-between"},title:{fontSize:13,display:"flex",alignItems:"center",color:e.palette.text.secondary,gap:8,"& .value":{color:e.palette.text.primary},"& .boldValue":{color:e.palette.text.primary,fontWeight:700}},greenBadge:{width:12,height:12,background:"rgb(151, 192, 97)"},redBadge:{width:12,height:12,background:"rgb(255, 112, 112)"},scale:{width:"100%",height:16,background:"rgba(255, 112, 112)","&.empty":{background:"#F9F9F9"}},scaleBar:{background:"rgba(151,192,97)"},icon:{width:"14px",height:"14px",color:"rgba(0,0,0,0.54)"},ratingsList:{borderTop:"1px solid #ccc",borderBottom:"1px solid #ccc",padding:"12px 0",maxHeight:140,boxSizing:"border-box",overflow:"auto"},rating:{display:"flex",padding:"4px 0px",alignItems:"center"},avatar:{width:24,height:24,marginRight:12,"& .icon":{fontSize:18}},userInfo:{overflow:"hidden"},user:{fontSize:13,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis"},ratingDateWrapper:{display:"flex",alignSelf:"start",marginLeft:"auto"},ratingDate:{fontSize:10,color:e.palette.text.secondary,marginRight:4},sourcesWrapper:{display:"flex",alignItems:"center",gap:4}}))),un=e=>{let{ratings:t,crosswalks:n,open:r,anchorEl:o,onClose:l}=e;const i=cn(),s=(e=>[...e].sort(((e,t)=>{const n=new Date(e.timestamp).getTime();return new Date(t.timestamp).getTime()-n})))(t),{percentOfLikes:c,percentOfDislikes:u}=sn(t),p=`${on(t)} (${c}%)`,d=`${ln(t)} (${u}%)`;return a().createElement(en.Z,{open:r,anchorEl:o,onClose:l,placement:"top-start",transition:!0},a().createElement("div",{className:i.wrapper},a().createElement("div",{className:i.info},a().createElement("span",{className:i.title},y().text("Score:"),a().createElement("span",{className:"boldValue"},an(t))),a().createElement("span",{className:i.title},y().text("No. of responses:"),a().createElement("span",{className:"value"},t.length))),a().createElement("div",null,a().createElement(Jt.Z,{variant:"determinate",value:c,classes:{bar:i.scaleBar},className:V()(i.scale,{empty:!t.length})}),a().createElement("div",{className:i.axis},a().createElement("span",null,"0"),a().createElement("span",null,"100%"))),a().createElement("div",{className:i.scaleHistory},a().createElement("span",{className:i.title},a().createElement("div",{className:i.greenBadge}),a().createElement(Xt.Z,{className:i.icon}),y().text("Agree:"),a().createElement("span",{className:"value"},p)),a().createElement("span",{className:i.title},a().createElement("div",{className:i.redBadge}),a().createElement(Kt.Z,{className:i.icon}),y().text("Disagree:"),a().createElement("span",{className:"value"},d))),!!s.length&&a().createElement("div",{className:i.ratingsList,"data-reltio-id":"reltio-ratings-list"},s.map(((e,t)=>{let{user:n,comment:r,timestamp:o,value:l}=e;return a().createElement("div",{key:t,className:i.rating,"data-reltio-id":"reltio-rating-item"},a().createElement(rn.Z,{className:i.avatar},a().createElement(nn.Z,{className:"icon"})),a().createElement("div",{className:i.userInfo},a().createElement("div",{className:i.user},n),a().createElement("div",{className:i.title},r||y().text("No comment"))),a().createElement("div",{className:i.ratingDateWrapper},a().createElement("span",{className:i.ratingDate},y().date(o,"L LT")),1===l?a().createElement(Kt.Z,{className:i.icon,"data-reltio-id":"reltio-dislike-icon"}):a().createElement(Xt.Z,{className:i.icon,"data-reltio-id":"reltio-like-icon"})))}))),a().createElement("div",{className:i.sourcesWrapper},a().createElement("span",{className:i.title},y().text("Sources:")),n.map(((e,t)=>a().createElement(tn.Z,{key:t,crosswalk:e}))))))},pn=(0,le.makeStyles)((e=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-end",width:128,cursor:"pointer"},averageRating:{marginBottom:4,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px",color:e.palette.text.primary},counts:{display:"flex",marginTop:4,gap:32},count:{display:"flex",alignItems:"center",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0,lineHeight:"15px"},icon:{marginRight:"4px",width:"14px",height:"14px",color:e.palette.text.secondary},scale:{height:3,width:"100%",background:"rgba(255, 112, 112)","&.empty":{background:"#F9F9F9"}},scaleBar:{background:"rgba(151,192,97)"}}))),dn=e=>{let{ratings:t,crosswalks:n,className:o}=e;const l=pn(),i=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{percentOfLikes:u}=sn(t);return a().createElement(a().Fragment,null,a().createElement("div",{"data-reltio-id":"reltio-ratings",className:V()(l.wrapper,o),ref:i,onClick:()=>c(!0)},a().createElement(G.Z,{className:l.averageRating},an(t)),a().createElement(Jt.Z,{variant:"determinate",value:u,classes:{bar:l.scaleBar},className:V()(l.scale,{empty:!t.length})}),a().createElement("div",{className:l.counts},a().createElement("div",{className:l.count},a().createElement(Xt.Z,{className:l.icon}),on(t)),a().createElement("div",{className:l.count},a().createElement(Kt.Z,{className:l.icon}),ln(t)))),a().createElement(un,{ratings:t,open:s,crosswalks:n,anchorEl:i.current,onClose:()=>c(!1)}))},mn=(0,le.makeStyles)((e=>({wrapper:{display:"flex",marginLeft:-8,gap:8},button:{minWidth:0,padding:8,fontSize:"14px",lineHeight:"16px",textTransform:"none",color:e.palette.text.secondary},isActive:{color:e.palette.text.primary}}))),gn=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const o=mn(),l=(0,x.useSelector)(v.ZP.selectors.getUserName),i=t.find((e=>{let{user:t}=e;return t===l})),s=[{text:y().text("Has left the practice"),onClick:()=>r(y().text("Has left the practice"))},{text:y().text("Has moved away"),onClick:()=>r(y().text("Has moved away"))},{text:y().text("Has passed away"),onClick:()=>r(y().text("Has passed away"))},{text:y().text("Has retired"),onClick:()=>r(y().text("Has retired"))},{text:y().text("Other"),onClick:()=>r(y().text("Other"))}];return a().createElement("div",{className:o.wrapper},a().createElement(ne.Z,{onClick:n,variant:"text",size:"small",className:V()(o.button,{[o.isActive]:5===(null==i?void 0:i.value)})},"Agree"),a().createElement(Ke.Z,{buttonProps:{endIcon:a().createElement(Rt.Z,null),variant:"text",size:"small",className:V()(o.button,{[o.isActive]:1===(null==i?void 0:i.value)})},buttonContent:1===(null==i?void 0:i.value)?i.comment:"Disagree",menuItems:s,menuId:"disagree-dropdown-menu-button"}))},fn=(0,le.makeStyles)((e=>({wrapper:{padding:"3px 16px"},entityTypeIcon:{marginRight:"16px"},entityLabel:{color:e.palette.primary.main,fontSize:"14px",lineHeight:"16px"},entityLabelContainer:{display:"flex",wordBreak:"break-all",textDecoration:"none"},relationLabel:{color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"},ratings:{marginLeft:"auto"},showDetailsButton:{marginLeft:"16px",marginTop:"8px"},relationAttributes:{paddingLeft:"60px"},suggestedWrapper:{padding:"6px 8px 6px 16px",backgroundColor:e.suggested,minWidth:"fit-content"},commentsContainer:{alignSelf:"center",marginTop:"11px","& + $ratings":{marginLeft:"16px"}},additionalButtonsWrapper:{marginLeft:"auto",display:"flex",alignItems:"center"}}))),hn=e=>{var t;let{connection:n,loadRelations:o,renderRelationArrowButton:i,acceptRelation:s,ignoreRelation:c,showRating:u}=e;const p=fn(),d=n.suggested,[m,g]=(0,r.useState)(!1),{entity:f,relation:b}=n,y=(0,x.useSelector)(v.ZP.selectors.getMetadata),{entityLabel:E,entityType:w,preparedUri:S,relationLabel:C}=vt(n,y),O=(null==b?void 0:b.ratings)||[],P=(null==b||null===(t=b.object)||void 0===t?void 0:t.crosswalks)||[],k=(0,x.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),N=f&&b&&(0,h.wp9)(h.q7e.RELATION,{entityUri:k,connection:n})||[];return a().createElement("div",{className:V()(p.wrapper,{[p.suggestedWrapper]:d})},a().createElement(_.Z,{display:"flex",minHeight:"44px",className:At.U},a().createElement(_.Z,{display:"flex",alignItems:"center"},a().createElement(_.Z,{display:"flex",alignItems:"center"},i&&i(),a().createElement(dt.Z,{entityType:w,className:p.entityTypeIcon})),a().createElement(_.Z,{display:"flex",flexDirection:"column"},a().createElement(mt.Z,{value:S,className:p.entityLabelContainer},a().createElement(yt,{label:E,entity:f},a().createElement("span",{className:p.entityLabel},E))),C&&a().createElement("span",{className:p.relationLabel},C),!d&&u&&a().createElement(gn,{ratings:O,onAgree:()=>{(0,h.Buf)(null==b?void 0:b.relationUri,{comment:"",value:5}).then(o)},onDisagree:e=>{(0,h.Buf)(null==b?void 0:b.relationUri,{comment:e,value:1}).then(o)}}))),a().createElement("div",{className:p.additionalButtonsWrapper},!(0,l.isEmpty)(N)&&a().createElement(zt.Z,{className:p.commentsContainer,uri:(0,h.gjS)(b),relatedObjectUris:N,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),d&&a().createElement(wt,{acceptRelation:s(n),ignoreRelation:c(n)}),!d&&a().createElement(a().Fragment,null,u&&a().createElement(dn,{ratings:O,crosswalks:P,className:p.ratings}),a().createElement(Gt,{show:m,onToggle:()=>{g((e=>!e))},className:p.showDetailsButton})))),m&&a().createElement(Bt,{connection:n,className:p.relationAttributes}))},bn=e=>{let{className:t,connections:n=[],loadRelations:o,config:l,mainEnityUri:i}=e;const{isComplex:s,content:c,type:u}=l,{ignoreRelation:p,acceptRelation:d}=((e,t,n)=>{const r=kt(e.inRelations,e.outRelations),a=(0,x.useDispatch)();return{ignoreRelation:e=>()=>{const{entity:o}=e;(0,h.iiD)(n,{relatedEntityUri:o.entityUri,relationType:r.type,relationDirection:r.direction}).then(t).catch((e=>{a(v.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong"))))}))},acceptRelation:e=>()=>{const{entity:o,relation:l}=e,{startDate:i,endDate:s}=l,c=r.direction===h.Nsj.IN,u=c?o.entityUri:n,p=c?n:o.entityUri;(0,h.DsR)({startEntityUri:u,endEntityUri:p,relationType:r.type,attributes:null,startDate:i,endDate:s}).then(t).catch((e=>{a(v.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong"))))}))}}})(c,o,i),m=(0,r.useMemo)((()=>(0,h.w3p)(n)),[n]),{getCommentsCount:g}=(0,r.useContext)(S.h);return(0,r.useEffect)((()=>{g(m)}),[g,m]),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(Dt,{config:l,connection:e,key:r},(t=>s?a().createElement(hn,{loadRelations:o,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t,showRating:"rating"===u}):a().createElement($t,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};bn.displayName="RelationsList";const yn=bn,vn=(0,le.makeStyles)((e=>({list:{paddingTop:"8px",paddingBottom:"10px",overflow:"auto",flexGrow:1},noData:{fontSize:"13px",color:e.palette.text.secondary,padding:"8px 16px"},linearIndicator:{top:"52px"}}))),xn=e=>{let{isLoading:t,config:n,loadRelations:r,connections:o,total:l,parentEntityUri:i}=e;const s=vn(),{selectors:c}=v.ZP,u=(0,x.useSelector)(c.getEntity),p=(0,x.useSelector)(c.getMode),d=n["text-empty"]||y().text("No data found");return t?a().createElement(L.Z,{className:s.linearIndicator}):n.content&&(0,h.KIu)(p)?a().createElement(Mt,{connections:o,className:s.list,key:null==u?void 0:u.uri,config:n,mode:p,noDataText:d,parentEntityUri:i}):n.content&&l>0?a().createElement(yn,{config:n,loadRelations:r,connections:o,className:s.list,key:null==u?void 0:u.uri,mainEnityUri:u.uri}):a().createElement(G.Z,{className:s.noData},d)},En=(0,le.makeStyles)({container:{flexGrow:1,display:"flex",flexDirection:"column",minHeight:0},content:{display:"flex",flexGrow:1,flexDirection:"column",minHeight:0},pagination:{height:"52px",flexGrow:0,flexShrink:0}}),wn=e=>{let{config:t,className:n}=e;const o=En(),{page:i,setPage:s,rowsPerPage:c,sortOrder:u,sortOption:p,showInactive:d,searchQuery:m,changeSearchQuery:g}=(0,r.useContext)(_e),{selectors:f}=v.ZP,b=(0,x.useSelector)((e=>f.getConnectionsWithDraftsByViewId(e,t.id))),y=(0,x.useSelector)(f.getEntity),E=(0,x.useSelector)((e=>f.getTotalByViewId(e,t.id))),w=(0,x.useSelector)(f.getMode),S=(0,r.useMemo)((()=>({order:u,field:p})),[u,p]);(0,r.useEffect)((()=>{g("")}),[null==y?void 0:y.uri]);const C=(0,r.useMemo)((()=>(e=>{const t=h.wSh.fromFalsy(e).map(h.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome("");return(new h.MEy).addClause(t).build()})(m)),[m]),{isLoading:O,reload:P}=(0,ze.a)({sorting:S,filter:C,page:i,rowsPerPage:c,config:t,entity:y,relationActivityFilter:d?h.Ng6.ALL:h.Ng6.ACTIVE_ONLY,mode:w}),k=(0,r.useMemo)((()=>(0,h.Px$)(b)),[b]),N=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,l.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return(0,Ve.I)(t.id),a().createElement(Ue.u.Provider,{value:y},a().createElement(He.X.Provider,{value:k},a().createElement(B.Z,{className:n},a().createElement("div",{className:o.container},a().createElement(Je.Provider,{value:N},a().createElement(st,{title:t.caption,total:E})),a().createElement("div",{className:o.content},a().createElement(xn,{isLoading:O,config:t,loadRelations:P,connections:b,total:E}),E>c&&a().createElement(q.Z,{classes:{root:o.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:c,page:i,onChangePage:s}))))))};wn.displayName="RelationsView";const Sn=a().createContext(null);Sn.displayName="TableAttributeContext";var Cn=n(17569),On=n(75975),Pn=n(79573);function kn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Nn(e,t,n[t])}))}return e}function Nn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zn="CHANGE_SEARCH_QUERY",Rn=kn({},On.ZP.actions,{changeSearchQuery:(0,Pn.zD)(Zn)}),Tn=(e,t)=>t.type===Zn?kn({},e,{searchQuery:t.payload,page:0}):On.ZP.reducer(e,t);var jn=n(92332),In=n(25843);function Dn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ln(e,t,n[t])}))}return e}function Ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Mn={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},An=(0,le.makeStyles)((()=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},rowCell:{fontSize:"13px",overflow:"hidden"},blobWrapper:{position:"relative",overflowY:"auto",overflowX:"hidden",whiteSpace:"pre",maxHeight:"100px",boxSizing:"border-box",padding:"15px 25px 0 25px"},defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"15px 25px 0 25px"},updateAttribute:Dn({padding:"0 4px",marginLeft:"-4px"},h.zXF[h.Y1q.updateAttribute]),insertAttribute:Dn({},h.zXF[h.Y1q.insertAttribute]),deleteAttribute:Dn({padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},h.zXF[h.Y1q.deleteAttribute]),description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > div":Mn}}))),zn=(0,In.Z)((e=>{const t=An(),{description:n}=(null==e?void 0:e.headCellData)||{};return a().createElement("div",{className:t.headCell},a().createElement(jn.default,e),a().createElement($.Z,{description:n,className:t.description}))}));var Vn=n(67586),Un=n(40007);const Hn=e=>{let{value:t,historyClassName:n}=e;const r=An();return a().createElement("div",{className:r.blobWrapper,onScroll:Pn.UW},a().createElement("span",{className:r[n]},t))},Fn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const o=An(),{value:i,uri:s}=t,{appearance:c}=(0,r.useContext)(T.m),u=(0,l.pipe)(h.IFm,h.o_F)(s,c);if(n.type===h.oS0.TYPE_BLOB)return a().createElement(Hn,{value:i,historyClassName:u});{const e=a().createElement(Vn.Z,{value:i,dataTypeDefinition:n});return a().createElement(Un.Z,{value:e},a().createElement("div",{className:o.defaultWrapper},a().createElement("span",{className:o[u]},e)))}};function Wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bn=(e,t)=>{const{uri:n,label:r,children:a,name:o,description:i}=e;return(0,l.reject)(l.isNil,{id:(0,h.Tde)(n,t),label:r,description:i,dataTypeDefinition:(0,h.PFL)(e),children:null==a?void 0:a.map((e=>Bn(e,t.concat({name:o}))))})},qn=(0,l.pipe)((0,l.split)("."),(0,l.slice)(2,1/0)),_n=e=>{if((0,h.vZp)(e)){const t=qn(e);return t.length>1?t.slice(0,-1):null}return null},Gn=(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){Wn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:_n(e.id),headCellRenderer:zn,rowCellValueRenderer:Fn})));var Yn=n(79575);function Qn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $n=n(33903),Xn=n(87825);const Kn=(0,le.makeStyles)((()=>({header:{padding:"0 12px 0 16px"},rightMenuItems:{display:"flex",flex:"1 0 auto",justifyContent:"flex-end",alignItems:"center"}}))),Jn=e=>{let{title:t}=e;const n=Kn(),o=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),{attributeType:l,searchQuery:i,setSearchQuery:s,filters:c,onToggleFilters:u,allColumnsData:p,visibleColumns:d,onChangeColumns:m}=(0,r.useContext)(Sn),g=o&&(null==l?void 0:l.required);return a().createElement(Y.Z,{title:t,className:n.header},g&&a().createElement(Q.Z,null),a().createElement($.Z,{description:null==l?void 0:l.description}),a().createElement("div",{className:n.rightMenuItems},a().createElement(ee.i,{query:i,onChange:s}),a().createElement($n.Z,{enabled:!!c,onClick:u}),a().createElement(K.Z,{height:24,margin:4}),a().createElement(Xn.Z,{columnsData:p,selectedColumns:d,onChangeColumns:m})))};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=(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=An();return a().createElement("div",{className:V()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,er({key:t,value:e},l)))))}));var nr=n(47081),rr=n(45108);const ar=(0,le.makeStyles)((()=>({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)",marginBottom:"15px"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}}))),or=e=>{let{onEdit:t,onRemove:n}=e;return a().createElement(a().Fragment,null,t&&a().createElement(We.k,{tooltipTitle:y().text("Edit"),icon:ut.Z,size:"L",onClick:t}),n&&a().createElement(We.k,{tooltipTitle:y().text("Remove"),icon:pt.Z,size:"L",onClick:n}))};function lr(){return lr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lr.apply(this,arguments)}const ir=e=>{let{columnsData:t,values:n,sorting:o,onSort:i,filters:s,onFilter:c,config:u,onEdit:p,onDeleteAttribute:d,deletedUris:m}=e;const g=(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,h.xIV)(e))(t))(qn(e),t))(r,e),t)}),{}),(0,l.assoc)("value",e))(t))))(n,t)),[n,t]),f=(0,r.useMemo)((()=>Gn(t)),[t]),b=ar(),y=(0,x.useSelector)(v.ZP.selectors.getMode),E=(0,h.KIu)(y),w=(0,x.useSelector)(v.ZP.selectors.getMetadata),S=(0,x.useSelector)(v.ZP.selectors.getEntityUri),C=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,S)||{})),{attributeType:O}=(0,r.useContext)(Sn),P=(0,r.useCallback)((e=>a().createElement(tr,lr({},e,{isSorted:!!o&&o.field===e.columnData.id}))),[o]),[k,N]=(0,r.useState)(null),{canUpdate:Z,canDelete:R}=(0,nr.l)(),T=(0,r.useMemo)((()=>"number"!=typeof k||!E||m.includes((0,l.pipe)((0,l.path)([k]),(0,l.prop)("uri"))(n))),[k,m,n,E]),j="number"==typeof k&&(I=(0,l.path)([k],n),R(u)&&(0,h.xv5)({attributeType:O,mode:y,attributeValue:I,metadata:w,isReltioCrosswalk:(0,h.KVV)(C.crosswalks,I)}));var I;const D="number"==typeof k&&(e=>Z(u)&&(0,h.yv0)({attributeType:O,mode:y,attributeValue:e,isReltioCrosswalk:(0,h.KVV)(C.crosswalks,e)}))((0,l.path)([k],n)),L=(0,r.useCallback)((()=>{const e=(0,l.path)([k],n);D&&p(e)}),[p,k,n,D]),M=(0,r.useCallback)((()=>{const e=(0,l.path)([k],n);if(!j)return;const t={parentUri:S,attributeType:O,uri:e.uri,value:e};d(t),N(null)}),[k,n,d,j,O,S]),A=T||!j&&!D?void 0:a().createElement(or,{onEdit:D?L:void 0,onRemove:j?M:void 0}),z=(0,r.useMemo)((()=>({deletedUris:m})),[m]);return a().createElement("div",{className:b.tableContainer},a().createElement(rr.Z,{autosizing:!0,maxHeight:477,columnsData:f,rowsData:g,sorting:o,onSort:i,filters:s,onFilter:c,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,resizeDebounceDelay:150,renderRowCell:P,onRowHover:N,hoverRowIndex:k,hoveredRowRightContent:A,context:z,classes:{hoveredRowRightContentWrapper:b["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:b["row-cell__buttons-container"]}}))};function sr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){cr(e,t,n[t])}))}return e}function cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ur=[],pr=(0,le.makeStyles)((()=>({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 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 mr=e=>{let{onChangeAttribute:t,onCancel:n,onApply:o,onDeleteAttribute:i,hasChanges:s,attributeValue:c}=e;const u=pr(),p=(0,x.useDispatch)(),m=(0,r.useContext)(d.m),{attributeType:g}=(0,r.useContext)(Sn),f=(0,x.useSelector)(v.ZP.selectors.getEntityUri),b=(0,x.useSelector)(v.ZP.selectors.getMode),E=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,f)||{})),w=(0,h.YkG)(g)&&(0,h.ZiX)((0,h.bwT)(c)),S=(0,x.useSelector)((e=>w?v.ZP.selectors.getModifiedEntities(e):void 0)),C=(0,x.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,f,g))),O=(0,h.ZiX)(f),P=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.addAttributes,p)(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){dr(e,t,n[t])}))}return e}({},e,{viewId:m}))))),[m,p]),k=(0,r.useCallback)((0,l.pipe)(v.N5.errors.actions.errorDeactivated,p),[p]);return a().createElement(a().Fragment,null,a().createElement(he.Z,{expanded:!0,attributeValue:c,showEmptyEditors:O,onDeleteAttribute:i,onDeactivateError:k,onChangeAttribute:t,onAddAttributes:P,mode:b,crosswalks:E.crosswalks,errors:C,attributeType:g,ownError:(0,h.ADq)(c,null,g.uri,C)}),a().createElement("div",{className:u.actionButtons},a().createElement(ne.Z,{onClick:()=>n(c)},y().text("Cancel")),a().createElement(ne.Z,{color:"primary",disabled:!s,onClick:()=>o(c,S),"data-reltio-id":"table-attribute-view-apply-button"},y().text("Apply"))))};var gr=n(98001);const fr=e=>(null==e?void 0:e.type)===h.NIO.missed,hr=(0,l.curry)(((e,t)=>e.find((0,l.pipe)((0,l.prop)("uri"),(0,l.either)((0,h.sOy)(t.parentUri),(0,l.equals)(t.uri)))))),br=(0,le.makeStyles)((()=>({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"}}))),yr=e=>{let{config:t,editingValues:n,modifiedValues:o,onChangeAttribute:i,onDeleteAttribute:s,onAdd:c,onCancel:u,onApply:p,onStartEditing:d,onReset:m,checkHasChanges:g,highlightedError:f,highlightedAttributeError:b}=e;const E=br(),{attributeType:w}=(0,r.useContext)(Sn),S=(0,x.useSelector)(v.ZP.selectors.getMode),{canCreate:C}=(0,nr.l)();(e=>{let{onStartEditing:t,modifiedValues:n,highlightedError:a,highlightedAttributeError:o}=e;const{attributeType:i}=(0,r.useContext)(Sn),s=(0,x.useSelector)(v.ZP.selectors.getEntityUri),c=(0,x.useSelector)((e=>v.ZP.selectors.getActiveErrorsForAttributesPager(e,s,i))),u=(0,r.useRef)(!0),p=(0,gr.u)(),d=(0,r.useMemo)((()=>c.find((0,l.both)(fr,(e=>(0,h.Wah)(e,s,i.uri))))),[c,s,i.uri]);(0,r.useEffect)((()=>{if(null!=i&&i.required&&1===n.length&&(0,h.ZiX)(n[0].uri))return t(n[0])}),[i]),(0,r.useEffect)((()=>{d&&1===n.length&&t(n[0])}),[d]),(0,r.useEffect)((()=>{u.current&&c.length&&((0,l.pipe)((0,l.map)(hr(n)),(0,l.reject)(l.isNil),(0,l.forEach)(t))(c),u.current=!1)}),[c]),(0,r.useEffect)((()=>{fr(a)&&1===n.length&&t(n[0])}),[a]),(0,r.useEffect)((()=>{if(o){const e=hr(n,o);e&&t(e)}}),[o]),(0,r.useEffect)((()=>{const e=p((e=>{e.type===v.N5.constants.ProfileActions.SAVE_PROFILE&&(u.current=!0)}));return()=>e()}),[p])})({onStartEditing:d,modifiedValues:o,highlightedError:f,highlightedAttributeError:b});const O=C(t)&&w&&(0,h.Vg3)({attributeType:w,mode:S})&&!n.length;return(0,r.useEffect)((()=>()=>m()),[m]),a().createElement("div",{className:E.editor},O&&a().createElement(ne.Z,{color:"primary",onClick:c,className:E.addButton,"data-reltio-id":"table-attribute-view-add-button"},a().createElement(pe.Z,{classes:{root:E.icon}}),a().createElement("div",{className:E.buttonLabel},y().text("Add"))),n.map((e=>a().createElement(mr,{key:e.uri,attributeValue:e,onChangeAttribute:i,onDeleteAttribute:s,onCancel:u,onApply:p,hasChanges:g(e)}))))},vr=(0,be.l)(I.NY,((e,t)=>{let{entityUri:n,attributeType:r}=t;const{element:a,type:o}=e||{},l=(0,I.Ie)(o),i=l&&(0,h.Wah)(a,n,r.uri);return{highlightedError:i?e:null,highlightedAttributeError:a&&l&&!i&&(0,h.nsY)(r,a)&&(0,h.vyG)(n,a)?e:null}}),(e=>{let{config:t,entityUri:n,highlightedError:o,highlightedAttributeError:i}=e;const s=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),c=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,n)||{})),{values:u,visibleColumns:p,onFilter:m,onSort:g,filters:f,sorting:b,allColumnsData:y}=(0,r.useContext)(Sn),{onDeleteAttribute:E,onStartEditing:w,onChangeAttribute:S,onAdd:C,onCancel:O,onApply:P,onReset:k,checkHasChanges:N,modifiedValues:Z,editingValues:R,deletedUris:T}=(()=>{const[e,t]=(0,r.useState)(),[n,a]=(0,r.useState)([]),o=(0,x.useDispatch)(),i=(0,x.useSelector)(v.ZP.selectors.getMode),s=(0,x.useSelector)(v.ZP.selectors.getEntityUri),c=(0,x.useSelector)(v.ZP.selectors.getMetadata),u=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,s)||{})),p=(0,r.useContext)(d.m),{attributeType:m,values:g}=(0,r.useContext)(Sn),f=(0,h.KIu)(i),b=(0,h.xy8)(m),y=(0,l.pathOr)(ur,[b,null==m?void 0:m.name],u),E=(0,r.useMemo)((()=>(0,h.gjI)({parentUri:s,attributeType:m})),[s,m]),w=(0,h.O27)(y),S=m.required&&w,C=(0,r.useMemo)((()=>S?[E]:y),[E,y,S]),O=(0,r.useMemo)((()=>[...C.filter((0,l.pipe)((0,l.prop)("uri"),(0,l.both)(h.ZiX,(0,l.pipe)((0,l.equals)(e),l.not)))),...(0,l.map)((e=>C.find((0,l.propEq)("uri",e.uri))||e))(g)].map((e=>{var t;return null!==(t=n.find((0,l.propEq)("uri",e.uri)))&&void 0!==t?t:e}))),[C,n,e,g]),P=(0,r.useMemo)((()=>(0,l.pipe)((0,l.map)((0,l.prop)("uri")),(0,l.filter)((e=>!C.find((0,l.propEq)("uri",e)))))(f?g:[])),[C,g,f]),k=C.filter((t=>{let{uri:r}=t;return r===e||n.find((0,l.propEq)("uri",r))})),N=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.modifyAttribute,o)(sr({},e,{viewId:p}))),[p,o]),Z=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.removeAttribute,o)(sr({},e,{viewId:p}))),[p,o]),R=(0,r.useCallback)((()=>{const e=(0,h.gjI)({parentUri:s,attributeType:m});t(e.uri),N({value:sr({},e,{value:(0,h.GPx)({attributeTypes:(0,h.BoX)(c,m),parentUri:e.uri,mode:i,metadata:c})}),uri:e.uri,attributeType:m})}),[s,m,c,i,N]),T=(0,r.useCallback)((e=>{a((t=>t.find((0,l.propEq)("uri",e.uri))?t:[...t,e]))}),[a]),j=(0,r.useCallback)((e=>{const r=n.find((0,l.propEq)("uri",e.uri));if(r){const t={attributeType:m,value:r,uri:e.uri};a((e=>(0,l.without)([r],e))),w||N(t)}else{const n={value:e,attributeType:m,uri:e.uri};t(null),Z(n)}o(v.N5.errors.actions.errorsSet([]))}),[Z,N,a,w,n,m,o]),I=(0,r.useCallback)(((e,t)=>{const n=(0,h.q5j)(c,m,e,t).map((n=>sr({},n,{path:(0,h.Z9i)({entityUri:s,metadata:c,entitiesMap:t||{[s]:(0,h.PeS)(m,e)}},n.uri||n.parentUri)})));return o(v.N5.errors.actions.errorsSet(n)),0===n.length}),[o,s,m,c]),D=(0,r.useCallback)(((e,n)=>{I(e,n)&&(t(null),a((t=>{const n=t.find((0,l.propEq)("uri",e.uri));return n?(0,l.without)([n],t):t})))}),[a,t,I]),L=(0,r.useCallback)((()=>{a([]),t(null)}),[]);return{checkHasChanges:e=>n.find((0,l.propEq)("uri",e.uri))!==e,onChangeAttribute:N,onDeleteAttribute:Z,onAdd:R,onCancel:j,onApply:D,onStartEditing:T,onReset:L,modifiedValues:O,editingValues:k,deletedUris:P}})(),{ref:j,errorClassName:I}=(0,me.B)({highlightedError:o,isSimple:!0}),D=s?Z:u,L=(0,r.useMemo)((()=>p.map((e=>y.find((0,l.propEq)("id",e))))),[p,y]);return a().createElement("div",{ref:j,className:I},s&&!(0,l.isEmpty)(c)&&a().createElement(yr,{config:t,editingValues:R,modifiedValues:Z,onChangeAttribute:S,onDeleteAttribute:E,onAdd:C,onReset:k,onCancel:O,onApply:P,onStartEditing:w,checkHasChanges:N,highlightedError:null==o?void 0:o.element,highlightedAttributeError:null==i?void 0:i.element}),L.length>0&&a().createElement(ir,{columnsData:L,config:t,values:D,filters:f,onFilter:m,sorting:b,onSort:g,onEdit:w,onDeleteAttribute:E,deletedUris:T}))})),xr=(0,le.makeStyles)((()=>({root:{display:"flex",flexDirection:"column"},content:{position:"relative",overflow:"hidden"},noData:{fontSize:"13px",paddingLeft:"20px",color:"rgba(0,0,0,0.54)"},header:{padding:"0 4px 0 16px"}}))),Er=15,wr=e=>{let{config:t,className:n}=e;const{caption:o,max:l=Er}=t,i=xr(),s=(0,x.useSelector)(v.ZP.selectors.getEntityUri),{totalVisibleValues:c,attributeType:u,showTable:p,hasPaging:d,isLoading:m,page:g,setPage:f}=(0,r.useContext)(Sn);return a().createElement(B.Z,{className:V()(i.root,n)},p?a().createElement(a().Fragment,null,a().createElement(Jn,{title:o}),a().createElement("div",{className:i.content},a().createElement(vr,{config:t,attributeType:u,entityUri:s}),d&&a().createElement(q.Z,{count:c,rowsPerPageOptions:[],rowsPerPage:l,page:g,onChangePage:f}),m&&a().createElement(L.Z,null))):a().createElement(a().Fragment,null,a().createElement(Y.Z,{title:o,className:i.header},a().createElement($.Z,{description:null==u?void 0:u.description})),a().createElement(G.Z,{className:i.noData},y().text("No data"))))};var Sr=n(37163);function Cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Or=0;const Pr=()=>Or++,kr=e=>{const t={children:[],nodeId:Pr()};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:Pr(),expanded:!0,rootIndex:i?n+1:void 0};i&&(s.root=i),a.children.push(s),a=s}}return t.children};var Nr=n(683);const Zr=(0,le.makeStyles)((e=>({container:{fontSize:"13px",display:"flex",paddingTop:"6px",position:"relative"},title:{flexGrow:1,minHeight:"15px",color:e.palette.primary.main,lineHeight:"15px"},wrapper:{width:"100%"},hidePageSelectorWhenSmall:{"@media (min-width: 450px)":{"& .MuiInputBase-root":{display:"none"},"& .MuiTablePagination-selectLabel":{display:"none"}}},avatar:{height:"16px",width:"16px",marginRight:"8px",marginLeft:"8px"},header:{padding:"0 4px 0 16px"},treeContainer:{flexGrow:1,display:"flex",flexDirection:"column",height:"100%",minHeight:"372px",maxHeight:"507px",overflow:"auto"},tree:{flexGrow:1,height:0},buttonsContainer:{flexShrink:0,marginLeft:"auto","& > * + *":{marginLeft:"-4px"}},button:{padding:"8px"},errorMessage:{fontSize:"13px",margin:"0 16px 0",lineHeight:"1.4",color:e.palette.text.secondary},linearIndicator:{top:"42px"}})));var Rr=n(1242);const Tr=a().createContext(null),jr=e=>{e.target.src=Rr},Ir=e=>{let{node:t}=e;const{entity:{uri:n},nodeId:o}=t,l=(0,h.idV)(t.entity.label),i=Zr(),s=(0,x.useSelector)(v.ZP.selectors.getAbsoluteImagePath),c=(0,x.useSelector)(v.ZP.selectors.getMetadata),{uri:u}=(0,x.useSelector)(v.ZP.selectors.getEntity),[p,d]=(0,r.useState)(),m=(0,r.useContext)(Tr),g=n===u,f=(0,h.nt9)(c,t.entity.type),b=f?(0,h.VD3)(c,f,"typeGraphIcon"):null,y=b&&(0,h.vPL)(s,b);return a().createElement("div",{className:i.wrapper,"data-node-id":o},a().createElement("div",{ref:d,className:i.container},a().createElement(rn.Z,{alt:"Node icon",className:V()(i.avatar),src:y||Rr,onError:jr}),a().createElement(Nr.Z,{isSelected:g,title:l,entityUri:n,viewId:m.id,anchorEl:p})))},Dr=((0,r.memo)(Ir),e=>{let{node:t}=e;return t.nodeId}),Lr=(0,le.makeStyles)((()=>({lineBlock:{height:"100%",position:"relative",display:"inline-block"},lineChildren:{height:"100%",position:"absolute",display:"inline-block","&:after":{content:"''",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)",width:"1px",left:"50%",bottom:"0",height:`calc(100% - ${Vr.rowHeight}px)`}},rootIndex:{display:"flex",alignItems:"center",color:"rgba(0,0,0,0.54)",height:"100%"},verticalLine:{width:"1px",left:"calc(50% - 1px)",top:0,height:Vr.rowHeight/2+"px",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:Vr.rowHeight/2+"px",left:"calc(50% - 1px)",width:"24%",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},node:{minWidth:"100%",position:"relative",textAlign:"left",padding:"0 24px 0 18px",boxSizing:"border-box",whiteSpace:"normal","&:hover":{backgroundColor:"rgba(0,0,0,0.06)"}},rootNode:{padding:"0 24px 0 13px"},longRootNode:{padding:"0 24px 0 5px"},nodeContent:{position:"absolute",top:0,bottom:0,paddingLeft:"18px",boxSizing:"border-box"},nodeRootLongContent:{paddingLeft:"20px"},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 Mr(){return Mr=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},Mr.apply(this,arguments)}function Ar(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zr(){return zr=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},zr.apply(this,arguments)}const Vr={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"]),d=i,m=r&&!o.root&&o.children&&o.children.length>0,g=Lr();return a().createElement("div",zr({style:{height:"100%"}},p,{key:o.nodeId}),m&&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},m&&a().createElement("div",{className:g.buttonWrapper,onClick:()=>{r({node:o,path:s,treeIndex:c})}},a().createElement("div",{"aria-label":o.expanded?"Collapse":"Expand",className:V()(g.button,o.expanded?g.expandedButton:g.collapsedButton)})),a().createElement("div",{className:g.rowTitle},"function"==typeof d?d({node:o,path:s,treeIndex:c}):d))))},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=Lr(),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 d=i.root?r-4:0,m=r*u-d,g={left:m,width:`calc(100% - ${m}px`},f=`${m+250}px`,h=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ar(e,t,n[t])}))}return e}({},s.style,{width:f}),b=(null==i?void 0:i.rootIndex)>99&&i.root;return a().createElement("div",Mr({},s,{className:V()(c.node,{[c.longRootNode]:b,[c.rootNode]:i.root&&!b}),style:h}),p,a().createElement("div",{className:V()(c.nodeContent,{[c.nodeRootLongContent]:b}),style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function Ur(){return Ur=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},Ur.apply(this,arguments)}const Hr=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",Ur({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"})))},Fr=e=>{let{title:t,onGraphOpen:n}=e;const o=Zr(),{showNavigateToGraph:l}=(0,r.useContext)(O.Y);return a().createElement(Y.Z,{title:t,className:o.header},l&&a().createElement("div",{className:o.buttonsContainer},a().createElement(We.k,{className:o.button,tooltipTitle:y().text("Show Graph"),icon:Hr,onClick:n,size:"L"})))},Wr=e=>Dr({node:e});function Br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qr=[10,25];var _r=n(52241),Gr=n(69089);const Yr=(0,le.makeStyles)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function Qr(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){$r(e,t,n[t])}))}return e}function $r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xr=e=>{let{config:t,className:n}=e;const o=(0,r.useRef)(),i=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{height:u,width:p,tooltip:d}=t,{html:m,visible:g,tooltip:f,customStyles:h,popup:b}=(0,_r.E)(t),y=Yr(),v=f||d;(0,r.useEffect)((()=>{o.current&&m&&(o.current.innerHTML="",Array.from(m.childNodes).forEach((e=>{o.current.appendChild(e)})))}),[m]),(0,r.useEffect)((()=>{c(!!b)}),[b]),(0,r.useEffect)((()=>{s&&i.current&&(i.current.innerHTML="",b&&Array.from(b.childNodes).forEach((e=>{i.current.appendChild(e)})))}),[s,b]);const x=(0,l.reject)(l.isNil,{width:p,height:u});return g?a().createElement("div",{className:y.bodyWrapper},a().createElement(Gr.Z,{ref:i,open:!!b}),a().createElement(ft.Z,{title:v||""},a().createElement("div",{ref:o,style:Qr({},x,h),className:V()(y.root,n)}))):null};var Kr=n(7882);const Jr=e=>{const t=t=>a().createElement(Kr.Z,{error:a().createElement(k.ZP,{LogoRenderer:k.B9.ERROR,text:"",secondaryText:y().text("Something went wrong"),variant:k.tC.small})},a().createElement(e,t));return t.displayName="WithErrorBoundary",t},ea=(0,le.makeStyles)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var ta=n(25744),na=n(63436),ra=n(40702),aa=n(40435);const oa=(0,l.pipe)((0,l.path)(["point","lat"]),(0,l.both)((0,l.gt)(90),(0,l.lt)(-90))),la=(0,le.makeStyles)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var ia=n(61347),sa=n(66078);const ca=(0,le.makeStyles)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),ua=ca,pa=e=>{let{totalImages:t}=e;const n=ua(),r=t>1?y().text("photos"):y().text("photo");return a().createElement(G.Z,{variant:"caption",className:n.caption},`${t} ${r}`)};function da(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){ma(e,t,n[t])}))}return e}function ma(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ga=e=>{let{config:t,attributeType:n,paging:r,requestNextPageOfAttributeValues:o}=e;const i=(0,x.useDispatch)(),s=(0,x.useSelector)(v.ZP.selectors.getEntity),c=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,s.uri)||{})),u=(0,l.pathOr)([],["attributes",n.name],c),p=t.id;return a().createElement(a().Fragment,null,a().createElement(sa.Z,{attributeValues:u,attributeType:n,onDeleteAttribute:e=>(0,l.pipe)(v.N5.actions.removeAttribute,i)(da({},e,{viewId:p})),parentUri:c.uri,onChangeAttribute:e=>(0,l.pipe)(v.N5.actions.modifyAttribute,i)(da({},e,{viewId:p})),imageSize:ba,paging:r,requestNextPageOfAttributeValues:o}),a().createElement(pa,{totalImages:u.length}))},fa=(0,le.makeStyles)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),ha=fa,ba={imageMargin:4,imageWidth:162,imageHeight:162};var ya=n(55485),va=n(23044),xa=n(20200),Ea=n(25601),wa=n(84236),Sa=n(48376);function Ca(){return Ca=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ca.apply(this,arguments)}const Oa=e=>{let{config:t,match:n,onStartRequest:o,onFinishRequest:l}=e;const i=(0,x.useDispatch)(),s=(0,x.useSelector)(v.ZP.selectors.getMetadata),c=(0,x.useSelector)(v.ZP.selectors.getEntity),{canMerge:u,canMark:p}=(0,h.hXd)(s,t,n.object,c,n.matchRules),m=(0,r.useMemo)((()=>[n.object]),[n.object]),g={entity:c,entities:m,mode:Ea.N.iconButton,onStartRequest:o},f=(0,r.useContext)(d.m),b=(0,r.useCallback)((()=>{l(),i(v.N5.entity.actions.loadEntity({viewId:f,uri:c.uri}))}),[i,c.uri,l,f]);return a().createElement(a().Fragment,null,u&&a().createElement(wa.H,Ca({},g,{onFinishRequest:b})),p&&a().createElement(Sa.i,Ca({},g,{onFinishRequest:l})))},Pa=e=>{let{config:t,entitiesMap:n,match:r,onFinishRequest:o,onStartRequest:l}=e;const i=(0,x.useSelector)(v.ZP.selectors.getMetadata),s=(0,x.useSelector)(v.ZP.selectors.getEntity);return a().createElement(xa.M,{match:r,entity:s,entitiesMap:n,metadata:i,className:At.U},a().createElement(zt.Z,{uri:(0,h.E_P)(s.uri,r.object.uri),relatedObjectUris:(0,h.wp9)(h.q7e.POTENTIAL_MATCH,{entityUri:s.uri,matchEntityUri:r.object.uri}),objectType:h.q7e.POTENTIAL_MATCH}),a().createElement(Oa,{match:r,config:t,onStartRequest:l,onFinishRequest:o}))},ka=(0,le.makeStyles)((e=>({root:{display:"flex",flexDirection:"column",minHeight:"52px"},matchesContainer:{position:"relative"},footer:{display:"flex",alignItems:"end",flexGrow:1,justifyContent:"flex-start",borderTop:"1px solid rgba(0,0,0, 0.12)",padding:"8px 16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},noData:{paddingLeft:"16px",paddingBottom:"16px",fontSize:"13px",color:"rgba(0,0,0,0.54)"}}))),Na={showTransitiveMatches:!0,showInactiveEntities:!1},Za={order:h.KM9.asc,field:"score"};var Ra;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Ra||(Ra={}));const Ta=e=>(0,l.pipe)(Jr,U.Z)(e),ja=Ta((e=>{let{className:t}=e;const n=ea();return a().createElement(B.Z,{className:V()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),Ia=Ta((e=>{let{className:t,config:n}=e;return a().createElement(H.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Da=Ta((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=Me(e,s),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){Ae(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:o,page:a,toggleShowInactive:u,showInactive:l},c)})(n);return a().createElement(F.Provider,{value:o},a().createElement(je,{config:n,className:t}))})),La=Ta((e=>{let{config:t,className:n}=e;const o=(e=>{var t;const{attributeUri:n}=e,a=(0,x.useSelector)(v.ZP.selectors.getMetadata),o=(0,r.useMemo)((()=>(0,h.zeJ)(a,n)),[a,n]),i=(0,r.useMemo)((()=>o?((e,t)=>(0,l.pipe)(((e,t)=>(0,h.WN0)(e,t)),(0,l.map)((e=>Bn(e,[t]))),(0,l.chain)(h.HQx),(0,l.uniqBy)((0,l.prop)("id")))(e,t))(a,o):[]),[a,o]),s=(0,r.useMemo)((()=>({searchQuery:"",filters:null,sorting:void 0,visibleColumns:i.filter((0,l.pipe)((0,l.prop)("dataTypeDefinition"),h.YkM,l.not)).map((e=>{let{id:t}=e;return t})).slice(0,5),page:0})),[i]),[c,u]=(0,r.useReducer)(Tn,s),{searchQuery:p,filters:d,sorting:m,page:g}=c,f=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),b=(0,r.useMemo)((()=>{const e=((e,t)=>h.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([]))(i,d);return e.length?e:null}),[d,i]),y=(0,r.useMemo)((()=>(0,l.reject)(l.isNil,{filters:b,page:g,sorting:m,searchQuery:p})),[b,g,m,p]),{changeSearchQuery:E,changePage:w,toggleSort:S,changeFilter:C,toggleFilters:O,changeColumns:P}=(0,Cn.o)({actions:Rn,dispatch:u}),k=Me(e,y);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){Qn(e,t,n[t])}))}return e}({},c,{setSearchQuery:E,setPage:w,onSort:S,onFilter:C,onToggleFilters:O,onChangeColumns:P,showTable:Boolean(((null==k||null===(t=k.values)||void 0===t?void 0:t.length)||b||p||f)&&o&&!o.hidden),allColumnsData:i},k)})(t);return a().createElement(Sn.Provider,{value:o},t&&a().createElement(wr,{config:t,className:n}))})),Ma=Ta((e=>{let{config:t,className:n}=e;const o=(0,x.useSelector)(v.ZP.selectors.getMetadata),i=(0,r.useMemo)((()=>(0,h.fS6)(o,t)),[o,t]),s=(e=>{var t;const n=(0,r.useMemo)((()=>(0,l.pipe)(Object.entries,(0,l.map)((e=>{let[t,n]=e;return{value:t,label:n}})),(0,l.unless)((e=>(0,h.O27)(e)||e.some((0,l.propEq)("value","name"))),(0,l.append)({label:y().text("Name"),value:"name"})))(e.sortOptions||{})),[e.sortOptions]),a=Number(e.max)||15,[o,i]=(0,r.useState)(0),[s,c]=(0,r.useState)(e.sortOrder||"asc"),[u,p]=(0,r.useState)(null===(t=n[0])||void 0===t?void 0:t.value),[d,m]=(0,r.useState)(""),[g,f]=(0,r.useState)(!1),b=(0,r.useCallback)((()=>{i(0),f((e=>!e))}),[]),v=(0,r.useCallback)((()=>{i(0),c((e=>"asc"===e?"desc":"asc"))}),[]),x=(0,r.useCallback)((e=>{i(0),p(e)}),[]);return{searchQuery:d,changeSearchQuery:(0,r.useCallback)((e=>{i(0),m(e)}),[]),sortOrder:s,toggleSortOrder:v,sortOption:u,changeSortOption:x,sortOptions:n,page:o,setPage:i,rowsPerPage:a,showInactive:g,toggleShowInactive:b}})(i);return a().createElement(_e.Provider,{value:s},a().createElement(wn,{config:i,className:n}))})),Aa=Ta(Xr),za=Ta((e=>{let{config:t,className:n}=e;const{id:o,caption:i,graph:s,_showNavigateToGraph:u}=t,p=null==s?void 0:s.type,d=Zr(),m=(0,x.useDispatch)(),g=(0,x.useSelector)(v.ZP.selectors.getEntityUri),{treeData:f,setTreeData:b,errorMessage:E,isLoading:w,rowsPerPage:S,count:C,onChangePage:P,onChangeRowsPerPage:k,page:N}=((e,t)=>{const n=(0,Ie._)(),[a,o]=(0,r.useState)(!1),[i,s]=(0,r.useState)([]),[c,u]=(0,r.useState)(null),[p,d]=(0,r.useState)(25),[m,g]=(0,r.useState)([]),[f,b]=(0,r.useState)(0);(0,r.useEffect)((()=>{g(i.slice(f*p,f*p+p))}),[f,p,i]),(0,r.useEffect)((()=>{b(0),d(25)}),[i]);const E=(0,r.useCallback)((e=>{d(e),b(0)}),[d]),w=(0,x.useSelector)(v.ZP.selectors.getEntity);return(0,De.D)((()=>{const e=i.map(((e,t)=>({tree:e,index:t}))).reduce(((e,t)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Cr(e,t,n[t])}))}return e}({},e,{[t.index]:{root:t.tree}})),{}),t=(0,h.XTh)((0,l.pick)(["uri","label","secondaryLabel","type"],w),e);s(t.map((0,l.prop)("root")))}),[null==w?void 0:w.updatedTime]),(0,r.useEffect)((()=>((0,h.ZiX)(e)||(u(null),o(!0),n((0,h.RFJ)({uri:e,graphUri:t})).then(kr).then(s).catch((e=>{console.warn(e),u((0,h.xU7)(e,y().text("Something went wrong")))})).finally((()=>{o(!1)}))),()=>{s([])})),[e,t,n]),{isLoading:a,treeData:m,setTreeData:s,errorMessage:c,rowsPerPage:p,count:i.length,onChangePage:b,onChangeRowsPerPage:E,page:f}})(g,p),{onResize:Z,getRowHeight:R,clearHeightsCache:T}=(()=>{const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)((()=>{t({})}),[]);return{onResize:(0,r.useCallback)((e=>(n,r)=>{t((t=>t[Wr(e)]!==r?(0,l.assoc)(Wr(e),r,t):t))}),[]),getRowHeight:(0,r.useCallback)((t=>{let{node:n}=t;return e[Wr(n)]?Math.max(e[Wr(n)],Vr.rowHeight):Vr.rowHeight}),[e]),clearHeightsCache:n}})(),j=(0,r.useContext)(O.Y),I=void 0!==u?u:j.showNavigateToGraph,D=(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Br(e,t,n[t])}))}return e}({},j,{showNavigateToGraph:I})),[I,j]),M=(0,r.useCallback)((()=>{m(v.ui.actions.openGraph({viewId:o,graphType:p,entityUri:g}))}),[m,o,p,g]),A=(0,r.useCallback)((e=>({title:a().createElement(c.Z,{handleHeight:!0,refreshMode:"debounce",refreshRate:100,onResize:Z(e.node)},a().createElement(Ir,{node:e.node}))})),[Z]);return(0,r.useEffect)((()=>{T()}),[T,g]),a().createElement(O.Y.Provider,{value:D},a().createElement(B.Z,{className:n},a().createElement(Fr,{onGraphOpen:M,title:i}),w&&a().createElement(L.Z,{className:d.linearIndicator}),a().createElement(Tr.Provider,{value:t},a().createElement("div",{className:d.treeContainer},a().createElement("div",{className:d.tree},E?a().createElement(G.Z,{className:d.errorMessage},E):a().createElement(a().Fragment,null,a().createElement(Sr.ZP,{isVirtualized:!1,treeData:f,canDrag:!1,theme:Vr,generateNodeProps:A,onChange:b,getNodeKey:Dr,rowHeight:R})))),C>qr[1]?a().createElement(q.Z,{classes:{root:d.hidePageSelectorWhenSmall},count:C,onChangePage:P,page:N,rowsPerPage:S,onChangeRowsPerPage:k,rowsPerPageOptions:qr,labelRowsPerPage:y().text("Roots per page:")}):null)))})),Va=Ta((e=>{let{config:t,className:n}=e;const o=ka(),i=(0,x.useSelector)(v.ZP.selectors.getEntity),s=(0,h.wwR)(i),[c,u]=(0,r.useState)(!1),p=(0,r.useCallback)((()=>{u(!0)}),[]),m=(0,r.useCallback)((()=>{u(!1)}),[]),{matches:g,entitiesMap:f,loadMatches:b}=(0,va.s)({enabled:!!s,entity:i,options:Na,filter:"",page:0,sorting:Za,rowsPerPage:3,onStartLoading:p,onFinishLoading:m}),E=(0,r.useCallback)((()=>{b()}),[b]),w=(0,x.useDispatch)(),C=(0,r.useContext)(d.m),O=(0,r.useCallback)((()=>{w(v.ui.actions.openPerspective({perspectiveId:"potentialMatches",viewId:C}))}),[w,C]),P=(0,r.useMemo)((()=>(0,h.NVY)(s,(0,l.map)(h.ev7,g))),[s,g]),{getCommentsCount:k}=(0,r.useContext)(S.h);(0,r.useEffect)((()=>{k(P)}),[k,P]);const N=!(0,l.isEmpty)(g),Z=c?Ra.Loading:(0,l.isEmpty)(g)?Ra.NoData:Ra.Loaded;return a().createElement(He.X.Provider,{value:f},a().createElement(B.Z,{className:V()(o.root,n)},a().createElement(Y.Z,{title:t.caption}),a().createElement("div",{className:o.matchesContainer},Z===Ra.Loading&&a().createElement(L.Z,null),Z===Ra.NoData&&a().createElement(G.Z,{className:o.noData},y().text("No matches found")),Z===Ra.Loaded&&g.map((e=>a().createElement(Pa,{config:t,entitiesMap:f,match:e,onFinishRequest:E,onStartRequest:p,key:e.object.uri})))),N&&a().createElement(a().Fragment,null,a().createElement("div",{className:o.footer},a().createElement(ya.Z,{component:"button",variant:"caption",onClick:O,underline:"none"},y().text("See all"))))))})),Ua=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,91572)).then((e=>({default:Ta(e.HierarchyTreeView)}))))),Ha=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,51317)).then((e=>({default:Ta(e.RelationshipsTableView)}))))),Fa=Ta((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:o,className:l}=e;const i=la(),s=(0,x.useSelector)(v.ZP.selectors.getMetadata),c=(0,x.useSelector)(v.ZP.selectors.getEntity),u=(0,x.useSelector)(v.ZP.selectors.getGoogleMapKey),{markers:p,loading:d}=((e,t,n)=>{const[a,o]=(0,r.useState)([]),[l,i]=(0,r.useState)(!0),s=(0,Ie._)();return(0,r.useEffect)((()=>{i(!0),s((0,h.DBr)(t,[e],n)).then((e=>{o(e.filter(oa))})).catch((()=>{o([])})).finally((()=>{i(!1)}))}),[e,t,n,s]),{markers:a,loading:l}})(c,s,u),m=(0,r.useMemo)((()=>a().createElement("div",{className:i.fullHeight},a().createElement(L.Z,null))),[i]),g=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),f=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return u&&a().createElement(B.Z,{className:V()(i.root,l)},d&&a().createElement(L.Z,null),a().createElement(aa.Z,{size:"S",icon:n?na.Z:ta.Z,onClick:()=>o(t.id),className:i.fullscreenBtn}),a().createElement(ra.Z,{loadingElement:m,defaultZoom:1,defaultCenter:g,markers:p,mapContainerClassName:i.fullHeight,mapKey:u,mapOptions:f}))})),Wa=Ta((e=>{let{config:t,className:n}=e;const{attributeUri:o}=t,i=ha(),s=(0,x.useDispatch)(),c=(0,x.useSelector)(v.ZP.selectors.getMode),u=(0,x.useSelector)(v.ZP.selectors.getEntityWithDiff),p=(0,x.useSelector)(v.ZP.selectors.getMetadata),d=o?(0,h.zeJ)(p,o):null,m=t["text-empty"]||y().text("No data found"),g=(0,r.useCallback)((e=>s(v.N5.actions.requestNextPageOfAttributeValues(e))),[s]);return a().createElement(B.Z,{className:n},a().createElement(Y.Z,{title:t.caption},a().createElement($.Z,{description:null==d?void 0:d.description})),a().createElement("div",{className:i.container},(()=>{if(d){const e=(0,l.pathOr)([],["attributes",d.name],u),n=(0,l.path)(["attributes","paging",o],u),r=e.length;if((0,h.KIu)(c)){const e={attributeType:d,config:t,paging:n,requestNextPageOfAttributeValues:g};return a().createElement(ga,e)}if(r>0){const t={attributeValues:e,attributeType:d,imageSize:ba,paging:n,parentUri:u.uri,requestNextPageOfAttributeValues:g};return a().createElement(a().Fragment,null,a().createElement(ia.Z,t),a().createElement(pa,{totalImages:r}))}}return a().createElement(G.Z,{className:i.noData},m)})()))}));class Ba{}Ba.ViewTypes=h.ZIY,Ba.getComponentBy=(e,t)=>{let{config:n,className:r,isFullscreen:o,onToggleFullscreen:l}=t;switch(n[e]){case Ba.ViewTypes.HierarchyTree:return a().createElement(Ua,{config:n,className:r});case Ba.ViewTypes.HierarchyPaths:return a().createElement(za,{config:n,className:r});case Ba.ViewTypes.RelationsTable:return a().createElement(Ha,{config:n,className:r});case Ba.ViewTypes.Relations:return a().createElement(Ma,{config:n,className:r});case Ba.ViewTypes.Attributes:return a().createElement(Ia,{className:r,config:n});case Ba.ViewTypes.SingleAttribute:return a().createElement(Da,{config:n,className:r});case Ba.ViewTypes.AttributeTable:return a().createElement(La,{config:n,className:r});case Ba.ViewTypes.Map:return a().createElement(Fa,{config:n,isFullscreen:o,onToggleFullscreen:l,className:r});case Ba.ViewTypes.Custom:return a().createElement(Aa,{config:n,className:r});case Ba.ViewTypes.ImageAttribute:return a().createElement(Wa,{config:n,className:r});case Ba.ViewTypes.PotentialMatches:return a().createElement(Va,{config:n,className:r})}},Ba.getComponent=e=>Ba.getComponentBy("class",e)||Ba.getComponentBy("react-class",e)||a().createElement(ja,{className:e.className});const qa=Ba,_a=()=>null,Ga=(0,r.memo)((e=>{let{config:t,isFullscreen:n,isAutosize:o,onToggleFullscreen:l}=e;const i=ea();return a().createElement(r.Suspense,{fallback:a().createElement(_a,null)},qa.getComponent({config:t,className:V()(i.component,{[i.fullHeight]:!o}),isFullscreen:n,onToggleFullscreen:l}))}));Ga.displayName="ViewComponent";const Ya=(0,le.makeStyles)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"},overflowContainer:{width:"100%",height:"100%",overflow:"hidden"}})));function Qa(){return Qa=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},Qa.apply(this,arguments)}const $a=["onConfigChanged","onRemove"],Xa=e=>{var t;let{layoutItemConfig:n,views:r,className:o,children:i,style:s,isFullscreen:c,onToggleFullscreen:u,AutosizeComponent:p}=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 m=r.find((e=>{let{id:t}=e;return n.i===t})),g=Ya(),f=(0,x.useSelector)(v.ZP.selectors.getGoogleMapKey);if(!m)return null;const b=m.class===qa.ViewTypes.Custom;if(b&&(null==m||null===(t=m.action)||void 0===t?void 0:t.platform)===h.X1H.CLASSIC)return null;if(m.class===qa.ViewTypes.Map&&!f)return null;const y=(e=>{var t;return null===(t=Object.entries(h.ZIY).find((t=>{let[n,r]=t;return e===r})))||void 0===t?void 0:t[0]})(m.class);return a().createElement("div",Qa({},(0,l.omit)($a,d),{"data-reltio-id":m.id,"data-reltio-class":y||"",style:s,className:V()(o,{[g.item]:!b,customView:b})}),a().createElement("div",{className:g.overflowContainer},a().createElement("div",{"data-reltio-id":"profile-view-container",className:V()({[g.fixedSizeContainer]:!p})},p,a().createElement(Ga,{config:m,isFullscreen:c,onToggleFullscreen:u,isAutosize:Boolean(p)})),i))},Ka=1024,Ja=(0,le.makeStyles)({scrollWrapper:{flexGrow:1,overflow:"auto"},scrollableContent:e=>{let{maxWidth:t,minWidth:n=Ka,scrollbarWidth:r}=e;return{minWidth:t&&t<n?t-r:n,height:"100%"}}}),eo=e=>{let{views:t,layout:n,frozen:o,entityUri:l,maxWidth:i,minWidth:s,onLayoutChanged:c}=e;const u=(0,r.useRef)(),p=(d=u.current)?d.offsetWidth-d.clientWidth:0;var d;const m=u.current,g=Ja({maxWidth:i,minWidth:s,scrollbarWidth:p}),f=(0,r.useMemo)((()=>({element:m,priority:["left","right","top","bottom"]})),[m]);return(0,r.useEffect)((()=>{u.current&&(u.current.scrollTop=0)}),[l]),a().createElement("div",{ref:u,className:g.scrollWrapper},a().createElement("div",{className:g.scrollableContent,"data-reltio-id":"reltio-profile-grid"},a().createElement(M.p.Provider,{value:f},a().createElement(A.Z,{LayoutItem:Xa,views:t,layout:n,onLayoutChanged:c,draggableHandle:".viewDraggableHandle",isStatic:o}))))};var to=n(10050),no=n(83820),ro=n(92679);const ao=(0,le.makeStyles)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),oo=e=>{let{notification:t}=e;const n=ao({}),o=(0,x.useDispatch)(),l=(0,x.useSelector)(v.ZP.selectors.getAutoCloseInterval),i=t.autoHideDuration||l&&1e3*l||5e3,[s,c]=(0,r.useState)(),[u,p]=(0,r.useState)(!0),d=(0,r.useCallback)(((e,n)=>{"clickaway"!==n&&(o(v.ui.actions.closeNotification(t.id)),p(!1))}),[t]),m=(0,r.useCallback)((()=>{s.cancelAction&&o(s.cancelAction),c(void 0)}),[s]),g=(0,r.useCallback)((()=>{o(s.applyAction),c(void 0),o(v.ui.actions.closeNotification(t.id))}),[s,t]),f=a().createElement(a().Fragment,null,t.actions.map((e=>a().createElement(ne.Z,{key:e.label,color:"primary",size:"small",onClick:()=>{e.needConfirmation?c(e):o(e.applyAction),p(!1)}},e.label)))),h=a().createElement(a().Fragment,null,a().createElement(aa.Z,{className:n.closeIcon,size:"S",icon:ro.default,onClick:d}),t.text);return a().createElement(a().Fragment,null,a().createElement(no.Z,{container:document.body},a().createElement(to.Z,{autoHideDuration:i,open:u,classes:{root:n.snackbar},action:f,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:h})),a().createElement(at.Z,{open:!!s,title:null==s?void 0:s.confirmationText,content:null==s?void 0:s.confirmationDescription,onSave:g,onDiscard:m,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))},lo=()=>{const e=(0,x.useSelector)(v.ZP.selectors.getNotifications);return e?a().createElement(a().Fragment,null,e.slice(-1).map((e=>a().createElement(oo,{key:e.id,notification:e})))):null};var io=n(15328),so=n(26436),co=n(70369),uo=n(50985),po=n(79386),mo=n(75647),go=n(76368),fo=n(36777),ho=n(97287);function bo(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){yo(e,t,n[t])}))}return e}function yo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vo(){return vo=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},vo.apply(this,arguments)}const xo=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",vo({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"}))))};function Eo(){return Eo=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},Eo.apply(this,arguments)}const wo=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",Eo({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},n),a().createElement("defs",null,a().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM20 8H8v12h12V8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg2383396984a"})),a().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},a().createElement("mask",{id:"svg2383396984b",fill:"#fff"},a().createElement("use",{xlinkHref:"#svg2383396984a"})),a().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2383396984b)",d:"M0 0h24v24H0z"})))},So=(0,le.makeStyles)({editingButtons:{display:"flex","& button + button":{minWidth:"88px",marginLeft:"8px"}},searchResults:{width:"150px",height:"25px",backgroundColor:"#ccc"},comments:{display:"flex",justifyContent:"flex-end",marginTop:"10px"},menuButton:{marginLeft:8},cancelButton:{border:"1px solid rgba(0, 0, 0, 0.23)"}}),Co=e=>a().createElement(io.Z,e,a().createElement(xo,null)),Oo=e=>a().createElement(io.Z,e,a().createElement(wo,null)),Po=(e,t,n,r,a)=>e.filter((e=>{let{value:o,permission:l}=e;return!(n&&!(0,h.KIu)(o))&&!!(r&&a||!(0,h.fnZ)(o))&&(0,h.uGe)(l,t)})),ko=e=>{let{className:t,profileBandConfig:n,menuItems:o,showMenu:i=!0}=e;const s=So(),c=(0,x.useDispatch)(),u=(0,x.useSelector)(v.ZP.selectors.getCanUserStartProcessFromQuery),p=(0,x.useSelector)(v.ZP.selectors.getEntityWithoutDiff),d=(0,x.useSelector)((e=>v.ZP.selectors.getModifiedEntity(e,p.uri))),m=(0,x.useSelector)(v.ZP.selectors.getMetadata),g=(0,x.useSelector)(v.ZP.selectors.isWorkflowEnabled),f=(0,x.useSelector)(v.ZP.selectors.getMode),b=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),E=(0,x.useSelector)(v.ZP.selectors.getIsViewMode),w=(0,x.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),S=(0,x.useSelector)(v.ZP.selectors.getProfileOperation),C=null==p?void 0:p.type,O=(0,r.useMemo)((()=>(0,h.nt9)(m,C)),[C,m]),P=S===h.OXy.Saving,k=S===h.OXy.Cloning||P,[N,Z]=(0,r.useState)(!1),R=(0,r.useCallback)((()=>{Z(!1)}),[]),T=(e=>{let{cloneAction:t,onCloneDiscard:n}=e;const a=(0,x.useSelector)(v.ZP.selectors.getEntityWithoutDiff),o=(0,x.useSelector)(v.ZP.selectors.getMetadata),i=(0,x.useDispatch)(),s=null==a?void 0:a.type,c=o.relationTypes,u=(0,r.useCallback)((0,h.Ian)(o,s),[o,s]),p=(0,h.nt9)(o,s),d=(0,r.useMemo)((()=>(0,l.when)((0,l.complement)(l.isNil),(0,l.pipe)((0,l.find)((0,l.pipe)((0,l.propOr)([],"entityTypeUris"),(0,l.either)((0,l.includes)(s),(0,l.includes)("*")))),(0,l.when)((0,l.complement)(l.isNil),(0,l.omit)(["entityTypeUris"]))))(t)),[t,s]),m=(0,r.useCallback)((()=>{if(d){const e=(0,l.pipe)((0,l.prop)("relationshipTypesToCopy"),(0,l.cond)([[l.isNil,(0,l.pipe)((0,l.always)(p),(0,l.propOr)([],"attributes"),(0,l.filter)(h.YkG),(0,l.map)(h.ZaZ))],[(0,l.includes)("*"),(0,l.pipe)((0,l.always)(c||[]),(0,l.map)((0,l.prop)("uri")),(0,l.filter)(u))],[l.T,l.identity]]))(d);i(v.N5.entity.actions.entityCloneRequested({data:bo({},(0,l.pick)(["attributeReplacementMapping"],d),{relationshipTypesToCopy:e}),entityUri:a.uri}))}n()}),[d,n,p,c,a.uri,u]);return d?m:void 0})({cloneAction:null==n?void 0:n.cloneAction,onCloneDiscard:R}),j=(0,r.useMemo)((()=>[{label:y().text("Editing"),value:h.fO_.EDITING,description:y().text("Edit profile directly"),icon:co.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:h.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:Co,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:h.fO_.VIEWING,description:y().text("Read or print profile"),icon:so.Z,permission:"READ"}]),[]),I=(0,r.useMemo)((()=>[...T?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:Oo,onClick:()=>Z(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:pt.Z,onClick:()=>{window.confirm(y().text("Are you sure you want to delete this?"))&&c(v.N5.entity.actions.entityRemoveRequested({entityUri:p.uri}))},permission:"DELETE"}]),[c,p.uri,T]),D=!w&&!(0,h.biM)(p)&&!(e=>(0,h.uGe)(h.BDP.READ,e)&&!(0,h.uGe)(h.BDP.UPDATE,e)&&!(0,h.uGe)(h.BDP.DELETE,e)&&!(0,h.uGe)(h.BDP.INITIATE_CHANGE_REQUEST,e))(O),L=(0,h.ZiX)(null==p?void 0:p.uri),M=(0,r.useMemo)((()=>Po(j,O,L,g,u)),[j,O,g,u,L]),A=(0,r.useMemo)((()=>Po(I,O,L,g,u)),[I,O,g,u,L]),z=(0,r.useCallback)((e=>{c(v.N5.mode.actions.modeUpdated(e))}),[c]),U=(0,r.useCallback)((()=>{c(v.N5.mode.actions.modeCancelEditing())}),[c]),H=(0,r.useCallback)((()=>{c(v.N5.actions.saveProfile())}),[c]);return a().createElement(a().Fragment,null,a().createElement(po.Z,{className:V()(t,At.U),entity:b&&d?d:p},a().createElement(_.Z,{display:"flex",alignItems:"center"},a().createElement(_.Z,{mr:3},b&&a().createElement(_.Z,{className:s.editingButtons},a().createElement(ne.Z,{variant:"outlined",className:s.cancelButton,onClick:U,"data-reltio-id":"reltio-profile-cancel-editing",disabled:k},y().text("Cancel")),a().createElement(ne.Z,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:H,disabled:k},(0,h.fnZ)(f)?y().text("Suggest"):y().text("Save"))),w&&E?a().createElement(mo.Z,null):E&&a().createElement(go.a,null)),D&&a().createElement(fo.T,{optionsGroup:M,buttonsGroup:A,value:f,onChange:z,disabled:k}),i&&a().createElement(Ke.Z,{menuId:"profile-header-menu",buttonComponent:aa.Z,buttonProps:{icon:uo.Z,size:"L","data-reltio-id":"reltio-profile-header-menu",className:s.menuButton},menuItems:o,MenuItemRenderer:ho.Z})),a().createElement(_.Z,{className:s.comments},a().createElement(zt.Z,{uri:p.uri,relatedObjectUris:(0,h.wp9)(h.q7e.ENTITY,{entityUri:p.uri}),objectType:h.q7e.ENTITY}))),!!T&&a().createElement(at.Z,{open:N,title:y().text("Do you want to create a clone of the profile?"),content:y().text("Cloning will create a copy of the current profile. You can modify the cloned profile in the next step. Are you sure you want to proceed?"),onSave:T,onDiscard:R,saveCaption:y().text("Proceed"),discardCaption:y().text("Cancel")}))};var No=n(3466),Zo=n(11821),Ro=n(98273);const To=(0,le.makeStyles)({wrapper:{display:"flex",overflow:"hidden",flexShrink:0,marginLeft:"3px",height:"100%"},badge:{fontSize:"12px",height:"18px",minWidth:"18px",backgroundColor:"#FF4081",color:"#FFF"},badgePosition:{right:"5px"}});function jo(){return jo=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},jo.apply(this,arguments)}let Io;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(Io||(Io={}));const Do=e=>{let{active:t,tabs:n,onClose:o}=e;const i=To(),s=!(0,l.isNil)(t),{content:c,headerProps:u,hidden:p}=n[t]||{};return(0,r.useEffect)((()=>{p&&o()}),[t,p,o]),a().createElement("div",{className:i.wrapper},a().createElement(Zo.h,{open:s},!p&&a().createElement(a().Fragment,null,a().createElement(Ro.P,jo({},u,{onClose:o})),c)))};var Lo=n(69409),Mo=n(7108),Ao=n(37778),zo=n(32158),Vo=n(95085),Uo=n(70675),Ho=n(13510);const Fo=(0,le.makeStyles)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),Wo=()=>{const e=Fo(),t=(0,x.useSelector)(v.ZP.selectors.getDBConnectorSideViews);return a().createElement("div",{className:e.wrapper},t.map((t=>a().createElement(Xr,{key:t.id,config:t,className:e.itemWrapper}))))};var Bo=n(36592);const qo=()=>{const{total:e}=(0,r.useContext)(R.O),t=To();return a().createElement(ot.Z,{badgeContent:e,classes:{anchorOriginTopRightRectangular:t.badgePosition,badge:t.badge}},a().createElement(Bo.Z,null))};function _o(){return _o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_o.apply(this,arguments)}const Go=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",_o({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"})))))},Yo=()=>{const{commentsMap:e}=(0,r.useContext)(S.h),t=To();return a().createElement(ot.Z,{badgeContent:(0,h.mdt)(e),classes:{anchorOriginTopRightRectangular:t.badgePosition,badge:t.badge}},a().createElement(Go,null))};function Qo(){return Qo=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},Qo.apply(this,arguments)}const $o=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",Qo({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),a().createElement("path",{d:"M14.101 16A5.003 5.003 0 0016 18.987V20H2v-4h12.101zM22 18.987V20v-1.013zM4 17v2h2v-2H4zM16 4v1.013A5.004 5.004 0 0014.101 8H2V4h14zm6 0v1.013V4zM6 7V5H4v2h2zm8 3v4H2v-4h12zM4 11v2h2v-2H4zm12 4v-2h6v2c0 1.3-.84 2.4-2 2.82V22h-2v-4.18c-1.16-.42-2-1.52-2-2.82zm0-6c0-1.3.84-2.4 2-2.82V2h2v4.18c1.16.42 2 1.52 2 2.82v2h-6V9z",fill:"#000",fillOpacity:".54"}))};var Xo=n(48211);const Ko=(0,le.makeStyles)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Jo=()=>{const e=Ko(),{tasks:t,loading:n}=(0,r.useContext)(R.O);return a().createElement("div",{className:e.wrapper},n&&a().createElement(L.Z,null),t&&t.map((e=>a().createElement(Xo.s,{key:e.taskId,task:e}))))};var el=n(15422);const tl=()=>a().createElement(el.Z,{text:y().text("Ready to go with the flow?"),secondaryText:y().text("Suggest a change or submit a match review, and we’ll kick off a workflow task to get things going.")});var nl=n(86868),rl=n(89925),al=n(85101);const ol=(0,le.makeStyles)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),ll=()=>{const e=ol(),{getComments:t,comments:n,pageToken:o}=(0,r.useContext)(S.h),l=(0,x.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant);(0,r.useEffect)((()=>{t(l)}),[t,l]);const i=(0,nl.Q)(n);return a().createElement(He.X.Provider,{value:i},a().createElement(_.Z,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:o}=e;return a().createElement(rl.J,{key:o,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),o&&a().createElement(ya.Z,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(l,o)},underline:"none"},a().createElement(al.Z,{className:e.showMoreIcon}),y().text("Show more"))))},il=()=>a().createElement(el.Z,{text:y().text("Care to join the conversation?"),secondaryText:y().text("Leave comments for team members anywhere in the Profile page, and we’ll record it here.")}),sl=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},cl=(0,le.makeStyles)((()=>({profileContainer:{display:"flex",overflow:"hidden",flexGrow:1}}))),ul=(0,r.memo)((e=>{let{perspectiveId:t,commentId:n,hideHistory:o,children:i}=e;const s=cl(),{defaultTab:c,tabs:u}=(e=>{let{commentId:t,hideHistory:n,perspectiveId:o}=e;const l=(0,x.useSelector)(v.ZP.selectors.isWorkflowSideViewEnabled),i=(0,x.useSelector)(v.ZP.selectors.isWorkflowEnabled),s=(0,x.useSelector)(v.ZP.selectors.isCollaborationSideViewEnabled),c=(0,x.useSelector)(v.ZP.selectors.isDBConnectorSideViewEnabled),u=(0,x.useSelector)(v.ZP.selectors.isCollaborationEnabled),p=t?Io.Collaboration:void 0,d=(0,x.useSelector)(v.ZP.selectors.getHistoryEvent),m=(0,x.useSelector)(v.ZP.selectors.getMetadata),g=(0,x.useSelector)(v.ZP.selectors.getEntity),f=(0,r.useContext)(R.O),b=(0,r.useContext)(S.h),{isHistoryEnabled:E,isProfilePersisted:w}=(0,Lo.C)({perspectiveId:o,entity:g,historyButtonId:Io.History}),{historyFilter:C,onApplyFilter:O,isLoading:P,historicUris:k,historyWithTotal:N,canLoadMore:Z,onLoadMore:T}=(0,Mo.k6)({entity:g,enabled:E}),j=l&&i&&!(0,h.ZiX)(null==g?void 0:g.uri),I=s&&u,D=(0,h.mdt)(null==b?void 0:b.commentsMap);return{tabs:(0,r.useMemo)((()=>[{buttonProps:{id:Io.Workflow,icon:qo,tooltipTitle:y().text("Workflow")},content:null!=f&&f.total?a().createElement(Jo,null):a().createElement(tl,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:sl(null==f?void 0:f.total),rightContent:a().createElement(Ao.G,null)},hidden:!j},{buttonProps:{id:Io.Collaboration,icon:Yo,tooltipTitle:y().text("Collaboration")},content:D?a().createElement(ll,null):a().createElement(il,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:sl(D)},hidden:!I},{buttonProps:{id:Io.History,icon:Ho.Z,tooltipTitle:y().text("History")},content:w?a().createElement(zo.Z,{isLoading:P,historyWithTotal:N,contributorsUris:k,entityUri:null==g?void 0:g.uri,historyEvent:d,onLoadMore:T,canLoadMore:Z}):a().createElement(Vo.Z,null),headerProps:{content:a().createElement(Uo.Z,{total:w?((null==k?void 0:k.length)||0)+1:void 0,entityType:(0,h.nt9)(m,null==g?void 0:g.type),filter:C,onApplyFilter:O})},hidden:n},{buttonProps:{id:Io.DBConnector,icon:$o,tooltipTitle:y().text("D&B Connector")},content:a().createElement(Wo,null),headerProps:{mainTitle:y().text("D&B Connector")},hidden:!c}]),[null==f?void 0:f.total,j,D,I,w,P,N,k,null==g?void 0:g.uri,null==g?void 0:g.type,d,T,Z,m,C,O,c]),defaultTab:p}})({commentId:n,hideHistory:o,perspectiveId:t});return a().createElement("div",{className:s.profileContainer},a().createElement(No.n,{defaultTab:c,perspectiveId:t,buttonsProps:(0,l.pipe)((0,l.reject)((0,l.propEq)("hidden",!0)),(0,l.pluck)("buttonProps"))(u)},i,a().createElement(Do,{tabs:u})))}));ul.displayName="ProfilePerspectiveView";var pl=n(3096),dl=n.n(pl),ml=n(28220);function gl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fl={};var hl=n(27938),bl=n(54064);function yl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vl=n(43589),xl=n(944);const El=(0,le.makeStyles)((e=>({wrapper:{alignItems:"center",display:"flex",padding:"12px 16px",fontSize:"13px",lineHeight:"15px",fontWeight:e.typography.fontWeightRegular,color:e.palette.text.secondary},loadingWrapper:{display:"flex",backgroundColor:"rgba(238, 238, 238, 1)",color:e.palette.text.secondary,boxShadow:"inset 0px -1px 0px rgba(0, 0, 0, 0.12)"},errorWrapper:{display:"flex",backgroundColor:"rgba(255, 235, 238, 1)",color:e.palette.error.main},successWrapper:{display:"flex",backgroundColor:"rgba(239, 253, 227, 1)",color:e.palette.success.main,"& span, & b":{paddingRight:"4px"}},closeIcon:{color:e.palette.text.secondary,cursor:"pointer","&:hover":{background:"none"}},indicatorIcon:{padding:"0 14px"},link:{color:e.palette.primary.main,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular,cursor:"pointer"}}))),wl=El;let Sl;!function(e){e.loading="loading",e.success="success",e.error="error"}(Sl||(Sl={}));const Cl=e=>{let{onClose:t}=e;const n=wl();return a().createElement(We.k,{tooltipTitle:y().text("Close"),onClick:t,size:"S",className:n.closeIcon,icon:ro.default})},Ol=e=>{let{onClose:t}=e;const n=wl();return a().createElement("div",{className:V()(n.wrapper,n.loadingWrapper)},a().createElement(Cl,{onClose:t}),a().createElement(qt.Z,{className:V()(n.indicatorIcon)}),a().createElement(G.Z,null,y().text("Loading background process...")))},Pl=e=>{let{label:t,onClose:n,onRefresh:r}=e;const o=wl();return a().createElement("div",{className:V()(o.wrapper,o.successWrapper)},a().createElement(Cl,{onClose:n}),a().createElement(vl.Z,{className:V()(o.indicatorIcon)}),a().createElement("div",{"data-reltio-id":"background-update-success"},a().createElement("span",null,y().text("This Profile")),a().createElement("b",null,(0,h.idV)(t)),a().createElement("span",null,y().text("has been updated.")),a().createElement("span",{onClick:r,className:o.link},y().text("Click Here to Refresh the page")),a().createElement("span",null,y().text(" to retrieve the latest profile data."))))},kl=e=>{let{onClose:t}=e;const n=wl();return a().createElement("div",{className:V()(n.wrapper,n.errorWrapper)},a().createElement(Cl,{onClose:t}),a().createElement(xl.Z,{className:V()(n.indicatorIcon)}),a().createElement(G.Z,null,y().text("UI attempted to check for updates but no update received in the last 30 seconds. Try refreshing the page manually.")))},Nl=e=>{let{label:t,onClose:n,onRefresh:r,status:o}=e;switch(o){case Sl.loading:return a().createElement(Ol,{onClose:n});case Sl.success:return a().createElement(Pl,{label:t,onClose:n,onRefresh:r});case Sl.error:return a().createElement(kl,{onClose:n});default:return null}},Zl=(e,t)=>((e,t)=>"*"===(null==e?void 0:e[0])||!(0,l.isNil)(e)&&e.includes(t))(e,t),Rl=(0,le.makeStyles)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflowX:"hidden",overflowY:"auto",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},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%"}},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"}})));function Tl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jl=(0,r.memo)((e=>{var t;let{config:n,saveState:o,getSavedState:l,commentId:i}=e;const{maxWidth:s,profileBand:c,workflow:u,frozen:p}=n||{},m=Rl({maxWidth:s}),g=(0,x.useSelector)(v.ZP.selectors.getEntity),f=(0,x.useSelector)(v.ZP.selectors.getHistoryEvent),b=(0,x.useSelector)(v.ZP.selectors.getIsHistoryModeEnabled),M=(null===(t=(0,x.useSelector)(v.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"",A=(0,x.useSelector)(v.ZP.selectors.getMode),z=(0,x.useSelector)(v.ZP.selectors.getProfileErrors),V=(0,x.useDispatch)(),U=(0,E.u)(),H=(e=>{const t=(0,hl.v)(e),n=(0,bl.b)();return(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){yl(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(u),{isLoading:F}=(0,w.M)(),{type:W,uri:B,updatedTime:q}=g||{},{onRefreshProfile:_,onCloseBackgroundProcessIndicator:G,cancelUpdateProcess:Y,isOpenBackgroundProcessIndicator:Q,backgroundUpdateStatus:$}=(e=>{let{entityUri:t,entityTypeUri:n,entityUpdatedTime:a}=e;const o=(0,x.useDispatch)(),{autoUpdateInReadMode:l,entityTypes:i}=(0,x.useSelector)(v.ZP.selectors.getProfileCheckUpdate)||{},s=Zl(i,n),c=Zl(l,n),u=(0,r.useRef)(null),p=(0,Ie._)(),m=(0,gr.u)(),g=(0,r.useContext)(d.m),[f,b]=(0,r.useState)(!1),[y,E]=(0,r.useState)(Sl.loading),w=6e3;const S=(0,r.useCallback)((()=>{o(v.N5.entity.actions.loadEntity({viewId:g,uri:t})),b(!1)}),[o,t,g]),C=(0,r.useCallback)((()=>{b(!1)}),[]),O=(0,r.useCallback)((()=>{clearTimeout(u.current),b(!1),p(Promise.resolve())}),[p]),P=(0,r.useCallback)((e=>{p((0,h.GBJ)(t)).then((t=>{t.updatedTime>a&&(E(Sl.success),c?S():b(!0),e=-1)})).catch((()=>{})).finally((()=>{e<0||(e?(e-=1,u.current=setTimeout(P,w,e)):(E(Sl.error),b(!0)))}))}),[a,t,c,S,p,w]),k=(0,r.useCallback)((()=>{s&&(E(Sl.loading),b(!0),u.current=setTimeout(P,w,4))}),[P,s]);return(0,r.useEffect)((()=>{const e=m((e=>{e.type===v.N5.constants.ProfileActions.PROFILE_SAVED&&k()}));return()=>{e()}}),[m,p,k]),{onRefreshProfile:S,onCloseBackgroundProcessIndicator:C,cancelUpdateProcess:O,isOpenBackgroundProcessIndicator:f,backgroundUpdateStatus:y}})({entityUri:B,entityTypeUri:W,entityUpdatedTime:q}),X=(0,r.useMemo)((()=>(0,h.dvH)(g)),[g]),K=(0,r.useContext)(S.h),J=(0,C.C)({objectIds:X}),ee=(0,r.useContext)(O.Y),te=(0,x.useSelector)(v.ZP.selectors.getShowAttributeDescription),ne=(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Tl(e,t,n[t])}))}return e}({},ee,{showDescription:te})),[ee,te]),{views:re,layout:ae,isLoaded:oe,onLayoutReset:le,onResetUndo:ie,handleLayoutChange:se}=(e=>{let{config:t,entityTypeUri:n,saveState:a,getSavedState:o}=e;const[l,i]=(0,r.useState)([]),[s,c]=(0,r.useState)([]),{canRead:u}=(0,nr.l)(),p=(0,r.useMemo)((()=>{const e=t.views.filter(u),n=(0,h.sFD)(t.layout,e);return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){gl(e,t,n[t])}))}return e}({},t,{views:e,layout:n})}),[t,u]),d=(0,r.useMemo)((()=>dl()(p)),[p]),m=null!=p&&p.nestedRoute?`/${p.nestedRoute}`:"",g=n&&p?n+m:null,f=(0,r.useCallback)((()=>o().then((e=>e.layout?{}:e))),[o]),b=(0,r.useCallback)((0,h.DsO)(a,1e3),[a]),{isLoaded:y,savedState:v=fl,updateSavedState:x}=(0,ml.w)({getSavedState:f,saveState:b,entityTypeUri:g}),E=(0,r.useCallback)((e=>{x({layout:e,views:s,configHash:d}),i(e)}),[x,d,s]),w=(0,r.useRef)(),S=(0,r.useCallback)((()=>{c(w.current.views),E(w.current.layout)}),[E]),C=(0,r.useCallback)((()=>{w.current={views:s,layout:l};const{views:e,layout:t}=(0,h.Mfk)({views:p.views,layout:p.layout});c(e),E(t)}),[p,l,s,E]);return(0,r.useEffect)((()=>{if(y){const e=d!==v.configHash,{views:t,layout:n}=(0,h.Mfk)({views:e||!v.views?p.views:v.views,layout:e?p.layout:v.layout});c(t),i(n)}}),[y,v,g]),{views:s,layout:l,isLoaded:y,onLayoutReset:C,onResetUndo:S,handleLayoutChange:E}})({config:n,entityTypeUri:W,saveState:o,getSavedState:l});(0,P.a)({entity:g,historyEvent:f}),(()=>{const e=(0,x.useDispatch)(),t=(0,x.useSelector)(v.ZP.selectors.getValidateReadMode),n=(0,x.useSelector)(v.ZP.selectors.getEntity)||{},{uri:a,updatedTime:o}=n,l=(0,h.biM)(n),i=(0,x.useSelector)(v.ZP.selectors.getMode),s=(0,x.useSelector)(v.ZP.selectors.getProfileViews),c=s&&s.length>0,u=(0,r.useCallback)((0,h.DsO)((t=>{t&&e(v.N5.actions.validateProfile())}),500),[e]);(0,r.useEffect)((()=>{const e=t&&!l&&a&&!(0,h.ZiX)(a)&&i===h.ARY.Viewing&&c;u(e)}),[u,l,t,o,a,i,c])})(),(0,r.useEffect)((()=>{V(v.N5.views.actions.profileViewsSet(re))}),[V,re]),(0,r.useEffect)((()=>{n.sidePanelViews&&V(v.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>()=>Y()),[B,A]);const ce=A===h.ARY.Viewing&&(0,h.ZiX)(B),ue=e=>a().createElement("div",{className:m.emptyState},a().createElement(k.ZP,{LogoRenderer:k.B9.NO_DATA,text:e,variant:k.tC.embedded})),{SnackbarRenderer:pe,resetLayout:de}=(0,N.w)({onLayoutReset:le,onResetUndo:ie}),me=(0,r.useMemo)((()=>[{primary:y().text("Reset layout"),secondary:y().text("Restore the default layout without saving any changes"),onClick:de}]),[de]);return a().createElement(O.Y.Provider,{value:ne},a().createElement(Z.j.Provider,{value:!0},a().createElement(S.e,{collaboration:b?K:J},a().createElement(R.O.Provider,{value:H},a().createElement(T.m.Provider,{value:U},a().createElement(j.l.Provider,{value:M},a().createElement(I.fy,null,a().createElement("div",{className:m.perspectiveView},oe&&B?a().createElement(ul,{commentId:i,perspectiveId:"profile"},a().createElement("div",{className:m.profileWrapper},a().createElement(ko,{profileBandConfig:c,showMenu:!p,menuItems:me}),F?ue(y().text("Loading")):a().createElement(a().Fragment,null,Q&&a().createElement(Nl,{label:g.label,onClose:G,onRefresh:_,status:$}),!b&&a().createElement(D.J,{attributesWithErrors:z}),!ce&&a().createElement(eo,{maxWidth:s,views:re,layout:ae,frozen:p,entityUri:B,onLayoutChanged:se})))):a().createElement(a().Fragment,null,a().createElement(L.Z,null),ue(y().text("No data to display."))),a().createElement(lo,null),a().createElement(pe,null)))))))))}));jl.displayName="ProfilePerspectiveView";const Il=(0,i.Z)({productionPrefix:"profilePerspective",disableGlobal:!0,seed:"prfl"});h.oss.register("profile",((e,t)=>{const n=e=>(0,l.sort)(((e,t)=>e.x>t.x||e.x===t.x&&e.y>t.y?1:-1),e),r=(0,l.map)((e=>(0,l.evolve)({layout:(0,l.pipe)(n,(0,l.map)((0,l.ifElse)((0,l.propEq)("autosizing",!0),(0,l.omit)(["y","height","minHeight","maxHeight"]),(0,l.omit)(["y","minHeight","maxHeight"]))))},e)));return(0,h.l22)(r(e),r(t))}));const Dl=e=>{let{config:t,onResize:n=l.identity,saveState:i,getSavedState:b,qxSandboxApi:y,commentId:v}=e;const x=(0,r.useCallback)((0,h.aYu)(b),[b]),{SnackbarRenderer:E,showSnackbarMessage:w}=(0,p.D)(),S=(0,r.useMemo)((()=>t&&(0,h.Vr9)(t)),[t]);return a().createElement(d.m.Provider,{value:null==S?void 0:S.id},a().createElement(m.S.Provider,{value:w},a().createElement(g.Y.Provider,{value:y},a().createElement(s.ZP,{generateClassName:Il},a().createElement(u._,{dateAdapter:o.Q},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>n(Math.floor(e),Math.floor(t))}),S&&a().createElement(jl,{config:S,saveState:i,getSavedState:x,commentId:v}),a().createElement(f.Z,{showErrorFromStore:!0}),a().createElement(E,null))))))};var Ll=n(5050),Ml=n(79935),Al=n(16e3);const zl=(0,le.makeStyles)((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}}))),Vl=e=>{let{total:t=0}=e;const n=zl(),o=(0,x.useDispatch)(),l=(0,r.useContext)(d.m),i=(0,r.useCallback)((()=>{o(v.ui.actions.openPerspective({perspectiveId:"profile",viewId:l}))}),[o,l]);return a().createElement(Y.Z,{title:""},a().createElement("div",{className:n.titleContainer},a().createElement(ya.Z,{component:"button",variant:"caption",className:n.link,onClick:i,underline:"none"},y().text("Profile")),a().createElement(Al.Z,{className:n.icon}),y().text("Tags")),a().createElement(Ml.Z,null),a().createElement(G.Z,{className:n.totalCaption,variant:"caption"},a().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var Ul=n(59916),Hl=n(26482);const Fl=(0,le.makeStyles)((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"}}))),Wl=e=>{let{label:t}=e;const n=Fl();return a().createElement(Hl.Z,{className:n.toolbar},a().createElement(Ul.Z,{className:n.avatar}),a().createElement(G.Z,{variant:"h6",className:n.label},t))};function Bl(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){ql(e,t,n[t])}))}return e}function ql(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _l=(0,le.makeStyles)((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}}))),Gl=[25,50,100],Yl=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const o=_l(),[i,s]=(0,r.useState)(Gl[0]),[c,u]=(0,r.useState)(0),p=(0,x.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions);(0,r.useEffect)((()=>{u(0)}),[t,n,p]);const{isLoading:d,total:m,entities:g}=(e=>{let{tag:t,entityUri:n,page:a=0,rowsPerPage:o=50}=e;const i=(0,x.useDispatch)(),s=(0,Ie._)(),c=(0,Ie._)(),[u,p]=(0,r.useState)(!1),[d,m]=(0,r.useState)(0),[g,f]=(0,r.useState)([]),{requestEntities:b,requestTotal:E}=(e=>{let{entityUri:t,tag:n}=e;const a=(0,x.useSelector)(v.ZP.selectors.getGlobalSearchRequestOptions),o=(0,x.useSelector)(v.ZP.selectors.getTenant),i=(0,x.useSelector)(v.ZP.selectors.getDtssPath),s=(0,r.useMemo)((()=>(0,h.Do$)(t)),[t]),c=(0,r.useMemo)((()=>[{filter:"equals",fieldName:"tags",values:[n]}]),[n]),u=!!s,p=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=Bl({select:"uri,label,type,secondaryLabel,defaultProfilePicValue,startDate,endDate"},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});return u?(0,h.uqV)({filters:e,options:t,customerTenant:o,dataTenant:s,dtssPath:i}).then((0,l.map)((0,h.E7G)(s))):(0,h.ZOr)(e,t)}),[u,s,o,i]);return{requestEntities:(0,r.useCallback)(((e,t)=>p(c,Bl({offset:t,max:e},a))),[c,a,p]),requestTotal:(0,r.useCallback)((()=>{const e=a;return(u?(0,h.J$m)({filters:c,options:e,customerTenant:o,dataTenant:s,dtssPath:i}):(0,h.j_Q)(c,e)).then((e=>e.total))}),[c,a,u,s,o,i])}})({entityUri:n,tag:t}),w=(0,r.useCallback)((e=>{i(v.ui.actions.errorSet((0,h.xU7)(e,y().text("Something went wrong")))),m(0)}),[i]);return(0,r.useEffect)((()=>{s(E()).then(m).catch(w)}),[E,s,w]),(0,r.useEffect)((()=>{p(!0),c(b(o,a*o)).then(f).catch(w).finally((()=>p(!1)))}),[a,o,b,c,w]),{isLoading:u,total:d,entities:g}})({tag:t,entityUri:n,page:c,rowsPerPage:i}),f=(0,r.useRef)(null);(0,r.useEffect)((()=>{f.current&&(f.current.scrollTop=0)}),[g]);const b=m>Gl[0];return a().createElement("div",{className:o.perspectiveView},a().createElement(Wl,{label:t}),a().createElement("div",{className:V()(o.tagsContainer,{[o.fullHeight]:b})},a().createElement(B.Z,{className:o.tagsView},a().createElement(Vl,{total:m}),a().createElement("div",{className:o.listContainer},d&&a().createElement(L.Z,null),m>0&&a().createElement("div",{className:o.entitiesList,ref:f},a().createElement(Ll.Z,{entities:g})),b&&a().createElement("div",{className:o.pagination},a().createElement(q.Z,{count:m,rowsPerPageOptions:Gl,rowsPerPage:i,page:c,onChangePage:u,onChangeRowsPerPage:s}))))))}));Yl.displayName="TagPerspectiveView";const Ql=(0,i.Z)({productionPrefix:"tagPerspective",disableGlobal:!0}),$l=e=>{let{config:t,tag:n,entityUri:r,onResize:o=l.identity}=e;return a().createElement(d.m.Provider,{value:t.id},a().createElement(s.ZP,{generateClassName:Ql},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(Yl,{tag:n,entityUri:r}),a().createElement(f.Z,{showErrorFromStore:!0})))};var Xl=n(39636);const Kl=(0,le.makeStyles)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),Jl=()=>{const e=Kl(),t=(0,x.useSelector)(v.ZP.selectors.getEntity),{tasks:n}=(0,r.useContext)(R.O),o=(0,r.useMemo)((()=>null==n?void 0:n.find((e=>e.objectURIs.includes((0,h.$Rg)(t.uri))))),[t.uri,n]);return a().createElement(po.Z,{entity:t},a().createElement("div",{className:e.actionsWrapper},o&&a().createElement(Xl.o,{task:o})))};function ei(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ti=(0,le.makeStyles)((e=>({perspectiveView:{position:"absolute",top:0,left:0,right:0,bottom:0,fontFamily:"Roboto, Helvetica, Arial, sans-serif",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:e.palette.background.default},perspectiveContainer:{display:"flex",flexGrow:1,overflow:"hidden"},attributesWrapper:{margin:"15px",flexGrow:1,overflowY:"auto",backgroundColor:"#FAFAFA"},contentWrapper:{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1}})));function ni(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ri={processTypes:["dataChangeRequestReview"]},ai=(0,r.memo)((()=>{const e=ti(),t=(0,x.useDispatch)(),n=(e=>{const t=(0,x.useDispatch)(),n=(0,x.useSelector)(v.ZP.selectors.getEntityUri),a=(0,hl.v)(e),o=(0,r.useCallback)((e=>{"Reject"===e&&t(v.ui.actions.openPerspective({perspectiveId:null,viewId:null})),"Approve"===e&&t(v.ui.actions.openEntity({uri:(0,h.$Rg)(n),viewId:null}))}),[t,n]);return(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ei(e,t,n[t])}))}return e}({},a,{onActionSuccess:o})),[a,o])})(ri),o=(0,x.useSelector)(v.ZP.selectors.getEntity),l=(0,r.useContext)(O.Y),i=(0,x.useSelector)(v.ZP.selectors.getShowAttributeDescription),s=(0,r.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ni(e,t,n[t])}))}return e}({},l,{showDescription:i})),[l,i]);(0,r.useEffect)((()=>{t(v.N5.sidePanelViews.actions.sidePanelViewsLoaded([{id:"common",views:[{point:"com.reltio.plugins.ui.view",id:"com.reltio.plugins.entity.side.WorkflowsView",class:"com.reltio.plugins.entity.side.WorkflowsView"}]}]))}),[t]);const c=!n.loading&&!!o.uri;return a().createElement(O.Y.Provider,{value:s},a().createElement(R.O.Provider,{value:n},a().createElement("div",{className:e.perspectiveView},!c&&a().createElement(L.Z,null),a().createElement("div",{className:e.perspectiveContainer},c?a().createElement(ul,{hideHistory:!0,perspectiveId:"dcrCard"},a().createElement("div",{className:e.contentWrapper},a().createElement(Jl,null),a().createElement("div",{className:e.attributesWrapper},a().createElement(H.Z,null)))):a().createElement(k.ZP,{LogoRenderer:k.B9.NO_DATA,text:y().text("No data to display."),variant:k.tC.embedded})))))}));ai.displayName="DCRReviewPerspectiveView";const oi=(0,i.Z)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0,seed:"dcr"}),li=e=>{let{config:t,onResize:n=l.identity}=e;return a().createElement(d.m.Provider,{value:t.id},a().createElement(s.ZP,{generateClassName:oi},a().createElement(u._,{dateAdapter:o.Q},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>n(Math.floor(e),Math.floor(t))}),a().createElement(ai,null),a().createElement(f.Z,{showErrorFromStore:!0}))))}},51317:(e,t,n)=>{n.r(t),n.d(t,{RelationshipsTableView:()=>Je});var r=n(9366),a=n(24328),o=n.n(a),l=n(44443),i=n(50914),s=n(52730),c=n(45738),u=n(31421),p=n(93553),d=n(38677),m=n(13980),g=n.n(m),f=n(2507),h=n.n(f),b=n(72342);const y=(0,b.makeStyles)({addButton:{marginLeft:"12px",padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},label:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),v=e=>{let{onClick:t}=e;const n=y();return o().createElement(d.Z,{color:"primary",className:n.addButton,onClick:t},o().createElement(p.Z,{classes:{root:n.icon}}),o().createElement("div",{className:n.label},h().text("Add")))};v.propTypes={onClick:g().func};const x=v;var E=n(71153),w=n.n(E);const S={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},C={color:"rgba(0,0,0,.54)"},O=(0,b.makeStyles)((e=>({headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"12px"},entityCell:{display:"flex",alignItems:"center",height:"100%"},entityLabel:{fontSize:"15px",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap","$row-cell--removed &":S,"$row-cell--inactive &":C},entityAvatar:{transform:"scale(0.7)",margin:"0 10px"},rowCell:{fontSize:"13px",overflow:"hidden"},description:{marginLeft:"-22px"},"row-cell--sorted":{color:"rgba(0,0,0,0.87)"},"row-cell--removed":{pointerEvents:"none","& > :not($entityCell)":S},"row-cell--inactive":C})));function P(){return P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P.apply(this,arguments)}const k=e=>{let{cell:t,CellValueRenderer:n,rowValue:{connection:r},isSorted:a}=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","rowValue","isSorted"]);const i=O(),s=(0,u.$qe)(r),c=(0,u.Fn9)(r.relation)&&(0,u.Fn9)(r.entity);return o().createElement("div",{className:w()({[i["row-cell--sorted"]]:a,[i["row-cell--removed"]]:s,[i["row-cell--inactive"]]:!c},i.rowCell)},t.values.map(((e,t)=>o().createElement(n,P({key:t,value:e},l)))))};k.propTypes={rowValue:g().object,cell:g().object,CellValueRenderer:g().elementType,isSorted:g().bool};const N=k;var Z=n(45108),R=n(53862),T=n(63532),j=n(96379),I=n(40007);const D=e=>{let{value:{entityType:t,entity:n}}=e;const r=(0,s.useDispatch)(),l=(0,a.useContext)(T.m),p=O(),d=(0,u.idV)(n.entityLabel),m=(0,u.wwR)({uri:n.entityUri,dataTenant:n.dataTenant});return o().createElement("div",{className:p.entityCell},o().createElement(j.Z,{className:p.entityAvatar,entityType:t}),o().createElement(I.Z,{value:d},o().createElement("span",{className:p.entityLabel,onClick:(0,i.pipe)((0,i.always)({uri:m,viewId:l}),c.ui.actions.openEntity,r)},d)))};D.propTypes={value:g().shape({entity:g().shape({entityUri:g().string,entityLabel:g().string}),entityType:u.p8l})};const L=D;var M=n(92332),A=n(12364);const z=(0,n(25843).Z)((e=>{const t=O(),{description:n}=(null==e?void 0:e.headCellData)||{};return o().createElement("div",{className:t.headCell},o().createElement(M.default,e),o().createElement(A.Z,{description:n,className:t.description}))}));var V=n(46728);const U=(0,i.pipe)((0,i.map)((e=>e.uri||e)),i.uniq);function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const F=(0,i.pipe)((0,i.split)("."),(0,i.slice)(2,1/0)),W=e=>{if(e.startsWith("relation.attributes")){const t=F(e);return t.length>1?t.slice(0,-1):null}return null},B=(0,i.map)((e=>{return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){H(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:W(e.id),headCellRenderer:z,rowCellValueRenderer:(t=e.id,"entity.label"===t?L:V.Z)});var t})),q=(0,b.makeStyles)({tableContainer:{display:"flex",fontFamily:"Roboto",color:"rgba(0,0,0,0.54)"},emptyData:{marginBottom:"30px"},"@global div[role=tooltip]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"@global div[role=presentation]":{fontFamily:"Roboto, Helvetica, Arial, sans-serif"},"row-cell__buttons-container":{position:"absolute"},"row-cell__buttons-wrapper":{display:"flex",paddingLeft:"10px","& > button":{marginLeft:"-10px",transform:"scale(0.9)"}}});var _=n(23883),G=n(87037),Y=n(29754),Q=n(6163);const $=e=>{let{canUpdate:t,canRemove:n,handleEditRelation:r,handleRemoveRelation:a}=e;return o().createElement(o().Fragment,null,t&&o().createElement(_.Z,{title:h().text("Edit")},o().createElement(G.Z,{onClick:r,size:"large"},o().createElement(Y.Z,null))),n&&o().createElement(_.Z,{title:h().text("Remove")},o().createElement(G.Z,{onClick:a,size:"large"},o().createElement(Q.Z,null))))};$.propTypes={canUpdate:g().bool,canRemove:g().bool,handleEditRelation:g().func,handleRemoveRelation:g().func};const X=$;function K(){return K=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K.apply(this,arguments)}const J=e=>{let{mode:t,columnsData:n,connections:r,metadata:l,sorting:s,onSort:p,filters:d,onFilter:m,onEditRelation:g,onRemoveRelation:f,basicTableRef:h,allowOnlyCreateNew:b}=e;const y=(0,a.useMemo)((()=>((e,t,n)=>e.map((e=>(0,i.pipe)((0,i.reduce)(((t,r)=>{let{id:a}=r;return(0,i.assoc)(a,((e,t,n)=>{let{entity:r,relation:a}=t;switch(e){case"entity.label":return{entity:r,entityType:(0,u.nt9)(n,r.entityType)};case"relation.label":return a.relationLabel||(0,u.Lmx)(n,a.relationType);case"relation.activeness.startDate":return a.startDate;case"relation.activeness.endDate":return a.endDate;default:return((e,t)=>(0,i.pipe)((0,i.path)(["object","attributes"]),(0,u.tT_)(e))(t))(F(e),a)}})(a,e,n),t)}),{}),(0,i.assoc)("connection",e))(t))))(r,n,l)),[r,n,l]),v=(0,a.useMemo)((()=>B(n)),[n]),x=q(),E=(0,a.useCallback)((e=>o().createElement(N,K({},e,{isSorted:!!s&&s.field===e.columnData.id}))),[s]),[w,S]=(0,a.useState)(null),{canRemove:C,canUpdate:O}=(e=>{let{metadata:t,mode:n,connection:r,onRemoveRelation:a,onEditRelation:o,allowOnlyCreateNew:l}=e;const i=(0,u.xvW)(r);if(c.N5.mode.selectors.getIsEditableMode(n)&&r&&(!l||i)){const{relation:{relationType:e}}=r,l=(0,u.$qe)(r),i=(0,u.V3K)(t,e);return{canRemove:a&&!l&&(0,u.Edd)(n,i),canUpdate:o&&!l&&(0,u.Z5t)(n,i)}}return{canRemove:!1,canUpdate:!1}})({mode:t,onRemoveRelation:f,onEditRelation:g,metadata:l,allowOnlyCreateNew:b,connection:(0,i.path)([w,"connection"],y)}),P=(0,a.useCallback)((e=>S(e)),[]),k=(0,a.useCallback)((()=>g((0,i.path)([w,"connection"],y))),[w,g,y]),R=(0,a.useCallback)((()=>f((0,i.path)([w,"connection","relation","relationUri"],y))),[w,f,y]),T=C||O?o().createElement(X,{handleEditRelation:k,handleRemoveRelation:R,canRemove:C,canUpdate:O}):void 0;return o().createElement("div",{className:x.tableContainer},o().createElement(Z.Z,{autosizing:!0,maxHeight:477,columnsData:v,rowsData:y,sorting:s,onSort:p,filters:d,onFilter:m,hoverStateEnabled:!0,defaultColumnWidth:250,defaultColumnMinWidth:200,headRowHeight:56,renderRowCell:E,onRowHover:P,hoverRowIndex:w,hoveredRowRightContent:T,classes:{hoveredRowRightContentWrapper:x["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:x["row-cell__buttons-container"]},ref:h,resizeDebounceDelay:150}))};J.propTypes={mode:g().string,columnsData:R.uz,connections:g().arrayOf(u.Rjq),metadata:u.pGS,filters:g().objectOf(R.Dq),onFilter:g().func,sorting:R.nI,onSort:g().func,onEditRelation:g().func,onRemoveRelation:g().func,basicTableRef:g().shape({current:g().object}),allowOnlyCreateNew:g().bool};const ee=J;var te=n(79312),ne=n(52194),re=n(58003),ae=n(55310),oe=n(46804),le=n(33903),ie=n(87825),se=n(47019),ce=n(30721),ue=n(80852),pe=n(50985),de=n(39475);const me=(0,b.makeStyles)((()=>({popupContent:{padding:"19px 23px"},checkboxControlLabel:{fontSize:"0.85rem"},checkboxControlCheckbox:{marginRight:"5px"}}))),ge=e=>{let{className:t,showInactive:n,onShowInactiveChange:r}=e;const l=me(),i=(0,a.useRef)(),[s,c]=(0,a.useState)(!1),u=()=>c((e=>!e));return o().createElement(o().Fragment,null,o().createElement(de.k,{className:t,ref:i,tooltipTitle:h().text("More"),icon:pe.Z,onClick:u,size:"L"}),o().createElement(se.ZP,{open:s,classes:{paper:l.popupContent},anchorEl:i.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},o().createElement(ce.Z,{classes:{label:l.checkboxControlLabel},control:o().createElement(ue.Z,{className:l.checkboxControlCheckbox,checked:n||!1,onChange:e=>r(e.target.checked)}),label:h().text("Show inactive Relationships")})))},fe=(0,b.makeStyles)({header:{padding:"0 4px 0 16px"},totalCaption:{lineHeight:"19px",fontSize:"14px",letterSpacing:"0.24px",color:"rgba(0,0,0,0.6)",flexShrink:0,marginRight:"5px",justifyContent:"flex-start",paddingTop:"16px",paddingBottom:"13px"},moreButton:{marginLeft:"-6px"},rightMenuItems:{display:"flex",flex:"1 0 auto",justifyContent:"flex-end",alignItems:"center"}}),he=e=>{let{title:t,total:n,searchQuery:r,onChangeSearchQuery:a,filtersEnabled:l,onToggleFilters:i,columnsData:s,selectedColumns:c,onChangeColumns:u,showInactive:p,onChangeShowInactive:d}=e;const m=fe();return o().createElement(ne.Z,{title:t,className:m.header},o().createElement(re.Z,{widthToHide:500},o().createElement(ae.Z,{height:24,margin:16}),o().createElement(te.Z,{className:m.totalCaption,variant:"caption"},n>1?h().text("${count} entities",{count:n}):h().text("${count} entity",{count:n}))),o().createElement("div",{className:m.rightMenuItems},o().createElement(oe.i,{query:r,onChange:a}),o().createElement(le.Z,{enabled:l,onClick:i}),o().createElement(ae.Z,{height:24,margin:4}),o().createElement(ie.Z,{columnsData:s,selectedColumns:c,onChangeColumns:u}),o().createElement(ge,{className:m.moreButton,showInactive:p,onShowInactiveChange:d})))};he.propTypes={title:g().string,total:g().number,columnsData:R.uz,selectedColumns:g().arrayOf(g().string),onChangeColumns:g().func,searchQuery:g().string,onChangeSearchQuery:g().func,filtersEnabled:g().bool,onToggleFilters:g().func,showInactive:g().bool,onChangeShowInactive:g().func};const be=he;var ye=n(75975),ve=n(79573);function xe(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){Ee(e,t,n[t])}))}return e}function Ee(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="CHANGE_SEARCH_QUERY",Se="CHANGE_SHOW_INACTIVE",Ce=xe({},ye.ZP.actions,{changeSearchQuery:(0,ve.zD)(we),changeShowInactive:(0,ve.zD)(Se)}),Oe=(e,t)=>{switch(t.type){case we:return xe({},e,{searchQuery:t.payload,page:0});case Se:return xe({},e,{showInactive:t.payload});default:return ye.ZP.reducer(e,t)}};var Pe=n(80231),ke=n(43407),Ne=n(80225),Ze=n(47081),Re=n(64047),Te=n(82565),je=n(79298),Ie=n(33945),De=n(87378);const Le=[10,25,50,100],Me=[{id:"entity.label",get label(){return h().text("Entity label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING},hideable:!1},{id:"relation.label",get label(){return h().text("Directional label")},dataTypeDefinition:{type:u.oS0.TYPE_STRING}},{id:"relation.activeness.startDate",get label(){return h().text("Start date")},dataTypeDefinition:u.PY2.startDate},{id:"relation.activeness.endDate",get label(){return h().text("End date")},dataTypeDefinition:u.PY2.endDate}],Ae=(0,i.pipe)(u.Tde,(0,i.concat)("relation.")),ze=(0,i.pipe)((0,i.map)((e=>({id:Ae(e.uri),label:e.label,description:e.description,dataTypeDefinition:(0,u.PFL)(e)}))),(0,i.uniqBy)((0,i.prop)("id"))),Ve=(0,i.pipe)(((e,t)=>{let{content:{inRelations:n=[],outRelations:r=[]}}=e,{relationTypes:a}=t;return(0,i.pipe)(U,(0,i.chain)((e=>(0,i.pipe)((0,i.find)((0,i.propEq)("uri",e)),u.DK$)(a))))([...n,...r])}),ze,(0,i.concat)(Me));var Ue=n(79575);const He=(0,b.makeStyles)({addArea:{display:"flex",alignItems:"center",height:"48px",borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},noData:{fontSize:"13px",paddingLeft:"20px",marginBottom:"20px",marginTop:"10px",color:"rgba(0,0,0,0.54)"}});function 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 We=(0,i.pluck)("id",Me),[Be]=We;function qe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _e=(0,i.memoizeWith)(((e,t)=>t.id),u.fS6),Ge=(0,s.connect)(((e,t)=>{const{config:n}=t;return{connections:c.ZP.selectors.getConnectionsWithDraftsByViewId(e,n.id),total:c.ZP.selectors.getTotalByViewId(e,n.id),entity:c.ZP.selectors.getEntity(e),metadata:c.ZP.selectors.getMetadata(e),mode:c.ZP.selectors.getMode(e),relationToAdd:c.ZP.selectors.getRelationToAddByViewId(e,n.id),relationsToEdit:c.ZP.selectors.getRelationsToEditByViewId(e,n.id),checkIfCanAddRelations:c.ZP.selectors.getCheckIfCanAddRelations(e,n.content)}}),void 0,((e,t,n)=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){qe(e,t,n[t])}))}return e}({},e,t,n,{config:_e(e.metadata,n.config)})))((e=>{let{className:t,config:n,entity:r,metadata:l,connections:p=[],total:d=0,mode:m,relationToAdd:g,relationsToEdit:f=[],checkIfCanAddRelations:b,dispatch:y,readOnlyMode:v}=e;const E={searchQuery:"",filters:null,visibleColumns:We,sorting:{order:n.sortOrder||"asc",field:n.sortColumn||Be},page:0,rowsPerPage:n.max||15,showInactive:!1},w=He(),S=(0,a.useContext)(Pe.j)?m:u.fO_.VIEWING,[C,O]=(0,a.useReducer)(Oe,E),P=(0,i.pipe)(Ce.changeSearchQuery,O),k=(0,i.pipe)(Ce.changeShowInactive,O),N=(0,a.useContext)(ke.Y),Z=(0,s.useSelector)(c.ZP.selectors.getShowAttributeDescription),R=(0,a.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Fe(e,t,n[t])}))}return e}({},N,{showDescription:Z})),[N,Z]);(0,a.useEffect)((()=>{P("")}),[null==r?void 0:r.uri]);const{visibleColumns:T,searchQuery:j,filters:I,sorting:D,page:L,rowsPerPage:M,showInactive:A}=C,z=(0,a.useMemo)((()=>Ve(n,l)),[n,l]),V=(0,a.useMemo)((()=>T.map((e=>z.find((0,i.propEq)("id",e))))),[T,z]),U=(0,a.useMemo)((()=>((e,t,n)=>{const r=u.wSh.fromFalsy(e).map(u.zHo).map((e=>`containsWordStartingWith(entity.label,${e}) or containsWordStartingWith(relation.label,${e})`)).orSome(""),a=(0,Ue.Tz)(n,t);return(new u.MEy).addClause(r).addClause(a).build()})(j,I,V)),[I,j]),{isLoading:H}=(0,Ne.a)({sorting:D,filter:U,page:L,rowsPerPage:M,config:n,entity:r,relationActivityFilter:A?u.Ng6.ALL:u.Ng6.ACTIVE_ONLY,mode:m}),F=(0,a.useMemo)((()=>{return e=E.rowsPerPage,Le.filter((t=>t!==e)).concat(e).sort(i.subtract);var e}),[]),{handleRowsPerPageChange:W,handlePageChange:B}=(0,a.useMemo)((()=>({handleRowsPerPageChange:(0,i.pipe)(Ce.changeRowsPerPage,O),handlePageChange:(0,i.pipe)(Ce.changePage,O)})),[]),q=(0,a.useCallback)((()=>{const e=(0,u.vlo)({config:n,mode:S,metadata:l,parentEntityUri:void 0});(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),y)(e)}),[n,S,l,y]),_=(0,a.useCallback)((e=>{y(c.N5.relations.actions.closeRelationEditor(n.id,e)),y(c.N5.relations.actions.removeRelation(n.id,e));const t=p.find((t=>(0,u.w1L)(t)===e)),r=(0,u.yV)(t);(0,u.ZiX)(r)&&y(c.N5.modifiedEntities.actions.entityDeleted(r))}),[n,p,y]),G=r&&b&&!v,Y=g?[g,...f]:f,{canUpdate:Q,canDelete:$}=(0,Ze.l)(),X=Q(n)&&!v,K=$(n)&&!v,J=(0,a.useRef)(null);return(0,Re.I)(n.id),o().createElement(ke.Y.Provider,{value:R},o().createElement(Te.Z,{className:t},o().createElement(be,{title:n.caption,total:d,columnsData:z,selectedColumns:T,onChangeColumns:(0,i.pipe)(Ce.changeColumns,O),searchQuery:j,onChangeSearchQuery:P,filtersEnabled:!!I,onToggleFilters:(0,i.pipe)(Ce.toggleFilters,O),showInactive:A,onChangeShowInactive:k}),G&&o().createElement("div",{className:w.addArea},o().createElement(x,{onClick:q})),Y.map((e=>o().createElement(je.Z,{key:(0,u.w1L)(e),connection:e,config:n,mode:S,metadata:l}))),o().createElement("div",{style:{position:"relative"}},o().createElement(ee,{mode:S,columnsData:V,connections:p,metadata:l,filters:I,onFilter:(0,i.pipe)(Ce.changeFilter,O),sorting:D,onSort:(0,i.pipe)(Ce.toggleSort,O),onEditRelation:X?(0,i.pipe)(c.N5.relations.actions.openRelationEditor(n.id),y):null,onRemoveRelation:K?_:null,basicTableRef:J,allowOnlyCreateNew:n.allowOnlyCreateNew}),p.length?o().createElement(Ie.Z,{count:d,rowsPerPageOptions:F,rowsPerPage:M,onChangeRowsPerPage:W,page:L,onChangePage:B,basicTableRef:J}):o().createElement(te.Z,{className:w.noData},h().text("No data found")),H&&o().createElement(De.Z,null))))}));var Ye=n(40855),Qe=n(54426),$e=n(41633),Xe=n(32479);const Ke=(0,Qe.Z)({productionPrefix:"relTable",disableGlobal:!0,seed:"relT"}),Je=e=>{let{config:t,onResize:n=i.identity,className:a,readOnlyMode:s}=e;return o().createElement(T.m.Provider,{value:t.id},o().createElement(Ye.ZP,{generateClassName:Ke},o().createElement($e._,{dateAdapter:r.Q},o().createElement(l.Z,{handleHeight:!0,onResize:(e,t)=>n(Math.floor(e),Math.floor(t))}),t&&o().createElement(Ge,{config:t,className:a,readOnlyMode:s}),o().createElement(Xe.Z,null))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
2
2
|
//# sourceMappingURL=2300.js.map
|