@reltio/remotes 1.4.1648 → 1.4.1649
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/1146.js +1 -1
- package/1148.js +1 -1
- package/1334.js +1 -1
- package/1425.js +1 -1
- package/1488.js +1 -1
- package/1488.js.map +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/1984.js +1 -1
- package/2066.js +1 -1
- package/2400.js +1 -1
- package/281.js +1 -1
- package/2966.js +1 -1
- package/3096.js +1 -1
- package/3348.js +1 -1
- package/3358.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/356.js +1 -1
- package/3854.js +1 -1
- package/3902.js +1 -1
- package/3902.js.map +1 -1
- package/3912.js +1 -1
- package/3926.js +1 -1
- package/415.js +1 -1
- package/4212.js +1 -1
- package/4390.js +1 -1
- package/4481.js +1 -1
- package/4609.js +1 -1
- package/4610.js +1 -1
- package/4703.js +1 -1
- package/4780.js +1 -1
- package/4780.js.map +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/5163.js +1 -1
- package/5292.js +1 -1
- package/5383.js +1 -1
- package/5617.js +1 -1
- package/6020.js +1 -1
- package/6287.js +1 -1
- package/636.js +1 -1
- package/6606.js +1 -1
- package/6799.js +1 -1
- package/6844.js +1 -1
- package/6860.js +1 -1
- package/6903.js +1 -1
- package/7128.js +1 -1
- package/7340.js +1 -1
- package/735.js +1 -1
- package/7422.js +1 -1
- package/7605.js +1 -1
- package/7626.js +1 -1
- package/764.js +1 -1
- package/7744.js +1 -1
- package/7896.js +1 -1
- package/820.js +1 -1
- package/8207.js +1 -1
- package/8565.js +1 -1
- package/870.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/9464.js +1 -1
- package/9719.js +1 -1
- package/9736.js +1 -1
- package/9861.js +1 -1
- package/987.js +1 -1
- package/99.js +1 -1
- package/9952.js +1 -1
- package/9960.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/remoteEntry.js +1 -1
package/5163.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]="2492e7e9-5579-4c81-a1b7-bff402e82411",e._sentryDebugIdIdentifier="sentry-dbid-2492e7e9-5579-4c81-a1b7-bff402e82411")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"1.4.1649"},(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[5163],{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},85321:(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 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error");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},35296:(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"}),"Warning");t.Z=l},5163:(e,t,n)=>{n.d(t,{vC:()=>Ei,Gv:()=>Ja,_n:()=>Yl,tM:()=>pi});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(59464),x=n(52730),E=n(589),w=n(96697),S=n(1824),C=n(36852),O=n(43407),P=n(35722),N=n(79002),k=n(61604),Z=n(80231),R=n(14834),T=n(62228),j=n(40006),I=n(43460),D=n(87378),L=n(8007),M=n(14593),A=n(71153),z=n.n(A),V=n(153),U=n(56346);const H=a().createContext(null);H.displayName="SingleAttributeContext";var F=n(80687),W=n(82565),B=n(33945),q=n(83422),_=n(79312),G=n(52194),$=n(32701),Y=n(12364),X=n(58003),Q=n(55310),K=n(33043),J=n(46804),ee=n(47019),te=n(38677),ne=n(80653),re=n(30721),ae=n(80852),oe=n(72342);const le=(0,oe.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"}}))),ie=e=>{let{className:t}=e;const n=le(),o=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(H),u=()=>i((e=>!e));return a().createElement(a().Fragment,null,a().createElement(te.Z,{ref:o,classes:{root:z()(n.triggerButton,t)},onClick:u},a().createElement(ne.Z,null)),a().createElement(ee.ZP,{open:l,classes:{paper:n.popupContent},anchorEl:o.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(re.Z,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:a().createElement(ae.Z,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:y().text("Show inactive values")})))},se=(0,oe.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"}}))),ce=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:o,isEditableMode:l}=e;const i=se(),{searchQuery:s,setSearchQuery:c,setPage:u,totalNonVisibleValues:p,nonVisibleValues:d,attributeType:m}=(0,r.useContext)(H),g=l&&(null==m?void 0:m.required);return a().createElement(G.Z,{title:t,className:i.root},g&&a().createElement($.Z,null),a().createElement(Y.Z,{description:null==m?void 0:m.description}),a().createElement(X.Z,{widthToHide:400},a().createElement(Q.Z,{height:24,margin:16}),a().createElement(_.Z,{className:i.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),a().createElement(K.Z,{nonOvTotal:p,className:i.ovIcon,nonOvValues:d,attributeType:m}),a().createElement("div",{className:i.rightMenuItems},a().createElement(J.i,{query:s,onChange:e=>{c(e),u(0)}}),o&&a().createElement(ie,null)))};var ue=n(93553),pe=n(56961),de=n(40941),me=n(63928),ge=n(55401),fe=n(11387),he=n(50548);const be=h.nIW,ye=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ye(n,t)})))):h.P6Y.strings.search(String(e),t),ve=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 ye(t,i)})))(t,n,r),c=(0,l.filter)(h.OXP,s);return{[(0,h.xy8)(r)]:{[be(r)]:c.slice(o,o+a),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}},xe=(0,oe.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 Ee(){return Ee=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},Ee.apply(this,arguments)}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Se(e,t,n[t])}))}return e}function Se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ce=[],Oe=(0,he.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=xe(),{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),N=(0,h.xy8)(n),k=(0,l.pipe)((0,l.pathOr)(Ce,[N,f]),(0,l.map)((0,l.prop)("uri")))(w),Z=(0,l.pathOr)(Ce,[N,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,de.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)),V=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.addAttributes,b)(e.map((e=>we({},e,{viewId:E}))))),[E,b]),U=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.modifyAttribute,b)(we({},e,{viewId:E}))),[E,b]),H=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.removeAttribute,b)(we({},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 V(t)}return V([e(n)])}),[V,o,n,M]),B=(0,h.Vg3)({attributeType:n,mode:P}),q={attributeType:n,errors:C,crosswalks:S.crosswalks,mode:P,onAddAttributes:V,onChangeAttribute:U,onDeactivateError:F,showNonOv:i},G=0===A.length&&0===t.length;return!(0,l.isEmpty)(S)&&a().createElement("div",{ref:I,className:D},a().createElement(me.Z,{cardinality:g}),a().createElement(ge.Z,{message:O}),B&&a().createElement(te.Z,{color:"primary",onClick:W,className:u.moreButton},a().createElement(ue.Z,{classes:{root:u.icon}}),a().createElement("div",{className:u.buttonLabel},y().text("Add"))),A.map(((e,t)=>a().createElement(fe.Z,Ee({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(pe.Z,{className:u.divider}),t.map((e=>{const t=Z.find((0,l.propEq)("uri",e.uri)),n=t||e,r=k.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:z()({[u.ovFalse]:!(0,h.OXP)(n)})},a().createElement(fe.Z,Ee({},q,{attributeValue:n,ownError:(0,h.ADq)(n,null,p,C),onDeleteAttribute:H,state:i})))})),G&&a().createElement(_.Z,{className:u.noData},s))}));var Pe=n(11013);const Ne=(0,oe.makeStyles)((()=>({simpleAttribute:{fontSize:"13px",lineHeight:"15px",marginBottom:"4px"}}))),ke=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(Pe.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r,className:z()({[o.simpleAttribute]:l})}))))},Ze=(0,oe.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}}))),Re=15,Te=e=>{let{config:t,className:n}=e;const{caption:o,max:l=Re,showInactiveValuesMenu:i}=t,s=Ze(),{values:c,totalVisibleValues:u,page:p,setPage:d,isLoading:m,hasPaging:g,attributeType:f,showInactive:h}=(0,r.useContext)(H),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(F.J.Provider,{value:S},a().createElement(W.Z,{className:z()(s.root,n)},a().createElement(ce,{totalVisibleValues:u,caption:o,showInactiveValuesMenu:i,isEditableMode:w}),a().createElement(q.Z,{className:s.content},(()=>{if(m)return a().createElement(D.Z,null);if(f){if(E&&C){const e={values:c,attributeType:f,showInactive:h};return a().createElement(ke,e)}if(w){const e={values:c,attributeType:f,parentUri:b,showInactive:h,noDataText:O};return a().createElement(Oe,e)}}return a().createElement(_.Z,{className:s.noData},O)})()),g&&a().createElement(B.Z,{count:u,page:p,rowsPerPage:l,rowsPerPageOptions:[],onChangePage:d,classes:{root:s.pagination}})))};var je=n(19701),Ie=n(55962);function De(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Le=(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,je._)(),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,N=be(n),k=(0,h.xy8)(n);g.current=(0,h.JQy)(w,P,N);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?ve: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){De(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)([k],e),r=(0,l.pathOr)([],[N],t);C||f(v.N5.actions.processNextPageOfAttributeValues({parentUri:P,attributeTypeUri:n,attributeTypeName:N,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,Ie.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 Me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ae=n(80225),ze=n(64047),Ve=n(10609),Ue=n(63929),He=n(1128),Fe=n(39475),We=n(74654),Be=n(812);const qe=a().createContext(null);qe.displayName="RelationsViewStateContext";const _e=(0,oe.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"}}))),Ge=e=>{let{className:t}=e;const n=_e(),o=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(qe),[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(te.Z,{ref:o,classes:{root:z()(n.button,t)},onClick:f},a().createElement(ne.Z,null)),a().createElement(ee.ZP,{open:m,classes:{paper:n.popupContent},anchorEl:o.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(re.Z,{classes:{label:n.checkboxControlLabel},control:a().createElement(ae.Z,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),b&&a().createElement(a().Fragment,null,a().createElement(pe.Z,{className:n.divider}),a().createElement(_.Z,{className:n.title,variant:"h6"},y().text("Sort by")),a().createElement("div",{className:n.sortControls},a().createElement(He.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(Fe.k,{tooltipTitle:v?y().text("Ascending"):y().text("Descending"),icon:v?We.Z:Be.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Ge.displayName="FilterButton";const $e=Ge,Ye=(0,oe.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),Qe=n(98538);const Ke=a().createContext(null);function Je(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){et(e,t,n[t])}))}return e}function et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tt=Math.pow(2,31)-1,nt=(0,oe.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 rt=n(22118),at=n(71001);const ot=e=>{let{label:t}=e;const n=nt();return a().createElement(at.Z,{classes:{anchorOriginTopRightRectangular:n.badgePosition,badge:n.badge},badgeContent:t},a().createElement(Xe.Z,null))},lt=()=>{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)(Ke),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=[Je({},a.content,{offset:0,max:null!==(e=a.maxDtssImport)&&void 0!==e?e:tt})],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 Je({},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=nt(),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(Fe.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:z()(i.tenant)},c)):a().createElement(Qe.Z,{menuId:"importDT-table-actions",buttonComponent:Fe.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>a().createElement(ot,{label:c})},menuItems:e.map((e=>({onClick:()=>{l(e)},text:e.label})))}),a().createElement(rt.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})))},it=e=>{let{title:t,total:n}=e;const o=Ye(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(qe);return a().createElement(G.Z,{title:t||"",className:o.header},n>0&&a().createElement(X.Z,{widthToHide:400},a().createElement(Q.Z,{height:24,margin:16}),a().createElement(_.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(J.i,{query:l,onChange:i}),a().createElement(lt,null),a().createElement($e,null)))};var st=n(79298),ct=n(29754),ut=n(6163),pt=n(96379),dt=n(18527),mt=n(90838),gt=n(23883);const ft=(0,oe.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 ht(){return ht=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},ht.apply(this,arguments)}const bt=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=ft(),c=(0,je._)(),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(mt.Z,{size:16,classes:{colorPrimary:s.progress}}),g&&a().createElement("div",{className:s.secondaryLabel},g));return a().createElement(gt.Z,ht({onOpen:b,title:y,disableFocusListener:!0,classes:{tooltip:s.tooltip}},i),o)},yt=(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)}},vt=(0,oe.makeStyles)((()=>({container:{display:"flex"}})));function xt(){return xt=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},xt.apply(this,arguments)}const Et=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=vt();return a().createElement("div",{className:o.container},a().createElement(te.Z,xt({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),a().createElement(te.Z,xt({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},wt=(0,oe.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"}}))),St=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:o,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=wt(),{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}=yt(t,n),O=(0,h.Fn9)(m)&&(0,h.Fn9)(d),P=(0,x.useSelector)(v.ZP.selectors.getMode),{canRemove:N,canUpdate:k}=(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=(N||k)&&o&&!t.suggested?a().createElement(a().Fragment,null,k&&a().createElement(Fe.k,{icon:ct.Z,size:"XS",onClick:R,tooltipTitle:y().text("Edit")}),N&&a().createElement(Fe.k,{icon:ut.Z,size:"XS",onClick:Z,tooltipTitle:y().text("Remove")})):void 0,D=t.suggested?a().createElement(Et,{acceptRelation:T,ignoreRelation:j,size:"small",disabled:b}):void 0,L=b?y().text("ignored"):y().text("edited");return a().createElement("div",{className:z()(p.container,{[p.rowInactive]:!O},{[p.removed]:g||b})},a().createElement("div",{className:p.row},u&&u(),a().createElement(pt.Z,{className:p.entityAvatar,entityType:E}),a().createElement(dt.Z,{value:S,className:p.entityLabelContainer},a().createElement(bt,{label:w,entity:d},a().createElement("span",{className:p.entityLabel},w)),(f||b)&&a().createElement(_.Z,{variant:"caption",className:p.editedLabel},"(",L,")"),C&&a().createElement("span",{className:p.relationLabel},`, ${C}`)),a().createElement("div",{className:p.editButtonsContent},I),D))}));St.displayName="EditableRelationItem";const Ct=St,Ot=(0,l.when)(h.Kn2,(0,l.prop)("uri")),Pt=(e,t)=>{const n=(e,t)=>(t?(0,h.VGB)(t):[]).map((t=>({type:Ot(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 kt=n(89507),Zt=n(65643);const Rt=(0,oe.makeStyles)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),Tt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:o}=e;const l=Rt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,h.xvW)(n)?null:o?a().createElement(Zt.Z,c):a().createElement(kt.Z,c)},jt=(0,oe.makeStyles)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),It=e=>{let{config:t,connection:n,children:o}=e;const l=jt(),{showInactive:i}=(0,r.useContext)(qe),{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(Tt,{onClick:u,connection:n,config:t,showSecondLevel:c}))),c&&a().createElement(Ue.X.Provider,{value:g},a().createElement("div",{className:l.secondLevelContent},a().createElement(vn,{isLoading:d,config:t,loadRelations:p,connections:s,total:m,parentEntityUri:n.entity.entityUri}))))},Dt=(0,oe.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"}}))),Lt=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=Dt(),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=Pt(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]),[N,k]=(0,l.partition)(h.xvW,n),Z=m&&g,R=0===N.length&&0===k.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(It,{config:o,connection:e,key:c},(t=>r?a().createElement(st.Z,{connection:r,config:o,mode:i,metadata:u}):a().createElement(Ct,{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(te.Z,{color:"primary",onClick:E,className:b.moreButton},a().createElement(ue.Z,{classes:{root:b.icon}}),a().createElement("div",{className:b.buttonLabel},y().text("Add"))),I&&a().createElement(st.Z,{connection:p,config:o,mode:i,metadata:u}),N.map(T),N.length>0&&k.length>0&&a().createElement(pe.Z,{className:b.divider}),k.map(T),R&&a().createElement(_.Z,{className:b.noData},s))};var Mt=n(62901),At=n(72316),zt=n(38309),Vt=n(89978);const Ut=(0,oe.makeStyles)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Ht(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){Ft(e,t,n[t])}))}return e}function Ft(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wt=e=>{let{connection:t,className:n}=e;const o=Ut(),{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)((()=>Ht({attributes:Ht({},(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(zt.A.Provider,{value:f},a().createElement(Vt.Z,{className:z()(o.attributesList,n),entity:p,attrTypes:u})):a().createElement("div",{className:z()(o.attributesList,n)},y().text("No attributes"))};var Bt=n(93400),qt=n(89025);const _t=e=>{let{show:t,onToggle:n,className:r}=e;return a().createElement(Fe.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?Bt.Z:qt.Z,onClick:n})},Gt=(0,oe.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"}}))),$t=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:o,ignoreRelation:i}=e;const s=Gt(),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}=yt(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:z()(s.container,{[s.rowInactive]:!w},{[s.suggestedWrapper]:c})},a().createElement("div",{className:z()(s.row,Mt.U)},n&&n(),a().createElement("div",{className:s.labelWrapper},a().createElement(pt.Z,{className:s.entityAvatar,entityType:f}),a().createElement(dt.Z,{value:y,className:s.entityLabelContainer},a().createElement(bt,{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(At.Z,{className:s.commentsContainer,uri:(0,h.gjS)(p),relatedObjectUris:C,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),c&&a().createElement(Et,{size:"small",acceptRelation:o(t),ignoreRelation:i(t)}),!c&&a().createElement(_t,{show:d,onToggle:()=>{m((e=>!e))},className:s.showDetails}))),d&&a().createElement(Wt,{connection:t}))}));$t.displayName="RelationItem";const Yt=$t;var Xt=n(18876),Qt=n(71976),Kt=n(30750),Jt=n(80233),en=n(60590),tn=n(11559),nn=n(65439);const rn=e=>(0,l.pipe)((0,l.pluck)("value"),l.mean,(0,l.defaultTo)(0))(e).toFixed(1),an=e=>e.filter((e=>5===e.value)).length,on=e=>e.filter((e=>1===e.value)).length,ln=e=>{if(0===e.length)return{percentOfLikes:0,percentOfDislikes:0};const t=an(e)/e.length*100,n=parseFloat(Number(t).toFixed(1));return{percentOfLikes:n,percentOfDislikes:parseFloat(Number(100-n).toFixed(1))}},sn=(0,oe.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}}))),cn=e=>{let{ratings:t,crosswalks:n,open:r,anchorEl:o,onClose:l}=e;const i=sn(),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}=ln(t),p=`${an(t)} (${c}%)`,d=`${on(t)} (${u}%)`;return a().createElement(Jt.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"},rn(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(Kt.Z,{variant:"determinate",value:c,classes:{bar:i.scaleBar},className:z()(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(Qt.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(nn.Z,{className:i.avatar},a().createElement(tn.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(Qt.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(en.Z,{key:t,crosswalk:e}))))))},un=(0,oe.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)"}}))),pn=e=>{let{ratings:t,crosswalks:n,className:o}=e;const l=un(),i=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{percentOfLikes:u}=ln(t);return a().createElement(a().Fragment,null,a().createElement("div",{"data-reltio-id":"reltio-ratings",className:z()(l.wrapper,o),ref:i,onClick:()=>c(!0)},a().createElement(_.Z,{className:l.averageRating},rn(t)),a().createElement(Kt.Z,{variant:"determinate",value:u,classes:{bar:l.scaleBar},className:z()(l.scale,{empty:!t.length})}),a().createElement("div",{className:l.counts},a().createElement("div",{className:l.count},a().createElement(Xt.Z,{className:l.icon}),an(t)),a().createElement("div",{className:l.count},a().createElement(Qt.Z,{className:l.icon}),on(t)))),a().createElement(cn,{ratings:t,open:s,crosswalks:n,anchorEl:i.current,onClose:()=>c(!1)}))},dn=(0,oe.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}}))),mn=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const o=dn(),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(te.Z,{onClick:n,variant:"text",size:"small",className:z()(o.button,{[o.isActive]:5===(null==i?void 0:i.value)})},"Agree"),a().createElement(Qe.Z,{buttonProps:{endIcon:a().createElement(Zt.Z,null),variant:"text",size:"small",className:z()(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"}))},gn=(0,oe.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"}}))),fn=e=>{var t;let{connection:n,loadRelations:o,renderRelationArrowButton:i,acceptRelation:s,ignoreRelation:c,showRating:u}=e;const p=gn(),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}=yt(n,y),O=(null==b?void 0:b.ratings)||[],P=(null==b||null===(t=b.object)||void 0===t?void 0:t.crosswalks)||[],N=(0,x.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),k=f&&b&&(0,h.wp9)(h.q7e.RELATION,{entityUri:N,connection:n})||[];return a().createElement("div",{className:z()(p.wrapper,{[p.suggestedWrapper]:d})},a().createElement(q.Z,{display:"flex",minHeight:"44px",className:Mt.U},a().createElement(q.Z,{display:"flex",alignItems:"center"},a().createElement(q.Z,{display:"flex",alignItems:"center"},i&&i(),a().createElement(pt.Z,{entityType:w,className:p.entityTypeIcon})),a().createElement(q.Z,{display:"flex",flexDirection:"column"},a().createElement(dt.Z,{value:S,className:p.entityLabelContainer},a().createElement(bt,{label:E,entity:f},a().createElement("span",{className:p.entityLabel},E))),C&&a().createElement("span",{className:p.relationLabel},C),!d&&u&&a().createElement(mn,{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)(k)&&a().createElement(At.Z,{className:p.commentsContainer,uri:(0,h.gjS)(b),relatedObjectUris:k,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),d&&a().createElement(Et,{acceptRelation:s(n),ignoreRelation:c(n)}),!d&&a().createElement(a().Fragment,null,u&&a().createElement(pn,{ratings:O,crosswalks:P,className:p.ratings}),a().createElement(_t,{show:m,onToggle:()=>{g((e=>!e))},className:p.showDetailsButton})))),m&&a().createElement(Wt,{connection:n,className:p.relationAttributes}))},hn=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=Pt(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(It,{config:l,connection:e,key:r},(t=>s?a().createElement(fn,{loadRelations:o,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t,showRating:"rating"===u}):a().createElement(Yt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};hn.displayName="RelationsList";const bn=hn,yn=(0,oe.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"}}))),vn=e=>{let{isLoading:t,config:n,loadRelations:r,connections:o,total:l,parentEntityUri:i}=e;const s=yn(),{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(D.Z,{className:s.linearIndicator}):n.content&&(0,h.KIu)(p)?a().createElement(Lt,{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(bn,{config:n,loadRelations:r,connections:o,className:s.list,key:null==u?void 0:u.uri,mainEnityUri:u.uri}):a().createElement(_.Z,{className:s.noData},d)},xn=(0,oe.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}}),En=e=>{let{config:t,className:n}=e;const o=xn(),{page:i,setPage:s,rowsPerPage:c,sortOrder:u,sortOption:p,showInactive:d,searchQuery:m,changeSearchQuery:g}=(0,r.useContext)(qe),{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,Ae.a)({sorting:S,filter:C,page:i,rowsPerPage:c,config:t,entity:y,relationActivityFilter:d?h.Ng6.ALL:h.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,h.Px$)(b)),[b]),k=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,l.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return(0,ze.I)(t.id),a().createElement(Ve.u.Provider,{value:y},a().createElement(Ue.X.Provider,{value:N},a().createElement(W.Z,{className:n},a().createElement("div",{className:o.container},a().createElement(Ke.Provider,{value:k},a().createElement(it,{title:t.caption,total:E})),a().createElement("div",{className:o.content},a().createElement(vn,{isLoading:O,config:t,loadRelations:P,connections:b,total:E}),E>c&&a().createElement(B.Z,{classes:{root:o.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:c,page:i,onChangePage:s}))))))};En.displayName="RelationsView";const wn=a().createContext(null);wn.displayName="TableAttributeContext";var Sn=n(17569),Cn=n(75975),On=n(79573);function Pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){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 kn="CHANGE_SEARCH_QUERY",Zn=Pn({},Cn.ZP.actions,{changeSearchQuery:(0,On.zD)(kn)}),Rn=(e,t)=>t.type===kn?Pn({},e,{searchQuery:t.payload,page:0}):Cn.ZP.reducer(e,t);var Tn=n(92332),jn=n(25843);function In(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Dn(e,t,n[t])}))}return e}function Dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ln={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},Mn=(0,oe.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:In({padding:"0 4px",marginLeft:"-4px"},h.zXF[h.Y1q.updateAttribute]),insertAttribute:In({},h.zXF[h.Y1q.insertAttribute]),deleteAttribute:In({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":Ln}}))),An=(0,jn.Z)((e=>{const t=Mn(),{description:n}=(null==e?void 0:e.headCellData)||{};return a().createElement("div",{className:t.headCell},a().createElement(Tn.default,e),a().createElement(Y.Z,{description:n,className:t.description}))}));var zn=n(67586),Vn=n(40007);const Un=e=>{let{value:t,historyClassName:n}=e;const r=Mn();return a().createElement("div",{className:r.blobWrapper,onScroll:On.UW},a().createElement("span",{className:r[n]},t))},Hn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const o=Mn(),{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(Un,{value:i,historyClassName:u});{const e=a().createElement(zn.Z,{value:i,dataTypeDefinition:n});return a().createElement(Vn.Z,{value:e},a().createElement("div",{className:o.defaultWrapper},a().createElement("span",{className:o[u]},e)))}};function Fn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wn=(e,t)=>{const{uri:n,label:r,children: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=>Wn(e,t.concat({name:o}))))})},Bn=(0,l.pipe)((0,l.split)("."),(0,l.slice)(2,1/0)),qn=e=>{if((0,h.vZp)(e)){const t=Bn(e);return t.length>1?t.slice(0,-1):null}return null},_n=(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){Fn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:qn(e.id),headCellRenderer:An,rowCellValueRenderer:Hn})));var Gn=n(79575);function $n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yn=n(33903),Xn=n(87825);const Qn=(0,oe.makeStyles)((()=>({header:{padding:"0 12px 0 16px"},rightMenuItems:{display:"flex",flex:"1 0 auto",justifyContent:"flex-end",alignItems:"center"}}))),Kn=e=>{let{title:t}=e;const n=Qn(),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)(wn),g=o&&(null==l?void 0:l.required);return a().createElement(G.Z,{title:t,className:n.header},g&&a().createElement($.Z,null),a().createElement(Y.Z,{description:null==l?void 0:l.description}),a().createElement("div",{className:n.rightMenuItems},a().createElement(J.i,{query:i,onChange:s}),a().createElement(Yn.Z,{enabled:!!c,onClick:u}),a().createElement(Q.Z,{height:24,margin:4}),a().createElement(Xn.Z,{columnsData:p,selectedColumns:d,onChangeColumns:m})))};function Jn(){return Jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jn.apply(this,arguments)}const er=(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=Mn();return a().createElement("div",{className:z()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,Jn({key:t,value:e},l)))))}));var tr=n(47081),nr=n(45108);const rr=(0,oe.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)"}}}))),ar=e=>{let{onEdit:t,onRemove:n}=e;return a().createElement(a().Fragment,null,t&&a().createElement(Fe.k,{tooltipTitle:y().text("Edit"),icon:ct.Z,size:"L",onClick:t}),n&&a().createElement(Fe.k,{tooltipTitle:y().text("Remove"),icon:ut.Z,size:"L",onClick:n}))};function or(){return or=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},or.apply(this,arguments)}const lr=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))(Bn(e),t))(r,e),t)}),{}),(0,l.assoc)("value",e))(t))))(n,t)),[n,t]),f=(0,r.useMemo)((()=>_n(t)),[t]),b=rr(),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)(wn),P=(0,r.useCallback)((e=>a().createElement(er,or({},e,{isSorted:!!o&&o.field===e.columnData.id}))),[o]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:R}=(0,tr.l)(),T=(0,r.useMemo)((()=>"number"!=typeof N||!E||m.includes((0,l.pipe)((0,l.path)([N]),(0,l.prop)("uri"))(n))),[N,m,n,E]),j="number"==typeof N&&(I=(0,l.path)([N],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 N&&(e=>Z(u)&&(0,h.yv0)({attributeType:O,mode:y,attributeValue:e,isReltioCrosswalk:(0,h.KVV)(C.crosswalks,e)}))((0,l.path)([N],n)),L=(0,r.useCallback)((()=>{const e=(0,l.path)([N],n);D&&p(e)}),[p,N,n,D]),M=(0,r.useCallback)((()=>{const e=(0,l.path)([N],n);if(!j)return;const t={parentUri:S,attributeType:O,uri:e.uri,value:e};d(t),k(null)}),[N,n,d,j,O,S]),A=T||!j&&!D?void 0:a().createElement(ar,{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(nr.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:k,hoverRowIndex:N,hoveredRowRightContent:A,context:z,classes:{hoveredRowRightContentWrapper:b["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:b["row-cell__buttons-container"]}}))};function ir(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){sr(e,t,n[t])}))}return e}function sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const cr=[],ur=(0,oe.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 pr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dr=e=>{let{onChangeAttribute:t,onCancel:n,onApply:o,onDeleteAttribute:i,hasChanges:s,attributeValue:c}=e;const u=ur(),p=(0,x.useDispatch)(),m=(0,r.useContext)(d.m),{attributeType:g}=(0,r.useContext)(wn),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){pr(e,t,n[t])}))}return e}({},e,{viewId:m}))))),[m,p]),N=(0,r.useCallback)((0,l.pipe)(v.N5.errors.actions.errorDeactivated,p),[p]);return a().createElement(a().Fragment,null,a().createElement(fe.Z,{expanded:!0,attributeValue:c,showEmptyEditors:O,onDeleteAttribute:i,onDeactivateError:N,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(te.Z,{onClick:()=>n(c)},y().text("Cancel")),a().createElement(te.Z,{color:"primary",disabled:!s,onClick:()=>o(c,S),"data-reltio-id":"table-attribute-view-apply-button"},y().text("Apply"))))};var mr=n(98001);const gr=e=>(null==e?void 0:e.type)===h.NIO.missed,fr=(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)))))),hr=(0,oe.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"}}))),br=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=hr(),{attributeType:w}=(0,r.useContext)(wn),S=(0,x.useSelector)(v.ZP.selectors.getMode),{canCreate:C}=(0,tr.l)();(e=>{let{onStartEditing:t,modifiedValues:n,highlightedError:a,highlightedAttributeError:o}=e;const{attributeType:i}=(0,r.useContext)(wn),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,mr.u)(),d=(0,r.useMemo)((()=>c.find((0,l.both)(gr,(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)(fr(n)),(0,l.reject)(l.isNil),(0,l.forEach)(t))(c),u.current=!1)}),[c]),(0,r.useEffect)((()=>{gr(a)&&1===n.length&&t(n[0])}),[a]),(0,r.useEffect)((()=>{if(o){const e=fr(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(te.Z,{color:"primary",onClick:c,className:E.addButton,"data-reltio-id":"table-attribute-view-add-button"},a().createElement(ue.Z,{classes:{root:E.icon}}),a().createElement("div",{className:E.buttonLabel},y().text("Add"))),n.map((e=>a().createElement(dr,{key:e.uri,attributeValue:e,onChangeAttribute:i,onDeleteAttribute:s,onCancel:u,onApply:p,hasChanges:g(e)}))))},yr=(0,he.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)(wn),{onDeleteAttribute:E,onStartEditing:w,onChangeAttribute:S,onAdd:C,onCancel:O,onApply:P,onReset:N,checkHasChanges:k,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)(wn),f=(0,h.KIu)(i),b=(0,h.xy8)(m),y=(0,l.pathOr)(cr,[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]),N=C.filter((t=>{let{uri:r}=t;return r===e||n.find((0,l.propEq)("uri",r))})),k=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.modifyAttribute,o)(ir({},e,{viewId:p}))),[p,o]),Z=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.removeAttribute,o)(ir({},e,{viewId:p}))),[p,o]),R=(0,r.useCallback)((()=>{const e=(0,h.gjI)({parentUri:s,attributeType:m});t(e.uri),k({value:ir({},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,k]),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||k(t)}else{const n={value:e,attributeType:m,uri:e.uri};t(null),Z(n)}o(v.N5.errors.actions.errorsSet([]))}),[Z,k,a,w,n,m,o]),I=(0,r.useCallback)(((e,t)=>{const n=(0,h.q5j)(c,m,e,t).map((n=>ir({},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:k,onDeleteAttribute:Z,onAdd:R,onCancel:j,onApply:D,onStartEditing:T,onReset:L,modifiedValues:O,editingValues:N,deletedUris:P}})(),{ref:j,errorClassName:I}=(0,de.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(br,{config:t,editingValues:R,modifiedValues:Z,onChangeAttribute:S,onDeleteAttribute:E,onAdd:C,onReset:N,onCancel:O,onApply:P,onStartEditing:w,checkHasChanges:k,highlightedError:null==o?void 0:o.element,highlightedAttributeError:null==i?void 0:i.element}),L.length>0&&a().createElement(lr,{columnsData:L,config:t,values:D,filters:f,onFilter:m,sorting:b,onSort:g,onEdit:w,onDeleteAttribute:E,deletedUris:T}))})),vr=(0,oe.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"}}))),xr=15,Er=e=>{let{config:t,className:n}=e;const{caption:o,max:l=xr}=t,i=vr(),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)(wn);return a().createElement(W.Z,{className:z()(i.root,n)},p?a().createElement(a().Fragment,null,a().createElement(Kn,{title:o}),a().createElement("div",{className:i.content},a().createElement(yr,{config:t,attributeType:u,entityUri:s}),d&&a().createElement(B.Z,{count:c,rowsPerPageOptions:[],rowsPerPage:l,page:g,onChangePage:f}),m&&a().createElement(D.Z,null))):a().createElement(a().Fragment,null,a().createElement(G.Z,{title:o,className:i.header},a().createElement(Y.Z,{description:null==u?void 0:u.description})),a().createElement(_.Z,{className:i.noData},y().text("No data"))))};var wr=n(37163);function Sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Cr=0;const Or=()=>Cr++,Pr=e=>{const t={children:[],nodeId:Or()};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:Or(),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 kr=(0,oe.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 Zr=n(1242);const Rr=a().createContext(null),Tr=e=>{e.target.src=Zr},jr=e=>{let{node:t}=e;const{entity:{uri:n},nodeId:o}=t,l=(0,h.idV)(t.entity.label),i=kr(),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)(Rr),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(nn.Z,{alt:"Node icon",className:z()(i.avatar),src:y||Zr,onError:Tr}),a().createElement(Nr.Z,{isSelected:g,title:l,entityUri:n,viewId:m.id,anchorEl:p})))},Ir=((0,r.memo)(jr),e=>{let{node:t}=e;return t.nodeId}),Dr=(0,oe.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% - ${zr.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:zr.rowHeight/2+"px",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:zr.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 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)}function Mr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ar(){return Ar=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},Ar.apply(this,arguments)}const zr={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=Dr();return a().createElement("div",Ar({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:z()(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=Dr(),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){Mr(e,t,n[t])}))}return e}({},s.style,{width:f}),b=(null==i?void 0:i.rootIndex)>99&&i.root;return a().createElement("div",Lr({},s,{className:z()(c.node,{[c.longRootNode]:b,[c.rootNode]:i.root&&!b}),style:h}),p,a().createElement("div",{className:z()(c.nodeContent,{[c.nodeRootLongContent]:b}),style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function Vr(){return Vr=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},Vr.apply(this,arguments)}const Ur=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",Vr({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"})))},Hr=e=>{let{title:t,onGraphOpen:n}=e;const o=kr(),{showNavigateToGraph:l}=(0,r.useContext)(O.Y);return a().createElement(G.Z,{title:t,className:o.header},l&&a().createElement("div",{className:o.buttonsContainer},a().createElement(Fe.k,{className:o.button,tooltipTitle:y().text("Show Graph"),icon:Ur,onClick:n,size:"L"})))},Fr=e=>Ir({node:e});function Wr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Br=[10,25];var qr=n(52241),_r=n(69089);const Gr=(0,oe.makeStyles)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function $r(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){Yr(e,t,n[t])}))}return e}function Yr(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,qr.E)(t),y=Gr(),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(_r.Z,{ref:i,open:!!b}),a().createElement(gt.Z,{title:v||""},a().createElement("div",{ref:o,style:$r({},x,h),className:z()(y.root,n)}))):null};var Qr=n(7882);const Kr=e=>{const t=t=>a().createElement(Qr.Z,{error:a().createElement(N.ZP,{LogoRenderer:N.B9.ERROR,text:"",secondaryText:y().text("Something went wrong"),variant:N.tC.small})},a().createElement(e,t));return t.displayName="WithErrorBoundary",t},Jr=(0,oe.makeStyles)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var ea=n(25744),ta=n(63436),na=n(40702),ra=n(40435);const aa=(0,l.pipe)((0,l.path)(["point","lat"]),(0,l.both)((0,l.gt)(90),(0,l.lt)(-90))),oa=(0,oe.makeStyles)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var la=n(61347),ia=n(66078);const sa=(0,oe.makeStyles)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),ca=sa,ua=e=>{let{totalImages:t}=e;const n=ca(),r=t>1?y().text("photos"):y().text("photo");return a().createElement(_.Z,{variant:"caption",className:n.caption},`${t} ${r}`)};function pa(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){da(e,t,n[t])}))}return e}function da(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ma=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(ia.Z,{attributeValues:u,attributeType:n,onDeleteAttribute:e=>(0,l.pipe)(v.N5.actions.removeAttribute,i)(pa({},e,{viewId:p})),parentUri:c.uri,onChangeAttribute:e=>(0,l.pipe)(v.N5.actions.modifyAttribute,i)(pa({},e,{viewId:p})),imageSize:ha,paging:r,requestNextPageOfAttributeValues:o}),a().createElement(ua,{totalImages:u.length}))},ga=(0,oe.makeStyles)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),fa=ga,ha={imageMargin:4,imageWidth:162,imageHeight:162};var ba=n(55485),ya=n(23044),va=n(20200),xa=n(25601),Ea=n(84236),wa=n(48376);function Sa(){return Sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sa.apply(this,arguments)}const Ca=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:xa.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(Ea.H,Sa({},g,{onFinishRequest:b})),p&&a().createElement(wa.i,Sa({},g,{onFinishRequest:l})))},Oa=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(va.M,{match:r,entity:s,entitiesMap:n,metadata:i,className:Mt.U},a().createElement(At.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(Ca,{match:r,config:t,onStartRequest:l,onFinishRequest:o}))},Pa=(0,oe.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},ka={order:h.KM9.asc,field:"score"};var Za;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Za||(Za={}));const Ra=e=>(0,l.pipe)(Kr,V.Z)(e),Ta=Ra((e=>{let{className:t}=e;const n=Jr();return a().createElement(W.Z,{className:z()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),ja=Ra((e=>{let{className:t,config:n}=e;return a().createElement(U.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Ia=Ra((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=Le(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){Me(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:o,page:a,toggleShowInactive:u,showInactive:l},c)})(n);return a().createElement(H.Provider,{value:o},a().createElement(Te,{config:n,className:t}))})),Da=Ra((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=>Wn(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)(Rn,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,Gn.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,Sn.o)({actions:Zn,dispatch:u}),N=Le(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){$n(e,t,n[t])}))}return e}({},c,{setSearchQuery:E,setPage:w,onSort:S,onFilter:C,onToggleFilters:O,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||b||p||f)&&o&&!o.hidden),allColumnsData:i},N)})(t);return a().createElement(wn.Provider,{value:o},t&&a().createElement(Er,{config:t,className:n}))})),La=Ra((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(qe.Provider,{value:s},a().createElement(En,{config:i,className:n}))})),Ma=Ra(Xr),Aa=Ra((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=kr(),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:N,page:k}=((e,t)=>{const n=(0,je._)(),[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,Ie.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){Sr(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(Pr).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[Fr(e)]!==r?(0,l.assoc)(Fr(e),r,t):t))}),[]),getRowHeight:(0,r.useCallback)((t=>{let{node:n}=t;return e[Fr(n)]?Math.max(e[Fr(n)],zr.rowHeight):zr.rowHeight}),[e]),clearHeightsCache:n}})(),j=(0,r.useContext)(O.Y),I=void 0!==u?u:j.showNavigateToGraph,L=(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){Wr(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(jr,{node:e.node}))})),[Z]);return(0,r.useEffect)((()=>{T()}),[T,g]),a().createElement(O.Y.Provider,{value:L},a().createElement(W.Z,{className:n},a().createElement(Hr,{onGraphOpen:M,title:i}),w&&a().createElement(D.Z,{className:d.linearIndicator}),a().createElement(Rr.Provider,{value:t},a().createElement("div",{className:d.treeContainer},a().createElement("div",{className:d.tree},E?a().createElement(_.Z,{className:d.errorMessage},E):a().createElement(a().Fragment,null,a().createElement(wr.ZP,{isVirtualized:!1,treeData:f,canDrag:!1,theme:zr,generateNodeProps:A,onChange:b,getNodeKey:Ir,rowHeight:R})))),C>Br[1]?a().createElement(B.Z,{classes:{root:d.hidePageSelectorWhenSmall},count:C,onChangePage:P,page:k,rowsPerPage:S,onChangeRowsPerPage:N,rowsPerPageOptions:Br,labelRowsPerPage:y().text("Roots per page:")}):null)))})),za=Ra((e=>{let{config:t,className:n}=e;const o=Pa(),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,ya.s)({enabled:!!s,entity:i,options:Na,filter:"",page:0,sorting:ka,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:N}=(0,r.useContext)(S.h);(0,r.useEffect)((()=>{N(P)}),[N,P]);const k=!(0,l.isEmpty)(g),Z=c?Za.Loading:(0,l.isEmpty)(g)?Za.NoData:Za.Loaded;return a().createElement(Ue.X.Provider,{value:f},a().createElement(W.Z,{className:z()(o.root,n)},a().createElement(G.Z,{title:t.caption}),a().createElement("div",{className:o.matchesContainer},Z===Za.Loading&&a().createElement(D.Z,null),Z===Za.NoData&&a().createElement(_.Z,{className:o.noData},y().text("No matches found")),Z===Za.Loaded&&g.map((e=>a().createElement(Oa,{config:t,entitiesMap:f,match:e,onFinishRequest:E,onStartRequest:p,key:e.object.uri})))),k&&a().createElement(a().Fragment,null,a().createElement("div",{className:o.footer},a().createElement(ba.Z,{component:"button",variant:"caption",onClick:O,underline:"none"},y().text("See all"))))))})),Va=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,91572)).then((e=>({default:Ra(e.HierarchyTreeView)}))))),Ua=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,51317)).then((e=>({default:Ra(e.RelationshipsTableView)}))))),Ha=Ra((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:o,className:l}=e;const i=oa(),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,je._)();return(0,r.useEffect)((()=>{i(!0),s((0,h.DBr)(t,[e],n)).then((e=>{o(e.filter(aa))})).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(D.Z,null))),[i]),g=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),f=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return u&&a().createElement(W.Z,{className:z()(i.root,l)},d&&a().createElement(D.Z,null),a().createElement(ra.Z,{size:"S",icon:n?ta.Z:ea.Z,onClick:()=>o(t.id),className:i.fullscreenBtn}),a().createElement(na.Z,{loadingElement:m,defaultZoom:1,defaultCenter:g,markers:p,mapContainerClassName:i.fullHeight,mapKey:u,mapOptions:f}))})),Fa=Ra((e=>{let{config:t,className:n}=e;const{attributeUri:o}=t,i=fa(),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(W.Z,{className:n},a().createElement(G.Z,{title:t.caption},a().createElement(Y.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(ma,e)}if(r>0){const t={attributeValues:e,attributeType:d,imageSize:ha,paging:n,parentUri:u.uri,requestNextPageOfAttributeValues:g};return a().createElement(a().Fragment,null,a().createElement(la.Z,t),a().createElement(ua,{totalImages:r}))}}return a().createElement(_.Z,{className:i.noData},m)})()))}));class Wa{}Wa.ViewTypes=h.ZIY,Wa.getComponentBy=(e,t)=>{let{config:n,className:r,isFullscreen:o,onToggleFullscreen:l}=t;switch(n[e]){case Wa.ViewTypes.HierarchyTree:return a().createElement(Va,{config:n,className:r});case Wa.ViewTypes.HierarchyPaths:return a().createElement(Aa,{config:n,className:r});case Wa.ViewTypes.RelationsTable:return a().createElement(Ua,{config:n,className:r});case Wa.ViewTypes.Relations:return a().createElement(La,{config:n,className:r});case Wa.ViewTypes.Attributes:return a().createElement(ja,{className:r,config:n});case Wa.ViewTypes.SingleAttribute:return a().createElement(Ia,{config:n,className:r});case Wa.ViewTypes.AttributeTable:return a().createElement(Da,{config:n,className:r});case Wa.ViewTypes.Map:return a().createElement(Ha,{config:n,isFullscreen:o,onToggleFullscreen:l,className:r});case Wa.ViewTypes.Custom:return a().createElement(Ma,{config:n,className:r});case Wa.ViewTypes.ImageAttribute:return a().createElement(Fa,{config:n,className:r});case Wa.ViewTypes.PotentialMatches:return a().createElement(za,{config:n,className:r})}},Wa.getComponent=e=>Wa.getComponentBy("class",e)||Wa.getComponentBy("react-class",e)||a().createElement(Ta,{className:e.className});const Ba=Wa,qa=()=>null,_a=(0,r.memo)((e=>{let{config:t,isFullscreen:n,isAutosize:o,onToggleFullscreen:l}=e;const i=Jr();return a().createElement(r.Suspense,{fallback:a().createElement(qa,null)},Ba.getComponent({config:t,className:z()(i.component,{[i.fullHeight]:!o}),isFullscreen:n,onToggleFullscreen:l}))}));_a.displayName="ViewComponent";const Ga=(0,oe.makeStyles)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"},overflowContainer:{width:"100%",height:"100%",overflow:"hidden"}})));function $a(){return $a=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},$a.apply(this,arguments)}const Ya=["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=Ga(),f=(0,x.useSelector)(v.ZP.selectors.getGoogleMapKey);if(!m)return null;const b=m.class===Ba.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===Ba.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",$a({},(0,l.omit)(Ya,d),{"data-reltio-id":m.id,"data-reltio-class":y||"",style:s,className:z()(o,{[g.item]:!b,customView:b})}),a().createElement("div",{className:g.overflowContainer},a().createElement("div",{"data-reltio-id":"profile-view-container",className:z()({[g.fixedSizeContainer]:!p})},p,a().createElement(_a,{config:m,isFullscreen:c,onToggleFullscreen:u,isAutosize:Boolean(p)})),i))},Qa=1024,Ka=(0,oe.makeStyles)({scrollWrapper:{flexGrow:1,overflow:"auto"},scrollableContent:e=>{let{maxWidth:t,minWidth:n=Qa,scrollbarWidth:r}=e;return{minWidth:t&&t<n?t-r:n,height:"100%"}}}),Ja=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=Ka({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(L.p.Provider,{value:f},a().createElement(M.Z,{LayoutItem:Xa,views:t,layout:n,onLayoutChanged:c,draggableHandle:".viewDraggableHandle",isStatic:o}))))};var eo=n(10050),to=n(83820),no=n(92679);const ro=(0,oe.makeStyles)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),ao=e=>{let{notification:t}=e;const n=ro({}),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(te.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(ra.Z,{className:n.closeIcon,size:"S",icon:no.default,onClick:d}),t.text);return a().createElement(a().Fragment,null,a().createElement(to.Z,{container:document.body},a().createElement(eo.Z,{autoHideDuration:i,open:u,classes:{root:n.snackbar},action:f,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:h})),a().createElement(rt.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")}))},oo=()=>{const e=(0,x.useSelector)(v.ZP.selectors.getNotifications);return e?a().createElement(a().Fragment,null,e.slice(-1).map((e=>a().createElement(ao,{key:e.id,notification:e})))):null};var lo=n(15328),io=n(26436),so=n(70369),co=n(50985),uo=n(79386),po=n(75647),mo=n(76368),go=n(36777),fo=n(97287);function ho(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){bo(e,t,n[t])}))}return e}function bo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yo(){return yo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yo.apply(this,arguments)}const vo=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",yo({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 xo(){return xo=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},xo.apply(this,arguments)}const Eo=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",xo({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"})))},wo=(0,oe.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)"}}),So=e=>a().createElement(lo.Z,e,a().createElement(vo,null)),Co=e=>a().createElement(lo.Z,e,a().createElement(Eo,null)),Oo=(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)})),Po=e=>{let{className:t,profileBandConfig:n,menuItems:o,showMenu:i=!0}=e;const s=wo(),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,N=S===h.OXy.Cloning||P,[k,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:ho({},(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:so.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:h.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:So,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:h.fO_.VIEWING,description:y().text("Read or print profile"),icon:io.Z,permission:"READ"}]),[]),I=(0,r.useMemo)((()=>[...T?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:Co,onClick:()=>Z(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:ut.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)((()=>Oo(j,O,L,g,u)),[j,O,g,u,L]),A=(0,r.useMemo)((()=>Oo(I,O,L,g,u)),[I,O,g,u,L]),V=(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(uo.Z,{className:z()(t,Mt.U),entity:b&&d?d:p},a().createElement(q.Z,{display:"flex",alignItems:"center"},a().createElement(q.Z,{mr:3},b&&a().createElement(q.Z,{className:s.editingButtons},a().createElement(te.Z,{variant:"outlined",className:s.cancelButton,onClick:U,"data-reltio-id":"reltio-profile-cancel-editing",disabled:N},y().text("Cancel")),a().createElement(te.Z,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:H,disabled:N},(0,h.fnZ)(f)?y().text("Suggest"):y().text("Save"))),w&&E?a().createElement(po.Z,null):E&&a().createElement(mo.a,null)),D&&a().createElement(go.T,{optionsGroup:M,buttonsGroup:A,value:f,onChange:V,disabled:N}),i&&a().createElement(Qe.Z,{menuId:"profile-header-menu",buttonComponent:ra.Z,buttonProps:{icon:co.Z,size:"L","data-reltio-id":"reltio-profile-header-menu",className:s.menuButton},menuItems:o,MenuItemRenderer:fo.Z})),a().createElement(q.Z,{className:s.comments},a().createElement(At.Z,{uri:p.uri,relatedObjectUris:(0,h.wp9)(h.q7e.ENTITY,{entityUri:p.uri}),objectType:h.q7e.ENTITY}))),!!T&&a().createElement(rt.Z,{open:k,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),ko=n(11821),Zo=n(98273);const Ro=(0,oe.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 To(){return To=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},To.apply(this,arguments)}let jo;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(jo||(jo={}));const Io=e=>{let{active:t,tabs:n,onClose:o}=e;const i=Ro(),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(ko.h,{open:s},!p&&a().createElement(a().Fragment,null,a().createElement(Zo.P,To({},u,{onClose:o})),c)))};var Do=n(69409),Lo=n(7108),Mo=n(37778),Ao=n(32158),zo=n(95085),Vo=n(70675),Uo=n(13510);const Ho=(0,oe.makeStyles)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),Fo=()=>{const e=Ho(),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 Wo=n(36592);const Bo=()=>{const{total:e}=(0,r.useContext)(R.O),t=Ro();return a().createElement(at.Z,{badgeContent:e,classes:{anchorOriginTopRightRectangular:t.badgePosition,badge:t.badge}},a().createElement(Wo.Z,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:"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"})))))},Go=()=>{const{commentsMap:e}=(0,r.useContext)(S.h),t=Ro();return a().createElement(at.Z,{badgeContent:(0,h.mdt)(e),classes:{anchorOriginTopRightRectangular:t.badgePosition,badge:t.badge}},a().createElement(_o,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 Yo=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:"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 Qo=(0,oe.makeStyles)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Ko=()=>{const e=Qo(),{tasks:t,loading:n}=(0,r.useContext)(R.O);return a().createElement("div",{className:e.wrapper},n&&a().createElement(D.Z,null),t&&t.map((e=>a().createElement(Xo.s,{key:e.taskId,task:e}))))};var Jo=n(15422);const el=()=>a().createElement(Jo.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 tl=n(86868),nl=n(89925),rl=n(85101);const al=(0,oe.makeStyles)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),ol=()=>{const e=al(),{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,tl.Q)(n);return a().createElement(Ue.X.Provider,{value:i},a().createElement(q.Z,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:o}=e;return a().createElement(nl.J,{key:o,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),o&&a().createElement(ba.Z,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(l,o)},underline:"none"},a().createElement(rl.Z,{className:e.showMoreIcon}),y().text("Show more"))))},ll=()=>a().createElement(Jo.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.")}),il=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},sl=(0,oe.makeStyles)((()=>({profileContainer:{display:"flex",overflow:"hidden",flexGrow:1}}))),cl=(0,r.memo)((e=>{let{perspectiveId:t,commentId:n,hideHistory:o,children:i}=e;const s=sl(),{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?jo.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,Do.C)({perspectiveId:o,entity:g,historyButtonId:jo.History}),{historyFilter:C,onApplyFilter:O,isLoading:P,historicUris:N,historyWithTotal:k,canLoadMore:Z,onLoadMore:T}=(0,Lo.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:jo.Workflow,icon:Bo,tooltipTitle:y().text("Workflow")},content:null!=f&&f.total?a().createElement(Ko,null):a().createElement(el,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:il(null==f?void 0:f.total),rightContent:a().createElement(Mo.G,null)},hidden:!j},{buttonProps:{id:jo.Collaboration,icon:Go,tooltipTitle:y().text("Collaboration")},content:D?a().createElement(ol,null):a().createElement(ll,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:il(D)},hidden:!I},{buttonProps:{id:jo.History,icon:Uo.Z,tooltipTitle:y().text("History")},content:w?a().createElement(Ao.Z,{isLoading:P,historyWithTotal:k,contributorsUris:N,entityUri:null==g?void 0:g.uri,historyEvent:d,onLoadMore:T,canLoadMore:Z}):a().createElement(zo.Z,null),headerProps:{content:a().createElement(Vo.Z,{total:w?((null==N?void 0:N.length)||0)+1:void 0,entityType:(0,h.nt9)(m,null==g?void 0:g.type),filter:C,onApplyFilter:O})},hidden:n},{buttonProps:{id:jo.DBConnector,icon:Yo,tooltipTitle:y().text("D&B Connector")},content:a().createElement(Fo,null),headerProps:{mainTitle:y().text("D&B Connector")},hidden:!c}]),[null==f?void 0:f.total,j,D,I,w,P,k,N,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(Io,{tabs:u})))}));cl.displayName="ProfilePerspectiveView";var ul=n(35296),pl=n(85321);const dl="48px",ml="1px solid rgba(0, 0, 0, .125)",gl=(0,oe.makeStyles)((e=>({accordion:{borderTop:ml,borderBottom:ml,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:dl,minHeight:dl,"&$accordionSummaryExpanded":{height:dl,minHeight:dl}},accordionSummaryHeading:{flex:1,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular},accordionSummaryExpanded:{},accordionSummaryContent:{display:"flex",alignItems:"center"},accordionDetails:{maxHeight:"21vh",overflow:"auto",paddingTop:0,paddingBottom:0,"& ul":{paddingLeft:"23px",marginTop:"3px"},"& li":{paddingLeft:"9px",paddingBottom:"8px"}},parents:{color:e.palette.text.primary},errorWrapper:{lineHeight:"18px",display:"flex",flexDirection:"column"},errorTitle:{display:"flex",alignItems:"center"},attributeTypesPath:{color:e.palette.text.secondary},goToIcon:{marginLeft:"4px"},errorsAccordion:{backgroundColor:"#FFF4F6",borderColor:"#FFB8B3"},errorsAccordionDetails:{color:"#DD2C00"},warningsAccordion:{backgroundColor:"#FFF9ED",borderColor:"#FFDD91"},warningsAccordionDetails:{color:"#CC7500"},icon:{marginRight:"8px"},errorIcon:{fill:"#FF1744"},warningIcon:{fill:"#F9A825"}}))),fl=gl;var hl=n(37453),bl=n(53711),yl=n(6341),vl=n(63655);const xl=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:o}=e;const l=fl();return t.length>0?a().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return a().createElement(hl.Z,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},a().createElement(bl.Z,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:a().createElement(vl.Z,null)},i,a().createElement(_.Z,{className:l.accordionSummaryHeading},s)),a().createElement(yl.Z,{className:z()(l.accordionDetails,p)},a().createElement("ul",null,c.map(((e,t)=>a().createElement(o,{key:t,error:e}))))))}))):null}));function El(){return El=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},El.apply(this,arguments)}xl.displayName="ErrorsPanel";const wl=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",El({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),a().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.245 12.75c0 .825-.467 1.5-1.045 1.5H4.8c-.583 0-1.05-.675-1.05-1.5v-7.5c0-.832.467-1.5 1.05-1.5h8.4c.578 0 1.05.668 1.05 1.5l-.005 7.5zM9.75 9.96v1.642l3-2.805L9.75 6v1.598c-2.918.404-4.08 2.4-4.5 4.402 1.043-1.402 2.415-2.04 4.5-2.04z",fill:"#000",fillOpacity:".54"}))},Sl=(0,l.omit)(["deactivated","path"]),Cl=(0,r.memo)((e=>{let{error:t}=e;const n=fl(),o=(0,x.useSelector)(v.ZP.selectors.getMetadata),i=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),s=((e,t)=>{let{type:n,source:r,message:a,attributeTypeUri:o="",attributeType:l}=t;if(n===h.NIO.missed&&r===h.zHr.local){const t=l||(0,h.zeJ)(e,o);return t?y().text("${attribute} is required",{attribute:t.label}):a}return a})(o,t),c=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[h.HAc.attributeValue,h.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(l.identity).join(" / ")})(t),u=(e=>{let{path:t}=e;return null==t?void 0:t.filter((e=>{let{type:t}=e;return t===h.HAc.attributeValue})).map((0,l.either)((0,l.path)(["valueType","label"]),(0,l.path)(["valueType","name"]))).filter(l.identity).join(" > ")})(t),{highlightError:p}=(0,r.useContext)(I.NY),d=t.uri||t.parentUri&&t.attributeTypeUri;return a().createElement("li",null,a().createElement("div",{className:n.errorWrapper},u&&a().createElement("span",{className:n.attributeTypesPath},u),a().createElement("span",{className:n.errorTitle},s,d&&i&&a().createElement(Fe.k,{icon:wl,size:"XXS",onClick:()=>p(t),tooltipTitle:y().text("Go to error"),className:n.goToIcon})),c&&a().createElement("span",{className:n.parents},c)))}));Cl.displayName="Error";const Ol=()=>{const e=fl(),t=(e=>{const t=(0,r.useRef)(e);return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&(0,l.equals)(e.map(Sl),t.map(Sl))}(e,t.current)||(t.current=e),t.current})((0,x.useSelector)(v.ZP.selectors.getProfileErrors)),[n,o]=(0,r.useMemo)((()=>(0,l.partition)(h.IT0,t)),[t]),[i,s]=(0,r.useState)(null),c=(0,r.useMemo)((()=>[{id:"errors",title:y().text("${number} ${errors}",{number:n.length,errors:1===n.length?y().text("error"):y().text("errors")}),icon:a().createElement(ul.Z,{className:z()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:y().text("${number} ${warnings}",{number:o.length,warnings:1===o.length?y().text("warning"):y().text("warnings")}),icon:a().createElement(pl.Z,{className:z()(e.icon,e.warningIcon)}),items:o,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,o,e]);(0,r.useEffect)((()=>{s("errors")}),[n]);const u=(0,r.useCallback)((e=>(t,n)=>{s(n?e:null)}),[]);return c.length>0?a().createElement(xl,{panels:c,expandedPanelId:i,onToggle:u,ErrorComponent:Cl}):null};var Pl=n(3096),Nl=n.n(Pl),kl=n(28220);function Zl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rl={};var Tl=n(27938),jl=n(54064);function Il(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Dl=n(43589),Ll=n(944);const Ml=(0,oe.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"}}))),Al=Ml;let zl;!function(e){e.loading="loading",e.success="success",e.error="error"}(zl||(zl={}));const Vl=e=>{let{onClose:t}=e;const n=Al();return a().createElement(Fe.k,{tooltipTitle:y().text("Close"),onClick:t,size:"S",className:n.closeIcon,icon:no.default})},Ul=e=>{let{onClose:t}=e;const n=Al();return a().createElement("div",{className:z()(n.wrapper,n.loadingWrapper)},a().createElement(Vl,{onClose:t}),a().createElement(Bt.Z,{className:z()(n.indicatorIcon)}),a().createElement(_.Z,null,y().text("Loading background process...")))},Hl=e=>{let{label:t,onClose:n,onRefresh:r}=e;const o=Al();return a().createElement("div",{className:z()(o.wrapper,o.successWrapper)},a().createElement(Vl,{onClose:n}),a().createElement(Dl.Z,{className:z()(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."))))},Fl=e=>{let{onClose:t}=e;const n=Al();return a().createElement("div",{className:z()(n.wrapper,n.errorWrapper)},a().createElement(Vl,{onClose:t}),a().createElement(Ll.Z,{className:z()(n.indicatorIcon)}),a().createElement(_.Z,null,y().text("UI attempted to check for updates but no update received in the last 30 seconds. Try refreshing the page manually.")))},Wl=e=>{let{label:t,onClose:n,onRefresh:r,status:o}=e;switch(o){case zl.loading:return a().createElement(Ul,{onClose:n});case zl.success:return a().createElement(Hl,{label:t,onClose:n,onRefresh:r});case zl.error:return a().createElement(Fl,{onClose:n});default:return null}},Bl=(e,t)=>((e,t)=>"*"===(null==e?void 0:e[0])||!(0,l.isNil)(e)&&e.includes(t))(e,t),ql=(0,oe.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 _l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Gl=(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=ql({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),L=(null===(t=(0,x.useSelector)(v.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"",M=(0,x.useSelector)(v.ZP.selectors.getMode),A=(0,x.useDispatch)(),z=(0,E.u)(),V=(e=>{const t=(0,Tl.v)(e),n=(0,jl.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){Il(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(u),{isLoading:U}=(0,w.M)(),{type:H,uri:F,updatedTime:W}=g||{},{onRefreshProfile:B,onCloseBackgroundProcessIndicator:q,cancelUpdateProcess:_,isOpenBackgroundProcessIndicator:G,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=Bl(i,n),c=Bl(l,n),u=(0,r.useRef)(null),p=(0,je._)(),m=(0,mr.u)(),g=(0,r.useContext)(d.m),[f,b]=(0,r.useState)(!1),[y,E]=(0,r.useState)(zl.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(zl.success),c?S():b(!0),e=-1)})).catch((()=>{})).finally((()=>{e<0||(e?(e-=1,u.current=setTimeout(P,w,e)):(E(zl.error),b(!0)))}))}),[a,t,c,S,p,w]),N=(0,r.useCallback)((()=>{s&&(E(zl.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&&N()}));return()=>{e()}}),[m,p,N]),{onRefreshProfile:S,onCloseBackgroundProcessIndicator:C,cancelUpdateProcess:O,isOpenBackgroundProcessIndicator:f,backgroundUpdateStatus:y}})({entityUri:F,entityTypeUri:H,entityUpdatedTime:W}),Y=(0,r.useMemo)((()=>(0,h.dvH)(g)),[g]),X=(0,r.useContext)(S.h),Q=(0,C.C)({objectIds:Y}),K=(0,r.useContext)(O.Y),J=(0,x.useSelector)(v.ZP.selectors.getShowAttributeDescription),ee=(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){_l(e,t,n[t])}))}return e}({},K,{showDescription:J})),[K,J]),{views:te,layout:ne,isLoaded:re,onLayoutReset:ae,onResetUndo:oe,handleLayoutChange:le}=(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,tr.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){Zl(e,t,n[t])}))}return e}({},t,{views:e,layout:n})}),[t,u]),d=(0,r.useMemo)((()=>Nl()(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=Rl,updateSavedState:x}=(0,kl.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:H,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)((()=>{A(v.N5.views.actions.profileViewsSet(te))}),[A,te]),(0,r.useEffect)((()=>{n.sidePanelViews&&A(v.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>()=>_()),[F,M]);const ie=M===h.ARY.Viewing&&(0,h.ZiX)(F),se=e=>a().createElement("div",{className:m.emptyState},a().createElement(N.ZP,{LogoRenderer:N.B9.NO_DATA,text:e,variant:N.tC.embedded})),{SnackbarRenderer:ce,resetLayout:ue}=(0,k.w)({onLayoutReset:ae,onResetUndo:oe}),pe=(0,r.useMemo)((()=>[{primary:y().text("Reset layout"),secondary:y().text("Restore the default layout without saving any changes"),onClick:ue}]),[ue]);return a().createElement(O.Y.Provider,{value:ee},a().createElement(Z.j.Provider,{value:!0},a().createElement(S.e,{collaboration:b?X:Q},a().createElement(R.O.Provider,{value:V},a().createElement(T.m.Provider,{value:z},a().createElement(j.l.Provider,{value:L},a().createElement(I.fy,null,a().createElement("div",{className:m.perspectiveView},re&&F?a().createElement(cl,{commentId:i,perspectiveId:"profile"},a().createElement("div",{className:m.profileWrapper},a().createElement(Po,{profileBandConfig:c,showMenu:!p,menuItems:pe}),U?se(y().text("Loading")):a().createElement(a().Fragment,null,G&&a().createElement(Wl,{label:g.label,onClose:q,onRefresh:B,status:$}),!b&&a().createElement(Ol,null),!ie&&a().createElement(Ja,{maxWidth:s,views:te,layout:ne,frozen:p,entityUri:F,onLayoutChanged:le})))):a().createElement(a().Fragment,null,a().createElement(D.Z,null),se(y().text("No data to display."))),a().createElement(oo,null),a().createElement(ce,null)))))))))}));Gl.displayName="ProfilePerspectiveView";const $l=(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 Yl=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:$l},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(Gl,{config:S,saveState:i,getSavedState:x,commentId:v}),a().createElement(f.Z,{showErrorFromStore:!0}),a().createElement(E,null))))))};var Xl=n(5050),Ql=n(79935),Kl=n(16e3);const Jl=(0,oe.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}}))),ei=e=>{let{total:t=0}=e;const n=Jl(),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(G.Z,{title:""},a().createElement("div",{className:n.titleContainer},a().createElement(ba.Z,{component:"button",variant:"caption",className:n.link,onClick:i,underline:"none"},y().text("Profile")),a().createElement(Kl.Z,{className:n.icon}),y().text("Tags")),a().createElement(Ql.Z,null),a().createElement(_.Z,{className:n.totalCaption,variant:"caption"},a().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var ti=n(59916),ni=n(26482);const ri=(0,oe.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"}}))),ai=e=>{let{label:t}=e;const n=ri();return a().createElement(ni.Z,{className:n.toolbar},a().createElement(ti.Z,{className:n.avatar}),a().createElement(_.Z,{variant:"h6",className:n.label},t))};function oi(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){li(e,t,n[t])}))}return e}function li(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ii=(0,oe.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}}))),si=[25,50,100],ci=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const o=ii(),[i,s]=(0,r.useState)(si[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,je._)(),c=(0,je._)(),[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=oi({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,oi({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>si[0];return a().createElement("div",{className:o.perspectiveView},a().createElement(ai,{label:t}),a().createElement("div",{className:z()(o.tagsContainer,{[o.fullHeight]:b})},a().createElement(W.Z,{className:o.tagsView},a().createElement(ei,{total:m}),a().createElement("div",{className:o.listContainer},d&&a().createElement(D.Z,null),m>0&&a().createElement("div",{className:o.entitiesList,ref:f},a().createElement(Xl.Z,{entities:g})),b&&a().createElement("div",{className:o.pagination},a().createElement(B.Z,{count:m,rowsPerPageOptions:si,rowsPerPage:i,page:c,onChangePage:u,onChangeRowsPerPage:s}))))))}));ci.displayName="TagPerspectiveView";const ui=(0,i.Z)({productionPrefix:"tagPerspective",disableGlobal:!0}),pi=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:ui},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(ci,{tag:n,entityUri:r}),a().createElement(f.Z,{showErrorFromStore:!0})))};var di=n(39636);const mi=(0,oe.makeStyles)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),gi=()=>{const e=mi(),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(uo.Z,{entity:t},a().createElement("div",{className:e.actionsWrapper},o&&a().createElement(di.o,{task:o})))};function fi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const hi=(0,oe.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 bi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const yi={processTypes:["dataChangeRequestReview"]},vi=(0,r.memo)((()=>{const e=hi(),t=(0,x.useDispatch)(),n=(e=>{const t=(0,x.useDispatch)(),n=(0,x.useSelector)(v.ZP.selectors.getEntityUri),a=(0,Tl.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){fi(e,t,n[t])}))}return e}({},a,{onActionSuccess:o})),[a,o])})(yi),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){bi(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(D.Z,null),a().createElement("div",{className:e.perspectiveContainer},c?a().createElement(cl,{hideHistory:!0,perspectiveId:"dcrCard"},a().createElement("div",{className:e.contentWrapper},a().createElement(gi,null),a().createElement("div",{className:e.attributesWrapper},a().createElement(U.Z,null)))):a().createElement(N.ZP,{LogoRenderer:N.B9.NO_DATA,text:y().text("No data to display."),variant:N.tC.embedded})))))}));vi.displayName="DCRReviewPerspectiveView";const xi=(0,i.Z)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0,seed:"dcr"}),Ei=e=>{let{config:t,onResize:n=l.identity}=e;return a().createElement(d.m.Provider,{value:t.id},a().createElement(s.ZP,{generateClassName:xi},a().createElement(u._,{dateAdapter:o.Q},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>n(Math.floor(e),Math.floor(t))}),a().createElement(vi,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(59464),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 N=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)))))};N.propTypes={rowValue:g().object,cell:g().object,CellValueRenderer:g().elementType,isSorted:g().bool};const k=N;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),$=n(29754),Y=n(6163);const X=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($.Z,null))),n&&o().createElement(_.Z,{title:h().text("Remove")},o().createElement(G.Z,{onClick:a,size:"large"},o().createElement(Y.Z,null))))};X.propTypes={canUpdate:g().bool,canRemove:g().bool,handleEditRelation:g().func,handleRemoveRelation:g().func};const Q=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(k,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)),[]),N=(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(Q,{handleEditRelation:N,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),Ne=n(43407),ke=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),N=(0,i.pipe)(Ce.changeShowInactive,O),k=(0,a.useContext)(Ne.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}({},k,{showDescription:Z})),[k,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,ke.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,$=g?[g,...f]:f,{canUpdate:Y,canDelete:X}=(0,Ze.l)(),Q=Y(n)&&!v,K=X(n)&&!v,J=(0,a.useRef)(null);return(0,Re.I)(n.id),o().createElement(Ne.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:N}),G&&o().createElement("div",{className:w.addArea},o().createElement(x,{onClick:q})),$.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:Q?(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 $e=n(40855),Ye=n(54426),Xe=n(41633),Qe=n(32479);const Ke=(0,Ye.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($e.ZP,{generateClassName:Ke},o().createElement(Xe._,{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(Qe.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]="2492e7e9-5579-4c81-a1b7-bff402e82411",e._sentryDebugIdIdentifier="sentry-dbid-2492e7e9-5579-4c81-a1b7-bff402e82411")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"1.4.1650"},(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[5163],{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},85321:(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 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error");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},35296:(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"}),"Warning");t.Z=l},5163:(e,t,n)=>{n.d(t,{vC:()=>Ei,Gv:()=>Ja,_n:()=>Yl,tM:()=>pi});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(59464),x=n(52730),E=n(589),w=n(96697),S=n(1824),C=n(36852),O=n(43407),P=n(35722),N=n(79002),k=n(61604),Z=n(80231),R=n(14834),T=n(62228),j=n(40006),I=n(43460),D=n(87378),L=n(8007),M=n(14593),A=n(71153),z=n.n(A),V=n(153),U=n(56346);const H=a().createContext(null);H.displayName="SingleAttributeContext";var F=n(80687),W=n(82565),B=n(33945),q=n(83422),_=n(79312),G=n(52194),$=n(32701),Y=n(12364),X=n(58003),Q=n(55310),K=n(33043),J=n(46804),ee=n(47019),te=n(38677),ne=n(80653),re=n(30721),ae=n(80852),oe=n(72342);const le=(0,oe.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"}}))),ie=e=>{let{className:t}=e;const n=le(),o=(0,r.useRef)(),[l,i]=(0,r.useState)(!1),{showInactive:s,toggleShowInactive:c}=(0,r.useContext)(H),u=()=>i((e=>!e));return a().createElement(a().Fragment,null,a().createElement(te.Z,{ref:o,classes:{root:z()(n.triggerButton,t)},onClick:u},a().createElement(ne.Z,null)),a().createElement(ee.ZP,{open:l,classes:{paper:n.popupContent},anchorEl:o.current,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(re.Z,{classes:{root:n.checkboxControlRoot,label:n.checkboxControlLabel},control:a().createElement(ae.Z,{className:n.checkboxControlCheckbox,checked:s,onChange:e=>c(e.target.checked)}),label:y().text("Show inactive values")})))},se=(0,oe.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"}}))),ce=e=>{let{caption:t,totalVisibleValues:n,showInactiveValuesMenu:o,isEditableMode:l}=e;const i=se(),{searchQuery:s,setSearchQuery:c,setPage:u,totalNonVisibleValues:p,nonVisibleValues:d,attributeType:m}=(0,r.useContext)(H),g=l&&(null==m?void 0:m.required);return a().createElement(G.Z,{title:t,className:i.root},g&&a().createElement($.Z,null),a().createElement(Y.Z,{description:null==m?void 0:m.description}),a().createElement(X.Z,{widthToHide:400},a().createElement(Q.Z,{height:24,margin:16}),a().createElement(_.Z,{className:i.totalCaption,variant:"caption"},y().number(n)," ",1===n?y().text("item"):y().text("items"))),a().createElement(K.Z,{nonOvTotal:p,className:i.ovIcon,nonOvValues:d,attributeType:m}),a().createElement("div",{className:i.rightMenuItems},a().createElement(J.i,{query:s,onChange:e=>{c(e),u(0)}}),o&&a().createElement(ie,null)))};var ue=n(93553),pe=n(56961),de=n(40941),me=n(63928),ge=n(55401),fe=n(11387),he=n(50548);const be=h.nIW,ye=(e,t)=>"object"==typeof e?Object.values(e).some((e=>e.some((e=>{let{value:n}=e;return ye(n,t)})))):h.P6Y.strings.search(String(e),t),ve=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 ye(t,i)})))(t,n,r),c=(0,l.filter)(h.OXP,s);return{[(0,h.xy8)(r)]:{[be(r)]:c.slice(o,o+a),paging:{[r]:{totalOvValues:c.length,totalValues:s.length}}}}},xe=(0,oe.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 Ee(){return Ee=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},Ee.apply(this,arguments)}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Se(e,t,n[t])}))}return e}function Se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ce=[],Oe=(0,he.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=xe(),{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),N=(0,h.xy8)(n),k=(0,l.pipe)((0,l.pathOr)(Ce,[N,f]),(0,l.map)((0,l.prop)("uri")))(w),Z=(0,l.pathOr)(Ce,[N,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,de.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)),V=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.addAttributes,b)(e.map((e=>we({},e,{viewId:E}))))),[E,b]),U=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.modifyAttribute,b)(we({},e,{viewId:E}))),[E,b]),H=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.removeAttribute,b)(we({},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 V(t)}return V([e(n)])}),[V,o,n,M]),B=(0,h.Vg3)({attributeType:n,mode:P}),q={attributeType:n,errors:C,crosswalks:S.crosswalks,mode:P,onAddAttributes:V,onChangeAttribute:U,onDeactivateError:F,showNonOv:i},G=0===A.length&&0===t.length;return!(0,l.isEmpty)(S)&&a().createElement("div",{ref:I,className:D},a().createElement(me.Z,{cardinality:g}),a().createElement(ge.Z,{message:O}),B&&a().createElement(te.Z,{color:"primary",onClick:W,className:u.moreButton},a().createElement(ue.Z,{classes:{root:u.icon}}),a().createElement("div",{className:u.buttonLabel},y().text("Add"))),A.map(((e,t)=>a().createElement(fe.Z,Ee({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(pe.Z,{className:u.divider}),t.map((e=>{const t=Z.find((0,l.propEq)("uri",e.uri)),n=t||e,r=k.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:z()({[u.ovFalse]:!(0,h.OXP)(n)})},a().createElement(fe.Z,Ee({},q,{attributeValue:n,ownError:(0,h.ADq)(n,null,p,C),onDeleteAttribute:H,state:i})))})),G&&a().createElement(_.Z,{className:u.noData},s))}));var Pe=n(11013);const Ne=(0,oe.makeStyles)((()=>({simpleAttribute:{fontSize:"13px",lineHeight:"15px",marginBottom:"4px"}}))),ke=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(Pe.Z,{key:e.uri,attributeValue:e,attributeType:n,showNonOv:r,className:z()({[o.simpleAttribute]:l})}))))},Ze=(0,oe.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}}))),Re=15,Te=e=>{let{config:t,className:n}=e;const{caption:o,max:l=Re,showInactiveValuesMenu:i}=t,s=Ze(),{values:c,totalVisibleValues:u,page:p,setPage:d,isLoading:m,hasPaging:g,attributeType:f,showInactive:h}=(0,r.useContext)(H),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(F.J.Provider,{value:S},a().createElement(W.Z,{className:z()(s.root,n)},a().createElement(ce,{totalVisibleValues:u,caption:o,showInactiveValuesMenu:i,isEditableMode:w}),a().createElement(q.Z,{className:s.content},(()=>{if(m)return a().createElement(D.Z,null);if(f){if(E&&C){const e={values:c,attributeType:f,showInactive:h};return a().createElement(ke,e)}if(w){const e={values:c,attributeType:f,parentUri:b,showInactive:h,noDataText:O};return a().createElement(Oe,e)}}return a().createElement(_.Z,{className:s.noData},O)})()),g&&a().createElement(B.Z,{count:u,page:p,rowsPerPage:l,rowsPerPageOptions:[],onChangePage:d,classes:{root:s.pagination}})))};var je=n(19701),Ie=n(55962);function De(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Le=(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,je._)(),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,N=be(n),k=(0,h.xy8)(n);g.current=(0,h.JQy)(w,P,N);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?ve: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){De(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)([k],e),r=(0,l.pathOr)([],[N],t);C||f(v.N5.actions.processNextPageOfAttributeValues({parentUri:P,attributeTypeUri:n,attributeTypeName:N,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,Ie.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 Me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ae=n(80225),ze=n(64047),Ve=n(10609),Ue=n(63929),He=n(1128),Fe=n(39475),We=n(74654),Be=n(812);const qe=a().createContext(null);qe.displayName="RelationsViewStateContext";const _e=(0,oe.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"}}))),Ge=e=>{let{className:t}=e;const n=_e(),o=(0,r.useRef)(),{showInactive:l,toggleShowInactive:i,sortOrder:s,toggleSortOrder:c,sortOption:u,changeSortOption:p,sortOptions:d}=(0,r.useContext)(qe),[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(te.Z,{ref:o,classes:{root:z()(n.button,t)},onClick:f},a().createElement(ne.Z,null)),a().createElement(ee.ZP,{open:m,classes:{paper:n.popupContent},anchorEl:o.current,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},a().createElement(re.Z,{classes:{label:n.checkboxControlLabel},control:a().createElement(ae.Z,{className:n.checkboxControlCheckbox,checked:l||!1,onChange:i}),label:y().text("Show inactive Relationships")}),b&&a().createElement(a().Fragment,null,a().createElement(pe.Z,{className:n.divider}),a().createElement(_.Z,{className:n.title,variant:"h6"},y().text("Sort by")),a().createElement("div",{className:n.sortControls},a().createElement(He.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(Fe.k,{tooltipTitle:v?y().text("Ascending"):y().text("Descending"),icon:v?We.Z:Be.Z,onClick:c,className:n.sortOrderButton,size:"L"})))))};Ge.displayName="FilterButton";const $e=Ge,Ye=(0,oe.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),Qe=n(98538);const Ke=a().createContext(null);function Je(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){et(e,t,n[t])}))}return e}function et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tt=Math.pow(2,31)-1,nt=(0,oe.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 rt=n(22118),at=n(71001);const ot=e=>{let{label:t}=e;const n=nt();return a().createElement(at.Z,{classes:{anchorOriginTopRightRectangular:n.badgePosition,badge:n.badge},badgeContent:t},a().createElement(Xe.Z,null))},lt=()=>{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)(Ke),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=[Je({},a.content,{offset:0,max:null!==(e=a.maxDtssImport)&&void 0!==e?e:tt})],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 Je({},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=nt(),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(Fe.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:z()(i.tenant)},c)):a().createElement(Qe.Z,{menuId:"importDT-table-actions",buttonComponent:Fe.k,buttonProps:{tooltipTitle:y().text("Import connections"),size:"L",icon:()=>a().createElement(ot,{label:c})},menuItems:e.map((e=>({onClick:()=>{l(e)},text:e.label})))}),a().createElement(rt.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})))},it=e=>{let{title:t,total:n}=e;const o=Ye(),{searchQuery:l,changeSearchQuery:i}=(0,r.useContext)(qe);return a().createElement(G.Z,{title:t||"",className:o.header},n>0&&a().createElement(X.Z,{widthToHide:400},a().createElement(Q.Z,{height:24,margin:16}),a().createElement(_.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(J.i,{query:l,onChange:i}),a().createElement(lt,null),a().createElement($e,null)))};var st=n(79298),ct=n(29754),ut=n(6163),pt=n(96379),dt=n(18527),mt=n(90838),gt=n(23883);const ft=(0,oe.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 ht(){return ht=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},ht.apply(this,arguments)}const bt=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=ft(),c=(0,je._)(),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(mt.Z,{size:16,classes:{colorPrimary:s.progress}}),g&&a().createElement("div",{className:s.secondaryLabel},g));return a().createElement(gt.Z,ht({onOpen:b,title:y,disableFocusListener:!0,classes:{tooltip:s.tooltip}},i),o)},yt=(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)}},vt=(0,oe.makeStyles)((()=>({container:{display:"flex"}})));function xt(){return xt=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},xt.apply(this,arguments)}const Et=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=vt();return a().createElement("div",{className:o.container},a().createElement(te.Z,xt({onClick:t,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Accept")),a().createElement(te.Z,xt({onClick:n,variant:"text",color:"primary"},r,{style:{alignSelf:"center"}}),y().text("Ignore")))},wt=(0,oe.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"}}))),St=(0,r.memo)((e=>{let{connection:t,metadata:n,showControls:o,onRemoveRelation:l,onEditRelation:i,onAcceptRelation:s,onIgnoreRelation:c,renderRelationArrowButton:u}=e;const p=wt(),{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}=yt(t,n),O=(0,h.Fn9)(m)&&(0,h.Fn9)(d),P=(0,x.useSelector)(v.ZP.selectors.getMode),{canRemove:N,canUpdate:k}=(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=(N||k)&&o&&!t.suggested?a().createElement(a().Fragment,null,k&&a().createElement(Fe.k,{icon:ct.Z,size:"XS",onClick:R,tooltipTitle:y().text("Edit")}),N&&a().createElement(Fe.k,{icon:ut.Z,size:"XS",onClick:Z,tooltipTitle:y().text("Remove")})):void 0,D=t.suggested?a().createElement(Et,{acceptRelation:T,ignoreRelation:j,size:"small",disabled:b}):void 0,L=b?y().text("ignored"):y().text("edited");return a().createElement("div",{className:z()(p.container,{[p.rowInactive]:!O},{[p.removed]:g||b})},a().createElement("div",{className:p.row},u&&u(),a().createElement(pt.Z,{className:p.entityAvatar,entityType:E}),a().createElement(dt.Z,{value:S,className:p.entityLabelContainer},a().createElement(bt,{label:w,entity:d},a().createElement("span",{className:p.entityLabel},w)),(f||b)&&a().createElement(_.Z,{variant:"caption",className:p.editedLabel},"(",L,")"),C&&a().createElement("span",{className:p.relationLabel},`, ${C}`)),a().createElement("div",{className:p.editButtonsContent},I),D))}));St.displayName="EditableRelationItem";const Ct=St,Ot=(0,l.when)(h.Kn2,(0,l.prop)("uri")),Pt=(e,t)=>{const n=(e,t)=>(t?(0,h.VGB)(t):[]).map((t=>({type:Ot(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 kt=n(89507),Zt=n(65643);const Rt=(0,oe.makeStyles)({arrowIcon:{fontSize:"16px",marginRight:"6px"}}),Tt=e=>{let{onClick:t,connection:n,config:r,showSecondLevel:o}=e;const l=Rt(),{parentEntityUri:i}=n,{contentSecondLevel:s}=r,c={onClick:t,className:l.arrowIcon};return i||!s||(0,h.xvW)(n)?null:o?a().createElement(Zt.Z,c):a().createElement(kt.Z,c)},jt=(0,oe.makeStyles)({row:{display:"flex",alignItems:"center",width:"100%"},secondLevelContent:{paddingLeft:"24px"}}),It=e=>{let{config:t,connection:n,children:o}=e;const l=jt(),{showInactive:i}=(0,r.useContext)(qe),{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(Tt,{onClick:u,connection:n,config:t,showSecondLevel:c}))),c&&a().createElement(Ue.X.Provider,{value:g},a().createElement("div",{className:l.secondLevelContent},a().createElement(vn,{isLoading:d,config:t,loadRelations:p,connections:s,total:m,parentEntityUri:n.entity.entityUri}))))},Dt=(0,oe.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"}}))),Lt=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=Dt(),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=Pt(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]),[N,k]=(0,l.partition)(h.xvW,n),Z=m&&g,R=0===N.length&&0===k.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(It,{config:o,connection:e,key:c},(t=>r?a().createElement(st.Z,{connection:r,config:o,mode:i,metadata:u}):a().createElement(Ct,{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(te.Z,{color:"primary",onClick:E,className:b.moreButton},a().createElement(ue.Z,{classes:{root:b.icon}}),a().createElement("div",{className:b.buttonLabel},y().text("Add"))),I&&a().createElement(st.Z,{connection:p,config:o,mode:i,metadata:u}),N.map(T),N.length>0&&k.length>0&&a().createElement(pe.Z,{className:b.divider}),k.map(T),R&&a().createElement(_.Z,{className:b.noData},s))};var Mt=n(62901),At=n(72316),zt=n(38309),Vt=n(89978);const Ut=(0,oe.makeStyles)((e=>({attributesList:{paddingLeft:"46px",paddingRight:"16px",marginBottom:"10px",color:e.palette.text.secondary,fontSize:"13px",letterSpacing:0}})));function Ht(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){Ft(e,t,n[t])}))}return e}function Ft(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wt=e=>{let{connection:t,className:n}=e;const o=Ut(),{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)((()=>Ht({attributes:Ht({},(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(zt.A.Provider,{value:f},a().createElement(Vt.Z,{className:z()(o.attributesList,n),entity:p,attrTypes:u})):a().createElement("div",{className:z()(o.attributesList,n)},y().text("No attributes"))};var Bt=n(93400),qt=n(89025);const _t=e=>{let{show:t,onToggle:n,className:r}=e;return a().createElement(Fe.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?Bt.Z:qt.Z,onClick:n})},Gt=(0,oe.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"}}))),$t=(0,r.memo)((e=>{let{connection:t,renderRelationArrowButton:n,acceptRelation:o,ignoreRelation:i}=e;const s=Gt(),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}=yt(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:z()(s.container,{[s.rowInactive]:!w},{[s.suggestedWrapper]:c})},a().createElement("div",{className:z()(s.row,Mt.U)},n&&n(),a().createElement("div",{className:s.labelWrapper},a().createElement(pt.Z,{className:s.entityAvatar,entityType:f}),a().createElement(dt.Z,{value:y,className:s.entityLabelContainer},a().createElement(bt,{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(At.Z,{className:s.commentsContainer,uri:(0,h.gjS)(p),relatedObjectUris:C,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),c&&a().createElement(Et,{size:"small",acceptRelation:o(t),ignoreRelation:i(t)}),!c&&a().createElement(_t,{show:d,onToggle:()=>{m((e=>!e))},className:s.showDetails}))),d&&a().createElement(Wt,{connection:t}))}));$t.displayName="RelationItem";const Yt=$t;var Xt=n(18876),Qt=n(71976),Kt=n(30750),Jt=n(80233),en=n(60590),tn=n(11559),nn=n(65439);const rn=e=>(0,l.pipe)((0,l.pluck)("value"),l.mean,(0,l.defaultTo)(0))(e).toFixed(1),an=e=>e.filter((e=>5===e.value)).length,on=e=>e.filter((e=>1===e.value)).length,ln=e=>{if(0===e.length)return{percentOfLikes:0,percentOfDislikes:0};const t=an(e)/e.length*100,n=parseFloat(Number(t).toFixed(1));return{percentOfLikes:n,percentOfDislikes:parseFloat(Number(100-n).toFixed(1))}},sn=(0,oe.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}}))),cn=e=>{let{ratings:t,crosswalks:n,open:r,anchorEl:o,onClose:l}=e;const i=sn(),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}=ln(t),p=`${an(t)} (${c}%)`,d=`${on(t)} (${u}%)`;return a().createElement(Jt.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"},rn(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(Kt.Z,{variant:"determinate",value:c,classes:{bar:i.scaleBar},className:z()(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(Qt.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(nn.Z,{className:i.avatar},a().createElement(tn.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(Qt.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(en.Z,{key:t,crosswalk:e}))))))},un=(0,oe.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)"}}))),pn=e=>{let{ratings:t,crosswalks:n,className:o}=e;const l=un(),i=(0,r.useRef)(),[s,c]=(0,r.useState)(!1),{percentOfLikes:u}=ln(t);return a().createElement(a().Fragment,null,a().createElement("div",{"data-reltio-id":"reltio-ratings",className:z()(l.wrapper,o),ref:i,onClick:()=>c(!0)},a().createElement(_.Z,{className:l.averageRating},rn(t)),a().createElement(Kt.Z,{variant:"determinate",value:u,classes:{bar:l.scaleBar},className:z()(l.scale,{empty:!t.length})}),a().createElement("div",{className:l.counts},a().createElement("div",{className:l.count},a().createElement(Xt.Z,{className:l.icon}),an(t)),a().createElement("div",{className:l.count},a().createElement(Qt.Z,{className:l.icon}),on(t)))),a().createElement(cn,{ratings:t,open:s,crosswalks:n,anchorEl:i.current,onClose:()=>c(!1)}))},dn=(0,oe.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}}))),mn=e=>{let{ratings:t,onAgree:n,onDisagree:r}=e;const o=dn(),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(te.Z,{onClick:n,variant:"text",size:"small",className:z()(o.button,{[o.isActive]:5===(null==i?void 0:i.value)})},"Agree"),a().createElement(Qe.Z,{buttonProps:{endIcon:a().createElement(Zt.Z,null),variant:"text",size:"small",className:z()(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"}))},gn=(0,oe.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"}}))),fn=e=>{var t;let{connection:n,loadRelations:o,renderRelationArrowButton:i,acceptRelation:s,ignoreRelation:c,showRating:u}=e;const p=gn(),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}=yt(n,y),O=(null==b?void 0:b.ratings)||[],P=(null==b||null===(t=b.object)||void 0===t?void 0:t.crosswalks)||[],N=(0,x.useSelector)(v.ZP.selectors.getEntityUriWithDataTenant),k=f&&b&&(0,h.wp9)(h.q7e.RELATION,{entityUri:N,connection:n})||[];return a().createElement("div",{className:z()(p.wrapper,{[p.suggestedWrapper]:d})},a().createElement(q.Z,{display:"flex",minHeight:"44px",className:Mt.U},a().createElement(q.Z,{display:"flex",alignItems:"center"},a().createElement(q.Z,{display:"flex",alignItems:"center"},i&&i(),a().createElement(pt.Z,{entityType:w,className:p.entityTypeIcon})),a().createElement(q.Z,{display:"flex",flexDirection:"column"},a().createElement(dt.Z,{value:S,className:p.entityLabelContainer},a().createElement(bt,{label:E,entity:f},a().createElement("span",{className:p.entityLabel},E))),C&&a().createElement("span",{className:p.relationLabel},C),!d&&u&&a().createElement(mn,{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)(k)&&a().createElement(At.Z,{className:p.commentsContainer,uri:(0,h.gjS)(b),relatedObjectUris:k,objectType:h.q7e.RELATION,allowOnlyOneComment:!0}),d&&a().createElement(Et,{acceptRelation:s(n),ignoreRelation:c(n)}),!d&&a().createElement(a().Fragment,null,u&&a().createElement(pn,{ratings:O,crosswalks:P,className:p.ratings}),a().createElement(_t,{show:m,onToggle:()=>{g((e=>!e))},className:p.showDetailsButton})))),m&&a().createElement(Wt,{connection:n,className:p.relationAttributes}))},hn=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=Pt(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(It,{config:l,connection:e,key:r},(t=>s?a().createElement(fn,{loadRelations:o,connection:e,acceptRelation:d,ignoreRelation:p,renderRelationArrowButton:t,showRating:"rating"===u}):a().createElement(Yt,{acceptRelation:d,ignoreRelation:p,connection:e,renderRelationArrowButton:t})))})))};hn.displayName="RelationsList";const bn=hn,yn=(0,oe.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"}}))),vn=e=>{let{isLoading:t,config:n,loadRelations:r,connections:o,total:l,parentEntityUri:i}=e;const s=yn(),{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(D.Z,{className:s.linearIndicator}):n.content&&(0,h.KIu)(p)?a().createElement(Lt,{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(bn,{config:n,loadRelations:r,connections:o,className:s.list,key:null==u?void 0:u.uri,mainEnityUri:u.uri}):a().createElement(_.Z,{className:s.noData},d)},xn=(0,oe.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}}),En=e=>{let{config:t,className:n}=e;const o=xn(),{page:i,setPage:s,rowsPerPage:c,sortOrder:u,sortOption:p,showInactive:d,searchQuery:m,changeSearchQuery:g}=(0,r.useContext)(qe),{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,Ae.a)({sorting:S,filter:C,page:i,rowsPerPage:c,config:t,entity:y,relationActivityFilter:d?h.Ng6.ALL:h.Ng6.ACTIVE_ONLY,mode:w}),N=(0,r.useMemo)((()=>(0,h.Px$)(b)),[b]),k=(0,r.useMemo)((()=>({reloadRelations:P,config:(0,l.pick)(["content","importFromDT","maxDtssImport"],t)})),[P,t]);return(0,ze.I)(t.id),a().createElement(Ve.u.Provider,{value:y},a().createElement(Ue.X.Provider,{value:N},a().createElement(W.Z,{className:n},a().createElement("div",{className:o.container},a().createElement(Ke.Provider,{value:k},a().createElement(it,{title:t.caption,total:E})),a().createElement("div",{className:o.content},a().createElement(vn,{isLoading:O,config:t,loadRelations:P,connections:b,total:E}),E>c&&a().createElement(B.Z,{classes:{root:o.pagination},count:E,rowsPerPageOptions:[],rowsPerPage:c,page:i,onChangePage:s}))))))};En.displayName="RelationsView";const wn=a().createContext(null);wn.displayName="TableAttributeContext";var Sn=n(17569),Cn=n(75975),On=n(79573);function Pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){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 kn="CHANGE_SEARCH_QUERY",Zn=Pn({},Cn.ZP.actions,{changeSearchQuery:(0,On.zD)(kn)}),Rn=(e,t)=>t.type===kn?Pn({},e,{searchQuery:t.payload,page:0}):Cn.ZP.reducer(e,t);var Tn=n(92332),jn=n(25843);function In(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Dn(e,t,n[t])}))}return e}function Dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ln={textDecoration:"line-through",color:"rgba(0,0,0,.54)"},Mn=(0,oe.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:In({padding:"0 4px",marginLeft:"-4px"},h.zXF[h.Y1q.updateAttribute]),insertAttribute:In({},h.zXF[h.Y1q.insertAttribute]),deleteAttribute:In({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":Ln}}))),An=(0,jn.Z)((e=>{const t=Mn(),{description:n}=(null==e?void 0:e.headCellData)||{};return a().createElement("div",{className:t.headCell},a().createElement(Tn.default,e),a().createElement(Y.Z,{description:n,className:t.description}))}));var zn=n(67586),Vn=n(40007);const Un=e=>{let{value:t,historyClassName:n}=e;const r=Mn();return a().createElement("div",{className:r.blobWrapper,onScroll:On.UW},a().createElement("span",{className:r[n]},t))},Hn=e=>{let{value:t,columnData:{dataTypeDefinition:n}}=e;const o=Mn(),{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(Un,{value:i,historyClassName:u});{const e=a().createElement(zn.Z,{value:i,dataTypeDefinition:n});return a().createElement(Vn.Z,{value:e},a().createElement("div",{className:o.defaultWrapper},a().createElement("span",{className:o[u]},e)))}};function Fn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wn=(e,t)=>{const{uri:n,label:r,children: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=>Wn(e,t.concat({name:o}))))})},Bn=(0,l.pipe)((0,l.split)("."),(0,l.slice)(2,1/0)),qn=e=>{if((0,h.vZp)(e)){const t=Bn(e);return t.length>1?t.slice(0,-1):null}return null},_n=(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){Fn(e,t,n[t])}))}return e}({},e,{sortable:!0,resizable:!0,nestedPath:qn(e.id),headCellRenderer:An,rowCellValueRenderer:Hn})));var Gn=n(79575);function $n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yn=n(33903),Xn=n(87825);const Qn=(0,oe.makeStyles)((()=>({header:{padding:"0 12px 0 16px"},rightMenuItems:{display:"flex",flex:"1 0 auto",justifyContent:"flex-end",alignItems:"center"}}))),Kn=e=>{let{title:t}=e;const n=Qn(),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)(wn),g=o&&(null==l?void 0:l.required);return a().createElement(G.Z,{title:t,className:n.header},g&&a().createElement($.Z,null),a().createElement(Y.Z,{description:null==l?void 0:l.description}),a().createElement("div",{className:n.rightMenuItems},a().createElement(J.i,{query:i,onChange:s}),a().createElement(Yn.Z,{enabled:!!c,onClick:u}),a().createElement(Q.Z,{height:24,margin:4}),a().createElement(Xn.Z,{columnsData:p,selectedColumns:d,onChangeColumns:m})))};function Jn(){return Jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jn.apply(this,arguments)}const er=(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=Mn();return a().createElement("div",{className:z()({[i["row-cell--sorted"]]:o,[i["row-cell--removed"]]:r},i.rowCell)},t.values.map(((e,t)=>a().createElement(n,Jn({key:t,value:e},l)))))}));var tr=n(47081),nr=n(45108);const rr=(0,oe.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)"}}}))),ar=e=>{let{onEdit:t,onRemove:n}=e;return a().createElement(a().Fragment,null,t&&a().createElement(Fe.k,{tooltipTitle:y().text("Edit"),icon:ct.Z,size:"L",onClick:t}),n&&a().createElement(Fe.k,{tooltipTitle:y().text("Remove"),icon:ut.Z,size:"L",onClick:n}))};function or(){return or=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},or.apply(this,arguments)}const lr=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))(Bn(e),t))(r,e),t)}),{}),(0,l.assoc)("value",e))(t))))(n,t)),[n,t]),f=(0,r.useMemo)((()=>_n(t)),[t]),b=rr(),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)(wn),P=(0,r.useCallback)((e=>a().createElement(er,or({},e,{isSorted:!!o&&o.field===e.columnData.id}))),[o]),[N,k]=(0,r.useState)(null),{canUpdate:Z,canDelete:R}=(0,tr.l)(),T=(0,r.useMemo)((()=>"number"!=typeof N||!E||m.includes((0,l.pipe)((0,l.path)([N]),(0,l.prop)("uri"))(n))),[N,m,n,E]),j="number"==typeof N&&(I=(0,l.path)([N],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 N&&(e=>Z(u)&&(0,h.yv0)({attributeType:O,mode:y,attributeValue:e,isReltioCrosswalk:(0,h.KVV)(C.crosswalks,e)}))((0,l.path)([N],n)),L=(0,r.useCallback)((()=>{const e=(0,l.path)([N],n);D&&p(e)}),[p,N,n,D]),M=(0,r.useCallback)((()=>{const e=(0,l.path)([N],n);if(!j)return;const t={parentUri:S,attributeType:O,uri:e.uri,value:e};d(t),k(null)}),[N,n,d,j,O,S]),A=T||!j&&!D?void 0:a().createElement(ar,{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(nr.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:k,hoverRowIndex:N,hoveredRowRightContent:A,context:z,classes:{hoveredRowRightContentWrapper:b["row-cell__buttons-wrapper"],hoveredRowRightContentContainer:b["row-cell__buttons-container"]}}))};function ir(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){sr(e,t,n[t])}))}return e}function sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const cr=[],ur=(0,oe.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 pr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dr=e=>{let{onChangeAttribute:t,onCancel:n,onApply:o,onDeleteAttribute:i,hasChanges:s,attributeValue:c}=e;const u=ur(),p=(0,x.useDispatch)(),m=(0,r.useContext)(d.m),{attributeType:g}=(0,r.useContext)(wn),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){pr(e,t,n[t])}))}return e}({},e,{viewId:m}))))),[m,p]),N=(0,r.useCallback)((0,l.pipe)(v.N5.errors.actions.errorDeactivated,p),[p]);return a().createElement(a().Fragment,null,a().createElement(fe.Z,{expanded:!0,attributeValue:c,showEmptyEditors:O,onDeleteAttribute:i,onDeactivateError:N,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(te.Z,{onClick:()=>n(c)},y().text("Cancel")),a().createElement(te.Z,{color:"primary",disabled:!s,onClick:()=>o(c,S),"data-reltio-id":"table-attribute-view-apply-button"},y().text("Apply"))))};var mr=n(98001);const gr=e=>(null==e?void 0:e.type)===h.NIO.missed,fr=(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)))))),hr=(0,oe.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"}}))),br=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=hr(),{attributeType:w}=(0,r.useContext)(wn),S=(0,x.useSelector)(v.ZP.selectors.getMode),{canCreate:C}=(0,tr.l)();(e=>{let{onStartEditing:t,modifiedValues:n,highlightedError:a,highlightedAttributeError:o}=e;const{attributeType:i}=(0,r.useContext)(wn),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,mr.u)(),d=(0,r.useMemo)((()=>c.find((0,l.both)(gr,(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)(fr(n)),(0,l.reject)(l.isNil),(0,l.forEach)(t))(c),u.current=!1)}),[c]),(0,r.useEffect)((()=>{gr(a)&&1===n.length&&t(n[0])}),[a]),(0,r.useEffect)((()=>{if(o){const e=fr(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(te.Z,{color:"primary",onClick:c,className:E.addButton,"data-reltio-id":"table-attribute-view-add-button"},a().createElement(ue.Z,{classes:{root:E.icon}}),a().createElement("div",{className:E.buttonLabel},y().text("Add"))),n.map((e=>a().createElement(dr,{key:e.uri,attributeValue:e,onChangeAttribute:i,onDeleteAttribute:s,onCancel:u,onApply:p,hasChanges:g(e)}))))},yr=(0,he.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)(wn),{onDeleteAttribute:E,onStartEditing:w,onChangeAttribute:S,onAdd:C,onCancel:O,onApply:P,onReset:N,checkHasChanges:k,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)(wn),f=(0,h.KIu)(i),b=(0,h.xy8)(m),y=(0,l.pathOr)(cr,[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]),N=C.filter((t=>{let{uri:r}=t;return r===e||n.find((0,l.propEq)("uri",r))})),k=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.modifyAttribute,o)(ir({},e,{viewId:p}))),[p,o]),Z=(0,r.useCallback)((e=>(0,l.pipe)(v.N5.actions.removeAttribute,o)(ir({},e,{viewId:p}))),[p,o]),R=(0,r.useCallback)((()=>{const e=(0,h.gjI)({parentUri:s,attributeType:m});t(e.uri),k({value:ir({},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,k]),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||k(t)}else{const n={value:e,attributeType:m,uri:e.uri};t(null),Z(n)}o(v.N5.errors.actions.errorsSet([]))}),[Z,k,a,w,n,m,o]),I=(0,r.useCallback)(((e,t)=>{const n=(0,h.q5j)(c,m,e,t).map((n=>ir({},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:k,onDeleteAttribute:Z,onAdd:R,onCancel:j,onApply:D,onStartEditing:T,onReset:L,modifiedValues:O,editingValues:N,deletedUris:P}})(),{ref:j,errorClassName:I}=(0,de.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(br,{config:t,editingValues:R,modifiedValues:Z,onChangeAttribute:S,onDeleteAttribute:E,onAdd:C,onReset:N,onCancel:O,onApply:P,onStartEditing:w,checkHasChanges:k,highlightedError:null==o?void 0:o.element,highlightedAttributeError:null==i?void 0:i.element}),L.length>0&&a().createElement(lr,{columnsData:L,config:t,values:D,filters:f,onFilter:m,sorting:b,onSort:g,onEdit:w,onDeleteAttribute:E,deletedUris:T}))})),vr=(0,oe.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"}}))),xr=15,Er=e=>{let{config:t,className:n}=e;const{caption:o,max:l=xr}=t,i=vr(),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)(wn);return a().createElement(W.Z,{className:z()(i.root,n)},p?a().createElement(a().Fragment,null,a().createElement(Kn,{title:o}),a().createElement("div",{className:i.content},a().createElement(yr,{config:t,attributeType:u,entityUri:s}),d&&a().createElement(B.Z,{count:c,rowsPerPageOptions:[],rowsPerPage:l,page:g,onChangePage:f}),m&&a().createElement(D.Z,null))):a().createElement(a().Fragment,null,a().createElement(G.Z,{title:o,className:i.header},a().createElement(Y.Z,{description:null==u?void 0:u.description})),a().createElement(_.Z,{className:i.noData},y().text("No data"))))};var wr=n(37163);function Sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Cr=0;const Or=()=>Cr++,Pr=e=>{const t={children:[],nodeId:Or()};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:Or(),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 kr=(0,oe.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 Zr=n(1242);const Rr=a().createContext(null),Tr=e=>{e.target.src=Zr},jr=e=>{let{node:t}=e;const{entity:{uri:n},nodeId:o}=t,l=(0,h.idV)(t.entity.label),i=kr(),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)(Rr),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(nn.Z,{alt:"Node icon",className:z()(i.avatar),src:y||Zr,onError:Tr}),a().createElement(Nr.Z,{isSelected:g,title:l,entityUri:n,viewId:m.id,anchorEl:p})))},Ir=((0,r.memo)(jr),e=>{let{node:t}=e;return t.nodeId}),Dr=(0,oe.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% - ${zr.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:zr.rowHeight/2+"px",position:"absolute",backgroundColor:"rgba(0,122,193,0.3)"},horizontalLineRight:{height:"1px",top:zr.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 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)}function Mr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ar(){return Ar=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},Ar.apply(this,arguments)}const zr={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=Dr();return a().createElement("div",Ar({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:z()(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=Dr(),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){Mr(e,t,n[t])}))}return e}({},s.style,{width:f}),b=(null==i?void 0:i.rootIndex)>99&&i.root;return a().createElement("div",Lr({},s,{className:z()(c.node,{[c.longRootNode]:b,[c.rootNode]:i.root&&!b}),style:h}),p,a().createElement("div",{className:z()(c.nodeContent,{[c.nodeRootLongContent]:b}),style:g},n))},scaffoldBlockPxWidth:16,rowHeight:28,slideRegionSize:50};function Vr(){return Vr=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},Vr.apply(this,arguments)}const Ur=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",Vr({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"})))},Hr=e=>{let{title:t,onGraphOpen:n}=e;const o=kr(),{showNavigateToGraph:l}=(0,r.useContext)(O.Y);return a().createElement(G.Z,{title:t,className:o.header},l&&a().createElement("div",{className:o.buttonsContainer},a().createElement(Fe.k,{className:o.button,tooltipTitle:y().text("Show Graph"),icon:Ur,onClick:n,size:"L"})))},Fr=e=>Ir({node:e});function Wr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Br=[10,25];var qr=n(52241),_r=n(69089);const Gr=(0,oe.makeStyles)((()=>({root:{position:"relative"},bodyWrapper:{paddingTop:"21px"}})));function $r(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){Yr(e,t,n[t])}))}return e}function Yr(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,qr.E)(t),y=Gr(),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(_r.Z,{ref:i,open:!!b}),a().createElement(gt.Z,{title:v||""},a().createElement("div",{ref:o,style:$r({},x,h),className:z()(y.root,n)}))):null};var Qr=n(7882);const Kr=e=>{const t=t=>a().createElement(Qr.Z,{error:a().createElement(N.ZP,{LogoRenderer:N.B9.ERROR,text:"",secondaryText:y().text("Something went wrong"),variant:N.tC.small})},a().createElement(e,t));return t.displayName="WithErrorBoundary",t},Jr=(0,oe.makeStyles)({stubView:{padding:"20px"},fullHeight:{height:"100%"},component:{boxSizing:"border-box",overflow:"auto",boxShadow:"none",borderRadius:"unset"}});var ea=n(25744),ta=n(63436),na=n(40702),ra=n(40435);const aa=(0,l.pipe)((0,l.path)(["point","lat"]),(0,l.both)((0,l.gt)(90),(0,l.lt)(-90))),oa=(0,oe.makeStyles)((()=>({root:{height:"100%",display:"flex",flexDirection:"column"},fullHeight:{height:"100%"},fullscreenBtn:{position:"absolute",right:"5px",top:"5px",zIndex:100}})));var la=n(61347),ia=n(66078);const sa=(0,oe.makeStyles)((e=>({caption:{color:e.palette.text.secondary,fontSize:"13px"}}))),ca=sa,ua=e=>{let{totalImages:t}=e;const n=ca(),r=t>1?y().text("photos"):y().text("photo");return a().createElement(_.Z,{variant:"caption",className:n.caption},`${t} ${r}`)};function pa(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){da(e,t,n[t])}))}return e}function da(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ma=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(ia.Z,{attributeValues:u,attributeType:n,onDeleteAttribute:e=>(0,l.pipe)(v.N5.actions.removeAttribute,i)(pa({},e,{viewId:p})),parentUri:c.uri,onChangeAttribute:e=>(0,l.pipe)(v.N5.actions.modifyAttribute,i)(pa({},e,{viewId:p})),imageSize:ha,paging:r,requestNextPageOfAttributeValues:o}),a().createElement(ua,{totalImages:u.length}))},ga=(0,oe.makeStyles)((e=>({container:{padding:"8px 16px"},noData:{fontSize:"13px",color:e.palette.text.secondary}}))),fa=ga,ha={imageMargin:4,imageWidth:162,imageHeight:162};var ba=n(55485),ya=n(23044),va=n(20200),xa=n(25601),Ea=n(84236),wa=n(48376);function Sa(){return Sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sa.apply(this,arguments)}const Ca=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:xa.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(Ea.H,Sa({},g,{onFinishRequest:b})),p&&a().createElement(wa.i,Sa({},g,{onFinishRequest:l})))},Oa=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(va.M,{match:r,entity:s,entitiesMap:n,metadata:i,className:Mt.U},a().createElement(At.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(Ca,{match:r,config:t,onStartRequest:l,onFinishRequest:o}))},Pa=(0,oe.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},ka={order:h.KM9.asc,field:"score"};var Za;!function(e){e[e.Loading=0]="Loading",e[e.NoData=1]="NoData",e[e.Loaded=2]="Loaded"}(Za||(Za={}));const Ra=e=>(0,l.pipe)(Kr,V.Z)(e),Ta=Ra((e=>{let{className:t}=e;const n=Jr();return a().createElement(W.Z,{className:z()(n.stubView,"viewDraggableHandle",t)},"NOT IMPLEMENTED")})),ja=Ra((e=>{let{className:t,config:n}=e;return a().createElement(U.Z,{className:t,caption:n.caption,excludeUris:n.excludeUris,includeUris:n.includeUris,attributesCount:n.attributesCount,pinnedAttributes:n.pinnedAttributes})})),Ia=Ra((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=Le(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){Me(e,t,n[t])}))}return e}({setSearchQuery:n,searchQuery:t,setPage:o,page:a,toggleShowInactive:u,showInactive:l},c)})(n);return a().createElement(H.Provider,{value:o},a().createElement(Te,{config:n,className:t}))})),Da=Ra((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=>Wn(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)(Rn,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,Gn.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,Sn.o)({actions:Zn,dispatch:u}),N=Le(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){$n(e,t,n[t])}))}return e}({},c,{setSearchQuery:E,setPage:w,onSort:S,onFilter:C,onToggleFilters:O,onChangeColumns:P,showTable:Boolean(((null==N||null===(t=N.values)||void 0===t?void 0:t.length)||b||p||f)&&o&&!o.hidden),allColumnsData:i},N)})(t);return a().createElement(wn.Provider,{value:o},t&&a().createElement(Er,{config:t,className:n}))})),La=Ra((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(qe.Provider,{value:s},a().createElement(En,{config:i,className:n}))})),Ma=Ra(Xr),Aa=Ra((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=kr(),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:N,page:k}=((e,t)=>{const n=(0,je._)(),[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,Ie.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){Sr(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(Pr).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[Fr(e)]!==r?(0,l.assoc)(Fr(e),r,t):t))}),[]),getRowHeight:(0,r.useCallback)((t=>{let{node:n}=t;return e[Fr(n)]?Math.max(e[Fr(n)],zr.rowHeight):zr.rowHeight}),[e]),clearHeightsCache:n}})(),j=(0,r.useContext)(O.Y),I=void 0!==u?u:j.showNavigateToGraph,L=(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){Wr(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(jr,{node:e.node}))})),[Z]);return(0,r.useEffect)((()=>{T()}),[T,g]),a().createElement(O.Y.Provider,{value:L},a().createElement(W.Z,{className:n},a().createElement(Hr,{onGraphOpen:M,title:i}),w&&a().createElement(D.Z,{className:d.linearIndicator}),a().createElement(Rr.Provider,{value:t},a().createElement("div",{className:d.treeContainer},a().createElement("div",{className:d.tree},E?a().createElement(_.Z,{className:d.errorMessage},E):a().createElement(a().Fragment,null,a().createElement(wr.ZP,{isVirtualized:!1,treeData:f,canDrag:!1,theme:zr,generateNodeProps:A,onChange:b,getNodeKey:Ir,rowHeight:R})))),C>Br[1]?a().createElement(B.Z,{classes:{root:d.hidePageSelectorWhenSmall},count:C,onChangePage:P,page:k,rowsPerPage:S,onChangeRowsPerPage:N,rowsPerPageOptions:Br,labelRowsPerPage:y().text("Roots per page:")}):null)))})),za=Ra((e=>{let{config:t,className:n}=e;const o=Pa(),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,ya.s)({enabled:!!s,entity:i,options:Na,filter:"",page:0,sorting:ka,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:N}=(0,r.useContext)(S.h);(0,r.useEffect)((()=>{N(P)}),[N,P]);const k=!(0,l.isEmpty)(g),Z=c?Za.Loading:(0,l.isEmpty)(g)?Za.NoData:Za.Loaded;return a().createElement(Ue.X.Provider,{value:f},a().createElement(W.Z,{className:z()(o.root,n)},a().createElement(G.Z,{title:t.caption}),a().createElement("div",{className:o.matchesContainer},Z===Za.Loading&&a().createElement(D.Z,null),Z===Za.NoData&&a().createElement(_.Z,{className:o.noData},y().text("No matches found")),Z===Za.Loaded&&g.map((e=>a().createElement(Oa,{config:t,entitiesMap:f,match:e,onFinishRequest:E,onStartRequest:p,key:e.object.uri})))),k&&a().createElement(a().Fragment,null,a().createElement("div",{className:o.footer},a().createElement(ba.Z,{component:"button",variant:"caption",onClick:O,underline:"none"},y().text("See all"))))))})),Va=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,91572)).then((e=>({default:Ra(e.HierarchyTreeView)}))))),Ua=(0,r.lazy)((()=>Promise.resolve().then(n.bind(n,51317)).then((e=>({default:Ra(e.RelationshipsTableView)}))))),Ha=Ra((e=>{let{config:t,isFullscreen:n,onToggleFullscreen:o,className:l}=e;const i=oa(),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,je._)();return(0,r.useEffect)((()=>{i(!0),s((0,h.DBr)(t,[e],n)).then((e=>{o(e.filter(aa))})).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(D.Z,null))),[i]),g=(0,r.useMemo)((()=>({lat:0,lng:0})),[]),f=(0,r.useMemo)((()=>({mapTypeControl:!0})),[]);return u&&a().createElement(W.Z,{className:z()(i.root,l)},d&&a().createElement(D.Z,null),a().createElement(ra.Z,{size:"S",icon:n?ta.Z:ea.Z,onClick:()=>o(t.id),className:i.fullscreenBtn}),a().createElement(na.Z,{loadingElement:m,defaultZoom:1,defaultCenter:g,markers:p,mapContainerClassName:i.fullHeight,mapKey:u,mapOptions:f}))})),Fa=Ra((e=>{let{config:t,className:n}=e;const{attributeUri:o}=t,i=fa(),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(W.Z,{className:n},a().createElement(G.Z,{title:t.caption},a().createElement(Y.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(ma,e)}if(r>0){const t={attributeValues:e,attributeType:d,imageSize:ha,paging:n,parentUri:u.uri,requestNextPageOfAttributeValues:g};return a().createElement(a().Fragment,null,a().createElement(la.Z,t),a().createElement(ua,{totalImages:r}))}}return a().createElement(_.Z,{className:i.noData},m)})()))}));class Wa{}Wa.ViewTypes=h.ZIY,Wa.getComponentBy=(e,t)=>{let{config:n,className:r,isFullscreen:o,onToggleFullscreen:l}=t;switch(n[e]){case Wa.ViewTypes.HierarchyTree:return a().createElement(Va,{config:n,className:r});case Wa.ViewTypes.HierarchyPaths:return a().createElement(Aa,{config:n,className:r});case Wa.ViewTypes.RelationsTable:return a().createElement(Ua,{config:n,className:r});case Wa.ViewTypes.Relations:return a().createElement(La,{config:n,className:r});case Wa.ViewTypes.Attributes:return a().createElement(ja,{className:r,config:n});case Wa.ViewTypes.SingleAttribute:return a().createElement(Ia,{config:n,className:r});case Wa.ViewTypes.AttributeTable:return a().createElement(Da,{config:n,className:r});case Wa.ViewTypes.Map:return a().createElement(Ha,{config:n,isFullscreen:o,onToggleFullscreen:l,className:r});case Wa.ViewTypes.Custom:return a().createElement(Ma,{config:n,className:r});case Wa.ViewTypes.ImageAttribute:return a().createElement(Fa,{config:n,className:r});case Wa.ViewTypes.PotentialMatches:return a().createElement(za,{config:n,className:r})}},Wa.getComponent=e=>Wa.getComponentBy("class",e)||Wa.getComponentBy("react-class",e)||a().createElement(Ta,{className:e.className});const Ba=Wa,qa=()=>null,_a=(0,r.memo)((e=>{let{config:t,isFullscreen:n,isAutosize:o,onToggleFullscreen:l}=e;const i=Jr();return a().createElement(r.Suspense,{fallback:a().createElement(qa,null)},Ba.getComponent({config:t,className:z()(i.component,{[i.fullHeight]:!o}),isFullscreen:n,onToggleFullscreen:l}))}));_a.displayName="ViewComponent";const Ga=(0,oe.makeStyles)((e=>({item:e.basicView,fixedSizeContainer:{height:"100%"},overflowContainer:{width:"100%",height:"100%",overflow:"hidden"}})));function $a(){return $a=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},$a.apply(this,arguments)}const Ya=["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=Ga(),f=(0,x.useSelector)(v.ZP.selectors.getGoogleMapKey);if(!m)return null;const b=m.class===Ba.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===Ba.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",$a({},(0,l.omit)(Ya,d),{"data-reltio-id":m.id,"data-reltio-class":y||"",style:s,className:z()(o,{[g.item]:!b,customView:b})}),a().createElement("div",{className:g.overflowContainer},a().createElement("div",{"data-reltio-id":"profile-view-container",className:z()({[g.fixedSizeContainer]:!p})},p,a().createElement(_a,{config:m,isFullscreen:c,onToggleFullscreen:u,isAutosize:Boolean(p)})),i))},Qa=1024,Ka=(0,oe.makeStyles)({scrollWrapper:{flexGrow:1,overflow:"auto"},scrollableContent:e=>{let{maxWidth:t,minWidth:n=Qa,scrollbarWidth:r}=e;return{minWidth:t&&t<n?t-r:n,height:"100%"}}}),Ja=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=Ka({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(L.p.Provider,{value:f},a().createElement(M.Z,{LayoutItem:Xa,views:t,layout:n,onLayoutChanged:c,draggableHandle:".viewDraggableHandle",isStatic:o}))))};var eo=n(10050),to=n(83820),no=n(92679);const ro=(0,oe.makeStyles)((()=>({closeIcon:{paddingRight:"12px",boxSizing:"content-box","& path":{fill:"#fff"}},snackbar:{"& > div":{flexWrap:"nowrap",alignItems:"baseline"}}}))),ao=e=>{let{notification:t}=e;const n=ro({}),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(te.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(ra.Z,{className:n.closeIcon,size:"S",icon:no.default,onClick:d}),t.text);return a().createElement(a().Fragment,null,a().createElement(to.Z,{container:document.body},a().createElement(eo.Z,{autoHideDuration:i,open:u,classes:{root:n.snackbar},action:f,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"center"},message:h})),a().createElement(rt.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")}))},oo=()=>{const e=(0,x.useSelector)(v.ZP.selectors.getNotifications);return e?a().createElement(a().Fragment,null,e.slice(-1).map((e=>a().createElement(ao,{key:e.id,notification:e})))):null};var lo=n(15328),io=n(26436),so=n(70369),co=n(50985),uo=n(79386),po=n(75647),mo=n(76368),go=n(36777),fo=n(97287);function ho(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){bo(e,t,n[t])}))}return e}function bo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yo(){return yo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yo.apply(this,arguments)}const vo=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",yo({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 xo(){return xo=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},xo.apply(this,arguments)}const Eo=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",xo({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"})))},wo=(0,oe.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)"}}),So=e=>a().createElement(lo.Z,e,a().createElement(vo,null)),Co=e=>a().createElement(lo.Z,e,a().createElement(Eo,null)),Oo=(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)})),Po=e=>{let{className:t,profileBandConfig:n,menuItems:o,showMenu:i=!0}=e;const s=wo(),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,N=S===h.OXy.Cloning||P,[k,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:ho({},(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:so.Z,permission:"UPDATE"},{label:y().text("Suggesting"),value:h.fO_.SUGGESTING,description:y().text("Suggest changes and initiate a workflow review"),icon:So,permission:"INITIATE_CHANGE_REQUEST"},{label:y().text("Viewing"),value:h.fO_.VIEWING,description:y().text("Read or print profile"),icon:io.Z,permission:"READ"}]),[]),I=(0,r.useMemo)((()=>[...T?[{label:y().text("Clone"),value:"Clone",description:y().text("Create a copy of the profile"),icon:Co,onClick:()=>Z(!0),permission:"CREATE"}]:[],{label:y().text("Delete"),value:"Delete",description:y().text("Permanently delete profile"),icon:ut.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)((()=>Oo(j,O,L,g,u)),[j,O,g,u,L]),A=(0,r.useMemo)((()=>Oo(I,O,L,g,u)),[I,O,g,u,L]),V=(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(uo.Z,{className:z()(t,Mt.U),entity:b&&d?d:p},a().createElement(q.Z,{display:"flex",alignItems:"center"},a().createElement(q.Z,{mr:3},b&&a().createElement(q.Z,{className:s.editingButtons},a().createElement(te.Z,{variant:"outlined",className:s.cancelButton,onClick:U,"data-reltio-id":"reltio-profile-cancel-editing",disabled:N},y().text("Cancel")),a().createElement(te.Z,{variant:"contained",color:"primary","data-reltio-id":"reltio-profile-save-profile",onClick:H,disabled:N},(0,h.fnZ)(f)?y().text("Suggest"):y().text("Save"))),w&&E?a().createElement(po.Z,null):E&&a().createElement(mo.a,null)),D&&a().createElement(go.T,{optionsGroup:M,buttonsGroup:A,value:f,onChange:V,disabled:N}),i&&a().createElement(Qe.Z,{menuId:"profile-header-menu",buttonComponent:ra.Z,buttonProps:{icon:co.Z,size:"L","data-reltio-id":"reltio-profile-header-menu",className:s.menuButton},menuItems:o,MenuItemRenderer:fo.Z})),a().createElement(q.Z,{className:s.comments},a().createElement(At.Z,{uri:p.uri,relatedObjectUris:(0,h.wp9)(h.q7e.ENTITY,{entityUri:p.uri}),objectType:h.q7e.ENTITY}))),!!T&&a().createElement(rt.Z,{open:k,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),ko=n(11821),Zo=n(98273);const Ro=(0,oe.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 To(){return To=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},To.apply(this,arguments)}let jo;!function(e){e[e.Workflow=0]="Workflow",e[e.Collaboration=1]="Collaboration",e[e.History=2]="History",e[e.DBConnector=3]="DBConnector"}(jo||(jo={}));const Io=e=>{let{active:t,tabs:n,onClose:o}=e;const i=Ro(),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(ko.h,{open:s},!p&&a().createElement(a().Fragment,null,a().createElement(Zo.P,To({},u,{onClose:o})),c)))};var Do=n(69409),Lo=n(7108),Mo=n(37778),Ao=n(32158),zo=n(95085),Vo=n(70675),Uo=n(13510);const Ho=(0,oe.makeStyles)({wrapper:{display:"flex",flexDirection:"column"},itemWrapper:{paddingLeft:"19px",paddingRight:"19px"}}),Fo=()=>{const e=Ho(),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 Wo=n(36592);const Bo=()=>{const{total:e}=(0,r.useContext)(R.O),t=Ro();return a().createElement(at.Z,{badgeContent:e,classes:{anchorOriginTopRightRectangular:t.badgePosition,badge:t.badge}},a().createElement(Wo.Z,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:"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"})))))},Go=()=>{const{commentsMap:e}=(0,r.useContext)(S.h),t=Ro();return a().createElement(at.Z,{badgeContent:(0,h.mdt)(e),classes:{anchorOriginTopRightRectangular:t.badgePosition,badge:t.badge}},a().createElement(_o,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 Yo=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:"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 Qo=(0,oe.makeStyles)({wrapper:{overflow:"auto",position:"relative",height:"100%"}}),Ko=()=>{const e=Qo(),{tasks:t,loading:n}=(0,r.useContext)(R.O);return a().createElement("div",{className:e.wrapper},n&&a().createElement(D.Z,null),t&&t.map((e=>a().createElement(Xo.s,{key:e.taskId,task:e}))))};var Jo=n(15422);const el=()=>a().createElement(Jo.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 tl=n(86868),nl=n(89925),rl=n(85101);const al=(0,oe.makeStyles)({wrapper:{overflow:"auto",paddingRight:"12px"},showMoreLink:{display:"flex",margin:"16px"},showMoreIcon:{fontSize:"1rem"}}),ol=()=>{const e=al(),{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,tl.Q)(n);return a().createElement(Ue.X.Provider,{value:i},a().createElement(q.Z,{className:e.wrapper},n.map((e=>{const{objectId:t,relatedObjectUris:n,objectType:r,commentId:o}=e;return a().createElement(nl.J,{key:o,uri:t,relatedObjectUris:n,objectType:r,comment:e})})),o&&a().createElement(ba.Z,{component:"button",variant:"caption",className:e.showMoreLink,onClick:()=>{t(l,o)},underline:"none"},a().createElement(rl.Z,{className:e.showMoreIcon}),y().text("Show more"))))},ll=()=>a().createElement(Jo.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.")}),il=e=>{if(e)return 1===e?y().text("${total} item",{total:e}):y().text("${total} items",{total:e})},sl=(0,oe.makeStyles)((()=>({profileContainer:{display:"flex",overflow:"hidden",flexGrow:1}}))),cl=(0,r.memo)((e=>{let{perspectiveId:t,commentId:n,hideHistory:o,children:i}=e;const s=sl(),{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?jo.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,Do.C)({perspectiveId:o,entity:g,historyButtonId:jo.History}),{historyFilter:C,onApplyFilter:O,isLoading:P,historicUris:N,historyWithTotal:k,canLoadMore:Z,onLoadMore:T}=(0,Lo.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:jo.Workflow,icon:Bo,tooltipTitle:y().text("Workflow")},content:null!=f&&f.total?a().createElement(Ko,null):a().createElement(el,null),headerProps:{mainTitle:y().text("Workflow"),secondTitle:il(null==f?void 0:f.total),rightContent:a().createElement(Mo.G,null)},hidden:!j},{buttonProps:{id:jo.Collaboration,icon:Go,tooltipTitle:y().text("Collaboration")},content:D?a().createElement(ol,null):a().createElement(ll,null),headerProps:{mainTitle:y().text("Collaboration"),secondTitle:il(D)},hidden:!I},{buttonProps:{id:jo.History,icon:Uo.Z,tooltipTitle:y().text("History")},content:w?a().createElement(Ao.Z,{isLoading:P,historyWithTotal:k,contributorsUris:N,entityUri:null==g?void 0:g.uri,historyEvent:d,onLoadMore:T,canLoadMore:Z}):a().createElement(zo.Z,null),headerProps:{content:a().createElement(Vo.Z,{total:w?((null==N?void 0:N.length)||0)+1:void 0,entityType:(0,h.nt9)(m,null==g?void 0:g.type),filter:C,onApplyFilter:O})},hidden:n},{buttonProps:{id:jo.DBConnector,icon:Yo,tooltipTitle:y().text("D&B Connector")},content:a().createElement(Fo,null),headerProps:{mainTitle:y().text("D&B Connector")},hidden:!c}]),[null==f?void 0:f.total,j,D,I,w,P,k,N,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(Io,{tabs:u})))}));cl.displayName="ProfilePerspectiveView";var ul=n(35296),pl=n(85321);const dl="48px",ml="1px solid rgba(0, 0, 0, .125)",gl=(0,oe.makeStyles)((e=>({accordion:{borderTop:ml,borderBottom:ml,fontSize:"13px",boxShadow:"none","&:not(:first-child)":{borderTop:0},"&:before":{display:"none"},"&$accordionExpanded":{margin:"auto"}},accordionExpanded:{},accordionSummary:{display:"flex",alignItems:"center",height:dl,minHeight:dl,"&$accordionSummaryExpanded":{height:dl,minHeight:dl}},accordionSummaryHeading:{flex:1,fontSize:e.typography.pxToRem(13),fontWeight:e.typography.fontWeightRegular},accordionSummaryExpanded:{},accordionSummaryContent:{display:"flex",alignItems:"center"},accordionDetails:{maxHeight:"21vh",overflow:"auto",paddingTop:0,paddingBottom:0,"& ul":{paddingLeft:"23px",marginTop:"3px"},"& li":{paddingLeft:"9px",paddingBottom:"8px"}},parents:{color:e.palette.text.primary},errorWrapper:{lineHeight:"18px",display:"flex",flexDirection:"column"},errorTitle:{display:"flex",alignItems:"center"},attributeTypesPath:{color:e.palette.text.secondary},goToIcon:{marginLeft:"4px"},errorsAccordion:{backgroundColor:"#FFF4F6",borderColor:"#FFB8B3"},errorsAccordionDetails:{color:"#DD2C00"},warningsAccordion:{backgroundColor:"#FFF9ED",borderColor:"#FFDD91"},warningsAccordionDetails:{color:"#CC7500"},icon:{marginRight:"8px"},errorIcon:{fill:"#FF1744"},warningIcon:{fill:"#F9A825"}}))),fl=gl;var hl=n(37453),bl=n(53711),yl=n(6341),vl=n(63655);const xl=(0,r.memo)((e=>{let{panels:t,expandedPanelId:n,onToggle:r,ErrorComponent:o}=e;const l=fl();return t.length>0?a().createElement("div",null,t.map((e=>{let{id:t,icon:i,title:s,items:c,accordionClassName:u,accordionDetailsClassName:p}=e;return a().createElement(hl.Z,{key:t,square:!0,expanded:n===t,onChange:r(t),className:u,classes:{root:l.accordion,expanded:l.accordionExpanded}},a().createElement(bl.Z,{classes:{root:l.accordionSummary,expanded:l.accordionSummaryExpanded,content:l.accordionSummaryContent},expandIcon:a().createElement(vl.Z,null)},i,a().createElement(_.Z,{className:l.accordionSummaryHeading},s)),a().createElement(yl.Z,{className:z()(l.accordionDetails,p)},a().createElement("ul",null,c.map(((e,t)=>a().createElement(o,{key:t,error:e}))))))}))):null}));function El(){return El=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},El.apply(this,arguments)}xl.displayName="ErrorsPanel";const wl=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",El({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),a().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.245 12.75c0 .825-.467 1.5-1.045 1.5H4.8c-.583 0-1.05-.675-1.05-1.5v-7.5c0-.832.467-1.5 1.05-1.5h8.4c.578 0 1.05.668 1.05 1.5l-.005 7.5zM9.75 9.96v1.642l3-2.805L9.75 6v1.598c-2.918.404-4.08 2.4-4.5 4.402 1.043-1.402 2.415-2.04 4.5-2.04z",fill:"#000",fillOpacity:".54"}))},Sl=(0,l.omit)(["deactivated","path"]),Cl=(0,r.memo)((e=>{let{error:t}=e;const n=fl(),o=(0,x.useSelector)(v.ZP.selectors.getMetadata),i=(0,x.useSelector)(v.ZP.selectors.getIsEditableMode),s=((e,t)=>{let{type:n,source:r,message:a,attributeTypeUri:o="",attributeType:l}=t;if(n===h.NIO.missed&&r===h.zHr.local){const t=l||(0,h.zeJ)(e,o);return t?y().text("${attribute} is required",{attribute:t.label}):a}return a})(o,t),c=(e=>{let{path:t,uri:n}=e;return null==t?void 0:t.slice(0,n?t.length-1:t.length).filter((e=>{let{type:t}=e;return[h.HAc.attributeValue,h.HAc.relationConnection].includes(t)})).map((e=>{let{label:t}=e;return t})).filter(l.identity).join(" / ")})(t),u=(e=>{let{path:t}=e;return null==t?void 0:t.filter((e=>{let{type:t}=e;return t===h.HAc.attributeValue})).map((0,l.either)((0,l.path)(["valueType","label"]),(0,l.path)(["valueType","name"]))).filter(l.identity).join(" > ")})(t),{highlightError:p}=(0,r.useContext)(I.NY),d=t.uri||t.parentUri&&t.attributeTypeUri;return a().createElement("li",null,a().createElement("div",{className:n.errorWrapper},u&&a().createElement("span",{className:n.attributeTypesPath},u),a().createElement("span",{className:n.errorTitle},s,d&&i&&a().createElement(Fe.k,{icon:wl,size:"XXS",onClick:()=>p(t),tooltipTitle:y().text("Go to error"),className:n.goToIcon})),c&&a().createElement("span",{className:n.parents},c)))}));Cl.displayName="Error";const Ol=()=>{const e=fl(),t=(e=>{const t=(0,r.useRef)(e);return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&(0,l.equals)(e.map(Sl),t.map(Sl))}(e,t.current)||(t.current=e),t.current})((0,x.useSelector)(v.ZP.selectors.getProfileErrors)),[n,o]=(0,r.useMemo)((()=>(0,l.partition)(h.IT0,t)),[t]),[i,s]=(0,r.useState)(null),c=(0,r.useMemo)((()=>[{id:"errors",title:y().text("${number} ${errors}",{number:n.length,errors:1===n.length?y().text("error"):y().text("errors")}),icon:a().createElement(ul.Z,{className:z()(e.icon,e.errorIcon)}),items:n,accordionClassName:e.errorsAccordion,accordionDetailsClassName:e.errorsAccordionDetails},{id:"warnings",title:y().text("${number} ${warnings}",{number:o.length,warnings:1===o.length?y().text("warning"):y().text("warnings")}),icon:a().createElement(pl.Z,{className:z()(e.icon,e.warningIcon)}),items:o,accordionClassName:e.warningsAccordion,accordionDetailsClassName:e.warningsAccordionDetails}].filter((e=>{let{items:t}=e;return t.length>0}))),[n,o,e]);(0,r.useEffect)((()=>{s("errors")}),[n]);const u=(0,r.useCallback)((e=>(t,n)=>{s(n?e:null)}),[]);return c.length>0?a().createElement(xl,{panels:c,expandedPanelId:i,onToggle:u,ErrorComponent:Cl}):null};var Pl=n(3096),Nl=n.n(Pl),kl=n(28220);function Zl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Rl={};var Tl=n(27938),jl=n(54064);function Il(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Dl=n(43589),Ll=n(944);const Ml=(0,oe.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"}}))),Al=Ml;let zl;!function(e){e.loading="loading",e.success="success",e.error="error"}(zl||(zl={}));const Vl=e=>{let{onClose:t}=e;const n=Al();return a().createElement(Fe.k,{tooltipTitle:y().text("Close"),onClick:t,size:"S",className:n.closeIcon,icon:no.default})},Ul=e=>{let{onClose:t}=e;const n=Al();return a().createElement("div",{className:z()(n.wrapper,n.loadingWrapper)},a().createElement(Vl,{onClose:t}),a().createElement(Bt.Z,{className:z()(n.indicatorIcon)}),a().createElement(_.Z,null,y().text("Loading background process...")))},Hl=e=>{let{label:t,onClose:n,onRefresh:r}=e;const o=Al();return a().createElement("div",{className:z()(o.wrapper,o.successWrapper)},a().createElement(Vl,{onClose:n}),a().createElement(Dl.Z,{className:z()(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."))))},Fl=e=>{let{onClose:t}=e;const n=Al();return a().createElement("div",{className:z()(n.wrapper,n.errorWrapper)},a().createElement(Vl,{onClose:t}),a().createElement(Ll.Z,{className:z()(n.indicatorIcon)}),a().createElement(_.Z,null,y().text("UI attempted to check for updates but no update received in the last 30 seconds. Try refreshing the page manually.")))},Wl=e=>{let{label:t,onClose:n,onRefresh:r,status:o}=e;switch(o){case zl.loading:return a().createElement(Ul,{onClose:n});case zl.success:return a().createElement(Hl,{label:t,onClose:n,onRefresh:r});case zl.error:return a().createElement(Fl,{onClose:n});default:return null}},Bl=(e,t)=>((e,t)=>"*"===(null==e?void 0:e[0])||!(0,l.isNil)(e)&&e.includes(t))(e,t),ql=(0,oe.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 _l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Gl=(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=ql({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),L=(null===(t=(0,x.useSelector)(v.ZP.selectors.getSearchKeyword))||void 0===t?void 0:t.value)||"",M=(0,x.useSelector)(v.ZP.selectors.getMode),A=(0,x.useDispatch)(),z=(0,E.u)(),V=(e=>{const t=(0,Tl.v)(e),n=(0,jl.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){Il(e,t,n[t])}))}return e}({},t,{onActionSuccess:n})),[t,n])})(u),{isLoading:U}=(0,w.M)(),{type:H,uri:F,updatedTime:W}=g||{},{onRefreshProfile:B,onCloseBackgroundProcessIndicator:q,cancelUpdateProcess:_,isOpenBackgroundProcessIndicator:G,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=Bl(i,n),c=Bl(l,n),u=(0,r.useRef)(null),p=(0,je._)(),m=(0,mr.u)(),g=(0,r.useContext)(d.m),[f,b]=(0,r.useState)(!1),[y,E]=(0,r.useState)(zl.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(zl.success),c?S():b(!0),e=-1)})).catch((()=>{})).finally((()=>{e<0||(e?(e-=1,u.current=setTimeout(P,w,e)):(E(zl.error),b(!0)))}))}),[a,t,c,S,p,w]),N=(0,r.useCallback)((()=>{s&&(E(zl.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&&N()}));return()=>{e()}}),[m,p,N]),{onRefreshProfile:S,onCloseBackgroundProcessIndicator:C,cancelUpdateProcess:O,isOpenBackgroundProcessIndicator:f,backgroundUpdateStatus:y}})({entityUri:F,entityTypeUri:H,entityUpdatedTime:W}),Y=(0,r.useMemo)((()=>(0,h.dvH)(g)),[g]),X=(0,r.useContext)(S.h),Q=(0,C.C)({objectIds:Y}),K=(0,r.useContext)(O.Y),J=(0,x.useSelector)(v.ZP.selectors.getShowAttributeDescription),ee=(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){_l(e,t,n[t])}))}return e}({},K,{showDescription:J})),[K,J]),{views:te,layout:ne,isLoaded:re,onLayoutReset:ae,onResetUndo:oe,handleLayoutChange:le}=(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,tr.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){Zl(e,t,n[t])}))}return e}({},t,{views:e,layout:n})}),[t,u]),d=(0,r.useMemo)((()=>Nl()(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=Rl,updateSavedState:x}=(0,kl.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:H,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)((()=>{A(v.N5.views.actions.profileViewsSet(te))}),[A,te]),(0,r.useEffect)((()=>{n.sidePanelViews&&A(v.N5.sidePanelViews.actions.sidePanelViewsLoaded(n.sidePanelViews))}),[n]),(0,r.useEffect)((()=>()=>_()),[F,M]);const ie=M===h.ARY.Viewing&&(0,h.ZiX)(F),se=e=>a().createElement("div",{className:m.emptyState},a().createElement(N.ZP,{LogoRenderer:N.B9.NO_DATA,text:e,variant:N.tC.embedded})),{SnackbarRenderer:ce,resetLayout:ue}=(0,k.w)({onLayoutReset:ae,onResetUndo:oe}),pe=(0,r.useMemo)((()=>[{primary:y().text("Reset layout"),secondary:y().text("Restore the default layout without saving any changes"),onClick:ue}]),[ue]);return a().createElement(O.Y.Provider,{value:ee},a().createElement(Z.j.Provider,{value:!0},a().createElement(S.e,{collaboration:b?X:Q},a().createElement(R.O.Provider,{value:V},a().createElement(T.m.Provider,{value:z},a().createElement(j.l.Provider,{value:L},a().createElement(I.fy,null,a().createElement("div",{className:m.perspectiveView},re&&F?a().createElement(cl,{commentId:i,perspectiveId:"profile"},a().createElement("div",{className:m.profileWrapper},a().createElement(Po,{profileBandConfig:c,showMenu:!p,menuItems:pe}),U?se(y().text("Loading")):a().createElement(a().Fragment,null,G&&a().createElement(Wl,{label:g.label,onClose:q,onRefresh:B,status:$}),!b&&a().createElement(Ol,null),!ie&&a().createElement(Ja,{maxWidth:s,views:te,layout:ne,frozen:p,entityUri:F,onLayoutChanged:le})))):a().createElement(a().Fragment,null,a().createElement(D.Z,null),se(y().text("No data to display."))),a().createElement(oo,null),a().createElement(ce,null)))))))))}));Gl.displayName="ProfilePerspectiveView";const $l=(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 Yl=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:$l},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(Gl,{config:S,saveState:i,getSavedState:x,commentId:v}),a().createElement(f.Z,{showErrorFromStore:!0}),a().createElement(E,null))))))};var Xl=n(5050),Ql=n(79935),Kl=n(16e3);const Jl=(0,oe.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}}))),ei=e=>{let{total:t=0}=e;const n=Jl(),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(G.Z,{title:""},a().createElement("div",{className:n.titleContainer},a().createElement(ba.Z,{component:"button",variant:"caption",className:n.link,onClick:i,underline:"none"},y().text("Profile")),a().createElement(Kl.Z,{className:n.icon}),y().text("Tags")),a().createElement(Ql.Z,null),a().createElement(_.Z,{className:n.totalCaption,variant:"caption"},a().createElement("span",{className:n.totalNumber},y().number(t,"0,0")),y().text("total profiles")))};var ti=n(59916),ni=n(26482);const ri=(0,oe.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"}}))),ai=e=>{let{label:t}=e;const n=ri();return a().createElement(ni.Z,{className:n.toolbar},a().createElement(ti.Z,{className:n.avatar}),a().createElement(_.Z,{variant:"h6",className:n.label},t))};function oi(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){li(e,t,n[t])}))}return e}function li(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ii=(0,oe.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}}))),si=[25,50,100],ci=(0,r.memo)((e=>{let{tag:t,entityUri:n}=e;const o=ii(),[i,s]=(0,r.useState)(si[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,je._)(),c=(0,je._)(),[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=oi({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,oi({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>si[0];return a().createElement("div",{className:o.perspectiveView},a().createElement(ai,{label:t}),a().createElement("div",{className:z()(o.tagsContainer,{[o.fullHeight]:b})},a().createElement(W.Z,{className:o.tagsView},a().createElement(ei,{total:m}),a().createElement("div",{className:o.listContainer},d&&a().createElement(D.Z,null),m>0&&a().createElement("div",{className:o.entitiesList,ref:f},a().createElement(Xl.Z,{entities:g})),b&&a().createElement("div",{className:o.pagination},a().createElement(B.Z,{count:m,rowsPerPageOptions:si,rowsPerPage:i,page:c,onChangePage:u,onChangeRowsPerPage:s}))))))}));ci.displayName="TagPerspectiveView";const ui=(0,i.Z)({productionPrefix:"tagPerspective",disableGlobal:!0}),pi=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:ui},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>o(Math.floor(e),Math.floor(t))}),t&&a().createElement(ci,{tag:n,entityUri:r}),a().createElement(f.Z,{showErrorFromStore:!0})))};var di=n(39636);const mi=(0,oe.makeStyles)((()=>({actionsWrapper:{display:"flex","& button + button":{width:"88px",marginLeft:"8px"}}}))),gi=()=>{const e=mi(),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(uo.Z,{entity:t},a().createElement("div",{className:e.actionsWrapper},o&&a().createElement(di.o,{task:o})))};function fi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const hi=(0,oe.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 bi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const yi={processTypes:["dataChangeRequestReview"]},vi=(0,r.memo)((()=>{const e=hi(),t=(0,x.useDispatch)(),n=(e=>{const t=(0,x.useDispatch)(),n=(0,x.useSelector)(v.ZP.selectors.getEntityUri),a=(0,Tl.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){fi(e,t,n[t])}))}return e}({},a,{onActionSuccess:o})),[a,o])})(yi),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){bi(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(D.Z,null),a().createElement("div",{className:e.perspectiveContainer},c?a().createElement(cl,{hideHistory:!0,perspectiveId:"dcrCard"},a().createElement("div",{className:e.contentWrapper},a().createElement(gi,null),a().createElement("div",{className:e.attributesWrapper},a().createElement(U.Z,null)))):a().createElement(N.ZP,{LogoRenderer:N.B9.NO_DATA,text:y().text("No data to display."),variant:N.tC.embedded})))))}));vi.displayName="DCRReviewPerspectiveView";const xi=(0,i.Z)({productionPrefix:"dcrReviewPerspective",disableGlobal:!0,seed:"dcr"}),Ei=e=>{let{config:t,onResize:n=l.identity}=e;return a().createElement(d.m.Provider,{value:t.id},a().createElement(s.ZP,{generateClassName:xi},a().createElement(u._,{dateAdapter:o.Q},a().createElement(c.Z,{handleHeight:!0,onResize:(e,t)=>n(Math.floor(e),Math.floor(t))}),a().createElement(vi,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(59464),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 N=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)))))};N.propTypes={rowValue:g().object,cell:g().object,CellValueRenderer:g().elementType,isSorted:g().bool};const k=N;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),$=n(29754),Y=n(6163);const X=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($.Z,null))),n&&o().createElement(_.Z,{title:h().text("Remove")},o().createElement(G.Z,{onClick:a,size:"large"},o().createElement(Y.Z,null))))};X.propTypes={canUpdate:g().bool,canRemove:g().bool,handleEditRelation:g().func,handleRemoveRelation:g().func};const Q=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(k,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)),[]),N=(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(Q,{handleEditRelation:N,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),Ne=n(43407),ke=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),N=(0,i.pipe)(Ce.changeShowInactive,O),k=(0,a.useContext)(Ne.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}({},k,{showDescription:Z})),[k,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,ke.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,$=g?[g,...f]:f,{canUpdate:Y,canDelete:X}=(0,Ze.l)(),Q=Y(n)&&!v,K=X(n)&&!v,J=(0,a.useRef)(null);return(0,Re.I)(n.id),o().createElement(Ne.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:N}),G&&o().createElement("div",{className:w.addArea},o().createElement(x,{onClick:q})),$.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:Q?(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 $e=n(40855),Ye=n(54426),Xe=n(41633),Qe=n(32479);const Ke=(0,Ye.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($e.ZP,{generateClassName:Ke},o().createElement(Xe._,{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(Qe.Z,null))))}},1242:(e,t,n)=>{e.exports=n.p+"5271a9e7b6651c852e93.png"}}]);
|
|
2
2
|
//# sourceMappingURL=5163.js.map
|