@reltio/remotes 1.4.924

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/651.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[651],{63651:(e,t,r)=>{r.r(t),r.d(t,{ALWAYS_VISIBLE_TYPE_URIS:()=>Oa,ActionButton:()=>DE,ActionButtonMode:()=>PE,ActivityLog:()=>n.Z,ActivityLogFilter:()=>a.Z,ActivityTypes:()=>l.I,AddWorkflowButton:()=>wE,ArrowExpandButton:()=>Ut,AsyncMountContext:()=>pa,AttributeListItem:()=>m.Z,AttributeTitle:()=>Q,AttributesList:()=>Ia,AttributesPager:()=>eo,AttributesTable:()=>rf,AttributesView:()=>ci,AutoSizeList:()=>ki.Z,AvatarWithFallback:()=>Ii,BarChart:()=>Qs.Z,BasicTable:()=>Pi.Z,BasicTableContext:()=>Ai.X,BasicTablePagination:()=>is.Z,BasicView:()=>O.Z,BasicViewContent:()=>Xs.Z,BasicViewHeader:()=>C.Z,BlockImageGalleryDialogContext:()=>wr,BranchDecorator:()=>D,COMMENTS_CONTAINER_VISIBILITY_AREA:()=>J,CardinalityMessage:()=>jl,ChartsFactory:()=>rc.Z,ClickAwayProvider:()=>oc,CollaborationContext:()=>ne,CollaborationItem:()=>He,CollapseButton:()=>ks.Z,CollapseRowButton:()=>Ps,ColorBar:()=>ic.Z,ColumnFilterType:()=>ji.Dq,ColumnsDataType:()=>ji.uz,ColumnsSettings:()=>ts,CommentsContainer:()=>Qe,ConfigureColumnsPopup:()=>fc,ConfirmDeleteDialog:()=>rh,ConfirmationDialog:()=>th,ConnectionRelationTypeSelector:()=>Ec,CrosswalkDragLayer:()=>pf,CrosswalkEditor:()=>Df,CrosswalkType:()=>df,CrosswalksDisplayProvider:()=>Lm,DEFAULT_OVERLAY_OPTIONS:()=>ob,DataTypeValue:()=>rt.Z,DataTypeValueEditor:()=>na.Z,DateEditor:()=>Dc.Z,DateRangeEditor:()=>Pc.Z,DateRangeTypes:()=>hb.K,DefaultCellValueRenderer:()=>ss.Z,DeltaTypes:()=>o.w,Drawer:()=>Tc,DropDownEditor:()=>Sc.Z,DropDownMenuButton:()=>fe.Z,DropDownSelector:()=>La.Z,DropdownIndicator:()=>sc.Z,DropdownIndicatorWithIconButton:()=>cc.Z,EMPTY_STATE_ICONS:()=>Mc.B9,EMPTY_STATE_VARIANTS:()=>Mc.tC,EditableAttribute:()=>Ol,EditableImageAttributesLine:()=>Qn,EmptyState:()=>Mc.ZP,EmptyStub:()=>wn.Vd,EntitiesMapContext:()=>ye,EntityAvatar:()=>ht,EntityCreator:()=>nl,EntityMarkerContext:()=>Jf,EntitySelector:()=>ml,EntityTypeBadge:()=>Uc,EntityTypeIcon:()=>_a.Z,EntityTypesSelector:()=>au,EntityUriLink:()=>xe.Z,ErrorBoundary:()=>lu.Z,ErrorMessage:()=>ea,ErrorPopup:()=>ou.Z,ErrorWrapper:()=>ia,ExpandableSearchInput:()=>Dm,ExpandedAttributesProvider:()=>Hg,ExpandedValueTooltip:()=>pi.C,FacetViewHeader:()=>k,FileTypeEditor:()=>Rc.Z,FilterButton:()=>os,FilterValueEditor:()=>Nc.Z,FlipCard:()=>du,HideOnShrink:()=>hu,HierarchicalAttributeTooltip:()=>wu,Highlighter:()=>Yr,HistoryActivityType:()=>gb,HistoryChangeTypes:()=>Rb,HistoryDiffContext:()=>it,HistoryHeader:()=>Ey,HistoryView:()=>$b,IdContext:()=>nv,ImageAttributesLine:()=>_o,ImageGalleryDialog:()=>Oo,ImportButton:()=>ku,ImportModes:()=>Su,InlineAttributesPager:()=>Mg,InlineImageAttribute:()=>Ag,InlineNestedAttribute:()=>Kg,InlineReferenceAttribute:()=>Sg,LightArrowTooltip:()=>Gm,LinearLoadIndicator:()=>Pn,Link:()=>Iu,LoadingSpinner:()=>Pu,MAP_DRAWING_MODES:()=>lb,MAP_MINIMUM_SCALE_RADIUS:()=>ib,Marginator:()=>Yg.Z,MatchRulesBlock:()=>rp,MenuWithPopper:()=>uc.Z,MergeButton:()=>jE,ModeSwitcher:()=>Eo,ModeSwitcherSelect:()=>ip,MoreAttributesButton:()=>Jr,MultiSelect:()=>_p.Z,MultiValueChip:()=>Ml.Z,MultipleInput:()=>sp.Z,NestedAttribute:()=>Kt,NestedAttributeEditor:()=>Za,NoData:()=>Lc,NoResults:()=>_c.X,NotMatchButton:()=>VE,NumberEditor:()=>Ic.Z,OvIcon:()=>ot,PieChart:()=>Js.Z,PivotingAttributeContext:()=>w,Popper:()=>Ge.Z,PopupBoundariesContext:()=>tv.p,PopupWithArrow:()=>Ke,PotentialMatchReviewCard:()=>gp,ProfileBand:()=>Ep,ProfileBandHistory:()=>wy,ProfileBandNavigation:()=>Ys,ProfileCard:()=>Op,ProfileMatchCard:()=>sE,ProfilePerspectiveViewContext:()=>rv,QueryBuilderAttributeDataType:()=>ji.eB,QueryBuilderAttributeType:()=>ji.Xw,QueryBuilderRow:()=>Rp,QueryBuilderRowsGroup:()=>Lp,ReactSelectOptionFilters:()=>Mp,ReactSortableTree:()=>zd,ReactSortableTreeHandlers:()=>Dd,ReactSortableTreeUtils:()=>pd,ReadOnlyAttribute:()=>nr,ReadOnlyAttributeValuesBlock:()=>Ti,ReadOnlyAttributesList:()=>ti,ReadOnlyAttributesPager:()=>ei,ReferenceAttribute:()=>rr,ReferenceAttributeEditor:()=>vl,RelationEditor:()=>Ny,RelationTypeSelector:()=>xi,ReltioGridLayout:()=>Fd.Z,ReltioMap:()=>db,ResizablePanes:()=>Kd,RowCellAutoSizer:()=>Ts,Score:()=>fp,ScoreLabel:()=>Y,ScrollableTabs:()=>Rm.Z,SearchInput:()=>Mr.Z,SelectionPopup:()=>Ur,SelectionPopupPopper:()=>am,SelectorWithOnlyOptionAutoSelect:()=>im,SideButtonsPanel:()=>um,SidePanel:()=>dm,SidePanelContentHeader:()=>gm,SimpleAttribute:()=>Zt,SimpleAttributeEditor:()=>va,SimpleDropDownSelector:()=>_l.Z,SimpleMatchRulesBlock:()=>Hu,SimpleMatchRulesBuilder:()=>Gu,SmallIconButton:()=>Lt.Z,SmallIconButtonWithTooltip:()=>be.k,SortingType:()=>ji.nI,SourceCrosswalksRow:()=>If,SourceIcon:()=>hm,Spacer:()=>fm.Z,TableContext:()=>Ai.X,TableWithBars:()=>ec.Z,TextEditor:()=>kc.Z,TimestampEditor:()=>Ac.Z,TransitiveMatchBlock:()=>tp,TreeChart:()=>tc.Z,UsersContext:()=>Ce,VerticalDivider:()=>ym,VerticalHeadingsTable:()=>wm,ViewIdContext:()=>qa.m,ViewMoreToggle:()=>Sm,VirtualGroupedList:()=>qr,WhiteSearchInput:()=>em,WorkflowComments:()=>Qy,WorkflowTaskCard:()=>bE,WorkflowTasksContext:()=>Py,basicTableViewState:()=>ws,buildColumnsFilter:()=>ps.Tz,columnFilterToMdmFilter:()=>ps.su,createStandardAction:()=>wn.zD,defaultGetRowCellHeight:()=>cs.Z,defaultRenderRowCell:()=>us.Z,getChecked:()=>wn.IR,getValue:()=>wn.NA,groupCrosswalksByTypesAndSources:()=>jf,isIE:()=>wn.w1,mergeClasses:()=>wn.ze,noop:()=>wn.ZT,parseJSON:()=>wn.Rx,stopPropagation:()=>wn.UW,toggleSortOrder:()=>wn.Dh,useActions:()=>BE,useActivitiesLoader:()=>i.d,useAsyncMount:()=>ma,useAttributeExpanded:()=>Wg,useBasicTableCellRenderer:()=>_s,useClickableStyle:()=>ac.d,useCollaboration:()=>qE,useConfigPermissions:()=>ev.l,useCrosswalkActions:()=>sf,useCrosswalkColor:()=>_m,useCrosswalkFocus:()=>Um,useCrosswalkHighlight:()=>Vm,useDidUpdateEffect:()=>te.D,useDynamicRowCellHeight:()=>Rs,useHighlightedCrosswalks:()=>Mm,useHistory:()=>Ob,useHistoryDiff:()=>kb,useHistorySlice:()=>mb,useKeyboardNavigation:()=>Gr,useMarkAsNotMatchRequest:()=>_E,useMatchesLoader:()=>oE,useMergeAllRequest:()=>AE,useModifiedEntity:()=>of,usePagingSimulator:()=>lE,usePrevious:()=>cb.D,useProfileActivitiesLoader:()=>d,useRelationTypeSelector:()=>bc,useRelationsLoader:()=>$E,useRunOnceAfterValueInitialization:()=>KE,useSafePromise:()=>yt._,useSavedState:()=>YE.a,useUsers:()=>XE,useWhyDidYouUpdate:()=>JE,useWorkflowAssignee:()=>Ly,useWorkflowCheckPermission:()=>Ay,useWorkflowComments:()=>Yy,useWorkflowTasks:()=>CE,withAsyncMount:()=>ha,withFilterAtBottom:()=>Ri.Z,withPercents:()=>nc.Z,withTableContext:()=>Di.Z,withTooltip:()=>nt.Z});var n=r(56082),a=r(40023),l=r(20414),o=r(33992),i=r(7278),s=r(24328),c=r.n(s),u=r(7771),p=r(54202);const d=e=>{let{filter:t,max:r,offset:n,entityUri:a}=e;return(0,s.useCallback)((async()=>{const e=(0,p.U)(t),l=await(0,u.k6v)({filter:e,max:r,offset:n,entityUri:a}),{total:o}=await(0,u.FEC)({filter:e,entityUri:a});return{data:l,total:o}}),[t,r,n,a])};var m=r(33117),g=r(52730),h=r(89810),f=r(71153),b=r.n(f),y=r(87918),x=r.n(y),E=r(95544),v=r(90436);const w=c().createContext([]);var O=r(1730),C=r(17998),T=r(79692);const S=(0,T.Z)({container:{padding:"0 16px",minHeight:"48px"},title:{fontSize:"16px",lineHeight:"19px",paddingTop:"16px",paddingBottom:"13px",justifyContent:"flex-start"}}),k=e=>{let{className:t,title:r,children:n}=e;const a=S();return c().createElement(C.Z,{title:r,classes:{root:b()(a.container,t),title:a.title}},n)};var N=r(17440);const I="1px solid #AFD4E9",P=(0,T.Z)({decorator:{marginLeft:8,borderLeft:I,"&:last-child":{borderLeft:"none","&:before":{borderLeft:I}},"&:before":{top:0,height:14,width:5,borderBottom:I,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),D=e=>{let{className:t,children:r,plain:n=!1,enabled:a=!1}=e;const l=P();return a?c().createElement("div",{className:b()(l.decorator,{[l.plain]:n},t)},c().createElement("div",{className:l.wrapper},r)):c().createElement(c().Fragment,null,r)};function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){R(e,t,r[t])}))}return e}function R(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const j="13px",Z="15px",L={titleRow:{display:"block",minHeight:"16px",textIndent:"-1em",paddingLeft:"1em"},title:{whiteSpace:"nowrap"},ovIcon:{marginLeft:"8px",marginRight:"-3px",marginTop:"-1px",textIndent:0}},_=(0,T.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),M=(0,T.Z)(A({wrapper:{fontSize:j,lineHeight:Z,flex:1},collaborationWrapper:{display:"flex",alignItems:"start",minHeight:"18px"},attribute:{marginLeft:"8px",paddingLeft:"4px",paddingRight:"4px",display:"inline",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},titleIcon:{width:"16px",height:"16px",marginBottom:"-3px",marginRight:"8px",marginLeft:"1px",color:"rgba(0, 0, 0, 0.38)"}},L)),V=(0,T.Z)(A({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:j,lineHeight:Z},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"}},L,{titleRow:A({},L.titleRow,{marginBottom:"3px"})}));var U=r(13980),B=r.n(U),z=r(32701);const F=(0,T.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"15px"}}),H=(0,T.Z)({container:{display:"flex",flexShrink:0,marginLeft:"10px",alignItems:"center"},value:{marginLeft:"4px",minWidth:"20px",textAlign:"center"}}),W=(0,T.Z)({dqiq:{width:"14px",height:"14px",lineHeight:"14px",background:"#e6605e",color:"#fff",fontSize:"10px",fontWeight:100,marginLeft:"2px",marginRight:"1px",borderRadius:"2px",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0,textIndent:0}}),q=()=>{const e=W();return c().createElement(c().Fragment,null,c().createElement("span",null,"DQ"),c().createElement("span",{className:e.dqiq},"IQ"))},G=["analyticsAttributes/DQ/analyticsAttributes/score","analyticsAttributes/DQ"],$=["analyticsAttributes/IQ/analyticsAttributes/score","analyticsAttributes/IQ"],K=e=>{let{label:t="",attrTypeUri:r=""}=e;const n=r.indexOf("analyticsAttributes/"),a=r.substr(n),l=(0,N.includes)(a,G),o=(0,N.includes)(a,$);return(0,N.cond)([[(0,N.always)(l),(0,N.always)(c().createElement(q,null))],[(0,N.always)(o),(0,N.always)(x().text("Rank"))],[N.T,(0,N.always)(t)]])()};K.propTypes={label:B().string,attrTypeUri:B().string};const Y=K,X=e=>{let{label:t,isRequired:r,className:n,attributeType:a={}}=e;const l=F();return c().createElement(v.Z,{className:b()(l.label,n),component:"span"},c().createElement(Y,{label:t,attrTypeUri:a.uri}),r&&c().createElement(z.Z,null))};X.propTypes={label:B().string,isRequired:B().bool,className:B().string,attributeType:u.EMD};const Q=X,J="commentsContainerVisibilityArea",ee=(0,T.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},[`.${J}:hover &`]:{visibility:"visible"}},showAlways:{}})));var te=r(55962);const re=()=>{},ne=c().createContext({comments:[],commentsMap:null,currentComment:null,getComment:re,getComments:()=>new Promise(re),getCommentsCount:re,createComment:()=>new Promise(re),editComment:()=>new Promise(re),createReply:()=>new Promise(re),resolveThread:re,reOpenThread:re,clearCurrentComment:re,deleteComment:re,sending:!1,loading:!1,pageToken:null});ne.displayName="CollaborationContext";var ae=r(80030);function le(){return le=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},le.apply(this,arguments)}const oe=e=>c().createElement("svg",le({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M2.8 1h14.4c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1z"})),ie=(0,T.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}},childrenWrapper:{position:"absolute",width:"100%",height:"100%",lineHeight:"15px",display:"flex",alignItems:"center",justifyContent:"center",top:"-2px",left:0,right:0,bottom:0,color:"white",fontSize:"10px",pointerEvents:"none"}}))),se=c().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const a=ie();return c().createElement(ae.ZP,{title:x().text("Show comment")},c().createElement("div",{ref:t,className:a.root,onClick:n},c().createElement(oe,{className:a.icon}),c().createElement("div",{className:a.childrenWrapper},r)))}));se.displayName="CommentButton";const ce=se;function ue(){return ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ue.apply(this,arguments)}const pe=e=>c().createElement("svg",ue({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M2.8 14.653L3.853 13.6H17.2V2.8H2.8v11.853zM17.2 1c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1h14.4zm-6.3 3.6H9.1v2.699L6.4 7.3v1.8l2.7-.001V11.8h1.8V9.099l2.7.001V7.3l-2.7-.001V4.6z"})),de=e=>{let{className:t,onClick:r}=e;const n=ie();return c().createElement(ae.ZP,{title:x().text("Add comment")},c().createElement("div",{className:b()(n.root,t),onClick:r},c().createElement(pe,{className:n.icon})))};var me=r(27291),ge=r(86689),he=r(43054),fe=r(98538),be=r(39475);const ye=c().createContext({});ye.displayName="EntitiesMapContext";var xe=r(18527);const Ee=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},ve=e=>`${x().date(e,"LT")} ${x().date(e,"LL")}`,we=(0,T.Z)((e=>({title:{marginBottom:"10px",color:e.palette.divider,fontSize:"12px",lineHeight:"14px"},label:{paddingLeft:"9px",borderLeft:"1px solid #D8D8D8",fontSize:"13px",color:e.palette.text.primary,lineHeight:"15px"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),Oe=e=>{let{comment:t,className:r}=e;const n=we(),a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,s.useContext)(ye);return c().createElement(E.Z,{className:r},(()=>{switch(t.objectType){case u.q7e.ENTITY_ATTRIBUTE:{const e=(0,u.AFK)(t.objectId,a.type),r=(0,u.zeJ)(l,e);return c().createElement(c().Fragment,null,c().createElement(v.Z,{className:n.title},x().text("Selected attribute:")),c().createElement(v.Z,{className:n.label},null==r?void 0:r.label))}case u.q7e.ENTITY:return c().createElement(c().Fragment,null,c().createElement(v.Z,{className:n.title},x().text("Selected profile:")),c().createElement(xe.Z,{className:b()(n.label,n.link),value:(0,u.wwR)(a)},(0,u.idV)(a.label)));case u.q7e.RELATION:{var e;const r=Ee(t,a.uri),l={uri:r,label:null===(e=o[r])||void 0===e?void 0:e.label};return c().createElement(c().Fragment,null,c().createElement(v.Z,{className:n.title},x().text("Selected relation:")),c().createElement(v.Z,{className:n.label},c().createElement(xe.Z,{className:n.link,value:(0,u.wwR)(a)},(0,u.idV)(a.label)),r&&c().createElement(c().Fragment,null,` ${x().text("to")} `,c().createElement(xe.Z,{className:n.link,value:(0,u.wwR)(l)},l.label?(0,u.idV)(l.label):(0,u.BTI)(l)))))}case u.q7e.POTENTIAL_MATCH:{var r;const e=Ee(t,a.uri),l={uri:e,label:null===(r=o[e])||void 0===r?void 0:r.label};return c().createElement(c().Fragment,null,c().createElement(v.Z,{className:n.title},x().text("Selected potential match:")),c().createElement(v.Z,{className:n.label},c().createElement(xe.Z,{className:n.link,value:(0,u.wwR)(a)},(0,u.idV)(a.label)),e&&c().createElement(c().Fragment,null,` ${x().text("and")} `,c().createElement(xe.Z,{className:n.link,value:(0,u.wwR)(l)},l.label?(0,u.idV)(l.label):(0,u.BTI)(l)))))}default:return null}})())},Ce=c().createContext([]);Ce.displayName="UsersContext";const Te=(0,T.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),Se=e=>{let{comment:t,className:r}=e;const n=Te(),a=(0,s.useContext)(Ce);return c().createElement(v.Z,{className:b()(n.root,r)},function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+";const a=[];let l="",o=!1;for(let i=0;i<=e.length;i++){const s=e[i],c=e[i+1],u=i===e.length-1;l+=s,s===n&&0===i&&(o=!0),o&&t.includes(l.slice(n.length))&&(o=!1,a.push(r(l)),l=""),c===n&&(o=!0,a.push(l),l=""),u&&a.push(l)}return a}(t.content,t.namedUsers,(e=>{const t=a.find((t=>t.username===e.slice(1)));return t?c().createElement(ge.Z,{href:`mailto:${t.email}`},e):e})).map(((e,t)=>c().createElement(s.Fragment,{key:t},e))))};var ke=r(43434);const Ne=(0,T.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function Ie(){return Ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ie.apply(this,arguments)}const Pe=e=>{let{className:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const a=Ne();return c().createElement(ke.Z,Ie({},n,{className:b()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))},De=(0,T.Z)((e=>({header:{display:"flex"},avatar:{marginRight:"8px"},username:{marginBottom:"1px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},createdAt:{marginTop:"3px",marginRight:"4px",color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},body:{marginLeft:"40px"},commentTarget:{marginTop:"-15px"},message:{marginTop:"12px"},dropdownMenu:{zIndex:"3000 !important"},buttons:{marginTop:"15px",marginBottom:"12px",display:"flex","& $button + $button":{marginLeft:"10px"}},button:{fontSize:"13px",lineHeight:"15px"}}))),Ae=e=>{let{onReply:t,className:r,uri:n,comment:a,onStartEditing:l}=e;const o=De(),i=(0,g.useSelector)(h.ZP.selectors.getUserName),u=a.createdBy===i,{resolveThread:p,reOpenThread:d,sending:m,deleteComment:f}=(0,s.useContext)(ne),b=(0,s.useMemo)((()=>[{text:x().text("Edit"),onClick:l},{text:x().text("Delete"),onClick:()=>f({uri:n,commentId:a.commentId})}]),[l,f,n,a]);return c().createElement(E.Z,{className:r},c().createElement(E.Z,{className:o.header},c().createElement(Pe,{classes:{root:o.avatar}},a.createdBy),c().createElement(E.Z,{width:"100%"},c().createElement(v.Z,{className:o.username},a.createdBy)),c().createElement(v.Z,{className:o.createdAt},ve(a.createdTime)),u&&c().createElement(fe.Z,{buttonComponent:be.k,buttonProps:{icon:he.Z,tooltipTitle:x().text("Open menu")},popoverProps:{PopoverClasses:{root:o.dropdownMenu}},menuItems:b,menuId:"collaboration-comment-menu"})),c().createElement(E.Z,{className:o.body},c().createElement(Oe,{comment:a,className:o.commentTarget}),c().createElement(Se,{comment:a,className:o.message}),c().createElement(E.Z,{className:o.buttons},c().createElement(ge.Z,{className:o.button,onClick:t,component:"button"},x().text("Reply")),"open"===a.status&&c().createElement(ge.Z,{disabled:m,className:o.button,onClick:()=>{p({commentId:a.commentId,uri:n})},component:"button"},x().text("Resolve")),"resolved"===a.status&&c().createElement(ge.Z,{disabled:m,className:o.button,onClick:()=>{d({commentId:a.commentId,uri:n})},component:"button"},x().text("Re-open")))))},Re=(0,T.Z)((e=>({root:{display:"flex",padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},avatar:{marginRight:"8px"},header:{display:"flex",marginBottom:"8px"},username:{color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},message:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px"},createdAt:{color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},marked:{marginLeft:"8px",color:e.palette.text.secondary,fontSize:"13px",fontStyle:"italic",lineHeight:"15px"}}))),je=e=>{let{className:t,reply:r}=e;const{createdBy:n,action:a,createdTime:l}=r,o=Re();return c().createElement(E.Z,{className:b()(o.root,t)},c().createElement(Pe,{classes:{root:o.avatar}},n),c().createElement(E.Z,null,c().createElement(E.Z,{className:o.header},c().createElement(v.Z,{className:o.username},n),"resolve"===a&&c().createElement(v.Z,{className:o.marked},x().text("Marked as resolved")),"reopen"===a&&c().createElement(v.Z,{className:o.marked},x().text("Re-opened"))),"resolve"!==a&&c().createElement(Se,{className:o.message,comment:r}),c().createElement(v.Z,{className:o.createdAt},ve(l))))};var Ze=r(77277),Le=r(2271);const _e=(0,T.Z)((e=>({root:{width:"100%",backgroundColor:"#fff",fontFamily:"Roboto","&__control":{fontSize:"13px"},"&__highlighter":{padding:"10px 22px",border:"1px solid transparent !important",maxHeight:"70px"},"&__input":{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,maxHeight:"70px",overflow:"auto !important"},"&__suggestions":{padding:"8px 0",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",transform:"translateY(-100%)"},"&__suggestions__list":{maxHeight:"200px",overflowY:"scroll"},"&__suggestions__item":{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover, &--focused":{backgroundColor:"rgba(0,0,0,0.04)"}}},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function Me(){return Me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Me.apply(this,arguments)}const Ve=e=>{let{onChange:t,className:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className"]);const a=_e(),l=(0,s.useContext)(Ce);return c().createElement(Le.r,Me({},n,{onChange:(e,r,n,a)=>{t(r,n,(0,N.uniq)(a.map((e=>{let{display:t}=e;return t.slice(1)}))))},className:b()(a.root,r)}),c().createElement(Le.p,{trigger:"+",data:l.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:a.mention}))},Ue=(0,T.Z)({root:{padding:"6px 6px 6px 8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},textField:{maxWidth:"calc(100% - 40px)"},form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:{marginLeft:"40px",marginTop:"8px"},button:{"& + $button":{marginLeft:"8px"}}}),Be=e=>{switch(e){case"open":return x().text("Reply...");case"resolved":return x().text("Adding a comment will re-open this");default:return""}},ze=e=>{let{inputRef:t,className:r,uri:n,relatedObjectUris:a,objectType:l,popperRef:o,comment:i,isEditingComment:u,onCancel:p}=e;const d=Ue(),m=(0,g.useSelector)(h.ZP.selectors.getUserName),{createReply:f,createComment:y,sending:v,editComment:w}=(0,s.useContext)(ne),[O,C]=(0,s.useState)(""),[T,S]=(0,s.useState)(""),[k,I]=(0,s.useState)([]),[P,D]=(0,s.useState)(!1),A=""!==O.trim(),R=P||A,j=null==i?void 0:i.status,Z=(e,t,r)=>{I(r),C(e),S(t)},L=()=>{null==p||p(),Z("","",[])};return(0,s.useEffect)((()=>{o&&o.current.update()}),[o,R]),(0,s.useEffect)((()=>{u?C(i.content):L()}),[u]),c().createElement(E.Z,{className:b()(d.root,r)},c().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,N.cond)([[(0,N.always)(!i),()=>y({content:T,namedUsers:k,objectType:l,uri:n,relatedObjectUris:a})],[(0,N.always)(u),()=>w({content:T,namedUsers:k,commentId:i.commentId,objectType:l,replies:i.replies,relatedObjectUris:a,uri:n})],[N.T,()=>f({content:T,namedUsers:k,commentId:i.commentId,action:"open"===i.status?"none":"reopen",uri:n})]])().then(L).catch(console.log)),className:d.form},c().createElement(E.Z,{className:d.main},c().createElement(Pe,{classes:{root:d.avatar}},m),c().createElement(Ve,{className:d.textField,disabled:v,onChange:(e,t,r)=>{Z(e,t,r)},inputRef:t,value:O,onFocus:()=>D(!0),onBlur:()=>D(!1),placeholder:Be(j)})),R&&c().createElement(E.Z,{className:d.buttons},c().createElement(Ze.Z,{className:d.button,variant:"contained",color:"primary",disabled:!A||v,type:"submit"},((e,t)=>t?x().text("Edit"):"open"===e||"resolved"===e?x().text("Reply"):x().text("Comment"))(j,u)),c().createElement(Ze.Z,{disabled:v,onClick:()=>L(),className:d.button,variant:"outlined",color:"primary"},x().text("Cancel")))))},Fe=(0,T.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),He=(0,s.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:n,classes:a,popperRef:l,messagesRef:o,comment:i}=e;const u=(0,s.useRef)(),p=Fe({classes:a}),[d,m]=(0,s.useState)(!1),g=c().createElement(ze,{className:p.sendMessageArea,inputRef:u,popperRef:l,uri:t,relatedObjectUris:r,objectType:n,comment:i,onCancel:()=>m(!1),isEditingComment:d});return c().createElement(E.Z,{className:p.root},i&&c().createElement(c().Fragment,null,c().createElement("div",{className:p.messages,ref:o},c().createElement(Ae,{comment:i,uri:t,onReply:()=>{d&&m(!1),u.current.focus()},onStartEditing:()=>{m(!0)},className:p.comment}),c().createElement(E.Z,{className:p.replies},i.replies.map((e=>c().createElement(je,{key:e.replyId,className:p.repliedComment,reply:e}))))),g),!i&&g)}));var We=r(27556),qe=r(1292),Ge=r(7421);const $e=(0,T.Z)((e=>{const t=e.palette.background.paper;return{popoverRoot:{backgroundColor:t,maxWidth:1e3},popper:{'&[x-placement*="bottom"] $arrow':{top:0,left:0,marginTop:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"0 100%"}},'&[x-placement*="top"] $arrow':{bottom:0,left:0,marginBottom:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"100% 0"}},'&[x-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"100% 100%"}},'&[x-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"0 0"}}},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t,"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",boxShadow:e.shadows[1],backgroundColor:"currentColor",transform:"rotate(45deg)"}}}})),Ke=e=>{let{anchorEl:t,placement:r="top",arrow:n=!0,open:a,onClose:l=(()=>{}),children:o,className:i,popperRef:s}=e;const u=$e(),[p,d]=c().useState(null);return c().createElement(Ge.Z,{anchorEl:t,placement:r,className:b()(u.popper,i),modifiers:{preventOverflow:{enabled:!0,boundariesElement:"window"},arrow:{enabled:n,element:p}},open:a,modal:!1,popperRef:s},c().createElement(E.Z,null,c().createElement(qe.Z,{onClickAway:e=>{var t;t=e.target,Array.from(document.querySelectorAll("[data-modal]")).some((e=>e.contains(t)))||l()}},c().createElement(We.Z,{className:u.popoverRoot},n?c().createElement("span",{className:u.arrow,ref:d}):null,c().createElement(E.Z,null,o)))))},Ye=(0,T.Z)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:e=>{let{hasScroll:t}=e;return{marginLeft:"16px",marginRight:t?"2px":"8px"}},replies:e=>{let{hasScroll:t}=e;return{marginLeft:"8px",marginRight:t?"2px":"8px"}},sendMessageArea:e=>{let{hasScroll:t,scrollWidth:r}=e;return{marginLeft:"8px",marginRight:t?r+2:"8px"}},messages:{maxHeight:"400px",overflowY:"auto"}}))),Xe=e=>{let{uri:t,relatedObjectUris:r,objectType:n,anchorEl:a,onClose:l,open:o,comment:i}=e;const[u,p]=(0,s.useState)(0),d=Ye({scrollWidth:u,hasScroll:0!==u}),m=(0,s.useRef)(null),{resolveThread:g,loading:h,sending:f}=(0,s.useContext)(ne),b=1+(null==i?void 0:i.replies.length);return c().createElement(Ke,{popperRef:m,anchorEl:a,open:o,placement:"right-start",onClose:l,className:d.popper},c().createElement(E.Z,{className:d.header},c().createElement(E.Z,{className:d.headerInfo},c().createElement(v.Z,{className:d.title},x().text("Comments")),i&&!h&&c().createElement(v.Z,{className:d.counter},x().number(b)," ",1===b?x().text("item"):x().text("items"))),i&&!h&&c().createElement(be.k,{className:d.resolveButton,size:"S",onClick:()=>{g({commentId:i.commentId,uri:t})},disabled:f,showForDisabled:!0,tooltipTitle:x().text("Resolve"),icon:me.Z,color:"primary"})),!h&&c().createElement(He,{popperRef:m,messagesRef:e=>{e&&p(e.offsetWidth-e.clientWidth)},classes:{root:d.collaborationItem,replies:d.replies,sendMessageArea:d.sendMessageArea,messages:d.messages,comment:d.comment},uri:t,relatedObjectUris:r,objectType:n,comment:i}))},Qe=e=>{let{className:t,uri:r,objectType:n,relatedObjectUris:a,onChangePopupVisibility:l,allowOnlyOneComment:o=!1,showAlways:i=!1}=e;const u=ee(),[p,d]=(0,s.useState)(null),[m,g]=(0,s.useState)(!1),h=m&&Boolean(p),{currentComment:f,commentsMap:y,getComment:x,clearCurrentComment:E,objectTypes:v}=(0,s.useContext)(ne),w=!!y&&(!v||v.includes(n)),O=((null==y?void 0:y[r])||[]).filter((e=>{let{status:t}=e;return"resolved"!==t})).reverse(),C=!o||o&&0===O.length,T=null===f&&h;return(0,te.D)((()=>{l&&l(h)}),[h]),w&&c().createElement("div",{className:b()(u.root,t)},C&&c().createElement(de,{className:b()(u.addButton,{[u.showAlways]:i||T}),onClick:e=>{d(e.currentTarget),g(!0)}}),O.map((e=>{let{replies:t,commentId:r}=e;return c().createElement(ce,{ref:r===(null==f?void 0:f.commentId)?d:null,key:r,onClick:()=>(e=>{x(e),g(!0)})(r)},1+t)})),c().createElement(Xe,{anchorEl:p,open:h,onClose:()=>{d(null),E(),g(!1)},uri:r,relatedObjectUris:a,objectType:n,comment:f}))};var Je=r(7089),et=r(41128);const tt=(0,T.Z)((e=>({container:{height:"16px",borderColor:(0,et.U1)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}})));var rt=r(67586),nt=r(78223);const at=(0,nt.Z)(Je.Z),lt=e=>{let{className:t,attributeType:r,nonOvValues:n=[],nonOvTotal:a}=e;const l=tt();if(!a)return null;const o=n.length?n.map(((e,t)=>c().createElement("div",{key:t},(0,u.YkM)(r)?(0,u.idV)(e.label):c().createElement(rt.Z,{value:(0,u.kDl)(e),dataTypeDefinition:(0,u.PFL)(r),rich:!1})))):null;return c().createElement(at,{tooltipTitle:o,tooltipPlacement:"top",label:`+ ${a}`,variant:"outlined",classes:{root:b()(l.container,t),label:l.label}})};lt.propTypes={className:B().string,nonOvTotal:B().number,attributeType:u.EMD,nonOvValues:B().arrayOf(B().oneOfType([u.cNQ,u.dMV,u.Rtp]))};const ot=lt,it=c().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});it.displayName="HistoryDiffContext";const st=(e,t)=>{const r=(0,u.xy8)(e);return t.reduce(((t,n)=>{for(const a in n){const l=(e[r]||[]).find((e=>e.uri===a));return Array.isArray(n[a])&&"object"==typeof n[a][0]?t=(t||[]).concat(st(l,n[a])):(t.push(ct(n[a],l)),t)}}),[])},ct=(e,t)=>e&&e.length&&!(0,N.isNil)(e[0])?{fieldName:(0,u.Tde)(t.uri),filter:t.type===u.oS0.TYPE_BLOB?u.j5E.FULL_TEXT:u.j5E.EQUALS,values:e}:{fieldName:(0,u.Tde)(t.uri),filter:"missing"},ut=(e,t,r,n)=>{const a=((e,t)=>{const r=t.find((t=>t.uri===e.uri));return r&&Array.isArray(r.children)?r.children:[]})(e,r);let l=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(l=l.filter((e=>a.includes(e.uri)))),l.reduce(((e,a)=>{const l=pt(t[a.name],n,r);return l&&l.length&&(Array.isArray(l[0])?e.push({[a.uri]:l[0]}):e.push({[a.uri]:l})),e}),[])},pt=(e,t,r)=>{if(e&&0!==e.length)return e.reduce(((e,n)=>{if("type"in n&&n.type){const a="lookupCode"in n?n.lookupCode:n.value,l=(0,u.zeJ)(t,n.type);a&&"object"!=typeof a&&(0,u.OXP)(n)?e.push(dt(a,l)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(ut(l,a,r,t))}return e}),[])},dt=(e,t)=>{switch(null==t?void 0:t.type){case u.oS0.TYPE_DATE:return new Date(e).getTime();case u.oS0.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function mt(){return mt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mt.apply(this,arguments)}const gt=e=>c().createElement("svg",mt({width:11,height:11,viewBox:"0 0 11 11"},e),c().createElement("path",{d:"M2.514 5h2.314V3l2.5 2.5-2.5 2.5V6h-3.8a4.5 4.5 0 10.73-3H.6a5.5 5.5 0 11-.577 3H0V5H2.514z",fill:"#6CACE4",stroke:"none",strokeWidth:1,fillRule:"evenodd"})),ht=e=>{let{entity:t,avatarClassName:r,imageClassName:n}=e;const a=(0,g.useSelector)(h.ZP.selectors.getMetadata),l=(0,g.useSelector)(h.ZP.selectors.getAbsoluteImagePath)||"",o=(0,u.uie)(a,l,t),i=(0,u.vPL)(l,(0,u.XH2)(a,t.type)),s=e=>{e.target.onError=null,e.target.src=(0,u.m5F)('\n<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Group</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Group" fill-rule="nonzero">\n <rect id="Rectangle" fill="#DFE5E9" x="0" y="0" width="400" height="400"></rect>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n </g>\n </g>\n</svg>\n')};return c().createElement(ke.Z,{className:b()(r,n),src:o,imgProps:{onError:s}},c().createElement("img",{className:n,src:i,alt:"fallback entity avatar",onError:s}))},ft=(0,T.Z)((e=>({container:{backgroundColor:"white",width:"360px",minWidth:"360px",maxWidth:"720px"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px"},title:{color:e.palette.text.primary,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px"},entityTypeLabel:{color:"rgba(0,0,0,0.67)",fontSize:"14px",paddingLeft:"16px",paddingBottom:"12px",lineHeight:"16px"},divider:{height:"24px",width:"1px",backgroundColor:"rgba(0,0,0,0.12)"},headerCount:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:"0.24px",lineHeight:"28px",width:"210px"},body:{borderBottom:"1px solid rgba(0,0,0,0.12)",padding:"0 16px 8px"},footer:{display:"flex",alignItems:"center",height:"31px",paddingLeft:"16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px"},profileIcon:{height:"16px",width:"16px"},entityContainer:{display:"flex",flexDirection:"row",alignItems:"center"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px",textDecoration:"none",paddingLeft:"8px"},icon:{margin:"auto 8px auto 0"},content:{color:e.palette.primary.main},seeAllButton:{cursor:"pointer"}}))),bt=(0,T.Z)({tooltip:{backgroundColor:"white",boxShadow:"0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2)",padding:0,borderRadius:"4px",maxWidth:"none"},arrow:{"&::before":{backgroundColor:"white"}}});var yt=r(29627);function xt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Et=e=>{let{value:t,attributeType:r,config:n={}}=e;const[a,l]=(0,s.useState)([]),[o,i]=(0,s.useState)(0),p=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},d=(0,yt._)(),m=(0,g.useDispatch)(),f=ft(),b=(0,g.useSelector)(h.ZP.selectors.getGlobalSearchRequestOptions)||{},y=n.entityType||p.type,E=o>6;(0,s.useEffect)((()=>{const e=function(e,t){let r=[{fieldName:"type",filter:"equals",values:[arguments.length>2&&void 0!==arguments[2]?arguments[2]:""]}];return Array.isArray(e)?r=r.concat(st(t,e)):r.push(ct([e],t)),r}(t,r,y),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xt(e,t,r[t])}))}return e}({max:6},b);d(Promise.all([(0,u.ZOr)(e,n),(0,u.j_Q)(e,n)])).then((e=>{const[t,{total:r}]=e;l(Array.isArray(t)?t:[]),i(r)})).catch((()=>{l([]),i(0)}))}),[]);const v=Boolean(n.label);return c().createElement("div",{className:f.container},c().createElement("div",{className:f.header},c().createElement("div",{className:f.title},x().text("Pivot profiles")),c().createElement("div",{className:f.divider}),c().createElement("div",{className:f.headerCount},x().number(o,"0,0")+" "+(1===o?x().text("item"):x().text("items")))),v&&c().createElement("div",{className:f.entityTypeLabel},n.label),c().createElement("div",{className:f.body},a.map((e=>c().createElement("div",{key:e.uri,className:f.entityContainer},c().createElement(ht,{entity:e,avatarClassName:f.profileIcon}),c().createElement(xe.Z,{className:f.entityLabel,value:(0,u.wwR)(e)},(0,u.idV)(e.label)))))),E&&c().createElement("div",{className:f.footer},c().createElement("a",{className:f.seeAllButton,onClick:()=>{const e=Array.isArray(t)?t.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,u.nIW)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,t);m(h.ui.actions.openPivotingPerspective({value:e,attributeType:r}))}},x().text("See all"))))},vt=e=>{let{value:t,attributeType:r,children:n,className:a}=e;const l=bt(),o=ft(),i=(0,s.useContext)(w)||[],p=(0,u.QZu)(r),d=(0,g.useSelector)(h.ZP.selectors.getMetadata)||{},m=p?ut(r,t.value,i,d):dt(t.lookupCode||t.value,r),f=i.some((e=>{let{uri:t}=e;return t===r.uri}))&&(Array.isArray(m)&&m.length||!Array.isArray(m)&&!(0,N.isNil)(m)),b=i.find((e=>{let{uri:t}=e;return t===r.uri}));return f?c().createElement(ae.ZP,{interactive:!0,arrow:!0,placement:"right-start",classes:l,title:c().createElement(Et,{value:m,attributeType:r,config:b.popup})},c().createElement("span",{className:a},c().createElement(gt,{className:o.icon}),c().createElement("span",{className:o.content},n))):c().createElement(c().Fragment,null,n)};let wt;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(wt||(wt={}));const Ot={[wt.insertAttribute]:{color:"#599E0E"},[wt.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[wt.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},Ct=e=>{switch(e){case"UPDATE_ATTRIBUTE":return wt.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return wt.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return wt.deleteAttribute;default:return""}},Tt="/",St=(0,N.pipe)((0,N.split)(Tt),(0,N.propSatisfies)((0,N.lte)(2),"length")),kt=(0,N.pipe)((0,N.split)(Tt),(0,N.slice)(0,-2),(0,N.join)(Tt)),Nt=(0,N.curry)(((e,t)=>(0,N.cond)([[(0,N.has)(e),(0,N.prop)(e)],[()=>St(e),Nt(kt(e))]])(t))),It=e=>(0,N.pipe)(N.keys,(0,N.any)((0,N.startsWith)(e+Tt))),Pt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=Nt(e,t);return(0,N.isNil)(r)?It(e)(t)?"UPDATE_ATTRIBUTE":"":r},Dt=function(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==n||null===(r=n[e])||void 0===r?void 0:r[t]};function At(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rt(e,t,r[t])}))}return e}function Rt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jt=(0,T.Z)({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{flex:1,padding:"0 4px"},updateAttribute:At({width:"fit-content",padding:"0 4px"},Ot[wt.updateAttribute]),insertAttribute:At({width:"fit-content",padding:"0 4px"},Ot[wt.insertAttribute]),deleteAttribute:At({width:"fit-content",padding:"0 4px",textDecoration:"line-through"},Ot[wt.deleteAttribute]),multilineAttribute:{width:"fit-content"}}),Zt=e=>{let{className:t,attributeType:r=null,attributeValue:n,inlined:a}=e;const l=jt(),{appearance:o}=(0,s.useContext)(it),i=Pt(n.uri,o),p=Ct(i),d=c().createElement(rt.Z,{value:(0,u.kDl)(n),dataTypeDefinition:(0,u.PFL)(r)});return a||p?c().createElement("div",{className:t},c().createElement(vt,{value:n,attributeType:r,key:n.uri,className:b()({[l.multilineAttribute]:!a})},c().createElement("span",{className:l[p]},d))):c().createElement("div",{className:b()(t,l.root,J)},c().createElement(vt,{value:n,attributeType:r,key:n.uri},c().createElement("span",{className:l.attributeValue},d)),c().createElement(Qe,{className:l.commentsContainer,uri:n.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:n.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE}))};var Lt=r(40435),_t=r(98989);const Mt=(0,T.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function Vt(){return Vt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vt.apply(this,arguments)}const Ut=e=>{const t=Mt(),{expanded:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return c().createElement(Lt.Z,Vt({icon:_t.Z,size:"XXS",disableRipple:!0,iconClassName:b()(t.expandIcon,{[t.expanded]:r}),className:b()(n,t.expandButton)},a))},Bt=(0,T.Z)({complexContainer:{marginTop:"1px"},labelContainer:{display:"flex",minHeight:"18px"},label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",paddingTop:"1px",marginLeft:"-2px"},spacer:{flex:1}}),zt=e=>{let{attributeTypesList:t,attributeValue:r,label:n,expanded:a=!1,children:l,showNonOv:o}=e;const i=Bt(),p=r.uri,[d,m]=(0,s.useState)(!1);(0,s.useEffect)((()=>{m(a)}),[a]);const g=(t||[]).some((e=>(0,u.kQw)(e))),h=(0,s.useMemo)((()=>({attributes:g?null:r.value,analyticsAttributes:g?r.value:null})),[r,g]);return c().createElement("div",{className:i.complexContainer},c().createElement("div",{className:b()(i.labelContainer,J)},c().createElement(Ut,{onClick:()=>m((e=>!e)),expanded:d}),c().createElement(v.Z,{component:"span",variant:"body2",classes:{body2:i.label}},n),c().createElement("div",{className:i.spacer}),c().createElement(Qe,{uri:r.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:r.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE})),d&&c().createElement(ti,{attrTypes:t,entity:h,drawLines:!0,parentUri:p,showNonOv:o},l))};zt.propTypes={children:B().node,label:B().oneOfType([B().string,B().node]),attributeTypesList:B().arrayOf(u.EMD),attributeValue:B().oneOfType([u.dMV,u.Rtp]),expanded:B().bool,showNonOv:B().bool};const Ft=zt;function Ht(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Wt(e,t,r[t])}))}return e}function Wt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qt=(0,T.Z)({label:{textDecoration:"none",padding:"0 4px"},updateAttribute:Ht({width:"fit-content"},Ot[wt.updateAttribute]),insertAttribute:Ht({width:"fit-content"},Ot[wt.insertAttribute]),deleteAttribute:Ht({width:"fit-content",textDecoration:"line-through"},Ot[wt.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function Gt(){return Gt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gt.apply(this,arguments)}const $t=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=qt(),{appearance:l}=(0,s.useContext)(it),o=(0,s.useMemo)((()=>{const e=Pt(t.uri,l),n=Ct(e),o=t.label?t.label:(0,u.Kxm)(t,r.dataLabelPattern);return c().createElement(vt,{className:a.pivotingTooltip,value:t,attributeType:r},c().createElement(E.Z,{component:"span",className:b()(a[n],a.label)},(0,u.idV)(o)))}),[l,a,t,r]);return c().createElement(Ft,Gt({label:o,attributeValue:t,attributeTypesList:(0,u.EUG)({},r)},n))};$t.propTypes=u.j2V;const Kt=(0,s.memo)($t);function Yt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xt(e,t,r[t])}))}return e}function Xt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qt=(0,T.Z)((e=>({label:{color:e.palette.primary.main,textDecoration:"none",padding:"0 4px"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:Yt({width:"fit-content"},Ot[wt.updateAttribute]),insertAttribute:Yt({width:"fit-content"},Ot[wt.insertAttribute]),deleteAttribute:Yt({width:"fit-content",textDecoration:"line-through"},Ot[wt.deleteAttribute])})));function Jt(){return Jt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jt.apply(this,arguments)}const er=e=>{let{attributeValue:t,metadata:r,attributeType:n,uiPath:a}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","metadata","attributeType","uiPath"]);const o=Qt(),i=(0,u.bwT)(t),p=(0,s.useMemo)((()=>(0,u.EUG)(r,n)),[n,r]),{appearance:d}=(0,s.useContext)(it),m=(0,s.useMemo)((()=>{const e=Pt(t.uri,d),r=Ct(e);return c().createElement("a",{href:(0,u.O27)(d)?(0,u.ChB)({uiPath:a,uri:i}):void 0,className:b()(o.label,o[r])},(0,u.idV)(t.label),t.relationshipLabel&&c().createElement("span",{className:o.relationshipLabel},t.relationshipLabel))}),[t.uri,t.label,t.relationshipLabel,d,i,o,a]);return c().createElement(Ft,Jt({attributeTypesList:p,attributeValue:t,label:m},l))};er.propTypes=u.NkU;const tr=(0,s.memo)(er),rr=(0,g.connect)((e=>({metadata:h.ZP.selectors.getMetadata(e),uiPath:h.ZP.selectors.getUIPath(e)})))(tr),nr=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case u.oS0.TYPE_NESTED:return c().createElement(Kt,t);case u.oS0.TYPE_REFERENCE:return c().createElement(rr,t);default:return c().createElement(Zt,t)}}}.build(t,e)},ar=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:l,showTitle:o=!0,showNonOv:i,totalNonVisibleValues:s}=e;const p=M(),{label:d}=n;return c().createElement("div",{className:b()(p.collaborationWrapper,J)},c().createElement("div",{className:b()(p.titleRow,p.wrapper)},o&&c().createElement(Q,{label:d,className:b()(p.title,a),attributeType:n}),c().createElement(ot,{nonOvValues:r,attributeType:n,className:p.ovIcon,nonOvTotal:s}),c().createElement(nr,{className:b()(p.attribute,l),attributeValue:t,attributeType:n,showNonOv:i,inlined:!0})),c().createElement(Qe,{uri:t.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:t.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE}))};var lr=r(4426);const or=(0,T.Z)({link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"}}),ir=e=>{let{moreNumber:t,valueNumber:r,onClick:n}=e;const a=or();return c().createElement(ge.Z,{component:"button",variant:"caption",className:a.link,onClick:n,underline:"none"},c().createElement(lr.Z,{className:a["svg-icon__root"]}),t&&r?x().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):x().text("Show more"))};var sr=r(96971);const cr=e=>{let{onClick:t}=e;const r=or();return c().createElement(ge.Z,{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},c().createElement(sr.Z,{className:r["svg-icon__root"]}),x().text("Show less"))},ur=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:l,parentUri:o,requestNextPageOfAttributeValues:i,titleClassName:u,contentClassName:p,showTitle:d=!0,showNonOv:m,totalNonVisibleValues:g}=e;const h=V(),[f,y]=(0,s.useState)(t),x=t<a,E=x&&f<a,v=x&&f>=a,{label:w}=l,O=r.slice(0,f),C=a-f;return c().createElement("div",{className:h.wrapper},d&&c().createElement("div",{className:h.titleRow},c().createElement(Q,{label:w,className:b()(h.title,u),attributeType:l}),c().createElement(ot,{nonOvValues:n,attributeType:l,className:h.ovIcon,nonOvTotal:g})),c().createElement("div",{className:h.attributes},O.map((e=>c().createElement(nr,{key:e.uri,className:b()(h.attribute,p),attributeValue:e,attributeType:l,showNonOv:m})))),E&&c().createElement(ir,{moreNumber:(0,N.min)(t,C),valueNumber:C,onClick:()=>{r.length<a&&i({parentUri:o,attributeTypeUri:l.uri,attributeTypeName:l.name,values:r,defaultMaxValues:t}),y(f+t)}}),v&&c().createElement(cr,{onClick:()=>{y(t)}}))};var pr=r(80079);function dr(){return dr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dr.apply(this,arguments)}const mr=e=>c().createElement("svg",dr({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("path",{d:"M0 0h24v24H0z"}),c().createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-4.5-9l2.5 3.096V18H5l4.5-5.5 2.5 3.01L16.5 10zm-8-4a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fillOpacity:.12,fill:"#000",fillRule:"nonzero"}))),gr=(0,T.Z)((e=>({root:{position:"relative"},image:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,objectFit:"cover",verticalAlign:"bottom"}},defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function hr(){return hr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hr.apply(this,arguments)}const fr="loading",br="loaded",yr="error",xr={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},Er=(0,s.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=xr.SMALL,overlay:l=null}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),i=a||xr.SMALL,p=gr(i),[d,m]=(0,s.useState)(fr);(0,s.useEffect)((()=>{m(fr)}),[t]);const g=d===fr,h=d===br;return d===yr?c().createElement("div",hr({className:b()(p.defaultContainer,p.image,r)},o),c().createElement(pr.Z,{className:p.defaultImage})):c().createElement("div",{className:b()(p.root,n)},!(0,u.O27)(t)&&c().createElement("img",hr({src:t,className:b()(p.image,r,{[p.hideImage]:g}),onLoad:()=>{m(br)},onError:()=>{m(yr)},alt:"image"},o)),g&&c().createElement("div",hr({className:b()(p.defaultContainer,p.image,r)},o),c().createElement(mr,{className:p.defaultImage})),h&&l)}));var vr=r(88267);const wr=c().createContext(!1);wr.displayName="BlockImageGalleryDialogContext";var Or=r(45203),Cr=r(15762);const Tr=(0,T.Z)((e=>({root:{display:"flex",alignContent:"center",flexDirection:"column"},main:{position:"relative",padding:"0 86px",marginTop:"auto"},mainImageContainer:{display:"flex",alignContent:"center",height:"100%",width:"100%"},mainImage:{maxWidth:"calc(100vw - 512px)",maxHeight:"calc(100vh - 192px)",margin:"0 auto",userSelect:"none"},arrowButton:{backgroundColor:e.palette.divider,color:"white","&:hover":{backgroundColor:e.palette.divider}},arrowButtonPrev:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)"},arrowButtonNext:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)"}})));var Sr=r(60905);const kr=(0,T.Z)((()=>({thumbnails:{marginLeft:"12px",marginBottom:"12px",marginTop:"auto",width:"calc(100vw - 364px)",overflowX:"auto",overflowY:"hidden"},gridContainer:{width:"100%"},thumb:{width:"96px",height:"96px",cursor:"pointer",userSelect:"none"},inactiveThumb:{filter:"brightness(0.5)"}}))),Nr=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:n}=e;const a=kr(),l=(0,s.useRef)(null);return(0,s.useEffect)((()=>{if(null!=l&&l.current){const e=l.current.scrollLeft,t=l.current.offsetWidth+e,r=96*n+16*n+12;t<r?l.current.scroll&&(r>t+96+16?l.current.scroll(r,0):l.current.scroll(112+e,0)):e+96>r&&l.current.scroll&&l.current.scroll(r-96,0)}}),[n,l]),c().createElement("div",{ref:l,className:a.thumbnails},c().createElement(Sr.Z,{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:a.gridContainer},t.map(((e,t)=>{let{uri:l,value:o}=e;return c().createElement(Sr.Z,{item:!0,key:l},c().createElement(Er,{onClick:()=>r(t),className:b()(a.thumb,{[a.inactiveThumb]:n!==t}),src:(0,u.efz)({value:o})}))}))))},Ir=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}=e;const l=Tr(),o=r[n],i=(0,u.QXK)(o);return c().createElement("div",{className:b()(l.root,t)},c().createElement("div",{className:l.main},n>0&&c().createElement(Lt.Z,{icon:Or.Z,className:b()(l.arrowButton,l.arrowButtonPrev),onClick:()=>{a(n-1)},size:"XL"}),c().createElement(Er,{containerClassName:l.mainImageContainer,className:l.mainImage,size:i&&xr.OVERRIDE,src:i}),n!==r.length-1&&c().createElement(Lt.Z,{icon:Cr.Z,className:b()(l.arrowButton,l.arrowButtonNext),onClick:()=>{a(n+1)},size:"XL"})),c().createElement(Nr,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}))};var Pr=r(21324),Dr=r(5806),Ar=r(33016),Rr=r(36138),jr=r(85256);const Zr=(0,T.Z)({moreAttributes:{display:"flex",paddingBottom:"6px","&$dense":{padding:0}},dense:{},popupContainer:{},moreAttributesPopup:{"&$popupContainer":{}},moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}});var Lr=r(79784);const _r=(0,T.Z)((()=>({container:e=>{let{containerHeight:t=553,containerWidth:r}=e;return{display:"flex",flexDirection:"column",height:t,width:r,flexGrow:1}},header:{marginLeft:"16px",marginTop:"16px",marginBottom:"12px",fontSize:"16px",fontWeight:500,letterSpacing:"0.15px",lineHeight:"24px"},searchInputContainer:{margin:"0 16px 12px 16px",flexShrink:"0"},list:{flexGrow:1,height:0,overflow:"hidden",width:"100%",position:"relative","& ul":{paddingBottom:0,paddingTop:0}}})));var Mr=r(33662);const Vr=e=>{let{title:t,className:r,onSearch:n,hideTitle:a,hideSearchInput:l,headerPlacement:o="top",containerWidth:i,containerHeight:s,searchInputOnKeyDown:u,children:p,searchInputRef:d}=e,m=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["title","className","onSearch","hideTitle","hideSearchInput","headerPlacement","containerWidth","containerHeight","searchInputOnKeyDown","children","searchInputRef"]);const g=_r({containerWidth:i,containerHeight:s}),h=c().createElement(c().Fragment,null,!a&&c().createElement("div",{className:g.header},t),!l&&c().createElement(Mr.Z,{onSearch:n,autofocus:!0,onKeyDown:u,inputRef:d,classes:{root:g.searchInputContainer},placeholder:x().text("Search & add attributes"),height:40}));return c().createElement(Lr.ZP,m,c().createElement("div",{className:b()(g.container,r),style:{width:i}},"top"===o&&h,c().createElement("div",{className:g.list},p),"bottom"===o&&h))};Vr.propTypes={className:B().string,title:B().string,headerPlacement:B().oneOf(["top","bottom"]),onSearch:B().func,searchInputOnKeyDown:B().func,containerWidth:B().number,containerHeight:B().number,hideTitle:B().bool,hideSearchInput:B().bool,searchInputRef:B().shape({current:B().instanceOf(Element)}),children:B().node},Vr.defaultProps={anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}};const Ur=Vr,Br=e=>{const t=e=>(0,N.flatten)(e.map((e=>[e].concat(e.items?t(e.items):[]))));let r=null;return t(e).map(((e,t)=>(e&&e.items&&(r=t),{item:e,index:t,titleItemIndex:r})))};var zr=r(50166);const Fr=(0,T.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Hr=e=>e.titleItemIndex===e.index,Wr=e=>{let{items:t,getItemSize:r,renderItem:n,renderGroupTitle:a,width:l="100%",height:o,fixedTitle:i=!0,itemKey:u=(e=>e),disableHorizontalScrollbar:p,hideSubtitles:d,focusIndex:m=null,onInnerContainerResize:g}=e;const h=Fr(),f=(0,s.useRef)(null),b=(0,s.useRef)(null),y=(0,s.useRef)(null),x=(0,s.useRef)([0]),E={topMargin:0},v=(0,s.useMemo)((()=>!d||(t||[]).some((e=>null!==e.titleItemIndex))),[t,d]),w=(0,s.useCallback)((e=>{const n=x.current.length;let a=0;t.slice(n-1,e+1).forEach(((e,t)=>{const l=n+t-1;t>0&&(x.current[l]=x.current[l-1]+a),a=r(l,e.item)}))}),[r,t]),O=(0,s.useCallback)((e=>t[e].titleItemIndex),[t]),C=(0,s.useCallback)((e=>t[e]),[t]);(0,s.useEffect)((()=>{requestAnimationFrame((()=>{f.current&&f.current.scrollTo(0)}))}),[t.length]),(0,s.useEffect)((()=>{f.current&&f.current.resetAfterIndex(0),T();const e=(e=>{const t=e.findIndex((e=>e.item.moveTo));if(t>-1){w(t);const e=O(t);return{offset:x.current[t],titleHeight:r(e,C(e).item)}}})(t);if(e&&e.offset&&f.current){const{titleHeight:t}=e,r=e.offset-t;(r<f.current.state.scrollOffset||r>f.current.state.scrollOffset+o)&&requestAnimationFrame((()=>{f.current&&f.current.scrollTo(r-(o-t)/2)}))}}),[w,C,r,O,o,x,t,f]);const T=()=>{y.current&&b.current&&(y.current.style.width=b.current.offsetWidth+"px")},S=(0,s.useCallback)((e=>{let r=null,n=0;return t.some(((t,a)=>{w(a+10);const l=x.current[a+1];return e>=n&&e<l&&(r={index:a,offset:n,listItem:t}),n=l,r})),r}),[w,x,t]),k=(0,s.useCallback)((e=>r(e,C(e).item)),[C,r]),N=(0,s.useCallback)((e=>{let{index:t,style:r,data:l}=e;const o=C(t);return o.item&&(Hr(o)&&a(r,o.item)||n(r,o.item,t,l))}),[C,a,n]),{handleOnItemsRendered:I}=(e=>{let{focusIndex:t,listRef:r,items:n}=e;const a=(0,s.useRef)(null),l=(0,s.useRef)(null),o=(0,s.useCallback)((e=>{let{visibleStartIndex:t,visibleStopIndex:r}=e;a.current=t,l.current=r}),[]);return(0,s.useEffect)((()=>{r.current&&null!==t&&0!==n.length&&(t<Math.max(a.current+3,0)?r.current.scrollToItem(Math.max(t-3,0),"start"):t>Math.min(l.current-3,n.length-1)&&r.current.scrollToItem(Math.min(t+3,n.length-1),"end"))}),[t,n.length,r]),{handleOnItemsRendered:o}})({items:t,focusIndex:m,listRef:f}),P=(0,s.useCallback)((()=>t.filter((e=>Hr(e))).map((e=>(e=>c().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},a({height:r(e.index,e.item)},e.item)))(e)))),[r,t,a]);return c().createElement(c().Fragment,null,c().createElement("div",{ref:y,className:h.stickyTitlesWrapper},i&&P()),g&&b.current&&c().createElement(vr.Z,{handleHeight:!0,onResize:g,targetDomEl:b.current}),c().createElement(zr.VariableSizeList,{ref:f,itemCount:t.length,itemSize:k,width:l,height:o,itemKey:u,innerRef:b,onScroll:e=>{let{scrollOffset:n,scrollDirection:a}=e;if(!i||!v)return;const l=S(n),o=l&&O(l.index);var s;null!==o&&(s=o,y.current&&[...y.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===s.toString()?(e.style.visibility="visible",E.index=s):e.style.visibility="hidden"}))),T();const c=null!==o&&r(o,C(o).item),u=S(n+c+E.topMargin);let p=0;if(u){switch(a){case"forward":u.offset-n>0&&Hr(u.listItem)&&(p=c-(u.offset-n));break;case"backward":{const e=o>-1&&(d=o,t.findIndex(((e,t)=>Hr(e)&&d<t))),r=(e=>(w(e),x.current[e]))(e);e>-1&&n<r&&c>=r-n&&(p=c-(r-n))}}(e=>{y.current&&(E.topMargin=-e,y.current.style.top=-e+"px")})(p)}var d},style:p?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:I},N))};Wr.propTypes={items:B().arrayOf(B().object).isRequired,getItemSize:B().func.isRequired,renderItem:B().func.isRequired,width:B().oneOfType([B().number,B().string]),height:B().number.isRequired,renderGroupTitle:B().func,fixedTitle:B().bool,hideSubtitles:B().bool,itemKey:B().func,disableHorizontalScrollbar:B().bool,focusIndex:B().number,onInnerContainerResize:B().func};const qr=Wr,Gr=e=>{let{items:t,open:r,onSelectFocusedItem:n,selectedItems:a,onClose:l}=e;const[o,i]=(0,s.useState)(null),c=(0,s.useRef)(!1),u=(0,s.useCallback)((e=>{let r=null===e?u(-1):e;for(;null!==e&&r<t.length&&(r<=e||r>=0&&Hr(t[r]));)r+=1;return r!==t.length?r:u(-1)}),[t]),p=(0,s.useCallback)((e=>{let r=null===e?t.length-1:e;for(;null!==e&&r>=0&&(r>=e||Hr(t[r]));)r-=1;return r<0?t.length-1:r}),[t]),d=(0,s.useCallback)((()=>{if(!(0,N.isNil)(o)){const e=t[o].item;!e.item.notSelectable&&n({item:e.item,groupData:e})}}),[n,t,o]),m=(0,s.useCallback)((e=>{if(0!==t.length)switch(e.key){case"Down":case"ArrowDown":return i(u),e.preventDefault(),!1;case"Up":case"ArrowUp":return i(p),e.preventDefault(),!1;case"Enter":c.current=!0,d();break;case"Tab":l&&l(e);break;default:return}}),[t,u,p,d,l]);return(0,s.useEffect)((()=>{if(c.current){c.current=!1;const e=t.findIndex((e=>e.item.moveTo));e>-1&&i(e)}else i(null)}),[t,r,a]),{focusIndex:o,handleKeyDown:m}};var $r=r(65549);const Kr=(0,T.Z)({highlight:{fontWeight:600}}),Yr=e=>{let{text:t="",highlight:r="",className:n}=e;const a=Kr(),l=r&&t.split(new RegExp(`(${r})`,"gi"));return c().createElement("span",null,r?l.map(((e,t)=>c().createElement("span",{key:t,className:e.toLocaleLowerCase()===r.toLocaleLowerCase()?n||a.highlight:""},e))):t)},Xr=(0,N.curry)(((e,t)=>(0,N.filter)((t=>t.label.toLowerCase().includes(e.toLowerCase())))(t))),Qr=e=>{let{label:t,popupTitle:r=t,data:n,dense:a,onApply:l}=e;const o=Zr(),i=(0,s.useRef)(),[u,p]=(0,s.useState)(!1),[d,g]=(0,s.useState)(""),[h,f]=(0,s.useState)([]),y=(0,s.useCallback)(((e,t)=>{f((0,N.ifElse)((0,N.always)(t),(0,N.append)(e),(0,N.reject)((0,N.propEq)("id",e.id)))(h))}),[h]),x=(0,s.useMemo)((()=>(0,N.pipe)(Xr(d),(0,N.map)((e=>({item:{id:e.uri,label:e.label,attrType:e}}))))(n)),[n,d]),E=(0,s.useMemo)((()=>Br(x)),[x]),v=(0,s.useCallback)((()=>28),[]),w=(0,s.useCallback)((e=>{let{item:t}=e;y(t,(0,N.not)((0,N.any)((0,N.propEq)("id",t.id))(h)))}),[y,h]),{focusIndex:O,handleKeyDown:C}=Gr({items:E,open:u,onSelectFocusedItem:w,selectedItems:h}),T=(0,s.useRef)(null);T.current=O;const S=Math.min(255,28*E.length),k=Math.max(140,S+112),I=(0,s.useCallback)(((e,t,r)=>{let{item:n,level:a=0}=t;const l=(0,N.any)((0,N.propEq)("id",n.id))(h),o=T.current===r;return c().createElement(m.Z,{key:n.uri,onClick:y,checked:l,level:a,data:n,label:c().createElement(Yr,{text:n.label,highlight:d}),labelInText:n.label,style:e,isFocused:o,isRequired:!!n.attrType.required,LogoIcon:n.LogoIcon})}),[d,y,h]);return c().createElement("div",{className:b()(o.moreAttributes,{[o.dense]:a})},c().createElement(Ze.Z,{color:"primary",onClick:()=>p(!u),ref:i,className:o.moreButton},c().createElement($r.Z,{classes:{root:o.icon}}),c().createElement("div",{className:o.buttonLabel},t)),c().createElement(Ur,{open:u,className:b()(o.moreAttributesPopup,o.popupContainer),anchorEl:i.current,onClose:(0,N.pipe)((()=>{h.length>0&&l((0,N.pluck)("attrType",h))}),(()=>p(!1)),(()=>g("")),(()=>f([]))),onSearch:g,containerHeight:k,title:r,containerWidth:320,searchInputOnKeyDown:C},c().createElement(qr,{getItemSize:v,renderItem:I,items:E,height:S,containerWidth:320,focusIndex:O})))};Qr.propTypes={label:B().string,popupTitle:B().string,data:B().array,dense:B().bool,onApply:B().func};const Jr=Qr;var en=r(95038),tn=r.n(en);const rn={get CreationTime(){return x().text("Creation Time")},get CreationDate(){return x().text("Creation Date")},get Dimensions(){return x().text("Dimensions")},get MimeType(){return x().text("Mime Type")},get Size(){return x().text("Size")},get Url(){return x().text("Full image URL (S3)")},get UrlPreview(){return x().text("Preview image URL (S3)")},get UrlThumbnail(){return x().text("Small image URL (S3)")},get CdnUrl(){return x().text("Full image URL (CDN)")},get CdnUrlPreview(){return x().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return x().text("Small image URL (CDN)")}},nn=function(){let{value:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,N.path)([t,0,"value"],e):"CreationDate"===t&&(0,N.path)(["CreationTimestamp",0,"value"],e)?tn()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,N.path)(["CreationTimestamp",0,"value"],e)?tn()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,N.path)(["Height",0,"value"],e)&&(0,N.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${x().text("pixels")}`:"Size"===t&&(0,N.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},an=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},ln=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,l=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?l:l.sort(((e,t)=>{const r=a.indexOf(e),n=a.indexOf(t);return-1===r&&-1!==n?1:-1===n&&-1!==r?-1:r-n}))},on=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=an(t.attributes);return ln(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((e=>{let{name:t}=e;return t===r}));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},sn=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),cn=(0,T.Z)({title:{marginBottom:"10px",color:"white",fontSize:"18px",lineHeight:"21px","&$canAdd":{marginBottom:"3px"}},divider:{width:"100%",height:"1px",background:"rgba(255,255,255,0.12)"},canAdd:{}}),un=e=>{let{attributeType:t,onAddAttributes:r,uri:n}=e;const a=cn(),l=an(t.attributes),o=Boolean(r);return c().createElement(E.Z,null,c().createElement(v.Z,{className:b()(a.title,{[a.canAdd]:o})},x().text("Meta info")),o&&c().createElement(s.Fragment,null,c().createElement(Jr,{label:x().text("Attributes"),data:l,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:n}))))}}),c().createElement(jr.Z,{className:a.divider})))},pn=(0,T.Z)((e=>({root:{fontSize:"13px",letterSpacing:0,lineHeight:"15px",marginBottom:"11px"},title:{color:"rgba(255,255,255,0.54)",marginRight:"12px",float:"left"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),dn=e=>{let{title:t,content:r,isLink:n,children:a}=e;const l=pn();return c().createElement("div",{className:l.root},c().createElement("span",{className:l.title},t),n?c().createElement("a",{className:l.link,href:r},x().text("link")):c().createElement("span",{className:l.content},r||a))},mn=(0,T.Z)({root:{padding:"10px 0"},title:{color:"rgba(255,255,255,0.54)",fontSize:"13px"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"}}),gn=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const a=mn(),l=(0,g.useSelector)(h.ZP.selectors.getIsViewMode),o=(i=t,s=n,ln(Object.keys(rn),s).map((e=>nn(i,e)?{title:rn[e],value:nn(i,e),isLink:sn(e)}:null)).filter(Boolean));var i,s;const u=on(t,r,n);return c().createElement(E.Z,{className:a.root},o.map((e=>{let{title:t,value:r,isLink:n}=e;return c().createElement(dn,{key:t,isLink:n,title:t,content:r})})),l&&u.map((e=>{let{attrType:r,values:n}=e;return c().createElement(ei,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:a.title,contentClassName:a.content,parentUri:t.uri})})))};var hn=r(94438),fn=r(52669),bn=r(81556);const yn=(0,T.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),xn=e=>{let{checked:t,className:r,onClick:n}=e;const a=yn(),l=t?bn.Z:fn.Z;return c().createElement(l,{className:b()(a.root,r),onClick:n})};function En(){return En=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},En.apply(this,arguments)}const vn=e=>c().createElement("svg",En({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M19 16v3H5v-3H3v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3h-2zm-6-3.33l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",id:"Download_svg__a"})),c().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"Download_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Download_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var wn=r(79573);const On=(0,T.Z)((()=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"0.2s linear all","&:not($selected):not($selectionMode):hover":{backgroundColor:"rgba(0,0,0,0.6)"},userSelect:"none"},selected:{backgroundColor:"rgba(0,114,206,0.6)"},selectionMode:{cursor:"pointer","&:not($selected)":{backgroundColor:"rgba(0,0,0,0.6)"}},button:{padding:0,width:"100px",height:"36px",color:"#fff",fontSize:"14px",fontWeight:500,lineHeight:"16px",border:"1px solid rgba(255,255,255,0.25)",backgroundColor:"rgba(98,2,238,0)"},checkedIcon:{position:"absolute",left:"4px",top:"4px",cursor:"pointer"},actions:{display:"flex",alignItems:"center",position:"absolute",top:"4px",right:"4px"},actionButton:{color:"#fff",fontSize:"24px"},dropDownMenuButton:{margin:"0 2px 0 8px"}}))),Cn=(0,s.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:l=wn.ZT,onSelect:o=wn.ZT,onShareLink:i,onSetAsDefault:u,onDelete:p,onDownload:d=wn.ZT,onClick:m}=e,g=On(),[h,f]=(0,s.useState)(!1),y=(0,s.useMemo)((()=>[{text:x().text("Share link"),onClick:i},{text:x().text("Set as default"),onClick:u},{text:x().text("Delete"),onClick:p}].filter((0,N.prop)("onClick"))),[i,u,p]),E=e=>()=>(0,N.ifElse)((0,N.equals)(!0),l,o)(e),v=r&&(n||h||a),w=!a&&!n&&h,O=r&&n;return c().createElement("div",{className:b()(g.overlay,{[g.selected]:n,[g.selectionMode]:a}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:a?E(n):e=>{e.currentTarget===e.target&&m()}},v&&c().createElement(xn,{className:g.checkedIcon,checked:n,onClick:E(n)}),w&&c().createElement("div",{className:g.actions},c().createElement(Lt.Z,{onClick:d,className:g.actionButton,icon:vn}),c().createElement(fe.Z,{menuId:`image-overlay-actions-${t}`,buttonComponent:Lt.Z,buttonProps:{icon:he.Z,className:b()(g.actionButton,g.dropDownMenuButton)},menuItems:y})),O&&c().createElement(Ze.Z,{className:g.button,variant:"outlined",onClick:l},x().text("Deselect")))}));var Tn=r(13896),Sn=r(58651),kn=r(8629),Nn=r(67358);const In=(0,T.Z)({loadingOverlay:{position:"absolute",width:"100%",height:"100%",top:0,left:0,opacity:.37,zIndex:10,backgroundColor:"#fff"},transparent:{backgroundColor:"transparent"}}),Pn=e=>{let{transparent:t=!1}=e;const r=In();return c().createElement("div",{className:b()(r.loadingOverlay,{[r.transparent]:t})},c().createElement(Nn.Z,{color:"secondary"}))};var Dn=r(74603);const An=(0,T.Z)((e=>({root:{width:"328px"},paper:{width:"100%",height:"40px",display:"flex",alignItems:"center",boxShadow:"none",backgroundColor:"rgba(0,0,0,0.03)"},inputRoot:{flex:1},input:{padding:"0 12px",fontSize:"14px","&:placeholder":{color:e.palette.text.secondary}},errorMessage:{marginTop:"8px",fontSize:"12px",color:e.palette.error.main}}))),Rn=e=>0===e.trim().length,jn=e=>{let{onSend:t}=e;const r=An(),[n,a]=(0,s.useState)(""),[l,o]=(0,s.useState)(null);return c().createElement(E.Z,{className:r.root},c().createElement(We.Z,{className:r.paper},c().createElement(Dn.Z,{value:n,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);a(t),r||Rn(t)?o(null):o(x().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:x().text("Paste an image URL here")}),c().createElement(Ze.Z,{disabled:Boolean(l)||Rn(n),variant:"outlined",color:"primary",onClick:()=>{t(n),a(""),o(null)}},x().text("Send"))),l&&c().createElement(v.Z,{className:r.errorMessage},l))};var Zn=r(83997);const Ln=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],_n=e=>{let{className:t,onAppendFile:r}=e;return c().createElement(c().Fragment,null,c().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:Ln.join(","),id:"upload-image-button",type:"file"}),c().createElement("label",{htmlFor:"upload-image-button"},c().createElement(Ze.Z,{className:t,variant:"contained",color:"primary",component:"span"},x().text("Select image"))))};function Mn(){return Mn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mn.apply(this,arguments)}const Vn=e=>c().createElement("svg",Mn({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},c().createElement("stop",{stopColor:"#FFF",offset:"0%"}),c().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},c().createElement("stop",{stopColor:"#FFF",offset:"0%"}),c().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),c().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},c().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),c().createElement("stop",{stopColor:"#000",offset:"100%"})),c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},c().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),c().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),c().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),c().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),c().createElement("g",{mask:"url(#UploadIcon_svg__b)"},c().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},c().createElement("path",{d:"M0 107.268c0 35.579 28.703 64.409 64.173 64.409h139.021c29.578 0 53.497-24.035 53.497-53.635 0-28.356-21.935-51.562-49.705-53.515C199.577 27.705 167.2 0 128.346 0 97.425 0 70.59 17.582 57.171 43.274 25.027 46.767 0 74.117 0 107.268z",fill:"#FFF",opacity:.3}),c().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),c().createElement("path",{d:"M127.979 8.91c38.773 0 70.206 31.895 70.206 71.24 0 39.346-31.433 71.241-70.206 71.241-6.067 0-11.954-.78-17.57-2.249 9.688-11.019 15.574-25.551 15.574-41.478 0-33.7-26.352-61.153-59.286-62.299C78.714 23.611 101.654 8.91 127.98 8.91z",fill:"url(#UploadIcon_svg__d)",opacity:.4})),c().createElement("path",{fill:"url(#UploadIcon_svg__e)",opacity:.12,d:"M82.093 128.474l38.374 37.966-10.666 18.958 72.714 71.94 63.578-57.537v-6.11l-71.107-70.352H97.22z",transform:"translate(-1 9)"}),c().createElement("path",{fill:"url(#UploadIcon_svg__f)",d:"M151.004 128.29v57.591h-40.836V128.29H81l49.5-49.409L180 128.29z",transform:"translate(-1 9)"})))),Un=(0,T.Z)((e=>({root:{padding:"36px 0 29px"},isActive:{backgroundColor:"rgba(0,114,206,0.12)"},icon:{width:"190px",height:"190px",marginBottom:"24px"},title:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px"},description:{marginBottom:"24px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),Bn=e=>{let{onAppendFile:t,className:r}=e;const n=Un(),[{canDrop:a,isOver:l},o]=(0,Tn.useDrop)({accept:[Zn.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),i=a&&l;return c().createElement("div",{ref:o,className:b()(n.root,{[n.isActive]:i},r)},c().createElement(Vn,{className:n.icon}),c().createElement(v.Z,{className:n.title},x().text("Drag an image here")),c().createElement(v.Z,{className:n.description},x().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),c().createElement(_n,{onAppendFile:t}))},zn=(0,T.Z)((e=>({root:{width:"100%",display:"flex",alignItems:"center",padding:"0 30px",boxSizing:"border-box"},border:{borderBottom:`1px solid ${e.palette.text.primary}`,flex:1,opacity:.12},text:{padding:"0 10px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),Fn=e=>{let{children:t,className:r}=e;const n=zn();return c().createElement(E.Z,{className:b()(n.root,r)},c().createElement(E.Z,{className:n.border}),c().createElement(v.Z,{className:n.text},t),c().createElement(E.Z,{className:n.border}))};var Hn=r(87685),Wn=r(37265);const qn=(0,T.Z)({closeIcon:{color:"#fff"}}),Gn=e=>{let{error:t,onClose:r}=e;const n=qn();return c().createElement(Wn.Z,{open:Boolean(t),onClose:r,message:t,action:c().createElement(be.k,{className:n.closeIcon,tooltipTitle:x().text("Close"),icon:Hn.default,onClick:r})})},$n=(0,T.Z)((e=>({root:{},dialogPaper:{position:"relative",maxWidth:"480px"},title:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",padding:"16px"},body:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 8px 49px",textAlign:"center"},targetBox:{marginBottom:"8px"},divider:{marginBottom:"28px"}}))),Kn=e=>{let{open:t,onClose:r,onUpload:n}=e;const a=$n(),l=(0,g.useSelector)(h.ZP.selectors.getImageServicePath),o=(0,g.useSelector)(h.ZP.selectors.getEnvironment),i=(0,g.useSelector)(h.ZP.selectors.getTenant),[p,d]=(0,s.useState)(!1),[m,f]=(0,s.useState)(null),b=e=>{d(!0),(0,u.Ixr)({image:e,imageServicePath:l,environment:o,tenant:i}).then((e=>{n(e),r()})).catch((e=>f(e.errorMessage))).finally((()=>d(!1)))};return c().createElement(Tn.DndProvider,{backend:Sn.default},c().createElement(kn.Z,{open:t,onClose:r,classes:{paper:a.dialogPaper}},c().createElement(v.Z,{className:a.title},x().text("Add new image")),c().createElement(E.Z,{className:a.body},c().createElement(Bn,{className:a.targetBox,onAppendFile:e=>{const t=Number((e.size/1024/1024).toFixed(2)),r=Ln.includes(e.type);t>20?f(x().text("File size exceeds configured max file size.")):r?b(e):f(x().text("File format is not supported."))}}),c().createElement(Fn,{className:a.divider},x().text("or")),c().createElement(jn,{onSend:e=>{b(e)}})),p&&c().createElement(Pn,null),c().createElement(Gn,{error:m,onClose:()=>f(null)})))},Yn={imageMargin:4,imageWidth:xr.SMALL.imageWidth,imageHeight:xr.SMALL.imageHeight},Xn=(0,T.Z)((()=>({root:{width:"100%",marginBottom:"10px"},image:e=>{let{imageMargin:t}=e;return{marginRight:t,cursor:"pointer","&:last-child":{marginRight:0}}},uploadContainer:e=>{let{imageMargin:t,imageWidth:r,imageHeight:n}=e;return{backgroundColor:"white",width:r,height:n,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),Qn=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:n,onChangeAttribute:a,requestNextPageOfAttributeValues:l,parentUri:o,paging:i,showNonOv:p,imageSize:d=Yn}=e;const m=Xn(d),f=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},b=(0,g.useSelector)((e=>h.ZP.selectors.getModifiedEntityDefaultProfilePic(e,f.uri))),y=(0,g.useDispatch)(),[x,E]=(0,s.useState)(!1),v=(0,s.useCallback)((()=>{E((e=>!e))}),[]),w=(0,s.useCallback)((e=>{const r=(0,u.hm5)(o,t.name),n={};for(const a in e){const l=(t.attributes||[]).find((e=>{let{name:t}=e;return t===a}));l&&(n[a]=[{uri:(0,u.hm5)(r,l.name),ov:!0,value:e[a],type:l.uri}])}a({attributeType:t,uri:r,value:n})}),[a,o,t]),O=(0,s.useCallback)((e=>{if(n(e),b===e.uri){var t;const n=(null===(t=r[0])||void 0===t?void 0:t.uri)===e.uri?r[1]:r[0];y(h.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:f.uri,value:n||{}}))}}),[n,f,b,r]),C=(e,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:l,onSetAsDefault:o}=e,i=(0,u.Q5d)(r),{uri:s}=r;return c().createElement(Cn,{id:s,onShareLink:()=>l(i),onSetAsDefault:()=>o(r),onDelete:()=>O({uri:s,attributeType:t}),onDownload:()=>a([i]),onClick:()=>n(s)})};return c().createElement("div",{className:m.root},c().createElement(Zo,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,u.efz)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return c().createElement("div",{className:m.image,key:n},c().createElement(Er,{src:r,overlay:C(e,t),onClick:()=>a(n),size:{imageWidth:d.imageWidth,imageHeight:d.imageHeight}}))},overlay:!0,countFixedItems:1,onUpload:v,onDeleteAttribute:O,imageSize:d,requestNextPageOfAttributeValues:l,paging:i,parentUri:o,showNonOv:p},c().createElement("div",{className:m.uploadContainer,onClick:v},c().createElement(Lt.Z,{className:m.uploadButton,iconClassName:m.uploadIcon,icon:hn.Z}))),c().createElement(Kn,{open:x,onUpload:w,onClose:v}))},Jn=(0,T.Z)((e=>({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"},caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),ea=e=>{let{className:t,message:r}=e;const n=Jn();return r?c().createElement(v.Z,{variant:"caption",className:b()(n.caption,t)},r):null};var ta=r(22983);const ra=(0,T.Z)((e=>({wrapper:{width:"100%"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},"editor-value":{flex:"1 1 auto"},"editor-actions":{display:"flex",alignItems:"center",paddingLeft:"8px"},addButton:{marginRight:"-8px"},button:{color:e.palette.text.secondary},placeholder:{height:"50px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary}})));var na=r(65314),aa=r(42494),la=r(74828);function oa(){return oa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oa.apply(this,arguments)}const ia=(0,s.memo)((e=>{let{errorMessage:t,children:r,className:n,classes:a}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const o=Jn(),i=!!t;return c().createElement(aa.Z,oa({className:b()(o.wrapper,n,null==a?void 0:a.root),error:!0},l),r,i&&c().createElement(la.Z,{className:b()(o.helperText,null==a?void 0:a.helperText)},c().createElement(ea,{message:t})))})),sa=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t}=arguments.length>1?arguments[1]:void 0;const{value:r,lookupCode:n}=e;switch(t){case u.oS0.TYPE_BOOLEAN:case u.oS0.TYPE_BOOLEAN_RADIO:case u.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,u.gxP)(r);case u.oS0.TYPE_DATE:return r&&u.P6Y.dates.toLocalDate(r)||null;case u.oS0.TYPE_LOCAL_DATE:case u.oS0.TYPE_TIMESTAMP:case u.oS0.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case u.oS0.TYPE_DEPENDENT_LOOKUP:case u.oS0.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}},ca=(e,t)=>{const{type:r}=(0,u.PFL)(e);switch(r){case u.oS0.TYPE_BOOLEAN:case u.oS0.TYPE_BOOLEAN_RADIO:case u.oS0.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case u.oS0.TYPE_DATE:return t&&tn()(t).format("YYYY-MM-DD")||"";case u.oS0.TYPE_TIMESTAMP:return t&&tn()(t).format()||"";case u.oS0.TYPE_ACTIVENESS_DATE:case u.oS0.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}},ua=(0,N.curry)(((e,t,r)=>({value:ca(t,r),uri:e.uri,attributeType:t}))),pa=c().createContext({enabled:!1,queueSizeThreshold:0});pa.Provider.propTypes={value:B().shape({enabled:B().bool,queueSizeThreshold:B().number})},pa.displayName="AsyncMountContext";let da=0;const ma=()=>{const e=(0,s.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,s.useContext)(pa),[n,a]=(0,s.useState)(!t||t&&da<r);e.current&&da++;const l=(0,s.useRef)();return(0,s.useEffect)((()=>{if(da--,!n)return l.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(l.current)}),[]),e.current=!1,n};function ga(){return ga=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ga.apply(this,arguments)}const ha=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,s.forwardRef)(((r,n)=>ma()?c().createElement(e,ga({},r,{ref:n})):t&&c().createElement(t,ga({},r,{ref:n}))));return r.displayName="WithAsyncMount",r};function fa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ba(e,t,r[t])}))}return e}function ba(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ya={};function xa(){return xa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xa.apply(this,arguments)}const Ea=e=>{let{className:t,attributeValue:r,attributeType:n,isReltioCrosswalk:a,ownError:l,mode:o,onAddOneMore:i,onDeleteAttribute:s,onChangeAttribute:p,onDeactivateError:d,additionalControlsRenderer:m,state:f}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state"]);const E=ra(),w="deleted"===f,O="edited"===f,C=(0,u.KIu)(o),T=(0,u.PFL)(n),S=sa(r,T),k=(0,u.Vg3)({attributeType:n,mode:o}),I=(0,u.yv0)({attributeType:n,attributeValue:r,mode:o,isReltioCrosswalk:a}),P=(0,u.xv5)({attributeType:n,attributeValue:r,mode:o,isReltioCrosswalk:a}),D=I&&C,A=(0,u.e$p)(l),R=(0,g.useSelector)((e=>(0,u.QEi)(n)?((e,t,r)=>{const n=h.ZP.selectors.getDependentLookupsStructureNode(e,r);if(n){const o=t.uri,{parents:i,missedParentsAttributeTypes:s}=((e,t,r)=>{const n=r.parents.flatMap((t=>{const r=h.ZP.selectors.getDependentLookupsStructureNode(e,t);return r.values.map((e=>fa({},e,{type:t,dependentLookupCode:r.attrType.dependentLookupCode})))})),a=h.ZP.selectors.getModifiedEntities(e),l=h.ZP.selectors.getEntityUri(e),o=h.ZP.selectors.getAllRelationsToAddAndEdit(e),i=(0,u.vUy)({parentValues:n,valueUri:t,entityUri:l,modifiedEntities:a,connections:o}),s=r.parents.map((t=>h.ZP.selectors.getDependentLookupsStructureNode(e,t).attrType)).filter((e=>!i.some((t=>{let{type:r,value:n}=t;return n&&r===e.uri}))));return{parents:Object.values(i.reduce(((e,t)=>{var r;return fa({},e,{[t.dependentLookupCode]:{type:t.dependentLookupCode,codeValues:(0,N.uniq)([t.value,...(null===(r=e[t.dependentLookupCode])||void 0===r?void 0:r.codeValues)||[]]).filter(Boolean).sort()}})}),{})),missedParentsAttributeTypes:s}})(e,o,n),{isBlocked:c=!1}=h.ZP.selectors.getDependentLookupEditorState(e,o)||{},p=(a=s).length?x().text("Please select value for ${labels} ${attributes}.",{labels:(l=a.map((0,N.pipe)((0,N.prop)("label"),(e=>`'${e}'`))),l.reduce(((e,t,r)=>[e,t].join(r===l.length-1?` ${x().text("and")} `:", ")))),attributes:1===a.length?x().text("attribute"):x().text("attributes")}):"",d=h.ZP.selectors.getLookupAutocomplete(e),m=(0,u.Vmh)(d,r),g=!(null!=t&&t.lookupCode||null!=t&&t.value)&&c&&x().text("Populating values...")||p||"",f={parents:i,disabled:!!p||c,placeholder:g,autopopulationId:m?o:null};return g&&(f.value=null),((e,t)=>{const r=ya[e];return(0,N.equals)(t,r)?r:((0,N.equals)(null==r?void 0:r.parents,t.parents)&&(t.parents=r.parents),ya[e]=t,t)})(o,f)}var a,l})(e,r,null==n?void 0:n.uri):null)),j=()=>{s({uri:r.uri,attributeType:n}),(0,u.PcX)(l)!==u.NIO.missed&&Z()},Z=()=>{l&&d((0,u.iFp)(l))};if(D){const e=!!i&&k&&!n.singleValue,a=!w&&!!s&&P,l=!!A,o=w?{disabled:!0}:{};return c().createElement("div",{className:b()(E.editor,t)},c().createElement(ia,{errorMessage:A},c().createElement("div",{className:b()(E["editor-value"],{[E.deleted]:w})},c().createElement(na.Z,xa({fieldName:(0,u.Tde)(n.uri),value:S,dataTypeDefinition:T,error:l,onChange:(0,N.pipe)(ua(r,n),p,Z),fullWidth:!0},R,y,o)))),c().createElement("div",{className:E["editor-actions"]},O&&c().createElement(v.Z,{variant:"caption",className:E.editedLabel},"(",x().text("edited"),")"),e&&c().createElement(Lt.Z,{icon:$r.Z,onClick:i,size:"L",className:b()(E.addButton,E.button)}),m&&m({attributeType:n,attributeValue:r}),a&&c().createElement(Lt.Z,{className:E.button,icon:ta.Z,onClick:j,size:"L"})))}return c().createElement("div",{className:t},c().createElement(rt.Z,{value:(0,u.kDl)(r),dataTypeDefinition:T}))};Ea.propTypes={className:B().string,attributeValue:u.cNQ,attributeType:u.EMD,ownError:u.wfT,isReltioCrosswalk:B().bool,state:B().oneOf(["deleted","edited"]),mode:u.XGc,onAddOneMore:B().func,onDeleteAttribute:B().func,onChangeAttribute:B().func,onDeactivateError:B().func,additionalControlsRenderer:B().func};const va=(0,s.memo)(ha(Ea,(()=>{const e=ra();return c().createElement("div",{className:e.placeholder})}))),wa=(0,T.Z)((e=>({editor:{display:"flex",flex:1,height:"36px",alignItems:"center"},label:{flex:1,marginLeft:"2px",marginTop:"2px",fontSize:"13px",lineHeight:"15px"},actions:{display:"flex",alignItems:"center"},titleContainer:{display:"flex",flex:1,minHeight:"20px"},expandButton:{marginTop:"2px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary},errorWrapperHelperText:{marginLeft:0}}))),Oa=[u.xPW.roles.uri,u.xPW.tags.uri],Ca=(e,t,r,n)=>{const a=(0,N.pipe)(u.nt9,(0,N.defaultTo)({}),(0,N.props)(["attributes","analyticsAttributes"]),(0,N.reject)(N.isNil),N.flatten,(0,N.concat)(N.__,(0,N.pipe)(N.values,(0,N.reject)((0,N.propEq)("uri",u.xPW.id.uri)))(u.xPW)))(e,t);return r.length?a.filter((e=>{let{uri:t}=e;return r.includes(t)})):a.filter((e=>{let{uri:t}=e;return!n.includes(t)}))},Ta=(e,t)=>(0,N.partition)((0,N.pipe)((0,N.path)(["attrType","uri"]),(0,N.includes)(N.__,e)),t),Sa=c().createContext(null);function ka(){return ka=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ka.apply(this,arguments)}const Na=e=>{let{attrTypes:t,entity:r,parentUri:n,showEmptyEditors:a,mode:l,crosswalks:o,drawLines:i,children:p,className:d,alwaysVisibleTypeUris:m=Oa,onAddAttributes:g,onChangeAttribute:h,onDeleteAttribute:f,additionalControlsRenderer:b,showNonOv:y}=e;const{attributes:E={}}=r,v=(0,s.useMemo)((()=>(0,u._kX)(l,t)),[t,l]),w=((e,t)=>e.filter((e=>{const r=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,N.cond)([[u.kqr,(0,N.always)(t)],[(0,N.both)(u.kQw,(0,N.always)(n)),(0,N.always)(n)],[N.T,(0,N.always)(r)]])(e)})(e,t),n=(e=>(0,u.kqr)(e)?"uri":"name")(e);return!(e.singleValue&&(0,N.has)(e[n])(r))})))(v,r),O=(0,s.useContext)(Sa),C=(0,s.useMemo)((()=>(0,u.Gtj)(t,l,r,a,y,O)),[t,l,r,a,y,O]),[T,S]=(0,s.useMemo)((()=>Ta(m,C)),[C,m]),k=(0,s.useCallback)((e=>{g(e.map((e=>({attributeType:e,parentUri:n}))))}),[g,n]),I={enabled:i};return c().createElement("div",{className:d},p&&c().createElement(D,I,p),c().createElement(D,ka({},I,{plain:!0}),v.length>0&&c().createElement(Jr,{label:x().text("More attributes"),onApply:k,dense:i,data:w})),S.concat(T).map((e=>{let{attrType:t,values:r}=e;return c().createElement(eo,{key:t.uri,attributeType:t,drawLines:i,values:r,paging:(0,N.path)(["paging",t.uri],E),parentUri:n,showEmptyEditors:a,mode:l,crosswalks:o,onAddAttributes:g,onChangeAttribute:h,onDeleteAttribute:f,additionalControlsRenderer:b,showNonOv:y})})))};Na.propTypes={attrTypes:B().array,entity:B().object,parentUri:B().string,children:B().node,showEmptyEditors:B().bool,mode:u.XGc,crosswalks:B().array,drawLines:B().bool,showNonOv:B().bool,className:B().string,alwaysVisibleTypeUris:B().array,onAddAttributes:B().func,onChangeAttribute:B().func,onDeleteAttribute:B().func,additionalControlsRenderer:B().func};const Ia=(0,s.memo)(Na);function Pa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Da=e=>{let{label:t,attributeTypesList:r,attributeType:n,attributeValue:a,children:l,errors:o,ownError:i,mode:p,metadata:d,crosswalks:m,lazy:g,showEmptyEditors:h,onAddOneMore:f,onAddAttributes:y,onDeleteAttribute:E,onChangeAttribute:w,additionalControlsRenderer:O,hideDeleteButton:C,state:T,showNonOv:S}=e;const k=wa(),N="deleted"===T,I="edited"===T,P=a.uri,D=(0,u.ZiX)(P),[A,R]=(0,s.useState)(D),j=(0,s.useMemo)((()=>(0,u.xv5)({attributeType:n,attributeValue:a,mode:p,metadata:d,isReltioCrosswalk:(0,u.KVV)(m,a)})),[n,a,p,d,m]),Z=!N&&!C&&!!E&&j,L=(0,s.useMemo)((()=>(0,u.J6q)(a,o)),[o,a]);(0,s.useEffect)((()=>{L&&R(!0)}),[o,L]),(0,s.useEffect)((()=>{N&&R(!1)}),[N]);const _=(r||[]).some((e=>(0,u.kQw)(e))),M=(0,s.useMemo)((()=>({attributes:_?null:a.value,analyticsAttributes:_?a.value:null})),[a,_]),V=(0,u.e$p)(i)||L&&x().text("Has an incorrect value")||"";return g?c().createElement(Ze.Z,{variant:"text",color:"primary",onClick:f},"Create attribute"):c().createElement(c().Fragment,null,c().createElement("div",{className:k.editor},c().createElement("div",{className:k.titleContainer},c().createElement(Ut,{onClick:()=>R((e=>!e)),expanded:A,className:k.expandButton,disabled:N}),c().createElement(ia,{errorMessage:V,classes:{helperText:k.errorWrapperHelperText}},c().createElement("div",{className:b()(k.label,{[k.deleted]:N})},t))),c().createElement("div",{className:k.actions},I&&c().createElement(v.Z,{variant:"caption",className:k.editedLabel},"(",x().text("edited"),")"),O&&O({attributeType:n,attributeValue:a}),Z&&c().createElement(Lt.Z,{icon:ta.Z,onClick:()=>E({uri:P,attributeType:n,attributeValue:a}),size:"L"}))),A&&c().createElement(Ia,{attrTypes:r,entity:M,showEmptyEditors:h||D,drawLines:!0,parentUri:P,mode:p,crosswalks:m,onAddAttributes:y,onChangeAttribute:w,onDeleteAttribute:E,additionalControlsRenderer:O,showNonOv:S},l))};Da.propTypes=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Pa(e,t,r[t])}))}return e}({label:B().string,children:B().node,attributeTypesList:B().arrayOf(u.EMD),attributeValue:B().oneOfType([u.dMV,u.Rtp])},u.KVe);const Aa=Da;function Ra(){return Ra=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ra.apply(this,arguments)}const ja=e=>{const{attributeValue:t,attributeType:r}=e,n=(0,u.Kxm)(t,r.dataLabelPattern);return c().createElement(Aa,Ra({label:(0,u.idV)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))};ja.propTypes=u.j2V;const Za=(0,s.memo)(ja);var La=r(84425),_a=r(42662),Ma=r(12231);const Va=(0,T.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}}),Ua=(0,T.Z)((e=>({singleValue:{color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",paddingTop:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},linkValue:{cursor:"pointer",color:e.palette.primary.main,textDecoration:"none"}}))),Ba=(0,T.Z)((e=>({addLabel:{color:e.palette.primary.main,display:"flex",fontWeight:"500",cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},groupHeading:{fontSize:"13px",height:"36px",padding:"0 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),za=(0,T.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}});function Fa(){return Fa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fa.apply(this,arguments)}const Ha=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=Va(),{uri:o,entityType:i,label:s,secondaryLabel:u}=a;return""!==o?c().createElement(Ma.Z,Fa({className:l.entityContainer,ref:t,key:o,onClick:()=>n({label:s,uri:o,entityType:i})},r),c().createElement(_a.Z,{className:l.entityAvatar,entityType:i}),c().createElement("span",{className:l.entityLabel},s,u&&c().createElement("span",{className:l.entitySecondaryLabel},", ",u))):c().createElement(Ma.Z,Fa({className:l.entityContainer,ref:t,key:o},r,{disabled:!0}),c().createElement("span",{className:l.emptyEntityLabel},x().text("No results found")))};Ha.propTypes={innerRef:B().oneOfType([B().oneOf([null]),B().func,B().shape({current:B().any.isRequired})]),innerProps:B().object.isRequired,selectOption:B().func.isRequired,data:B().shape({uri:B().string.isRequired,label:B().string.isRequired,entityType:u.pyR.isRequired})};const Wa=Ha;var qa=r(12212);const Ga=e=>{const{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:n},children:a,data:l}=e,o=Ua(),i=(0,g.useDispatch)(),p=(0,s.useContext)(qa.m),d=(0,g.useSelector)(h.ZP.selectors.getUIPath),m=(0,u.ZiX)(l.entityUri)?{className:o.singleValue,component:"span"}:{className:b()(o.singleValue,o.linkValue),onMouseDown:e=>{e.stopPropagation(),n||(0,N.pipe)((0,N.always)({uri:l.entityUri,viewId:p}),h.ui.actions.openEntity,i)()},onClick:e=>e.preventDefault(),href:(0,u.ChB)({uiPath:d,uri:l.entityUri}),component:"a"};return!r&&c().createElement(v.Z,m,(0,u.ZiX)(l.entityUri)?x().text(`New ${t.label} will be created`):(0,u.idV)(a))};Ga.propTypes={children:B().string,data:B().object.isRequired,selectProps:B().object.isRequired};const $a=Ga;var Ka=r(33375),Ya=r(61837);const Xa=e=>{const{selectProps:{onClear:t}}=e,r=za();return c().createElement(Ya.Z,{onClick:t},c().createElement(Ka.Z,{className:r.clearIcon}))};Xa.propTypes={selectProps:B().object.isRequired};const Qa=Xa,Ja=e=>e&&e.attributes,el=e=>{let{entity:t,entityType:r,attributeTypesSelectionStrategy:n=Ja,mode:a,onAddAttributes:l,onDeleteAttribute:o,onChangeAttribute:i}=e;const u=(0,s.useMemo)((()=>n(r)),[n,r]);return t?c().createElement(Ia,{attrTypes:u,entity:t,showEmptyEditors:!0,drawLines:!0,parentUri:t.uri,mode:a,crosswalks:t.crosswalks,onAddAttributes:l,onChangeAttribute:i,onDeleteAttribute:o}):null};el.propTypes={entityUri:B().string,parentUri:B().string,entity:B().object,entityType:B().object,attributeTypesSelectionStrategy:B().func,mode:u.XGc,onAddAttributes:B().func,onDeleteAttribute:B().func,onChangeAttribute:B().func};const tl=el,rl={onAddAttributes:h.N5.actions.addAttributes,onDeleteAttribute:h.N5.actions.removeAttribute,onChangeAttribute:h.N5.actions.modifyAttribute},nl=(0,g.connect)(((e,t)=>({entity:t.entityUri&&h.ZP.selectors.getModifiedEntity(e,t.entityUri)})),rl)(tl);var al=r(92391);const{Group:ll}=al.F,ol=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,l=Ba();return c().createElement(ll,e,c().createElement("div",{className:l.groupHeading},c().createElement("span",null,n.label),r&&c().createElement("span",{onClick:()=>r(t,n.entityType),className:l.addLabel},c().createElement($r.Z,{className:l.addIcon}),x().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};ol.propTypes={selectProps:B().object.isRequired,data:B().object,children:B().array};const il=ol,sl=(0,T.Z)({creatorWrapper:{marginTop:"20px"}});function cl(){return cl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cl.apply(this,arguments)}function ul(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){pl(e,t,r[t])}))}return e}function pl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dl=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a,onChange:l,onCreate:o,metadata:i,globalSearchRequestOptions:p,attributeTypesSelectionStrategy:d,disableLinkClick:m}=e,g=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const h=sl(),[f,b]=(0,s.useState)(""),y=(0,s.useMemo)((()=>r.map((e=>(0,u.nt9)(i,e)))),[r,i]),E=[{filter:"equals",fieldName:"type",values:r.map(u.nIW)}],v=ul({},p,{max:a}),w=o?(e,t)=>{o(t||r[0],e),b("")}:void 0,O=e=>{null!==e&&(b(""),l(e))},C=(0,s.useMemo)((()=>1!==y.length),[y]),T=((0,N.isEmpty)(t)?y[0]:(0,u.nt9)(i,t.entityType))||{},S=o&&x().text(`Create ${f?`"${f}" as `:""}new ${T.label}`),k=x().text(`Select ${1===y.length?`${y[0].label} `:""}profile`),I=!(0,N.isEmpty)(t)&&(0,u.ZiX)(t.entityUri),P=C?{Group:il,GroupHeading:wn.Vd}:{},D=I?{ClearIndicator:Qa}:{};return c().createElement(c().Fragment,null,c().createElement(La.Z,cl({value:(0,N.isEmpty)(t)?void 0:t,inputValue:f,onInputChange:e=>{b(e)},getOptions:e=>(0,u.ZOr)(E,v,e).then((e=>t=>{const r=t.map((t=>ul({},t,{label:(0,u.idV)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),n=e=>(0,N.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e;return e.length>1?e.map((e=>({label:e.label,entityType:e.uri,options:n(r.filter((t=>t.type===e.uri)))}))):n(r)})(y)),getOptionLabel:(0,N.prop)("entityLabel"),onChange:O,onCreate:w,onClear:()=>{O({})},label:k,createLabel:S,components:ul({Option:Wa,SingleValue:$a},P,D),currentEntityType:T,isClearable:!0,disableLinkClick:m},g)),I&&c().createElement("div",{className:h.creatorWrapper},c().createElement(nl,{mode:n,attributeTypesSelectionStrategy:d,entityType:T,entityUri:t.entityUri})))};dl.propTypes={entity:u.oZZ,entityTypesUris:B().arrayOf(B().string),max:B().number,mode:u.XGc,dispatch:B().func,metadata:u.pGS,onChange:B().func.isRequired,onCreate:B().func,attributeTypesSelectionStrategy:B().func,globalSearchRequestOptions:B().object,disableLinkClick:B().bool};const ml=dl,gl=(0,T.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function hl(){return hl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hl.apply(this,arguments)}function fl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bl(e,t,r[t])}))}return e}function bl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yl=e=>{const t=gl(),{modifiedEntity:r,metadata:n,globalSearchRequestOptions:a,onDeleteModifiedEntity:l,onUpdateModifiedEntity:o,onDeactivateError:i}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["modifiedEntity","metadata","globalSearchRequestOptions","onDeleteModifiedEntity","onUpdateModifiedEntity","onDeactivateError"]),{attributeValue:d,attributeType:m,mode:g,crosswalks:h,errors:f,onChangeAttribute:y}=p,x=(0,s.useRef)(d),E=(0,u.CZ8)(d),v=(0,u.o96)(d),w=(0,u.Poc)(m),O=(0,u.nt9)(n,w),C=r?(0,u.Kxm)(r,O.dataLabelPattern):d.label,T=(0,s.useMemo)((()=>[w]),[w]),S=(0,s.useMemo)((()=>(0,u.EtK)(h,v)),[h,v]),k=(0,s.useMemo)((()=>(0,u.mbo)(d,f)),[d,f]),I=(0,s.useMemo)((()=>E&&{entityUri:(0,u.ZTM)(E),entityType:(0,u.uGi)(E),entityLabel:d.label}),[E,d.label]),P=(0,s.useMemo)((()=>(0,u.tF$)(m).map((e=>(0,u.zeJ)(n,e))).filter(N.identity)),[m,n]),D=(0,s.useCallback)((e=>(0,u.ct9)(m,e)),[m]),A=(0,s.useCallback)((e=>{r&&l(r.uri);const t=x.current,n=!(0,N.isEmpty)(e)&&e.uri===(0,u.bwT)(t),a=fl({},d,{label:e.label,refEntity:n?t.refEntity:(0,u.fmQ)(e),refRelation:n?t.refRelation:(0,u.NBq)(d)});y({value:a,attributeType:m,uri:d.uri}),k&&i((0,u.iFp)(k))}),[d,m,r,y,l,i,k]),R=(0,s.useCallback)(((e,t)=>{const r=(0,N.pipe)(D,(0,u._kX)(g))(O),a=(0,u.pBq)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:n,mode:g});A(a),o(a)}),[D,g,O,n,A,o]),j=(0,s.useMemo)((()=>(0,u.yv0)({attributeType:m,attributeValue:d,mode:g,isReltioCrosswalk:(0,u.KVV)(h,d)})),[m,d,g,h]),Z=(0,s.useMemo)((()=>(0,u.d89)(g,O)),[g,O]),L=(0,u.e$p)(k);return c().createElement(Aa,hl({},p,{label:(0,u.idV)(C),attributeTypesList:P,crosswalks:S,metadata:n}),c().createElement(ia,{errorMessage:L},c().createElement(ml,{className:b()(t.item,{[t.dense]:L||I&&(0,u.ZiX)(I.entityUri)}),entity:I||{},entityTypesUris:T,max:20,globalSearchRequestOptions:a,mode:g,onChange:j?A:void 0,onCreate:Z?R:void 0,metadata:n,attributeTypesSelectionStrategy:D})))};yl.propTypes=fl({},u.NkU,{modifiedEntity:u.pyR,metadata:u.pGS,globalSearchRequestOptions:B().object,onDeleteModifiedEntity:B().func,onUpdateModifiedEntity:B().func,onDeactivateError:B().func});const xl=(0,s.memo)(yl),El={onDeleteModifiedEntity:h.N5.modifiedEntities.actions.entityDeleted,onUpdateModifiedEntity:h.N5.modifiedEntities.actions.entityCreated,onDeactivateError:h.N5.errors.actions.errorDeactivated},vl=(0,g.connect)(((e,t)=>{const r=(0,u.bwT)(t.attributeValue);return{modifiedEntity:(0,u.ZiX)(r)?h.ZP.selectors.getModifiedEntity(e,r):null,metadata:h.ZP.selectors.getMetadata(e),globalSearchRequestOptions:h.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"])}}),El)(xl);function wl(){return wl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wl.apply(this,arguments)}const Ol=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{showEmptyEditors:r,onAddAttributes:n,lazy:a,errors:l,crosswalks:o,showNonOv:i}=t,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv"]);switch(e.type){case u.oS0.TYPE_NESTED:return c().createElement(Za,t);case u.oS0.TYPE_REFERENCE:return c().createElement(vl,t);default:return c().createElement(va,wl({isReltioCrosswalk:(0,u.KVV)(o,t.attributeValue)},s))}}}.build(t,e)},Cl=(0,T.Z)((e=>({caption:{fontSize:"0.7rem",opacity:.54},wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start"},attributesWrapper:{width:"100%",marginBottom:"10px"},link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"},title:{fontSize:"12px",lineHeight:"14px",paddingLeft:"12px",paddingBottom:"4px",color:e.palette.text.secondary},typeError:{marginLeft:"12px"}}))),Tl=e=>x().text("${value}",{value:1===e?x().text("value"):x().text("values")}),Sl=(0,N.has)("minValue"),kl=(0,N.has)("maxValue"),Nl=(0,N.pipe)(kl,N.not),Il=(0,N.propSatisfies)((e=>1===e),"minValue"),Pl=e=>{let{minValue:t}=e;return x().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:x().number(t,"0"),minValueCaption:Tl(t)})},Dl=e=>{let{maxValue:t}=e;return x().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:x().number(t,"0"),maxValueCaption:Tl(t)})},Al=(0,N.cond)([[N.isNil,(0,N.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return x().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:x().number(t,"0"),minValueCaption:Tl(t)})}],[(0,N.allPass)([Il,kl]),Dl],[(0,N.allPass)([Il,Nl]),(0,N.always)("")],[(0,N.allPass)([Sl,kl]),e=>{let{minValue:t,maxValue:r}=e;return x().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:Pl({minValue:t}),maxValue:x().number(r,"0"),maxValueCaption:Tl(r)})}],[kl,Dl],[Sl,Pl],[N.T,(0,N.always)("")]]),Rl=e=>{let{cardinality:t}=e;const r=Cl();return c().createElement(v.Z,{variant:"caption",className:r.caption},Al(t))};Rl.propTypes={cardinality:u.oA3};const jl=Rl,Zl=(0,N.filter)((0,N.propSatisfies)(u.ZiX,"uri")),Ll=e=>{let{max:t,values:r,attributeType:n,parentUri:a,mode:l,drawLines:o,showEmptyEditors:i,errorMessage:p,errors:d,paging:m,crosswalks:g,showNonOv:h,onAddAttributes:f,onDeleteAttribute:b,onChangeAttribute:y,onDeactivateError:x,additionalControlsRenderer:E,requestNextPageOfAttributeValues:v}=e;const w=Cl(),[O,C]=(0,s.useState)(t),[T,S]=(0,s.useState)(!1),{label:k,required:I,cardinality:P,name:A,uri:R}=n,j=(0,u.KIu)(l),Z=(0,s.useContext)(Sa),L=(0,s.useMemo)((()=>null==Z?void 0:Z.includes(R)),[R,Z]),_=(0,u.O27)(r),M=(!T&&i||I||L)&&_,V=(0,s.useRef)((0,u.gjI)({parentUri:a,attributeType:n})),U=(0,s.useCallback)((()=>{C(O+1);const e={parentUri:a,index:O,attributeType:n};return f(M&&!(0,u.YkM)(n.type)?[e,e]:[e])}),[O,f,a,n,M]),B=(0,s.useCallback)((0,N.pipe)(b,N.T,S),[b,S]);if(_&&!M)return null;if(M&&_&&(r=[V.current]),(0,u.O27)(r))return null;const z=(Zl(r)||[]).length,F=h?"totalValues":"totalOvValues",H=(0,N.ifElse)((0,N.has)(F),(0,N.pipe)((0,N.prop)(F),(0,N.add)(z)),(0,N.always)(r.length))(m),W=t<H,q=W&&O<H,G=W&&O>=H,$=r.slice(0,O),K=$?$.length-1:0,Y=H-O;return c().createElement(D,{enabled:o},c().createElement("div",{className:w.wrapper},c().createElement(Q,{label:k,isRequired:I,className:w.title,attributeType:n}),j&&c().createElement(jl,{cardinality:P}),j&&c().createElement(ea,{message:p,className:w.typeError}),c().createElement("div",{className:w.attributesWrapper},$.map(((e,t)=>c().createElement(Ol,{key:e.uri,attributeValue:e,attributeType:n,lazy:M&&!I,showEmptyEditors:i,errors:d,ownError:(0,u.ADq)(e,t,n.uri,d),mode:l,crosswalks:g,onAddOneMore:K===t?U:null,onAddAttributes:f,onDeleteAttribute:B,onChangeAttribute:y,onDeactivateError:x,additionalControlsRenderer:E}))),q&&c().createElement(ir,{moreNumber:(0,N.min)(t,Y),valueNumber:Y,onClick:()=>{r.length<H&&v({parentUri:a,attributeTypeUri:R,attributeTypeName:A,values:r,defaultMaxValues:t}),C(O+t)}}),G&&c().createElement(cr,{onClick:()=>{C(t)}}))))};var _l=r(90590),Ml=r(92145);const Vl=(0,T.Z)({valueContainer:{marginLeft:"8px",width:0}}),Ul={MultiValue:Ml.Z},Bl=e=>{let{values:t}=e;const r=Vl(),n=(0,g.useDispatch)(),a=(0,g.useSelector)(h.ZP.selectors.getMetadata),l=(0,g.useSelector)(h.ZP.selectors.getEntity),o=l.uri,i=(0,u.JvE)(a,l.type).map((e=>({value:e.uri,label:e.label}))),s=t.map((e=>{var t;return{value:e,label:(null===(t=i.find((0,N.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,u.nIW)(e)}}));return c().createElement(_l.Z,{label:"",height:40,isMulti:!0,options:i,value:s,onChange:e=>{const t=(null==e?void 0:e.map((0,N.prop)("value")))||[];n(h.N5.actions.modifyAttribute({value:t,attributeType:u.xPW.roles,uri:o}))},components:Ul,classes:r})};var zl=r(7766);const Fl=e=>e?`?filter=${(0,u.Uqd)()((e=>[{filter:"containsWordStartingWith",fieldName:"tags",values:[e]}])(e))}`:"",Hl=[{fieldName:"tags",orderType:"reversedCount"}],Wl=e=>(0,u.FK9)({query:Fl(e),body:Hl}).then((e=>Object.keys(e.tags))),ql=e=>{let{className:t,values:r}=e;const n=(0,g.useDispatch)(),a=(0,g.useSelector)(h.ZP.selectors.getEntityUri),l=(0,s.useCallback)((e=>n(h.N5.actions.modifyAttribute({value:e,attributeType:u.xPW.tags,uri:a}))),[n,a]);return c().createElement(zl.Z,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r,onChange:l,getSuggestions:Wl})};function Gl(){return Gl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gl.apply(this,arguments)}function $l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Kl=e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:l}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage"]);const i=Cl(),{label:p,required:d,cardinality:m}=r,g=(0,u.KIu)(a),h=(0,s.useRef)((0,u.gjI)({parentUri:n,attributeType:r}));return c().createElement(E.Z,{className:i.wrapper},c().createElement(Q,{label:p,isRequired:d,className:i.title,attributeType:r}),g&&c().createElement(jl,{cardinality:m}),g&&c().createElement(ea,{message:l}),c().createElement(E.Z,{className:i.attributesWrapper},(()=>{switch(r.uri){case u.xPW.tags.uri:return c().createElement(ql,{values:t});case u.xPW.roles.uri:return c().createElement(Bl,{values:t});default:{const e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$l(e,t,r[t])}))}return e}({},h.current,{value:t[0]||""});return c().createElement(Ol,Gl({attributeValue:e,attributeType:r,mode:a},o))}}})()))};function Yl(){return Yl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yl.apply(this,arguments)}var Xl;!function(e){e.imageLine="imageLine",e.special="special",e.default="default"}(Xl||(Xl={}));const Ql=(0,s.memo)((e=>{let{values:t,attributeType:r,mode:n=u.ARY.Viewing,crosswalks:a,drawLines:l,paging:o={},parentUri:i,errors:s,errorMessage:p,max:d=1/0,showEmptyEditors:m,showNonOv:g,onAddAttributes:h,onDeleteAttribute:f,onChangeAttribute:b,onDeactivateError:y,additionalControlsRenderer:x,requestNextPageOfAttributeValues:E}=e;const v=Cl(),w=(0,N.partition)(u.OXP),[O]=w(t),C=g?t:O,T={errorMessage:p,errors:s,mode:n,parentUri:i,onAddAttributes:h,onDeleteAttribute:f,onChangeAttribute:b,onDeactivateError:y,additionalControlsRenderer:x};return(()=>{switch((0,N.cond)([[u.kqr,(0,N.always)(Xl.special)],[u.Or$,(0,N.always)(Xl.imageLine)],[N.T,(0,N.always)(Xl.default)]])(r)){case Xl.special:return c().createElement(D,{enabled:l},c().createElement(Kl,Yl({values:C,attributeType:r},T)));case Xl.imageLine:return c().createElement(D,{enabled:l},c().createElement("div",{className:v.wrapper},c().createElement(Q,{label:null==r?void 0:r.label,attributeType:r}),c().createElement(Qn,{attributeValues:C,attributeType:r,paging:o,onDeleteAttribute:f,parentUri:i,onChangeAttribute:b,requestNextPageOfAttributeValues:E,showNonOv:g})));default:return c().createElement(Ll,Yl({values:C,attributeType:r,max:d,paging:o,crosswalks:a,showEmptyEditors:m,drawLines:l,requestNextPageOfAttributeValues:E,showNonOv:g},T))}})()})),Jl={requestNextPageOfAttributeValues:h.N5.actions.requestNextPageOfAttributeValues,onDeactivateError:h.N5.errors.actions.errorDeactivated},eo=(0,g.connect)(((e,t)=>{let{parentUri:r,attributeType:n,max:a}=t;return{errors:h.ZP.selectors.getActiveErrorsForAttributesPager(e,r,n),errorMessage:(0,u.tQX)(r,n,h.ZP.selectors.getProfileErrors(e)),max:a||h.ZP.selectors.getDefaultMaxValues(e)}}),Jl)(Ql),to=(0,T.Z)({root:{},form:{padding:"10px 0"},divider:{width:"100%",height:"1px",background:"rgba(255,255,255,0.12)"},actions:{display:"flex",justifyContent:"flex-end",marginTop:"4px"},cancelButton:{color:"white",marginRight:"8px"}}),ro=e=>{let{attributeType:t,imageAttributeFieldsOrder:r,attributeValue:n,hasChanges:a,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i,onCancel:s,onApply:p,mode:d}=e;const m=to(),g=on(n,t,r),h=0!==g.length||0===g.length&&a;return c().createElement(E.Z,{className:m.root},c().createElement(E.Z,{className:m.form},g.map((e=>{let{attrType:t,values:r}=e;return c().createElement(eo,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,u.ZiX)(n.uri),mode:d,drawLines:!1,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i})}))),h&&c().createElement(c().Fragment,null,c().createElement(jr.Z,{className:m.divider}),c().createElement(E.Z,{className:m.actions},c().createElement(Ze.Z,{disabled:!a,onClick:s,className:m.cancelButton},x().text("Cancel")),c().createElement(Ze.Z,{disabled:!a,onClick:p,color:"primary"},x().text("Apply")))))},no={palette:{type:"dark",primary:u.rSc.palette.primary,secondary:u.rSc.palette.secondary}},ao=(0,Ar.Z)(no),lo=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:n}=e;const{addAttributes:a,changeAttribute:l,deleteAttribute:o,clearLocalChanges:i,applyLocalChanges:p,attributeValue:d,hasChanges:m}=(e=>{let{initialAttributeValue:t,attributeType:r}=e;const n=(0,g.useDispatch)(),a=(0,s.useContext)(qa.m),[l,o]=(0,s.useState)(t);(0,s.useEffect)((()=>{o(t)}),[t]);const i=!(0,N.equals)(l,t),c=(0,s.useCallback)((e=>{o((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,u.tPT)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),p=(0,s.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;o((e=>(0,u.ww$)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),d=(0,s.useCallback)((e=>{let{attributeType:t,uri:r}=e;o((e=>(0,u.d$I)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:c,changeAttribute:p,deleteAttribute:d,clearLocalChanges:(0,s.useCallback)((()=>{o(t)}),[t]),applyLocalChanges:(0,s.useCallback)((()=>{n(h.N5.actions.modifyAttribute({value:l,attributeType:r,uri:l.uri,viewId:a}))}),[l,r,a,n]),attributeValue:l,hasChanges:i}})({attributeType:r,initialAttributeValue:n}),f=(0,g.useSelector)(h.ZP.selectors.getMode),b=(0,g.useSelector)(h.ZP.selectors.getIsEditableMode);return c().createElement(Rr.ThemeProvider,{theme:ao},c().createElement(E.Z,null,c().createElement(un,{attributeType:r,uri:null==d?void 0:d.uri,onAddAttributes:b?a:void 0}),c().createElement(gn,{attributeType:r,attributeValue:d,imageAttributeFieldsOrder:t}),b&&c().createElement(ro,{mode:f,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:d,hasChanges:m,onDeleteAttribute:o,onChangeAttribute:l,onAddAttributes:a,onCancel:i,onApply:p})))},oo=(0,T.Z)((e=>({root:{position:"relative",backgroundColor:"#333",maxHeight:"calc(100vh - 64px)",overflow:"hidden"},header:{display:"flex",alignItems:"center",height:"56px",paddingLeft:"16px",boxShadow:`0 1px 0 0 ${e.palette.divider}`},headerTitle:{color:"rgba(255, 255, 255, 0.87)",fontSize:"16px",lineHeight:"19px"},bodyWrapper:{maxHeight:"calc(100% - 56px)",overflow:"auto"},body:{padding:"16px"},formControlLabel:{marginLeft:0,marginBottom:"27px"},checkboxLabel:{marginLeft:"8px",color:"rgba(255,255,255,0.87)",fontSize:"13px",lineHeight:"15px"},checkbox:{color:"white",padding:0}}))),io=e=>{let{className:t,attributeValue:r,handleSetAsDefault:n,attributeType:a}=e;const l=oo(),o=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},i=(0,g.useSelector)((e=>h.ZP.selectors.getModifiedEntity(e,null==o?void 0:o.uri)))||{},u=(0,g.useSelector)(h.ZP.selectors.getIsViewMode)?o:i,p=(0,g.useSelector)(h.ZP.selectors.getImageAttributesFieldsOrder)||{},d=p[null==o?void 0:o.type]||(null==p?void 0:p.default)||{},[m,f]=(0,s.useState)(!1);(0,s.useEffect)((()=>{f((null==u?void 0:u.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,u]);const y=(0,s.useCallback)((()=>{n(r.uri)}),[null==r?void 0:r.uri]);return c().createElement(E.Z,{className:b()(l.root,t)},c().createElement(E.Z,{className:l.header},c().createElement(v.Z,{className:l.headerTitle},x().text("Details"))),c().createElement(E.Z,{className:l.bodyWrapper},c().createElement(E.Z,{className:l.body},c().createElement(Dr.Z,{classes:{root:l.formControlLabel,label:l.checkboxLabel},control:c().createElement(Pr.Z,{className:l.checkbox,checked:m,onChange:y,color:"default"}),label:x().text("Set as default")}),c().createElement(lo,{attributeType:a,imageAttributeFieldsOrder:d,attributeValue:r}))))},so=(0,T.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),co=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:n,handleSetAsDefault:a,attributeType:l}=e;const[o,i]=(0,s.useState)(0);(0,s.useEffect)((()=>{u(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const u=(0,s.useCallback)((e=>{var r;i(e),n(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),p=so();return c().createElement(E.Z,{className:p.root},c().createElement(Ir,{attributeValueIndex:o,setAttributeValueIndex:u,attributeValues:t,className:p.main}),c().createElement(io,{handleSetAsDefault:a,attributeValue:t[o],className:p.details,attributeType:l}))};var uo=r(38724),po=r(70331),mo=r(15223),go=r(73115);function ho(){return ho=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ho.apply(this,arguments)}const fo=e=>c().createElement("svg",ho({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M14 5a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1h10zm6 12v2h-3v-2h3zm2-4v2h-5v-2h5zm0-4v2h-5V9h5zm0-4v2h-5V5h5z",id:"Details_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},c().createElement("mask",{id:"Details_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Details_svg__a"})),c().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"})));var bo=r(38592);const yo=(0,T.Z)((e=>({button:{minWidth:"30px",padding:"8px 8px",justifyContent:"start",fill:"rgba(0,0,0,0.54)",textTransform:"none",borderColor:"rgba(0,0,0,0.12)"},icon:{color:"rgba(0,0,0,0.54)",width:"20px",height:"20px",marginRight:"8px"},title:{fontSize:"13px",lineHeight:"15px",letterSpacing:0},current:{"& $icon":{color:e.palette.primary.main},backgroundColor:(0,et.U1)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,et.U1)(e.palette.primary.main,.24)}}}))),xo=(0,nt.Z)(Ze.Z),Eo=e=>{let{className:t,classes:r={},modes:n=[],modeId:a,onChange:l}=e;const o=yo();return c().createElement(bo.Z,{className:t},n.map((e=>{let{id:t,title:n,tooltipTitle:i,Icon:s}=e;return c().createElement(xo,{key:String(t),className:b()(o.button,{[o.current]:a===t},r.button),tooltipTitle:i,onClick:(u=t,()=>l(u)),"data-reltio-id":`reltio-search-mode-${t}`},s&&c().createElement(s,{className:o.icon}),n&&c().createElement("div",{className:o.title},n));var u})))},vo=(0,T.Z)((()=>({paper:{backgroundColor:"rgba(0, 0, 0, .85)"},backdrop:{backgroundColor:"transparent"},toolbar:{paddingLeft:"20px",paddingRight:"20px"},appBar:{position:"relative",background:"linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%)"},closeButton:{marginRight:"28px"},closeIcon:{fontSize:"24px",color:"#fff"},headerLeft:{display:"flex",alignItems:"center",flex:2},headerCenter:{display:"flex",justifyContent:"center",flex:1},headerRight:{flex:2,display:"flex",justifyContent:"flex-end",alignItems:"center"},modeSwitcher:{backgroundColor:"#fff"},content:{padding:0}})));let wo;!function(e){e.GALLERY_MODE="gallery",e.DETAILS_MODE="details"}(wo||(wo={}));const Oo=e=>{let{open:t,mode:r,children:n,header:a,onClose:l,onChangeMode:o}=e;const i=vo(),u=(0,s.useMemo)((()=>[{id:wo.GALLERY_MODE,title:x().text("Gallery"),Icon:go.Z},{id:wo.DETAILS_MODE,title:x().text("Details"),Icon:fo}]),[]);return c().createElement(kn.Z,{classes:{paper:i.paper},open:t,BackdropProps:{className:i.backdrop},fullScreen:!0},c().createElement(po.Z,{classes:{colorPrimary:i.appBar}},c().createElement(mo.Z,{className:i.toolbar},c().createElement(E.Z,{className:i.headerLeft},c().createElement(be.k,{tooltipTitle:x().text("Close"),onClick:l,className:i.closeButton,iconClassName:i.closeIcon,icon:Hn.default}),null==a?void 0:a.left),c().createElement(E.Z,{className:i.headerCenter},c().createElement(Eo,{modes:u,modeId:r,onChange:o,className:i.modeSwitcher})),c().createElement(E.Z,{className:i.headerRight},null==a?void 0:a.right))),c().createElement(uo.Z,{className:i.content},n))},Co=(0,T.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),To=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:a,onShareLink:l,onSetAsDefault:o,onDownload:i,onClickImage:s,onDelete:u}=e;const p=Co(),d=e=>c().createElement(Cn,{id:e,selected:r.includes(e),selectionMode:0!==r.length,onSelect:()=>n(e),onDeselect:()=>a(e),onShareLink:()=>l(e),onSetAsDefault:()=>o(e),onDownload:()=>i(e),onClick:()=>s(e),onDelete:u?()=>u(e):void 0,canBeSelected:!0});return c().createElement(E.Z,{className:p.root},c().createElement(Sr.Z,{container:!0},t.map((e=>{let{id:t,src:r}=e;return c().createElement(Sr.Z,{key:t,classes:{item:p.item},item:!0},c().createElement(Er,{size:xr.LARGE,onClick:()=>s(t),src:r,overlay:d(t)}))}))))},So=(0,T.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),ko=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:a}=e;const l=So(),o=t.length===r.length;return c().createElement(ge.Z,{component:"button",underline:"none",classes:{button:l.selectButton},onClick:o?a:n},o?x().text("Clear selection"):x().text("Select all images"))};var No=r(35292);const Io=(0,T.Z)((()=>({downloadButton:{color:"#fff",fontSize:"24px",marginLeft:"30px"},shareButton:{color:"#fff",fontSize:"24px",marginLeft:"21px"},deleteButton:{color:"#fff",fontSize:"24px",marginLeft:"24px"},divider:{height:"31px",width:"1px",marginLeft:"10px",backgroundColor:"rgba(255,255,255,0.38)"}}))),Po=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:a}=e;const l=Io();return c().createElement(c().Fragment,null,n&&c().createElement(Ze.Z,{variant:"contained",color:"primary",onClick:n,startIcon:c().createElement(hn.Z,null)},x().text("Upload")),t&&n&&c().createElement("div",{className:l.divider}),t&&c().createElement(be.k,{className:l.downloadButton,tooltipTitle:x().text("Download selected items"),icon:vn,onClick:t}),r&&c().createElement(be.k,{className:l.shareButton,tooltipTitle:x().text("Copy link"),icon:No.Z,onClick:r}),a&&c().createElement(be.k,{className:l.deleteButton,tooltipTitle:x().text("Delete selected items"),icon:ta.Z,onClick:a}))},Do=e=>{let{attributeValues:t,open:r,onClose:n,currentAttributeValueUri:a,setCurrentAttributeValueUri:l,attributeType:o,onDownload:i,onShareLink:p,onSetAsDefault:d,onUpload:m,onDeleteAttribute:f}=e;const[b,y]=(0,s.useState)([]),[x,E]=(0,s.useState)(wo.GALLERY_MODE),v=(0,g.useSelector)(h.ZP.selectors.getIsViewMode);(0,s.useEffect)((()=>{E(a?wo.DETAILS_MODE:wo.GALLERY_MODE)}),[a]);const w=t.map((e=>({src:(0,u.efz)(e),downloadURL:(0,u.Q5d)(e),id:e.uri}))),O=e=>{p(w.find((0,N.propEq)("id",e)).downloadURL)},C=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));d(r)},T=e=>{f({uri:e,attributeType:o})},S=x===wo.GALLERY_MODE,k=x===wo.DETAILS_MODE,I=b.length>0,P=k||S&&I,D=!v&&P,A=!v&&(k||S&&!I),R=S&&I&&c().createElement(ko,{items:w,selectedItems:b,onClearAll:()=>{y([])},onSelectAll:()=>{y((0,N.pluck)("id",w))}}),j=c().createElement(Po,{onDelete:D?()=>{(S?b:[a]).forEach((e=>{T(e)})),b.length&&y([])}:void 0,onDownload:P?()=>{const e=S?(0,N.pipe)((0,N.filter)((e=>{let{id:t}=e;return b.includes(t)})),(0,N.pluck)("downloadURL"))(w):[w.find((0,N.propEq)("id",a)).downloadURL];i(e)}:void 0,onShare:k?()=>{O(a)}:void 0,onUpload:A?m:void 0});return c().createElement(Oo,{mode:x,open:r,onChangeMode:E,header:{left:R,right:j},onClose:n},S&&c().createElement(To,{items:w,selectedItems:b,onSelectImage:e=>{y((t=>[...t,e]))},onDeselectImage:e=>{y((t=>t.filter((t=>t!==e))))},onShareLink:O,onSetAsDefault:C,onDownload:e=>{i([w.find((0,N.propEq)("id",e)).downloadURL])},onClickImage:e=>{l(e),E(wo.DETAILS_MODE)},onDelete:v?void 0:T}),k&&c().createElement(co,{handleSetAsDefault:C,setCurrentAttributeValueUri:l,currentAttributeValueUri:a,attributeValues:t,attributeType:o}))};var Ao=r(94079);const Ro=(0,T.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:e=>{let{imageWidth:t,imageHeight:r}=e;return{backgroundColor:"white",width:t,height:r,position:"absolute",right:0,cursor:"pointer"}},moreButton:t=>{let{imageWidth:r,imageHeight:n}=t;return{display:"flex",justifyContent:"center",alignItems:"center",width:r,height:n,backgroundColor:(0,Ao.fade)(e.palette.primary.main,.06)}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})));function jo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zo=e=>{let{attributeType:t,attributeValues:r=[],renderImage:n,overlay:a=!1,countFixedItems:l=0,children:o,onUpload:i,onDeleteAttribute:p,imageSize:d=Yn,paging:m,parentUri:f,showNonOv:b,requestNextPageOfAttributeValues:y}=e;const x=(0,g.useSelector)(h.ZP.selectors.getEntity)||{},E=(0,g.useSelector)(h.ZP.selectors.getIsViewMode),w=(0,g.useDispatch)(),O=Ro(d);(0,s.useEffect)((()=>{if(m&&y){const e=b?m.totalOvValues:m.totalValues;e>r.length&&y({parentUri:f,attributeTypeUri:t.uri,attributeTypeName:t.name,values:[],defaultMaxValues:e})}}),[m,y,t,f,r.length,b]);const C=(0,s.useRef)(),[T,S]=(0,s.useState)(0),[k,N]=(0,s.useState)(0),I=(0,s.useContext)(wr),[P,D]=(0,s.useState)(!1),[A,R]=(0,s.useState)(),j=(0,s.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=d,a=Math.floor((e+t)/(n+t))-l,o=e+t-(a+l)*(n+t)<8;S(a),r.length>a?N(r.length-a+(o?1:0)):N(0)}),[r.length,l,d]),Z=(0,s.useCallback)((e=>{j(e),C.current=e}),[j]);(0,s.useEffect)((()=>{C.current&&j(C.current)}),[r.length,j]);const L=(0,s.useCallback)((e=>{I||(R(e),D(!0))}),[I]),_=(0,s.useCallback)((()=>{D(!1)}),[]),M=e=>(e=>{e.forEach(((e,t)=>{try{if((e=>!!(e=>e.indexOf("://")>0||0===e.indexOf("//"))(e)&&new URL(e).host!==location.host)(e)){const r=document.createElement("iframe");r.setAttribute("style","display: none;"),r.setAttribute("src",e),document.body.appendChild(r),setTimeout((()=>document.body.removeChild(r)),3e4*(t+1))}else{const t=document.createElement("a");t.href=e,t.download=(e=>e.split("/").pop())(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}catch(e){console.error(e)}}))})(e),V=e=>navigator.clipboard.writeText(e),U=(0,s.useCallback)((e=>{E?(0,u.YL3)(x.uri,e.uri).then((t=>{let{status:r}=t;"success"===r&&w(h.N5.entity.actions.setDefaultProfilePic(e))})):w(h.N5.modifiedEntities.actions.setDefaultProfilePic({entityUri:x.uri,value:e}))}),[E,x.uri,w]),B=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jo(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:L},a&&{onDownload:M,onShareLink:V,onSetAsDefault:U});return c().createElement(c().Fragment,null,c().createElement(vr.Z,{handleWidth:!0,onResize:Z}),c().createElement(Do,{attributeValues:r,open:P,onClose:_,setCurrentAttributeValueUri:R,currentAttributeValueUri:A,attributeType:t,onDownload:M,onShareLink:V,onSetAsDefault:U,onUpload:i,onDeleteAttribute:p}),c().createElement("div",{className:O.imageBox},o,r.slice(0,T).map(n(B)),k>0&&c().createElement("div",{className:O.moreButtonContainer},c().createElement("div",{className:O.moreButton,onClick:()=>L()},c().createElement(v.Z,{className:O.number},`+${k}`)))))},Lo=(0,T.Z)((e=>({image:e=>{let{imageMargin:t,imageHeight:r,imageWidth:n}=e;return{marginRight:t,width:n,height:r,cursor:"pointer","&:last-child":{marginRight:0}}},deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,u.m5F)('<svg xmlns="http://www.w3.org/2000/svg" style="stroke: #D1051E; stroke-width: 1" viewBox="0 0 114 114">\n\t<line x1="5" y1="109" x2="109" y2="5" />\n</svg>')}') no-repeat`,backgroundColor:Ot[wt.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:Ot[wt.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ot[wt.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ot[wt.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ot[wt.updateAttribute].color}`,outlineOffset:"-3px"}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),_o=e=>{let{attributeType:t,attributeValues:r=[],paging:n,parentUri:a,requestNextPageOfAttributeValues:l,showNonOv:o,imageSize:i=Yn}=e;const p=Lo(i),{appearance:d}=(0,s.useContext)(it);return c().createElement(Zo,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,u.efz)(e),{uri:n}=e,a=Pt(n,d),l=Ct(a);return c().createElement("div",{className:b()(p.image,{[p[l+"Image"]]:l}),key:n},c().createElement(Er,{onClick:()=>t(n),className:p[l],src:r,size:{imageWidth:i.imageWidth,imageHeight:i.imageHeight}}))}},imageSize:i,requestNextPageOfAttributeValues:l,paging:n,parentUri:a,showNonOv:o})};var Mo=r(20404);const Vo=e=>{let{className:t,values:r,Component:n}=e;return c().createElement("div",{className:t},r.map(((e,t)=>c().createElement(s.Fragment,{key:e},c().createElement(n,{value:e}),t<r.length-1&&", "))))};function Uo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Bo(e,t,r[t])}))}return e}function Bo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zo=(0,T.Z)({insertAttribute:Uo({width:"fit-content"},Ot[wt.insertAttribute]),deleteAttribute:Uo({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},Ot[wt.deleteAttribute])}),Fo=e=>{let{value:t}=e;const r=zo(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),{appearance:a}=(0,s.useContext)(it),l=Dt("roles",t,a),o=Ct(l);return c().createElement("span",{className:r[o]},(0,u.xqc)(n,t))},Ho=e=>{let{className:t,values:r}=e;return c().createElement(Vo,{values:r,className:t,Component:Fo})},Wo=e=>{let{value:t}=e;const r=zo(),n=(0,g.useSelector)(h.ZP.selectors.getUIPath),a=(0,g.useSelector)(h.ZP.selectors.getEntity),{appearance:l}=(0,s.useContext)(it),o=Dt("tags",t,l),i=Ct(o);return c().createElement(ge.Z,{underline:"none",className:r[i],href:(0,u.hgZ)({uiPath:n,tag:t,entityUri:a.uri})},t)},qo=e=>{let{className:t,values:r}=e;return c().createElement(Vo,{values:r,className:t,Component:Wo})},Go=e=>{let{values:t,attributeType:r,showTitle:n=!0}=e;const a=M(),{label:l}=r;return c().createElement("div",{className:b()(a.titleRow,a.wrapper)},n&&c().createElement(c().Fragment,null,(o=a.titleIcon,r.uri===u.xPW.tags.uri?c().createElement(Mo.Z,{className:o}):null),c().createElement(Q,{label:l,className:a.title,attributeType:r})),(e=>{switch(r.uri){case u.xPW.tags.uri:return c().createElement(qo,{className:e,values:t});case u.xPW.roles.uri:return c().createElement(Ho,{className:e,values:t});default:return c().createElement(nr,{className:e,attributeValue:{value:t[0]},attributeType:r,inlined:!0})}})(a.attribute));var o},$o="oneLine",Ko="multiLine",Yo="imageLine",Xo="special",Qo=(0,s.memo)((e=>{let{values:t,attributeType:r,drawLines:n,paging:a={},parentUri:l,max:o=1/0,requestNextPageOfAttributeValues:i,titleClassName:s,contentClassName:p,showTitle:d=!0,showNonOv:m}=e;const g=_(),h=(0,N.partition)(u.OXP);if(!t||!t.length)return null;const[f,y]=h(t),x=m?t:f,E=m?[]:y,v=m?"totalValues":"totalOvValues",w=(0,N.ifElse)((0,N.has)(v),(0,N.prop)(v),(0,N.always)(x.length))(a),O=null!=a&&a.totalValues?a.totalValues-w:E.length,C=1===w&&!(0,u.YkM)(r);return c().createElement(D,{enabled:n,className:b()({[g.paddingWrapperWithLines]:n})},c().createElement("div",{className:b()({[g.paddingWrapper]:!n})},(()=>{switch((0,N.cond)([[u.kqr,(0,N.always)(Xo)],[u.Or$,(0,N.always)(Yo)],[(0,N.always)(C),(0,N.always)($o)],[N.T,(0,N.always)(Ko)]])(r)){case $o:return c().createElement(ar,{value:x[0],nonVisibleValues:E,totalNonVisibleValues:O,attributeType:r,titleClassName:s,contentClassName:p,showTitle:d,showNonOv:m});case Ko:return c().createElement(ur,{values:x,nonVisibleValues:E,totalVisibleValues:w,totalNonVisibleValues:O,attributeType:r,parentUri:l,max:o,requestNextPageOfAttributeValues:i,titleClassName:s,contentClassName:p,showTitle:d,showNonOv:m});case Yo:return c().createElement(c().Fragment,null,d&&c().createElement(Q,{label:null==r?void 0:r.label,attributeType:r}),c().createElement(_o,{attributeValues:x,attributeType:r,paging:a,parentUri:l,requestNextPageOfAttributeValues:i,showNonOv:m}));case Xo:return c().createElement(Go,{values:x,attributeType:r,showTitle:d})}})()))})),Jo={requestNextPageOfAttributeValues:h.N5.actions.requestNextPageOfAttributeValues},ei=(0,g.connect)(((e,t)=>{let{max:r}=t;return{max:r||h.ZP.selectors.getDefaultMaxValues(e)}}),Jo)(Qo),ti=(0,s.memo)((e=>{let{attrTypes:t,entity:r,parentUri:n,drawLines:a,children:l,className:o,max:i,alwaysVisibleTypeUris:p=Oa,showNonOv:d}=e;const[m,g]=(0,s.useState)(i||1/0),h=(0,s.useMemo)((()=>(0,u.fyF)(t,r,d)),[t,r,d]),[f,b]=(0,s.useMemo)((()=>Ta(p,h)),[h,p]),y=b.slice(0,m),x=i&&y.length<b.length,E=i&&y.length>=b.length&&i<y.length,v={enabled:a};return c().createElement("div",{className:o},l&&c().createElement(D,v,l),y.concat(f).map((e=>{let{attrType:t,values:l}=e;return c().createElement(ei,{key:t.uri,attributeType:t,drawLines:a,values:l,paging:(0,N.path)(["paging",t.uri],r.attributes),parentUri:n,showNonOv:d})})),x&&c().createElement(ir,{onClick:()=>{g(1/0)}}),E&&c().createElement(cr,{onClick:()=>{g(i)}}))})),ri=(0,T.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),ni=(0,g.connect)((e=>({metadata:h.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:r={},metadata:n,caption:a="",excludeUris:l=[],includeUris:o=[],attributesCount:i=16}=e;const p=ri(),d=(0,g.useSelector)(h.ZP.selectors.getPivotingAttributes),m=(0,s.useMemo)((()=>Ca(n,r.type,o,l)),[l,o,n,r.type]),f=(0,u.fyF)(m,r).filter((e=>{let{values:t}=e;return!(0,u.O27)(t)})).length>0;return f||!(0,u.O27)(a)?c().createElement(w.Provider,{value:d},c().createElement(O.Z,{className:t},a&&c().createElement(k,{className:p.header,title:a}),c().createElement(E.Z,{className:b()(p.attributesContainer,{[p.noCaption]:!a})},f?c().createElement(ti,{entity:r,attrTypes:m,parentUri:r.uri,drawLines:!1,max:i}):c().createElement(v.Z,{className:p.noData},x().text("No data found"))))):null})),ai=(0,T.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function li(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){oi(e,t,r[t])}))}return e}function oi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ii=(0,g.connect)((e=>({metadata:h.ZP.selectors.getMetadata(e)})))((e=>{let{className:t,entity:r={},mode:n,metadata:a,caption:l="",excludeUris:o=[],includeUris:i=[],pinnedAttributes:p}=e;const d=ai(),m=(0,g.useDispatch)(),f=(0,s.useContext)(qa.m),y=(0,g.useSelector)(h.ZP.selectors.getUserRoles),x=(0,s.useMemo)((()=>(0,u.mC3)(p,y)),[p,y]),v=(0,g.useSelector)((e=>h.ZP.selectors.getModifiedEntity(e,r.uri)||{})),w=(0,s.useMemo)((()=>Ca(a,v.type,i,o)),[o,i,a,v.type]),C=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.addAttributes,m)(e.map((e=>li({},e,{viewId:f}))))),[f,m]),T=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.modifyAttribute,m)(li({},e,{viewId:f}))),[f,m]),S=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.removeAttribute,m)(li({},e,{viewId:f}))),[f,m]);return c().createElement(O.Z,{className:t},l&&c().createElement(k,{className:d.header,title:l}),c().createElement(E.Z,{className:b()(d.attributesContainer,{[d.noCaption]:!l})},c().createElement(Sa.Provider,{value:x},c().createElement(Ia,{entity:v,attrTypes:w,parentUri:v.uri,drawLines:!1,mode:n,showEmptyEditors:(0,u.ZiX)(v.uri),crosswalks:v.crosswalks,onAddAttributes:C,onChangeAttribute:T,onDeleteAttribute:S}))))}));function si(){return si=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},si.apply(this,arguments)}const ci=(0,g.connect)(((e,t)=>({entity:t.entity||h.ZP.selectors.getEntityWithDiff(e),mode:t.mode||h.ZP.selectors.getMode(e)})))((e=>{let{mode:t=u.ARY.Viewing,attributesCount:r,pinnedAttributes:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["mode","attributesCount","pinnedAttributes"]);return(0,u.uzs)(t)?c().createElement(ni,si({attributesCount:r},a)):c().createElement(ii,si({mode:t,pinnedAttributes:n},a))})),ui=(0,T.Z)({container:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},text:{display:"flex",width:"calc(100% - 68px)"},textItem:{fontSize:"13px",lineHeight:"15px",marginRight:10},primaryTextItem:{flex:"1 0",flexBasis:0,maxWidth:"50%",overflow:"hidden",textOverflow:"ellipsis"},secondaryTextItem:{flex:"1 0",flexBasis:0,overflow:"hidden",textOverflow:"ellipsis"},icons:{transform:"scale(0.5)",position:"relative",flexShrink:0,width:"68px",bottom:"10px"},iconTop:{position:"absolute",top:0,left:0,zIndex:1},iconBottom:{position:"absolute",top:0,left:26,zIndex:0}});var pi=r(83088);function di(){return di=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},di.apply(this,arguments)}const mi=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=ui(),{value:o,label:i,startObject:s,endObject:u}=a,p=s.objectType.label+" ↔ "+u.objectType.label;return c().createElement(Ma.Z,di({className:l.container,ref:t,key:o,onClick:()=>n({label:i,value:o,startObject:s,endObject:u})},r),c().createElement("div",{className:l.icons},c().createElement(_a.Z,{className:l.iconTop,entityType:s.objectType}),c().createElement(_a.Z,{className:l.iconBottom,entityType:u.objectType})),c().createElement("div",{className:l.text},c().createElement(pi.C,{value:i},c().createElement(v.Z,{className:b()(l.textItem,l.primaryTextItem)},i)),c().createElement(pi.C,{value:p},c().createElement(v.Z,{color:"textSecondary",className:b()(l.textItem,l.secondaryTextItem)},p))))};mi.propTypes={innerRef:B().oneOfType([B().oneOf([null]),B().func,B().shape({current:B().any.isRequired})]),innerProps:B().object.isRequired,selectOption:B().func.isRequired,data:B().shape({value:B().string.isRequired,label:B().string.isRequired,startObject:B().object,endObject:B().object})};const gi=mi;function hi(){return hi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hi.apply(this,arguments)}function fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bi=e=>{let{value:t={},options:r=[],onChange:n=N.identity,TextFieldProps:a}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","options","onChange","TextFieldProps"]);const o=(0,s.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){fi(e,t,r[t])}))}return e}({},(0,N.defaultTo)({},a),{"data-reltio-id":"relation-type-selector"})),[a]);return c().createElement(La.Z,hi({value:t,options:r,onChange:n,label:x().text("Select relationship type "),components:{Option:gi},TextFieldProps:o},l))},yi=B().shape({label:B().string.isRequired,value:B().string.isRequired,startObject:B().object,endObject:B().object});bi.propTypes={value:yi,options:B().arrayOf(yi),onChange:B().func};const xi=bi;function Ei(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vi(e,t,r[t])}))}return e}function vi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wi(){return wi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wi.apply(this,arguments)}function Oi(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const Ci=e=>{let{values:t,valueContainerClassName:r}=e,n=Oi(e,["values","valueContainerClassName"]);return c().createElement(c().Fragment,null,(t||[]).map((e=>c().createElement("div",{key:e.uri,className:r},c().createElement(nr,wi({attributeValue:e},n))))))},Ti=(0,s.memo)((e=>{let{expanded:t}=e,r=Oi(e,["expanded"]);const{attributeType:n,values:a,valueContainerClassName:l}=r;switch(n.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_REFERENCE:return Ci(Ei({expanded:t},r));case u.oS0.TYPE_IMAGE:return c().createElement("div",{className:l},c().createElement(_o,{attributeType:n,attributeValues:a,imageSize:{imageHeight:40,imageWidth:40,imageMargin:2}}));default:return Ci(Ei({},r))}}));var Si,ki=r(44938);function Ni(){return Ni=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ni.apply(this,arguments)}!function(e){e[e.ICON_MODE=0]="ICON_MODE",e[e.TEXT_MODE=1]="TEXT_MODE",e[e.ERROR_MODE=2]="ERROR_MODE"}(Si||(Si={}));const Ii=e=>{let{className:t,icon:r,avatarText:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","icon","avatarText"]);const[l,o]=(0,s.useState)(null);(0,s.useEffect)((()=>{o(r?Si.ICON_MODE:Si.TEXT_MODE)}),[r,n]);const i=()=>{o(Si.ERROR_MODE)};switch(l){case Si.ICON_MODE:return c().createElement(ke.Z,Ni({className:t,src:r,onError:i},a));case Si.TEXT_MODE:case Si.ERROR_MODE:return c().createElement(ke.Z,Ni({className:t},a),n);default:return null}};var Pi=r(45108),Di=r(30488),Ai=r(38748),Ri=r(25843),ji=r(53862);function Zi(){return Zi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zi.apply(this,arguments)}const Li=e=>c().createElement("svg",Zi({width:20,height:18,viewBox:"0 0 20 18",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M16 7.24V6h-4v1.24a8.417 8.417 0 00-2 .768V6H6v6h.29a8.497 8.497 0 00-.15.358l-.29.733.29.733.07.176H2c-1.1 0-2-.9-2-2V2C0 .9.9 0 2 0h14c1.1 0 2 .9 2 2v6.008a8.417 8.417 0 00-2-.768zM4 12V6H2v6h2zm0-8V2H2v2h2zm6 0V2H6v2h4zm6 0V2h-4v2h4zm-2 5a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091A6.451 6.451 0 0014 9zm0 6.818a2.728 2.728 0 010-5.454 2.728 2.728 0 010 5.454zm0-4.363c-.905 0-1.636.73-1.636 1.636 0 .905.73 1.636 1.636 1.636.905 0 1.636-.73 1.636-1.636 0-.906-.73-1.636-1.636-1.636z",fill:"#000",fillRule:"nonzero",stroke:"none",strokeWidth:1,opacity:.54}));function _i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Mi(e,t,r[t])}))}return e}function Mi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vi=e=>e.id===e.groupId,Ui=(0,N.curry)(((e,t)=>{let{id:r,groupId:n}=e;return t.groupId===n&&(r===t.id||r.startsWith(`${t.id}.`))})),Bi=(0,N.curry)(((e,t)=>{let{groupId:r}=e;return r===t.id})),zi=(0,N.propOr)(!0,"hideable"),Fi=(e,t)=>{const r=((e,t)=>e.find((0,N.either)(Bi(t),Ui(t))))(e,t);return r?(r.children=Fi(r.children||[],t),e):e.concat(t)},Hi=(0,N.curry)(((e,t)=>u.P6Y.strings.search(t.label,e)||(t.children||[]).some(Hi(e)))),Wi=(0,N.reduce)(((e,t)=>Fi(e,{id:t.id,groupId:t.groupId,label:t.label,attrType:t.dataTypeDefinition})),[]),qi=(0,N.curry)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,N.pipe)((0,N.filter)(Hi(e)),(0,N.chain)((t=>[{item:_i({},t,{filterText:e}),level:r},...t.children?qi(e,t.children,r+1):[]])))(t)})),Gi=(0,N.has)("columns"),$i=e=>{let{id:t,label:r,columns:n}=e;return[{id:t,groupId:t,label:r},...n.map((0,N.assoc)("groupId",t))]},Ki=e=>e.children?(0,N.chain)(Ki,e.children):[e],Yi=(e,t)=>{const r=Ki(t),n=t=>e.includes(t.id);return Vi(t)?r.every(n):r.some(n)},Xi=(0,T.Z)({popup:{minWidth:"200px"},groupItem:{backgroundColor:"rgba(0,0,0,0.04)"}}),Qi=e=>{let{item:t,onClick:r,checked:n,level:a,style:l,isFocused:o,isGroupItem:i}=e;const s=Xi();return c().createElement(m.Z,{key:t.id,onClick:r,checked:n,level:a,data:t,label:c().createElement(Yr,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:l,isFocused:o,hideIcon:i,className:b()({[s.groupItem]:i})})};Qi.propTypes={item:B().shape({label:B().string,filterText:B().string}),level:B().number,onClick:B().func,checked:B().bool,style:B().object,isGroupItem:B().bool,isFocused:B().bool};const Ji=Qi,es=e=>{let{columnsData:t,selectedColumns:r,onChangeColumns:n,title:a,tooltipTitle:l}=e;const o=Xi(),[i,p]=(0,s.useState)(null),[d,m]=(0,s.useState)(""),g=(0,s.useMemo)((()=>((e,t)=>(0,N.pipe)((0,N.chain)((0,N.when)(Gi,$i)),(0,N.filter)((0,N.either)(Vi,zi)),Wi,qi(t))(e))(t,d)),[t,d]),h=(0,u.fW1)("label")(g)||308,f=(0,s.useMemo)((()=>Br(g)),[g]),b=(0,s.useCallback)((e=>{const t=(0,N.pipe)(Ki,(0,N.pluck)("id"))(e),a=Yi(r,e);n(a?(0,N.difference)(r,t):(0,N.uniq)((0,N.concat)(r,t)))}),[r,n]),y=(0,s.useCallback)((e=>{let{item:t}=e;return b(t)}),[b]),{focusIndex:E,handleKeyDown:v}=Gr({items:f,open,onSelectFocusedItem:y,selectedItems:r}),w=Math.min(300,32*f.length),O=Math.max(140,w+108);return c().createElement(c().Fragment,null,c().createElement(be.k,{tooltipTitle:l||x().text("Show/hide columns"),size:"L",icon:Li,onClick:e=>p(e.currentTarget)}),c().createElement(Ur,{className:o.popup,open:!!i,anchorEl:i,onClose:(0,N.pipe)((()=>p(null)),(()=>m(""))),onSearch:m,title:a||x().text("Show/hide columns"),containerWidth:h,containerHeight:O,searchInputOnKeyDown:v},c().createElement(qr,{fixedTitle:!1,height:w,renderItem:(e,t,n)=>{let{item:a,level:l=0}=t;return c().createElement(Ji,{style:e,item:a,level:l,isFocused:E===n,checked:Yi(r,a),isGroupItem:Vi(a),onClick:b})},items:f,getItemSize:()=>32,containerWidth:h,focusIndex:E})))};es.propTypes={columnsData:ji.uz,selectedColumns:B().arrayOf(B().string),onChangeColumns:B().func,title:B().string,tooltipTitle:B().string};const ts=es;function rs(){return rs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rs.apply(this,arguments)}const ns=e=>c().createElement("svg",rs({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M18 2V0H0v2l7 8v8l4-2v-6z",fill:"currentColor",fillRule:"nonzero",stroke:"none",strokeWidth:1})),as=(0,T.Z)((e=>({"filterIcon--enabled":{color:e.palette.primary.main},closeIcon:{position:"absolute",right:"3px",bottom:"3px",transform:"scale(0.5)"},button:{padding:"11px"}}))),ls=e=>{let{enabled:t,onClick:r}=e;const n=as();return c().createElement(ae.ZP,{title:t?x().text("Clear all filters"):x().text("Filter")},c().createElement(Ya.Z,{onClick:r,classes:{root:n.button}},t?c().createElement(c().Fragment,null,c().createElement(ns,{className:n["filterIcon--enabled"]}),c().createElement(Hn.default,{color:"primary",className:n.closeIcon})):c().createElement(ns,null)))};ls.propTypes={enabled:B().bool,onClick:B().func};const os=ls;var is=r(42011),ss=r(46728),cs=r(85103),us=r(1928),ps=r(9377);function ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ms(e,t,r[t])}))}return e}function ms(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gs="CHANGE_COLUMNS",hs="TOGGLE_FILTERS",fs="CHANGE_FILTER",bs="TOGGLE_SORT",ys="CHANGE_PAGE",xs="CHANGE_ROWS_PER_PAGE",Es={changeColumns:(0,wn.zD)(gs),toggleFilters:(0,wn.zD)(hs),changeFilter:(0,wn.zD)(fs),toggleSort:(0,wn.zD)(bs),changePage:(0,wn.zD)(ys),changeRowsPerPage:(0,wn.zD)(xs)},vs=(e,t)=>{const r=(0,N.difference)(e.visibleColumns,t),n=e=>r.includes(e);return(0,N.evolve)({visibleColumns:(0,N.always)(t),sorting:(0,N.when)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(e.field)}),(()=>{const[e]=t;return{field:e,order:"asc"}})),filters:e=>(0,N.keys)(e).reduce(((e,t)=>n(t)?(0,N.dissoc)(t,e):e),e)},e)},ws={reducer:(e,t)=>{switch(t.type){case gs:{const r=t.payload;return vs(e,r)}case hs:{const t=!e.filters;return ds({},e,{filters:t?{}:null,page:t?e.page:0})}case fs:{const{columnId:r,filter:n}=t.payload;return(0,N.evolve)({filters:n?(0,N.assoc)(r,n):(0,N.dissoc)(r),page:(0,N.always)(0)},e)}case bs:{const r=t.payload,n=(0,N.path)(["sorting","field"],e),a=(0,N.path)(["sorting","order"],e);return ds({},e,{sorting:{field:r,order:(0,wn.Dh)(r===n?a:null)},page:0})}case ys:return ds({},e,{page:t.payload});case xs:return ds({},e,{rowsPerPage:t.payload});default:return e}},actions:Es,changeVisibleColumns:vs};var Os=r(76625);const Cs=e=>{let{onChangeHeight:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChangeHeight","children"]);const a=(0,s.useRef)(null),{rowValue:l,rowIndex:o,columnData:i,cellIndex:u}=n,p=t({rowIndex:o,cellIndex:u,columnData:i}),d=()=>a.current&&p(a.current.clientHeight);return(0,te.D)(d,[l.rawValue]),c().createElement("div",null,c().createElement(vr.Z,{handleHeight:!0,onResize:d}),c().createElement(Os.Z,{rootRef:a},r))};Cs.propTypes={onChangeHeight:B().func,children:B().node};const Ts=Cs;var Ss=r(3073),ks=r(28831);const Ns=(0,T.Z)((()=>({hidden:{visibility:"hidden"}}))),Is=e=>{let{rowIndex:t,rowValue:r,className:n}=e;const a=Ns(),{toggleRowCollapse:l,getIsRowCollapsible:o,getIsRowCollapsed:i}=(0,s.useContext)(Ss.x),u=o(r),p=i(t);return c().createElement(ks.Z,{className:b()(n,{[a.hidden]:!u}),isOpen:!p,onClick:e=>{l(t),e.stopPropagation()}})};Is.propTypes={rowIndex:B().number,rowValue:B().object,className:B().string};const Ps=Is;function Ds(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const As=e=>{let{rowIndex:t,columnData:{id:r},cellIndex:n}=e;return`${r}[${t}][${n}]`},Rs=()=>{const[e,t]=(0,s.useState)({}),r=(0,s.useRef)({}),n=(0,s.useCallback)((0,u.DsO)((()=>{t(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ds(e,t,r[t])}))}return e}({},r.current))})),[]),a=(0,s.useCallback)((()=>{r.current={}}),[]);return{getDynamicRowCellHeight:(0,s.useCallback)((0,N.pipe)(As,(0,N.prop)(N.__,e)),[e]),changeRowCellHeight:(0,s.useCallback)((0,N.curry)((0,N.useWith)((0,N.pipe)(((e,t)=>{r.current[e]=t}),n),[As,N.identity])),[]),clearHeightsCache:a}};var js=r(21697),Zs=r(8233);function Ls(){return Ls=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ls.apply(this,arguments)}const _s=e=>{let{rowsData:t,columnsData:r,renderRowCell:n=us.Z,getRowCellHeight:a=cs.Z,defaultRowHeight:l=48,maxRowValuesCount:o=1/0}=e;const{tableRowsData:i,collapseContextValue:u}=(0,Zs.Z)({rowsData:t,columnsData:r,renderRowCell:n,getRowCellHeight:a,maxRowValuesCount:o});return(0,s.useMemo)((()=>{const e=i.reduce(((e,t,r)=>{const{data:n}=t;return e[r]=(0,js.calculateRowHeight)(n,l),e}),{}),t=(t,r,n)=>{const a=[t,"subRowHeight",r,n,"height"];return(0,N.pathOr)(0,a,e)},n=t=>(0,N.pathOr)(0,[t,"height"],e),a=e=>{let{columnId:a,rowIndex:l}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["columnId","rowIndex"]);return c().createElement(Ss.x.Provider,{value:u},c().createElement("div",Ls({},o,{style:{height:n(l)}}),i.length>0&&(0,js.getCellContentFromRowsData)({columnIndex:r.findIndex((0,N.propEq)("id",a)),headData:r,rowsData:i,rowIndex:l,getHeightForSubRow:t})))};return a.propTypes={columnId:B().string,rowIndex:B().number},{getRowHeight:n,CellRenderer:a}}),[i,l,u,r])};var Ms=r(67766),Vs=r(42767);const Us=(0,T.Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),Bs=(0,nt.Z)(ge.Z),zs=e=>{let{total:t=0,onPrev:r,onNext:n,onSearchResultsClick:a,isPrevDisabled:l,isNextDisabled:o}=e;const i=Us();return c().createElement("div",{className:i.container},c().createElement(Bs,{className:i.link,component:"button",variant:"caption",onClick:a,underline:"none",tooltipTitle:x().text("Go to search results")},(0,u.k7L)(t,1e6)," ",1===t?x().text("Search result"):x().text("Search results")),c().createElement(be.k,{size:"L",icon:Ms.Z,tooltipTitle:x().text("Go to previous profile"),onClick:r,disabled:l,showForDisabled:!0}),c().createElement(be.k,{size:"L",icon:Vs.Z,tooltipTitle:x().text("Go to next profile"),onClick:n,disabled:o,showForDisabled:!0}))};function Fs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Hs(e,t,r[t])}))}return e}function Hs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ws{constructor(e){var t=this;let{data:{query:r,sortField:n,sortOrder:a},tenant:l,searchTenant:o,apiPath:i,dtssPath:s,globalSearchRequestOptions:c}=e;this.query=void 0,this.sortField=void 0,this.sortOrder=void 0,this.tenant=void 0,this.searchTenant=void 0,this.apiPath=void 0,this.dtssPath=void 0,this.globalSearchRequestOptions=void 0,this.isDT=()=>this.tenant!==this.searchTenant,this.getQueryFilter=()=>({rawFilter:this.query}),this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[t.getQueryFilter(),...e],a=Fs({},t.globalSearchRequestOptions,{sort:t.sortField,order:t.sortOrder,select:"uri,label,type",scoreEnabled:!1},r);return t.isDT()?(0,u.uqV)({filters:n,options:a,customerTenant:t.tenant,dataTenant:t.searchTenant,dtssPath:t.dtssPath}):(0,u.ZOr)(n,a)},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"uri",values:[e]}],{offset:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{offset:t,max:e}),this.requestTotal=()=>{const e=[this.getQueryFilter()],t=this.globalSearchRequestOptions;return(this.isDT()?(0,u.J$m)({filters:e,options:t,customerTenant:this.tenant,dataTenant:this.searchTenant,dtssPath:this.dtssPath}):(0,u.j_Q)(e,t)).then((e=>e.total))},this.query=r,this.sortField=n,this.sortOrder=a,this.tenant=l,this.searchTenant=o,this.apiPath=i,this.dtssPath=s,this.globalSearchRequestOptions=c}}function qs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Gs(e,t,r[t])}))}return e}function Gs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class $s{constructor(e){var t=this;let{data:r,tenant:n,apiPath:a}=e;this.searchBody=void 0,this.tenant=void 0,this.apiPath=void 0,this.getEntities=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[{rawFilter:t.searchBody.filter},...e];return(0,u.P2h)({apiPath:t.apiPath,tenant:t.tenant,searchBody:qs({},t.searchBody,{filter:e.length?(0,u.Uqd)()(n):t.searchBody.filter}),options:r})},this.checkEntity=e=>this.getEntities([{filter:"equals",fieldName:"id",values:[(0,u.BTI)({uri:e})]}],{from:0,max:1}).then((t=>t&&t.length>0&&t[0].uri===e)),this.requestEntities=(e,t)=>this.getEntities([],{from:t,max:e}),this.requestTotal=()=>(0,u.dED)({apiPath:this.apiPath,tenant:this.tenant,searchBody:this.searchBody}).then((e=>e.count)),this.searchBody=r,this.tenant=n,this.apiPath=a}}const Ks=(e,t)=>(0,N.pipe)((0,N.map)((0,N.prop)("uri")),(0,N.reject)((e=>t.includes(e))))(e),Ys=()=>{const{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}=(()=>{const e=(0,yt._)(),t=(0,yt._)(),r=(0,yt._)(),{uri:n,index:a,total:l,tenant:o,cache:i}=(0,g.useSelector)(h.ZP.selectors.getSearchNavigationData)||{},{type:c,data:p}=(0,g.useSelector)(h.ZP.selectors.getSearchProviderData)||{},d=(0,g.useSelector)(h.ZP.selectors.getTenant),m=(0,g.useSelector)(h.ZP.selectors.getApiPath),f=(0,g.useSelector)(h.ZP.selectors.getDtssPath),b=(0,g.useSelector)((e=>h.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),y=(0,s.useContext)(qa.m),x=(0,g.useDispatch)(),[E,v]=(0,s.useState)(!1),w=(0,s.useMemo)((()=>((e,t)=>{switch(e){case"search":return new Ws(t);case"graphsearch":return new $s(t)}})(c,{data:p,tenant:d,searchTenant:o,apiPath:m,dtssPath:f,globalSearchRequestOptions:b})),[c,p,d,o,m,f,b]),O=(0,s.useCallback)((e=>{x(h.yC.actions.updateSearchNavigationDataFields(e))}),[x]),C=(0,s.useCallback)((e=>{const t=d!==o?(0,u.wwR)({uri:e,dataTenant:o}):e;x(h.ui.actions.openEntity({uri:t,viewId:y,source:"navigation"}))}),[x,y,d,o]),T=(0,s.useCallback)((()=>{x(h.ui.actions.openPerspective({perspectiveId:c,viewId:y}))}),[x,c,y]);(0,s.useEffect)((()=>{a>=l?O({index:l-1}):a<0&&O({index:0})}),[l,a,O]);const S=(0,s.useCallback)(((e,n,a)=>{v(!0),t(w.requestTotal()).then((e=>O({total:e})));const l=a+1;return r(w.requestEntities(15,l)).then((t=>{if(t){if(t.length){const r=Ks(t,e);if(r.length>0)return O({cache:e.concat(r),uri:r[0],index:l+t.length-r.length}),void C(r[0]);if(a+t.length<n-1)return S(e,n-t.length,a+t.length)}O({index:l})}})).finally((()=>{v(!1)}))}),[w,O,C]),k=(0,s.useCallback)(((e,n)=>{v(!0),t(w.requestTotal()).then((e=>O({total:e})));const a=n-1,l=Math.max(0,n-15),o=15+Math.min(0,n-15);return r(w.requestEntities(o,l)).then((t=>{if(t){if(t.length){const r=Ks(t,e);if(r.length>0)return O({cache:r.concat(e),uri:r[r.length-1],index:a-(t.length-r.length)}),void C(r[r.length-1]);if(n-t.length>0)return k(e,n-t.length)}O({index:0})}})).finally((()=>{v(!1)}))}),[w,O,C]),N=(0,s.useCallback)(((t,r,n,a)=>{if(r<t.length){const l=t[r];return v(!0),e(w.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),N(e,r,n-1,a)}O({index:a+1,uri:l,cache:t,total:n}),C(l)})).finally((()=>{v(!1)}))}if(!(a>=n-1))return S(t,n,a);O({cache:t,total:n,index:n-1})}),[w,O,C,S]),I=(0,s.useCallback)(((t,r,n,a)=>{if(r>-1){const l=t[r];return v(!0),e(w.checkEntity(l)).then((e=>{if(!e){const e=[...t];return e.splice(r,1),I(e,r-1,n-1,a-1)}O({index:a-1,uri:l,cache:t,total:n}),C(l)})).finally((()=>{v(!1)}))}if(!(a<=0))return k(t,a);O({index:0,cache:t,total:n})}),[w,O,C,k]),P=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)-1;I(i,e,l,a)}}),[I,i,n,l,a]),D=(0,s.useCallback)((()=>{if(i&&n){const e=i.indexOf(n)+1;N(i,e,l,a)}}),[N,i,n,l,a]);return{total:l,onPrev:P,onNext:D,onSearchResultsClick:T,isPrevDisabled:E||a<=0,isNextDisabled:E||a>=l-1}})();return(()=>{const{cache:e}=(0,g.useSelector)(h.ZP.selectors.getSearchNavigationData)||{},t=(0,g.useSelector)(h.ZP.selectors.getMode),r=(0,g.useSelector)(h.ZP.selectors.getEntity);return(0,u.uzs)(t)&&(null==e?void 0:e.includes(null==r?void 0:r.uri))})()?c().createElement(zs,{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}):null};var Xs=r(82068),Qs=r(72668),Js=r(38037),ec=r(62321),tc=r(56215),rc=r(12960),nc=r(39878),ac=r(59383);function lc(){return lc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lc.apply(this,arguments)}const oc=e=>c().createElement(qe.Z,lc({mouseEvent:"onMouseDown"},e));var ic=r(89902),sc=r(78501),cc=r(59952),uc=r(51556);const pc=(0,T.Z)((()=>({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}})));function dc(){return dc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dc.apply(this,arguments)}function mc(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gc(e,t,r[t])}))}return e}function gc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hc=e=>{let{open:t,anchorEl:r,data:n,onSearch:a,onClose:l,titleText:o,filterText:i,onListItemClick:p,selected:d,hideCheckBox:g,renderGroupTitle:h}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","anchorEl","data","onSearch","onClose","titleText","filterText","onListItemClick","selected","hideCheckBox","renderGroupTitle"]);const y=(0,s.useCallback)((e=>e.label.toLowerCase().includes(i.toLowerCase())),[i]),x=(0,s.useCallback)((e=>y(e)||(e.children||[]).some(x)),[y]),E=(0,s.useMemo)((()=>{const e=(0,N.curry)(((e,r,n,a)=>[{item:mc({},r,{filterText:i}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=function(t,r,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const l=t=>e(a,t,r,n),o=t.filter(x);return(h?N.map:N.chain)(l,o)};return t}),[i,h,x]),v=(0,s.useCallback)((e=>e.map((e=>({item:e,items:E(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[E]),w=(0,s.useCallback)((e=>{let{item:t}=e;p(t,!d.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))))}),[p,d]),O=(0,s.useMemo)((()=>(h?v:E)(n)),[n,h,v,E]),C=(0,s.useMemo)((()=>Br(O)),[O]),{focusIndex:T,handleKeyDown:S}=Gr({items:C,open:t,onSelectFocusedItem:w,selectedItems:d}),k=(0,s.useRef)(null);k.current=T;const I=(0,s.useCallback)(((e,t,r)=>{let{item:n,level:a=0}=t;const l=!!d.find((e=>e.id===n.id||e.id.includes(`${n.id}.`))),o=k.current===r;return c().createElement(m.Z,{key:n.id,onClick:p,checked:l,level:a,data:n,label:c().createElement(Yr,{text:n.label,highlight:n.filterText}),labelInText:n.label,style:e,hideCheckBox:g,isFocused:o,notSelectable:n.notSelectable,LogoIcon:n.LogoIcon})}),[g,p,d]),P=(0,u.fW1)("label")(O)||308,D=pc();return c().createElement(Ur,dc({open:t,className:b()(D.container,D.popupContainer),anchorEl:r,onClose:l,onSearch:a,title:o,containerWidth:P,searchInputOnKeyDown:S},f),c().createElement(qr,{height:300,renderItem:I,items:C,hideSubtitles:!0,getItemSize:()=>32,containerWidth:P,focusIndex:T,renderGroupTitle:h}))};hc.propTypes={open:B().bool,hideCheckBox:B().bool,anchorEl:B().any,selected:B().array,data:B().array,filterText:B().string,titleText:B().string,onClose:B().func,onListItemClick:B().func,onSearch:B().func,renderGroupTitle:B().func},hc.defaultProps={data:[],selected:[],titleText:x().text("Show/hide columns"),filterText:""};const fc=hc,bc=e=>{let{reversedContextLabels:t}=e;return{getRelationTypesOptions:(0,s.useCallback)(((e,r)=>{const n={},a=(0,N.pipe)(u.PjQ,(0,N.tap)((e=>n[e]=(0,N.propOr)(0,e,n)+1))),l=(0,N.ascend)((0,N.prop)("label")),o=(0,N.curry)(((e,r)=>{let{uri:n,label:l,startObject:o,endObject:i}=r;const s=e===(t?u.Nsj.OUT:u.Nsj.IN)?o:i;return{label:{directionalLabel:a(s),typeLabel:l},value:`${n},${e}`,startObject:o,endObject:i}}));return e.map(o(u.Nsj.IN)).concat(r.map(o(u.Nsj.OUT))).map((0,N.evolve)({label:e=>{let{directionalLabel:t,typeLabel:r}=e;return t?n[t]>1?`${t} (${r})`:t:r}})).sort(l)}),[t]),fromEditorValue:(0,s.useCallback)(((e,t)=>r=>{const[n,a]=r.value.split(",");return{type:(a===u.Nsj.IN?e:t).find((0,N.propEq)("uri",n)),direction:a}}),[]),toEditorValue:(0,s.useCallback)(((e,t)=>t.find((0,N.propEq)("value",`${e.relationType},${e.direction}`))),[])}};function yc(){return yc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yc.apply(this,arguments)}const xc=e=>{let{relation:t={},inRelationTypes:r=[],outRelationTypes:n=[],onChange:a=N.identity,applyFirstByDefault:l=!1,reversedContextLabels:o=!1}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["relation","inRelationTypes","outRelationTypes","onChange","applyFirstByDefault","reversedContextLabels"]);const{getRelationTypesOptions:u,fromEditorValue:p,toEditorValue:d}=bc({reversedContextLabels:o}),m=(0,s.useMemo)((()=>u(r,n)),[u,r,n]),g=(0,s.useCallback)((0,N.pipe)(p(r,n),a),[p,r,n,a]);return(0,s.useEffect)((()=>{l&&m.length&&g(m[0])}),[m,l,g]),c().createElement(xi,yc({value:d(t,m),options:m,onChange:g},i))};xc.propTypes={className:B().string,relation:u.bNA,inRelationTypes:B().arrayOf(u.IYE),outRelationTypes:B().arrayOf(u.IYE),applyFirstByDefault:B().bool,reversedContextLabels:B().bool,onChange:B().func};const Ec=xc;var vc=r(4190),wc=r(60364);function Oc(){return Oc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Oc.apply(this,arguments)}const Cc=e=>{let{open:t=!0,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[a,l]=(0,s.useState)(t),o=(0,wc.Z)().transitions.duration.leavingScreen;return(0,s.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{l(!1)}),o);return()=>clearTimeout(e)}l(!0)}}),[t,o,a]),c().createElement(vc.ZP,Oc({open:t},n),a&&r)};Cc.displayName="Drawer";const Tc=Cc;var Sc=r(1128),kc=r(43371),Nc=r(15299),Ic=r(19855),Pc=r(72466),Dc=r(39600),Ac=r(91785),Rc=r(51594),jc=r(7522);function Zc(){return Zc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zc.apply(this,arguments)}const Lc=e=>c().createElement(jc.Z,Zc({message:x().text("No data available")},e));var _c=r(6216),Mc=r(79002);const Vc=(0,T.Z)({"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",display:"inline-flex",marginRight:"12px",borderRadius:"2px"},"entityType-medium":{padding:"2px 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",display:"inline-flex",marginRight:"16px"}}),Uc=e=>{let{entity:t,className:r,size:n="small"}=e;const a=Vc(),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=t.type,i=(0,u.nt9)(l,o)||{},s=(0,u.VD3)(l,i,"typeColor")||u.rSc.palette.primary.main;return c().createElement(v.Z,{style:{backgroundColor:s,color:u.P6Y.Colors.getColor(s)?"#FFFFFF":"#212121"},className:b()(a[`entityType-${n}`],r),component:"div"},(0,u.jFi)(l,t))};var Bc=r(45767),zc=r(86619);const Fc=(0,T.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&[disabled]":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function Hc(){return Hc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hc.apply(this,arguments)}const Wc=(0,N.always)(32),qc=e=>{let{selectedEntityTypes:t,onItemClick:r,focusIndex:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedEntityTypes","onItemClick","focusIndex"]);return c().createElement(qr,Hc({getItemSize:Wc,renderItem:(e,a,l)=>{let{item:o}=a;const i=!!t.find((e=>o.uri===e)),s=l===n;return c().createElement(m.Z,{key:o.uri,onClick:r,checked:i,data:o,label:c().createElement(Yr,{text:o.label,highlight:o.filterText}),labelInText:o.label,style:e,isFocused:s,hideIcon:!0,LogoIcon:o.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0},a))};qc.propTypes={selectedEntityTypes:B().array,onItemClick:B().func,focusIndex:B().number};const Gc=(0,s.memo)(qc),$c=(0,T.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),Kc=(e,t)=>{const{childNodes:r,clientLeft:n,clientWidth:a}=t;if(r.length>0){const[t]=r,l=document.createRange();l.setStart(t,0);for(let r=0;r<e.length;r++){l.setEnd(t,l.endOffset+e[r].length);const{width:o}=l.getBoundingClientRect();if(n+o>a)return r;r!==e.length-1&&l.setEnd(t,l.endOffset+", ".length)}}return-1},Yc=e=>e.join(", "),Xc=e=>`calc(${(0,N.isNil)(e)?"100%":`${e}px`} - 35px)`,Qc=e=>{let{list:t,maxWidth:r}=e;const n=$c(),a=(0,s.useRef)(),[l,o]=(0,s.useState)(0);(0,s.useEffect)((()=>{o(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=Kc(e,t);return-1===r?0:e.length-r}return 0})(e,t);return r-Math.max(1,r-n)})(t,a.current))}),[t]);const i=Yc(t),u=l>0,p=u?Yc(t.slice(0,-l)):i;return c().createElement(ae.ZP,{title:u?i:""},c().createElement("div",{className:n.listLabelContainer},c().createElement("div",{style:{width:Xc(r)},className:n.listLabel,ref:a},i),c().createElement("div",{className:n.visibleItemsLabel},p),u&&c().createElement("div",{className:n.hiddenCount},`+${l}`)))};Qc.propTypes={list:B().arrayOf(B().string).isRequired,maxWidth:B().number};const Jc=Qc;function eu(){return eu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eu.apply(this,arguments)}function tu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ru(e,t,r[t])}))}return e}function ru(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nu=e=>{let{entityTypes:t,selectedEntityTypes:r,single:n,placeholder:a,enableEmptyValueUnderline:l,onChange:o,classes:i={},ListLabelProps:p={},disabled:d=!1}=e;const m=Fc(),[g,h]=(0,s.useState)(!1),f=(0,s.useCallback)((()=>h(!0)),[]),y=(0,s.useCallback)((()=>h(!1)),[]),[E,v]=(0,s.useState)(""),w=(0,s.useCallback)((()=>v("")),[]),O=(0,s.useCallback)((0,N.pipe)(w,y),[y,w]),C=(0,s.useMemo)((()=>t.filter(u.oDv).filter((e=>{let{label:t}=e;return u.P6Y.strings.search(t,E)})).map(((e,t)=>({item:{item:tu({},e,{filterText:E})},index:t})))),[t,E]),T=(0,s.useMemo)((()=>r.map((e=>t.find((0,N.propEq)("uri",e)))).map((0,N.prop)("label"))),[r,t]),S=(0,s.useCallback)(((e,t)=>{n?(o(t?[e.uri]:[]),O()):o(t?r.concat(e.uri):r.filter((t=>t!==e.uri)))}),[r,o,n,O]),k=(0,s.useCallback)((e=>{let{item:t}=e;const n=!r.includes(t.uri);S(t,n)}),[r,S]),{focusIndex:I,handleKeyDown:P}=Gr({items:C,open:g,onSelectFocusedItem:k,selectedItems:r,onClose:O}),D=(0,s.useRef)(),A=D.current?D.current.getBoundingClientRect().width:0,R=Math.max(A,255),j=0===r.length;return c().createElement(c().Fragment,null,c().createElement(zc.Z,{label:x().text("Entity type"),ref:D,InputProps:{startAdornment:j&&!a?null:c().createElement("div",{className:b()(m.inputText,i.inputText)},j?c().createElement("div",null,a):c().createElement(Jc,eu({},p,{list:T}))),classes:{root:m.inputRoot,input:b()(m.input,i.input,{[m.emptyInput]:j&&!a}),disabled:b()(m.disabledInput,{[m.disabledPointer]:d}),underline:m.disabledUnderline},endAdornment:c().createElement(Lt.Z,{size:"L",icon:Bc.Z,iconClassName:b()(m.icon,{[m["popup-opened-icon"]]:g}),disabled:d}),readOnly:!0,disabled:!0,disableUnderline:j&&!l},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:b()(m.inputLabel,i.label)}},value:"",onClick:d?void 0:f,classes:{root:b()(m.root,i.root)},margin:"dense",variant:"filled",disabled:d,"data-reltio-id":"entity-type-selector"}),c().createElement(Ur,{open:g,anchorEl:D.current,onClose:O,onSearch:v,title:x().text("Select entity types"),containerWidth:R,containerHeight:355,searchInputOnKeyDown:P,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":"entity-type-selector-popup"}},c().createElement(Gc,{items:C,onItemClick:S,selectedEntityTypes:r,width:R,height:245,focusIndex:I})))};nu.propTypes={entityTypes:B().arrayOf(u.p8l),selectedEntityTypes:B().arrayOf(B().string).isRequired,onChange:B().func.isRequired,single:B().bool,enableEmptyValueUnderline:B().bool,placeholder:B().string,classes:B().shape({root:B().string,label:B().string,inputText:B().string,input:B().string}),ListLabelProps:B().shape({maxWidth:B().number}),disabled:B().bool};const au=(0,s.memo)(nu);var lu=r(7882),ou=r(97333);const iu=e=>`rotateY(${e?180:0}deg)`,su=e=>`rotateX(${e?180:0}deg)`,cu=e=>`rotateY(${e?0:-180}deg)`,uu=e=>`rotateX(${e?0:-180}deg)`,pu=(0,T.Z)({back:e=>{let{isFlipped:t,direction:r}=e;return{WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",height:"100%",left:"0",position:t?"relative":"absolute",top:"0",transform:"horizontal"===r?cu(t):uu(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",display:"flex"}},container:e=>{let{cardZIndex:t}=e;return{perspective:"1000px",zIndex:t}},flipper:{height:"100%",position:"relative",width:"100%"},front:e=>{let{isFlipped:t,direction:r}=e;return{WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",height:"100%",left:"0",position:t?"absolute":"relative",top:"0",transform:"horizontal"===r?iu(t):su(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",zIndex:2,display:"flex"}}}),du=(0,s.forwardRef)(((e,t)=>{let{cardZIndex:r="auto",direction:n="vertical",isCardFlipped:a=!1,children:l,className:o}=e;const[i,u]=(0,s.useState)(a),p=pu({cardZIndex:r,direction:n,isFlipped:i});return(0,s.useEffect)((()=>{a!==i&&u(a)}),[a,i]),c().createElement("div",{className:b()(p.flipper,o),ref:t},c().createElement("div",{"data-id":"front",className:p.front},l[0]),c().createElement("div",{"data-id":"back",className:p.back},l[1]))})),mu=()=>c().createElement("div",{style:{display:"none"}}),gu=e=>{let{widthToHide:t,children:r}=e;return c().createElement(vr.Z,{handleWidth:!0,render:e=>{let{width:n}=e;return n>t?c().createElement(c().Fragment,null,r):c().createElement(mu,null)}})};gu.propTypes={children:B().node,widthToHide:B().number.isRequired};const hu=gu;function fu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bu(e,t,r[t])}))}return e}function bu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yu=(0,N.range)(2,10).reduce(((e,t)=>fu({},e,{[`&:nth-child(${t})`]:{paddingLeft:`calc(1em * (${t} - 2))`,"&::before":{content:'"└"',display:"inline-block",fontSize:"1em",marginRight:"5px",color:"rgba(255, 255, 255, 0.28)"}}})),{}),xu=(0,T.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px","& p":{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},"& ul":{listStyleType:"none",padding:0,margin:0,"& li":fu({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},yu,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function Eu(){return Eu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eu.apply(this,arguments)}const vu=e=>{let{pathToTitle:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const a=xu(),l=t&&t.length?c().createElement("div",{className:a.tooltipContent},c().createElement("p",null,(0,N.last)(t)),t.length>2&&c().createElement("ul",null,t.map((e=>c().createElement("li",{key:e},e))))):"";return c().createElement(ae.ZP,Eu({title:l,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};vu.propTypes={pathToTitle:B().arrayOf(B().string).isRequired,children:B().node};const wu=vu;var Ou=r(4614),Cu=r(61932);const Tu=(0,T.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}});let Su;!function(e){e[e.INIT=1]="INIT",e[e.PROGRESS=2]="PROGRESS",e[e.SUCCESS=3]="SUCCESS",e[e.DONE=4]="DONE"}(Su||(Su={}));const ku=e=>{let{classes:t={},tooltip:r="",onClick:n=wn.ZT,mode:a=Su.INIT}=e;const l=Tu();return c().createElement("div",{className:b()(l.root,t.root)},(()=>{switch(a){case Su.INIT:return c().createElement(be.k,{className:t.button,size:"M",tooltipTitle:r,icon:Cu.Z,onClick:n});case Su.PROGRESS:return c().createElement(Ou.Z,{className:t.spinner,size:24});case Su.SUCCESS:return c().createElement(me.Z,{className:b()(l.check,t.check)});default:return null}})())},Nu=(0,T.Z)({link:{textDecoration:"inherit",color:"inherit","&:visited":{textDecoration:"inherit",color:"inherit"}}}),Iu=e=>{let{to:t,children:r,onClick:n}=e;const a=Nu();return c().createElement("a",{href:t,onClick:e=>{n&&(n(),e.stopPropagation(),e.preventDefault())},className:a.link},r)},Pu=e=>{let{className:t}=e;return c().createElement("img",{className:t,alt:"loading",src:(0,u.Uw1)("R0lGODlhFQALAKIAAP///8Hf75vL5Van0wB4v////wAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAFACwAAAIAFQAHAAADLFi6zPSQFEGpGhgXkrEUQShc1bB1wxcGYzGUZ6eKJGVy8lS1aJxJjaAiAkkAACH5BAkKAAUALAAAAwAUAAUAAAMiWLFbJRC6QakCODjBxIzDlW3dB4UBBmhPWQygwrCR9FZDAgAh+QQJCgAFACwIAAMADAAFAAADFBiqVfIvgBmaWHeC6rCklrdw0JMAACH5BAkKAAUALAAAAgAUAAcAAAMkSLpU/vCRQWmLLmg967hYAIxBV4GRSJoWlo1A6X1usXGMUkcJACH5BAkKAAUALAAAAgAOAAcAAAMdWLpF/qSMORudcYg97M2b0BHXAHIelV0pxizQkwAAOw==")})},Du=e=>{let{isMlMatch:t=!1}=e;return c().createElement(c().Fragment,null,t?x().text("Match IQ"):x().text("Match rules"))},Au=(0,T.Z)({title:{fontWeight:500,marginBottom:"9px"},body:{fontWeight:"normal",marginLeft:"16px"},container:{padding:"8px",fontSize:"12px",lineHeight:"14px"}}),Ru=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=Au();return c().createElement("div",{className:n.container},c().createElement("div",{className:n.title},c().createElement(Du,{isMlMatch:t})," "),c().createElement("div",{className:n.body},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},ju=(0,T.Z)((e=>({container:{fontSize:"13px",lineHeight:"15px"},title:{color:e.palette.text.secondary,marginBottom:"7px"},labelsContainer:{color:e.palette.text.primary,marginBottom:"8px"}}))),Zu=e=>{let{isMlMatch:t,matchRules:r,className:n}=e;const a=ju();return c().createElement("div",{className:b()(a.container,n)},c().createElement("div",{className:a.title},c().createElement(Du,{isMlMatch:t})),c().createElement("div",{className:a.labelsContainer},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},Lu=(0,T.Z)((e=>({label:{backgroundColor:"rgba(43,152,240,0.12)",fontSize:"12px",lineHeight:"14px",color:e.palette.text.primary,display:"flex",alignItems:"center",padding:"4px 8px"},container:{display:"flex",alignItems:"center",cursor:"pointer",marginBottom:"8px"}})));function _u(){return _u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_u.apply(this,arguments)}const Mu=(0,s.forwardRef)(((e,t)=>{let{children:r,expanded:n,onExpand:a,className:l}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","expanded","onExpand","className"]);const i=Lu();return c().createElement("div",_u({onClick:a,ref:t,className:b()(i.container,l)},o),c().createElement(Ut,{expanded:n}),c().createElement("div",{className:i.label},r))}));Mu.displayName="MatchRuleBadge";const Vu=Mu,Uu=(0,T.Z)({container:{display:"flex",flexDirection:"column",alignItems:"flex-start"},rulesContainer:{marginLeft:"16px"},icon:{height:"17px",width:"15px",marginRight:"5px"}});function Bu(){return Bu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bu.apply(this,arguments)}const zu=e=>c().createElement("svg",Bu({width:192,height:192,viewBox:"0 0 192 192",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("linearGradient",{x1:"94.582%",y1:"6.451%",x2:"23.195%",y2:"83.323%",id:"MLMatch_svg__b"},c().createElement("stop",{stopColor:"#CDE1FF",offset:"0%"}),c().createElement("stop",{stopColor:"#AFFBF4",offset:"100%"})),c().createElement("linearGradient",{x1:"94.582%",y1:"6.594%",x2:"23.195%",y2:"83.214%",id:"MLMatch_svg__d"},c().createElement("stop",{stopColor:"#FFF",offset:"0%"}),c().createElement("stop",{stopColor:"#FDFFFF",offset:"100%"})),c().createElement("linearGradient",{x1:"93.837%",y1:"55.274%",x2:"29.292%",y2:"-20.431%",id:"MLMatch_svg__g"},c().createElement("stop",{stopColor:"#FFFCC7",stopOpacity:0,offset:"0%"}),c().createElement("stop",{stopColor:"#FFF470",offset:"100%"})),c().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"98.152%",id:"MLMatch_svg__i"},c().createElement("stop",{stopColor:"#83D6FF",offset:"0%"}),c().createElement("stop",{stopColor:"#72B9EF",offset:"100%"})),c().createElement("path",{d:"M1.821 66.003L34.263 9.94C36.633 5.813 45.673.594 51.398.072l64.445-.064c5.06-.241 14.821 5.084 17.888 10.395l31.467 54.503c3.186 5.518 2.765 16.592-.13 22.117l-30.948 53.481c-3.776 5.127-14.165 11.126-19.57 11.328l-62.134.061c-5.51-.264-15.934-5.764-18.758-10.655L1.856 86.155C-.846 81.475-.37 70.648 1.82 66.003z",id:"MLMatch_svg__a"}),c().createElement("path",{d:"M11.109 67.042l28.713-49.618C41.92 13.77 49.931 9.158 55.006 8.7l57.143.005c4.486-.209 13.147 4.516 15.871 9.223l27.954 48.298c2.83 4.89 2.467 14.696-.095 19.586l-27.391 47.334c-3.343 4.537-12.55 9.84-17.342 10.013l-55.094-.004c-4.886-.24-14.134-5.12-16.643-9.454L11.16 84.889c-2.4-4.147-1.989-13.735-.05-17.847z",id:"MLMatch_svg__c"}),c().createElement("path",{d:"M.995 0c26.4.684 47.59 22.234 47.59 48.72 0 26.23-23.795 34.53-23.795 56.987 0 3.703-3.011 6.705-6.725 6.705l-17.07-.001V68.985c6.466-1.238 11.353-6.923 11.353-13.75S7.46 42.722.995 41.485V0z",id:"MLMatch_svg__e"}),c().createElement("path",{d:"M47.353 0l-.087 41.235-.225.003c-7.588.167-13.688 6.37-13.688 13.997 0 7.683 6.19 13.92 13.854 14l-.091 43.265H27.887c-1.894-.56-3.197-1.234-3.91-2.025-.712-.79-1.357-2.275-1.933-4.455l-2.335-10.733c-.354-1.265-.674-2.183-.96-2.753-.286-.57-.784-1.281-1.494-2.134L2.002 70.367c-.846-.949-1.383-1.73-1.61-2.343-.228-.613-.356-1.626-.386-3.038V31.34c-.028-.785.044-1.37.216-1.757.173-.387.566-.848 1.18-1.382L28.368.885c.37-.367.665-.601.885-.704.22-.103.557-.163 1.01-.181h17.09z",id:"MLMatch_svg__h"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("g",{transform:"translate(12 6)"},c().createElement("use",{fill:"url(#MLMatch_svg__b)",xlinkHref:"#MLMatch_svg__a"}),c().createElement("use",{fill:"url(#MLMatch_svg__d)",opacity:.5,xlinkHref:"#MLMatch_svg__c"})),c().createElement("g",{transform:"translate(69.652 30.765)"},c().createElement("rect",{fill:"#363636",x:15.457,y:132.745,width:21.151,height:23.158,rx:10.576}),c().createElement("path",{d:"M48.146 118.763v18.93c0 7.198-5.944 13.035-13.277 13.035h-16.71c-7.333 0-13.278-5.837-13.278-13.036v-18.929a13 13 0 01.023-.763h43.22a13 13 0 01.022.763z",fill:"#717171"}),c().createElement("path",{d:"M41.348 137.2c0 7.199-4.947 13.035-11.048 13.035H16.395c-6.101 0-11.047-5.836-11.047-13.035v-18.965h36V137.2z",fill:"#828282"}),c().createElement("path",{d:"M47.51 138.235a4 4 0 110 8H4.556a4 4 0 110-8h42.956zm0-11a4 4 0 110 8H4.556a4 4 0 110-8h42.956zm0-11a4 4 0 110 8H4.556a4 4 0 110-8h42.956z",fill:"#B1B1B1"}),c().createElement("path",{d:"M24.999 138.234v8h-16v-8h16zm0-11v8h-16v-8h16zm0-11v8h-16v-8h16z",fill:"#C5C5C5"}),c().createElement("g",{transform:"translate(27)"},c().createElement("mask",{id:"MLMatch_svg__f",fill:"#fff"},c().createElement("use",{xlinkHref:"#MLMatch_svg__e"})),c().createElement("use",{fill:"#FFD44B",xlinkHref:"#MLMatch_svg__e"}),c().createElement("path",{d:"M-49 48.729C-49 21.583-27.155 0-.207 0 26.74 0 48.585 21.817 48.585 48.729c0 26.227-23.75 34.525-23.75 56.98a6.708 6.708 0 01-6.713 6.703h-38.208a6.708 6.708 0 01-6.712-6.704C-26.798 85.217-49 75.875-49 48.73z",fill:"#FFD347",mask:"url(#MLMatch_svg__f)"}),c().createElement("path",{d:"M-49 48.729C-49 21.583-27.155 0-.207 0 26.74 0 48.585 21.817 48.585 48.729c0 26.227-23.75 34.525-23.75 56.98a6.708 6.708 0 01-6.713 6.703h-38.208a6.708 6.708 0 01-6.712-6.704C-26.798 85.217-49 75.875-49 48.73z",fill:"#FFDE72",mask:"url(#MLMatch_svg__f)"}),c().createElement("path",{d:"M11.965 48.645c.17-7.171 7.488-10.693 13.863-6.802 7.245 4.422 4.05 16.311-4.742 16.548l-.268.004h-3.227l-4.608 56.092-5.995-.253 4.413-51.248.185-4.592-10.592.001v-6h10.83l.139-3.585.002-.165zm10.737-1.681c-2.54-1.55-4.64-.58-4.737 1.766l-.005.284-.131 3.38 2.99.001c2.852 0 3.999-3.945 2.011-5.347l-.128-.084z",fill:"#F3BE13",mask:"url(#MLMatch_svg__f)"}),c().createElement("ellipse",{fill:"url(#MLMatch_svg__g)",mask:"url(#MLMatch_svg__f)",cx:-1.89,cy:48.245,rx:36.534,ry:36.667}))),c().createElement("g",{transform:"translate(45.647 30.765)"},c().createElement("mask",{id:"MLMatch_svg__j",fill:"#fff"},c().createElement("use",{xlinkHref:"#MLMatch_svg__h"})),c().createElement("use",{fill:"url(#MLMatch_svg__i)",xlinkHref:"#MLMatch_svg__h"}),c().createElement("path",{fill:"#D6FCFA",fillRule:"nonzero",opacity:.5,mask:"url(#MLMatch_svg__j)",d:"M38.24 11.235v6l-3.55-.001-22.207 22.207h-18.13v-6H9.997l22.207-22.206zM25.682 40.779l13.8 13.799H50v6H36.997L21.439 45.021zM53.311 28.235v6h-13.65l-3.935 4.246-4.4-4.08 5.718-6.166zM14.248 52.235l20.52 20.52h3.695v6h-6.18l-20.52-20.52H-.647v-6zM21.353 84.235h8.95L40.4 94.332h16.753v6H37.915L27.817 90.235z"})),c().createElement("circle",{fill:"#008FD8",cx:94,cy:86,r:9}))),Fu=(0,nt.Z)(Vu),Hu=e=>{let{isMlMatch:t=!1,matchRules:r}=e;const n=Uu(),[a,l]=(0,s.useState)(!1),o=(0,s.useCallback)((()=>l((e=>!e))),[]);return c().createElement("div",{className:n.container},c().createElement(Fu,{tooltipTitle:c().createElement(Ru,{matchRules:r,isMlMatch:t}),tooltipPlacement:"bottom-start",onExpand:o,expanded:a},t?c().createElement(c().Fragment,null,c().createElement(zu,{className:n.icon}),x().text("Match IQ")):x().text("Rules")),a?c().createElement(Zu,{className:n.rulesContainer,matchRules:r,isMlMatch:t}):null)};function Wu(){return Wu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wu.apply(this,arguments)}const qu=e=>{let{matchRules:t,Component:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["matchRules","Component"]);const[a,l]=(0,u.UkJ)(t);return c().createElement(c().Fragment,null,(0,N.isEmpty)(l)?null:c().createElement(r,Wu({matchRules:l},n)),(0,N.isEmpty)(a)?null:c().createElement(r,Wu({isMlMatch:!0,matchRules:a},n)))};qu.propTypes={matchRules:u.p3$,Component:B().func};const Gu=qu,$u=(0,T.Z)((e=>({label:{fontSize:"13px",lineHeight:"15px",color:e.palette.primary.light},container:{display:"flex",flexDirection:"column"},badge:{display:"flex",marginBottom:"8px",cursor:"pointer"},matchLabels:{marginLeft:"30px"}}))),Ku=e=>{let{label:t,matchRules:r}=e;const n=$u(),[a,l]=(0,s.useState)(!1),o=(0,s.useCallback)((()=>l((e=>!e))),[]);return c().createElement("div",{className:n.container},c().createElement("div",{onClick:o,className:n.badge},c().createElement(Ut,{expanded:a}),c().createElement("div",{className:n.label},t)),a?c().createElement(Gu,{Component:Zu,matchRules:r,className:n.matchLabels}):null)},Yu=(0,T.Z)({container:{display:"flex",flexDirection:"column"},rulesWrapper:{display:"flex",flexDirection:"column"}}),Xu=(0,T.Z)({ruleWrapper:{paddingTop:"8px"},label:{fontWeight:500,fontSize:"12px"}}),Qu=e=>{let{transitiveMatchRules:t}=e;const r=Xu();return c().createElement(c().Fragment,null,t.map(((e,t)=>{let{label:n,matchRules:a}=e;return c().createElement("div",{key:t,className:r.ruleWrapper},c().createElement("div",{className:r.label},n),c().createElement(Ru,{matchRules:a}))})))};function Ju(){return Ju=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ju.apply(this,arguments)}const ep=(0,nt.Z)(Vu),tp=e=>{let{transitiveMatchRules:t}=e;const r=Yu(),[n,a]=(0,s.useState)(!1),l=(0,s.useCallback)((()=>a((e=>!e))),[]);return c().createElement("div",{className:r.container},c().createElement(ep,{tooltipTitle:c().createElement(Qu,{transitiveMatchRules:t}),tooltipPlacement:"bottom-start",onExpand:l,expanded:n},x().text("Transitive matches")),n?t.map(((e,t)=>c().createElement(Ku,Ju({key:t},e)))):null)},rp=e=>{let{entitiesMap:t,entity:r,match:n,metadata:a}=e;return(0,u.Pcm)(n)?c().createElement(tp,{transitiveMatchRules:(0,u.wB1)(a,n,t)}):c().createElement(Gu,{matchRules:(0,u.LS0)(a,r.type,n.matchRules),Component:Hu})};var np=r(73698);const ap=(0,T.Z)((e=>({root:{maxWidth:156,paddingTop:"9px",paddingBottom:"9px"},outlined:{paddingRight:32,paddingLeft:12},arrowIcon:{fontSize:"18px",top:"calc(50% - 9px)",right:"12px",color:e.palette.text.secondary},currentValue:{display:"flex",alignItems:"center"},currentValueIcon:{fontSize:"18px",marginRight:"8px",color:e.palette.text.secondary},currentValueText:{fontSize:"14px",lineHeight:"16px",textTransform:"uppercase",fontWeight:500,color:e.palette.text.primary,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},menuItem:{padding:"9px 12px 7px"},firstMenuItemButton:{borderTop:"1px solid #e4e4e4"},menuItemInner:{display:"flex",alignItems:"flex-start"},menuItemIcon:{fontSize:"18px",color:e.palette.text.secondary,marginRight:"9px"},menuItemLabel:{fontSize:"14px",lineHeight:"16px",fontWeight:500,color:e.palette.text.primary},menuItemDescription:{fontSize:"10px",lineHeight:"16px",color:e.palette.text.secondary}})));function lp(){return lp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lp.apply(this,arguments)}const op=e=>"onClick"in e,ip=e=>{let{optionsGroup:t,buttonsGroup:r,value:n,onChange:a,disabled:l=!1}=e;const o=ap();return c().createElement(np.Z,{classes:{root:o.root,icon:o.arrowIcon,outlined:o.outlined},value:n,onChange:e=>{const{value:r}=e.target;t.some((0,N.propEq)("value",r))&&a(r)},variant:"outlined",renderValue:e=>{const{icon:r,label:n}=t.find((0,N.propEq)("value",e));return c().createElement(E.Z,{className:o.currentValue},c().createElement(r,{className:o.currentValueIcon}),c().createElement(ae.ZP,{title:n},c().createElement(v.Z,{className:o.currentValueText},n)))},MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},getContentAnchorEl:null},disabled:l,"data-reltio-id":"reltio-profile-select-mode"},(e=>{const t=e.findIndex(op);return e.map(((e,r)=>{const{value:n,description:a,icon:l}=e,i={value:n,className:o.menuItem};return op(e)&&(i.onClick=()=>e.onClick(n),i.className=b()(i.className,{[o.firstMenuItemButton]:r===t})),c().createElement(Ma.Z,lp({key:n},i,{"data-reltio-id":`reltio-profile-select-mode-${n}`}),c().createElement(E.Z,{className:o.menuItemInner},c().createElement(l,{className:o.menuItemIcon}),c().createElement(E.Z,null,c().createElement(v.Z,{className:o.menuItemLabel},n),c().createElement(v.Z,{className:o.menuItemDescription},a))))}))})([...t,...r]))};var sp=r(16482),cp=r(73272);function up(){return up=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},up.apply(this,arguments)}const pp=e=>c().createElement("svg",up({viewBox:"0 0 20 20"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 10L14 5.5V9h-3.5L5 3.5 3.5 5l6.04 6H14v3.5l4.5-4.5zM7.04 11.455L3.5 15 5 16.5l3.54-3.545-1.5-1.5z"})),dp=(0,T.Z)((e=>({expanded:{backgroundColor:"rgba(0, 0, 0, 0.03)"},info:{fontSize:"13px",color:e.palette.text.secondary,wordWrap:"break-word"},icon:{width:"32px",height:"32px",fill:"#fff",backgroundColor:"rgba(177, 92, 189, 1)",borderRadius:"50%",margin:"5px 12px 0 8px"},infoBlock:{display:"flex",flexDirection:"row"},header:{display:"flex",flexDirection:"row",paddingBottom:"5px"},flex:{flex:1},caption:{fontSize:"16px",color:"rgba(0, 0, 0, 0.87)"},title:{display:"flex",flexDirection:"row",alignItems:"center",margin:"6px 0 8px 0"},flag:{height:"12px",width:"12px",stroke:"#000000",fill:"none",margin:"2px 5px 0 5px"},pmReviewCard:{borderTop:"3px solid #E83D40",flexDirection:"column",width:"100%"},date:{fontSize:"13px",color:"rgba(0, 0, 0, 0.87)"},mainInfo:{display:"flex",flexDirection:"column",flex:1}}))),mp=e=>{let{date:t,type:r,createdBy:n,step:a,children:l,Actions:o}=e;const i=dp(),[u,p]=(0,s.useState)(!1);return c().createElement("div",{className:i.pmReviewCard},c().createElement("div",{className:b()(i.header,{[i.expanded]:u})},c().createElement(pp,{className:i.icon}),c().createElement("div",{className:i.mainInfo},c().createElement("div",{className:i.title},c().createElement("div",{className:b()(i.caption,i.flex)},x().text("Match review")),c().createElement(cp.Z,{className:i.flag}),c().createElement("span",{className:i.date},x().date(t,"L")),c().createElement(ks.Z,{isOpen:u,onClick:()=>{p(!u)}})),c().createElement("div",{className:i.infoBlock},c().createElement("div",{className:i.flex},c().createElement("div",{className:i.info},r),c().createElement("div",{className:i.info},x().text("Created by ${createdBy}",{createdBy:n})),c().createElement("div",{className:i.info},x().text("Step: ${step}",{step:a}))),o))),u?l:null)};mp.propTypes={date:B().number,createdBy:B().string,type:B().string,step:B().string,children:B().oneOfType([B().node,B().arrayOf(B().node)]),Actions:B().node};const gp=mp,hp=e=>{let{label:t,value:r,uri:n,rangeColorsConfig:a,className:l}=e;const o=H();return c().createElement("div",{className:b()(o.container,l),key:n},c().createElement(Y,{attrTypeUri:n,label:t}),c().createElement("span",{className:o.value,style:{color:(0,u.Uz2)(n,r,a)}},r))};hp.propTypes={label:B().string,value:B().oneOfType([B().string,B().number]),uri:B().string,rangeColorsConfig:B().object,className:B().string};const fp=hp,bp=(0,T.Z)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"inset 0 -1px 0 0 rgba(0,114,206,0.06), inset 0 1px 0 0 rgba(0,114,206,0.06);","&:after":{content:'""',minHeight:"inherit",fontSize:0}},inactive:{background:e.inactiveBackground},profileIcon:{marginRight:"12px"},imageProfileIcon:{width:"48px",height:"48px"},profileInfo:{display:"flex",flexDirection:"column",flex:"1 1 50%"},badge:{},label:{lineHeight:"1.2",letterSpacing:"0.25px",color:e.palette.text.primary,wordBreak:"break-word","&+ $specialInfo":{marginTop:"4px"}},secondaryLabel:{display:"inline-flex",color:e.palette.text.primary,marginTop:"2px",lineHeight:"16px",fontSize:"14px",fontWeight:400,"&+ $businessCard":{marginLeft:"12px"}},businessCard:{color:e.palette.text.secondary,display:"inline-flex",fontSize:"14px",marginTop:"4px",lineHeight:"1.2"},specialInfo:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",width:"100%",marginTop:"8px"},entityType:{display:"flex",flexWrap:"wrap"},entityId:{fontSize:"13px",color:e.palette.text.secondary,whiteSpace:"nowrap",cursor:"pointer","&:hover":{textDecoration:"underline"}},scores:{display:"flex",flexGrow:1,justifyContent:"flex-end",paddingRight:"20px"}})));function yp(){return yp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yp.apply(this,arguments)}const xp=e=>{let{className:t,entity:r,scoresToShow:n,rangeColorsConfig:a,children:l,classes:o}=e;const i=bp({classes:o}),p=(0,g.useSelector)(h.ZP.selectors.getMetadata),d=(0,s.useCallback)((()=>{navigator.clipboard.writeText((0,u.BTI)(r))}),[r]);if((0,N.isNil)(r))return null;const m=(0,u.idV)(r.label),f=r.secondaryLabel,y=(0,u.ptG)(p,r),E=(0,u.Fn9)(r),w=(0,u.AET)(p,r,n),O=r.uri;return c().createElement("div",{className:b()(i.profileBandWrapper,t)},c().createElement("div",{className:b()(i.profileBand,{[i.inactive]:!E}),"data-entity-uri":O},c().createElement(ht,{key:r.uri,entity:r,avatarClassName:i.profileIcon,imageClassName:i.imageProfileIcon}),c().createElement("div",{className:i.profileInfo},c().createElement("div",null,c().createElement(v.Z,{variant:"h6",className:i.label},m),f&&c().createElement(v.Z,{variant:"subtitle2",className:i.secondaryLabel},f),y&&c().createElement(v.Z,{variant:"subtitle1",className:i.businessCard},y)),c().createElement("div",{className:i.specialInfo},c().createElement("div",{className:i.entityType},c().createElement(Uc,{entity:r,size:"medium",className:i.badge}),w.length>0&&c().createElement("div",{className:i.scores},w.map((e=>c().createElement(fp,yp({key:e.uri},e,{rangeColorsConfig:a}))))),c().createElement(ae.ZP,{title:x().text("Copy to clipboard")},c().createElement(v.Z,{display:"inline",variant:"body2",className:i.entityId,onClick:d},x().text("Entity ID"),": ",(0,u.BTI)(r)))))),l&&c().createElement("div",null,l)))};xp.propTypes={className:B().string,entity:B().object,scoresToShow:B().arrayOf(B().string),rangeColorsConfig:B().object,children:B().node,classes:B().object};const Ep=xp,vp=(0,T.Z)((e=>({container:{position:"relative",display:"flex",fontSize:"12px",lineHeight:"14px",color:e.palette.text.primary,padding:"8px 8px 8px 0",overflow:"hidden"},colorBox:{position:"absolute",opacity:.12,top:0,left:0,bottom:0,width:"32px"},image:{width:"32px",height:"32px"},avatar:{marginRight:"8px",marginLeft:"16px",marginTop:"2px"},info:{overflow:"hidden",display:"flex",flexDirection:"column"},firstRow:{width:"100%"},label:{display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:500,color:e.palette.primary.main},link:{textDecoration:"none"},secondRow:{wordWrap:"break-word",marginTop:"4px",lineHeight:"13px",fontSize:"11px"},thirdRow:{display:"flex",alignItems:"center",fontSize:"12px",color:e.palette.text.secondary,marginTop:"auto"}})));function wp(){return wp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wp.apply(this,arguments)}const Op=(0,s.memo)((e=>{let{entity:t,classes:r={},disableEntityTypeColor:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","disableEntityTypeColor"]);const l=vp(),{secondaryLabel:o,label:i,container:s}=r,p=(0,g.useSelector)(h.ZP.selectors.getMetadata),d=(0,u.idV)(t.label),{secondaryLabel:m,type:f}=t,y=(0,u.nt9)(p,f)||{},x=(0,u.VD3)(p,y,"typeColor")||u.rSc.palette.primary.main;return c().createElement("div",wp({className:b()(l.container,s)},a),c().createElement("div",{className:l.colorBox,style:n?void 0:{backgroundColor:x}}),c().createElement(ht,{entity:t,avatarClassName:l.avatar,imageClassName:l.image}),c().createElement("div",{className:l.info},c().createElement("div",{className:l.firstRow},c().createElement(xe.Z,{value:(0,u.wwR)(t),className:l.link},c().createElement(pi.C,{value:d,placement:"top",showOnExceededHeight:!0},c().createElement("span",{className:b()(l.label,i)},d)))),c().createElement("div",{className:l.secondRow},m&&c().createElement(pi.C,{value:m,placement:"top",showOnExceededHeight:!0},c().createElement("span",{className:o},m))),c().createElement("div",{className:l.thirdRow},c().createElement(Uc,{entity:t}),c().createElement("div",null,(0,u.BTI)(t)))))})),Cp=(0,T.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));var Tp=r(6782);const Sp="46px",kp=(0,T.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:Sp},readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:Sp}}))),Np=e=>{let{className:t,rowData:r}=e;const n=kp();return c().createElement("div",{className:b()(n.readOnlyLogicOperatorContainer,t)},r&&r.operator?(0,Tp.Z)(r.operator):x().text("Where"))};Np.propTypes={className:B().string,rowData:B().object};const Ip=Np,Pp=e=>{let{className:t,rowData:r}=e;const n=kp();return c().createElement("div",{className:b()(n.readOnlyFilter,t)},r&&r.filter?(0,u.XS2)(r.filter):x().text("equals"))};Pp.propTypes={className:B().string,rowData:B().object};const Dp=Pp;const Ap=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=Ip,AttributeSelectorComponent:l,FilterSelectorComponent:o=Dp,ValuesEditorComponent:i,ActionsComponent:s,filterSelectorRef:u,attributeSelectorProps:p={}}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const m=Cp();return c().createElement("div",{className:b()(m.row,t.root)},c().createElement(a,{className:t.logicOperatorContainer,rowContext:d,rowData:n}),c().createElement("div",{className:b()(m.rowItem,t.attributeSelectorContainer)},c().createElement(l,{attributeSelectorProps:p,rowContext:d,rowData:r})),c().createElement("div",{className:b()(m.rowItem,t.filterSelectorContainer)},c().createElement(o,{textFieldInputRef:u,rowContext:d,rowData:r})),c().createElement("div",{className:b()(m.rowItem,m.fullWidth,t.valuesEditorContainer)},c().createElement(i,{rowContext:d,rowData:r})),c().createElement("div",{className:b()(m.rowItem,t.actionsContainer,{[m.hidden]:!r})},c().createElement(s,{rowContext:d,rowData:r})))};Ap.propTypes={classes:B().shape({root:B().string,logicOperatorContainer:B().string,attributeSelectorContainer:B().string,filterSelectorContainer:B().string,valuesEditorContainer:B().string,actionsContainer:B().string}),rowData:ji.Xw,previousRowData:ji.Xw,LogicOperatorComponent:B().elementType,AttributeSelectorComponent:B().elementType,FilterSelectorComponent:B().elementType,ValuesEditorComponent:B().elementType,ActionsComponent:B().elementType,filterSelectorRef:B().object,attributeSelectorProps:B().shape({onRestoreFocus:B().func,onOpen:B().func,disablePopoverRestoreFocus:B().bool})};const Rp=(0,s.memo)(Ap);function jp(){return jp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jp.apply(this,arguments)}const Zp=e=>{let{className:t,rowClasses:r,rowsData:n,lastRowAttributeSelectorProps:a,filterSelectorRef:l,filterSelectorRefIndex:o}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","rowClasses","rowsData","lastRowAttributeSelectorProps","filterSelectorRef","filterSelectorRefIndex"]);const s=(e,t,n)=>{const s=t>0?(0,N.path)([t-1],n):null,u=t===n.length?{attributeSelectorProps:a}:{};return c().createElement(Rp,jp({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?l:void 0},i,u))};return c().createElement("div",{className:t},n.map(s),s(null,n.length,n))};Zp.propTypes={className:B().string,rowClasses:B().shape({root:B().string,logicOperatorContainer:B().string,attributeSelectorContainer:B().string,filterSelectorContainer:B().string,valuesEditorContainer:B().string,actionsContainer:B().string}),rowsData:B().arrayOf(ji.Xw),LogicOperatorComponent:B().elementType,AttributeSelectorComponent:B().elementType,FilterSelectorComponent:B().elementType,ValuesEditorComponent:B().elementType,ActionsComponent:B().elementType,filterSelectorRef:B().object,filterSelectorRefIndex:B().number,lastRowAttributeSelectorProps:B().shape({onRestoreFocus:B().func,onOpen:B().func,disablePopoverRestoreFocus:B().bool})};const Lp=(0,s.memo)(Zp);var _p=r(15793);const Mp={BY_LABEL:(0,r(54573).c)({stringify:(0,N.prop)("label")})};var Vp=r(81521),Up=r(8978),Bp=r(46847),zp=r(15459);function Fp(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}const Hp=(0,T.Z)((()=>({"@global .rst__node":{minWidth:"100%",whiteSpace:"nowrap",position:"relative",textAlign:"left"},"@global .rst__node.rst__rtl":{textAlign:"right"},"@global .rst__nodeContent":{position:"absolute",top:0,bottom:0},"@global .rst__lineBlock, .rst__absoluteLineBlock":{height:"100%",position:"relative",display:"inline-block"},"@global .rst__absoluteLineBlock":{position:"absolute",top:0},"@global .rst__lineHalfHorizontalRight::before, .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after":{position:"absolute",content:"",backgroundColor:"black"},"@global .rst__lineHalfHorizontalRight::before":{height:"1px",top:"50%",right:0,width:"50%"},"@global .rst__rtl.rst__lineHalfHorizontalRight::before":{left:0,right:"initial"},"@global .rst__lineFullVertical::after, .rst__lineHalfVerticalTop::after, .rst__lineHalfVerticalBottom::after":{width:"1px",left:"50%",top:0,height:"100%"},"@global .rst__rtl.rst__lineFullVertical::after, .rst__rtl.rst__lineHalfVerticalTop::after, .rst__rtl.rst__lineHalfVerticalBottom::after":{right:"50%",left:"initial"},"@global .rst__lineHalfVerticalTop::after":{height:"50%"},"@global .rst__lineHalfVerticalBottom::after":{top:"auto",bottom:0,height:"50%"},"@global .rst__highlightLineVertical":{zIndex:3},"@global .rst__highlightLineVertical::before":{position:"absolute",content:"",backgroundColor:"#36c2f6",width:"8px",marginLeft:"-4px",left:"50%",top:0,height:"100%"},"@global .rst__rtl.rst__highlightLineVertical::before":{marginLeft:"initial",marginRight:"-4px",left:"initial",right:"50%"},"@keyframes arrow-pulse":{"0%":{transform:"translate(0, 0)",opacity:0},"30%":{transform:"translate(0, 300%)",opacity:1},"70%":{transform:"translate(0, 700%)",opacity:1},"100%":{transform:"translate(0, 1000%)",opacity:0}},"@global .rst__highlightLineVertical::after":{content:"",position:"absolute",height:0,marginLeft:"-4px",left:"50%",top:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid white",animation:"arrow-pulse 1s infinite linear both"},"@global .rst__rtl.rst__highlightLineVertical::after":{marginLeft:"initial",marginRight:"-4px",right:"50%",left:"initial"},"@global .rst__highlightTopLeftCorner::before":{zIndex:3,content:"",position:"absolute",borderTop:"solid 8px #36c2f6",borderLeft:"solid 8px #36c2f6",boxSizing:"border-box",height:"calc(50% + 4px)",top:"50%",marginTop:"-4px",right:0,width:"calc(50% + 4px)"},"@global .rst__rtl.rst__highlightTopLeftCorner::before":{borderRight:"solid 8px #36c2f6",borderLeft:"none",left:0,right:"initial"},"@global .rst__highlightBottomLeftCorner":{zIndex:3},"@global .rst__highlightBottomLeftCorner::before":{content:"",position:"absolute",borderBottom:"solid 8px #36c2f6",borderLeft:"solid 8px #36c2f6",boxSizing:"border-box",height:"calc(100% + 4px)",top:0,right:"12px",width:"calc(50% - 8px)"},"@global .rst__rtl.rst__highlightBottomLeftCorner::before":{borderRight:"solid 8px #36c2f6",borderLeft:"none",left:"12px",right:"initial"},"@global .rst__highlightBottomLeftCorner::after":{content:"",position:"absolute",height:0,right:0,top:"100%",marginTop:"-12px",borderTop:"12px solid transparent",borderBottom:"12px solid transparent",borderLeft:"12px solid #36c2f6"},"@global .rst__rtl.rst__highlightBottomLeftCorner::after":{left:0,right:"initial",borderRight:"12px solid #36c2f6",borderLeft:"none"}})));function Wp(){return Wp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wp.apply(this,arguments)}const qp=e=>{let{children:t,listIndex:r,swapFrom:n,swapLength:a,swapDepth:l,scaffoldBlockPxWidth:o,lowerSiblingCounts:i,connectDropTarget:u,isOver:p,draggedNode:d,canDrop:m,treeIndex:g,treeId:h,getPrevRow:f,node:b,path:y,rowDirection:x}=e,E=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","listIndex","swapFrom","swapLength","swapDepth","scaffoldBlockPxWidth","lowerSiblingCounts","connectDropTarget","isOver","draggedNode","canDrop","treeIndex","treeId","getPrevRow","node","path","rowDirection"]);Hp();const v="rtl"===x?"rst__rtl":null,w=i.length,O=[];let C;return i.forEach(((e,t)=>{let i="";if(e>0?i=0===r?"rst__lineHalfHorizontalRight rst__lineHalfVerticalBottom":t===w-1?"rst__lineHalfHorizontalRight rst__lineFullVertical":"rst__lineFullVertical":0===r?i="rst__lineHalfHorizontalRight":t===w-1&&(i="rst__lineHalfVerticalTop rst__lineHalfHorizontalRight"),O.push(c().createElement("div",{key:`pre_${1+t}`,style:{width:o},className:Fp("rst__lineBlock",i,v)})),g!==r&&t===l){let e,l="";l=r===n+a-1?"rst__highlightBottomLeftCorner":g===n?"rst__highlightTopLeftCorner":"rst__highlightLineVertical",e="rtl"===x?{width:o,right:o*t}:{width:o,left:o*t},O.push(c().createElement("div",{key:t,style:e,className:Fp("rst__absoluteLineBlock",l,v)}))}})),C="rtl"===x?{right:o*w}:{left:o*w},u(c().createElement("div",Wp({},E,{className:Fp("rst__node",v)}),O,c().createElement("div",{className:"rst__nodeContent",style:C},s.Children.map(t,(e=>(0,s.cloneElement)(e,{isOver:p,canDrop:m,draggedNode:d}))))))};qp.defaultProps={swapFrom:null,swapDepth:null,swapLength:null,canDrop:!1,draggedNode:null,rowDirection:"ltr"},qp.propTypes={treeIndex:B().number.isRequired,treeId:B().string.isRequired,swapFrom:B().number,swapDepth:B().number,swapLength:B().number,scaffoldBlockPxWidth:B().number.isRequired,lowerSiblingCounts:B().arrayOf(B().number).isRequired,listIndex:B().number.isRequired,children:B().node.isRequired,connectDropTarget:B().func.isRequired,isOver:B().bool.isRequired,canDrop:B().bool,draggedNode:B().shape({}),getPrevRow:B().func.isRequired,node:B().shape({}).isRequired,path:B().arrayOf(B().oneOfType([B().string,B().number])).isRequired,rowDirection:B().string};const Gp=qp;function $p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Kp(e,t,r[t])}))}return e}function Kp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yp(e){let{targetIndex:t,node:r,currentIndex:n,getNodeKey:a,path:l=[],lowerSiblingCounts:o=[],ignoreCollapsed:i=!0,isPseudoRoot:s=!1}=e;const c=s?[]:[...l,a({node:r,treeIndex:n})];if(n===t)return{node:r,lowerSiblingCounts:o,path:c};if(!r.children||i&&!0!==r.expanded)return{nextIndex:n+1};let u=n+1;const p=r.children.length;for(let e=0;e<p;e+=1){const n=Yp({ignoreCollapsed:i,getNodeKey:a,targetIndex:t,node:r.children[e],currentIndex:u,lowerSiblingCounts:[...o,p-e-1],path:c});if(n.node)return n;u=n.nextIndex}return{nextIndex:u}}function Xp(e){let{node:t,ignoreCollapsed:r=!0}=e;return Yp({getNodeKey:()=>{},ignoreCollapsed:r,node:t,currentIndex:0,targetIndex:-1}).nextIndex-1}function Qp(e){let{callback:t,getNodeKey:r,ignoreCollapsed:n,isPseudoRoot:a=!1,node:l,parentNode:o=null,currentIndex:i,path:s=[],lowerSiblingCounts:c=[]}=e;const u=a?[]:[...s,r({node:l,treeIndex:i})];if(!a&&!1===t(a?null:{node:l,parentNode:o,path:u,lowerSiblingCounts:c,treeIndex:i}))return!1;if(!l.children||!0!==l.expanded&&n&&!a)return i;let p=i;const d=l.children.length;if("function"!=typeof l.children)for(let e=0;e<d;e+=1)if(p=Qp({callback:t,getNodeKey:r,ignoreCollapsed:n,node:l.children[e],parentNode:a?null:l,currentIndex:p+1,lowerSiblingCounts:[...c,d-e-1],path:u}),!1===p)return!1;return p}function Jp(e){let{callback:t,getNodeKey:r,ignoreCollapsed:n,isPseudoRoot:a=!1,node:l,parentNode:o=null,currentIndex:i,path:s=[],lowerSiblingCounts:c=[]}=e;const u=$p({},l),p=a?[]:[...s,r({node:u,treeIndex:i})],d={node:u,parentNode:o,path:p,lowerSiblingCounts:c,treeIndex:i};if(!u.children||!0!==u.expanded&&n&&!a)return{treeIndex:i,node:t(d)};let m=i;const g=u.children.length;return"function"!=typeof u.children&&(u.children=u.children.map(((e,l)=>{const o=Jp({callback:t,getNodeKey:r,ignoreCollapsed:n,node:e,parentNode:a?null:u,currentIndex:m+1,lowerSiblingCounts:[...c,g-l-1],path:p});return m=o.treeIndex,o.node}))),{node:t(d),treeIndex:m}}function ed(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;!t||t.length<1||Qp({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]})}function td(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;return!t||t.length<1?[]:Jp({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]}).node.children}function rd(e){let{treeData:t,expanded:r=!0}=e;return td({treeData:t,callback:e=>{let{node:t}=e;return $p({},t,{expanded:r})},getNodeKey:e=>{let{treeIndex:t}=e;return t},ignoreCollapsed:!1})}function nd(e){let{treeData:t,path:r,newNode:n,getNodeKey:a,ignoreCollapsed:l=!0}=e;const o="RESULT_MISS",i=e=>{let{isPseudoRoot:t=!1,node:s,currentTreeIndex:c,pathIndex:u}=e;if(!t&&a({node:s,treeIndex:c})!==r[u])return o;if(u>=r.length-1)return"function"==typeof n?n({node:s,treeIndex:c}):n;if(!s.children)throw new Error("Path referenced children of node with no children.");let p=c+1;for(let e=0;e<s.children.length;e+=1){const t=i({node:s.children[e],currentTreeIndex:p,pathIndex:u+1});if(t!==o)return $p({},s,t?{children:[...s.children.slice(0,e),t,...s.children.slice(e+1)]}:{children:[...s.children.slice(0,e),...s.children.slice(e+1)]});p+=1+Xp({node:s.children[e],ignoreCollapsed:l})}return o},s=i({node:{children:t},currentTreeIndex:-1,pathIndex:-1,isPseudoRoot:!0});if(s===o)throw new Error("No node found at the given path.");return s.children}function ad(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,l=null,o=null;return{treeData:nd({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:e=>{let{node:t,treeIndex:r}=e;return l=t,o=r,null}}),node:l,treeIndex:o}}function ld(e){let{targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:l,isPseudoRoot:o=!1,isLastChild:i,node:s,currentIndex:c,currentDepth:u,getNodeKey:p,path:d=[]}=e;const m=e=>o?[]:[...d,p({node:e,treeIndex:c})];if(c>=r-1||i&&(!s.children||!s.children.length)){if("function"==typeof s.children)throw new Error("Cannot add to children defined by a function");{const e=$p({},s,l?{expanded:!0}:{},{children:s.children?[n,...s.children]:[n]});return{node:e,nextIndex:c+2,insertedTreeIndex:c+1,parentPath:m(e),parentNode:o?null:e}}}if(u>=t-1){if(!s.children||"function"==typeof s.children||!0!==s.expanded&&a&&!o)return{node:s,nextIndex:c+1};let e=c+1,t=null,l=null;for(let n=0;n<s.children.length;n+=1){if(e>=r){t=e,l=n;break}e+=1+Xp({node:s.children[n],ignoreCollapsed:a})}if(null===l){if(e<r&&!i)return{node:s,nextIndex:e};t=e,l=s.children.length}const u=$p({},s,{children:[...s.children.slice(0,l),n,...s.children.slice(l)]});return{node:u,nextIndex:e,insertedTreeIndex:t,parentPath:m(u),parentNode:o?null:u}}if(!s.children||"function"==typeof s.children||!0!==s.expanded&&a&&!o)return{node:s,nextIndex:c+1};let g=null,h=null,f=null,b=c+1,y=s.children;"function"!=typeof y&&(y=y.map(((e,o)=>{if(null!==g)return e;const s=ld({targetDepth:t,minimumTreeIndex:r,newNode:n,ignoreCollapsed:a,expandParent:l,isLastChild:i&&o===y.length-1,node:e,currentIndex:b,currentDepth:u+1,getNodeKey:p,path:[]});return"insertedTreeIndex"in s&&({insertedTreeIndex:g,parentNode:f,parentPath:h}=s),b=s.nextIndex,s.node})));const x=$p({},s,{children:y}),E={node:x,nextIndex:b};return null!==g&&(E.insertedTreeIndex=g,E.parentPath=[...m(x),...h],E.parentNode=f),E}function od(e){let{treeData:t,depth:r,minimumTreeIndex:n,newNode:a,getNodeKey:l=(()=>{}),ignoreCollapsed:o=!0,expandParent:i=!1}=e;if(!t&&0===r)return{treeData:[a],treeIndex:0,path:[l({node:a,treeIndex:0})],parentNode:null};const s=ld({targetDepth:r,minimumTreeIndex:n,newNode:a,ignoreCollapsed:o,expandParent:i,getNodeKey:l,isPseudoRoot:!0,isLastChild:!0,node:{children:t},currentIndex:-1,currentDepth:-1});if(!("insertedTreeIndex"in s))throw new Error("No suitable position found to insert.");const c=s.insertedTreeIndex;return{treeData:s.node.children,treeIndex:c,path:[...s.parentPath,l({node:a,treeIndex:c})],parentNode:s.parentNode}}function id(e){let{treeData:t,getNodeKey:r,ignoreCollapsed:n=!0}=e;if(!t||t.length<1)return[];const a=[];return ed({treeData:t,getNodeKey:r,ignoreCollapsed:n,callback:e=>{a.push(e)}}),a}function sd(e,t){return!!e.children&&"function"!=typeof e.children&&e.children.some((e=>e===t||sd(e,t)))}function cd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.children?"function"==typeof e.children?t+1:e.children.reduce(((e,r)=>Math.max(e,cd(r,t+1))),t):t}function ud(e){let{getNodeKey:t,treeData:r,searchQuery:n,searchMethod:a,searchFocusOffset:l,expandAllMatchPaths:o=!1,expandFocusMatchPaths:i=!0}=e,s=0;const c=e=>{let{isPseudoRoot:r=!1,node:u,currentIndex:p,path:d=[]}=e,m=[],g=!1,h=!1;const f=r?[]:[...d,t({node:u,treeIndex:p})],b=r?null:{path:f,treeIndex:p},y=u.children&&"function"!=typeof u.children&&u.children.length>0;!r&&a($p({},b,{node:u,searchQuery:n}))&&(s===l&&(h=!0),s+=1,g=!0);let x=p;const E=$p({},u);return y&&(E.children=E.children.map((e=>{const t=c({node:e,currentIndex:x+1,path:f});return t.node.expanded?x=t.treeIndex:x+=1,(t.matches.length>0||t.hasFocusMatch)&&(m=[...m,...t.matches],t.hasFocusMatch&&(h=!0),(o&&t.matches.length>0||(o||i)&&t.hasFocusMatch)&&(E.expanded=!0)),t.node}))),r||E.expanded||(m=m.map((e=>$p({},e,{treeIndex:null})))),g&&(m=[$p({},b,{node:E}),...m]),{node:m.length>0?E:u,matches:m,hasFocusMatch:h,treeIndex:x}},u=c({node:{children:r},isPseudoRoot:!0,currentIndex:-1});return{matches:u.matches,treeData:u.node.children}}const pd={find:ud,getDepth:cd,isDescendant:sd,getTreeFromFlatData:function(e){let{flatData:t,getKey:r=(e=>e.id),getParentKey:n=(e=>e.parentId),rootKey:a="0"}=e;if(!t)return[];const l={};if(t.forEach((e=>{const t=n(e);t in l?l[t].push(e):l[t]=[e]})),!(a in l))return[];const o=e=>{const t=r(e);return t in l?$p({},e,{children:l[t].map((e=>o(e)))}):$p({},e)};return l[a].map((e=>o(e)))},getFlatDataFromTree:id,insertNode:od,addNodeUnderParent:function(e){let{treeData:t,newNode:r,parentKey:n=null,getNodeKey:a,ignoreCollapsed:l=!0,expandParent:o=!1,addAsFirstChild:i=!1}=e;if(null===n)return i?{treeData:[r,...t||[]],treeIndex:0}:{treeData:[...t||[],r],treeIndex:(t||[]).length};let s=null,c=!1;const u=td({treeData:t,getNodeKey:a,ignoreCollapsed:l,callback:e=>{let{node:t,treeIndex:a,path:u}=e;const p=u?u[u.length-1]:null;if(c||p!==n)return t;c=!0;const d=$p({},t);if(o&&(d.expanded=!0),!d.children)return s=a+1,$p({},d,{children:[r]});if("function"==typeof d.children)throw new Error("Cannot add to children defined by a function");let m=a+1;for(let e=0;e<d.children.length;e+=1)m+=1+Xp({node:d.children[e],ignoreCollapsed:l});return s=m,$p({},d,{children:i?[r,...d.children]:[...d.children,r]})}});if(!c)throw new Error("No node found with the given key.");return{treeData:u,treeIndex:s}},getNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,l=null;try{nd({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:e=>{let{node:t,treeIndex:r}=e;return l={node:t,treeIndex:r},t}})}catch(e){}return l},removeNode:ad,removeNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e;return nd({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:null})},changeNodeAtPath:nd,toggleExpandedForAll:rd,map:td,walk:ed,getVisibleNodeInfoAtIndex:function(e){let{treeData:t,index:r,getNodeKey:n}=e;if(!t||t.length<1)return null;const a=Yp({targetIndex:r,getNodeKey:n,node:{children:t,expanded:!0},currentIndex:-1,path:[],lowerSiblingCounts:[],isPseudoRoot:!0});return a.node?a:null},getVisibleNodeCount:function(e){let{treeData:t}=e;const r=e=>e.children&&!0===e.expanded&&"function"!=typeof e.children?1+e.children.reduce(((e,t)=>e+r(t)),0):1;return t.reduce(((e,t)=>e+r(t)),0)},getDescendantCount:Xp};function dd(){return dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dd.apply(this,arguments)}function md(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gd(e,t,r[t])}))}return e}function gd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hd=e=>{let{scaffoldBlockPxWidth:t,toggleChildrenVisibility:r,connectDragPreview:n,connectDragSource:a,isDragging:l,canDrop:o,canDrag:i,node:s,title:u,subtitle:p,draggedNode:d,path:m,treeIndex:g,isSearchMatch:h,isSearchFocus:f,buttons:b,className:y,style:x,didDrop:E,treeId:v,isOver:w,parentNode:O,rowDirection:C}=e,T=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["scaffoldBlockPxWidth","toggleChildrenVisibility","connectDragPreview","connectDragSource","isDragging","canDrop","canDrag","node","title","subtitle","draggedNode","path","treeIndex","isSearchMatch","isSearchFocus","buttons","className","style","didDrop","treeId","isOver","parentNode","rowDirection"]);const S=u||s.title,k=p||s.subtitle,N="rtl"===C?"rst__rtl":null;let I;i&&(I="function"==typeof s.children&&s.expanded?c().createElement("div",{className:"rst__loadingHandle"},c().createElement("div",{className:"rst__loadingCircle"},[...new Array(12)].map(((e,t)=>c().createElement("div",{key:t,className:Fp("rst__loadingCirclePoint",N)}))))):a(c().createElement("div",{className:"rst__moveHandle"}),{dropEffect:"copy"}));const P=d&&sd(d,s),D=!E&&l;let A={left:-.5*t};return"rtl"===C&&(A={right:-.5*t}),c().createElement("div",dd({style:{height:"100%"}},T),r&&s.children&&(s.children.length>0||"function"==typeof s.children)&&c().createElement("div",null,c().createElement("button",{type:"button","aria-label":s.expanded?"Collapse":"Expand",className:Fp(s.expanded?"rst__collapseButton":"rst__expandButton",N),style:A,onClick:()=>r({node:s,path:m,treeIndex:g})}),s.expanded&&!l&&c().createElement("div",{style:{width:t},className:Fp("rst__lineChildren",N)})),c().createElement("div",{className:Fp("rst__rowWrapper",N)},n(c().createElement("div",{className:Fp("rst__row",D&&"rst__rowLandingPad",D&&!o&&"rst__rowCancelPad",h&&"rst__rowSearchMatch",f&&"rst__rowSearchFocus",N,y),style:md({opacity:P?.5:1},x)},I,c().createElement("div",{className:Fp("rst__rowContents",!i&&"rst__rowContentsDragDisabled",N)},c().createElement("div",{className:Fp("rst__rowLabel",N)},c().createElement("span",{className:Fp("rst__rowTitle",s.subtitle&&"rst__rowTitleWithSubtitle")},"function"==typeof S?S({node:s,path:m,treeIndex:g}):S),k&&c().createElement("span",{className:"rst__rowSubtitle"},"function"==typeof k?k({node:s,path:m,treeIndex:g}):k)),c().createElement("div",{className:"rst__rowToolbar"},b.map(((e,t)=>c().createElement("div",{key:t,className:"rst__toolbarButton"},e)))))))))};hd.defaultProps={isSearchMatch:!1,isSearchFocus:!1,canDrag:!1,toggleChildrenVisibility:null,buttons:[],className:"",style:{},parentNode:null,draggedNode:null,canDrop:!1,title:null,subtitle:null,rowDirection:"ltr"},hd.propTypes={node:B().shape({}).isRequired,title:B().oneOfType([B().func,B().node]),subtitle:B().oneOfType([B().func,B().node]),path:B().arrayOf(B().oneOfType([B().string,B().number])).isRequired,treeIndex:B().number.isRequired,treeId:B().string.isRequired,isSearchMatch:B().bool,isSearchFocus:B().bool,canDrag:B().bool,scaffoldBlockPxWidth:B().number.isRequired,toggleChildrenVisibility:B().func,buttons:B().arrayOf(B().node),className:B().string,style:B().shape({}),connectDragPreview:B().func.isRequired,connectDragSource:B().func.isRequired,parentNode:B().shape({}),isDragging:B().bool.isRequired,didDrop:B().bool.isRequired,draggedNode:B().shape({}),isOver:B().bool.isRequired,canDrop:B().bool,rowDirection:B().string};const fd=hd;function bd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class yd extends s.Component{render(){const e=this.props,{children:t,connectDropTarget:r,treeId:n,drop:a}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","connectDropTarget","treeId","drop"]);return r(c().createElement("div",null,s.Children.map(t,(e=>(0,s.cloneElement)(e,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bd(e,t,r[t])}))}return e}({},l))))))}}yd.defaultProps={canDrop:!1,draggedNode:null},yd.propTypes={children:B().node.isRequired,connectDropTarget:B().func.isRequired,isOver:B().bool.isRequired,canDrop:B().bool,draggedNode:B().shape({}),treeId:B().string.isRequired,drop:B().func.isRequired};const xd=yd,Ed=(0,T.Z)((()=>({"@global .rst__placeholder":{position:"relative",height:"68px",maxWidth:"300px",padding:"10px"},"@global .rst__placeholder, .rst__placeholder > *":{boxSizing:"border-box"},"@global .rst__placeholder::before":{border:"3px dashed #d9d9d9",content:"",position:"absolute",top:"5px",right:"5px",bottom:"5px",left:"5px",zIndex:-1},"@global .rst__placeholderLandingPad, .rst__placeholderCancelPad":{border:"none !important",boxShadow:"none !important",outline:"none !important"},"@global .rst__placeholderLandingPad *, .rst__placeholderCancelPad *":{opacity:"0 !important"},"@global .rst__placeholderLandingPad::before, .rst__placeholderCancelPad::before":{backgroundColor:"lightblue",borderColor:"white"},"@global .rst__placeholderCancelPad::before":{backgroundColor:"#e6a8ad"}}))),vd=e=>{let{isOver:t,canDrop:r}=e;return Ed(),c().createElement("div",{className:Fp("rst__placeholder",r&&"rst__placeholderLandingPad",r&&!t&&"rst__placeholderCancelPad")})};vd.defaultProps={isOver:!1,canDrop:!1},vd.propTypes={isOver:B().bool,canDrop:B().bool};const wd=vd,Od=e=>{let t=[],r=[],n=null;return a=>{const l=Object.keys(a).sort(),o=l.map((e=>a[e]));return(o.length!==t.length||o.some(((e,r)=>e!==t[r]))||l.some(((e,t)=>e!==r[t])))&&(t=o,r=l,n=e(a)),n}},Cd=Od(od),Td=Od(id),Sd=Od(Xp);function kd(e){let{treeIndex:t}=e;return t}function Nd(e){return"string"==typeof e?e:null===e||"object"!=typeof e||!e.props||!e.props.children||"string"!=typeof e.props.children&&"object"!=typeof e.props.children?"":"string"==typeof e.props.children?e.props.children:e.props.children.map((e=>Nd(e))).join("")}function Id(e,t,r,n,a){return"function"==typeof r[e]?String(r[e]({node:r,path:n,treeIndex:a})).indexOf(t)>-1:"object"==typeof r[e]?Nd(r[e]).indexOf(t)>-1:r[e]&&String(r[e]).indexOf(t)>-1}function Pd(e){let{node:t,path:r,treeIndex:n,searchQuery:a}=e;return Id("title",a,t,r,n)||Id("subtitle",a,t,r,n)}const Dd={defaultSearchMethod:Pd,defaultGetNodeKey:kd};var Ad=r(75047);class Rd{constructor(e){this.hoverHandler=()=>{if(null===this.hoverProps)return;const{dropTargetProps:e,monitor:t,component:r}=this.hoverProps,n=t.getItem();if(!n)return;const a=this.getTargetDepth(e,t,r),l=n.node;(e.node!==this.lastDropTargetNode||a!==this.lastDropTargetDepth)&&(this.lastDropTargetNode=e.node,this.lastDropTargetDepth=a,this.dragHover({node:l,path:n.path,minimumTreeIndex:e.listIndex,depth:a}),this.hoverProps=null)},this.deferredCallHoverHandler=()=>{if(this.shouldSkipMoreFrames)return this.shouldSkipMoreFrames=!1,void(this.rafId=requestAnimationFrame(this.deferredCallHoverHandler));this.rafId=null,this.hoverHandler()},this.treeRef=e,this.resetDragVariables()}get startDrag(){return this.treeRef.startDrag}get dragHover(){return this.treeRef.dragHover}get endDrag(){return this.treeRef.endDrag}get drop(){return this.treeRef.drop}get treeId(){return this.treeRef.treeId}get dndType(){return this.treeRef.dndType}get treeData(){return this.treeRef.state.draggingTreeData||this.treeRef.props.treeData}get getNodeKey(){return this.treeRef.props.getNodeKey}get customCanDrop(){return this.treeRef.props.canDrop}get maxDepth(){return this.treeRef.props.maxDepth}resetDragVariables(){this.lastDropTargetNode=null,this.lastDropTargetDepth=null,this.hoverProps=null,this.lastCanDropResult=null,this.lastCanDropProps=null,this.shouldSkipMoreFrames=!1,this.rafId=null}getTargetDepth(e,t,r){let n=0;const a=e.getPrevRow();if(a){let{path:t}=a;!this.treeRef.canNodeHaveChildren(a.node)&&(t=t.slice(0,t.length-1)),n=Math.min(t.length,e.path.length)}let l,o=(t.getItem().path||[]).length;if(t.getItem().treeId!==this.treeId)if(o=0,r){const n=(0,Ad.findDOMNode)(r).getBoundingClientRect(),a=t.getSourceClientOffset().x-n.left;l=Math.round(a/e.scaffoldBlockPxWidth)}else l=e.path.length;else{const r="rtl"===e.rowDirection?-1:1;l=Math.round(r*t.getDifferenceFromInitialOffset().x/e.scaffoldBlockPxWidth)}let i=Math.min(n,Math.max(0,o+l-1));if(void 0!==this.maxDepth&&null!==this.maxDepth){const e=cd(t.getItem().node);i=Math.max(0,Math.min(i,this.maxDepth-e-1))}return i}canDrop(e,t){if(!t.isOver())return!1;const r=e.getPrevRow(),n=r?r.path:[],a=r?r.node:{},l=Math.round(t.getDifferenceFromInitialOffset().x/e.scaffoldBlockPxWidth),o={nodeId:void 0!==e.node.nodeId?e.node.nodeId:e.node,rowAbove:r,abovePath:n,aboveNodeId:void 0!==a.nodeId?a.nodeId:a,blocksOffset:l};if((0,N.equals)(this.lastCanDropProps,o))return this.lastCanDropResult;this.lastCanDropProps=o;const i=this.getTargetDepth(e,t,null);if(i>=n.length&&"function"==typeof a.children)return this.lastCanDropResult=!1;if("function"==typeof this.customCanDrop){const{node:r}=t.getItem(),n=Cd({treeData:this.treeData,newNode:r,depth:i,getNodeKey:this.getNodeKey,minimumTreeIndex:e.listIndex,expandParent:!0});return this.lastCanDropResult=this.customCanDrop({node:r,prevPath:t.getItem().path,prevParent:t.getItem().parentNode,prevTreeIndex:t.getItem().treeIndex,nextPath:n.path,nextParent:n.parentNode,nextTreeIndex:n.treeIndex})}return this.lastCanDropResult=!0}wrapSource(e){const t={beginDrag:e=>(this.startDrag(e),{node:e.node,parentNode:e.parentNode,path:e.path,treeIndex:e.treeIndex,treeId:e.treeId}),endDrag:(e,t)=>{this.rafId&&cancelAnimationFrame(this.rafId),this.endDrag(t.getDropResult()),this.resetDragVariables()},isDragging:(e,t)=>{const r=t.getItem().node;return e.node===r}};return(0,Tn.DragSource)(this.dndType,t,(function(e,t){return{connectDragSource:e.dragSource(),connectDragPreview:e.dragPreview(),isDragging:t.isDragging(),didDrop:t.didDrop()}}))(e)}wrapTarget(e){const t={drop:(e,t,r)=>{this.rafId&&cancelAnimationFrame(this.rafId);const n={node:t.getItem().node,path:t.getItem().path,treeIndex:t.getItem().treeIndex,treeId:this.treeId,minimumTreeIndex:e.treeIndex,depth:this.getTargetDepth(e,t,r)};return this.lastDropTargetNode=null,this.drop(n),n},hover:(e,t,r)=>{this.rafId?this.shouldSkipMoreFrames=!0:(this.shouldSkipMoreFrames=!1,this.hoverProps={dropTargetProps:e,monitor:t,component:r},this.rafId=requestAnimationFrame(this.deferredCallHoverHandler))},canDrop:this.canDrop.bind(this)};return(0,Tn.DropTarget)(this.dndType,t,(function(e,t){const r=t.getItem();return{connectDropTarget:e.dropTarget(),isOver:t.isOver(),canDrop:t.canDrop(),draggedNode:r?r.node:null}}))(e)}wrapPlaceholder(e){const t={drop:(e,t)=>{const{node:r,path:n,treeIndex:a}=t.getItem(),l={node:r,path:n,treeIndex:a,treeId:this.treeId,minimumTreeIndex:0,depth:0};return this.drop(l),l}};return(0,Tn.DropTarget)(this.dndType,t,(function(e,t){const r=t.getItem();return{connectDropTarget:e.dropTarget(),isOver:t.isOver(),canDrop:t.canDrop(),draggedNode:r?r.node:null}}))(e)}}function jd(){return jd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jd.apply(this,arguments)}function Zd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ld(e,t,r[t])}))}return e}function Ld(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let _d=1;const Md=e=>{const t=Zd({},e,{style:Zd({},e.theme.style,e.style),innerStyle:Zd({},e.theme.innerStyle,e.innerStyle),reactVirtualizedListProps:Zd({},e.theme.reactVirtualizedListProps,e.reactVirtualizedListProps)}),r={nodeContentRenderer:fd,placeholderRenderer:wd,rowHeight:62,scaffoldBlockPxWidth:44,slideRegionSize:100,treeNodeRenderer:Gp};return Object.keys(r).forEach((n=>{null===e[n]&&(t[n]=void 0!==e.theme[n]?e.theme[n]:r[n])})),t};class Vd extends s.Component{constructor(e){super(e);const{dndType:t,nodeContentRenderer:r,treeNodeRenderer:n,isVirtualized:a,slideRegionSize:l}=Md(e);this.dndManager=new Rd(this),this.treeId=`rst__${_d}`,_d+=1,this.dndType=t||this.treeId,this.nodeContentRenderer=this.dndManager.wrapSource(r),this.treePlaceholderRenderer=this.dndManager.wrapPlaceholder(xd),this.treeNodeRenderer=this.dndManager.wrapTarget(n),a&&(this.scrollZoneVirtualList=(Up._t||Up.ZP)(Vp.aV),this.vStrength=(0,Up.Kx)(l),this.hStrength=(0,Up.v7)(l)),this.state={draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,searchMatches:[],searchFocusTreeIndex:null,dragging:!1,draggingExpandedPaths:[],ignoreOneTreeUpdate:!1,instanceProps:{treeData:this.props.treeData||[],searchQuery:null,searchFocusOffset:null,ignoreTreeChanges:!1}},this.toggleChildrenVisibility=this.toggleChildrenVisibility.bind(this),this.moveNode=this.moveNode.bind(this),this.startDrag=this.startDrag.bind(this),this.dragHover=this.dragHover.bind(this),this.endDrag=this.endDrag.bind(this),this.drop=this.drop.bind(this),this.handleDndMonitorChange=this.handleDndMonitorChange.bind(this)}componentDidMount(){Vd.loadLazyChildren(this.props);const e=Vd.search(this.props,this.state,!0,!0,!1);this.setState(e),this.clearMonitorSubscription=this.props.dragDropManager.getMonitor().subscribeToStateChange(this.handleDndMonitorChange)}static getDerivedStateFromProps(e,t){const{instanceProps:r}=t,n={};return(0,N.equals)(r.searchQuery,e.searchQuery)?r.searchFocusOffset!==e.searchFocusOffset&&Object.assign(n,Vd.search(e,t,!0,!0,!0)):Object.assign(n,Vd.search(e,t,!0,!0,!1)),r.searchQuery=e.searchQuery,r.searchFocusOffset=e.searchFocusOffset,n.instanceProps=r,n}componentDidUpdate(e,t){if(this.state.dragging!==t.dragging&&this.props.onDragStateChanged&&this.props.onDragStateChanged({isDragging:this.state.dragging,draggedNode:this.state.draggedNode}),this.state.dragging)if((0,N.equals)(this.props.treeData,e.treeData))this.state.draggingTreeData&&t.draggingTreeData!==this.state.draggingTreeData&&ed({treeData:this.state.draggingTreeData,getNodeKey:this.props.getNodeKey,callback:e=>{let{node:t,path:r,lowerSiblingCounts:n,treeIndex:a}=e;t.pending&&t.expanded&&this.props.onLazyLoadChildren({node:t,path:r,lowerSiblingCounts:n,treeIndex:a})}});else{const{treeData:e}=ad({treeData:this.props.treeData,path:t.draggedPath,getNodeKey:this.props.getNodeKey});this.setState((t=>{let{draggingExpandedPaths:r}=t;return{draggingTreeData:r.reduce(((e,t)=>{let r;try{r=nd({treeData:e,path:t,newNode:e=>{let{node:t}=e;return Zd({},t,{expanded:!0})},getNodeKey:this.props.getNodeKey})}catch(t){r=e}return r}),e)}}))}else if(this.props.treeData!==e.treeData){const t=(0,N.equals)(this.props.treeData,e.treeData),{ignoreOneTreeUpdate:r,instanceProps:n}=this.state,a={};t||(r?a.ignoreOneTreeUpdate=!1:(a.searchFocusTreeIndex=null,Vd.loadLazyChildren(this.props),Object.assign(a,Vd.search(this.props,this.state,!1,!1,!1))),a.draggingTreeData=null,a.draggedNode=null,a.draggedMinimumTreeIndex=null,a.draggedDepth=null,a.dragging=!1,a.draggingExpandedPaths=[],a.instanceProps=Zd({},n,{treeData:this.props.treeData}),this.setState(a))}}componentWillUnmount(){this.clearMonitorSubscription()}getRows(e){return Td({ignoreCollapsed:!0,getNodeKey:this.props.getNodeKey,treeData:e})}handleDndMonitorChange(){!this.props.dragDropManager.getMonitor().isDragging()&&this.state.draggingTreeData&&this.endDrag()}toggleChildrenVisibility(e){let{node:t,path:r}=e;const{instanceProps:n}=this.state,a=nd({treeData:n.treeData,path:r,newNode:e=>{let{node:t}=e;return Zd({},t,{expanded:!t.expanded})},getNodeKey:this.props.getNodeKey});this.props.onChange(a),this.props.onVisibilityToggle({treeData:a,node:t,expanded:!t.expanded,path:r})}moveNode(e){let{node:t,path:r,treeIndex:n,depth:a,minimumTreeIndex:l}=e;const{treeData:o,treeIndex:i,path:s,parentNode:c}=od({treeData:this.state.draggingTreeData,newNode:t,depth:a,minimumTreeIndex:l,expandParent:!0,getNodeKey:this.props.getNodeKey});this.setState({draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,dragging:!1,draggingExpandedPaths:[]},(()=>{this.props.onChange(o),this.props.onMoveNode({treeData:o,node:t,treeIndex:i,path:s,nextPath:s,nextTreeIndex:i,prevPath:r,prevTreeIndex:n,nextParentNode:c})}))}static search(e,t,r,n,a){const{onChange:l,getNodeKey:o,searchFinishCallback:i,searchQuery:s,searchMethod:c,searchFocusOffset:u,onlyExpandSearchedNodes:p}=e,{instanceProps:d}=t;if(!s&&!c)return i&&i([]),{searchMatches:[]};const m={},{treeData:g,matches:h}=ud({getNodeKey:o,treeData:p?rd({treeData:d.treeData,expanded:!1}):d.treeData,searchQuery:s,searchMethod:c||Pd,searchFocusOffset:u,expandAllMatchPaths:n&&!a,expandFocusMatchPaths:!!n});n&&(m.ignoreOneTreeUpdate=!0,l(g)),i&&i(h);let f=null;return r&&null!==u&&u<h.length&&(f=h[u].treeIndex),m.searchMatches=h,m.searchFocusTreeIndex=f,m}startDrag(e){let{path:t}=e;this.setState((e=>{const{treeData:r,node:n,treeIndex:a}=ad({treeData:e.instanceProps.treeData,path:t,getNodeKey:this.props.getNodeKey});return{draggingTreeData:r,draggedNode:n,draggedDepth:t.length-1,draggedMinimumTreeIndex:a,draggedPath:t,dragging:!0}}))}dragHover(e){let{node:t,depth:r,minimumTreeIndex:n}=e;this.state.draggedDepth===r&&this.state.draggedMinimumTreeIndex===n||this.setState((e=>{let{draggingTreeData:a,instanceProps:l,draggingExpandedPaths:o}=e;const i=a||l.treeData,s=Cd({treeData:i,newNode:t,depth:r,minimumTreeIndex:n,expandParent:!0,getNodeKey:this.props.getNodeKey}),c=this.getRows(s.treeData)[s.treeIndex].path.slice(0,-1),u=(0,N.pipe)((0,N.when)((0,N.always)((0,N.gt)(c.length,0)),(0,N.append)(c)),(0,N.uniqWith)((0,N.eqBy)(String)))(o);return{draggedNode:t,draggedDepth:r,draggedMinimumTreeIndex:n,draggingTreeData:nd({treeData:i,path:c,newNode:e=>{let{node:t}=e;return Zd({},t,{expanded:!0})},getNodeKey:this.props.getNodeKey}),searchFocusTreeIndex:null,dragging:!0,draggingExpandedPaths:u}}))}endDrag(e){const{instanceProps:t}=this.state;if(e){if(e.treeId!==this.treeId){const{node:r,path:n,treeIndex:a}=e;let l=this.props.shouldCopyOnOutsideDrop;"function"==typeof l&&(l=l({node:r,prevTreeIndex:a,prevPath:n}));let o=this.state.draggingTreeData||t.treeData;l&&(o=nd({treeData:t.treeData,path:n,newNode:e=>{let{node:t}=e;return Zd({},t)},getNodeKey:this.props.getNodeKey})),this.props.onChange(o),this.props.onMoveNode({treeData:o,node:r,treeIndex:null,path:null,nextPath:null,nextTreeIndex:null,prevPath:n,prevTreeIndex:a})}}else(()=>{this.setState({draggingTreeData:null,draggedNode:null,draggedMinimumTreeIndex:null,draggedDepth:null,dragging:!1})})()}drop(e){this.moveNode(e)}canNodeHaveChildren(e){const{canNodeHaveChildren:t}=this.props;return!t||t(e)}static loadLazyChildren(e){ed({treeData:e.treeData,getNodeKey:e.getNodeKey,callback:t=>{let{node:r,path:n,lowerSiblingCounts:a,treeIndex:l}=t;r.pending&&(r.expanded||e.loadCollapsedLazyChildren)&&e.onLazyLoadChildren({node:r,path:n,lowerSiblingCounts:a,treeIndex:l,done:t=>e.onChange(nd({treeData:e.treeData,path:n,newNode:e=>{let{node:n}=e;return n===r?Zd({},n,{children:t}):n},getNodeKey:e.getNodeKey}),!0)})}})}renderRow(e,t){let{listIndex:r,style:n,getPrevRow:a,matchKeys:l,swapFrom:o,swapDepth:i,swapLength:s}=t;const{node:u,parentNode:p,path:d,lowerSiblingCounts:m,treeIndex:g}=e,{canDrag:h,generateNodeProps:f,scaffoldBlockPxWidth:b,searchFocusOffset:y,rowDirection:x}=Md(this.props),E=this.treeNodeRenderer,v=this.nodeContentRenderer,w=d[d.length-1],O=w in l,C=O&&l[w]===y,T={node:u,parentNode:p,path:d,lowerSiblingCounts:m,treeIndex:g,isSearchMatch:O,isSearchFocus:C},S=f?f(T):{},k="function"!=typeof h?h:h(T),N={treeIndex:g,scaffoldBlockPxWidth:b,node:u,path:d,treeId:this.treeId,rowDirection:x};return c().createElement(E,jd({style:n,key:w,listIndex:r,getPrevRow:a,lowerSiblingCounts:m,swapFrom:o,swapLength:s,swapDepth:i},N),c().createElement(v,jd({parentNode:p,isSearchMatch:O,isSearchFocus:C,canDrag:k,toggleChildrenVisibility:this.toggleChildrenVisibility},N,S)))}render(){const{dragDropManager:e,style:t,className:r,innerStyle:n,rowHeight:a,isVirtualized:l,placeholderRenderer:o,reactVirtualizedListProps:i,getNodeKey:s,rowDirection:u}=Md(this.props),{searchMatches:p,searchFocusTreeIndex:d,draggedNode:m,draggedDepth:g,draggedMinimumTreeIndex:h}=this.state,f=this.state.draggingTreeData||this.props.treeData,b="rtl"===u?"rst__rtl":null;let y,x=null,E=null;if(m&&null!==h){const e=Cd({treeData:f,newNode:m,depth:g,minimumTreeIndex:h,expandParent:!0,getNodeKey:s}),t=h;x=e.treeIndex,E=1+Sd({node:m}),y=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=[...e.slice(0,t),...e.slice(t+n)];return[...a.slice(0,r),...e.slice(t,t+n),...a.slice(r)]}(this.getRows(e.treeData),x,t,E)}else y=this.getRows(f);const v={};p.forEach(((e,t)=>{let{path:r}=e;v[r[r.length-1]]=t}));const w=null!==d?{scrollToIndex:d}:{};let O,C=t;if(y.length<1){const e=this.treePlaceholderRenderer,t=o;O=c().createElement(e,{treeId:this.treeId,drop:this.drop},c().createElement(t,null))}else if(l){C=Zd({height:"100%"},C);const t=this.scrollZoneVirtualList;O=c().createElement(Vp.qj,null,(r=>{let{height:l,width:o}=r;return c().createElement(t,jd({},w,{dragDropManager:e,verticalStrength:this.vStrength,horizontalStrength:this.hStrength,speed:30,scrollToAlignment:"start",className:this.props.classes.rst__virtualScrollOverride,width:o,onScroll:e=>{let{scrollTop:t}=e;this.scrollTop=t},height:l,style:n,rowCount:y.length,estimatedRowSize:"function"!=typeof a?a:void 0,rowHeight:"function"!=typeof a?a:e=>{let{index:t}=e;return a({index:t,treeIndex:t,node:y[t].node,path:y[t].path})},rowRenderer:e=>{let{index:t,style:r}=e;return this.renderRow(y[t],{listIndex:t,style:r,getPrevRow:()=>y[t-1]||null,matchKeys:v,swapFrom:x,swapDepth:g,swapLength:E})}},i))}))}else O=y.map(((e,t)=>this.renderRow(e,{listIndex:t,style:{height:"function"!=typeof a?a:a({index:t,treeIndex:t,node:e.node,path:e.path})},getPrevRow:()=>y[t-1]||null,matchKeys:v,swapFrom:x,swapDepth:g,swapLength:E})));return c().createElement("div",{className:Fp("rst__tree",r,b),style:C},O)}}Vd.propTypes={classes:B().object,dragDropManager:B().shape({getMonitor:B().func}).isRequired,treeData:B().arrayOf(B().object).isRequired,style:B().shape({}),className:B().string,innerStyle:B().shape({}),rowHeight:B().oneOfType([B().number,B().func]),slideRegionSize:B().number,reactVirtualizedListProps:B().shape({}),scaffoldBlockPxWidth:B().number,maxDepth:B().number,searchMethod:B().func,searchQuery:B().any,searchFocusOffset:B().number,searchFinishCallback:B().func,generateNodeProps:B().func,isVirtualized:B().bool,treeNodeRenderer:B().func,nodeContentRenderer:B().func,placeholderRenderer:B().func,theme:B().shape({style:B().shape({}),innerStyle:B().shape({}),reactVirtualizedListProps:B().shape({}),scaffoldBlockPxWidth:B().number,slideRegionSize:B().number,rowHeight:B().oneOfType([B().number,B().func]),treeNodeRenderer:B().func,nodeContentRenderer:B().func,placeholderRenderer:B().func}),getNodeKey:B().func,onChange:B().func.isRequired,onMoveNode:B().func,canDrag:B().oneOfType([B().func,B().bool]),canDrop:B().func,canNodeHaveChildren:B().func,shouldCopyOnOutsideDrop:B().oneOfType([B().func,B().bool]),onVisibilityToggle:B().func,dndType:B().string,onDragStateChanged:B().func,onlyExpandSearchedNodes:B().bool,rowDirection:B().string,onLazyLoadChildren:B().func,ignoreTreeChanges:B().bool},Vd.defaultProps={canDrag:!0,canDrop:null,canNodeHaveChildren:()=>!0,className:"",dndType:null,generateNodeProps:null,getNodeKey:kd,innerStyle:{},isVirtualized:!0,maxDepth:null,treeNodeRenderer:null,nodeContentRenderer:null,onMoveNode:()=>{},onVisibilityToggle:()=>{},placeholderRenderer:null,reactVirtualizedListProps:{},rowHeight:null,scaffoldBlockPxWidth:null,searchFinishCallback:null,searchFocusOffset:null,searchMethod:null,searchQuery:null,shouldCopyOnOutsideDrop:!1,slideRegionSize:null,style:{},theme:{},onDragStateChanged:()=>{},onlyExpandSearchedNodes:!1,rowDirection:"ltr",onLazyLoadChildren:()=>{},ignoreTreeChanges:!1},(0,Bp.polyfill)(Vd);const Ud=(0,zp.Z)((()=>({"@global .ReactVirtualized__Grid__innerScrollContainer":{overflow:"visible !important"},"@global .ReactVirtualized__Grid":{outline:"none"},"@global .ReactVirtualized__List":{},rst__virtualScrollOverride:{overflow:"auto !important"},"@global .rst__rtl .ReactVirtualized__Grid__innerScrollContainer":{direction:"rtl"}})))(Vd),Bd=e=>c().createElement(Tn.DndContext.Consumer,null,(t=>{let{dragDropManager:r}=t;return void 0===r?null:c().createElement(Ud,jd({},e,{dragDropManager:r}))})),zd=e=>c().createElement(Tn.DndProvider,{backend:Sn.default},c().createElement(Bd,e));var Fd=r(17822),Hd=r(31396);const Wd=(0,T.Z)((()=>({container:{position:"relative","& .Resizer":{zIndex:1,boxSizing:"border-box",backgroundClip:"padding-box","&.disabled":{cursor:"initial",height:0,margin:0},"&.horizontal":{height:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"100% 1px",backgroundPosition:"top",width:"100%",marginBottom:"-10px","&:not(.disabled):hover":{cursor:"row-resize",backgroundImage:"linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))",backgroundSize:"100% 3px"}},"&.vertical":{width:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"1px 100%",backgroundPosition:"left",height:"100%",marginRight:"-10px","&:not(.disabled):hover":{cursor:"col-resize",backgroundImage:"linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))",backgroundSize:"3px 100%"}}}}}))),qd=e=>"horizontal"===e,Gd=e=>{let{className:t,children:r,orientation:n,defaultSize:a,size:l,minSize:o,maxSize:i,allowResize:p,onChange:d}=e;const m=Wd(),g=(0,wc.Z)(),[h,f]=(0,s.useState)(),[y,x]=(0,s.useState)(!0),E=(0,s.useCallback)((()=>x(!0)),[]),v=(0,s.useCallback)((()=>x(!1)),[]),w=()=>qd(n)?null==h?void 0:h.clientHeight:null==h?void 0:h.clientWidth,O=(0,s.useCallback)((0,u.DsO)((e=>{const t=w();d({percentageSize:e/t*100+"%",isMaxSize:i>0?e===i:e===t+i,isMinSize:e===o})}),250),[d,n,i,h]),C=(0,s.useMemo)((()=>({transition:g.transitions.create(qd(n)?"height":"width",{easing:g.transitions.easing.sharp,duration:g.transitions.duration.leavingScreen})})),[n,g]);return"number"==typeof l&&l<0&&(l=(w()||0)+l),c().createElement("div",{ref:f,className:b()(m.container,t)},c().createElement(Hd.Z,{split:n,size:l,allowResize:p,onChange:O,defaultSize:a,minSize:o,maxSize:i,onDragStarted:v,onDragFinished:E,pane1Style:y?C:void 0},r))},$d=B().oneOfType([B().number,B().string]);Gd.propTypes={className:B().string,children:B().arrayOf(B().node).isRequired,orientation:B().oneOf(["horizontal","vertical"]).isRequired,defaultSize:$d,size:$d,minSize:$d,maxSize:$d,allowResize:B().bool,onChange:B().func};const Kd=Gd;var Yd=r(15311);function Xd(){return Xd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xd.apply(this,arguments)}function Qd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jd(e,t,r[t])}))}return e}function Jd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const em=e=>{let{classes:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=(0,Yd.y)({});return c().createElement(Mr.Z,Xd({classes:Qd({},t,{focused:n.white})},r))};var tm=r(72654);function rm(){return rm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rm.apply(this,arguments)}const nm=e=>{let{open:t,anchorEl:r,className:n,onClose:a,containerWidth:l,containerHeight:o,paperProps:i,listContent:s,externalInputField:u,classes:p={}}=e;const d=_r({containerWidth:l,containerHeight:o});return c().createElement("div",{className:p.root},u,c().createElement(Ge.Z,{open:t,onClose:a,anchorEl:r,placement:"bottom-start",transition:!0},(e=>{let{TransitionProps:t}=e;return c().createElement(tm.Z,t,c().createElement(We.Z,rm({elevation:2},i),c().createElement("div",{className:b()(d.container,n),style:{width:l}},c().createElement("div",{className:d.list},s))))})))};nm.propTypes={open:B().bool,anchorEl:B().object,className:B().string,onClose:B().func,containerWidth:B().number,containerHeight:B().number,paperProps:B().object,listContent:B().element,externalInputField:B().element,classes:B().shape({root:B().string})},nm.defaultProps={popoverAnchorOrigin:{vertical:"top",horizontal:"right"}};const am=nm,lm=(0,T.Z)({onlyValue:{color:"rgba(0,0,0,.6)",fontSize:"13px",fontWeight:"normal",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},select:{fontSize:"13px",color:"rgba(0,0,0,.6)",paddingLeft:"15px","&&":{paddingRight:"35px"}},selectMenu:{"& li":{fontSize:"13px",height:"32px"}},textField:{maxWidth:"100%"}}),om=e=>{let{value:t,onChange:r,options:n,classes:a={},emptyLabel:l}=e;const o=lm(),[i,...u]=n,p=0===u.length;(0,s.useEffect)((()=>{p&&t!==i.value&&r(i.value)}),[i.value]);const d=!!l;return c().createElement("div",{className:a.root},p?c().createElement(v.Z,{className:a.onlyValue||o.onlyValue,variant:"h6"},i.label):c().createElement(Sc.Z,{displayEmpty:d,disableUnderline:!0,classes:{select:a.select||o.select},TextFieldProps:{classes:{root:a.textField||o.textField}},MenuProps:{classes:{list:a.selectMenu||o.selectMenu}},value:t||"",entries:d?[{value:"",label:l},...n]:n,onChange:e=>r(e||null)}))};om.propTypes={value:B().string,onChange:B().func,options:B().arrayOf(B().shape({value:B().string,label:B().string})),classes:B().shape({root:B().string,onlyValue:B().string,select:B().string,selectMenu:B().string,textField:B().string}),emptyLabel:B().string};const im=om,sm=(0,T.Z)((e=>({container:{display:"flex",flexDirection:"column",flexShrink:0,width:"64px",paddingTop:"8px",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)"},active:{backgroundColor:(0,et.U1)(e.palette.primary.main,.12),"&:after":{content:'""',position:"absolute",height:"42px",width:"3px",backgroundColor:e.palette.primary.main,left:"-8px",borderRadius:"0 6px 6px 0"}},buttonWrapper:{position:"relative",width:"48px",height:"44px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",margin:"2px 8px",color:e.palette.text.secondary,"&$active":{color:e.palette.primary.main}}})));function cm(){return cm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cm.apply(this,arguments)}const um=e=>{let{buttonsProps:t,activeIndexId:r,className:n,onButtonClick:a}=e;const l=sm();return c().createElement("div",{className:b()(l.container,n)},t.map((e=>{let{id:t}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["id"]);return c().createElement(be.k,cm({},n,{size:"S",key:t,className:b()({[l.active]:r===t},l.buttonWrapper),onClick:()=>a(t),"data-reltio-id":`reltio-profile-right-side-button-${t}`}))})))},pm=(0,T.Z)((e=>({contentWrapper:{display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper,boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",marginLeft:"3px",transition:e.transitions.create(["width"],{duration:e.transitions.duration.enteringScreen})}}))),dm=e=>{let{width:t,open:r,children:n}=e;const a=pm();return c().createElement("div",{className:a.contentWrapper,style:{width:`${r?t:0}px`}},r&&c().createElement(c().Fragment,null,n))},mm=(0,T.Z)({container:{display:"flex",flexShrink:0,height:"63px",alignItems:"center",borderBottom:"1px solid rgba(0,0,0,0.12)"},icon:{margin:"0 20px"},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"19px 17px"},secondTitle:{fontSize:"14px"}}),gm=e=>{let{onClose:t,mainTitle:r,secondTitle:n,content:a,rightContent:l}=e;const o=mm();return c().createElement("div",{className:o.container},c().createElement(be.k,{size:"S",icon:Hn.default,onClick:t,className:o.icon,tooltipTitle:x().text("Close")}),a||c().createElement(c().Fragment,null,c().createElement(v.Z,{variant:"h6"},r),c().createElement(jr.Z,{orientation:"vertical",flexItem:!0,className:o.divider}),c().createElement(v.Z,{variant:"body1",color:"textSecondary",className:o.secondTitle},n),l))},hm=e=>{let{sourceType:t,className:r}=e;const n=(0,g.useSelector)(h.ZP.selectors.getMetadata),{label:a,icon:l}=(0,u.PWK)(n,t);return c().createElement(Ii,{className:r,avatarText:a[0],icon:l?(0,u.vPL)("https://s3.amazonaws.com/reltio.images/api",l):null,variant:"square"})};var fm=r(79935);const bm=e=>{let{height:t,margin:r}=e;return c().createElement("div",{style:{width:"1px",height:`${t}px`,borderLeft:"1px solid rgba(0,0,0,0.38)",margin:`0 ${r}px`,flexShrink:"0"}})};bm.propTypes={height:B().number,margin:B().number};const ym=bm,xm=e=>{let{label:t}=e;return t||null},Em=e=>{let{value:t}=e;return t||null},vm=e=>{let{className:t,rowsData:r,columnsData:n,theadRowsNumber:a=0}=e;const l=e=>{const t=e.cellRenderer||Em,r=e.headCellRenderer||xm;return c().createElement("tr",{key:e.id},c().createElement("th",{key:e.id},c().createElement(r,e)),n.map(((r,n)=>c().createElement("td",{key:n},c().createElement(t,{value:r[e.id],columnValue:r,rowData:e})))))};return c().createElement("table",{className:t},a>0&&c().createElement("thead",null,r.slice(0,a).map(l)),c().createElement("tbody",null,r.slice(a).map(l)))};vm.propTypes={rowsData:B().arrayOf(B().shape({id:B().string,label:B().string,headCellRenderer:B().func,cellRenderer:B().func})),columnsData:B().arrayOf(B().object),theadRowsNumber:B().number,className:B().string};const wm=(0,s.memo)(vm);var Om=r(83543);const Cm=(0,T.Z)((()=>({viewMoreLessLink:{display:"flex",alignItems:"center",cursor:"pointer"},arrow:{marginRight:"8px",marginLeft:"-2px",transform:"rotate(0deg)",transition:"transform 0.35s ease"},rotated:{transform:"rotate(-180deg)"}}))),Tm=e=>{let{active:t,onClick:r,className:n}=e;const a=Cm();return c().createElement(ge.Z,{className:b()(a.viewMoreLessLink,n),onClick:r,underline:"none"},c().createElement(Om.Z,{className:b()(a.arrow,{[a.rotated]:t})}),t?x().text("View less"):x().text("View more"))};Tm.propTypes={active:B().bool,onClick:B().func,className:B().string};const Sm=Tm;var km=r(29611),Nm=r(50581),Im=r(21853);const Pm=(0,T.Z)({searchButton:{marginLeft:"auto !important",marginRight:"-4px",padding:"8px"},input:{flex:"1 0 200px",marginLeft:"70px",fontSize:"14px",background:"rgba(0,0,0,0.03) 2px",padding:"4px 0",marginRight:"4px"},startAdornment:{color:"rgba(0,0,0,0.54)",paddingLeft:"8px"}}),Dm=e=>{let{query:t,onChange:r}=e;const[n,a]=(0,s.useState)(t),[l,o]=(0,s.useState)(!!t);(0,s.useEffect)((()=>{a(t)}),[t]);const i=Pm(),u=n&&n.length;return l?c().createElement(km.Z,{className:i.input,value:n,autoFocus:!0,placeholder:x().text("Search"),disableUnderline:!0,onChange:(0,N.pipe)(wn.NA,a),startAdornment:c().createElement(Nm.Z,{position:"start"},c().createElement(Im.Z,{className:i.startAdornment})),endAdornment:c().createElement(Nm.Z,{position:"end"},u&&c().createElement(Lt.Z,{size:"S",icon:Hn.default,onClick:(0,N.pipe)(N.F,o,(0,N.always)(""),(0,N.tap)(r),a)})),onKeyPress:(0,N.when)((0,N.propEq)("key","Enter"),(0,N.pipe)((0,N.always)(n),N.trim,r))}):c().createElement(Ya.Z,{className:i.searchButton,onClick:(0,N.pipe)(N.T,o)},c().createElement(Im.Z,null))};var Am,Rm=r(7907);!function(e){e.READING="READING",e.HOVERED="HOVERED",e.EDITING="EDITING"}(Am||(Am={}));const jm=()=>{const[e,t]=(0,s.useState)(null),r=e===Am.READING,n=e===Am.EDITING,a=e===Am.HOVERED;(0,s.useEffect)((()=>{t(Am.READING)}),[]);const l=(0,s.useCallback)((0,u.DsO)(t,50),[]),o=(0,s.useCallback)((()=>{n||l(Am.HOVERED)}),[l,n]),i=(0,s.useCallback)((()=>{n||l(Am.READING)}),[l,n]);return{setReadingMode:(0,s.useCallback)((()=>t(Am.READING)),[t]),setEditingMode:(0,s.useCallback)((()=>t(Am.EDITING)),[t]),onMouseLeave:i,onMouseEnter:o,isReadingMode:r,isEditingMode:n,isHovered:a}};const Zm=(0,s.createContext)(null),Lm=e=>{let{children:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children"]);return c().createElement(Zm.Provider,{value:r},t)},_m=e=>{const{getCrosswalkColor:t=(0,N.pipe)(u.uKF,u.CJp)}=(0,s.useContext)(Zm)||{};return e?t(e):""},Mm=()=>{const{highlightedCrosswalks:e=[]}=(0,s.useContext)(Zm)||{};return e},Vm=e=>{const{highlightedCrosswalks:t=[],setCrosswalkHighlighted:r=wn.ZT}=(0,s.useContext)(Zm)||{},n=!!e&&!!t.find((0,N.eqBy)(u.uKF,e));return{isHighlighted:n,isDimmed:t.length>0&&!n,highlightCrosswalk:(0,s.useCallback)((()=>r(e,!0)),[e,r]),removeHighlight:(0,s.useCallback)((()=>r(e,!1)),[e,r])}},Um=e=>{const{toggleCrosswalkFocus:t=wn.ZT,focusedCrosswalks:r=[]}=(0,s.useContext)(Zm)||{};return{isFocused:!!e&&r.some((0,N.eqBy)(u.uKF,e)),toggleCrosswalkFocus:(0,s.useCallback)((()=>t(e)),[e,t])}};var Bm=r(72753);const zm=(0,T.Z)({sourceItem:{display:"flex",overflow:"hidden"},eyeIcon:e=>{let{isFocused:t}=e;return{marginLeft:"10px",color:t?"#000":"rgba(0, 0, 0, 0.54)"}},label:{color:"rgba(0, 0, 0, 0.87)",verticalAlign:"top",fontSize:"13px",lineHeight:"16px"},sourceInfo:{overflow:"hidden"},crosswalkValue:{color:"rgba(0, 0, 0, 0.54)",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},sourceIcon:e=>{let{color:t}=e;return{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px",backgroundColor:t}},crosswalkIcon:e=>{let{color:t,isOpaque:r}=e;return{backgroundColor:t,height:"12px",width:"12px",borderRadius:"30px",opacity:r?1:.38,transition:"opacity 0.3s"}}}),Fm=(0,T.Z)((()=>({label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",marginLeft:"2px",marginRight:"8px"}}))),Hm=e=>{let{crosswalk:t,color:r,className:n,focusable:a=!1}=e;const{toggleCrosswalkFocus:l,isFocused:o}=Um(t),i=zm({color:r,isFocused:o}),s=(0,g.useSelector)(h.ZP.selectors.getMetadata),{label:p}=(0,u.PWK)(s,t.type);return c().createElement("div",{className:b()(i.sourceItem,n)},c().createElement(hm,{className:i.sourceIcon,sourceType:t.type}),c().createElement("div",{className:i.sourceInfo},c().createElement("div",null,c().createElement("span",{className:i.label},p),a&&c().createElement(be.k,{icon:Bm.Z,className:i.eyeIcon,size:"XXS",tooltipTitle:x().text("Focus"),onClick:()=>l()})),c().createElement("div",{className:i.crosswalkValue},t.value)))},Wm=(0,T.Z)((e=>({tooltip:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,filter:"drop-shadow(0px 1px 5px #00000033) drop-shadow(0px 3px 1px #0000001F) drop-shadow(0px 2px 2px #00000024)",padding:"10px",maxWidth:"none"},arrow:{color:e.palette.background.paper}})));function qm(){return qm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qm.apply(this,arguments)}const Gm=e=>{const t=Wm();return c().createElement(ae.ZP,qm({},e,{classes:t,arrow:!0}))},$m=e=>{let{crosswalk:t,className:r}=e;const n=_m(t),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Vm(t),i=zm({isOpaque:!a,color:n});return c().createElement(Gm,{title:c().createElement(Hm,{crosswalk:t,color:n}),placement:"top"},c().createElement("div",{className:b()(i.crosswalkIcon,r),onMouseEnter:()=>l(),onMouseLeave:()=>o()}))};var Km=r(27604);const Ym=(0,T.Z)((()=>({textField:{margin:0},input:{borderRadius:0},inputMultiline:{"&$input":{paddingTop:0,paddingBottom:0}},booleanEditor:{paddingLeft:"10px"},timestampEditor:{"&$paper":{minWidth:"255px"}},paper:e=>{let{color:t,containerWidth:r}=e;return{border:`3px solid ${t}`,borderRadius:"4px",width:r,minWidth:"160px"}},popoverRoot:{zIndex:"10!important"}})));function Xm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qm=[u.oS0.TYPE_TEXT,u.oS0.TYPE_BLOB],Jm=e=>{let{attributeType:t,attributeValue:r,color:n,containerRef:a,onClose:l,onEdit:o}=e;const i=Ym({color:n,containerWidth:a.current?a.current.getBoundingClientRect().width:0}),p=(0,u.PFL)(t),d=sa(r,p),[m,g]=(0,s.useState)(d),h={className:i.textField,InputProps:{disableUnderline:!0,classes:{root:i.input,multiline:i.inputMultiline}}},f=()=>{const e=ca(t,m);if(!(0,N.isNil)(m)&&!(0,N.equals)(m,d)){const n=(0,u.CwH)(t)?{value:e.value,lookupCode:e.lookupCode}:{value:""===m&&(0,u.FVt)(p.type)?null:e};o(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xm(e,t,r[t])}))}return e}({},r,n))}l()};return c().createElement(Lr.ZP,{open:!!a,anchorEl:a.current,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},classes:{paper:b()(i.paper,{[i.booleanEditor]:(0,u.T6Y)(p.type),[i.timestampEditor]:(0,u.j5n)(p.type)}),root:i.popoverRoot},onKeyUp:e=>{"Enter"!==e.key||Qm.includes(p.type)?"Escape"===e.key&&l():f()},onBackdropClick:f},c().createElement(na.Z,{autoFocus:!0,dataTypeDefinition:p,fieldName:(0,u.Tde)(t.uri),onChange:g,TextFieldProps:h,value:m,fullWidth:!0}))};function eg(){return eg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eg.apply(this,arguments)}const tg=e=>c().createElement("svg",eg({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3.5A8.503 8.503 0 003.5 12c0 4.692 3.808 8.5 8.5 8.5s8.5-3.808 8.5-8.5-3.808-8.5-8.5-8.5zM6.1 12c0-3.26 2.64-5.9 5.9-5.9 1.161 0 2.24.336 3.149.917L7.017 15.15A5.821 5.821 0 016.101 12zm5.9 5.9c-1.16 0-2.24-.336-3.148-.917l8.131-8.131c.581.908.917 1.987.917 3.148 0 3.26-2.64 5.9-5.9 5.9z",fill:"#000",fillOpacity:.54}));function rg(){return rg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rg.apply(this,arguments)}const ng=e=>c().createElement("svg",rg({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.847 9.402a6.34 6.34 0 00-.8-1.322L8.08 17.048A6.34 6.34 0 0012 18.4a6.398 6.398 0 005.847-8.998zm-7.283 7.283l6.121-6.121a4.898 4.898 0 01-6.121 6.121zm1.437-11.084a6.334 6.334 0 013.92 1.352L6.953 15.92A6.334 6.334 0 015.6 12c0-3.536 2.864-6.4 6.4-6.4zm0 1.5c.5 0 .982.075 1.436.215l-6.121 6.12A4.898 4.898 0 0112 7.1zM6.6 17.903A7.967 7.967 0 0012 20c4.417-.001 8.001-3.585 8.001-8.001a7.967 7.967 0 00-2.601-5.902A7.988 7.988 0 0012 4c-4.416 0-8 3.584-8 8a7.967 7.967 0 002.602 5.902zM12 2.5c-5.244 0-9.5 4.256-9.5 9.5s4.256 9.5 9.5 9.5 9.5-4.256 9.5-9.5-4.256-9.5-9.5-9.5z",fill:"#000",fillOpacity:.54})),ag=e=>{let{isIgnored:t,onClick:r,disabled:n}=e;return c().createElement(be.k,{disabled:n,showForDisabled:!0,icon:t?tg:ng,tooltipTitle:n?x().text("You don't have permissions to ignore"):x().text("Ignore"),onClick:r,size:"XS",disableRipple:!0})};function lg(){return lg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lg.apply(this,arguments)}const og=e=>c().createElement("svg",lg({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 4v6l2 2v2h-5v7l-.992 1L11 21v-7H6v-2l2-2V4H7V2h10v2h-1z",fill:"#000",fillOpacity:.54}));function ig(){return ig=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ig.apply(this,arguments)}const sg=e=>c().createElement("svg",ig({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 10V4h1V2H7v2h1v6l-2 2v2h5v7l1.008 1L13 21v-7h5v-2l-2-2zm-6-6h4v7l1 1H9l1-1V4z",fill:"#000",fillOpacity:.54})),cg=e=>{let{isPinned:t,onClick:r,disabled:n}=e;return c().createElement(be.k,{disabled:n,showForDisabled:!0,onClick:r,icon:t?og:sg,tooltipTitle:n?"You don't have permissions to pin":x().text("Pin"),size:"XS",disableRipple:!0})},ug=(0,T.Z)((e=>({menuItem:{minHeight:"32px",color:e.palette.text.secondary},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"16px"},sourceItem:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)",paddingBottom:"8px",paddingLeft:"16px",maxWidth:"200px"}}))),pg=(0,nt.Z)(Ma.Z),dg=e=>{let{styles:t,icon:r,text:n}=e;return c().createElement(c().Fragment,null,r,c().createElement(v.Z,{classes:{root:t.menuText}},n))},mg=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=(()=>{})}=e;const a=ug(),{disabled:l,text:o,tooltip:i,onClick:s,id:u="",icon:p,crosswalk:d,color:m}=r;return d?c().createElement(Hm,{className:a.sourceItem,color:m,crosswalk:d,focusable:!0}):c().createElement(pg,{tooltipTitle:i,showForDisabled:!0,classes:{root:a.menuItem},onClick:e=>{n(e),s(e)},disabled:l,ref:t,"data-reltio-id":`crosswalk-menu-item${u}`},c().createElement(dg,{icon:p,text:o,styles:a}))}));mg.displayName="CrosswalkMenuItem";const gg=mg;function hg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fg=(0,T.Z)((()=>({root:e=>{let{fullyColored:t,opaque:r,color:n,variant:a}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hg(e,t,r[t])}))}return e}({height:"28px"},"filled"===a&&{borderRadius:"4px",background:t?n:`linear-gradient(to right, ${n} 8px, rgba(0,0,0,0.05) 8px)`},"outlined"===a&&{"&::after":{content:'""',position:"absolute",background:n,borderRadius:"4px 0px 0px 4px",width:"8px",height:"100%",pointerEvents:"none"},"&::before":{content:'""',position:"absolute",boxSizing:"border-box",borderRadius:"4px",border:t?`${n} solid 2px`:"rgba(0,0,0,0.12) solid 1px",width:"100%",height:"100%",pointerEvents:"none"}},{display:"flex",alignItems:"center",maxWidth:"230px",opacity:r?1:.38,transition:"opacity 0.3s",position:"relative"})},attributeValue:{marginLeft:"16px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",flex:1},actions:{display:"flex",width:"71px",justifyContent:"flex-end",marginRight:"4px"}}))),bg=e=>{let{className:t,dataReltioId:r,attributeType:n=null,attributeValue:a,crosswalk:l,disableEdit:o,disableDelete:i,onIgnore:p,onEdit:d,onPin:m,onDelete:g}=e;const{isReadingMode:h,isEditingMode:f,isHovered:y,onMouseEnter:E,onMouseLeave:v,setReadingMode:w,setEditingMode:O}=jm(),C=(0,s.useRef)(),T=(0,u.nIW)(a.uri),S=(0,u.x_)(l),k=!n.system&&!S,N=k&&!o&&(0,u.Z5t)(u.fO_.EDITING,n),I=k&&!i&&(0,u.Edd)(u.fO_.EDITING,n),P=(0,u.ZiX)(a.uri),D=!P&&(!h&&N||a.pin),A=!P&&(!h&&N||a.ignored),R=_m(l),{isHighlighted:j,isDimmed:Z,highlightCrosswalk:L,removeHighlight:_}=Vm(l),M=fg({variant:S?"outlined":"filled",opaque:!Z,fullyColored:j,color:R}),V=[{crosswalk:l,color:R},{disabled:!N,text:x().text("Edit"),icon:c().createElement(Km.Z,null),tooltip:N?null:x().text("You don't have permissions to edit"),onClick:()=>O(),id:"edit"},{disabled:!I,text:x().text("Delete"),icon:c().createElement(ta.Z,null),tooltip:I?null:x().text("You don't have permissions to delete"),onClick:()=>g({attributeType:n,attributeValue:a,crosswalks:[l]}),id:"delete"}],U=()=>{_(),w()};return c().createElement("div",{ref:C,className:b()(t,M.root),onMouseEnter:()=>{L(),E()},onMouseLeave:()=>{_(),v()},"data-reltio-id":r},c().createElement("div",{className:M.attributeValue},c().createElement(rt.Z,{value:(0,u.kDl)(a),dataTypeDefinition:(0,u.PFL)(n)})),c().createElement("div",{className:M.actions},D&&c().createElement(cg,{isPinned:a.pin,onClick:()=>m({attributeValue:a}),disabled:!N}),A&&c().createElement(ag,{isIgnored:a.ignored,onClick:()=>p({attributeValue:a}),disabled:!N}),y&&c().createElement(fe.Z,{MenuItemRenderer:gg,menuId:`simple-attribute-additional-actions-${T}`,buttonComponent:be.k,buttonProps:{icon:he.Z,size:"XS",tooltipTitle:x().text("More actions")},onMenuClose:U,menuItems:V})),f&&c().createElement(Jm,{attributeType:n,attributeValue:a,color:R,onClose:U,onEdit:e=>d({attributeType:n,attributeValue:e,crosswalk:l}),containerRef:C}))},yg=(0,T.Z)((()=>({simpleAttributesWrapper:{display:"flex",flexWrap:"wrap",gap:"4px",width:"100%",minHeight:"28px"},dropIndicator:{height:"28px",color:"#828282",fontSize:"13px",lineHeight:"28px",background:"rgba(0, 0, 0, 0.04)",border:"1px dashed #828282",borderRadius:"4px",boxSizing:"border-box",padding:"0 12px"}})));function xg(){return xg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xg.apply(this,arguments)}const Eg=e=>{let{attributeValues:t,attributeType:r,parentUri:n,disableEdit:a,crosswalksMap:l,onAdd:o}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues","attributeType","parentUri","disableEdit","crosswalksMap","onAdd"]);const s=yg(),[{isDragItemOver:p},d]=(0,Tn.useDrop)({accept:"Crosswalk",canDrop:e=>{let{crosswalk:t}=e;const n=(0,u.bC9)(t.uri)||"relation"===t.ownerType,l=(0,u.WgC)(t.uri)&&"entity"===t.ownerType;return(0,u.d89)(u.fO_.EDITING,r)&&!a&&(n&&(0,u.$NE)(r.uri)||l&&(0,u.EdS)(r.uri))},collect:e=>({isDragItemOver:e.isOver()&&e.canDrop()}),drop:(e,a)=>{let{crosswalk:l}=e;o({attributeType:r,crosswalk:l,parentUri:n,index:t.length})}});let m=0;return c().createElement("div",{ref:d,className:s.simpleAttributesWrapper},t.map((e=>{var t;return null===(t=l[e.uri])||void 0===t?void 0:t.map((t=>c().createElement(bg,xg({key:e.uri+t.uri,attributeType:r,attributeValue:e,crosswalk:t,disableEdit:a,dataReltioId:"value-index-"+m++},i))))})),p&&c().createElement("div",{className:s.dropIndicator},x().text("Drop here")))};function vg(){return vg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vg.apply(this,arguments)}const wg=e=>{let{className:t,attributeValues:r,attributeType:n,onAdd:a,parentUri:l,disableEdit:o}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues","attributeType","onAdd","parentUri","disableEdit"]);const s=!o&&(0,u.d89)(u.fO_.EDITING,n);return 0===r.length&&s?c().createElement(Ze.Z,{variant:"text",color:"primary",onClick:()=>a({parentUri:l,attributeType:n,index:0})},x().text("Create attribute")):c().createElement("div",{className:t},r.map((e=>c().createElement(Kg,vg({key:e.uri,attributeValue:e,attributeType:n,onAdd:a,disableEdit:o},i)))))},Og=e=>{let{children:t}=e;const r=Fm();return c().createElement(v.Z,{component:"span",variant:"body2",classes:{body2:r.label}},t)},Cg=(0,T.Z)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary}})));function Tg(){return Tg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tg.apply(this,arguments)}const Sg=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=Cg(),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,g.useSelector)(h.ZP.selectors.getUIPath),i=c().createElement(Og,null,c().createElement("a",{href:(0,u.ChB)({uiPath:o,uri:(0,u.bwT)(t)}),className:a.label},(0,u.idV)(t.label),t.relationshipLabel&&c().createElement("span",{className:a.relationshipLabel},t.relationshipLabel))),s=(0,N.pipe)(u.tF$,(0,N.map)((e=>(0,u.zeJ)(l,e))),(0,N.reject)(N.isNil))(r);return c().createElement(Gg,Tg({attributeValue:t,attributeType:r,attributeTypesList:s,label:i},n))};function kg(){return kg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kg.apply(this,arguments)}const Ng=e=>{let{className:t,attributeValues:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues"]);return c().createElement("div",{className:t},r.map((e=>c().createElement(Sg,kg({key:e.uri,attributeValue:e},n)))))},Ig=(0,T.Z)((()=>({image:{borderRadius:"4px",background:"white",display:"inline-block",verticalAlign:"middle"},imageContainer:{display:"inline",lineHeight:"45px",paddingRight:"8px"}})));function Pg(){return Pg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pg.apply(this,arguments)}const Dg={imageWidth:55,imageHeight:45},Ag=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=Ig();return c().createElement(Gg,Pg({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:c().createElement(Er,{containerClassName:a.imageContainer,className:a.image,src:(0,u.Ysv)(t),size:Dg})},n))};function Rg(){return Rg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rg.apply(this,arguments)}const jg=e=>{let{className:t,attributeValues:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValues"]);return c().createElement("div",{className:t},r.map((e=>c().createElement(Ag,Rg({key:e.uri,attributeValue:e},n)))))},Zg=(0,T.Z)((()=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start"},complexAttributesWrapper:{width:"100%"}})));function Lg(){return Lg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lg.apply(this,arguments)}function _g(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const Mg=e=>{let{attributeType:t,attributeValues:r=[],paging:n={},max:a=1/0,requestNextPage:l}=e,o=_g(e,["attributeType","attributeValues","paging","max","requestNextPage"]);const i=Zg(),[p,d]=(0,s.useState)(a),m=(0,N.propOr)(r.length,"totalValues",n),g=a<m,h=g&&p<m,f=g&&p>=m,b=r.slice(0,p),y=m-p;return c().createElement("div",{className:i.wrapper},(e=>{switch(t.type){case u.oS0.TYPE_NESTED:return c().createElement(wg,Lg({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));case u.oS0.TYPE_REFERENCE:{const{crosswalksMap:r}=o,n=_g(o,["crosswalksMap"]);return c().createElement(Ng,Lg({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t,crosswalksMap:r},n))}case u.oS0.TYPE_IMAGE:return c().createElement(jg,Lg({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));default:return c().createElement(Eg,Lg({attributeValues:e,attributeType:t},o))}})(b),h&&c().createElement(ir,{moreNumber:Math.min(a,y),valueNumber:y,onClick:()=>{r.length<m&&l(),d(p+a)}}),f&&c().createElement(cr,{onClick:()=>{d(a)}}))},Vg=(0,T.Z)((e=>({title:{fontSize:"12px",lineHeight:"14px",paddingBottom:"4px",display:"inline-block",color:e.palette.text.secondary}})));function Ug(){return Ug=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ug.apply(this,arguments)}const Bg=e=>{let{attributeTypes:t,attributes:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeTypes","attributes"]);const a=Vg();return c().createElement(c().Fragment,null,t.filter(u.Uty).map((e=>c().createElement(D,{key:e.uri,enabled:!0},c().createElement(Q,{className:a.title,label:e.label,attributeType:e}),c().createElement(Mg,Ug({attributeType:e,attributeValues:r[e.name],paging:(0,N.path)(["paging",e.uri],r)},n))))))},zg=e=>{let{onClick:t}=e;return c().createElement(be.k,{icon:ta.Z,tooltipTitle:x().text("Delete"),onClick:t,size:"XS",disableRipple:!0})},Fg=(0,s.createContext)(null),Hg=e=>{let{children:t,attributeUris:r}=e;return c().createElement(Fg.Provider,{value:r},t)},Wg=e=>((0,s.useContext)(Fg)||[]).some((t=>(0,u.sOy)(t,e))),qg=(0,T.Z)((()=>({root:{display:"flex",minHeight:"20px"},actions:{display:"flex",width:"65px",justifyContent:"flex-end",flexShrink:0,alignSelf:"center"},crosswalkIcon:{display:"inline-block",verticalAlign:"middle","& + &":{marginLeft:"4px"}}}))),Gg=e=>{let{attributeType:t,attributeValue:r,attributeTypesList:n,label:a,crosswalksMap:l,disableEdit:o,disableDelete:i,onPin:p,onIgnore:d,onDelete:m,onEdit:g,onAdd:h}=e;const f=qg(),{isReadingMode:b,onMouseEnter:y,onMouseLeave:x}=jm(),E=!o&&(0,u.Z5t)(u.fO_.EDITING,t),v=!i&&(0,u.Edd)(u.fO_.EDITING,t),w=(0,u.ZiX)(r.uri),O=!w&&(!b&&E||r.pin),C=!w&&(!b&&E||r.ignored),T=!b&&v,S=Wg(r.uri),[k,I]=(0,s.useState)(S||w);(0,te.D)((()=>{S&&I(S)}),[S]);const P=(0,N.pipe)((0,N.pickBy)(((e,t)=>(0,u.sOy)(t,null==r?void 0:r.uri))),N.values,N.flatten,(0,N.uniqBy)((0,N.prop)("uri")))(l);return c().createElement(c().Fragment,null,c().createElement("div",{className:f.root,onMouseEnter:y,onMouseLeave:x},c().createElement(Ut,{onClick:()=>I((e=>!e)),expanded:k}),c().createElement("span",null,a,P.map((e=>c().createElement($m,{key:(0,u.uKF)(e),crosswalk:e,className:f.crosswalkIcon})))),c().createElement(fm.Z,null),c().createElement("div",{className:f.actions},O&&c().createElement(cg,{disabled:!E,isPinned:r.pin,onClick:()=>p({attributeValue:r})}),C&&c().createElement(ag,{disabled:!E,isIgnored:r.ignored,onClick:()=>d({attributeValue:r})}),T&&c().createElement(zg,{onClick:()=>m({attributeType:t,attributeValue:r,crosswalks:l[r.uri]})}))),k&&c().createElement(Bg,{attributeTypes:n,attributes:r.value,parentUri:r.uri,crosswalksMap:l,disableEdit:!E,disableDelete:!v,onPin:p,onIgnore:d,onDelete:m,onEdit:g,onAdd:h}))};function $g(){return $g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$g.apply(this,arguments)}const Kg=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=c().createElement(Og,null,(0,u.idV)(null==t?void 0:t.label));return c().createElement(Gg,$g({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:a},n))};var Yg=r(33286),Xg=r(49429),Qg=r(55999),Jg=r(79249);const eh=(0,T.Z)({paper:{minHeight:"180px"},title:{padding:"16px 16px 10px 16px",fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px"},content:{padding:"0 16px"},contentText:{marginBottom:0,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px"},actionButtons:{display:"flex",paddingTop:"4px",fontSize:"14px",fontWeight:500,letterSpacing:0,lineHeight:"16px","& > div":{marginLeft:"auto"}},discardButton:{marginRight:"8px"}}),th=e=>{let{open:t,title:r,content:n,onCancel:a,cancelCaption:l=x().text("Cancel"),onDiscard:o,discardCaption:i="",onSave:s,saveCaption:u=x().text("Save"),disabledSave:p=!1}=e;const d=eh();return c().createElement(kn.Z,{open:t,onClose:a,classes:{paperScrollPaper:d.paper}},c().createElement(Jg.Z,{classes:{root:d.title}},r),c().createElement(uo.Z,{classes:{root:d.content}},c().createElement(Qg.Z,{classes:{root:d.contentText}},n)),c().createElement(Xg.Z,{className:d.actionButtons,disableSpacing:!0},a&&c().createElement(Ze.Z,{onClick:a},l),c().createElement("div",null,o&&c().createElement(Ze.Z,{onClick:o,classes:{root:d.discardButton}},i),c().createElement(Ze.Z,{onClick:s,color:"primary",disabled:p,autoFocus:!0},u))))},rh=e=>{let{open:t,onClose:r,onConfirm:n}=e;return c().createElement(kn.Z,{open:t},c().createElement(uo.Z,null,c().createElement(Qg.Z,null,x().text("Are you sure you want to delete this?"))),c().createElement(Xg.Z,null,c().createElement(Ze.Z,{onClick:r,color:"primary"},x().text("No")),c().createElement(Ze.Z,{onClick:()=>{n(),r()},color:"primary"},x().text("Yes"))))};var nh=r(92332);const ah=(0,T.Z)((e=>({coloredCell:{"&::before":{content:'""',position:"absolute",right:0,top:0,width:"100%",height:"100%",background:"rgba(0,0,0,0.06)",pointerEvents:"none"}},headCell:{display:"flex",alignItems:"center",fontSize:"12px",height:"100%",color:e.palette.text.secondary},rowCell:{fontSize:"13px",overflow:"hidden"},cellValueWrapper:{padding:"15px 15px 0 15px","&:last-child":{paddingBottom:"15px"}},attributeTitle:{display:"block",marginLeft:"3px","&:not(:last-child)":{marginBottom:"5px"}},ovValue:{"& + &":{marginTop:"4px"}},count:{textAlign:"center"},ruleType:{display:"flex",alignItems:"center"},ruleTypeLabel:{marginRight:"5px"},rulePopup:{width:"270px",overflowY:"hidden"},popupItem:{paddingBottom:"5px",paddingTop:"5px"},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"},closeButton:{height:24,width:24},popupTitle:{fontWeight:500,marginLeft:"12px"},popupTitleWrapper:{display:"flex",paddingLeft:16,paddingTop:16},popupItemsWrapper:{overflowY:"auto",maxHeight:"280px"},winnerSourceItemWrapper:{paddingBottom:"2px",paddingTop:"2px"},winnerSourceItem:{display:"flex",alignItems:"center",width:"100%",paddingLeft:"8px"},winnerSourceItemLabel:{fontSize:13}}))),lh=e=>{const t=ah();return c().createElement("div",{className:b()(t.headCell,t.coloredCell)},c().createElement(nh.default,e),e.children)},oh=(0,T.Z)({root:{marginBottom:"-6px"}}),ih=(0,Di.Z)((0,N.pick)(["parentUri","parentTypeUri","onAdd","selectedAttributeTypes","onSelectAttributeTypes"]))((e=>{let{parentTypeUri:t,parentUri:r,selectedAttributeTypes:n,onSelectAttributeTypes:a,onAdd:l}=e;const o=oh(),i=(0,g.useSelector)(h.ZP.selectors.getMetadata),s=[...i.entityTypes,...i.relationTypes||[]].find((0,N.propEq)("uri",t)),p=e=>!(null!=n&&n.find((0,N.propEq)("uri",e.uri))),d=(0,N.pipe)((0,N.propOr)([],"attributes"),(0,N.reject)((0,N.either)(u.YkG,u.Or$)),(0,N.filter)((0,N.either)(u.QZu,p)),(0,N.filter)((0,N.both)(u.Uty,(e=>(0,u.Vg3)({attributeType:e,mode:u.fO_.EDITING})))))(s);return c().createElement("div",{className:o.root},c().createElement(Jr,{label:x().text("Attribute"),popupTitle:x().text("Add attributes"),data:d,onApply:e=>{const t=e.filter(p);t.length>0&&a([...t,...n]),e.filter(u.QZu).forEach((e=>{l({attributeType:e,parentUri:r})}))}}))}));const sh=(0,Di.Z)((0,N.pick)(["readOnly"]))((e=>{let{readOnly:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readOnly"]);return t?c().createElement(lh,r):c().createElement(lh,r,c().createElement(fm.Z,null),c().createElement(ih,null))})),ch=e=>{let{value:t}=e;const r=ah();return c().createElement("div",{className:r.cellValueWrapper},t)},uh=(0,T.Z)((()=>({simpleAttributeWrapper:{padding:"15px"},complexAttributeWrapper:{padding:"15px","& + &":{borderTop:"1px solid rgba(0,0,0,.1)"}}})));function ph(){return ph=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ph.apply(this,arguments)}const dh=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=uh();return c().createElement("div",{className:n.simpleAttributeWrapper},c().createElement(Mg,ph({attributeValues:t},r)))};function mh(){return mh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mh.apply(this,arguments)}const gh=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=uh(),a=null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:n.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(Kg,mh({attributeValue:e},r)))));return c().createElement(c().Fragment,null,a)};function hh(){return hh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hh.apply(this,arguments)}const fh=e=>{let{attributeValues:t,crosswalksMap:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues","crosswalksMap"]);const a=uh(),l=null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:a.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(Sg,hh({attributeValue:e,crosswalksMap:r},n)))));return c().createElement(c().Fragment,null,l)};function bh(){return bh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bh.apply(this,arguments)}const yh=e=>{let{attributeValues:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValues"]);const n=uh();return c().createElement(c().Fragment,null,null==t?void 0:t.map(((e,t)=>c().createElement("div",{key:null==e?void 0:e.uri,className:n.complexAttributeWrapper,"data-reltio-id":`value-index-${t}`},c().createElement(Ag,bh({attributeValue:e},r))))))};function xh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Eh=(0,Di.Z)((0,N.pick)(["onDelete","onPin","onIgnore","onEdit","onAdd","parentUri","readOnly"]))((e=>{let{value:t,onDelete:r,onEdit:n,onPin:a,onIgnore:l,onAdd:o,parentUri:i,readOnly:s}=e;return class{static build(e,t){switch(e){case u.oS0.TYPE_NESTED:return c().createElement(gh,t);case u.oS0.TYPE_REFERENCE:return c().createElement(fh,t);case u.oS0.TYPE_IMAGE:return c().createElement(yh,t);default:return c().createElement(dh,t)}}}.build(t.attributeType.type,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xh(e,t,r[t])}))}return e}({},t,{parentUri:i,onDelete:r,onEdit:n,onPin:a,onIgnore:l,onAdd:o,disableEdit:s,disableDelete:s}))})),vh=e=>{let{value:{values:t,attributeType:r}}=e;const n=ah();return c().createElement("div",{className:n.cellValueWrapper},c().createElement(Q,{className:n.attributeTitle,label:r.label,attributeType:r}),c().createElement(Ti,{values:t,attributeType:r,valueContainerClassName:n.ovValue}))},wh=e=>{let{value:t}=e;const r=ah();return c().createElement("div",{className:b()(r.cellValueWrapper,r.count)},t)};var Oh=r(11776),Ch=r(38402),Th=r(49378),Sh=r(99144);const kh=e=>{let{sourcesUriOrder:t}=e;const r=ah(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata);return c().createElement(c().Fragment,null,t.map((e=>c().createElement(Ch.Z,{key:e,className:r.popupItem},c().createElement(hm,{className:r.sourceIcon,sourceType:e}),c().createElement(Th.Z,{primary:(0,u.tH7)(n,e),primaryTypographyProps:{variant:"body2"}})))))},Nh=e=>{let{attributeUri:t}=e;const r=ah(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),a=(0,u.zeJ)(n,t);return c().createElement(Ch.Z,{key:a.uri,className:r.popupItem},c().createElement(Th.Z,{primary:(0,u.idV)(a.label),primaryTypographyProps:{variant:"body2"}}))},Ih=(0,N.cond)([[(0,N.prop)("sourcesUriOrder"),()=>x().text("Source sequence")],[(0,N.prop)("primaryAttributeUri"),()=>x().text("Attribute winner")],[(0,N.prop)("comparisonAttributeUri"),()=>x().text("Comparison attribute")]]),Ph=(0,N.cond)([[(0,N.prop)("sourcesUriOrder"),e=>{let{sourcesUriOrder:t}=e;return c().createElement(kh,{sourcesUriOrder:t})}],[(0,N.prop)("primaryAttributeUri"),e=>{let{primaryAttributeUri:t}=e;return c().createElement(Nh,{attributeUri:t})}],[(0,N.prop)("comparisonAttributeUri"),e=>{let{comparisonAttributeUri:t}=e;return c().createElement(Nh,{attributeUri:t})}]]),Dh=e=>{let{info:t}=e;const r=ah(),[n,a]=(0,s.useState)(null),l=()=>a(null);return c().createElement(c().Fragment,null,c().createElement(be.k,{icon:Sh.Z,tooltipTitle:x().text("View details"),size:"XS",onClick:e=>a(e.currentTarget)}),c().createElement(Lr.ZP,{classes:{paper:r.rulePopup},open:!!n,anchorEl:n,onClose:l,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},c().createElement("div",{className:r.popupTitleWrapper},c().createElement(Ya.Z,{className:r.closeButton,onClick:l},c().createElement(Hn.default,null)),c().createElement(v.Z,{variant:"subtitle1",className:r.popupTitle},Ih(t))),c().createElement(Oh.Z,{component:"div",className:r.popupItemsWrapper},Ph(t))))},Ah=e=>{let{value:{ruleType:t,sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}=e;const l=ah(),o=r||n||a;return c().createElement("div",{className:b()(l.cellValueWrapper,l.ruleType)},c().createElement("div",{className:l.ruleTypeLabel},t.label),o&&c().createElement(Dh,{info:{sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}))};function Rh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jh=(0,T.Z)({item:e=>{let{color:t,opacity:r,variant:n}=e;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rh(e,t,r[t])}))}return e}({},"filled"===n&&{backgroundColor:t},"outlined"===n&&{border:`${t} solid 2px`},{opacity:r,transition:"opacity 0.3s",boxSizing:"border-box"})}});function Zh(){return Zh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zh.apply(this,arguments)}const Lh=(0,s.forwardRef)(((e,t)=>{let{color:r,opacity:n,variant:a="filled",children:l,className:o}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["color","opacity","variant","children","className"]);const s=jh({color:r,opacity:n,variant:a});return c().createElement("div",Zh({ref:t,className:b()(s.item,o)},i),l)})),_h=e=>{let{crosswalk:t}=e;const r=ah(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Vm(t);return c().createElement(Lh,{className:r.winnerSourceItem,color:(0,u.CJp)((0,u.uKF)(t)),opacity:a?.38:1,onMouseEnter:()=>l(),onMouseLeave:()=>o()},c().createElement(hm,{className:r.sourceIcon,sourceType:t.type}),c().createElement(Th.Z,{primary:(0,u.tH7)(n,t.type),primaryTypographyProps:{variant:"body2"},classes:{primary:r.winnerSourceItemLabel}}))},Mh=e=>{let{value:{crosswalks:t}}=e;const r=ah();return c().createElement(Oh.Z,{component:"div"},t.map((e=>c().createElement(Ch.Z,{key:e.uri,className:r.winnerSourceItemWrapper},c().createElement(_h,{crosswalk:e})))))},Vh=[{id:"ovValues",get label(){return x().text("Attributes & OV")},hideable:!1,initialWidth:360,minWidth:250},{id:"winnerSources",get label(){return x().text("Winner source systems")},initialWidth:220},{id:"ruleType",get label(){return x().text("Rule type")},initialWidth:200},{id:"count",get label(){return x().text("Count")},initialWidth:80,minWidth:80},{id:"values",get label(){return x().text("Attribute values")},hideable:!1}],Uh=e=>(0,u.OXP)(e)&&!(0,u.ZiX)(e.uri),Bh=["ovValues","ruleType","values"],zh=e=>{switch(e){case"ovValues":return vh;case"values":return Eh;case"count":return wh;case"ruleType":return Ah;case"winnerSources":return Mh;default:return ch}},Fh=(0,N.pipe)(u.cwx,(0,N.sortWith)([(0,N.descend)((0,N.propOr)(-1,"priority"))]),(0,N.map)((0,N.prop)("uri"))),Hh=(0,N.curry)(((e,t)=>(0,u.YkG)(e)&&t&&(0,N.pipe)(u.c31,(0,N.find)((r=>r.slice((0,u.u5q)(r).length)===t.slice(e.uri.length))))(e)||t)),Wh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return(0,N.pipe)((0,N.filter)(Uh),(0,N.chain)((e=>(0,N.pipe)((0,N.pickBy)(((t,r)=>{const n=(0,u.sOy)(r,e.uri),a=n?r.slice(e.uri.length+1):"",l=a&&(0,u.IM5)(e.value,a);return n&&(!l||Uh(l))})),N.values,N.flatten)(t))),(0,N.uniqBy)((0,N.prop)("uri")))(e)},qh=(0,N.map)((e=>{let{id:t,label:r,initialWidth:n,minWidth:a}=e;return{id:t,label:r,initialWidth:n,minWidth:a,autoResize:!n,resizable:!0,sortable:!1,headCellRenderer:"ovValues"===t?sh:lh,rowCellValueRenderer:zh(t)}})),Gh=(e,t,r,n,a,l)=>{switch(e){case"ovValues":return{attributeType:n,values:null==l?void 0:l.filter(Uh)};case"values":return{attributeType:n,attributeValues:l,crosswalksMap:a};case"count":return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;switch(e){case u.oS0.TYPE_REFERENCE:case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return t.length;default:return t.reduce(((e,t)=>e+r[t.uri].length),0)}}(n.type,l,a);case"ruleType":return((e,t,r)=>{var n,a;const l=[...e.entityTypes,...e.relationTypes||[]].find((0,N.propEq)("uri",r)),o=null==l||null===(n=l.survivorshipGroups)||void 0===n?void 0:n.find((0,N.propEq)("default",!0)),i=null==o||null===(a=o.mapping)||void 0===a?void 0:a.find((0,N.propEq)("attribute",t.uri)),s=(0,u.o_J)(e,null==i?void 0:i.survivorshipStrategy)||(0,u.Xaq)(e),c=(e=>"configuration/survivorshipStrategies/SRC_SYS"===(null==e?void 0:e.uri))(s)?(0,N.uniq)([...(null==i?void 0:i.sourcesUriOrder)||[],...(null==o?void 0:o.sourcesUriOrder)||[],...Fh(e)]):void 0,p=Hh(t),d=(e=>"configuration/survivorshipStrategies/OtherAttributeWinnerCrosswalk"===(null==e?void 0:e.uri))(s)?p(null==i?void 0:i.primaryAttributeUri):void 0,m=(0,u.YkM)(t)&&(e=>"configuration/survivorshipStrategies/MinValue"===(null==e?void 0:e.uri)||"configuration/survivorshipStrategies/MaxValue"===(null==e?void 0:e.uri))(s)?p(null==i?void 0:i.comparisonAttributeUri):void 0;return{ruleType:s,sourcesUriOrder:c,primaryAttributeUri:d,comparisonAttributeUri:m}})(t,n,r);case"winnerSources":return{crosswalks:Wh(l,a)};default:return null}};function $h(){return $h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$h.apply(this,arguments)}const Kh=e=>{let{cell:t,CellValueRenderer:r,columnIndex:n,columnData:a}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["cell","CellValueRenderer","columnIndex","columnData"]);const o=ah(),i=0===n;return c().createElement("div",{className:b()(o.rowCell,i&&o.coloredCell),"data-reltio-id":`column-name-${a.id}`},t.values.map(((e,t)=>c().createElement(r,$h({key:t,value:e},l)))))};var Yh=r(44962),Xh=r(2682),Qh=r(84899);const Jh=e=>{let{open:t,onClose:r,onConfirmEditWithoutIgnore:n,onConfirmEditWithIgnore:a}=e;const[l,o]=(0,s.useState)("without");return c().createElement(kn.Z,{open:t,onEnter:()=>o("without")},c().createElement(uo.Z,null,c().createElement(Qg.Z,null,x().text("You are attempting to change a value that is presently ignored.")),c().createElement(aa.Z,{component:"fieldset"},c().createElement(Qh.Z,{component:"legend"},x().text("Please choose an option:")),c().createElement(Xh.Z,{value:l,onChange:(0,N.pipe)(wn.NA,o)},c().createElement(Dr.Z,{value:"without",control:c().createElement(Yh.Z,null),label:x().text("Save without Ignore")}),c().createElement(Dr.Z,{value:"with",control:c().createElement(Yh.Z,null),label:x().text("Save and apply Ignore to new value")})))),c().createElement(Xg.Z,null,c().createElement(Ze.Z,{onClick:r,color:"primary"},x().text("Cancel")),c().createElement(Ze.Z,{onClick:()=>{"with"===l?a():n(),r()},color:"primary"},x().text("Ok"))))},ef=(0,T.Z)({tableContainer:{height:"100%",overflow:"hidden",display:"flex",flexDirection:"column"},tableHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between"},tableContent:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",position:"relative"}});function tf(){return tf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tf.apply(this,arguments)}const rf=(0,s.memo)((e=>{let{entity:t,isLoading:r,crosswalksMap:n,visibleColumns:a=Bh,onChangeVisibleColumns:l,readOnly:o,onDelete:i=wn.ZT,onPin:p=wn.ZT,onIgnore:d=wn.ZT,onEdit:m=wn.ZT,onAdd:f=wn.ZT,selectedAttributeTypes:b,onSelectAttributeTypes:y=wn.ZT}=e;const E=ef(),v=(0,s.useMemo)((()=>(0,N.pipe)((0,N.filter)((e=>{let{id:t}=e;return a.includes(t)})),qh)(Vh)),[a]),{type:w,uri:O,attributes:T={}}=t||{},S=(0,g.useSelector)(h.ZP.selectors.getMetadata);(0,s.useEffect)((()=>{if(t&&(0,N.isNil)(b)){const e=(0,N.pipe)(N.keys,(0,N.without)(["paging"]),(0,N.map)((0,u.tCm)(w)),(0,N.map)((e=>(0,u.zeJ)(S,e,w))),(0,N.filter)(u.Uty))(T);y(e)}}),[t,b]);const k=(0,s.useMemo)((()=>w?function(e,t){let r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]).map((l=>{const o=(0,u.nIW)(l.uri),i=a[o],s=(0,u.YkG)(l)?n.relation:n.entity;return(0,N.pipe)((0,N.reduce)(((r,n)=>(0,N.assoc)(n,Gh(n,e,t,l,s,i),r)),{}),(0,N.assoc)("rawValue",i))(r)}))}(S,w,b,a,n,T):[]),[S,w,b,a,T,n]),{getDynamicRowCellHeight:I,changeRowCellHeight:P}=Rs(),D=(0,s.useCallback)((e=>c().createElement(Ts,tf({onChangeHeight:P},e),c().createElement(Kh,e))),[P]),A=(0,s.useCallback)((0,N.either)(I,(0,N.always)(68)),[I]),[R,j]=(0,s.useState)(null),[Z,L]=(0,s.useState)(null),_=(0,s.useCallback)((e=>{e.attributeValue.ignored?L(e):m(e)}),[m,L]),M=(0,s.useMemo)((()=>({onDelete:j,onPin:p,onIgnore:d,onEdit:_,onAdd:f,parentUri:O,parentTypeUri:w,selectedAttributeTypes:b,onSelectAttributeTypes:y,readOnly:o})),[j,p,d,_,f,O,w,b,y,o]);return c().createElement("div",{className:E.tableContainer},c().createElement(C.Z,{classes:{root:E.tableHeader},title:x().text("Sources")},c().createElement(ts,{columnsData:Vh,selectedColumns:a,onChangeColumns:l})),c().createElement("div",{className:E.tableContent},r&&c().createElement(Pn,null),c().createElement(Pi.Z,{fixFirstColumn:!0,headRowHeight:48,defaultColumnWidth:250,defaultColumnMinWidth:200,columnsData:v,rowsData:k,renderRowCell:D,getRowCellHeight:A,context:M})),c().createElement(rh,{open:!!R,onClose:()=>j(null),onConfirm:()=>i(R)}),c().createElement(Jh,{open:!!Z,onClose:()=>L(null),onConfirmEditWithIgnore:()=>m(Z),onConfirmEditWithoutIgnore:()=>{d({attributeValue:Z.attributeValue}),m(Z)}}))}));function nf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){af(e,t,r[t])}))}return e}function af(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lf=[],of=e=>{let{entity:t,onLoad:r=wn.ZT,onModify:n=wn.ZT,onError:a=wn.ZT}=e;const[l,o]=(0,s.useState)(null),[i,c]=(0,s.useState)(null),p=(0,s.useRef)([]),d=(0,s.useRef)(null),m=(0,s.useCallback)((()=>{d.current=null}),[]),[g,h]=(0,s.useState)(lf),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(((e,t)=>((0,u.sJj)(t).forEach((r=>{e[r]=[...e[r]||[],t]})),e)),{})};(0,s.useEffect)((()=>{const e={entity:f(null==t?void 0:t.crosswalks),relation:(0,N.pipe)(u.HQx,f)(t)};if((null==l?void 0:l.uri)===(null==t?void 0:t.uri)&&d.current){const{ownerType:t}=d.current,r=Object.keys(e[t]),n=Object.keys(i[t]);h((0,N.difference)(r,n))}else h(lf);m(),o(t),c(e),p.current=[]}),[t]);const b=(0,s.useCallback)((0,N.pipe)(a,m),[a,m]),{deleteAttribute:y,ignoreAttribute:x,pinAttribute:E,createAttribute:v,updateAttribute:w}=(e=>{let{onSuccess:t=wn.ZT,onError:r=wn.ZT,onLoad:n=wn.ZT}=e;const a=(0,s.useCallback)((e=>{n(),e.then((()=>{t()})).catch(r)}),[r,t,n]),l=(0,s.useCallback)((e=>e.then((e=>{if("error"in e)throw e.error;return e}))),[]);return{deleteAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,attributeType:r,crosswalks:n}=e;const o=(0,u.YkG)(r)?(0,N.pipe)(u.o96,(0,N.prop)("objectURI"),u.VGk,l)(t):Promise.all((n||[]).map((e=>{let{type:r,value:n,sourceTable:a}=e;return l((0,u.xZs)({attributeUri:t.uri,sourceUri:r,crosswalkValue:n,crosswalkSourceTable:a}))})));a(o)}),[a,l]),pinAttribute:(0,s.useCallback)((e=>{let{attributeValue:t}=e;(0,N.pipe)(u.xkv,l,a)({attributeUri:t.uri,value:!t.pin})}),[a,l]),ignoreAttribute:(0,s.useCallback)((e=>{let{attributeValue:t}=e;(0,N.pipe)(u.P8_,l,a)({attributeUri:t.uri,value:!t.ignored})}),[a,l]),updateAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,attributeType:r,crosswalk:n}=e;(0,u.YkM)(r)||(0,u.Or$)(r)||(0,N.pipe)(u.tCj,l,a)({attributeUri:t.uri,sourceUri:n.type,crosswalkValue:n.value,crosswalkSourceTable:n.sourceTable,value:(0,u.CwH)(r)?t.lookupCode:t.value})}),[a,l]),createAttribute:(0,s.useCallback)((e=>{let{attributeValue:t,crosswalk:r}=e;(0,N.pipe)(u.JV_,(0,N.andThen)((e=>{let[{errors:t}]=e;if(t)throw t})),a)({attributeUri:t.uri,sourceUri:r.type,crosswalkValue:r.value,crosswalkSourceTable:r.sourceTable,value:t.value})}),[a])}})({onLoad:r,onSuccess:n,onError:b}),O=(0,s.useCallback)((e=>{let{attributeType:t,parentUri:r,crosswalk:n,index:a}=e;const l=(0,u.gjI)({parentUri:r,attributeType:t}),{uri:i}=l;if(n){const{ownerType:e}=n;c((t=>nf({},t,{[e]:nf({},t[e],{[i]:[n]})})))}o((e=>{var n;return(0,N.isNil)(a)&&(a=null===(n=(0,u.JQy)(e,r,t.name))||void 0===n?void 0:n.length),(0,u.wLZ)({entity:e,attributeType:t,newAttribute:l,index:a})})),p.current.some((e=>(0,u.sOy)(i,e)))||p.current.push(i)}),[]),C=(0,s.useCallback)((e=>{const{attributeValue:{uri:t},attributeType:r}=e;(0,u.ZiX)(t)?(o((e=>(0,u.d$I)({entity:e,attributeType:r,uri:t}))),c((0,N.evolve)({entity:(0,N.dissoc)(t),relation:(0,N.dissoc)(t)})),p.current=(0,N.without)([t],p.current)):y(e)}),[y]),T=(0,s.useCallback)((e=>{if((0,u.ZiX)(e.attributeValue.uri)){const{attributeValue:t,attributeType:r,crosswalk:n}=e;if(!(0,N.isNil)(t.value)){const{uri:e}=t,a=p.current.find((t=>(0,u.sOy)(e,t))),o=(0,u.ww$)({entity:l,attributeType:r,uri:e,value:(0,u.kDl)(t)});v({attributeValue:(0,u.dLR)(o,a),crosswalk:n}),d.current=n}}else w(e)}),[v,w,l]);return{modifiedEntity:l,crosswalksMap:i,onAddAttribute:O,onDeleteAttribute:C,onPinAttribute:E,onIgnoreAttribute:x,onEditAttribute:T,newlyCreatedAttributes:g}},sf=e=>{let{onLoad:t=wn.ZT,onSuccess:r=wn.ZT,onError:n=wn.ZT}=e;const a=(0,s.useCallback)((e=>{t(),e.then((e=>{let{errors:t}=e;if(t)throw t;r()})).catch(n)}),[t,n,r]);return{addCrosswalk:(0,s.useCallback)((e=>{let{entity:t,contributorCrosswalk:r,crosswalk:n}=e;const l=r?(0,u.psB)({entityTypeUri:t.type,contributorCrosswalkType:r.type,contributorCrosswalkValue:r.value,contributorCrosswalkSourceTable:r.sourceTable,crosswalkType:n.type,crosswalkValue:n.value,crosswalkSourceTable:n.sourceTable,crosswalkDeleteDate:n.deleteDate}):(0,u.kRE)({entityUri:t.uri,crosswalk:n});(0,N.pipe)((0,N.andThen)((e=>{let[t]=e;return t})),a)(l)}),[a]),editCrosswalk:(0,s.useCallback)((e=>{let{entityUri:t,crosswalkId:r,attributeName:n,value:l}=e;(0,N.pipe)((0,N.ifElse)((e=>{let{value:t}=e;return(0,N.isNil)(t)}),u.K$w,u.WVU),(0,N.andThen)((e=>{let[t]=e;return t})),a)({entityUri:t,crosswalkId:r,attributeName:n,value:l})}),[a]),deleteCrosswalk:(0,s.useCallback)((e=>{let{entityUri:t,crosswalkId:r}=e;(0,N.pipe)(u.Gmt,a)({entityUri:t,crosswalkId:r})}),[a])}},cf=(0,T.Z)({dragLayer:{position:"fixed",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",zIndex:1300,pointerEvents:"none"},crosswalkPreview:{height:"28px",maxWidth:"394px",display:"flex",overflow:"hidden",padding:"6px",alignItems:"center",boxSizing:"border-box"},sourceLabel:{fontSize:"13px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},sourceIcon:{width:"16px",height:"16px",marginRight:"9px"}}),uf=e=>{let{crosswalk:t}=e;const r=cf(),n=_m(t),a=(0,g.useSelector)(h.ZP.selectors.getMetadata),l=(0,u.tH7)(a,t.type);return c().createElement(Lh,{color:n,className:r.crosswalkPreview},c().createElement(hm,{className:r.sourceIcon,sourceType:t.type}),c().createElement(v.Z,{className:r.sourceLabel,variant:"body2"},l))},pf=(0,s.memo)((()=>{var e;const t=cf(),{isDragging:r,clientOffset:n,item:a}=(0,Tn.useDragLayer)((e=>({isDragging:e.isDragging(),clientOffset:e.getClientOffset(),item:e.getItem()}))),l=(0,s.useRef)(),o=(null===(e=l.current)||void 0===e?void 0:e.getBoundingClientRect())||{x:0,y:0},i=`translate(${(null==n?void 0:n.x)-(null==o?void 0:o.x)}px, ${(null==n?void 0:n.y)-(null==o?void 0:o.y)}px`;return r&&c().createElement("div",{ref:l,className:t.dragLayer},c().createElement("div",{style:{display:"flex",transform:i,WebkitTransform:i}},"Crosswalk"===a.type&&c().createElement(uf,{crosswalk:a.crosswalk})))}));let df;!function(e){e.Simple="simple",e.Empty="empty",e.Dependent="dependent"}(df||(df={}));const mf=(0,T.Z)((()=>({root:e=>{let{isOpaque:t}=e;return{display:"flex",opacity:t?1:.38,transition:"opacity 0.3s"}},wrapper:{width:"100%",display:"flex",alignItems:"center",height:28,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDcvMjYvMTMEw7WpAAAAeElEQVQ4ja3VuwrAIBBE0aup0uX/v9ImCCGSdIL4WF136+EwxcC6+3k/hAsxSREArvPAW2LAGFzFhqAG64JarAnuYBW4ixWgBZZBKwzAW2Ig7HAVCzHJ4AoGQsNVbAhqsC6oxZrgDlaBu1gBWmAZtMIA3MwLmMUAfmyqQ9/LD+oDAAAAAElFTkSuQmCC)"},focusedIcon:{width:28,height:28,backgroundColor:"rgba(0, 0, 0, 0.12)",borderRadius:0,borderRight:"1px solid #fff"},sourceIcon:{height:"16px",width:"16px",marginLeft:"16px",marginRight:"9px",fontSize:"14px"}}))),gf=(0,s.memo)((e=>{let{crosswalkType:t,focusable:r=!0}=e;const{isDimmed:n}=Vm(),a=mf({isOpaque:!n}),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,u.tH7)(l,t);return c().createElement("div",{className:a.root},c().createElement(Lt.Z,{size:"XXS",className:a.focusedIcon,icon:r&&Bm.Z,disabled:!0}),c().createElement("div",{className:a.wrapper},c().createElement(hm,{className:a.sourceIcon,sourceType:t}),c().createElement(v.Z,{variant:"body2"},o)))}));var hf=r(19540),ff=r(42484);function bf(){return bf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bf.apply(this,arguments)}const yf=e=>c().createElement("svg",bf({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().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:"Copy_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"Copy_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Copy_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#Copy_svg__b)",d:"M0 0h24v24H0z"}))),xf=(0,T.Z)((()=>({root:{display:"flex",justifyContent:"space-between",alignItems:"center",overflowWrap:"anywhere"},text:{fontSize:13},button:{flexShrink:0,marginLeft:8,padding:0,textTransform:"none"}}))),Ef=e=>{let{value:t}=e;const r=xf();return c().createElement("div",{className:r.root},c().createElement(v.Z,{className:r.text,variant:"body2"},t),c().createElement(Lt.Z,{size:"XXS",icon:yf,color:"primary",className:r.button,onClick:()=>navigator.clipboard.writeText(t)}))},vf=(0,T.Z)((()=>({timestampEditorInput:{paddingTop:15,paddingBottom:15,fontSize:13},timestampEditor:{height:38}}))),wf=e=>{let{value:t,classes:r={},disabled:n=!1,onChange:a}=e;const l=vf(),[o,i]=(0,s.useState)(!1),u=e=>a(e.valueOf());return c().createElement(Ac.Z,{variant:"filled",value:t?new Date(t):null,disabled:n,onChange:(0,N.unless)((0,N.always)(o),u),onAccept:u,onOpen:()=>i(!0),onClose:()=>i(!1),InputProps:{disableUnderline:!0,classes:{input:l.timestampEditorInput,root:b()(l.timestampEditor,r.root)}}})},Of=(0,T.Z)((e=>({text:{fontSize:13},attributeWrapper:{display:"flex",alignItems:"center",paddingTop:5,paddingBottom:5,marginLeft:12},attributeTitle:{fontSize:13,width:135,color:e.palette.text.secondary},attributeValue:{paddingLeft:10,display:"flex",alignItems:"center",flexGrow:1},input:{paddingTop:14,paddingBottom:14,fontSize:13},editor:{flexGrow:1},moreButton:{marginLeft:24},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"}}))),Cf=e=>{let{crosswalk:t,canEditAttribute:r=!0,onEditAttribute:n,onDeleteAttribute:a}=e;const l=Of(),o=!("uri"in t),i=(0,g.useSelector)(h.ZP.selectors.getMetadata),[p,d]=(0,s.useState)([]),[m,f]=(0,s.useState)(null),b=(0,s.useMemo)((()=>[{label:u.G39.sourceSystems.label,uri:"type"},{label:u.G39.value.label,uri:"value"},{label:u.G39.sourceTable.label,uri:"sourceTable",canBeAdded:o,canBeDeleted:o},{label:u.G39.createDate.label,uri:"createDate"},{label:u.G39.updateDate.label,uri:"updateDate"},{label:u.G39.deleteDate.label,uri:"deleteDate",canBeAdded:!0,canBeDeleted:!0},{label:u.G39.reltioLoadDate.label,uri:"reltioLoadDate"},{label:u.G39.publishDate.label,uri:"sourcePublishDate"}]),[]),y=(0,N.pipe)((0,N.filter)((0,N.propEq)("canBeAdded",!0)),(0,N.filter)((e=>!(0,N.has)(e.uri,t))),(0,N.filter)((e=>!p.includes(e.uri))))(b);return c().createElement(c().Fragment,null,y.length>0&&r&&c().createElement(Jr,{label:x().text("Add attributes"),onApply:e=>{e.length>0&&d((t=>t.concat((0,N.map)((0,N.prop)("uri"),e))))},data:y}),b.map((e=>e.uri in t||p.includes(e.uri)?c().createElement("div",{key:e.uri,className:l.attributeWrapper},c().createElement(v.Z,{variant:"body2",className:l.attributeTitle},`${e.label}:`),c().createElement("div",{className:l.attributeValue},((e,t)=>{switch(e){case"type":{const r=(0,u.tH7)(i,t);return o?c().createElement(_l.Z,{label:"",placeholder:t,className:l.editor,value:{value:t,label:r},options:(0,u.cwx)(i).sort((0,N.ascend)((0,N.prop)("label"))).map((e=>{let{uri:t,label:r}=e;return{value:t,label:r}})),onChange:t=>{let{value:r}=t;return n(e,r)},TextFieldProps:{InputProps:{disableUnderline:!0}}}):c().createElement(c().Fragment,null,c().createElement(hm,{className:l.sourceIcon,sourceType:t}),c().createElement(v.Z,{className:l.text,variant:"body2"},r))}case"sourceTable":return o?c().createElement(kc.Z,{multiple:!1,multiline:!1,getValueLabel:void 0,classes:{root:l.editor},required:!0,variant:"filled",value:t,onInput:t=>n(e,t.target.value),margin:"dense",InputProps:{disableUnderline:!0,classes:{input:l.input}}}):c().createElement(v.Z,{className:l.text,variant:"body2"},t);case"value":return o?c().createElement(kc.Z,{multiple:!1,multiline:!1,getValueLabel:void 0,classes:{root:l.editor},required:!0,variant:"filled",value:t,onInput:t=>n(e,t.target.value),margin:"dense",InputProps:{disableUnderline:!0,classes:{input:l.input}}}):c().createElement(Ef,{value:t});case"deleteDate":return c().createElement(wf,{value:t&&tn().utc((0,u.ZBU)(t)).valueOf(),onChange:t=>n(e,t.toString()),classes:{root:l.editor},disabled:!r});case"sourcePublishDate":case"createDate":case"updateDate":case"reltioLoadDate":return c().createElement(v.Z,{className:l.text,variant:"body2"},(0,u.o0x)(t));default:return null}})(e.uri,t[e.uri]),e.canBeDeleted&&c().createElement(be.k,{icon:ta.Z,disabled:!r,onClick:()=>f(e.uri),size:"XS",tooltipTitle:x().text("Delete attribute"),showForDisabled:!0}))):null)),c().createElement(rh,{open:!!m,onClose:()=>f(null),onConfirm:()=>{return e=m,d((t=>(0,N.without)([e],t))),void((0,N.isNil)(t[e])||a(e));var e}}))},Tf=(0,T.Z)({root:e=>{let{isOpaque:t}=e;return{display:"flex",opacity:t?1:.19,transition:"opacity 0.3s"}},header:{width:"100%",display:"flex",alignItems:"center",height:"28px"},focusedIcon:e=>{let{isFocused:t}=e;return{width:"26px","&:not([disabled])":{border:"1px solid rgba(0, 0, 0, 0.12)"},height:"28px",color:t?"#000":"rgba(0, 0, 0, 0.54)",borderRadius:0,margin:"0px 1px"}},crosswalkWrapper:{width:"100%",overflow:"hidden"},sourceIcon:{height:"16px",width:"16px",marginRight:"9px",fontSize:"14px"},attributesWrapper:e=>{let{color:t}=e;return{border:"1px solid",borderColor:t,position:"relative"}},deleteCrosswalkButton:{position:"absolute",top:5,right:5},labelValue:{marginLeft:5,marginRight:8},dependentIcon:{width:"16px",height:"16px",fillOpacity:.38}}),Sf=(0,s.memo)((e=>{let{crosswalk:t,isDependent:r,isEmpty:n=!1,isColored:a=!0,focusable:l=!0,disableEdit:o,disableDelete:i,onDelete:p,onEdit:d}=e;const m=(0,s.useRef)(null),f=_m(t),{toggleCrosswalkFocus:b,isFocused:y}=Um(t),E=n?"#FFF":a?f:"#CACCD1",{isDimmed:w,highlightCrosswalk:O,removeHighlight:C}=Vm(t),[T]=Mm(),S=Tf({color:E,isOpaque:!w,isFocused:y}),[k,N]=(0,s.useState)(!1),[I,P]=(0,s.useState)(!1),D=(0,g.useSelector)(h.ZP.selectors.getMetadata),A=(0,u.tH7)(D,t.type),R=(0,u.nIW)(t.uri),j=(0,u.x_)(t),[,Z,L]=(0,Tn.useDrag)({item:{type:"Crosswalk",crosswalk:t},canDrag:!j}),_=!j&&"relation"!==t.ownerType;return(0,s.useEffect)((()=>{L((0,ff.r)(),{captureDraggingState:!0})}),[]),(0,s.useEffect)((()=>{var e;l&&T&&(0,u.aFF)(T,t)&&T!==t&&(null==m||null===(e=m.current)||void 0===e||e.scrollIntoView({behavior:"smooth"}))}),[T]),c().createElement("div",{className:S.root,ref:m},c().createElement(be.k,{size:"XXS",className:S.focusedIcon,icon:l&&Bm.Z,onClick:()=>b(),disabled:!l,tooltipTitle:l&&x().text("Focus")}),c().createElement("div",{className:S.crosswalkWrapper},c().createElement(Lh,{ref:Z,className:S.header,color:E,variant:j?"outlined":"filled",onMouseEnter:()=>O(),onMouseLeave:()=>C()},r&&c().createElement(hf.Z,{className:S.dependentIcon}),c().createElement(Ut,{onClick:()=>N((e=>!e)),expanded:k}),c().createElement(hm,{className:S.sourceIcon,sourceType:t.type}),c().createElement(pi.C,{value:A},c().createElement(v.Z,{variant:"body2",noWrap:!0},A)),c().createElement(fm.Z,null),c().createElement(pi.C,{value:t.value},c().createElement(v.Z,{variant:"body2",className:S.labelValue,noWrap:!0},t.value))),k&&c().createElement("div",{className:S.attributesWrapper},_&&c().createElement("div",{className:S.deleteCrosswalkButton},c().createElement(be.k,{icon:ta.Z,disabled:i,onClick:()=>P(!0),size:"XS",tooltipTitle:x().text("Delete crosswalk"),showForDisabled:!0}),c().createElement(rh,{open:I,onConfirm:()=>{y&&b(),p(R)},onClose:()=>P(!1)})),c().createElement(Cf,{crosswalk:t,canEditAttribute:!o,onEditAttribute:(e,t)=>{d({crosswalkId:R,attributeName:e,value:t})},onDeleteAttribute:e=>{d({crosswalkId:R,attributeName:e})}}))))})),kf=(0,T.Z)((()=>({root:{display:"flex",alignItems:"center",height:"28px",paddingLeft:"37px"}}))),Nf=e=>{let{showMore:t,onClick:r}=e;const n=kf();return c().createElement(ge.Z,{className:n.root,component:"button",variant:"caption",underline:"none",onClick:r},c().createElement("span",null,t?x().text("View dependent crosswalks"):x().text("Hide dependent crosswalks")))},If=e=>{let{source:t,crosswalksByTypes:r,showCrosswalkColors:n=!0,crosswalksFocusEnabled:a=!0,expanded:l,disableEditCrosswalk:o,disableDeleteCrosswalk:i,onEdit:p,onDelete:d,onToggleExpanded:m}=e;const g=Mm();return(0,s.useEffect)((()=>{!l&&a&&r[df.Dependent].some((e=>g.some((0,u.aFF)(e))))&&m()}),[g]),c().createElement(c().Fragment,null,0===r[df.Simple].length&&0===r[df.Empty].length&&c().createElement(gf,{crosswalkType:t,focusable:a}),r[df.Simple].map((e=>c().createElement(Sf,{key:e.uri,crosswalk:e,focusable:a,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),r[df.Empty].map((e=>c().createElement(Sf,{key:e.uri,crosswalk:e,focusable:a,isEmpty:!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),l&&r[df.Dependent].map((e=>c().createElement(Sf,{key:e.uri,crosswalk:e,isDependent:!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,focusable:a,isColored:n}))),r[df.Dependent].length>0&&c().createElement(Nf,{showMore:!l,onClick:()=>m()}))},Pf=(0,T.Z)({caption:{paddingLeft:15,paddingTop:16,paddingBottom:8},controlButtons:{display:"flex",justifyContent:"flex-end",paddingBottom:10,paddingTop:20},cancelButton:{marginRight:20}}),Df=e=>{let{className:t,onAdd:r,onClose:n}=e;const a=Pf(),[l,o]=(0,s.useState)({type:"",value:""});return c().createElement("div",{className:t},c().createElement(v.Z,{variant:"body1",className:a.caption},x().text("Add crosswalk")),c().createElement(Cf,{crosswalk:l,onDeleteAttribute:e=>{o((0,N.dissoc)(e))},onEditAttribute:(e,t)=>{o((0,N.assoc)(e,t))}}),c().createElement("div",{className:a.controlButtons},c().createElement(Ze.Z,{className:a.cancelButton,onClick:n},x().text("Cancel")),c().createElement(Ze.Z,{color:"primary",onClick:()=>{r(l),n()},disabled:!l.type||!l.value},x().text("Add"))))},Af=e=>e[df.Simple].length>0?1:e[df.Dependent].length>0?e[df.Empty].length>0?2:3:4,Rf=(0,N.evolve)({[df.Dependent]:(0,N.sort)(((e,t)=>{const r=e.sourceTable||"",n=t.sourceTable||"";return r===n?0:r?n?r<n?-1:1:-1:1}))}),jf=(0,N.curry)(((e,t,r)=>{const n=(r||[]).reduce(((r,n)=>(r[n.type]||(r[n.type]={[df.Simple]:[],[df.Empty]:[],[df.Dependent]:[]}),"relation"===n.ownerType?r[n.type][df.Dependent].push(n):((e,t,r)=>0===(0,u.sJj)(r).filter((r=>{const n=(0,u.AFK)(r,e);return t.some((0,N.propEq)("uri",n))})).length)(e,t,n)?r[n.type][df.Empty].push(n):((e,t,r)=>!(0,u.sJj)(r).some((r=>{const n=(0,u.AFK)(r,e),a=t.find((0,N.propEq)("uri",n));return a&&!(0,u.YkM)(a)})))(e,t,n)?r[n.type][df.Dependent].push(n):r[n.type][df.Simple].push(n),r)),{});return Object.keys(n).sort(((e,t)=>Af(n[e])-Af(n[t])||(e<t?-1:1))).map((e=>({source:e,crosswalksByTypes:Rf(n[e])})))}));var Zf=r(17871);const Lf=e=>{let{children:t,className:r,position:n,map:a}=e;const[l,o]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=document.createElement("div"),t=a.controls[n].length;return a.controls[n].push(e),o(e),()=>{a.controls[n].removeAt(t)}}),[a,n]),(0,s.useEffect)((()=>{l&&r&&l.classList.add(r)}),[r,l]),l?(0,Ad.createPortal)(t,l):null};var _f=r(41039);const Mf="circle",Vf="polygon",Uf=.001;function Bf(){return Bf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bf.apply(this,arguments)}const zf=e=>c().createElement("svg",Bf({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("path",{d:"M10.61 8.568A1.666 1.666 0 119.432 7.39l3.656-3.657a6.668 6.668 0 101.179 1.179L10.61 8.568zm-7.503 6.325A8.333 8.333 0 1114.893 3.107 8.333 8.333 0 013.107 14.893z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd",opacity:.54}));function Ff(){return Ff=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ff.apply(this,arguments)}const Hf=e=>c().createElement("svg",Ff({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().createElement("path",{d:"M18.29 11.44a1.49 1.49 0 012.12 0l1.15 1.15c.59.58.59 1.53 0 2.12L16.27 20H13v-3.27zM18.174 4c0 1.71-.26 3.285-.932 4.563-.946 1.798-2.609 2.724-4.906 2.46l-.855-.116c-4.382-.544-6.626.53-6.626 3.609 0 1.968 1.105 2.924 3.267 3.304.692.121 1.306.165 2.234.176L11 18v2l-.698-.003c-1.016-.013-1.71-.063-2.526-.206-3.018-.53-4.921-2.176-4.921-5.274 0-4.819 3.71-6.378 9.52-5.505 1.575.237 2.506-.255 3.098-1.38.451-.858.666-2.02.697-3.307L16.174 4h2zM18 13.97l-3.45 3.45v1.03h1.03L19.03 15 18 13.97z",id:"Draw_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#Draw_svg__a"})),c().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},c().createElement("path",{d:"M0 0h24v24H0z"})))),Wf=(0,T.Z)({container:{margin:"2px",display:"flex",alignItems:"center"},button:{color:"rgba(0,0,0,0.54)",padding:0,height:"24px",width:"24px",minWidth:0},icon:{width:"20px",height:"20px"}}),qf=(0,nt.Z)(Ze.Z),Gf=e=>{let{drawingMode:t,drawingModes:r=[],hasActiveOverlay:n,onDrawingModeChanged:a,onClearOverlay:l}=e;const o=Wf(),i=e=>()=>{a(e)};return c().createElement("div",{className:o.container},t||n?c().createElement(qf,{tooltipTitle:x().text("Clear area"),className:o.button,onClick:n?l:i(null)},c().createElement(_f.Z,{className:o.icon})):r.map((e=>{const t=(e=>{switch(e){case Mf:return zf;case Vf:return Hf;default:return null}})(e);return c().createElement(qf,{tooltipTitle:x().text("Draw area"),key:e,className:o.button,onClick:i(e)},c().createElement(t,{className:o.icon}))})))},$f=(0,T.Z)({container:{height:"28px",marginRight:"7px",marginLeft:0},label:{fontSize:"11px",alignSelf:"center",lineHeight:"13px",marginLeft:"2px",letterSpacing:0},checkbox:{width:"20px",height:"20px",padding:"5px","& svg":{width:"16px",height:"16px"}}}),Kf=e=>{let{isSearchOnMapMove:t,onChangeIsSearchOnMapMove:r}=e;const n=$f();return c().createElement(Dr.Z,{classes:{root:n.container,label:n.label},control:c().createElement(Pr.Z,{checked:t,onChange:e=>{r(e.target.checked)},color:"primary",className:n.checkbox}),label:x().text("Search as I move the map")})},Yf=e=>{const t=e.getBounds(),r=t.getNorthEast(),n=t.getSouthWest(),a=r.lat(),l=r.lng(),o=n.lat(),i=n.lng(),s=[],c=[];if(!(180===l&&-180===i||-180===l&&180===i)){const e=t.getCenter();s.push([a,e.lng()]),c.push([o,e.lng()])}return[[a,l],...s,[a,i],[o,i],...c,[o,l]]},Xf=e=>{switch(e){case Mf:return window.google.maps.drawing.OverlayType.CIRCLE;case Vf:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},Qf=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((e=>{let{lat:t,lng:r}=e;return n.extend(new window.google.maps.LatLng(t,r))})),e.fitBounds(n)}},Jf=c().createContext({});Jf.displayName="EntityMarkerContext";const eb=(0,T.Z)({popper:{maxWidth:"263px",minWidth:"150px",boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",backgroundColor:"white",borderRadius:"2px"}});function tb(){return tb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tb.apply(this,arguments)}const rb=(0,u.m5F)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large (hover)</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large-(hover)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.32" cx="11" cy="28.5" rx="6" ry="4.66666667"></ellipse>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n <path d="M20,2 L20,20 L14.755,20 L14.6905172,20.0815309 C14.3562717,20.5012516 14.0578656,20.8886742 13.7817711,21.2616986 L13.5786724,21.5390469 C11.92787,23.8181606 11.079024,25.6311217 11.0052669,27.2674145 L11.0052669,27.2674145 L11,27.5 L10.9968324,27.3203844 C10.9285422,25.3781621 9.75347502,23.1598866 7.22124201,20.0010865 L2,20 L2,2 L20,2 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" mask="url(#mask-3)"></path>\n </g>\n</svg>'),nb=(0,u.m5F)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M20,1 C20.5522847,1 21,1.44771525 21,2 L21,20 C21,20.5522847 20.5522847,21 20,21 L15.2374606,21.0021908 C14.9306693,21.3935449 14.6510143,21.7632851 14.3885453,22.1256523 C12.8309725,24.2760522 12,26.0137017 12,27.5 C12,28.0522847 11.5522847,28.5 11,28.5 C10.4477153,28.5 10,28.0522847 10,27.5 C10,25.7886708 8.84033182,23.6810997 6.73798027,21.0014567 L2,21 C1.44771525,21 1,20.5522847 1,20 L1,2 C1,1.44771525 1.44771525,1 2,1 L20,1 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.12" cx="11" cy="28.5" rx="4.5" ry="3.5"></ellipse>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="Path-3" fill="#FFFFFF"></path>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" fill-rule="nonzero" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n </g>\n</svg>'),ab=(0,s.memo)((e=>{let{marker:t,onClick:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const a=eb(),l=(0,s.useRef)(),[o,i]=(0,s.useState)(!1),{activeEntityUri:p}=(0,s.useContext)(Jf),d=(0,N.pathEq)(["entity","uri"],p,t),m={lat:t.point.lat,lng:t.point.lng},g=(0,s.useCallback)((0,u.DsO)(i,50),[]),h=(0,s.useCallback)((()=>g(!0)),[g]),f=(0,s.useCallback)((()=>g(!1)),[g]),b=(0,s.useCallback)((()=>r(t)),[r,t]);return c().createElement(c().Fragment,null,c().createElement(Ge.Z,{anchorEl:l.current,open:o,className:a.popper,modal:!1,placement:"top"},c().createElement(Op,{entity:t.entity,onMouseOver:h,onMouseOut:f})),c().createElement(Zf.Jx,tb({icon:{url:o||d?rb:nb,scaledSize:new google.maps.Size(22,32)},position:m,onClick:b,visible:!1!==t.visible,onMouseOver:h,onMouseOut:f},n)),c().createElement(Zf.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:m},c().createElement("span",{ref:l})))})),lb={CIRCLE:"circle",POLYGON:"polygon"},ob={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},ib=.001,sb=(0,T.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});var cb=r(90690);function ub(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pb=["drawing"],db=e=>{let{markers:t=[],mapKey:r,defaultZoom:n,defaultCenter:a,loadingElement:l,isSearchOnMapMove:o,isSearchEnabled:i,activeOverlay:u,overlayOptions:p,drawingModes:d=[],markerClusterer:m,markerClustererOptions:g,mapContainerClassName:h,onMapBoundsChanged:f,onOverlayUpdated:b,onMarkerClicked:y}=e;const x=sb(),{isLoaded:E,loadError:v}=(0,Zf.Ji)({googleMapsApiKey:r,libraries:pb}),w=(0,s.useRef)(null),[O,C]=(0,s.useState)(null),[T,S]=(0,s.useState)(null),[k,I]=(0,s.useState)(null);(e=>{let{markers:t,activeOverlay:r,isSearchOnMapMove:n,map:a}=e;const l=(0,cb.D)(t),o=(0,cb.D)(r),i=a&&window.google;(0,s.useEffect)((()=>{i&&!n&&t.length&&t!==l?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const e=n.getCenter();n.extend(new window.google.maps.LatLng(e.lat()+Uf,e.lng()+Uf)),n.extend(new window.google.maps.LatLng(e.lat()-Uf,e.lng()-Uf))}t.fitBounds(n),r&&Qf(t,r,n)})(t,a,r):i&&r&&r!==o&&Qf(a,r)}),[a,t,r])})({markers:t,activeOverlay:u,map:O,isSearchOnMapMove:o});const P=(0,s.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ub(e,t,r[t])}))}return e}({},ob,p||{})),[p]),D=(0,s.useCallback)((e=>{f(e?Yf(O):null),I(null),clearTimeout(w.current)}),[O,f]),A=(0,s.useCallback)((()=>{clearTimeout(w.current)}),[]),R=(0,s.useCallback)((()=>{o&&f(Yf(O))}),[o,O,f]),j=(0,s.useCallback)((()=>{o&&(clearTimeout(w.current),w.current=setTimeout(R,1e3))}),[R,o]),Z=(0,s.useCallback)(((e,t)=>{const r=t||T&&{type:lb.POLYGON,overlay:T};if(!(0,N.isEmpty)(r)&&"function"==typeof b){const{overlay:e,type:t}=r,n={[lb.POLYGON]:()=>e.getPath().getArray().map((e=>[e.lat(),e.lng()])),[lb.CIRCLE]:()=>({radius:e.getRadius()/1e3,center:e.getCenter()})},a=n[t]&&n[t]();a&&b({data:a,type:t})}}),[b,T]),L=(0,s.useCallback)((e=>t=>{Z(null,{type:e,overlay:t}),t.setMap(null),I(null)}),[Z]),_=(0,s.useCallback)((()=>{b(null)}),[b]),M=e=>t.filter((0,N.prop)("point")).map((t=>c().createElement(ab,{key:t.id,marker:t,clusterer:e,onClick:y})));return v?null:E?c().createElement(Zf.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:{mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},onLoad:C,zoom:n,center:a,onZoomChanged:A,onDragStart:A,onIdle:j,mapContainerClassName:h},O&&i&&Boolean(d.length)&&c().createElement(Lf,{className:x.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:O},c().createElement(Gf,{hasActiveOverlay:!!u,drawingModes:d,drawingMode:k,onDrawingModeChanged:I,onClearOverlay:_})),O&&i&&c().createElement(Lf,{className:x.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:O},c().createElement(Kf,{onChangeIsSearchOnMapMove:D,isSearchOnMapMove:o})),m?(V=g,c().createElement(Zf.XL,{options:V},M)):M(),!Xf(k)&&u&&(0,N.propEq)("type",lb.POLYGON,u)&&c().createElement(Zf.mg,{onLoad:S,path:u.path,editable:!0,options:P,onMouseUp:Z,onDragEnd:Z}),i&&Boolean(d.length)&&c().createElement(Zf.j_,{onPolygonComplete:L(lb.POLYGON),onCircleComplete:L(lb.CIRCLE),drawingMode:Xf(k),options:{drawingControl:!1,circleOptions:P,polygonOptions:P}})):l;var V},mb=e=>{let{entity:t,historyEvent:r}=e;const[n,a]=(0,s.useState)(!1),l=(0,g.useSelector)(h.ZP.selectors.getHistorySlice),o=(0,g.useDispatch)(),i=(0,yt._)(),{aStamp:c,bStamp:p,overrideUri:d}=r||{},m=d||(null==t?void 0:t.uri);return(0,s.useEffect)((()=>{r&&m&&(a(!0),i(Promise.all([(0,u.lrH)(m,c),p&&1!==p?(0,u.lrH)(m,p):Promise.resolve(null)])).then((e=>{let[t,r]=e;o(h.N5.history.actions.setHistorySlice({aEntity:t,bEntity:r}))})).catch((e=>{console.warn("Failed to load entity slice",e)})).finally((()=>{a(!1)})))}),[c,p,m]),{isLoading:n,historySlice:l}};let gb;!function(e){e.UPDATE="UPDATE",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(gb||(gb={}));var hb=r(39034);const fb=e=>(0,N.pipe)((0,N.map)(e),(0,N.join)(" or ")),bb=e=>{const[t,r]=e;return tn()().subtract(t,r).valueOf()},yb=(0,N.chain)((0,N.cond)([[(0,N.equals)(gb.MERGE),()=>[l.I.ENTITIES_MERGED,l.I.ENTITIES_MERGED_MANUALLY,l.I.ENTITIES_MERGED_ON_THE_FLY]],[(0,N.equals)(gb.UNMERGE),()=>[l.I.ENTITIES_SPLITTED]],[(0,N.equals)(gb.UPDATE),()=>[l.I.ENTITY_CHANGED]]])),xb=(0,N.pipe)((0,N.defaultTo)([]),yb,(0,N.concat)([l.I.ENTITY_CREATED,l.I.ENTITY_REMOVED,l.I.ENTITY_LOST_MERGE]),fb((e=>`equals(type, '${e}')`))),Eb=(0,N.pipe)((0,N.defaultTo)({}),(0,N.reject)(u.O27),(0,N.evolve)({users:fb((e=>`equals(user, '${(0,u.HRH)(e)}')`)),attributes:fb((e=>`changes(${(0,u.HRH)(e.value)})`)),dateRange:e=>{let{type:t,period:r}=e;switch(t){case hb.K.WITHIN:return`gte(timestamp, ${bb(r)})`;case hb.K.AGO:return`lte(timestamp, ${bb(r)})`;case hb.K.BETWEEN:{const[e,t]=r;return`gte(timestamp, ${e.valueOf()}) and lte(timestamp, ${tn()(t).endOf("date").valueOf()})`}default:return""}}}),(0,N.over)((0,N.lensProp)("activities"),xb),N.values,(0,N.reject)(u.O27),(0,N.append)("not equals(user, 'collaboration-service')"),(0,N.map)((e=>`(${e})`)),(0,N.join)(" and "));function vb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wb(e,t,r[t])}))}return e}function wb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ob=e=>{let{entity:t,enabled:r}=e;const[n,a]=(0,s.useState)({activities:[gb.MERGE,gb.UNMERGE,gb.UPDATE]}),[l,o]=(0,s.useState)(0),i=(0,s.useMemo)((()=>Eb(n)),[n]),[c,p]=(0,s.useState)(null),[d,m]=(0,s.useState)(null),[g,h]=(0,s.useState)(!1),f=(0,yt._)(),b=null==t?void 0:t.uri,y={max:32,order:"desc"},x=(0,u.O27)(null==n?void 0:n.attributes)||void 0;(0,s.useEffect)((()=>{b&&r&&(h(!0),f((0,u.kgP)(vb({entityUri:b,historicUris:c,filter:i,showAll:x},y))).then(m).catch((e=>{console.warn("Failed to load history data",e),m(null)})).finally((()=>{h(!1)})))}),[i,x,c]),(0,s.useEffect)((()=>{b&&r&&(h(!0),f((0,u.wdF)({entityUri:b})).then((e=>{p(e)})).catch((e=>{console.warn("Failed to load history data",e),p(null)})).finally((()=>{h(!1)})),o(0))}),[b,null==t?void 0:t.updatedTime,r]);const E=(0,s.useCallback)((e=>{b&&c&&r&&(h(!0),f((0,u.kgP)(vb({entityUri:b,historicUris:c,filter:i,showAll:x,offset:e},y))).then((e=>{m((t=>vb({},t,{changes:[...null==t?void 0:t.changes,...e.changes]})))})).catch((e=>{console.warn("Failed to load history data",e)})).finally((()=>{h(!1)})))}),[c,i,r]),v=(0,s.useMemo)((()=>32*(l+1)<(null==d?void 0:d.total)),[d,l]),w=(0,s.useCallback)((e=>{o(0),a(e)}),[]),O=(0,s.useCallback)((()=>{v&&(E(32*(l+1)),o(l+1))}),[E,l,v]);return{isLoading:g,canLoadMore:v,onLoadMore:O,onApplyFilter:w,historicUris:c,historyWithTotal:d,historyFilter:n}},Cb={appearance:{},attributes:{},roles:[],tags:[]},Tb=(0,N.evolve)({refEntity:u.VGB,refRelation:u.VGB}),Sb=e=>e?(0,N.evolve)({attributes:(0,N.map)((0,N.map)(Tb))})(e):e,kb=()=>{const e=(0,g.useDispatch)(),t=(0,g.useSelector)(h.ZP.selectors.getHistorySlice),r=(0,g.useSelector)(h.ZP.selectors.getHistoryDiff),n=(0,g.useSelector)(h.ZP.selectors.getHistoryMode),a=(0,g.useSelector)(h.ZP.selectors.getEntity);return(0,s.useEffect)((()=>{if(t){const{aEntity:r,bEntity:l}=t,o=u.nwO.HistoryManager.createHistoryManager(u.nwO.AttributesDiff).computeEntityHistoryDiff(Sb(n===h.Z9.Current?a:l),Sb(r));e(h.N5.history.actions.setHistoryDiff(o))}}),[t,n,e,a]),r||Cb};var Nb=r(57312);const Ib=(0,T.Z)((()=>({historyRow:{position:"relative",padding:"8px 12px 16px",cursor:"pointer"},selected:{background:"rgba(0,0,0,0.05)","&:before":{content:'""',background:"rgba(0,0,0,0.05)",width:"100%",height:"100%",position:"absolute",left:"-100%",top:0}},rowHeader:{display:"flex",position:"relative"},badge:e=>{let{color:t}=e;return{position:"absolute",width:"2px",height:"100%",left:"-9px",pointerEvents:"none",background:t,"&:before":{height:"100%",width:"3px",content:'""',left:"-3px",background:t,position:"absolute",opacity:.06}}},title:{color:"rgba(0,0,0,0.87)",fontSize:"13px",letterSpacing:0,lineHeight:"16px",fontWeight:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&.bold":{fontWeight:500}},date:{marginLeft:"auto",color:"rgba(0,0,0,0.54)",fontSize:"11px",letterSpacing:0,lineHeight:"16px"},user:{color:"rgba(0,0,0,0.38)",fontSize:"12px",letterSpacing:0,lineHeight:"14px"}}))),Pb=e=>{let{change:t,isCurrent:r,isSelected:n,onClick:a}=e;const{uri:l,type:o,matchGroups:i,user:s,timestamp:p}=t,d=(0,u.GtP)(l),m=Ib({color:d});return c().createElement("div",{className:b()(m.historyRow,{[m.selected]:n}),onClick:a},c().createElement("div",{className:m.rowHeader},c().createElement("div",{className:m.badge}),c().createElement(v.Z,{className:b()(m.title,{bold:r})},r?x().text("Current view"):(0,Nb.Xr)(o)),!r&&c().createElement(v.Z,{className:m.date},x().date(p,"L LT"))),i&&c().createElement(v.Z,{className:m.title},x().text("Match rule:")," ",i.join(", ")),c().createElement(v.Z,{className:m.user},s))};function Db(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ab;!function(e){e.FAKE_NAVIGATE_PROFILE="FAKE_NAVIGATE_PROFILE",e.FAKE_FILTERED_INCOMING="FAKE_FILTERED_INCOMING",e.FAKE_FILTERED_OUTGOING="FAKE_FILTERED_OUTGOING",e.FAKE_UPDATE="FAKE_UPDATE"}(Ab||(Ab={}));const Rb=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Db(e,t,r[t])}))}return e}({},l.I,Ab),jb=e=>e===Rb.FAKE_FILTERED_INCOMING||e===Rb.FAKE_FILTERED_OUTGOING,Zb=e=>{let{x:t,y:r,toX:n,toY:a,color:l,isDashed:o}=e;const i=((e,t,r,n)=>{const a=t>n,l=e<r,o=a?-6:6;return`M${e} ${t} L${l?r-12:r+12} ${t} ${l?`c 6 0 12 ${o} 12`:`c -6 0 -12 ${o} -12`} ${a?-12:12} L${r} ${n}`})(t,r,n,a);return c().createElement("path",{d:i,stroke:l,strokeWidth:2,fill:"none",strokeDasharray:o?"3,3":void 0})},Lb=e=>{let{x:t,y:r,color:n,isDashed:a,isCollapsed:l,showCollapseIcon:o,showLine:i}=e;const s=o?6:3;return c().createElement("g",null,i&&c().createElement("rect",{id:"line",x:t-s-4,y:r-s-4,width:2*s+8,height:2,fill:n}),c().createElement("circle",{cx:t,cy:r,r:s,fill:a?"#fff":n,stroke:n,strokeDasharray:a?"1,1":void 0,strokeWidth:2}),o&&c().createElement("g",{id:"icon"},c().createElement("rect",{x:t-4,y:r-1,width:8,height:2,fill:"#fff"}),l&&c().createElement("rect",{x:t-1,y:r-4,width:2,height:8,fill:"#fff"})))},_b=(0,s.memo)((e=>{let{graphData:t}=e;const{historyLanes:r,rows:n}=t,a=[16],{links:l,rowLines:o,circles:i}=n.reduce(((e,t,l)=>{let{uri:o,height:i,uris:s,type:p,index:d}=t;const m=16*r[o].index+24,g=a[l];a.push(g+i);const h=jb(p),f=h?s[0]:o,b=!(null!=s&&s.some((e=>r[e])));e.circles.push(c().createElement(Lb,{key:`circle-${f}-${l}`,x:m,y:g,color:(0,u.GtP)(f),isDashed:h,isCollapsed:b,showCollapseIcon:!!s,showLine:p===Rb.FAKE_NAVIGATE_PROFILE})),e.rowLines.push(c().createElement("rect",{key:`${f}-${d}`,x:m,y:g-8,width:"100%",height:16,fill:(0,u.GtP)(f),opacity:.06}));const y=p===Rb.ENTITIES_SPLITTED;return null==s||s.forEach((t=>{const a=r[t];if(!a)return;const o=n[l].height,i=16*a.index+24,s=y?g-o:g+o;m!==i&&e.links.push(c().createElement(Zb,{key:`link-${t}-${d}`,x:m,y:g,toX:i,toY:s,isDashed:jb(p),color:(0,u.GtP)(t)}))})),e}),{links:[],circles:[],rowLines:[]}),s=16*Object.keys(r).length+24,p=a[a.length-1]-16;return Object.entries(r).forEach((e=>{let[t,r]=e;const o=16*r.index+24;r.lifeTime.forEach(((e,s)=>{var d;let{start:m,end:g}=e;if((null===(d=n[null==g?void 0:g.index])||void 0===d?void 0:d.type)===Rb.ENTITIES_SPLITTED)return;const h=a[null==m?void 0:m.index]||p,f=a[(null==g?void 0:g.index)+1]||16,b=(0,u.GtP)(t);!g&&r.index>0&&i.push(c().createElement(Lb,{key:`initCircle-${t}-${s}`,x:o,y:f,color:b,showLine:!0})),l.push(c().createElement("path",{key:`line-${t}-${s}`,d:`M${o} ${h} L${o} ${f}`,stroke:b,strokeWidth:2}))}))})),c().createElement("svg",{className:"chart",width:s,height:p},c().createElement("g",{id:"rowLines"},o),c().createElement("g",{id:"links"},l),c().createElement("g",{id:"circles"},i))})),Mb=(0,T.Z)({historyTree:{display:"grid",gridTemplateColumns:"auto 1fr",overflowY:"auto"},graph:{overflowX:"scroll",overflowY:"hidden"},history:{minWidth:344},buttonContainer:{gridColumnStart:1,gridColumnEnd:3,padding:"8px 16px"},shadow:{boxShadow:"inset -8px 0px 5px -5px rgba(0,0,0,0.1)"}});function Vb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ub=e=>{let{historyData:t,isLoading:r,canLoadMore:n,onLoadMore:a,entityUri:l,historyEvent:o,findPreviousChange:i}=e;const p=Mb(),d=(0,g.useDispatch)(),m=(0,g.useSelector)(h.ZP.selectors.getIsEditableMode),[f,y]=(0,s.useState)({historyLanes:{},rows:[]}),[E,v]=(0,s.useState)(!1),[w,O]=(0,s.useState)(-1);(0,s.useEffect)((()=>{if((0,N.isNil)(o))return void O(0);const e=e=>(null==e?void 0:e.uri)===((null==o?void 0:o.overrideUri)||l)&&(null==e?void 0:e.timestamp)===(null==o?void 0:o.aStamp),r=-1!==w?t.rows[w]:null,n=t.rows.findIndex((t=>e(t)));O(e(r)?w:n)}),[t.rows,o]);const C=(0,s.useRef)(null),T=(0,s.useCallback)((e=>{if(!(0,N.isNil)(e)){var r;const n=null===(r=t.rows)||void 0===r?void 0:r.map(((t,r)=>{var n;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Vb(e,t,r[t])}))}return e}({},t,{height:null===(n=e.childNodes[r])||void 0===n?void 0:n.clientHeight})}));y({historyLanes:t.historyLanes,rows:n})}}),[t]),S=()=>{const{scrollWidth:e,clientWidth:t,scrollLeft:r}=(null==C?void 0:C.current)||{};v(r<e-t)};return c().createElement("div",{className:p.historyTree},r&&c().createElement(Pn,null),c().createElement("div",{className:b()(p.graph,{[p.shadow]:E}),onScroll:S,ref:C},c().createElement(_b,{graphData:f}),c().createElement(vr.Z,{handleWidth:!0,onResize:S})),c().createElement("div",{ref:T,className:p.history},t.rows.map(((e,t)=>{const r=t===w,n=0===t;return c().createElement(Pb,{key:`row-${t}`,change:e,isCurrent:n,isSelected:r,onClick:()=>((e,t,r,n)=>{if(m){if(!window.confirm(x().text("Are you sure you want to go in history mode? All your changes will be lost.")))return;d(h.N5.mode.actions.modeUpdated(u.ARY.Viewing))}if(n&&!r||!n&&r)d(h.N5.history.actions.clearHistoryEvent()),O(0);else if(!n&&!r){const r=i(e-1,t.uri||l),n=i(e,t.uri||l),a=null==r?void 0:r.timestamp,o=null==n?void 0:n.timestamp,s=(null==t?void 0:t.uri)===l?null:null==t?void 0:t.uri;d(h.N5.history.actions.setHistoryEvent({aStamp:a,bStamp:o,overrideUri:s})),O(e)}})(t,e,r,n)})}))),n&&c().createElement("div",{className:p.buttonContainer},c().createElement(Ze.Z,{color:"primary",onClick:()=>a()},x().text("Show more"))))},Bb=(0,T.Z)({root:{flex:1,display:"flex",flexWrap:"wrap",padding:"10px 15px"}}),zb=(0,T.Z)({icon:e=>{let{color:t}=e;return{boxSizing:"border-box",borderWidth:2,borderStyle:"solid",borderColor:t,height:12,width:12,borderRadius:30,transition:"opacity 0.3s",margin:4}},active:e=>{let{color:t}=e;return{backgroundColor:t}},inactive:{backgroundColor:"white"},clickable:{cursor:"pointer"}}),Fb=e=>{let{value:t,isSelected:r=!0,onClick:n}=e;const a=(0,u.GtP)(t),l=zb({color:a});return c().createElement("div",{className:b()(l.icon,{[l.inactive]:!r,[l.active]:r,[l.clickable]:!!n}),onClick:n})},Hb=e=>{let{values:t,selectedValues:r,entityUri:n,onSelectValues:a,className:l}=e;const o=Bb();return c().createElement("div",{className:b()(o.root,l)},c().createElement(Fb,{value:n}),(null==t?void 0:t.length)>0&&t.map((e=>c().createElement(Fb,{key:e,value:e,isSelected:null==r?void 0:r.includes(e),onClick:()=>(e=>{null!=r&&r.includes(e)?a((0,N.without)([e],r)):a([...r||[],e])})(e)}))))};function Wb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qb=(e,t)=>e.reduce(((e,r,n)=>{let{start:a,end:l}=r;if(a){const r=t-a.timestamp;((0,N.isNil)(e.startDistance)||Math.abs(e.startDistance)>Math.abs(r)&&r>0)&&(e.startIndex=n,e.startDistance=r)}if(l){const r=t-l.timestamp;((0,N.isNil)(e.endDistance)||Math.abs(e.endDistance)>Math.abs(r)&&r<0)&&(e.endIndex=n,e.endDistance=r)}return e}),{startIndex:null,endIndex:null,startDistance:null,endDistance:null}),Gb=(0,T.Z)({root:{display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},borderBottom:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"}}),$b=(0,s.memo)((e=>{let{isLoading:t,historyWithTotal:r,contributorsUris:n,entityUri:a,canLoadMore:l,onLoadMore:o,historyEvent:i}=e;const u=Gb(),[p,d]=(0,s.useState)(null);(0,s.useEffect)((()=>{d(n)}),[n]);const{historyData:m,findPreviousChange:g}=(e=>{let{entityUri:t,historyChanges:r,selectedUris:n}=e;return(0,s.useMemo)((()=>{const e={[t]:{index:0,lifeTime:[]}},a=[{type:Rb.FAKE_UPDATE,user:"",timestamp:0,uri:t}],l=(0,N.curry)(((e,r)=>{const n=r.uri||t;if(Array.isArray(e)){if(r.type!==Rb.ENTITY_LOST_MERGE)return null;if(e.includes(n))return r;if(r.uris)return e.some((e=>r.uris.includes(e)))?r:null}else{var a;if(n===e||null!==(a=r.uris)&&void 0!==a&&a.includes(e))return r}return null})),o=(e,t)=>(0,N.pipe)((0,N.slice)(0,e-1),N.reverse,(0,N.find)(l(t)))(r),i=t=>{const r=e[t];return r||n&&!n.includes(t)||(e[t]={index:Object.keys(e).length,lifeTime:[]}),r},s=(e,t)=>{const r=e[e.length-1];!r||r.start&&(r.start.type!==Rb.ENTITY_CREATED||t.type!==Rb.ENTITIES_SPLITTED)?e.push({start:t,end:null}):r.start=t},c=(e,t)=>{let r=!0;if(e.length){const n=e[e.length-1];r=!((!n.start||n.start.timestamp<t.timestamp)&&(!n.end||n.end.timestamp>t.timestamp))}r&&e.push({start:null,end:null})},u=(e,t)=>{if(e.length){const r=e[e.length-1];r.start||(r.start=t)}e.push({start:null,end:t})},p=[];return null==r||r.forEach(((r,n)=>{var l;switch(r.type){case Rb.ENTITIES_SPLITTED:if(!o(n,r.uri||t))return;{const e=r.uri,t=r.uris?[r.uris,e]:[e],a=o(n,t);if(a&&(!e||e===a.uri))return}break;case Rb.ENTITY_LOST_MERGE:case Rb.RELATIONSHIP_CREATED:case Rb.RELATIONSHIP_REMOVED:case Rb.RELATIONSHIP_CHANGED:return}let d=!1;null===(l=r.uris)||void 0===l||l.forEach((e=>{i(e)||(d=!0)}));const m=i(r.uri||t);if(!m)return;const g=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Wb(e,t,r[t])}))}return e}({},r);((t,r)=>{var n,l;switch(r.type){case Rb.ENTITY_CREATED:s(t,r);break;case Rb.ENTITIES_MERGED_ON_THE_FLY:case Rb.ENTITY_CHANGED:c(t,r);break;case Rb.ENTITY_LOST_MERGE:case Rb.ENTITY_REMOVED:u(t,r);break;case Rb.ENTITIES_SPLITTED:c(t,r),null===(n=r.uris)||void 0===n||n.forEach((t=>{const n=e[t];if(!n)return;const l=n.lifeTime.length;l?s(n.lifeTime,r):u(n.lifeTime,r),a.push({type:l?Rb.FAKE_UPDATE:Rb.FAKE_NAVIGATE_PROFILE,uri:t,user:r.user,timestamp:r.timestamp})}));break;case Rb.ENTITIES_MERGED:case Rb.ENTITIES_MERGED_MANUALLY:c(t,r),null===(l=r.uris)||void 0===l||l.forEach((t=>{const n=e[t];n&&u(n.lifeTime,r)}))}})(m.lifeTime,g),d&&p.push(g),a.push(g)})),p.forEach((t=>{t.uris.forEach((n=>{e[n]||r.forEach((r=>{let{uri:l,uris:o,timestamp:i,user:s,type:c}=r;l===n&&(null==o||o.forEach((r=>{const n=e[r];if(!n)return;let l=null;switch(c){case Rb.ENTITIES_MERGED:case Rb.ENTITIES_MERGED_MANUALLY:l=Rb.FAKE_FILTERED_INCOMING;break;case Rb.ENTITIES_SPLITTED:l=Rb.FAKE_FILTERED_OUTGOING;break;default:return}const o={type:l,uri:t.uri,uris:[r],user:s,timestamp:i},u=qb(n.lifeTime,t.timestamp);l===Rb.FAKE_FILTERED_INCOMING?(0,N.isNil)(u.endIndex)||(n.lifeTime[u.endIndex].end=o):(0,N.isNil)(u.startIndex)||(n.lifeTime[u.startIndex].start=o),a.splice(a.indexOf(t),0,o)})))}))}))})),a.forEach(((e,r)=>{e.index=r,e.uri=e.uri||t})),{historyData:{historyLanes:e,rows:a},findPreviousChange:(e,t)=>(0,N.pipe)((0,N.slice)(e+1,1/0),(0,N.find)(l(t)))(a)}}),[t,r,n])})({entityUri:a,historyChanges:null==r?void 0:r.changes,selectedUris:p});return c().createElement("div",{className:u.root},c().createElement(Hb,{values:n,selectedValues:p,onSelectValues:d,entityUri:a,className:u.borderBottom}),c().createElement(Ub,{historyData:m,isLoading:t,onLoadMore:o,canLoadMore:l,entityUri:a,historyEvent:i,findPreviousChange:g}))}));var Kb=r(36444),Yb=r(15791),Xb=r(55234);const Qb=[hb.K.WITHIN,hb.K.AGO,hb.K.BETWEEN],Jb=e=>({[hb.K.WITHIN]:x().text("Within the last"),[hb.K.AGO]:x().text("More than"),[hb.K.BETWEEN]:x().text("Date range")}[e]||"");var ey=r(77875),ty=r(27446);const ry=(0,T.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},intervalContainer:{display:"flex",justifyContent:"space-between"},typeInput:{width:160,marginRight:10}}),ny=[null,null],ay=[null,"hours"],ly=e=>{let{value:t,onChange:r,className:n}=e;const a=ry(),l=e=>e===hb.K.WITHIN||e===hb.K.AGO,o=e=>e===hb.K.BETWEEN,i=o(null==t?void 0:t.type)?t.period:ny,u=l(null==t?void 0:t.type)?t.period:ay,[p,d]=(0,s.useState)(i),[m,g]=(0,s.useState)(u),h=(null==t?void 0:t.type)||hb.K.WITHIN,f=e=>l(e)?m:o(e)?p:void 0,y=e=>{r({type:h,period:e})};return(0,te.D)((()=>{t?l(t.type)?g(t.period):o(t.type)&&d(t.period):(d(ny),g(ay))}),[t]),c().createElement("div",{className:b()(a.root,n)},c().createElement(v.Z,{className:a.title,variant:"subtitle1"},x().text("Date")),c().createElement("div",{className:a.intervalContainer},c().createElement(_l.Z,{label:"",className:a.typeInput,value:{value:h,label:Jb(h)},options:Qb.map((e=>({value:e,label:Jb(e)}))),onChange:e=>{let{value:n}=e;(null==t?void 0:t.type)!==n&&r({period:f(n),type:n})}}),l(h)?c().createElement(ey.Z,{interval:m,onChange:y}):c().createElement(ty.Z,{values:p,onChange:y})))},oy=[gb.UPDATE,gb.MERGE,gb.UNMERGE];function iy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sy={input:e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iy(e,t,r[t])}))}return e}({},e,{fontSize:"14px"})},cy=(0,T.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},dropDownInput:{width:"100%",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.03)",borderTop:"4px"},valueContainer:{overflowY:"auto",height:44},option:{fontSize:"14px",height:"32px"}}),uy=e=>{let{selectedHistoryActivityTypes:t,onChange:r,className:n}=e;const a=cy(),l=e=>{return{value:e,label:(t=e,{[gb.UPDATE]:x().text("Update"),[gb.MERGE]:x().text("Merge"),[gb.UNMERGE]:x().text("Unmerge")}[t]||"")};var t},o=e=>e.map(l),i=o(oy);return c().createElement("div",{className:b()(a.root,n)},c().createElement(v.Z,{className:a.title,variant:"subtitle1"},x().text("Activity")),c().createElement(_p.Z,{value:o(t),onChange:(0,N.pipe)((0,N.defaultTo)([]),(0,N.pluck)("value"),r),options:i,TextFieldProps:{classes:{root:a.dropDownInput}},components:{DropdownIndicator:cc.Z},styles:sy,classes:a,menuPlacement:"bottom"}))},py=(0,T.Z)({icon:{margin:5},popup:{width:500,height:500,overflowY:"hidden"},filterContainer:{padding:20,height:410,overflowY:"auto"},filterItem:{marginTop:15},filterControls:{display:"flex",padding:"10px 12px 0",borderTop:"solid 1px rgba(0, 0, 0, 0.12)"},clearButton:{marginRight:"auto"},input:{height:"100%",paddingLeft:"12px",paddingRight:"8px"}});function dy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const my=e=>{let{filter:t,onApplyFilter:r,entityType:n}=e;const a=py(),[l,o]=(0,s.useState)(null),i=()=>o(null),[u,p]=(0,s.useState)(t),d=(0,N.curry)(((e,t)=>{p((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){dy(e,t,r[t])}))}return e}({},r,{[e]:t})))})),{activities:m=[],attributes:g=[],dateRange:h=null,users:f=[]}=u||{};return c().createElement(c().Fragment,null,c().createElement(Lt.Z,{icon:Kb.Z,size:"XS",onClick:e=>o(e.currentTarget),className:a.icon}),c().createElement(Lr.ZP,{classes:{paper:a.popup},open:!!l,anchorEl:l,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},c().createElement("div",{className:a.filterContainer},c().createElement(v.Z,{variant:"h6"},x().text("Filter")),c().createElement(ly,{value:h,onChange:d("dateRange"),className:a.filterItem}),c().createElement(Yb.Z,{selectedUsers:f,onChange:d("users"),className:a.filterItem}),c().createElement(uy,{selectedHistoryActivityTypes:m,onChange:d("activities"),className:a.filterItem}),c().createElement(Xb.Z,{selectedAttributes:g,entityType:n,onChange:d("attributes"),className:a.filterItem,title:x().text("Attribute updated"),menuPlacement:"top"})),c().createElement("div",{className:a.filterControls},c().createElement(Ze.Z,{onClick:()=>p(null),className:a.clearButton},x().text("Clear all")),c().createElement(Ze.Z,{onClick:i},x().text("Cancel")),c().createElement(Ze.Z,{color:"primary",onClick:()=>{h&&(e=>{if(e.type===hb.K.AGO||e.type===hb.K.WITHIN){const[t,r]=e.period;return"Number"===(0,N.type)(t)&&"String"===(0,N.type)(r)&&t>0}if(e.type===hb.K.BETWEEN){const[t,r]=e.period;return t instanceof Date&&r instanceof Date}})(h)?r(u):r((0,N.dissoc)("dateRange",u)),i()}},x().text("Apply")))))};var gy=r(98281);const hy=(0,T.Z)({icon:{margin:5},menuItem:{minHeight:"32px"},menuText:{fontSize:"13px",lineHeight:"15px",letterSpacing:0,marginLeft:"30px"},checkIcon:{position:"absolute",color:"rgba(0, 0, 0, 0.54)"}}),fy=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=wn.ZT}=e;const a=hy(),{text:l,selected:o,onClick:i}=r;return c().createElement(Ma.Z,{classes:{root:a.menuItem},onClick:e=>{n(),i(e)},ref:t},o&&c().createElement(gy.Z,{className:a.checkIcon}),c().createElement(v.Z,{classes:{root:a.menuText}},l))}));fy.displayName="MenuItemRenderer";const by=fy,yy=()=>{const e=hy(),t=(0,g.useSelector)(h.ZP.selectors.getHistoryMode),r=(0,g.useDispatch)(),n=e=>{r(h.N5.history.actions.setHistoryMode(e))},a=[{text:x().text("Compare to Current view"),selected:t===h.Z9.Current,onClick:()=>n(h.Z9.Current)},{text:x().text("Compare to Previous view"),selected:t===h.Z9.Previous,onClick:()=>n(h.Z9.Previous)}];return c().createElement(fe.Z,{MenuItemRenderer:by,buttonComponent:Lt.Z,buttonProps:{icon:he.Z,size:"L",className:e.icon},menuId:"history-menu",menuItems:a})},xy=(0,T.Z)({root:{display:"flex",flex:1,alignItems:"center"},icon:{margin:4},divider:{backgroundColor:"rgba(0,0,0,0.12)",margin:"3px 19px"},count:{fontSize:14}}),Ey=e=>{let{total:t,entityType:r,filter:n,onApplyFilter:a}=e;const l=xy();return c().createElement("div",{className:l.root},c().createElement(v.Z,{variant:"h6"},x().text("History")),c().createElement(jr.Z,{orientation:"vertical",flexItem:!0,className:l.divider}),!(0,N.isNil)(t)&&c().createElement(v.Z,{variant:"body1",color:"textSecondary",className:l.count},1===t?x().text("${count} contributing profile",{count:t}):x().text("${count} contributing profiles",{count:t})),c().createElement(fm.Z,null),c().createElement(my,{entityType:r,filter:n,onApplyFilter:a}),c().createElement(yy,null))},vy=(0,T.Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),wy=()=>{const e=vy(),t=(0,g.useSelector)(h.ZP.selectors.getHistoryEvent),r=(0,g.useDispatch)(),n=(0,N.pipe)(h.N5.history.actions.clearHistoryEvent,r);return t?c().createElement("div",{className:e.root},c().createElement(v.Z,{component:"div"},x().text("You are viewing a historic slice:")," ",c().createElement("span",{className:e.slice},x().date(t.aStamp,"llll"))),c().createElement(Ze.Z,{className:e.cancelButton,variant:"contained",color:"primary",onClick:n},x().text("Cancel"))):null},Oy=(0,T.Z)({editor:{display:"flex",flexDirection:"column",padding:"0 24px 5px"},title:{color:"rgba(0, 0, 0, 0.6)",fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px",margin:"17px 0 24px"},item:{marginBottom:"20px"},dense:{marginBottom:0},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 Cy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ty(e,t,r[t])}))}return e}function Ty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sy=e=>{let{connection:t,modifiedEntity:r,allModifiedEntities:n,dispatch:a,config:l,mode:o,metadata:i,globalSearchRequestOptions:p,error:d}=e;const{relationUri:m,relationType:g,direction:f}=t.relation,y=t.isNew,E=Oy(),{inRelations:w=[],outRelations:O=[]}=(0,s.useMemo)((()=>(0,u.ocC)({config:l,direction:f,relationType:g,mode:o,metadata:i})),[l,f,g,o,i]),C=(0,s.useMemo)((()=>(0,u.xF8)(i,g)),[g,i]),T=(0,s.useMemo)((()=>Cy({attributes:Cy({},h.N5.relations.selectors.getRelationAttributesFromConnection(t))},(0,u.p2l)(t.relation))),[t]),S=(0,s.useRef)(t),k=(0,s.useRef)(r),I=(0,s.useMemo)((()=>(0,u.SAs)(n,r)),[n,r]),P=(0,s.useRef)([]);(0,s.useEffect)((()=>{P.current=(0,N.pipe)((0,N.concat)(I.map((0,N.prop)("uri"))),N.uniq)(P.current)}),[I]);const D=(0,s.useRef)(I),A=(0,u.z7d)(w,O),R=S.current!==t||k.current!==r||(j=D.current,Z=I,j.length!==Z.length||j.some(((e,t)=>j[t]!==Z[t])))||t.isNew&&!(0,u.O27)((0,N.path)(["relation","object","attributes"],t));var j,Z;const L=y?h.N5.relations.actions.addRelation:h.N5.relations.actions.editRelation,_=(0,s.useCallback)((0,N.pipe)(h.N5.relations.actions.setRelationType(l.id,m),a),[l,m,a]),M=(0,s.useCallback)((()=>(0,N.pipe)(h.N5.relations.actions.closeRelationEditor,a)(l.id,m)),[l,m,a]),V=(0,s.useCallback)((e=>{if(r){const t=(0,u.nt9)(i,r.type);return(0,u.wx9)(t,r,e)}return e}),[r,i]),U=(0,s.useCallback)((e=>a(h.N5.modifiedEntities.actions.entityCreated(e))),[a]),B=(0,s.useCallback)((e=>a(h.N5.modifiedEntities.actions.entityDeleted(e))),[a]),z=(0,s.useCallback)((e=>{r&&B(r.uri),a(h.N5.relations.actions.setRelationEntity(l.id,m,e)),d&&a(h.N5.errors.actions.errorDeactivated((0,u.iFp)(d)))}),[l.id,m,a,r,B,d]),F=(0,s.useCallback)((()=>{const e=(0,u.Bd_)(i,n,t);return a(h.N5.errors.actions.errorsSet(e)),0===e.length}),[t,i,n,a]),H=(0,s.useCallback)((()=>a(h.N5.errors.actions.errorsSet([]))),[a]),W=(0,s.useCallback)((0,N.pipe)((0,N.always)(t),(0,N.when)(F,(0,N.pipe)(u.zhn,V,L(l.id),a,(0,N.always)((0,N.differenceWith)(N.equals,P.current,I.map((0,N.prop)("uri")))),(0,N.forEach)(B),M))),[t,l,a,V,F,I]),q=(0,s.useCallback)((()=>{const e=k.current;r!==e&&(e?(U(e),r&&r.uri!==e.uri&&B(r.uri)):B(r.uri));const t=D.current;(0,N.differenceWith)(N.equals,P.current,t.map((0,N.prop)("uri"))).forEach(B),t.forEach(U),H(),M()}),[M,U,B,H,r]),G=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.addAttributes,a)(e.map((e=>Cy({},e,{viewId:l.id}))))),[l.id,a]),$=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.modifyAttribute,a)(Cy({},e,{viewId:l.id}))),[l.id,a]),K=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.removeAttribute,a)(Cy({},e,{viewId:l.id}))),[l.id,a]),Y=(0,s.useCallback)(((e,t)=>{const r=(0,u.nt9)(i,e),n=(0,N.pipe)(u.wcJ,(0,u._kX)(o))(r),a=(0,u.pBq)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:o});z(a),U(a)}),[U,z,o,i]),X=(0,u.e$p)(d);return c().createElement(c().Fragment,null,c().createElement("div",{className:E.editor},c().createElement(v.Z,{className:E.title},y?x().text("Add new item"):x().text("Edit item")),null===A&&c().createElement(Ec,{className:E.item,relation:t.relation,inRelationTypes:w,outRelationTypes:O,onChange:_}),Boolean(g)&&c().createElement(c().Fragment,null,c().createElement(ia,{errorMessage:X},c().createElement(ml,{className:b()(E.item,{[E.dense]:X||t.entity&&(0,u.ZiX)(t.entity.entityUri)}),entity:t.entity||{},entityTypesUris:l.content.entityTypes||[],max:l.max||20,globalSearchRequestOptions:p,mode:o,onChange:z,onCreate:Y,metadata:i,attributeTypesSelectionStrategy:u.wcJ})),c().createElement(Ia,{className:E.item,attrTypes:C,entity:T,showEmptyEditors:!0,crosswalks:t.crosswalks,mode:o,parentUri:m,onAddAttributes:G,onChangeAttribute:$,onDeleteAttribute:K}))),c().createElement("div",{className:E.actionButtons},c().createElement(Ze.Z,{onClick:q},x().text("Cancel")),c().createElement(Ze.Z,{color:"primary",disabled:!R,onClick:W},x().text("Apply"))),c().createElement(jr.Z,null))};Sy.propTypes={connection:u.Rjq,modifiedEntity:u.pyR,allModifiedEntities:B().object,dispatch:B().func,config:u.PiC,mode:B().string,metadata:u.pGS,globalSearchRequestOptions:B().object,error:u.wfT};const ky=Sy,Ny=(0,g.connect)(((e,t)=>{const r=(n=t,h.N5.relations.selectors.getEntityUriFromConnection(n.connection));var n;const a=(0,u.ZiX)(r);return{modifiedEntity:a?h.ZP.selectors.getModifiedEntity(e,r):null,allModifiedEntities:a?h.ZP.selectors.getModifiedEntities(e):null,globalSearchRequestOptions:h.ZP.selectors.getGlobalSearchRequestOptions(e,["ovOnly"]),error:(0,u.ATu)(t.connection,h.ZP.selectors.getProfileErrors(e))}}))(ky),Iy=(0,T.Z)((e=>({card:{borderBottom:"1px solid rgba(0,0,0,0.06)"},withBackground:{backgroundColor:"rgba(0, 0, 0, 0.03)"},lineWrapper:{position:"relative"},icon:{position:"absolute",top:"8px",left:"16px",width:"32px",height:"32px",zIndex:1},line:e=>{let{color:t}=e;return{borderLeft:`3px solid ${t}`,position:"absolute",left:0,top:0,bottom:0}},info:{fontSize:"13px",color:e.palette.text.secondary,wordWrap:"break-word",lineHeight:"15px"},commentsInfo:{display:"flex",alignItems:"center",marginBottom:"-4px",marginTop:"7px"},commentsIcon:{width:"11px",height:"11px",marginLeft:"2px",marginRight:"6px",marginTop:"-2px"},infoValue:{color:e.palette.text.primary},infoBlock:{display:"flex",flexDirection:"row",marginBottom:"5px"},header:{display:"flex",flexDirection:"row",paddingBottom:"12px"},flex:{flex:1},caption:{fontSize:"16px",color:e.palette.text.primary},title:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:"-4px"},flag:{height:"13px",width:"13px",marginTop:"-2px",stroke:"#000000",fill:"none",margin:"2px 5px 0 5px"},date:{fontSize:"13px",color:e.palette.text.primary},mainInfo:{display:"flex",flexDirection:"column",flex:1},controlsBox:{marginRight:"16px",marginBottom:"12px",marginTop:"13px"},controlsInRow:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"20px"},priority:{width:"162px"},comments:{marginLeft:"11px"}}))),Py=c().createContext(null);Py.displayName="WorkflowTasksContext";const Dy=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{errorMessage:t,errorCode:r}=e;r!==u.Xt7.WORKFLOW_IS_NOT_REGISTERED_ERROR&&(console.error(e),ou.Z.addError({title:x().text("Error"),message:t||x().text("Something went wrong...")}))},Ay=()=>{const e=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),t=(0,g.useSelector)(h.ZP.selectors.getCanUserStartProcessFromQuery),r=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowJobs),n=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowEnvironmentConfigJar),a=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowDefinition),l=(0,g.useSelector)(h.ZP.selectors.getCanUserViewWorkflowConfigJar),o=(0,g.useSelector)(h.ZP.selectors.getCanUserViewProcessInstanceSearchQuery),i=(0,g.useSelector)(h.ZP.selectors.getCanUserUpdateWorkflowDataTask),s=(0,g.useSelector)(h.ZP.selectors.getCanUserUpdateProcessInstance),c=(0,g.useSelector)(h.ZP.selectors.getCanUserReadWorkflowDataTask),u=(0,g.useSelector)(h.ZP.selectors.getCanUserManageWorkflowEnvironmentDefinition),p=(0,g.useSelector)(h.ZP.selectors.getCanUserManageWorkflowDefinition),d=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsValidateTasks),m=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsUpdateTasks),f=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsTerminateProcessInstance),b=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobsSyncBusinessProcessData),y=(0,g.useSelector)(h.ZP.selectors.getCanUserExecuteWorkflowJobs),x=(0,g.useSelector)(h.ZP.selectors.getCanUserCreateWorkflowEnvironmentConfigJar),E=(0,g.useSelector)(h.ZP.selectors.getCanUserRegisterConfigEnvironments),v=(0,g.useSelector)(h.ZP.selectors.getCanUserCreateWorkflowConfigJar);return g=>{if(!e)return!1;switch(g){case"VIEW_PROCESS_DEFINITIONS":return a;case"DEPLOY_GENERIC_PROCESS_DEFINITION":return u;case"VIEW_JOBS":return r;case"START_JOB":return y||b&&f&&m&&d;case"VIEW_CUSTOM_JARS":return l||n;case"UPDATE_PROCESS_INSTANCE":return s;case"VIEW_TASKS":return c;case"REGISTER_TENANT":return E;case"START_PROCESS_INSTANCE":case"START_PROCESS_INSTANCE_SEARCH_QUERY":return t;case"VIEW_PROCESS_INSTANCE_COMMENTS":case"VIEW_PROCESS_INSTANCES":case"VIEW_PROCESS_INSTANCE_COUNT":return o;case"UPDATE_TASK":return i;case"DEPLOY_TENANT_PROCESS_DEFINITION":return p;case"DEPLOY_CUSTOM_JAR":return v&&x}return!1}},Ry=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((0,N.startsWith)("changeRequests/"))},jy=e=>void 0===e||!0===e,Zy=e=>({label:e,value:e}),Ly=e=>{let{assignee:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Py)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,yt._)(),p=(0,yt._)(),[d,m]=(0,s.useState)(null),[f,b]=(0,s.useState)(),[y,x]=(0,s.useState)(!1),E=Ay()("UPDATE_TASK")&&jy(n);(0,s.useEffect)((()=>{m(Zy(t))}),[t]);const v=(0,s.useCallback)((e=>{if(l&&E&&r){const t=(0,N.filter)((t=>t.value.toLowerCase().includes(e)));return f?Promise.resolve(t(f)):p((0,u.j2$)({taskId:r,workflowPath:l,environment:o,tenant:i})).then((e=>{const{data:r}=e,n=r.map(Zy);return b(n),t(n)})).catch(Dy)}}),[l,r,o,i,f,b,E]),w=(0,s.useCallback)((e=>{if(l&&E&&r){const{value:t}=e;x(!0),c((0,u._C4)({taskId:r,workflowPath:l,environment:o,tenant:i,assignee:t})).then((()=>{m(Zy(t)),null==a||a(r,{assignee:t})})).catch(Dy).finally((()=>{x(!1)}))}}),[l,r,o,i,E]);return{assignee:d,getAssignees:v,updateAssignee:w,updateRequestIsInProgress:y,readOnly:!E}},_y=e=>{let{taskId:t,assignee:r,isTaskOpen:n}=e;const{assignee:a,getAssignees:l,updateAssignee:o,updateRequestIsInProgress:i,readOnly:s}=Ly({taskId:t,assignee:r,isOpen:n}),u=i||s;return c().createElement(La.Z,{isDisabled:u,getOptions:l,onChange:o,hideSelectedOptions:!1,label:x().text("Assigned to"),value:a,defaultOptions:!0,TextFieldProps:{disabled:u},height:40})},My=(0,T.Z)({dueDate:{marginTop:0,marginBottom:0},dueDateInput:{height:"40px"},inputLabel:{fontSize:"14px"}}),Vy=e=>{let{taskId:t,dueDate:r,isTaskOpen:n,className:a}=e;const l=My(),{updateDueDate:o,updateRequestIsInProgress:i,readOnly:p}=(e=>{let{dueDate:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Py)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,yt._)(),[p,d]=(0,s.useState)(!1),m=Ay()("UPDATE_TASK")&&jy(n);return{updateDueDate:(0,s.useCallback)((e=>{l&&m&&r&&e&&t!==e&&(d(!0),c((0,u.KF3)({taskId:r,workflowPath:l,environment:o,tenant:i,dueDate:e})).then((()=>{null==a||a(r,{dueDate:e})})).catch(Dy).finally((()=>{d(!1)})))}),[l,r,o,i,a,c,t,m]),updateRequestIsInProgress:p,readOnly:!m}})({dueDate:r,taskId:t,isOpen:n});return c().createElement(Dc.Z,{className:b()(l.dueDate,a),disabled:i||p,value:r,label:x().text("Due date"),onChange:(0,N.pipe)((e=>e&&e.getTime()),o),margin:"dense",InputProps:{className:l.dueDateInput},InputLabelProps:{classes:{root:l.inputLabel}}})},Uy=e=>{let{taskId:t,priority:r,isTaskOpen:n,className:a}=e;const{priorities:l,updatePriority:o,updateRequestIsInProgress:i,readOnly:p}=(e=>{let{priority:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Py)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,yt._)(),[p,d]=(0,s.useState)(!1),m=Ay()("UPDATE_TASK")&&jy(n),f=(0,s.useCallback)((e=>{const{value:n}=e;l&&m&&r&&t!==n&&(d(!0),c((0,u.ax9)({taskId:r,workflowPath:l,environment:o,tenant:i,priority:n})).then((()=>{null==a||a(r,{priority:n})})).catch(Dy).finally((()=>{d(!1)})))}),[l,r,o,i,a,c,t,m]);return{priorities:(0,s.useMemo)((()=>[{label:x().text("Low"),value:u.NVC.low},{label:x().text("Medium"),value:u.NVC.medium},{label:x().text("High"),value:u.NVC.high},{label:x().text("Urgent"),value:u.NVC.urgent}]),[]),updatePriority:f,updateRequestIsInProgress:p,readOnly:!m}})({taskId:t,priority:r,isOpen:n}),d=i||p;return c().createElement(La.Z,{className:a,isDisabled:d,options:l,onChange:o,hideSelectedOptions:!1,label:x().text("Priority"),value:l.find((0,N.propEq)("value",r)),TextFieldProps:{disabled:d},height:40})};var By=r(94842),zy=r(98685);const Fy=(0,T.Z)((e=>({comment:{display:"flex",flexDirection:"row",flex:1,marginLeft:"6px"},avatar:{height:"24px",width:"24px",margin:"3px 13px 0 0"},icon:{fill:"#537280",backgroundColor:"#EAEDEE"},firstLine:{display:"flex",flexDirection:"row"},info:{flex:1},author:{flex:1,fontWeight:"500",color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px"},date:{color:"rgba(0, 0, 0, 0.54)",fontSize:"11px",marginRight:"17px",lineHeight:"15px"},text:{color:"rgba(0, 0, 0, 0.6)",fontSize:"13px",wordWrap:"break-word",wordBreak:"break-all",paddingRight:"10px"}}))),Hy=(0,T.Z)((e=>({circleButton:{maxWidth:"14px",maxHeight:"14px",border:"1px solid rgba(0, 0, 0, 0.3)",fontSize:"13px",color:"rgba(0, 0, 0, 0.6)",position:"absolute",top:"-11px",left:"5px",backgroundColor:"#ffffff","&:hover":{backgroundColor:"#f7f7f7"},"&.focused":{backgroundColor:"#f7f7f7"}},delimiter:{position:"relative",height:"4px",borderTop:"1px solid rgba(0, 0, 0, 0.3)",borderBottom:"1px solid rgba(0, 0, 0, 0.3)",margin:"15px 0 24px 0"}}))),Wy=(0,T.Z)((e=>({container:{padding:"5px 0",display:"flex",flexDirection:"column"},commentsContainer:{maxHeight:"300px",overflowY:"auto"},title:{margin:"0 0 8px 5px",fontSize:"14px",color:"rgba(0, 0, 0, 0.87)"},filledInputRoot:{backgroundColor:"rgba(0, 0, 0, 0.03)",padding:"0 6px",height:"40px",margin:"10px 17px 0 6px",fontSize:"14px","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}}))),qy=(0,T.Z)((e=>({messageContainer:{borderBottom:"1px solid rgba(0,0,0,0.3)",paddingBottom:"7px",marginBottom:"7px"}}))),Gy=e=>{let{author:t,classes:r,message:n,time:a}=e;const l=Fy();return c().createElement("div",{className:l.comment},c().createElement(ke.Z,{className:l.avatar},c().createElement(zy.Z,{className:l.icon})),c().createElement("div",{className:b()(l.info,r.messageContainer)},c().createElement("div",{className:l.firstLine},c().createElement("div",{className:l.author},t),c().createElement("span",{className:l.date},x().date(a,"L LT"))),c().createElement("div",{className:l.text},n)))};Gy.defaultProps={classes:{}},Gy.propTypes={classes:B().object,author:B().string,id:B().string,message:B().string,time:B().number};const $y=e=>{let{comments:t,onClick:r}=e;const n=Hy();return c().createElement(c().Fragment,null,c().createElement(Gy,t[0]),c().createElement("div",{className:n.delimiter},c().createElement(Ya.Z,{className:n.circleButton,onClick:r},t.length-2)),c().createElement(Gy,t[t.length-1]))};$y.propTypes={comments:B().arrayOf(B().shape({author:B().string,id:B().string,message:B().string,time:B().number})),onClick:B().func};const Ky=e=>{let{comments:t}=e;const r=qy();return t.map((e=>{let{author:t,id:n,message:a,time:l}=e;return c().createElement(Gy,{classes:{messageContainer:r.messageContainer},key:n,author:t,message:a,time:l})}))};Ky.propTypes={comments:B().arrayOf(B().shape({author:B().string,id:B().string,message:B().string,time:B().number}))};const Yy=e=>{let{processInstanceComments:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(Py)||{},l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,yt._)(),[p,d]=(0,s.useState)([]),[m,f]=(0,s.useState)(!1),b=Ay()("UPDATE_TASK")&&jy(n);(0,s.useEffect)((()=>{d(t||[])}),[t]);const y=(0,s.useCallback)((e=>{b&&(f(!0),c((0,u.tZe)({workflowPath:l,environment:o,tenant:i,taskId:r,comment:e}).then((()=>(0,u.yW4)({workflowPath:l,environment:o,tenant:i,taskId:r})))).then((e=>{let{processInstanceComments:t}=e;d(t||[]),null==a||a(r,{processInstanceComments:t})})).catch(Dy).finally((()=>f(!1))))}),[o,r,i,l,c,a,b]);return{comments:p,requestIsInProgress:m,writeComment:y,readOnly:!b}},Xy=e=>e.target.value,Qy=e=>{let{processInstanceComments:t,taskId:r,isTaskOpen:n}=e;const a=Wy(),[l,o]=(0,s.useState)(!1),[i,u]=(0,s.useState)(""),{comments:p,writeComment:d,readOnly:m}=Yy({processInstanceComments:t,taskId:r,isOpen:n}),g=(0,s.useCallback)((()=>{d(i),u("")}),[i,d]),h=(0,N.pipe)(Xy,u);return c().createElement("div",{className:a.container},c().createElement("div",{className:a.title}," ",x().text("Comments")," "),c().createElement("div",{className:a.commentsContainer},l||p.length<3?c().createElement(Ky,{comments:p}):c().createElement($y,{onClick:()=>o(!0),comments:p})),!m&&c().createElement(km.Z,{endAdornment:c().createElement(Nm.Z,{position:"end"},c().createElement(Lt.Z,{icon:By.Z,disabled:0===i.length,onClick:g})),classes:{root:a.filledInputRoot},placeholder:x().text("Write a comment"),value:i,onKeyPress:(0,N.when)((0,N.propEq)("key","Enter"),g),onChange:h,disableUnderline:!0}))};Qy.propTypes={processInstanceComments:B().arrayOf(B().shape({author:B().string,id:B().string,message:B().string,time:B().number})),taskId:B().string};const Jy=e=>{let{taskId:t,possibleActions:r,assignee:n,isTaskOpen:a}=e;const{actions:l,actionRequestIsInProgress:o}=(e=>{let{possibleActions:t,assignee:r,taskId:n,isOpen:a}=e;const{loadWorkflowTasks:l}=(0,s.useContext)(Py)||{},o=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),i=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),c=(0,g.useSelector)(h.ZP.selectors.getTenant),p=(0,g.useSelector)(h.ZP.selectors.getUserName),d=(0,g.useSelector)(h.ZP.selectors.getEntityUri),[m,f]=(0,s.useState)(!1),b=(0,s.useContext)(qa.m),y=(0,g.useDispatch)(),x=(0,s.useCallback)((e=>()=>{o&&n&&(f(!0),(0,u.TZ_)({taskId:n,workflowPath:o,environment:i,tenant:c,action:e}).then((()=>{"Delete"===e?y(h.ui.actions.entityDeletionFinished()):(y(h.N5.entity.actions.loadEntity({viewId:b,uri:d})),null==l||l())})).catch(Dy).finally((()=>{f(!1)})))}),[o,n,i,c,y,d,b,l]);return{actions:(0,s.useMemo)((()=>p===r&&jy(a)?(t||[]).map((e=>{let{action:t,label:r}=e;return{text:r,onClick:x(t)}})):[]),[t,x,p,r,a]),actionRequestIsInProgress:m}})({taskId:t,possibleActions:r,assignee:n,isOpen:a});return l.length>0?c().createElement(fe.Z,{buttonComponent:Lt.Z,buttonProps:{icon:he.Z,size:"L",disabled:o},menuId:"workflow-actions",menuItems:l}):null},ex=(0,T.Z)({decorator:{display:"flex",alignItems:"stretch"},lineBlock:{width:"56px",flexShrink:0},withLinePadding:{"& $noLine":{height:"10px"},"& $line":{height:"calc(100% - 10px)"}},noLine:{height:"0"},line:{height:"100%",position:"relative",marginLeft:"31px",borderLeft:"2px solid rgba(0,0,0,0.06)","&:before":{position:"absolute",height:6,width:6,borderRadius:"50%",left:-5,top:"15px",background:"#d8d8d8",content:'""',display:"block",border:"1px solid white"},"&$plain":{"&:before":{width:0,border:"none"}},"&$last":{height:"15px"}},content:{flex:1,minWidth:0},plain:{},last:{},rowDivider:{marginLeft:0}}),tx=e=>{let{className:t,children:r,plain:n,first:a,last:l,transparent:o,divider:i}=e;const s=ex();return c().createElement("div",{className:b()(t,s.decorator)},c().createElement("div",{className:b()(s.lineBlock,{[s.withLinePadding]:a})},!o&&c().createElement(c().Fragment,null,c().createElement("div",{className:s.noLine}),c().createElement("div",{className:b()(s.line,{[s.plain]:n},{[s.last]:l})}))),c().createElement("div",{className:s.content},r,i&&c().createElement(jr.Z,{className:s.rowDivider,light:!0,variant:"inset"})))};let rx={};const nx=["#DC057B","#5DC003","#FEC92F","#F57F27","#B71137","#056B97","#4499AE","#BD81BE","#5F3577","#A68560","#555962"];let ax=0;function lx(){return lx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lx.apply(this,arguments)}const ox=e=>c().createElement("svg",lx({width:20,height:20,viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),c().createElement("defs",null,c().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:"CollaborationIcon_svg__a"})),c().createElement("g",{transform:"translate(-2 -2)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"CollaborationIcon_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#CollaborationIcon_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#CollaborationIcon_svg__b)",d:"M0 0h24v24H0z"}))),ix=e=>{let{task:t,children:r,actions:n,Icon:a}=e;const{taskId:l,dueDate:o,priority:i,assignee:u,createdBy:p,createTime:d,displayName:m,processDefinitionDisplayName:g,objectURIs:h,processInstanceComments:f,possibleActions:y,isOpen:E}=t,v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,N.pipe)(Ry,(0,N.unless)(N.isNil,(0,N.pipe)((0,N.split)("/"),(0,N.nth)(1))))(e)}(h),w=(e=>{let{processDefinitionDisplayName:t}=e;const r=t;return rx[r]||(rx[r]=nx[ax],ax++,ax>nx.length-1&&(ax=0)),rx[r]})({processDefinitionDisplayName:g}),O=Iy({color:w}),[C,T]=(0,s.useState)(!1),S=Ay()("VIEW_PROCESS_INSTANCE_COMMENTS");return c().createElement("div",{className:O.card},c().createElement("div",{className:b()({[O.withBackground]:C})},c().createElement("div",{className:O.lineWrapper},c().createElement("div",{className:O.line}),a&&c().createElement(a,{className:O.icon}),c().createElement(tx,{plain:!0,first:!0,transparent:!C},c().createElement("div",{className:O.mainInfo},c().createElement("div",{className:O.title},c().createElement("div",{className:b()(O.caption,O.flex)},g),c().createElement(cp.Z,{className:O.flag}),c().createElement(ae.ZP,{title:x().text("Due date")},c().createElement("span",{className:O.date},x().date(o,"L"))),c().createElement(ks.Z,{isOpen:C,size:"L",onClick:()=>{T(!C)}})),c().createElement("div",{className:O.infoBlock},c().createElement("div",{className:O.flex},v&&c().createElement("div",{className:O.info},x().text("DCR ID"),": ",c().createElement("span",{className:O.infoValue},v)),c().createElement("div",{className:O.info},x().text("Created by"),": ",c().createElement("span",{className:O.infoValue},p)," ",x().text("on")," ",c().createElement("span",{className:O.infoValue},x().date(d,"L"))),c().createElement("div",{className:O.info},x().text("Step"),": ",c().createElement("span",{className:O.infoValue},m)),S&&(null==f?void 0:f.length)>0&&c().createElement("div",{className:O.commentsInfo},c().createElement(ox,{className:O.commentsIcon}),c().createElement("div",{className:O.infoValue},f.length))),n||c().createElement(Jy,{taskId:l,possibleActions:y,assignee:u,isTaskOpen:E}))))),C&&c().createElement(tx,{plain:!0},c().createElement("div",{className:O.controlsBox},c().createElement("div",{className:O.controlsInRow},c().createElement(Vy,{taskId:l,dueDate:o,isTaskOpen:E}),c().createElement(Uy,{taskId:l,priority:i,className:O.priority,isTaskOpen:E})),c().createElement(_y,{taskId:l,assignee:u,isTaskOpen:E})))),C&&c().createElement(c().Fragment,null,r,S&&c().createElement("div",{className:O.comments},c().createElement(Qy,{taskId:l,processInstanceComments:f,isTaskOpen:E}))))};function sx(){return sx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sx.apply(this,arguments)}const cx=e=>c().createElement("svg",sx({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#42A5F5",cx:14,cy:14,r:14}),c().createElement("path",{d:"M16.43 9.87c0 1.59 1.25 2.87 2.79 2.87 1.53 0 2.78-1.28 2.78-2.87C22 8.29 20.75 7 19.22 7c-1.54 0-2.79 1.29-2.79 2.87zm1.4 0c0-.79.62-1.43 1.39-1.43.77 0 1.39.64 1.39 1.43 0 .79-.62 1.44-1.39 1.44-.77 0-1.39-.65-1.39-1.44zm-6.26 8.26c0-1.59-1.25-2.87-2.79-2.87-1.53 0-2.78 1.28-2.78 2.87C6 19.71 7.25 21 8.78 21c1.54 0 2.79-1.29 2.79-2.87zM8.09 9.15v4.31h1.39v-2.87h2.78v2.15l2.78-2.87L12.26 7v2.15H8.09zm11.82 9.7v-4.31h-1.39v2.87h-2.78v-2.15l-2.78 2.87L15.74 21v-2.15h4.17z",fill:"#FFF",opacity:.87})));let ux,px;!function(e){e.ADDED="added",e.EDITED="edited",e.DELETED="deleted",e.PINNED="pinned",e.IGNORED="ignored",e.PIN_DELETED="pin_deleted",e.IGNORE_DELETED="ignore_deleted"}(ux||(ux={})),function(e){e.INSERT_ATTRIBUTE="INSERT_ATTRIBUTE",e.UPDATE_ATTRIBUTE="UPDATE_ATTRIBUTE",e.DELETE_ATTRIBUTE="DELETE_ATTRIBUTE",e.PIN_ATTRIBUTE="PIN_ATTRIBUTE",e.IGNORE_ATTRIBUTE="IGNORE_ATTRIBUTE",e.CREATE_ENTITY="CREATE_ENTITY",e.CREATE_RELATIONSHIP="CREATE_RELATIONSHIP",e.UPDATE_TAGS="UPDATE_TAGS",e.UPDATE_ROLES="UPDATE_ROLES",e.UPDATE_START_DATE="UPDATE_START_DATE",e.UPDATE_END_DATE="UPDATE_END_DATE",e.UPDATE_PROFILE_PIC_BY_URL="UPDATE_PROFILE_PIC_BY_URL",e.UPDATE_PROFILE_PIC_BY_URI="UPDATE_PROFILE_PIC_BY_URI",e.DELETE_RELATIONSHIP="DELETE_RELATIONSHIP"}(px||(px={}));const dx=e=>({[ux.ADDED]:x().text("added"),[ux.EDITED]:x().text("edited"),[ux.DELETED]:x().text("deleted"),[ux.PINNED]:x().text("pinned"),[ux.PIN_DELETED]:x().text("pin deleted"),[ux.IGNORED]:x().text("ignored"),[ux.IGNORE_DELETED]:x().text("ignore deleted")}[e]||""),mx=(e,t)=>(0,N.when)((0,N.allPass)([(0,N.pipe)((0,N.prop)("type"),(0,N.equals)(u.oS0.TYPE_STRING)),()=>(0,u.CBv)(t)]),(0,N.evolve)({type:(0,N.always)(u.oS0.TYPE_URL)}))((0,u.PFL)(e));function gx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hx(e,t,r[t])}))}return e}function hx(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fx=(e,t)=>{if("newValue"in e||"oldValue"in e){const{newValue:r,oldValue:n,type:a}=e,l=(0,N.pathOr)([],["value",t.name])(r),o=(0,N.pathOr)([],["value",t.name])(n),i=Math.max(l.length,o.length);return(0,N.times)((e=>[{value:{newValue:l[e],oldValue:o[e],type:a}}]),i)}const r=e[t.name];return r?[r]:[]},bx=(0,N.curry)(((e,t,r)=>{const n=Ca(e,t.type,[],[]);return xx(e,n,r)})),yx=(0,N.curry)(((e,t,r)=>{const n=(0,u.V3K)(e,t.type),a=(0,u.xF8)(e,t.type);return(0,N.flatten)([{level:1,label:(0,N.propOr)("","label",n),attributeType:n,attributeValue:gx({},t,r)},xx(e,a,r,2)])})),xx=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return(0,N.flatten)(t.map((t=>fx(r,t).map((r=>r.map((r=>Ex(e,t,r,n))))))).filter((0,N.complement)(N.isEmpty)))},Ex=(e,t,r,n)=>{switch(t.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return vx(e,t,r,n);case u.oS0.TYPE_REFERENCE:return wx(e,t,r,n);default:{const e=((e,t)=>{const r=(0,u.kqr)(e)?t:t.value;return(0,N.is)(Object,r)?r:{newValue:t,type:px.INSERT_ATTRIBUTE}})(t,r);return Ox(t,e,n)}}},vx=(e,t,r,n)=>{const a=(0,u.EUG)({},t);return[{level:n,label:(0,u.idV)((null==t?void 0:t.label)||(null==t?void 0:t.name)),attributeType:t,attributeValue:r},xx(e,a,r.value,n+1)]},wx=(e,t,r,n)=>{const a=(0,u.EUG)(e,t);return[{level:n,label:(null==t?void 0:t.label)||(null==t?void 0:t.name),attributeType:t,attributeValue:r},xx(e,a,r.value,n+1)]},Ox=(e,t,r)=>{const{newValue:n,oldValue:a,type:l}=(e=>{let{newValue:t,oldValue:r,type:n}=e;return n===px.UPDATE_ATTRIBUTE?{type:n,newValue:t,oldValue:r}:{type:n,newValue:r||t}})(t),o=((e,t)=>{switch(e){case px.CREATE_RELATIONSHIP:case px.INSERT_ATTRIBUTE:return ux.ADDED;case px.UPDATE_TAGS:case px.UPDATE_ROLES:case px.UPDATE_ATTRIBUTE:return ux.EDITED;case px.DELETE_ATTRIBUTE:case px.DELETE_RELATIONSHIP:return ux.DELETED;case px.PIN_ATTRIBUTE:return null!=t&&t.pin?ux.PIN_DELETED:ux.PINNED;case px.IGNORE_ATTRIBUTE:return null!=t&&t.ignored?ux.IGNORE_DELETED:ux.IGNORED}})(l,a);return{attributeType:e,newValue:n,oldValue:a,operation:o,label:(null==e?void 0:e.label)||(null==e?void 0:e.name),level:r}};function Cx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Tx(e,t,r[t])}))}return e}function Tx(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sx=["defaultProfilePicValue",u.xPW.tags.name,u.xPW.roles.name,u.xPW.startDate.name,u.xPW.endDate.name],kx=e=>{let{newValue:t,oldValue:r}=e;const n=e=>isNaN(e)?e:parseInt(e),a=e=>(null==e?void 0:e.length)&&!(0,u.O27)(e),l=a(t),o=a(r);return l&&o?[{type:px.UPDATE_ATTRIBUTE,oldValue:{value:n(r[0])},newValue:{value:n(t[0])}}]:l?[{type:px.INSERT_ATTRIBUTE,newValue:{value:n(t[0])}}]:o?[{type:px.DELETE_ATTRIBUTE,oldValue:{value:n(r[0])}}]:void 0},Nx=(e,t)=>{const{newValue:r=[],oldValue:n=[],type:a}=t,l=a===px.UPDATE_ROLES?(0,u.xqc)(e):N.identity,o=(0,N.difference)(r,n),i=(0,N.difference)(n,r),s=[];return o.length&&s.push({type:px.INSERT_ATTRIBUTE,newValue:{value:o.map(l).join(", ")}}),i.length&&s.push({type:px.DELETE_ATTRIBUTE,oldValue:{value:i.map(l).join(", ")}}),s},Ix=(e,t)=>{const r=(e=>{const{type:t,attributePath:r,refObjectURI:n,refAttributeType:a}=e,l=t===px.INSERT_ATTRIBUTE?(0,u.Zmi)(r):r;if(n){const e=a.split("/attributes/"),t=n.split("/")[1];return[e[1],t,l].join("/")}return l})(t),n=r.split("/");let a=e;for(let e=0;e<n.length-1;e+=2){var l;const r=n[e],o=n[e+1],i=(a[r]||[]).find((0,N.propEq)("id",o)),s=n.length===e+2?t:{},c=i||{id:o,value:s},u=(null===(l=t.refObjectURI)||void 0===l?void 0:l.indexOf(o))>=0&&t.refObjectURI;u&&(c.refObjectURI=u),(0,N.isNil)(i)&&(a[r]=(a[r]||[]).concat(c)),a=c.value}return e},Px=(e,t)=>{const{attributes:r={},startDate:n,endDate:a}=t,{roles:l,tags:o,defaultProfilePicValue:i}=t,s=Cx({},r);return i&&(s.defaultProfilePicValue=[i]),l&&(s[u.xPW.roles.name]=[{type:px.INSERT_ATTRIBUTE,newValue:{value:l.map((0,u.xqc)(e)).join(", ")}}]),o&&(s[u.xPW.tags.name]=[{type:px.INSERT_ATTRIBUTE,newValue:{value:o.join(", ")}}]),n&&(s[u.xPW.startDate.name]=[{type:px.INSERT_ATTRIBUTE,newValue:{value:n}}]),a&&(s[u.xPW.endDate.name]=[{type:px.INSERT_ATTRIBUTE,newValue:{value:a}}]),s},Dx=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{type:a}=r;switch(a){case px.UPDATE_PROFILE_PIC_BY_URL:n.defaultProfilePicValue=[r.newValue];break;case px.UPDATE_TAGS:n[u.xPW.tags.name]=Nx(e,r);break;case px.UPDATE_ROLES:n[u.xPW.roles.name]=Nx(e,r);break;case px.UPDATE_START_DATE:n[u.xPW.startDate.name]=kx(r);break;case px.UPDATE_END_DATE:n[u.xPW.endDate.name]=kx(r);break;case px.CREATE_RELATIONSHIP:case px.CREATE_ENTITY:return Cx({},n,Px(e,r.newValue));case px.INSERT_ATTRIBUTE:case px.UPDATE_ATTRIBUTE:case px.DELETE_ATTRIBUTE:case px.PIN_ATTRIBUTE:case px.IGNORE_ATTRIBUTE:Ix(n,r)}return n},Ax=(0,T.Z)((e=>({linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"}}))),Rx=e=>{let{suggestionsCount:t,isExpanded:r,onClick:n,className:a}=e;const l=Ax();return c().createElement(ge.Z,{component:"button",variant:"caption",underline:"none",onClick:n,className:a},c().createElement("span",{className:l.linkLabel},r?x().text("View less suggestions"):x().text("View ${suggestionsCount} more suggestions",{suggestionsCount:t})))};var jx=r(43525);const Zx=(0,T.Z)((e=>({field:{fontSize:"12px",lineHeight:"20px",color:e.palette.text.primary,marginTop:"6px",overflow:"hidden",wordBreak:"break-word"},fieldName:{color:e.palette.text.secondary,marginRight:"8px"},difference:{marginRight:"8px"},arrow:{margin:"0 4px",fontSize:"12px",color:e.palette.text.primary},chip:{height:"20px",fontSize:"10px",fontWeight:500,lineHeight:"16px",letterSpacing:0,flexShrink:0,textTransform:"capitalize",color:e.palette.primary.main,borderColor:e.palette.primary.main,"&.edited":{color:"#CC7500",borderColor:"#CC7500"},"&.added":{color:"#599E0E",borderColor:"#599E0E"},"&.deleted":{color:"#CF0E26",borderColor:"#CF0E26"}}}))),Lx=e=>{let{label:t,oldValue:r,newValue:n,operation:a,className:l}=e;const o=Zx(),i=r||n;return c().createElement("div",{className:b()(o.field,l)},c().createElement("span",{className:o.fieldName},t,":"),c().createElement("span",{className:o.difference},i,n&&r&&c().createElement(c().Fragment,null,c().createElement(jx.Z,{className:o.arrow}),n)),a&&c().createElement(Je.Z,{variant:"outlined",label:dx(a),className:b()(o.chip,a)}))},_x=c().createContext(null);_x.displayName="AttributesChangesContext";const Mx=(0,T.Z)((e=>({linkContainer:{textDecoration:"none",cursor:"pointer",marginLeft:"4px"},linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},disabledLink:{pointerEvents:"none",cursor:"default"},label:{color:e.palette.text.primary},change:e=>{let{level:t=0}=e;return{marginLeft:16*t+"px"}}}))),Vx=e=>{let{label:t,level:r,attributeType:n,attributeValue:a,oldValue:l,newValue:o,operation:i}=e;const p=Mx({level:r}),d=(0,g.useSelector)(h.ZP.selectors.getEntityUri),m=(0,s.useContext)(_x),f=(0,s.useCallback)((()=>{if((0,u.YkG)(n)){const e=(0,N.when)((0,N.anyPass)([(0,N.hasPath)(["value","newValue"]),(0,N.hasPath)(["value","oldValue"])]),(0,N.ifElse)((0,N.hasPath)(["value","newValue"]),(0,N.path)(["value","newValue"]),(0,N.path)(["value","oldValue"])))(a);return function(e,t,r){let n,a,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=l[t.refObjectURI];return o?(a=r===o.startObjectUri?o.endObjectUri:o.startObjectUri,n=r===o.startObjectUri?o.endObjectLabel:o.startObjectLabel):t.refEntity&&(a=t.refEntity.objectURI,n=l[a].label),{objectUri:a,objectLabel:n}}(n,e,d,m)}if("endObject"in n){const{endObjectUri:e,endObjectLabel:t}=a;return{objectUri:e,objectLabel:t}}}),[n,a,d,m]),y=(0,s.useCallback)((()=>{const{objectUri:e,objectLabel:t}=f()||{};if(!(0,N.isNil)(e)&&!(0,N.isNil)(t)){var r;const n=!1===(null===(r=m[e])||void 0===r?void 0:r.isExist);return c().createElement(xe.Z,{value:e,className:b()(p.linkContainer,{[p.disabledLink]:n})},c().createElement("span",{className:b()(p.linkLabel,{[p.label]:n})},(0,u.idV)(t)))}return null}),[f,m,p]),x=(0,s.useMemo)((()=>c().createElement("span",null,t,y())),[t,y]),E=(0,s.useCallback)((e=>{const t=(0,u.kDl)(e);return c().createElement(rt.Z,{value:t,dataTypeDefinition:mx(n,t)})}),[n]);return c().createElement(Lx,{className:p.change,label:x,oldValue:l&&E(l),newValue:o&&E(o),operation:i})},Ux=(0,T.Z)({title:{fontSize:"12px",letterSpacing:0,lineHeight:"16px",fontWeight:500,marginTop:"8px"}});function Bx(){return Bx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bx.apply(this,arguments)}const zx=e=>{let{changes:t}=e;const r=Ux();return c().createElement(c().Fragment,null,t.map(((e,t)=>(0,N.has)("level",e)?c().createElement(Vx,Bx({},e,{key:t})):c().createElement("div",{className:r.title,key:t},e.label))))},Fx=(0,N.pipe)((0,N.filter)((0,N.has)("operation")),N.length),Hx=(0,T.Z)((e=>({container:{boxSizing:"border-box",border:"1px solid rgba(0,0,0,0.03)",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.03)",padding:"10px",margin:"12px 16px 12px 0"},uri:{color:e.palette.primary.main,textDecoration:"none",cursor:"pointer"},label:{fontSize:"12px",letterSpacing:0,lineHeight:"16px"},showMoreLink:{marginTop:"8px"}}))),Wx=e=>{let{changes:t,objectsInfo:r,entityInfo:n,relationsInfo:a,max:l}=e;const o=Hx(),i=(0,g.useSelector)(h.ZP.selectors.getMetadata),[p,d]=(0,s.useMemo)((()=>((e,t,r,n)=>{const a=t=>(0,N.pipe)((0,N.pick)([t]),bx(e,r)),l=(0,N.curry)(((e,t)=>(0,N.reduce)(((e,r)=>(0,N.concat)(e,r(t))),[],e))),o=(0,N.propOr)([],r.uri)(t).reduce(((t,n)=>Dx(e,r,n,t)),{}),i=n.map((r=>((e,t,r)=>(0,N.propOr)([],r.uri)(t).reduce(((t,n)=>Dx(e,r,n,t)),{}))(e,t,r)));return[l([(0,N.pipe)((0,N.omit)(Sx),bx(e,r)),a(u.xPW.roles.name),a(u.xPW.tags.name),a(u.xPW.startDate.name),a(u.xPW.endDate.name)],o),(0,N.flatten)(n.map(((t,r)=>yx(e,t,i[r]))))]})(i,t,n,a)),[i,t,n,a]),m=(0,s.useMemo)((()=>{const e={label:x().text("Relationships")};return d.length>0?(0,N.flatten)([p,e,d]):p}),[p,d]),{isExpanded:f,onToggle:b,itemsToShow:y,collapsedSuggestionsCount:E}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const[r,n]=(0,s.useState)(!1),a=(0,s.useCallback)((()=>n((e=>!e))),[]),l=(0,s.useMemo)((()=>e.slice(0,t)),[e,t]),o=(0,s.useMemo)((()=>Fx(e)),[e]),i=(0,s.useMemo)((()=>Fx(l)),[l]);return{isExpanded:r,onToggle:a,itemsToShow:r?e:l,collapsedSuggestionsCount:o-i}}(m,l);return c().createElement(_x.Provider,{value:r},c().createElement("div",{className:o.container},c().createElement(xe.Z,{className:o.uri,value:(0,u.wwR)(n)},c().createElement("div",{className:o.label},(0,u.idV)(n.label))),c().createElement(zx,{changes:y}),E>0&&c().createElement(Rx,{onClick:b,suggestionsCount:E,isExpanded:f,className:o.showMoreLink})))};function qx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Gx(e,t,r[t])}))}return e}function Gx(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $x=(0,N.filter)((0,N.pipe)((0,N.prop)("uri"),u.WgC)),Kx=(0,N.filter)((0,N.pipe)((0,N.prop)("uri"),u.bC9)),Yx=(e,t)=>(0,N.filter)((0,N.allPass)([(0,N.pipe)((0,N.prop)("uri"),u.bC9),(0,N.pipe)((0,N.prop)("startObjectUri"),(0,N.equals)(t))]))(e),Xx=(0,N.curry)(((e,t)=>({entity:t,relations:Yx(e,t.uri)}))),Qx=(0,N.curry)(((e,t)=>{const r=e[t.startObjectUri],n=[t];return r?{entity:qx({},r,{uri:t.startObjectUri}),relations:n}:{relations:n}})),Jx=(e,t)=>{const{entity:r,relations:n}=t,{uri:a}=r,l=(0,N.pipe)((0,N.pathOr)([],[a,"relations"]),(0,N.concat)(n),N.uniq)(e);return e[a]={entity:r,relations:l},e};function eE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tE=e=>{let{task:t}=e;const{objectURIs:r}=t,n=Ry(r),{dcr:a,groupedObjects:l}=(e=>{const[t,r]=(0,s.useState)([]),[n,a]=(0,s.useState)(null),l=(0,yt._)(),o=(0,s.useCallback)((e=>(0,N.isEmpty)(e)?Promise.resolve([]):l((0,u.DnY)(e,{searchOptions:"ovOnly",defaultMaxValues:1}))),[]);return(0,s.useEffect)((()=>{(0,u.E6I)(e).then((e=>{const{changes:t,objectsInfo:n}=e,l=((e,t)=>(0,N.pipe)(N.keys,(0,N.filter)((t=>(0,N.prop)([t],e))),(0,N.map)((e=>qx({},t[e],{uri:e}))))(t))(t,n),i=(0,N.pipe)($x,(0,N.map)(Xx(l)))(l),s=(0,N.pipe)(Kx,(0,N.map)(Qx(n)))(l),[c,u]=(0,N.partition)((0,N.has)("entity"),s),p=u.map((0,N.path)(["relations",0,"startObjectUri"]));o(p).then((e=>{const t=u.map(((t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eE(e,t,r[t])}))}return e}({},t,{entity:e[r]})));(0,N.pipe)(N.flatten,(0,N.reduce)(Jx,{}),N.values,r)([i,c,t])})).catch(Dy),a(e)})).catch(Dy)}),[e,o]),{dcr:n,groupedObjects:t}})(n);return c().createElement(ix,{task:t,Icon:cx},a&&l.map(((e,t)=>c().createElement(tx,{key:t,last:t===l.length-1,divider:!0},c().createElement(Wx,{entityInfo:e.entity,relationsInfo:e.relations,changes:a.changes,objectsInfo:a.objectsInfo})))))},rE=(0,T.Z)({pmCard:{marginLeft:"-15px"}});function nE(){return nE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nE.apply(this,arguments)}const aE=e=>c().createElement("svg",nE({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#1976D2",cx:14,cy:14,r:14}),c().createElement("path",{d:"M22.5 14L18 9.5V13h-3.5L9 7.5 7.5 9l6.04 6H18v3.5l4.5-4.5zm-11.46 1.46L7.5 19 9 20.5l3.54-3.54-1.5-1.5z",fill:"#FFF",opacity:.87})));const lE=e=>(0,s.useCallback)((e=>{let t={},r=[];return async n=>{let{max:a,offset:l,force:o}=n,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(n,["max","offset","force"]),s=o;const c=Object.keys(t);if(s=s||!(0,N.equals)(Object.keys(i),c),!s)for(const e of c)s=s||!(0,N.equals)(t[e],i[e]);return s&&(r=await e(i),t=i),{response:r.slice(l,l+a),total:r.length,originalResponse:r}}})(e),[e]),oE=e=>{let{enabled:t,entity:r,filter:n,onFinishLoading:a,onStartLoading:l,options:o,page:i,rowsPerPage:c,sorting:p}=e;const{order:d,field:m}=p||{},[f,b]=(0,s.useState)(0),[y,x]=(0,s.useState)([]),[E,v]=(0,s.useState)({}),w=(0,g.useSelector)(h.ZP.selectors.getTenant),O=(0,g.useSelector)(h.ZP.selectors.getDtssPath),C=(0,g.useSelector)(h.ZP.selectors.getDataTenants),T=(0,s.useMemo)((()=>({dtssPath:O,dataTenants:C,entity:r,customerTenant:w,dtssRequest:u.Rgl})),[O,C,r,w]),S=(0,s.useCallback)((0,u.U_T)(T,u.SP6),[T]),k=lE(S),I=lE(u.bFH),P=(0,N.prop)("uri",r),D=(0,yt._)(),A=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t&&(null==l||l(),D((0,u.biM)(r)?I({dtssPath:O,entity:r,customerTenant:w,offset:i*c,max:c,force:e}):k({entityUri:P,offset:i*c,max:c,filter:n,sort:m,order:d,force:e,deep:o.showTransitiveMatches?void 0:1,activeness:o.showInactiveEntities?u.YJ7.ALL:u.YJ7.ACTIVE_ONLY})).then((e=>{const{response:t,total:r,originalResponse:n}=e;b(r),x(t),(0,u.B1H)(n).length>0&&v((0,u.SvV)(n))})).finally((()=>{null==a||a()})))}),[O,t,P,m,n,I,k,a,l,o,d,i,c,D,w]);return(0,s.useEffect)((()=>{A()}),[A]),{total:f,matches:y,entitiesMap:E,loadMatches:(0,s.useCallback)((()=>{A(!0)}),[A])}},iE=(0,T.Z)({root:{display:"flex",flexDirection:"column",paddingRight:"12px",paddingTop:"8px",paddingBottom:"8px","& + &":{borderTop:"1px solid rgba(0,0,0, 0.12)"}},profileCardWrapper:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},profileCardContainer:{flexGrow:1},rulesContainer:{paddingLeft:"40px"}}),sE=e=>{let{children:t,entitiesMap:r,entity:n,match:a,metadata:l,className:o}=e;const i=iE();return c().createElement("div",{className:b()(i.root,o)},c().createElement("div",{className:i.profileCardWrapper},c().createElement(Op,{entity:a.object,classes:{container:i.profileCardContainer},disableEntityTypeColor:!0}),t),c().createElement("div",{className:i.rulesContainer},c().createElement(rp,{match:a,metadata:l,entitiesMap:r,entity:n})))},cE={showTransitiveMatches:!0,showInactiveEntities:!1},uE=e=>{let{task:t}=e;const r=rE(),{objectURIs:n}=t,a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),{matches:o,entitiesMap:i}=oE({enabled:!!a.uri,entity:a,filter:"",rowsPerPage:Number.MAX_SAFE_INTEGER,page:0,options:cE}),s=null==o?void 0:o.find((e=>{let{object:t}=e;return n.includes(t.uri)}));return c().createElement(ix,{task:t,Icon:aE},s&&c().createElement(tx,{last:!0},c().createElement("div",{className:r.pmCard},c().createElement(sE,{metadata:l,entity:a,match:s,entitiesMap:i}))))};function pE(){return pE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pE.apply(this,arguments)}const dE=e=>c().createElement("svg",pE({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("circle",{fill:"#205191",cx:14,cy:14,r:14}),c().createElement("path",{d:"M9.667 20.622c-.92 0-1.667-.744-1.667-1.662V8.99c0-.916.747-1.66 1.667-1.66h2.446A1.993 1.993 0 0114 6l.162.006a1.992 1.992 0 011.725 1.323h2.446c.92 0 1.667.745 1.667 1.662v9.97c0 .917-.747 1.661-1.667 1.661zm9-1.33V8.66h-1.334v1.993h-6.666V8.66H9.333v10.634h9.334zM15.86 14.46v1.302h-5.206V14.46h5.206zm1.494-2v1.302h-6.7V12.46h6.7zM14 7.33c.367 0 .667.298.667.664a.668.668 0 01-1.334 0c0-.366.3-.665.667-.665z",fill:"#FFF",opacity:.87})));function mE(){return mE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mE.apply(this,arguments)}const gE=e=>c().createElement("svg",mE({width:28,height:28,viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",opacity:.87},c().createElement("circle",{fill:"#0D47A1",cx:14,cy:14,r:14}),c().createElement("path",{d:"M8.17 9.824v8.995c0 .886.72 1.606 1.607 1.606h8.352c.192 0 .375-.035.546-.097l1.38 1.382.804-.804-1.32-1.32-1.09-1.089-8.993-8.994-1.092-1.092-1.317-1.317-.803.803L8.17 9.824zm9.316 9.316h-8.03v-8.03l8.03 8.03zM9.777 7.575c-.192 0-.376.033-.55.094L10.42 8.86h.32v.322l1.607 1.606h4.819V8.86h1.284v8.03l1.285 1.286V9.182c0-.887-.72-1.607-1.606-1.607h-2.358a1.931 1.931 0 00-1.818-1.285 1.93 1.93 0 00-1.818 1.285H9.777zm3.533.643c0-.353.29-.643.643-.643.353 0 .642.29.642.643a.644.644 0 01-.642.642.644.644 0 01-.643-.642z",fill:"#FFF"})));class hE{}hE.build=e=>{let{task:t}=e;const{processType:r}=t;switch(r){case u.Yj_.dataChangeRequestReview:return c().createElement(tE,{task:t});case u.Yj_.potentialMatchReview:return c().createElement(uE,{task:t});case u.Yj_.recommendForDelete:return c().createElement(ix,{task:t,Icon:gE});default:return c().createElement(ix,{task:t,Icon:dE})}};const fE=hE,bE=e=>{let{task:t}=e;return fE.build({task:t})};var yE=r(8560);const xE=(0,T.Z)((e=>({popoverPaper:{width:"464px"},title:{fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",color:e.palette.text.primary,marginBottom:"17px"},content:{display:"flex",flexDirection:"column",padding:"23px 24px 14px 24px"},simpleDropDownSelector:{marginBottom:"20px"},inputRoot:{paddingTop:"0 !important",paddingBottom:"0 !important"},select:{fontSize:"14px"},footer:{display:"flex",justifyContent:"flex-end",padding:"5px 8px 8px",borderTop:"1px solid rgba(0,0,0,0.12)"},cancelButton:{marginRight:"8px"},input:{fontSize:"14px"}}))),EE=e=>{let{anchorEl:t,onClose:r}=e;const n=xE(),[a,l]=(0,s.useState)(""),[o,i]=(0,s.useState)(null),[p,d]=(0,s.useState)(!1),{definitions:m}=(()=>{const[e,t]=(0,s.useState)([]),r=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),n=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),a=(0,g.useSelector)(h.ZP.selectors.getTenant),l=(0,g.useSelector)(h.ZP.selectors.getEntity).type;return(0,s.useEffect)((()=>{(0,u.IU6)({workflowPath:r,environment:n,tenant:a}).then((e=>{let{data:r}=e;return t(((e,t)=>e.filter((e=>{let{manualStart:r,objectTypes:n}=e;return r&&(!n||(null==n?void 0:n.some((e=>e===t))))})))(r,l))}))}),[l,r,n,a]),{definitions:e}})(),{processInstance:f,loading:b}=(()=>{const{loadWorkflowTasks:e}=(0,s.useContext)(Py),t=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),r=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),n=(0,g.useSelector)(h.ZP.selectors.getTenant),a=(0,g.useSelector)(h.ZP.selectors.getEntity).uri,[l,o]=(0,s.useState)(!1);return{processInstance:(0,s.useCallback)(((l,i)=>(o(!0),(0,u.$ju)({workflowPath:t,tenant:n,environment:r,processType:i,comment:l,objectURIs:[a]}).then((()=>{e()})).catch((e=>{throw Dy(e),e})).finally((()=>{o(!1)})))),[a,r,e,n,t]),loading:l}})(),y=Boolean(t);return c().createElement(c().Fragment,null,c().createElement(Lr.ZP,{open:y,anchorEl:t,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},classes:{paper:n.popoverPaper}},c().createElement("div",{className:n.content},c().createElement(v.Z,{className:n.title},x().text("Add new workflow")),c().createElement(_l.Z,{className:n.simpleDropDownSelector,variant:"filled",height:40,TextFieldProps:{InputProps:{disableUnderline:!0}},placeholder:x().text("Select task type"),value:o,onChange:e=>{i(e)},label:"",options:m.map((e=>({value:e.type,label:e.displayName})))}),c().createElement(zc.Z,{variant:"filled",hiddenLabel:!0,size:"small",placeholder:"Type a comment",InputProps:{disableUnderline:!0,classes:{input:n.input,root:n.inputRoot}},value:a,onChange:e=>{l(e.target.value)},multiline:!0})),c().createElement("div",{className:n.footer},c().createElement(Ze.Z,{disabled:b,className:n.cancelButton,onClick:r},x().text("Cancel")),c().createElement(Ze.Z,{disabled:b,color:"primary",onClick:()=>{f(a,null==o?void 0:o.value).then((()=>{d(!0),l(""),i(null)})).catch((()=>{}))}},x().text("Start")))),c().createElement(yE.Z,{container:document.body},c().createElement(Wn.Z,{open:p,autoHideDuration:5e3,onClose:()=>{d(!1)},message:x().text("A new workflow has started")})))},vE=(0,T.Z)({button:{padding:"9px 16px 9px 12px",marginLeft:"auto",marginRight:"8px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"}}),wE=()=>{const e=vE(),[t,r]=(0,s.useState)(null),n=Ay(),a=n("START_PROCESS_INSTANCE"),l=n("VIEW_PROCESS_DEFINITIONS");return a&&l?c().createElement(c().Fragment,null,c().createElement(Ze.Z,{color:"primary",className:e.button,onClick:e=>r(e.currentTarget)},c().createElement($r.Z,{className:e.icon}),c().createElement("div",{className:e.buttonLabel},x().text("Add"))),c().createElement(EE,{anchorEl:t,onClose:()=>r(null)})):null};function OE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const CE=e=>{const{processTypes:t,assignee:r,showClosedTasks:n}=e||{},a=(0,yt._)(),l=(0,g.useSelector)(h.ZP.selectors.getWorkflowPath),o=(0,g.useSelector)(h.ZP.selectors.getWorkflowEnvironmentUrl),i=(0,g.useSelector)(h.ZP.selectors.getTenant),c=(0,g.useSelector)(h.ZP.selectors.getEntityUri),p=(0,g.useSelector)(h.ZP.selectors.getIsEditableMode),d=Ay()("VIEW_TASKS"),m=!(!l||!o)&&d,[f,b]=(0,s.useState)(null),[y,x]=(0,s.useState)(0),[E,v]=(0,s.useState)(!1),w=(0,s.useCallback)((()=>{v(!0);const e=!Array.isArray(t)||t.includes("*")?null:t,s=(e||[null]).map((e=>(0,u.uT0)({entityUri:c,workflowPath:l,environment:o,tenant:i,filter:{assignee:r,processType:e},includeClosed:!!n})));a(Promise.all(s)).then((t=>{const n=(0,N.pipe)((0,N.map)((0,N.prop)("data")),(0,N.reject)(N.isNil),N.flatten,(0,N.uniqBy)((0,N.prop)("taskId")),(0,N.filter)(TE(e,r)))(t);b(n),x(n.length)})).catch((e=>{console.warn("Workflow error",e)})).finally((()=>{v(!1)}))}),[c,o,a,i,l,r,n,t]);(0,s.useEffect)((()=>{c&&m&&!(0,u.ZiX)(c)&&w()}),[m,c,w,p]);const O=(0,s.useCallback)(((e,t)=>{b((r=>r.map((r=>r.taskId===e?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){OE(e,t,r[t])}))}return e}({},r,t):r))))}),[]);return{tasks:f,total:y,loading:E,updateTaskState:O,loadWorkflowTasks:w}},TE=(e,t)=>r=>(!e||e.includes(r.processType))&&(!t||t===r.assignee);function SE(){return SE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SE.apply(this,arguments)}const kE=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return c().createElement("svg",SE({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"},r),c().createElement("defs",null,c().createElement("path",{d:"M17.045 20.455l1.41-1.41-3.41-3.41-1.41 1.41 3.41 3.41zm-9.5-12.41h3.5v5.59l-5.41 5.41 1.41 1.41 6-6v-6.41h3.5l-4.5-4.5-4.5 4.5z",id:"svg2402947257a"})),c().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"svg2402947257b",fill:"#fff"},c().createElement("use",{xlinkHref:"#svg2402947257a",transform:"rotate(90 12.045 12)"})),c().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg2402947257b)",d:"M0 0h24v24H0z"})))},NE=(0,T.Z)((e=>({button:{padding:"9px 16px 9px 12px","& svg g path":{fill:e.palette.primary.main,fillOpacity:1}},iconButton:{"& svg g path":{fill:e.palette.primary.main,fillOpacity:1}},startIcon:{marginLeft:0,marginRight:"8px",width:"18px",height:"18px",alignItems:"center"},label:{whiteSpace:"nowrap",fontSize:"14px",lineHeight:"16px",letterSpacing:0},overflowStyle:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},menuIcon:{marginRight:"12px"},menuItem:{minHeight:"28px",padding:"2px 16px 2px 12px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}})));function IE(){return IE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IE.apply(this,arguments)}let PE;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(PE||(PE={}));const DE=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=PE.iconButton,label:a,disabled:l,icon:o,onClick:i=wn.ZT,onMenuClose:s=wn.ZT}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","label","disabled","icon","onClick","onMenuClose"]);const p=NE();return(()=>{switch(n){case"iconButton":return c().createElement(be.k,IE({disabled:l,className:b()(p.iconButton,r),size:"S",tooltipTitle:a,onClick:i,icon:o},u));case"button":return c().createElement(Ze.Z,IE({className:b()(p.button,r),disabled:l,startIcon:c().createElement(o,null),onClick:i,color:"primary",classes:{startIcon:p.startIcon,label:p.label}},u),c().createElement(pi.C,{value:a},c().createElement("div",{className:p.overflowStyle},a)));case"menuItem":{const e=()=>{s(),i()};return c().createElement(Ma.Z,IE({classes:{root:p.menuItem},onClick:e,disabled:l,ref:t},u),c().createElement(c().Fragment,null,c().createElement(o,{className:p.menuIcon}),c().createElement(v.Z,{classes:{root:p.menuText}},a)))}}})()}));DE.displayName="ActionButton";const AE=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a,onError:l=wn.ZT}=e;const o=(0,g.useSelector)(h.ZP.selectors.getTenant),i=(0,g.useSelector)(h.ZP.selectors.getDtssPath),[c,p]=(0,s.useState)(!1);return{isPending:c,sendMergeAllRequest:(0,s.useCallback)((()=>{null==a||a(),p(!0);const e={dtssPath:i,customerTenant:o,entity:r,entities:t};((0,u.biM)(r)?(0,u.uJQ)(e):(0,u.OxG)(e)).catch(l).finally((()=>{null==n||n(),p(!1)}))}),[i,t,r,n,a,o])}};function RE(){return RE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RE.apply(this,arguments)}const jE=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=PE.iconButton,onMenuClose:a=wn.ZT,disabled:l=!1,entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","onMenuClose","disabled","entity","entities","onStartRequest","onFinishRequest","onError"]);const{sendMergeAllRequest:m}=AE({entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:p});return c().createElement(DE,RE({className:r,disabled:l,mode:n,label:x().text("Merge"),icon:kE,onClick:m,onMenuClose:a,ref:t},d))}));function ZE(){return ZE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZE.apply(this,arguments)}jE.displayName="mergeButton";const LE=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return c().createElement("svg",ZE({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"},r),c().createElement("defs",null,c().createElement("path",{d:"M17 13.138l4.5 4.5-4.5 4.5V18.5h-1.247l-3.488-3.479 1.413-1.414 2.901 2.893H17v-3.362zM17 1.5L21.5 6 17 10.5V7.138h-.421l-11.03 11H2v-2h2.723l11.03-11H17V1.5zm-11.45 4l3.294 3.286-1.414 1.413L4.723 7.5H2v-2h3.55z",id:"svg3400996178a"})),c().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"svg3400996178b",fill:"#fff"},c().createElement("use",{xlinkHref:"#svg3400996178a"})),c().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3400996178b)",d:"M0 0h24v24H0z"})))},_E=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a}=e;const l=(0,g.useSelector)(h.ZP.selectors.getTenant),o=(0,g.useSelector)(h.ZP.selectors.getDtssPath),[i,c]=(0,s.useState)(!1);return{isPending:i,sendMarkAsNotMatchRequest:(0,s.useCallback)((()=>{null==a||a(),c(!0);const e={dtssPath:o,customerTenant:l,entity:r,entities:t};((0,u.biM)(r)?(0,u.bMg)(e):(0,u.fZN)(e)).finally((()=>{null==n||n(),c(!1)}))}),[o,t,r,n,a,l])}};function ME(){return ME=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ME.apply(this,arguments)}const VE=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=PE.iconButton,onMenuClose:a=wn.ZT,disabled:l=!1,entity:o,entities:i,onStartRequest:s,onFinishRequest:u}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","mode","onMenuClose","disabled","entity","entities","onStartRequest","onFinishRequest"]);const{sendMarkAsNotMatchRequest:d}=_E({entity:o,entities:i,onStartRequest:s,onFinishRequest:u});return c().createElement(DE,ME({className:r,disabled:l,mode:n,label:x().text("Not a match"),icon:LE,onClick:d,onMenuClose:a,ref:t},p))}));function UE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}VE.displayName="notMatchButton";const BE=e=>{let{actions:t,dispatch:r}=e;return(0,s.useMemo)((()=>Object.entries(t).reduce(((e,t)=>{let[n,a]=t;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){UE(e,t,r[t])}))}return e}({},e,{[n]:(0,N.pipe)(a,r)})}),{})),[r,t])};function zE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){FE(e,t,r[t])}))}return e}function FE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const HE=[],WE=e=>console.error("Collaboration error",e),qE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:HE,t=arguments.length>1?arguments[1]:void 0;const r=(0,g.useSelector)(h.ZP.selectors.getEntity),n=(0,g.useSelector)(h.ZP.selectors.getTenant),a=(0,g.useSelector)(h.ZP.selectors.getCollaborationPath),l=(0,g.useSelector)(h.ZP.selectors.isCollaborationEnabled),[o,i]=(0,s.useState)(null),[c,p]=(0,s.useState)([]),[d,m]=(0,s.useState)(null),[f,b]=(0,s.useState)(null),[y,x]=(0,s.useState)(!1),[E,v]=(0,s.useState)(!1),w=(0,s.useCallback)((e=>{m((t=>zE({},t,e)))}),[]),O=null==r?void 0:r.uri,C=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(l&&O&&!(0,u.ZiX)(O)){const r=e=>{console.warn("Collaboration error",e),m(null)};(0,N.pipe)(u.$oF,(0,N.andThen)((0,N.map)((0,N.props)(["objectId","comments"]))),(0,N.andThen)(N.fromPairs),(0,N.andThen)(t?m:w),(0,N.otherwise)(r))({uris:e,tenant:n,collaborationPath:a})}else m(null)}),[w,a,O,l,n]);(0,s.useEffect)((()=>{C(e,!0)}),[e,C]);const T=(0,s.useCallback)(((e,t)=>{(0,u.liG)({collaborationPath:a,tenant:n,relatedObjectUri:e,pageToken:t}).then((e=>{let{items:r,nextPageToken:n}=e;p((e=>t?(0,N.uniqBy)((0,N.prop)("commentId"),[...e,...r]):r)),i(n)})).catch(WE)}),[a,n]),S=(0,s.useCallback)((e=>{v(!0),(0,u.d7q)({collaborationPath:a,tenant:n,commentId:e}).then(b).catch(WE).finally((()=>v(!1)))}),[a,n]),k=(e,t)=>{b(e),m((r=>zE({},r,{[t]:[...r[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),p((t=>[e,...t]))},I=e=>{b(e),p((0,N.map)((0,N.when)((0,N.propEq)("commentId",e.commentId),(0,N.always)(e))))},P=(e,t)=>{b(null),m((r=>{const n=r[t]||[];return zE({},r,{[t]:n.filter((t=>t.commentId!==e))})})),p((t=>t.filter((t=>t.commentId!==e))))},D=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:l,uri:o,relatedObjectUris:i}=e;x(!0);const s={objectId:o,content:t,relatedObjectUris:i,objectType:l,visibility:"public",namedUsers:r,permanentLink:""};return(0,u.Yrx)({collaborationPath:a,tenant:n,data:s}).then((e=>{let[t]=e;return k(t,o)})).catch(WE).finally((()=>x(!1)))}),[a,n]),A=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:l,uri:o,relatedObjectUris:i,commentId:s,replies:c}=e;x(!0);const p={objectId:o,content:t,relatedObjectUris:i,objectType:l,visibility:"public",namedUsers:r,permanentLink:"",commentId:s,replies:c};return(0,u.uAg)({collaborationPath:a,tenant:n,data:p}).then((e=>I(zE({},e,{replies:c})))).catch(WE).finally((()=>x(!1)))}),[a,n]),R=(0,s.useCallback)((e=>{let{uri:t,commentId:r}=e;x(!0),(0,u.YFy)({collaborationPath:a,tenant:n,commentId:r}).then((()=>P(r,t))).catch(WE).finally((()=>x(!1)))}),[a,n]),j=(0,s.useCallback)(((e,t,r)=>{const n="resolve"===e.action?"resolved":"open";b("resolved"===n?e=>{if(e)return null}:t=>{if(t)return zE({},t,{replies:[...t.replies,e]})}),m((e=>zE({},e,{[t]:e[t].map((e=>e.commentId===r?zE({},e,{status:n,replies:e.replies+1}):e))}))),p((t=>t.map((t=>t.commentId===r?zE({},t,{status:n,replies:[...t.replies,e]}):t))))}),[]),Z=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,commentId:l,action:o,uri:i}=e;x(!0);const s={content:t,action:o,namedUsers:r};return(0,u.PP2)({collaborationPath:a,tenant:n,commentId:l,data:s}).then((e=>{let[t]=e;return j(t,i,l)})).catch(WE).finally((()=>x(!1)))}),[a,n,j]),L=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;Z({content:"",namedUsers:[],commentId:t,action:"resolve",uri:r})}),[Z]),_=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;Z({content:"",namedUsers:[],commentId:t,action:"reopen",uri:r})}),[Z]),M=(0,s.useCallback)((()=>{b(null)}),[]);return{clearCurrentComment:M,comments:c,commentsMap:d,createComment:D,createReply:Z,currentComment:f,deleteComment:R,editComment:A,getComment:S,getComments:T,getCommentsCount:C,loading:E,objectTypes:t,pageToken:o,reOpenThread:_,resolveThread:L,sending:y}};function GE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $E=e=>{let{sorting:t,filter:r,page:n,rowsPerPage:a,config:l,entity:o,relationActivityFilter:i,mode:c}=e;const[p,d]=(0,s.useState)(!1),m=(0,g.useDispatch)(),f=(0,g.useSelector)(h.ZP.selectors.getTenant),b=(0,g.useSelector)(h.ZP.selectors.getDtssPath),{activityFilter:y,globalFilter:x}=(0,g.useSelector)(h.ZP.selectors.getGlobalSearchRequestOptions)||{},E=(0,yt._)(),v=(0,s.useCallback)((()=>{if(null!=o&&o.uri){const e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){GE(e,t,r[t])}))}return e}({},l.content,{sortBy:null==t?void 0:t.field,order:null==t?void 0:t.order,returnDates:!0,returnObjects:!0,activeness:{relation:i||u.Ng6.ALL,entity:y},max:a,offset:n*a,filter:(0,u.vyX)(x,r)||void 0}),s=(0,N.cond)([[(0,N.pipe)((0,N.prop)("uri"),u.ZiX),()=>Promise.resolve([{total:0}])],[u.biM,t=>(0,u.n_1)({entityUri:t.uri,configs:[e],customerTenant:f,dataTenant:t.dataTenant,dtssPath:b})],[N.T,t=>(0,u.N6e)(t.uri,[e])]]);d(!0),E(s(o)).then((e=>{let[{connections:t,total:r}]=e;m(h.N5.relations.actions.relationsLoaded({id:l.id,connections:t,total:r}))})).finally((()=>{d(!1)}))}}),[y,l,m,b,null==o?void 0:o.uri,null==o?void 0:o.dataTenant,r,x,n,i,a,E,t,f]),w=(0,s.useRef)(!1);w.current=!1,(0,s.useEffect)((()=>{w.current=!0,v()}),[v]);const O=(0,cb.D)(c);return(0,s.useEffect)((()=>{c!==u.ARY.Viewing||w.current||O===c||(w.current=!0,v())}),[v,c,O]),{isLoading:p,reload:v}},KE=(e,t)=>{const r=(0,s.useRef)(!1);(0,s.useEffect)((()=>{t&&!r.current&&(r.current=!0,e())}),[e,t])};var YE=r(11326);const XE=()=>{const[e,t]=(0,s.useState)([]),r=(0,g.useSelector)(h.ZP.selectors.getTenant),n=(0,g.useSelector)(h.ZP.selectors.getUIPath),a=e=>{console.warn("Users error",e),t([])};return(0,s.useEffect)((()=>{(0,u.kz_)(r,n).then((e=>{let{array:r}=e;return t(r)})).catch(a)}),[r,n]),e};function QE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JE=(e,t)=>{const r=(0,s.useRef)();(0,s.useEffect)((()=>{if(r.current){const n=Object.keys(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){QE(e,t,r[t])}))}return e}({},r.current,t)),a={};n.forEach((e=>{r.current[e]!==t[e]&&(a[e]={from:r.current[e],to:t[e]})})),Object.keys(a).length&&console.log("[why-did-you-update]",e,a)}r.current=t}))};var ev=r(47081),tv=r(8007);const rv=c().createContext(!1);rv.displayName="ProfilePerspectiveViewContext";const nv=c().createContext("");nv.displayName="IdContext"}}]);