@reltio/remotes 1.4.947 → 1.4.948
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/934.js +1 -1
- package/package.json +1 -1
package/934.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[934],{92934:(e,t,r)=>{r.r(t),r.d(t,{ALWAYS_VISIBLE_TYPE_URIS:()=>Ca,ActionButton:()=>VE,ActionButtonMode:()=>ME,ActivityLog:()=>n.Z,ActivityLogFilter:()=>a.Z,ActivityTypes:()=>l.I,AddWorkflowButton:()=>PE,ArrowExpandButton:()=>Ut,AsyncMountContext:()=>da,AttributeListItem:()=>m.Z,AttributeTitle:()=>Q,AttributesList:()=>Pa,AttributesPager:()=>to,AttributesTable:()=>sf,AttributesView:()=>ui,AutoSizeList:()=>Ni.Z,AvatarWithFallback:()=>Pi,BarChart:()=>Js.Z,BasicTable:()=>Di.Z,BasicTableContext:()=>Ai.X,BasicTablePagination:()=>ss.Z,BasicView:()=>O.Z,BasicViewContent:()=>Qs.Z,BasicViewHeader:()=>C.Z,BlockImageGalleryDialogContext:()=>Or,BranchDecorator:()=>D,COMMENTS_CONTAINER_VISIBILITY_AREA:()=>J,CardinalityMessage:()=>Zl,ChartsFactory:()=>nc.Z,ClickAwayProvider:()=>ic,CollaborationContext:()=>ne,CollaborationItem:()=>qe,CollapseButton:()=>Ns.Z,CollapseRowButton:()=>Ds,ColorBar:()=>sc.Z,ColumnFilterType:()=>Zi.Dq,ColumnsDataType:()=>Zi.uz,ColumnsSettings:()=>rs,CommentsContainer:()=>et,ConfigureColumnsPopup:()=>bc,ConfirmDeleteDialog:()=>ih,ConfirmationDialog:()=>oh,ConnectionRelationTypeSelector:()=>vc,CrosswalkDragLayer:()=>ff,CrosswalkEditor:()=>Lf,CrosswalkType:()=>bf,CrosswalksDisplayProvider:()=>Um,DEFAULT_OVERLAY_OPTIONS:()=>pb,DataTypeValue:()=>at.Z,DataTypeValueEditor:()=>aa.Z,DateEditor:()=>Rc.Z,DateRangeEditor:()=>Dc.Z,DateRangeTypes:()=>Eb.K,DefaultCellValueRenderer:()=>cs.Z,DeltaTypes:()=>o.w,Drawer:()=>Sc,DropDownEditor:()=>kc.Z,DropDownMenuButton:()=>be.Z,DropDownSelector:()=>_a.Z,DropdownIndicator:()=>cc.Z,DropdownIndicatorWithIconButton:()=>uc.Z,EMPTY_STATE_ICONS:()=>Vc.B9,EMPTY_STATE_VARIANTS:()=>Vc.tC,EditableAttribute:()=>Cl,EditableImageAttributesLine:()=>Jn,EmptyState:()=>Vc.ZP,EmptyStub:()=>On.Vd,EntitiesMapContext:()=>xe,EntityAvatar:()=>bt,EntityCreator:()=>al,EntityMarkerContext:()=>ab,EntitySelector:()=>gl,EntityTypeBadge:()=>Uc,EntityTypeIcon:()=>Ma.Z,EntityTypesSelector:()=>lu,EntityUriLink:()=>Ee.Z,ErrorBoundary:()=>ou.Z,ErrorMessage:()=>ta,ErrorPopup:()=>iu.Z,ErrorWrapper:()=>sa,ExpandableSearchInput:()=>Lm,ExpandedAttributesProvider:()=>Yg,ExpandedValueTooltip:()=>di.C,FacetViewHeader:()=>k,FileTypeEditor:()=>jc.Z,FilterButton:()=>is,FilterValueEditor:()=>Ic.Z,FlipCard:()=>mu,HideOnShrink:()=>fu,HierarchicalAttributeTooltip:()=>Ou,Highlighter:()=>Xr,HistoryActivityType:()=>xb,HistoryChangeTypes:()=>Mb,HistoryDiffContext:()=>ct,HistoryHeader:()=>Sy,HistoryPanelEmptyState:()=>Iy,HistoryView:()=>Jb,IdContext:()=>pv,ImageAttributesLine:()=>Mo,ImageGalleryDialog:()=>Co,ImportButton:()=>Nu,ImportModes:()=>ku,InlineAttributesPager:()=>Fg,InlineImageAttribute:()=>_g,InlineNestedAttribute:()=>eh,InlineReferenceAttribute:()=>Dg,LightArrowTooltip:()=>Qm,LinearLoadIndicator:()=>Dn,Link:()=>Pu,LoadingSpinner:()=>Du,MAP_DRAWING_MODES:()=>ub,MAP_MINIMUM_SCALE_RADIUS:()=>db,Marginator:()=>th.Z,MatchRulesBlock:()=>np,MenuWithPopper:()=>pc.Z,MergeButton:()=>zE,ModeSwitcher:()=>vo,ModeSwitcherSelect:()=>sp,MoreAttributesButton:()=>en,MultiSelect:()=>Mp.Z,MultiValueChip:()=>Vl.Z,MultipleInput:()=>cp.Z,NestedAttribute:()=>Kt,NestedAttributeEditor:()=>La,NoData:()=>_c,NoResults:()=>Mc.X,NotMatchButton:()=>GE,NumberEditor:()=>Pc.Z,OvIcon:()=>st,PieChart:()=>ec.Z,PivotingAttributeContext:()=>w,Popper:()=>Ye.Z,PopupBoundariesContext:()=>cv.p,PopupWithArrow:()=>Xe,PotentialMatchReviewCard:()=>hp,ProfileBand:()=>vp,ProfileBandHistory:()=>Ny,ProfileBandNavigation:()=>Xs,ProfileCard:()=>Cp,ProfileMatchCard:()=>fE,ProfilePerspectiveViewContext:()=>uv,QueryBuilderAttributeDataType:()=>Zi.eB,QueryBuilderAttributeType:()=>Zi.Xw,QueryBuilderRow:()=>jp,QueryBuilderRowsGroup:()=>_p,ReactSelectOptionFilters:()=>Vp,ReactSortableTree:()=>Fd,ReactSortableTreeHandlers:()=>Rd,ReactSortableTreeUtils:()=>dd,ReadOnlyAttribute:()=>ar,ReadOnlyAttributeValuesBlock:()=>Si,ReadOnlyAttributesList:()=>ri,ReadOnlyAttributesPager:()=>ti,ReferenceAttribute:()=>nr,ReferenceAttributeEditor:()=>wl,RelatedObjectUrisContext:()=>ae,RelationEditor:()=>Zy,RelationTypeSelector:()=>Ei,ReltioGridLayout:()=>Hd.Z,ReltioMap:()=>bb,ResizablePanes:()=>Kd,RowCellAutoSizer:()=>Ss,Score:()=>bp,ScoreLabel:()=>K,ScrollableTabs:()=>Mm.Z,SearchInput:()=>Vr.Z,SelectionPopup:()=>Ur,SelectionPopupPopper:()=>lm,SelectorWithOnlyOptionAutoSelect:()=>sm,SideButtonsPanel:()=>pm,SidePanel:()=>bm,SidePanelContentHeader:()=>xm,SidePanelEmptyState:()=>hm,SimpleAttribute:()=>Lt,SimpleAttributeEditor:()=>wa,SimpleDropDownSelector:()=>Ml.Z,SimpleMatchRulesBlock:()=>Wu,SimpleMatchRulesBuilder:()=>$u,SmallIconButton:()=>_t.Z,SmallIconButtonWithTooltip:()=>ye.k,SortingType:()=>Zi.nI,SourceCrosswalksRow:()=>jf,SourceIcon:()=>Em,Spacer:()=>vm.Z,TableContext:()=>Ai.X,TableWithBars:()=>tc.Z,TextEditor:()=>Nc.Z,TimestampEditor:()=>Ac.Z,TransitiveMatchBlock:()=>rp,TreeChart:()=>rc.Z,UsersContext:()=>Te,VerticalDivider:()=>Om,VerticalHeadingsTable:()=>km,ViewIdContext:()=>Ga.m,ViewMoreToggle:()=>Dm,VirtualGroupedList:()=>Gr,WhiteSearchInput:()=>tm,WorkflowComments:()=>lx,WorkflowTaskCard:()=>TE,WorkflowTasksContext:()=>_y,basicTableViewState:()=>Os,buildColumnsFilter:()=>ds.Tz,columnFilterToMdmFilter:()=>ds.su,createStandardAction:()=>On.zD,defaultGetRowCellHeight:()=>us.Z,defaultRenderRowCell:()=>ps.Z,getChecked:()=>On.IR,getValue:()=>On.NA,groupCrosswalksByTypesAndSources:()=>Vf,isIE:()=>On.w1,mergeClasses:()=>On.ze,noop:()=>On.ZT,parseJSON:()=>On.Rx,stopPropagation:()=>On.UW,toggleSortOrder:()=>On.Dh,useActions:()=>YE,useActivitiesLoader:()=>i.d,useAsyncMount:()=>ga,useAttributeExpanded:()=>Kg,useBasicTableCellRenderer:()=>Ms,useClickableStyle:()=>lc.d,useCollaboration:()=>ev,useConfigPermissions:()=>sv.l,useCrosswalkActions:()=>mf,useCrosswalkColor:()=>zm,useCrosswalkFocus:()=>Wm,useCrosswalkHighlight:()=>Hm,useDidUpdateEffect:()=>te.D,useDynamicRowCellHeight:()=>js,useHighlightedCrosswalks:()=>Fm,useHistory:()=>Nb,useHistoryDiff:()=>Rb,useHistorySlice:()=>yb,useKeyboardNavigation:()=>$r,useMarkAsNotMatchRequest:()=>WE,useMatchesLoader:()=>gE,useMergeAllRequest:()=>BE,useModifiedEntity:()=>df,usePagingSimulator:()=>mE,usePrevious:()=>gb.D,useProfileActivitiesLoader:()=>d,useRelationTypeSelector:()=>yc,useRelationsLoader:()=>rv,useRunOnceAfterValueInitialization:()=>nv,useSafePromise:()=>ze._,useSavedState:()=>av.a,useUsers:()=>lv,useWhyDidYouUpdate:()=>iv,useWorkflowAssignee:()=>Fy,useWorkflowCheckPermission:()=>Vy,useWorkflowComments:()=>nx,useWorkflowTasks:()=>RE,withAsyncMount:()=>fa,withFilterAtBottom:()=>ji.Z,withPercents:()=>ac.Z,withTableContext:()=>Ri.Z,withTooltip:()=>lt.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(58263),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 R(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){A(e,t,r[t])}))}return e}function A(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)(R({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)(R({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:R({},L.titleRow,{marginBottom:"3px"})}));var B=r(13980),U=r.n(B),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"],Y=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)]])()};Y.propTypes={label:U().string,attrTypeUri:U().string};const K=Y,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(K,{label:t,attrTypeUri:a.uri}),r&&c().createElement(z.Z,null))};X.propTypes={label:U().string,isRequired:U().bool,className:U().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";const ae=c().createContext([]);ae.displayName="RelatedObjectUrisContext";var le=r(80030);function oe(){return oe=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},oe.apply(this,arguments)}const ie=e=>c().createElement("svg",oe({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"})),se=(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"}}))),ce=c().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const a=se();return c().createElement(le.ZP,{title:x().text("Show comment")},c().createElement("div",{ref:t,className:a.root,onClick:n},c().createElement(ie,{className:a.icon}),c().createElement("div",{className:a.childrenWrapper},r)))}));ce.displayName="CommentButton";const ue=ce;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: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"})),me=e=>{let{className:t,onClick:r}=e;const n=se();return c().createElement(le.ZP,{title:x().text("Add comment")},c().createElement("div",{className:b()(n.root,t),onClick:r},c().createElement(de,{className:n.icon})))};var ge=r(27291),he=r(86689),fe=r(43054),be=r(98538),ye=r(39475);const xe=c().createContext({});xe.displayName="EntitiesMapContext";var Ee=r(18527);const ve=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},we=e=>`${x().date(e,"LT")} ${x().date(e,"LL")}`,Oe=(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"}}))),Ce=e=>{let{comment:t,className:r}=e;const n=Oe(),a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,s.useContext)(xe);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(Ee.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=ve(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(Ee.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(Ee.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=ve(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(Ee.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(Ee.Z,{className:n.link,value:(0,u.wwR)(l)},l.label?(0,u.idV)(l.label):(0,u.BTI)(l)))))}default:return null}})())},Te=c().createContext([]);Te.displayName="UsersContext";const Se=(0,T.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),ke=e=>{let{comment:t,className:r}=e;const n=Se(),a=(0,s.useContext)(Te);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(he.Z,{href:`mailto:${t.email}`},e):e})).map(((e,t)=>c().createElement(s.Fragment,{key:t},e))))};var Ne=r(43434);const Ie=(0,T.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));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=>{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=Ie();return c().createElement(Ne.Z,Pe({},n,{className:b()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))},Re=(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=Re(),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(De,{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},we(a.createdTime)),u&&c().createElement(be.Z,{buttonComponent:ye.k,buttonProps:{icon:fe.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(Ce,{comment:a,className:o.commentTarget}),c().createElement(ke,{comment:a,className:o.message}),c().createElement(E.Z,{className:o.buttons},c().createElement(he.Z,{className:o.button,onClick:t,component:"button"},x().text("Reply")),"open"===a.status&&c().createElement(he.Z,{disabled:m,className:o.button,onClick:()=>{p({commentId:a.commentId,uri:n})},component:"button"},x().text("Resolve")),"resolved"===a.status&&c().createElement(he.Z,{disabled:m,className:o.button,onClick:()=>{d({commentId:a.commentId,uri:n})},component:"button"},x().text("Re-open")))))},je=(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"}}))),Ze=e=>{let{className:t,reply:r}=e;const{createdBy:n,action:a,createdTime:l}=r,o=je();return c().createElement(E.Z,{className:b()(o.root,t)},c().createElement(De,{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(ke,{className:o.message,comment:r}),c().createElement(v.Z,{className:o.createdAt},we(l))))};var Le=r(77277),_e=r(2271);const Me=(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 Ve(){return Ve=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},Ve.apply(this,arguments)}const Be=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=Me(),l=(0,s.useContext)(Te);return c().createElement(_e.r,Ve({},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(_e.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"}}});var ze=r(29627);const Fe=e=>{switch(e){case"open":return x().text("Reply...");case"resolved":return x().text("Adding a comment will re-open this");default:return""}},He=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),R=(0,ze._)(),A=""!==O.trim(),j=P||A,Z=null==i?void 0:i.status,L=(e,t,r)=>{I(r),C(e),S(t)},_=()=>{null==p||p(),L("","",[])};return(0,s.useEffect)((()=>{o&&o.current.update()}),[o,j]),(0,s.useEffect)((()=>{u?C(i.content):_()}),[u]),c().createElement(E.Z,{className:b()(d.root,r)},c().createElement("form",{onSubmit:e=>{e.preventDefault();const t=(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})]]);return R(t()).then(_).catch(console.log)},className:d.form},c().createElement(E.Z,{className:d.main},c().createElement(De,{classes:{root:d.avatar}},m),c().createElement(Be,{className:d.textField,disabled:v,onChange:(e,t,r)=>{L(e,t,r)},inputRef:t,value:O,onFocus:()=>D(!0),onBlur:()=>D(!1),placeholder:Fe(Z)})),j&&c().createElement(E.Z,{className:d.buttons},c().createElement(Le.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"))(Z,u)),c().createElement(Le.Z,{disabled:v,onClick:()=>_(),className:d.button,variant:"outlined",color:"primary"},x().text("Cancel")))))},We=(0,T.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),qe=(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=We({classes:a}),[d,m]=(0,s.useState)(!1),g=c().createElement(He,{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(Ze,{key:e.replyId,className:p.repliedComment,reply:e}))))),g),!i&&g)}));var Ge=r(27556),$e=r(1292),Ye=r(7421);const Ke=(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)"}}}})),Xe=e=>{let{anchorEl:t,placement:r="top",arrow:n=!0,open:a,onClose:l=(()=>{}),children:o,className:i,popperRef:s}=e;const u=Ke(),[p,d]=c().useState(null);return c().createElement(Ye.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($e.Z,{onClickAway:e=>{var t;t=e.target,Array.from(document.querySelectorAll("[data-modal]")).some((e=>e.contains(t)))||l()}},c().createElement(Ge.Z,{className:u.popoverRoot},n?c().createElement("span",{className:u.arrow,ref:d}):null,c().createElement(E.Z,null,o)))))},Qe=(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"}}))),Je=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=Qe({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(Xe,{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(ye.k,{className:d.resolveButton,size:"S",onClick:()=>{g({commentId:i.commentId,uri:t})},disabled:f,showForDisabled:!0,tooltipTitle:x().text("Resolve"),icon:ge.Z,color:"primary"})),!h&&c().createElement(qe,{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}))},et=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;(0,te.D)((()=>{l&&l(h)}),[h]);const S=(0,s.useContext)(ae),k=(0,s.useMemo)((()=>S?[...a,...S]:a),[S,a]);return w&&c().createElement("div",{className:b()(u.root,t)},C&&c().createElement(me,{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(ue,{ref:r===(null==f?void 0:f.commentId)?d:null,key:r,onClick:()=>(e=>{x(e),g(!0)})(r)},1+t)})),c().createElement(Je,{anchorEl:p,open:h,onClose:()=>{d(null),E(),g(!1)},uri:r,relatedObjectUris:k,objectType:n,comment:f}))};var tt=r(7089),rt=r(41128);const nt=(0,T.Z)((e=>({container:{height:"16px",borderColor:(0,rt.U1)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}})));var at=r(67586),lt=r(78223);const ot=(0,lt.Z)(tt.Z),it=e=>{let{className:t,attributeType:r,nonOvValues:n=[],nonOvTotal:a}=e;const l=nt();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(at.Z,{value:(0,u.kDl)(e),dataTypeDefinition:(0,u.PFL)(r),rich:!1})))):null;return c().createElement(ot,{tooltipTitle:o,tooltipPlacement:"top",label:`+ ${a}`,variant:"outlined",classes:{root:b()(l.container,t),label:l.label}})};it.propTypes={className:U().string,nonOvTotal:U().number,attributeType:u.EMD,nonOvValues:U().arrayOf(U().oneOfType([u.cNQ,u.dMV,u.Rtp]))};const st=it,ct=c().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});ct.displayName="HistoryDiffContext";const ut=(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(ut(l,n[a])):(t.push(pt(n[a],l)),t)}}),[])},pt=(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"},dt=(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=mt(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}),[])},mt=(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(gt(a,l)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(dt(l,a,r,t))}return e}),[])},gt=(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 ht(){return ht=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},ht.apply(this,arguments)}const ft=e=>c().createElement("svg",ht({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"})),bt=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(Ne.Z,{className:b()(r,n),src:o,imgProps:{onError:s}},c().createElement("img",{className:n,src:i,alt:"fallback entity avatar",onError:s}))},yt=(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"}}))),xt=(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"}}});function Et(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vt=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,ze._)(),m=(0,g.useDispatch)(),f=yt(),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(ut(t,e)):r.push(pt([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){Et(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(bt,{entity:e,avatarClassName:f.profileIcon}),c().createElement(Ee.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"))))},wt=e=>{let{value:t,attributeType:r,children:n,className:a}=e;const l=xt(),o=yt(),i=(0,s.useContext)(w)||[],p=(0,u.QZu)(r),d=(0,g.useSelector)(h.ZP.selectors.getMetadata)||{},m=p?dt(r,t.value,i,d):gt(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(le.ZP,{interactive:!0,arrow:!0,placement:"right-start",classes:l,title:c().createElement(vt,{value:m,attributeType:r,config:b.popup})},c().createElement("span",{className:a},c().createElement(ft,{className:o.icon}),c().createElement("span",{className:o.content},n))):c().createElement(c().Fragment,null,n)};let Ot;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(Ot||(Ot={}));const Ct={[Ot.insertAttribute]:{color:"#599E0E"},[Ot.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[Ot.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},Tt=e=>{switch(e){case"UPDATE_ATTRIBUTE":return Ot.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return Ot.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return Ot.deleteAttribute;default:return""}},St="/",kt=(0,N.pipe)((0,N.split)(St),(0,N.propSatisfies)((0,N.lte)(2),"length")),Nt=(0,N.pipe)((0,N.split)(St),(0,N.slice)(0,-2),(0,N.join)(St)),It=(0,N.curry)(((e,t)=>(0,N.cond)([[(0,N.has)(e),(0,N.prop)(e)],[()=>kt(e),It(Nt(e))]])(t))),Pt=e=>(0,N.pipe)(N.keys,(0,N.any)((0,N.startsWith)(e+St))),Dt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=It(e,t);return(0,N.isNil)(r)?Pt(e)(t)?"UPDATE_ATTRIBUTE":"":r},Rt=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){jt(e,t,r[t])}))}return e}function jt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zt=(0,T.Z)({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{flex:1,wordBreak:"break-all"},updateAttribute:At({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ct[Ot.updateAttribute]),insertAttribute:At({width:"fit-content"},Ct[Ot.insertAttribute]),deleteAttribute:At({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},Ct[Ot.deleteAttribute]),multilineAttribute:{width:"fit-content"}}),Lt=e=>{let{className:t,attributeType:r=null,attributeValue:n,inlined:a}=e;const l=Zt(),{appearance:o}=(0,s.useContext)(ct),i=Dt(n.uri,o),p=Tt(i),d=c().createElement(at.Z,{value:(0,u.kDl)(n),dataTypeDefinition:(0,u.PFL)(r)});return a||p?c().createElement("div",{className:t},c().createElement(wt,{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(wt,{value:n,attributeType:r,key:n.uri},c().createElement("span",{className:l.attributeValue},d)),c().createElement(et,{className:l.commentsContainer,uri:n.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:n.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE}))};var _t=r(40435),Mt=r(98989);const Vt=(0,T.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function Bt(){return Bt=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},Bt.apply(this,arguments)}const Ut=e=>{const t=Vt(),{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(_t.Z,Bt({icon:Mt.Z,size:"XXS",disableRipple:!0,iconClassName:b()(t.expandIcon,{[t.expanded]:r}),className:b()(n,t.expandButton)},a))},zt=(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}}),Ft=e=>{let{attributeTypesList:t,attributeValue:r,label:n,expanded:a=!1,children:l,showNonOv:o}=e;const i=zt(),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(et,{uri:r.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:r.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE})),d&&c().createElement(ri,{attrTypes:t,entity:h,drawLines:!0,parentUri:p,showNonOv:o},l))};Ft.propTypes={children:U().node,label:U().oneOfType([U().string,U().node]),attributeTypesList:U().arrayOf(u.EMD),attributeValue:U().oneOfType([u.dMV,u.Rtp]),expanded:U().bool,showNonOv:U().bool};const Ht=Ft;function Wt(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){qt(e,t,r[t])}))}return e}function qt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gt=(0,T.Z)({label:{textDecoration:"none"},updateAttribute:Wt({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ct[Ot.updateAttribute]),insertAttribute:Wt({width:"fit-content"},Ct[Ot.insertAttribute]),deleteAttribute:Wt({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},Ct[Ot.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function $t(){return $t=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},$t.apply(this,arguments)}const Yt=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=Gt(),{appearance:l}=(0,s.useContext)(ct),o=(0,s.useMemo)((()=>{const e=Dt(t.uri,l),n=Tt(e),o=t.label?t.label:(0,u.Kxm)(t,r.dataLabelPattern);return c().createElement(wt,{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(Ht,$t({label:o,attributeValue:t,attributeTypesList:(0,u.EUG)({},r)},n))};Yt.propTypes=u.j2V;const Kt=(0,s.memo)(Yt);function Xt(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){Qt(e,t,r[t])}))}return e}function Qt(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)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:Xt({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ct[Ot.updateAttribute]),insertAttribute:Xt({width:"fit-content"},Ct[Ot.insertAttribute]),deleteAttribute:Xt({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},Ct[Ot.deleteAttribute])})));function er(){return er=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},er.apply(this,arguments)}const tr=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=Jt(),i=(0,u.bwT)(t),p=(0,s.useMemo)((()=>(0,u.EUG)(r,n)),[n,r]),{appearance:d}=(0,s.useContext)(ct),m=(0,s.useMemo)((()=>{const e=Dt(t.uri,d),r=Tt(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(Ht,er({attributeTypesList:p,attributeValue:t,label:m},l))};tr.propTypes=u.NkU;const rr=(0,s.memo)(tr),nr=(0,g.connect)((e=>({metadata:h.ZP.selectors.getMetadata(e),uiPath:h.ZP.selectors.getUIPath(e)})))(rr),ar=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(nr,t);default:return c().createElement(Lt,t)}}}.build(t,e)},lr=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(st,{nonOvValues:r,attributeType:n,className:p.ovIcon,nonOvTotal:s}),c().createElement(ar,{className:b()(p.attribute,l),attributeValue:t,attributeType:n,showNonOv:i,inlined:!0})),c().createElement(et,{uri:t.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:t.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE}))};var or=r(4426);const ir=(0,T.Z)({link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"}}),sr=e=>{let{moreNumber:t,valueNumber:r,onClick:n}=e;const a=ir();return c().createElement(he.Z,{component:"button",variant:"caption",className:a.link,onClick:n,underline:"none"},c().createElement(or.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 cr=r(96971);const ur=e=>{let{onClick:t}=e;const r=ir();return c().createElement(he.Z,{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},c().createElement(cr.Z,{className:r["svg-icon__root"]}),x().text("Show less"))},pr=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(st,{nonOvValues:n,attributeType:l,className:h.ovIcon,nonOvTotal:g})),c().createElement("div",{className:h.attributes},O.map((e=>c().createElement(ar,{key:e.uri,className:b()(h.attribute,p),attributeValue:e,attributeType:l,showNonOv:m})))),E&&c().createElement(sr,{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(ur,{onClick:()=>{y(t)}}))};var dr=r(80079);function mr(){return mr=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},mr.apply(this,arguments)}const gr=e=>c().createElement("svg",mr({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"}))),hr=(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 fr(){return fr=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},fr.apply(this,arguments)}const br="loading",yr="loaded",xr="error",Er={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},vr=(0,s.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=Er.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||Er.SMALL,p=hr(i),[d,m]=(0,s.useState)(br);(0,s.useEffect)((()=>{m(br)}),[t]);const g=d===br,h=d===yr;return d===xr?c().createElement("div",fr({className:b()(p.defaultContainer,p.image,r)},o),c().createElement(dr.Z,{className:p.defaultImage})):c().createElement("div",{className:b()(p.root,n)},!(0,u.O27)(t)&&c().createElement("img",fr({src:t,className:b()(p.image,r,{[p.hideImage]:g}),onLoad:()=>{m(yr)},onError:()=>{m(xr)},alt:"image"},o)),g&&c().createElement("div",fr({className:b()(p.defaultContainer,p.image,r)},o),c().createElement(gr,{className:p.defaultImage})),h&&l)}));var wr=r(88267);const Or=c().createContext(!1);Or.displayName="BlockImageGalleryDialogContext";var Cr=r(45203),Tr=r(15762);const Sr=(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 kr=r(60905);const Nr=(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)"}}))),Ir=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:n}=e;const a=Nr(),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(kr.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(kr.Z,{item:!0,key:l},c().createElement(vr,{onClick:()=>r(t),className:b()(a.thumb,{[a.inactiveThumb]:n!==t}),src:(0,u.efz)({value:o})}))}))))},Pr=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}=e;const l=Sr(),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(_t.Z,{icon:Cr.Z,className:b()(l.arrowButton,l.arrowButtonPrev),onClick:()=>{a(n-1)},size:"XL"}),c().createElement(vr,{containerClassName:l.mainImageContainer,className:l.mainImage,size:i&&Er.OVERRIDE,src:i}),n!==r.length-1&&c().createElement(_t.Z,{icon:Tr.Z,className:b()(l.arrowButton,l.arrowButtonNext),onClick:()=>{a(n+1)},size:"XL"})),c().createElement(Ir,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}))};var Dr=r(21324),Rr=r(5806),Ar=r(33016),jr=r(36138),Zr=r(85256);const Lr=(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 _r=r(79784);const Mr=(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 Vr=r(33662);const Br=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=Mr({containerWidth:i,containerHeight:s}),h=c().createElement(c().Fragment,null,!a&&c().createElement("div",{className:g.header},t),!l&&c().createElement(Vr.Z,{onSearch:n,autofocus:!0,onKeyDown:u,inputRef:d,classes:{root:g.searchInputContainer},placeholder:x().text("Search & add attributes"),height:40}));return c().createElement(_r.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))};Br.propTypes={className:U().string,title:U().string,headerPlacement:U().oneOf(["top","bottom"]),onSearch:U().func,searchInputOnKeyDown:U().func,containerWidth:U().number,containerHeight:U().number,hideTitle:U().bool,hideSearchInput:U().bool,searchInputRef:U().shape({current:U().instanceOf(Element)}),children:U().node},Br.defaultProps={anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}};const Ur=Br,zr=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 Fr=r(50166);const Hr=(0,T.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Wr=e=>e.titleItemIndex===e.index,qr=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=Hr(),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&&(Wr(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=>Wr(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(wr.Z,{handleHeight:!0,onResize:g,targetDomEl:b.current}),c().createElement(Fr.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&&Wr(u.listItem)&&(p=c-(u.offset-n));break;case"backward":{const e=o>-1&&(d=o,t.findIndex(((e,t)=>Wr(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))};qr.propTypes={items:U().arrayOf(U().object).isRequired,getItemSize:U().func.isRequired,renderItem:U().func.isRequired,width:U().oneOfType([U().number,U().string]),height:U().number.isRequired,renderGroupTitle:U().func,fixedTitle:U().bool,hideSubtitles:U().bool,itemKey:U().func,disableHorizontalScrollbar:U().bool,focusIndex:U().number,onInnerContainerResize:U().func};const Gr=qr,$r=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&&Wr(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||Wr(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 Yr=r(65549);const Kr=(0,T.Z)({highlight:{fontWeight:600}}),Xr=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)},Qr=(0,N.curry)(((e,t)=>(0,N.filter)((t=>t.label.toLowerCase().includes(e.toLowerCase())))(t))),Jr=e=>{let{label:t,popupTitle:r=t,data:n,dense:a,onApply:l}=e;const o=Lr(),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)(Qr(d),(0,N.map)((e=>({item:{id:e.uri,label:e.label,attrType:e}}))))(n)),[n,d]),E=(0,s.useMemo)((()=>zr(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}=$r({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(Xr,{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(Le.Z,{color:"primary",onClick:()=>p(!u),ref:i,className:o.moreButton},c().createElement(Yr.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(Gr,{getItemSize:v,renderItem:I,items:E,height:S,containerWidth:320,focusIndex:O})))};Jr.propTypes={label:U().string,popupTitle:U().string,data:U().array,dense:U().bool,onApply:U().func};const en=Jr;var tn=r(95038),rn=r.n(tn);const nn={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)")}},an=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)?rn()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,N.path)(["CreationTimestamp",0,"value"],e)?rn()(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},ln=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},on=(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}))},sn=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=ln(t.attributes);return on(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}),[])},cn=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),un=(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:{}}),pn=e=>{let{attributeType:t,onAddAttributes:r,uri:n}=e;const a=un(),l=ln(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(en,{label:x().text("Attributes"),data:l,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:n}))))}}),c().createElement(Zr.Z,{className:a.divider})))},dn=(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"}}))),mn=e=>{let{title:t,content:r,isLink:n,children:a}=e;const l=dn();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))},gn=(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"}}),hn=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const a=gn(),l=(0,g.useSelector)(h.ZP.selectors.getIsViewMode),o=(i=t,s=n,on(Object.keys(nn),s).map((e=>an(i,e)?{title:nn[e],value:an(i,e),isLink:cn(e)}:null)).filter(Boolean));var i,s;const u=sn(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(mn,{key:t,isLink:n,title:t,content:r})})),l&&u.map((e=>{let{attrType:r,values:n}=e;return c().createElement(ti,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:a.title,contentClassName:a.content,parentUri:t.uri})})))};var fn=r(94438),bn=r(52669),yn=r(81556);const xn=(0,T.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),En=e=>{let{checked:t,className:r,onClick:n}=e;const a=xn(),l=t?yn.Z:bn.Z;return c().createElement(l,{className:b()(a.root,r),onClick:n})};function vn(){return vn=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},vn.apply(this,arguments)}const wn=e=>c().createElement("svg",vn({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 On=r(79573);const Cn=(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"}}))),Tn=(0,s.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:l=On.ZT,onSelect:o=On.ZT,onShareLink:i,onSetAsDefault:u,onDelete:p,onDownload:d=On.ZT,onClick:m}=e,g=Cn(),[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(En,{className:g.checkedIcon,checked:n,onClick:E(n)}),w&&c().createElement("div",{className:g.actions},c().createElement(_t.Z,{onClick:d,className:g.actionButton,icon:wn}),c().createElement(be.Z,{menuId:`image-overlay-actions-${t}`,buttonComponent:_t.Z,buttonProps:{icon:fe.Z,className:b()(g.actionButton,g.dropDownMenuButton)},menuItems:y})),O&&c().createElement(Le.Z,{className:g.button,variant:"outlined",onClick:l},x().text("Deselect")))}));var Sn=r(13896),kn=r(58651),Nn=r(8629),In=r(67358);const Pn=(0,T.Z)({loadingOverlay:{position:"absolute",width:"100%",height:"100%",top:0,left:0,opacity:.37,zIndex:10,backgroundColor:"#fff"},transparent:{backgroundColor:"transparent"},relativePosition:{"&$loadingOverlay":{position:"relative"}}}),Dn=e=>{let{transparent:t=!1,relativePosition:r=!1}=e;const n=Pn();return c().createElement(c().Fragment,null,c().createElement("div",{className:b()(n.loadingOverlay,{[n.transparent]:t,[n.relativePosition]:r})},c().createElement(In.Z,{color:"secondary"})))};var Rn=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}}))),jn=e=>0===e.trim().length,Zn=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(Ge.Z,{className:r.paper},c().createElement(Rn.Z,{value:n,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);a(t),r||jn(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(Le.Z,{disabled:Boolean(l)||jn(n),variant:"outlined",color:"primary",onClick:()=>{t(n),a(""),o(null)}},x().text("Send"))),l&&c().createElement(v.Z,{className:r.errorMessage},l))};var Ln=r(83997);const _n=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Mn=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:_n.join(","),id:"upload-image-button",type:"file"}),c().createElement("label",{htmlFor:"upload-image-button"},c().createElement(Le.Z,{className:t,variant:"contained",color:"primary",component:"span"},x().text("Select image"))))};function Vn(){return Vn=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},Vn.apply(this,arguments)}const Bn=e=>c().createElement("svg",Vn({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"}}))),zn=e=>{let{onAppendFile:t,className:r}=e;const n=Un(),[{canDrop:a,isOver:l},o]=(0,Sn.useDrop)({accept:[Ln.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(Bn,{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(Mn,{onAppendFile:t}))},Fn=(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"}}))),Hn=e=>{let{children:t,className:r}=e;const n=Fn();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 Wn=r(87685),qn=r(37265);const Gn=(0,T.Z)({closeIcon:{color:"#fff"}}),$n=e=>{let{error:t,onClose:r}=e;const n=Gn();return c().createElement(qn.Z,{open:Boolean(t),onClose:r,message:t,action:c().createElement(ye.k,{className:n.closeIcon,tooltipTitle:x().text("Close"),icon:Wn.default,onClick:r})})},Yn=(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=Yn(),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(Sn.DndProvider,{backend:kn.default},c().createElement(Nn.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(zn,{className:a.targetBox,onAppendFile:e=>{const t=Number((e.size/1024/1024).toFixed(2)),r=_n.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(Hn,{className:a.divider},x().text("or")),c().createElement(Zn,{onSend:e=>{b(e)}})),p&&c().createElement(Dn,null),c().createElement($n,{error:m,onClose:()=>f(null)})))},Xn={imageMargin:4,imageWidth:Er.SMALL.imageWidth,imageHeight:Er.SMALL.imageHeight},Qn=(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"}}))),Jn=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:n,onChangeAttribute:a,requestNextPageOfAttributeValues:l,parentUri:o,paging:i,showNonOv:p,imageSize:d=Xn}=e;const m=Qn(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(Tn,{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(Lo,{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(vr,{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(_t.Z,{className:m.uploadButton,iconClassName:m.uploadIcon,icon:fn.Z}))),c().createElement(Kn,{open:x,onUpload:w,onClose:v}))},ea=(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"}}))),ta=e=>{let{className:t,message:r}=e;const n=ea();return r?c().createElement(v.Z,{variant:"caption",className:b()(n.caption,t)},r):null};var ra=r(22983);const na=(0,T.Z)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center"},"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 aa=r(65314),la=r(42494),oa=r(74828);function ia(){return ia=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},ia.apply(this,arguments)}const sa=(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=ea(),i=!!t;return c().createElement(la.Z,ia({className:b()(o.wrapper,n,null==a?void 0:a.root),error:!0},l),r,i&&c().createElement(oa.Z,{className:b()(o.helperText,null==a?void 0:a.helperText)},c().createElement(ta,{message:t})))})),ca=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}},ua=(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&&rn()(t).format("YYYY-MM-DD")||"";case u.oS0.TYPE_TIMESTAMP:return t&&rn()(t).format()||"";case u.oS0.TYPE_ACTIVENESS_DATE:case u.oS0.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}},pa=(0,N.curry)(((e,t,r)=>({value:ua(t,r),uri:e.uri,attributeType:t}))),da=c().createContext({enabled:!1,queueSizeThreshold:0});da.Provider.propTypes={value:U().shape({enabled:U().bool,queueSizeThreshold:U().number})},da.displayName="AsyncMountContext";let ma=0;const ga=()=>{const e=(0,s.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,s.useContext)(da),[n,a]=(0,s.useState)(!t||t&&ma<r);e.current&&ma++;const l=(0,s.useRef)();return(0,s.useEffect)((()=>{if(ma--,!n)return l.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(l.current)}),[]),e.current=!1,n};function ha(){return ha=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},ha.apply(this,arguments)}const fa=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,s.forwardRef)(((r,n)=>ga()?c().createElement(e,ha({},r,{ref:n})):t&&c().createElement(t,ha({},r,{ref:n}))));return r.displayName="WithAsyncMount",r};function ba(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){ya(e,t,r[t])}))}return e}function ya(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xa={};function Ea(){return Ea=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},Ea.apply(this,arguments)}const va=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=na(),w="deleted"===f,O="edited"===f,C=(0,u.KIu)(o),T=(0,u.PFL)(n),S=ca(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,R=(0,u.e$p)(l),A=(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=>ba({},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 ba({},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=xa[e];return(0,N.equals)(t,r)?r:((0,N.equals)(null==r?void 0:r.parents,t.parents)&&(t.parents=r.parents),xa[e]=t,t)})(o,f)}var a,l})(e,r,null==n?void 0:n.uri):null)),j=()=>{l&&d((0,u.iFp)(l))},Z=!!i&&k&&!n.singleValue,L=!w&&!!s&&P,_=!!R,M=w?{disabled:!0}:{};return c().createElement("div",{className:b()(E.editor,t)},c().createElement(sa,{errorMessage:R,className:E.errorWrapper},c().createElement("div",{className:b()(E["editor-value"],{[E.deleted]:w},{[E["editor-read-only-value"]]:!D})},D?c().createElement(aa.Z,Ea({fieldName:(0,u.Tde)(n.uri),value:S,dataTypeDefinition:T,error:_,onChange:(0,N.pipe)(pa(r,n),p,j),fullWidth:!0},A,y,M)):c().createElement(at.Z,{value:(0,u.kDl)(r),dataTypeDefinition:T}))),c().createElement("div",{className:E["editor-actions"]},O&&c().createElement(v.Z,{variant:"caption",className:E.editedLabel},"(",x().text("edited"),")"),Z&&c().createElement(_t.Z,{icon:Yr.Z,onClick:i,size:"L",className:b()(E.addButton,E.button)}),m&&m({attributeType:n,attributeValue:r}),L&&c().createElement(_t.Z,{className:E.button,icon:ra.Z,onClick:()=>{s({uri:r.uri,attributeType:n}),(0,u.PcX)(l)!==u.NIO.missed&&j()},size:"L"})))};va.propTypes={className:U().string,attributeValue:u.cNQ,attributeType:u.EMD,ownError:u.wfT,isReltioCrosswalk:U().bool,state:U().oneOf(["deleted","edited"]),mode:u.XGc,onAddOneMore:U().func,onDeleteAttribute:U().func,onChangeAttribute:U().func,onDeactivateError:U().func,additionalControlsRenderer:U().func};const wa=(0,s.memo)(fa(va,(()=>{const e=na();return c().createElement("div",{className:e.placeholder})}))),Oa=(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}}))),Ca=[u.xPW.roles.uri,u.xPW.tags.uri],Ta=(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)}))},Sa=(e,t)=>(0,N.partition)((0,N.pipe)((0,N.path)(["attrType","uri"]),(0,N.includes)(N.__,e)),t),ka=c().createContext(null);function Na(){return Na=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},Na.apply(this,arguments)}const Ia=e=>{let{attrTypes:t,entity:r,parentUri:n,showEmptyEditors:a,mode:l,crosswalks:o,drawLines:i,children:p,className:d,alwaysVisibleTypeUris:m=Ca,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)(ka),C=(0,s.useMemo)((()=>(0,u.Gtj)(t,l,r,a,y,O)),[t,l,r,a,y,O]),[T,S]=(0,s.useMemo)((()=>Sa(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,Na({},I,{plain:!0}),v.length>0&&c().createElement(en,{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(to,{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})})))};Ia.propTypes={attrTypes:U().array,entity:U().object,parentUri:U().string,children:U().node,showEmptyEditors:U().bool,mode:u.XGc,crosswalks:U().array,drawLines:U().bool,showNonOv:U().bool,className:U().string,alwaysVisibleTypeUris:U().array,onAddAttributes:U().func,onChangeAttribute:U().func,onDeleteAttribute:U().func,additionalControlsRenderer:U().func};const Pa=(0,s.memo)(Ia);function Da(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ra=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=Oa(),N="deleted"===T,I="edited"===T,P=a.uri,D=(0,u.ZiX)(P),[R,A]=(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&&A(!0)}),[o,L]),(0,s.useEffect)((()=>{N&&A(!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(Le.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:()=>A((e=>!e)),expanded:R,className:k.expandButton,disabled:N}),c().createElement(sa,{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(_t.Z,{icon:ra.Z,onClick:()=>E({uri:P,attributeType:n,attributeValue:a}),size:"L"}))),R&&c().createElement(Pa,{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))};Ra.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){Da(e,t,r[t])}))}return e}({label:U().string,children:U().node,attributeTypesList:U().arrayOf(u.EMD),attributeValue:U().oneOfType([u.dMV,u.Rtp])},u.KVe);const Aa=Ra;function ja(){return ja=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},ja.apply(this,arguments)}const Za=e=>{const{attributeValue:t,attributeType:r}=e,n=(0,u.Kxm)(t,r.dataLabelPattern);return c().createElement(Aa,ja({label:(0,u.idV)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))};Za.propTypes=u.j2V;const La=(0,s.memo)(Za);var _a=r(84425),Ma=r(42662),Va=r(12231);const Ba=(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"}}))),za=(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"}}))),Fa=(0,T.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}});function Ha(){return Ha=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},Ha.apply(this,arguments)}const Wa=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=Ba(),{uri:o,entityType:i,label:s,secondaryLabel:u}=a;return""!==o?c().createElement(Va.Z,Ha({className:l.entityContainer,ref:t,key:o,onClick:()=>n({label:s,uri:o,entityType:i})},r),c().createElement(Ma.Z,{className:l.entityAvatar,entityType:i}),c().createElement("span",{className:l.entityLabel},s,u&&c().createElement("span",{className:l.entitySecondaryLabel},", ",u))):c().createElement(Va.Z,Ha({className:l.entityContainer,ref:t,key:o},r,{disabled:!0}),c().createElement("span",{className:l.emptyEntityLabel},x().text("No results found")))};Wa.propTypes={innerRef:U().oneOfType([U().oneOf([null]),U().func,U().shape({current:U().any.isRequired})]),innerProps:U().object.isRequired,selectOption:U().func.isRequired,data:U().shape({uri:U().string.isRequired,label:U().string.isRequired,entityType:u.pyR.isRequired})};const qa=Wa;var Ga=r(12212);const $a=e=>{const{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:n},children:a,data:l}=e,o=Ua(),i=(0,g.useDispatch)(),p=(0,s.useContext)(Ga.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))};$a.propTypes={children:U().string,data:U().object.isRequired,selectProps:U().object.isRequired};const Ya=$a;var Ka=r(33375),Xa=r(61837);const Qa=e=>{const{selectProps:{onClear:t}}=e,r=Fa();return c().createElement(Xa.Z,{onClick:t},c().createElement(Ka.Z,{className:r.clearIcon}))};Qa.propTypes={selectProps:U().object.isRequired};const Ja=Qa,el=e=>e&&e.attributes,tl=e=>{let{entity:t,entityType:r,attributeTypesSelectionStrategy:n=el,mode:a,onAddAttributes:l,onDeleteAttribute:o,onChangeAttribute:i}=e;const u=(0,s.useMemo)((()=>n(r)),[n,r]);return t?c().createElement(Pa,{attrTypes:u,entity:t,showEmptyEditors:!0,drawLines:!0,parentUri:t.uri,mode:a,crosswalks:t.crosswalks,onAddAttributes:l,onChangeAttribute:i,onDeleteAttribute:o}):null};tl.propTypes={entityUri:U().string,parentUri:U().string,entity:U().object,entityType:U().object,attributeTypesSelectionStrategy:U().func,mode:u.XGc,onAddAttributes:U().func,onDeleteAttribute:U().func,onChangeAttribute:U().func};const rl=tl,nl={onAddAttributes:h.N5.actions.addAttributes,onDeleteAttribute:h.N5.actions.removeAttribute,onChangeAttribute:h.N5.actions.modifyAttribute},al=(0,g.connect)(((e,t)=>({entity:t.entityUri&&h.ZP.selectors.getModifiedEntity(e,t.entityUri)})),nl)(rl);var ll=r(92391);const{Group:ol}=ll.F,il=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,l=za();return c().createElement(ol,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(Yr.Z,{className:l.addIcon}),x().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};il.propTypes={selectProps:U().object.isRequired,data:U().object,children:U().array};const sl=il,cl=(0,T.Z)({creatorWrapper:{marginTop:"20px"}});function ul(){return ul=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},ul.apply(this,arguments)}function pl(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){dl(e,t,r[t])}))}return e}function dl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ml=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=cl(),[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=pl({},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:sl,GroupHeading:On.Vd}:{},D=I?{ClearIndicator:Ja}:{};return c().createElement(c().Fragment,null,c().createElement(_a.Z,ul({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=>pl({},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:pl({Option:qa,SingleValue:Ya},P,D),currentEntityType:T,isClearable:!0,disableLinkClick:m},g)),I&&c().createElement("div",{className:h.creatorWrapper},c().createElement(al,{mode:n,attributeTypesSelectionStrategy:d,entityType:T,entityUri:t.entityUri})))};ml.propTypes={entity:u.oZZ,entityTypesUris:U().arrayOf(U().string),max:U().number,mode:u.XGc,dispatch:U().func,metadata:u.pGS,onChange:U().func.isRequired,onCreate:U().func,attributeTypesSelectionStrategy:U().func,globalSearchRequestOptions:U().object,disableLinkClick:U().bool};const gl=ml,hl=(0,T.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function fl(){return fl=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},fl.apply(this,arguments)}function bl(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){yl(e,t,r[t])}))}return e}function yl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xl=e=>{const t=hl(),{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]),R=(0,s.useCallback)((e=>{r&&l(r.uri);const t=x.current,n=!(0,N.isEmpty)(e)&&e.uri===(0,u.bwT)(t),a=bl({},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]),A=(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});R(a),o(a)}),[D,g,O,n,R,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,fl({},p,{label:(0,u.idV)(C),attributeTypesList:P,crosswalks:S,metadata:n}),c().createElement(sa,{errorMessage:L},c().createElement(gl,{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?R:void 0,onCreate:Z?A:void 0,metadata:n,attributeTypesSelectionStrategy:D})))};xl.propTypes=bl({},u.NkU,{modifiedEntity:u.pyR,metadata:u.pGS,globalSearchRequestOptions:U().object,onDeleteModifiedEntity:U().func,onUpdateModifiedEntity:U().func,onDeactivateError:U().func});const El=(0,s.memo)(xl),vl={onDeleteModifiedEntity:h.N5.modifiedEntities.actions.entityDeleted,onUpdateModifiedEntity:h.N5.modifiedEntities.actions.entityCreated,onDeactivateError:h.N5.errors.actions.errorDeactivated},wl=(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"])}}),vl)(El);function Ol(){return Ol=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},Ol.apply(this,arguments)}const Cl=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(La,t);case u.oS0.TYPE_REFERENCE:return c().createElement(wl,t);default:return c().createElement(wa,Ol({isReltioCrosswalk:(0,u.KVV)(o,t.attributeValue)},s))}}}.build(t,e)},Tl=(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"}}))),Sl=e=>x().text("${value}",{value:1===e?x().text("value"):x().text("values")}),kl=(0,N.has)("minValue"),Nl=(0,N.has)("maxValue"),Il=(0,N.pipe)(Nl,N.not),Pl=(0,N.propSatisfies)((e=>1===e),"minValue"),Dl=e=>{let{minValue:t}=e;return x().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:x().number(t,"0"),minValueCaption:Sl(t)})},Rl=e=>{let{maxValue:t}=e;return x().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:x().number(t,"0"),maxValueCaption:Sl(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:Sl(t)})}],[(0,N.allPass)([Pl,Nl]),Rl],[(0,N.allPass)([Pl,Il]),(0,N.always)("")],[(0,N.allPass)([kl,Nl]),e=>{let{minValue:t,maxValue:r}=e;return x().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:Dl({minValue:t}),maxValue:x().number(r,"0"),maxValueCaption:Sl(r)})}],[Nl,Rl],[kl,Dl],[N.T,(0,N.always)("")]]),jl=e=>{let{cardinality:t}=e;const r=Tl();return c().createElement(v.Z,{variant:"caption",className:r.caption},Al(t))};jl.propTypes={cardinality:u.oA3};const Zl=jl,Ll=(0,N.filter)((0,N.propSatisfies)(u.ZiX,"uri")),_l=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=Tl(),[O,C]=(0,s.useState)(t),[T,S]=(0,s.useState)(!1),{label:k,required:I,cardinality:P,name:R,uri:A}=n,j=(0,u.KIu)(l),Z=(0,s.useContext)(ka),L=(0,s.useMemo)((()=>null==Z?void 0:Z.includes(A)),[A,Z]),_=(0,u.O27)(r),M=(!T&&i||I||L)&&_,V=(0,s.useRef)((0,u.gjI)({parentUri:a,attributeType:n})),B=(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]),U=(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=(Ll(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),Y=$?$.length-1:0,K=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(Zl,{cardinality:P}),j&&c().createElement(ta,{message:p,className:w.typeError}),c().createElement("div",{className:w.attributesWrapper},$.map(((e,t)=>c().createElement(Cl,{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:Y===t?B:null,onAddAttributes:f,onDeleteAttribute:U,onChangeAttribute:y,onDeactivateError:x,additionalControlsRenderer:E}))),q&&c().createElement(sr,{moreNumber:(0,N.min)(t,K),valueNumber:K,onClick:()=>{r.length<H&&v({parentUri:a,attributeTypeUri:A,attributeTypeName:R,values:r,defaultMaxValues:t}),C(O+t)}}),G&&c().createElement(ur,{onClick:()=>{C(t)}}))))};var Ml=r(90590),Vl=r(92145);const Bl=(0,T.Z)({valueContainer:{marginLeft:"8px",width:0}}),Ul={MultiValue:Vl.Z},zl=e=>{let{values:t}=e;const r=Bl(),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(Ml.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 Fl=r(7766);const Hl=e=>e?`?filter=${(0,u.Uqd)()((e=>[{filter:"containsWordStartingWith",fieldName:"tags",values:[e]}])(e))}`:"",Wl=[{fieldName:"tags",orderType:"reversedCount"}],ql=e=>(0,u.FK9)({query:Hl(e),body:Wl}).then((e=>Object.keys(e.tags))),Gl=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(Fl.Z,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r,onChange:l,getSuggestions:ql})};function $l(){return $l=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},$l.apply(this,arguments)}function Yl(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,onDeleteAttribute:o,showEmptyEditors: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,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","showEmptyEditors"]);const d=Tl(),{label:m,required:g,cardinality:h}=r,f=(0,u.KIu)(a),[b,y]=(0,s.useState)(!1),x=(0,s.useCallback)((0,N.pipe)(o,N.T,y),[o,y]),v=(0,u.O27)(t),w=!b&&i&&v,O=(0,s.useRef)((0,u.gjI)({parentUri:n,attributeType:r}));return(0,u.j2U)(r)&&v&&!w?null:c().createElement(E.Z,{className:d.wrapper},c().createElement(Q,{label:m,isRequired:g,className:d.title,attributeType:r}),f&&c().createElement(Zl,{cardinality:h}),f&&c().createElement(ta,{message:l}),c().createElement(E.Z,{className:d.attributesWrapper},(()=>{switch(r.uri){case u.xPW.tags.uri:return c().createElement(Gl,{values:t});case u.xPW.roles.uri:return c().createElement(zl,{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){Yl(e,t,r[t])}))}return e}({},O.current,{value:t[0]||""});return c().createElement(Cl,$l({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:x},p))}}})()))};function Xl(){return Xl=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},Xl.apply(this,arguments)}var Ql;!function(e){e.imageLine="imageLine",e.special="special",e.default="default"}(Ql||(Ql={}));const Jl=(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=Tl(),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,showEmptyEditors:m};return(()=>{switch((0,N.cond)([[u.kqr,(0,N.always)(Ql.special)],[u.Or$,(0,N.always)(Ql.imageLine)],[N.T,(0,N.always)(Ql.default)]])(r)){case Ql.special:return c().createElement(D,{enabled:l},c().createElement(Kl,Xl({values:C,attributeType:r},T)));case Ql.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(Jn,{attributeValues:C,attributeType:r,paging:o,onDeleteAttribute:f,parentUri:i,onChangeAttribute:b,requestNextPageOfAttributeValues:E,showNonOv:g})));default:return c().createElement(_l,Xl({values:C,attributeType:r,max:d,paging:o,crosswalks:a,drawLines:l,requestNextPageOfAttributeValues:E,showNonOv:g},T))}})()})),eo={requestNextPageOfAttributeValues:h.N5.actions.requestNextPageOfAttributeValues,onDeactivateError:h.N5.errors.actions.errorDeactivated},to=(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)}}),eo)(Jl),ro=(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"}}),no=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=ro(),g=sn(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(to,{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(Zr.Z,{className:m.divider}),c().createElement(E.Z,{className:m.actions},c().createElement(Le.Z,{disabled:!a,onClick:s,className:m.cancelButton},x().text("Cancel")),c().createElement(Le.Z,{disabled:!a,onClick:p,color:"primary"},x().text("Apply")))))},ao={palette:{type:"dark",primary:u.rSc.palette.primary,secondary:u.rSc.palette.secondary}},lo=(0,Ar.Z)(ao),oo=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)(Ga.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(jr.ThemeProvider,{theme:lo},c().createElement(E.Z,null,c().createElement(pn,{attributeType:r,uri:null==d?void 0:d.uri,onAddAttributes:b?a:void 0}),c().createElement(hn,{attributeType:r,attributeValue:d,imageAttributeFieldsOrder:t}),b&&c().createElement(no,{mode:f,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:d,hasChanges:m,onDeleteAttribute:o,onChangeAttribute:l,onAddAttributes:a,onCancel:i,onApply:p})))},io=(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}}))),so=e=>{let{className:t,attributeValue:r,handleSetAsDefault:n,attributeType:a}=e;const l=io(),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(Rr.Z,{classes:{root:l.formControlLabel,label:l.checkboxLabel},control:c().createElement(Dr.Z,{className:l.checkbox,checked:m,onChange:y,color:"default"}),label:x().text("Set as default")}),c().createElement(oo,{attributeType:a,imageAttributeFieldsOrder:d,attributeValue:r}))))},co=(0,T.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),uo=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=co();return c().createElement(E.Z,{className:p.root},c().createElement(Pr,{attributeValueIndex:o,setAttributeValueIndex:u,attributeValues:t,className:p.main}),c().createElement(so,{handleSetAsDefault:a,attributeValue:t[o],className:p.details,attributeType:l}))};var po=r(38724),mo=r(70331),go=r(15223),ho=r(73115);function fo(){return fo=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},fo.apply(this,arguments)}const bo=e=>c().createElement("svg",fo({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 yo=r(38592);const xo=(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,rt.U1)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,rt.U1)(e.palette.primary.main,.24)}}}))),Eo=(0,lt.Z)(Le.Z),vo=e=>{let{className:t,classes:r={},modes:n=[],modeId:a,onChange:l}=e;const o=xo();return c().createElement(yo.Z,{className:t},n.map((e=>{let{id:t,title:n,tooltipTitle:i,Icon:s}=e;return c().createElement(Eo,{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})))},wo=(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 Oo;!function(e){e.GALLERY_MODE="gallery",e.DETAILS_MODE="details"}(Oo||(Oo={}));const Co=e=>{let{open:t,mode:r,children:n,header:a,onClose:l,onChangeMode:o}=e;const i=wo(),u=(0,s.useMemo)((()=>[{id:Oo.GALLERY_MODE,title:x().text("Gallery"),Icon:ho.Z},{id:Oo.DETAILS_MODE,title:x().text("Details"),Icon:bo}]),[]);return c().createElement(Nn.Z,{classes:{paper:i.paper},open:t,BackdropProps:{className:i.backdrop},fullScreen:!0},c().createElement(mo.Z,{classes:{colorPrimary:i.appBar}},c().createElement(go.Z,{className:i.toolbar},c().createElement(E.Z,{className:i.headerLeft},c().createElement(ye.k,{tooltipTitle:x().text("Close"),onClick:l,className:i.closeButton,iconClassName:i.closeIcon,icon:Wn.default}),null==a?void 0:a.left),c().createElement(E.Z,{className:i.headerCenter},c().createElement(vo,{modes:u,modeId:r,onChange:o,className:i.modeSwitcher})),c().createElement(E.Z,{className:i.headerRight},null==a?void 0:a.right))),c().createElement(po.Z,{className:i.content},n))},To=(0,T.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),So=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:a,onShareLink:l,onSetAsDefault:o,onDownload:i,onClickImage:s,onDelete:u}=e;const p=To(),d=e=>c().createElement(Tn,{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(kr.Z,{container:!0},t.map((e=>{let{id:t,src:r}=e;return c().createElement(kr.Z,{key:t,classes:{item:p.item},item:!0},c().createElement(vr,{size:Er.LARGE,onClick:()=>s(t),src:r,overlay:d(t)}))}))))},ko=(0,T.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),No=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:a}=e;const l=ko(),o=t.length===r.length;return c().createElement(he.Z,{component:"button",underline:"none",classes:{button:l.selectButton},onClick:o?a:n},o?x().text("Clear selection"):x().text("Select all images"))};var Io=r(35292);const Po=(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)"}}))),Do=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:a}=e;const l=Po();return c().createElement(c().Fragment,null,n&&c().createElement(Le.Z,{variant:"contained",color:"primary",onClick:n,startIcon:c().createElement(fn.Z,null)},x().text("Upload")),t&&n&&c().createElement("div",{className:l.divider}),t&&c().createElement(ye.k,{className:l.downloadButton,tooltipTitle:x().text("Download selected items"),icon:wn,onClick:t}),r&&c().createElement(ye.k,{className:l.shareButton,tooltipTitle:x().text("Copy link"),icon:Io.Z,onClick:r}),a&&c().createElement(ye.k,{className:l.deleteButton,tooltipTitle:x().text("Delete selected items"),icon:ra.Z,onClick:a}))},Ro=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)(Oo.GALLERY_MODE),v=(0,g.useSelector)(h.ZP.selectors.getIsViewMode);(0,s.useEffect)((()=>{E(a?Oo.DETAILS_MODE:Oo.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===Oo.GALLERY_MODE,k=x===Oo.DETAILS_MODE,I=b.length>0,P=k||S&&I,D=!v&&P,R=!v&&(k||S&&!I),A=S&&I&&c().createElement(No,{items:w,selectedItems:b,onClearAll:()=>{y([])},onSelectAll:()=>{y((0,N.pluck)("id",w))}}),j=c().createElement(Do,{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:R?m:void 0});return c().createElement(Co,{mode:x,open:r,onChangeMode:E,header:{left:A,right:j},onClose:n},S&&c().createElement(So,{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(Oo.DETAILS_MODE)},onDelete:v?void 0:T}),k&&c().createElement(uo,{handleSetAsDefault:C,setCurrentAttributeValueUri:l,currentAttributeValueUri:a,attributeValues:t,attributeType:o}))};var Ao=r(94079);const jo=(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 Zo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lo=e=>{let{attributeType:t,attributeValues:r=[],renderImage:n,overlay:a=!1,countFixedItems:l=0,children:o,onUpload:i,onDeleteAttribute:p,imageSize:d=Xn,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=jo(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)(Or),[P,D]=(0,s.useState)(!1),[R,A]=(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||(A(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),B=(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]),U=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){Zo(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:L},a&&{onDownload:M,onShareLink:V,onSetAsDefault:B});return c().createElement(c().Fragment,null,c().createElement(wr.Z,{handleWidth:!0,onResize:Z}),c().createElement(Ro,{attributeValues:r,open:P,onClose:_,setCurrentAttributeValueUri:A,currentAttributeValueUri:R,attributeType:t,onDownload:M,onShareLink:V,onSetAsDefault:B,onUpload:i,onDeleteAttribute:p}),c().createElement("div",{className:O.imageBox},o,r.slice(0,T).map(n(U)),k>0&&c().createElement("div",{className:O.moreButtonContainer},c().createElement("div",{className:O.moreButton,onClick:()=>L()},c().createElement(v.Z,{className:O.number},`+${k}`)))))},_o=(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:Ct[Ot.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:Ct[Ot.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ct[Ot.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ct[Ot.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ct[Ot.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"}}))),Mo=e=>{let{attributeType:t,attributeValues:r=[],paging:n,parentUri:a,requestNextPageOfAttributeValues:l,showNonOv:o,imageSize:i=Xn}=e;const p=_o(i),{appearance:d}=(0,s.useContext)(ct);return c().createElement(Lo,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,u.efz)(e),{uri:n}=e,a=Dt(n,d),l=Tt(a);return c().createElement("div",{className:b()(p.image,{[p[l+"Image"]]:l}),key:n},c().createElement(vr,{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 Vo=r(20404);const Bo=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){zo(e,t,r[t])}))}return e}function zo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fo=(0,T.Z)({insertAttribute:Uo({width:"fit-content"},Ct[Ot.insertAttribute]),deleteAttribute:Uo({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},Ct[Ot.deleteAttribute])}),Ho=e=>{let{value:t}=e;const r=Fo(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),{appearance:a}=(0,s.useContext)(ct),l=Rt("roles",t,a),o=Tt(l);return c().createElement("span",{className:r[o]},(0,u.xqc)(n,t))},Wo=e=>{let{className:t,values:r}=e;return c().createElement(Bo,{values:r,className:t,Component:Ho})},qo=e=>{let{value:t}=e;const r=Fo(),n=(0,g.useSelector)(h.ZP.selectors.getUIPath),a=(0,g.useSelector)(h.ZP.selectors.getEntity),{appearance:l}=(0,s.useContext)(ct),o=Rt("tags",t,l),i=Tt(o);return c().createElement(he.Z,{underline:"none",className:r[i],href:(0,u.hgZ)({uiPath:n,tag:t,entityUri:a.uri})},t)},Go=e=>{let{className:t,values:r}=e;return c().createElement(Bo,{values:r,className:t,Component:qo})},$o=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(Vo.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(Go,{className:e,values:t});case u.xPW.roles.uri:return c().createElement(Wo,{className:e,values:t});default:return c().createElement(ar,{className:e,attributeValue:{value:t[0]},attributeType:r,inlined:!0})}})(a.attribute));var o},Yo="oneLine",Ko="multiLine",Xo="imageLine",Qo="special",Jo=(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)(Qo)],[u.Or$,(0,N.always)(Xo)],[(0,N.always)(C),(0,N.always)(Yo)],[N.T,(0,N.always)(Ko)]])(r)){case Yo:return c().createElement(lr,{value:x[0],nonVisibleValues:E,totalNonVisibleValues:O,attributeType:r,titleClassName:s,contentClassName:p,showTitle:d,showNonOv:m});case Ko:return c().createElement(pr,{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 Xo:return c().createElement(c().Fragment,null,d&&c().createElement(Q,{label:null==r?void 0:r.label,attributeType:r}),c().createElement(Mo,{attributeValues:x,attributeType:r,paging:a,parentUri:l,requestNextPageOfAttributeValues:i,showNonOv:m}));case Qo:return c().createElement($o,{values:x,attributeType:r,showTitle:d})}})()))})),ei={requestNextPageOfAttributeValues:h.N5.actions.requestNextPageOfAttributeValues},ti=(0,g.connect)(((e,t)=>{let{max:r}=t;return{max:r||h.ZP.selectors.getDefaultMaxValues(e)}}),ei)(Jo),ri=(0,s.memo)((e=>{let{attrTypes:t,entity:r,parentUri:n,drawLines:a,children:l,className:o,max:i,alwaysVisibleTypeUris:p=Ca,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)((()=>Sa(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(ti,{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(sr,{onClick:()=>{g(1/0)}}),E&&c().createElement(ur,{onClick:()=>{g(i)}}))})),ni=(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)"}}),ai=(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=ni(),d=(0,g.useSelector)(h.ZP.selectors.getPivotingAttributes),m=(0,s.useMemo)((()=>Ta(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(ri,{entity:r,attrTypes:m,parentUri:r.uri,drawLines:!1,max:i}):c().createElement(v.Z,{className:p.noData},x().text("No data found"))))):null})),li=(0,T.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function oi(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){ii(e,t,r[t])}))}return e}function ii(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const si=(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=li(),m=(0,g.useDispatch)(),f=(0,s.useContext)(Ga.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)((()=>Ta(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=>oi({},e,{viewId:f}))))),[f,m]),T=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.modifyAttribute,m)(oi({},e,{viewId:f}))),[f,m]),S=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.removeAttribute,m)(oi({},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(ka.Provider,{value:x},c().createElement(Pa,{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 ci(){return ci=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},ci.apply(this,arguments)}const ui=(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(ai,ci({attributesCount:r},a)):c().createElement(si,ci({mode:t,pinnedAttributes:n},a))})),pi=(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 di=r(83088);function mi(){return mi=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},mi.apply(this,arguments)}const gi=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=pi(),{value:o,label:i,startObject:s,endObject:u}=a,p=s.objectType.label+" ↔ "+u.objectType.label;return c().createElement(Va.Z,mi({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(Ma.Z,{className:l.iconTop,entityType:s.objectType}),c().createElement(Ma.Z,{className:l.iconBottom,entityType:u.objectType})),c().createElement("div",{className:l.text},c().createElement(di.C,{value:i},c().createElement(v.Z,{className:b()(l.textItem,l.primaryTextItem)},i)),c().createElement(di.C,{value:p},c().createElement(v.Z,{color:"textSecondary",className:b()(l.textItem,l.secondaryTextItem)},p))))};gi.propTypes={innerRef:U().oneOfType([U().oneOf([null]),U().func,U().shape({current:U().any.isRequired})]),innerProps:U().object.isRequired,selectOption:U().func.isRequired,data:U().shape({value:U().string.isRequired,label:U().string.isRequired,startObject:U().object,endObject:U().object})};const hi=gi;function fi(){return fi=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},fi.apply(this,arguments)}function bi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yi=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){bi(e,t,r[t])}))}return e}({},(0,N.defaultTo)({},a),{"data-reltio-id":"relation-type-selector"})),[a]);return c().createElement(_a.Z,fi({value:t,options:r,onChange:n,label:x().text("Select relationship type "),components:{Option:hi},TextFieldProps:o},l))},xi=U().shape({label:U().string.isRequired,value:U().string.isRequired,startObject:U().object,endObject:U().object});yi.propTypes={value:xi,options:U().arrayOf(xi),onChange:U().func};const Ei=yi;function vi(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){wi(e,t,r[t])}))}return e}function wi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oi(){return Oi=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},Oi.apply(this,arguments)}function Ci(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 Ti=e=>{let{values:t,valueContainerClassName:r}=e,n=Ci(e,["values","valueContainerClassName"]);return c().createElement(c().Fragment,null,(t||[]).map((e=>c().createElement("div",{key:e.uri,className:r},c().createElement(ar,Oi({attributeValue:e},n))))))},Si=(0,s.memo)((e=>{let{expanded:t}=e,r=Ci(e,["expanded"]);const{attributeType:n,values:a,valueContainerClassName:l}=r;switch(n.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_REFERENCE:return Ti(vi({expanded:t},r));case u.oS0.TYPE_IMAGE:return c().createElement("div",{className:l},c().createElement(Mo,{attributeType:n,attributeValues:a,imageSize:{imageHeight:40,imageWidth:40,imageMargin:2}}));default:return Ti(vi({},r))}}));var ki,Ni=r(44938);function Ii(){return Ii=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},Ii.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"}(ki||(ki={}));const Pi=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?ki.ICON_MODE:ki.TEXT_MODE)}),[r,n]);const i=()=>{o(ki.ERROR_MODE)};switch(l){case ki.ICON_MODE:return c().createElement(Ne.Z,Ii({className:t,src:r,onError:i},a));case ki.TEXT_MODE:case ki.ERROR_MODE:return c().createElement(Ne.Z,Ii({className:t},a),n);default:return null}};var Di=r(45108),Ri=r(30488),Ai=r(38748),ji=r(25843),Zi=r(53862);function Li(){return Li=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},Li.apply(this,arguments)}const _i=e=>c().createElement("svg",Li({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 Mi(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}const Bi=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}.`))})),zi=(0,N.curry)(((e,t)=>{let{groupId:r}=e;return r===t.id})),Fi=(0,N.propOr)(!0,"hideable"),Hi=(e,t)=>{const r=((e,t)=>e.find((0,N.either)(zi(t),Ui(t))))(e,t);return r?(r.children=Hi(r.children||[],t),e):e.concat(t)},Wi=(0,N.curry)(((e,t)=>u.P6Y.strings.search(t.label,e)||(t.children||[]).some(Wi(e)))),qi=(0,N.reduce)(((e,t)=>Hi(e,{id:t.id,groupId:t.groupId,label:t.label,attrType:t.dataTypeDefinition})),[]),Gi=(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)(Wi(e)),(0,N.chain)((t=>[{item:Mi({},t,{filterText:e}),level:r},...t.children?Gi(e,t.children,r+1):[]])))(t)})),$i=(0,N.has)("columns"),Yi=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],Xi=(e,t)=>{const r=Ki(t),n=t=>e.includes(t.id);return Bi(t)?r.every(n):r.some(n)},Qi=(0,T.Z)({popup:{minWidth:"200px"},groupItem:{backgroundColor:"rgba(0,0,0,0.04)"}}),Ji=e=>{let{item:t,onClick:r,checked:n,level:a,style:l,isFocused:o,isGroupItem:i}=e;const s=Qi();return c().createElement(m.Z,{key:t.id,onClick:r,checked:n,level:a,data:t,label:c().createElement(Xr,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:l,isFocused:o,hideIcon:i,className:b()({[s.groupItem]:i})})};Ji.propTypes={item:U().shape({label:U().string,filterText:U().string}),level:U().number,onClick:U().func,checked:U().bool,style:U().object,isGroupItem:U().bool,isFocused:U().bool};const es=Ji,ts=e=>{let{columnsData:t,selectedColumns:r,onChangeColumns:n,title:a,tooltipTitle:l}=e;const o=Qi(),[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)($i,Yi)),(0,N.filter)((0,N.either)(Bi,Fi)),qi,Gi(t))(e))(t,d)),[t,d]),h=(0,u.fW1)("label")(g)||308,f=(0,s.useMemo)((()=>zr(g)),[g]),b=(0,s.useCallback)((e=>{const t=(0,N.pipe)(Ki,(0,N.pluck)("id"))(e),a=Xi(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}=$r({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(ye.k,{tooltipTitle:l||x().text("Show/hide columns"),size:"L",icon:_i,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(Gr,{fixedTitle:!1,height:w,renderItem:(e,t,n)=>{let{item:a,level:l=0}=t;return c().createElement(es,{style:e,item:a,level:l,isFocused:E===n,checked:Xi(r,a),isGroupItem:Bi(a),onClick:b})},items:f,getItemSize:()=>32,containerWidth:h,focusIndex:E})))};ts.propTypes={columnsData:Zi.uz,selectedColumns:U().arrayOf(U().string),onChangeColumns:U().func,title:U().string,tooltipTitle:U().string};const rs=ts;function ns(){return ns=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},ns.apply(this,arguments)}const as=e=>c().createElement("svg",ns({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})),ls=(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"}}))),os=e=>{let{enabled:t,onClick:r}=e;const n=ls();return c().createElement(le.ZP,{title:t?x().text("Clear all filters"):x().text("Filter")},c().createElement(Xa.Z,{onClick:r,classes:{root:n.button}},t?c().createElement(c().Fragment,null,c().createElement(as,{className:n["filterIcon--enabled"]}),c().createElement(Wn.default,{color:"primary",className:n.closeIcon})):c().createElement(as,null)))};os.propTypes={enabled:U().bool,onClick:U().func};const is=os;var ss=r(42011),cs=r(46728),us=r(85103),ps=r(1928),ds=r(9377);function ms(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}const hs="CHANGE_COLUMNS",fs="TOGGLE_FILTERS",bs="CHANGE_FILTER",ys="TOGGLE_SORT",xs="CHANGE_PAGE",Es="CHANGE_ROWS_PER_PAGE",vs={changeColumns:(0,On.zD)(hs),toggleFilters:(0,On.zD)(fs),changeFilter:(0,On.zD)(bs),toggleSort:(0,On.zD)(ys),changePage:(0,On.zD)(xs),changeRowsPerPage:(0,On.zD)(Es)},ws=(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)},Os={reducer:(e,t)=>{switch(t.type){case hs:{const r=t.payload;return ws(e,r)}case fs:{const t=!e.filters;return ms({},e,{filters:t?{}:null,page:t?e.page:0})}case bs:{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 ys:{const r=t.payload,n=(0,N.path)(["sorting","field"],e),a=(0,N.path)(["sorting","order"],e);return ms({},e,{sorting:{field:r,order:(0,On.Dh)(r===n?a:null)},page:0})}case xs:return ms({},e,{page:t.payload});case Es:return ms({},e,{rowsPerPage:t.payload});default:return e}},actions:vs,changeVisibleColumns:ws};var Cs=r(76625);const Ts=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(wr.Z,{handleHeight:!0,onResize:d}),c().createElement(Cs.Z,{rootRef:a},r))};Ts.propTypes={onChangeHeight:U().func,children:U().node};const Ss=Ts;var ks=r(3073),Ns=r(28831);const Is=(0,T.Z)((()=>({hidden:{visibility:"hidden"}}))),Ps=e=>{let{rowIndex:t,rowValue:r,className:n}=e;const a=Is(),{toggleRowCollapse:l,getIsRowCollapsible:o,getIsRowCollapsed:i}=(0,s.useContext)(ks.x),u=o(r),p=i(t);return c().createElement(Ns.Z,{className:b()(n,{[a.hidden]:!u}),isOpen:!p,onClick:e=>{l(t),e.stopPropagation()}})};Ps.propTypes={rowIndex:U().number,rowValue:U().object,className:U().string};const Ds=Ps;function Rs(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}]`},js=()=>{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){Rs(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 Zs=r(21697),Ls=r(8233);function _s(){return _s=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},_s.apply(this,arguments)}const Ms=e=>{let{rowsData:t,columnsData:r,renderRowCell:n=ps.Z,getRowCellHeight:a=us.Z,defaultRowHeight:l=48,maxRowValuesCount:o=1/0}=e;const{tableRowsData:i,collapseContextValue:u}=(0,Ls.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,Zs.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(ks.x.Provider,{value:u},c().createElement("div",_s({},o,{style:{height:n(l)}}),i.length>0&&(0,Zs.getCellContentFromRowsData)({columnIndex:r.findIndex((0,N.propEq)("id",a)),headData:r,rowsData:i,rowIndex:l,getHeightForSubRow:t})))};return a.propTypes={columnId:U().string,rowIndex:U().number},{getRowHeight:n,CellRenderer:a}}),[i,l,u,r])};var Vs=r(67766),Bs=r(42767);const Us=(0,T.Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),zs=(0,lt.Z)(he.Z),Fs=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(zs,{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(ye.k,{size:"L",icon:Vs.Z,tooltipTitle:x().text("Go to previous profile"),onClick:r,disabled:l,showForDisabled:!0}),c().createElement(ye.k,{size:"L",icon:Bs.Z,tooltipTitle:x().text("Go to next profile"),onClick:n,disabled:o,showForDisabled:!0}))};function Hs(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){Ws(e,t,r[t])}))}return e}function Ws(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class qs{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=Hs({},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 Gs(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){$s(e,t,r[t])}))}return e}function $s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ys{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:Gs({},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),Xs=()=>{const{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}=(()=>{const e=(0,ze._)(),t=(0,ze._)(),r=(0,ze._)(),{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)(Ga.m),x=(0,g.useDispatch)(),[E,v]=(0,s.useState)(!1),w=(0,s.useMemo)((()=>((e,t)=>{switch(e){case"search":return new qs(t);case"graphsearch":return new Ys(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(Fs,{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}):null};var Qs=r(82068),Js=r(72668),ec=r(38037),tc=r(62321),rc=r(56215),nc=r(12960),ac=r(39878),lc=r(59383);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 ic=e=>c().createElement($e.Z,oc({mouseEvent:"onMouseDown"},e));var sc=r(89902),cc=r(78501),uc=r(59952),pc=r(51556);const dc=(0,T.Z)((()=>({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}})));function mc(){return mc=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},mc.apply(this,arguments)}function gc(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){hc(e,t,r[t])}))}return e}function hc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fc=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:gc({},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)((()=>zr(O)),[O]),{focusIndex:T,handleKeyDown:S}=$r({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(Xr,{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=dc();return c().createElement(Ur,mc({open:t,className:b()(D.container,D.popupContainer),anchorEl:r,onClose:l,onSearch:a,title:o,containerWidth:P,searchInputOnKeyDown:S},f),c().createElement(Gr,{height:300,renderItem:I,items:C,hideSubtitles:!0,getItemSize:()=>32,containerWidth:P,focusIndex:T,renderGroupTitle:h}))};fc.propTypes={open:U().bool,hideCheckBox:U().bool,anchorEl:U().any,selected:U().array,data:U().array,filterText:U().string,titleText:U().string,onClose:U().func,onListItemClick:U().func,onSearch:U().func,renderGroupTitle:U().func},fc.defaultProps={data:[],selected:[],titleText:x().text("Show/hide columns"),filterText:""};const bc=fc,yc=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 xc(){return xc=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},xc.apply(this,arguments)}const Ec=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}=yc({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(Ei,xc({value:d(t,m),options:m,onChange:g},i))};Ec.propTypes={className:U().string,relation:u.bNA,inRelationTypes:U().arrayOf(u.IYE),outRelationTypes:U().arrayOf(u.IYE),applyFirstByDefault:U().bool,reversedContextLabels:U().bool,onChange:U().func};const vc=Ec;var wc=r(4190),Oc=r(60364);function Cc(){return Cc=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},Cc.apply(this,arguments)}const Tc=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,Oc.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(wc.ZP,Cc({open:t},n),a&&r)};Tc.displayName="Drawer";const Sc=Tc;var kc=r(1128),Nc=r(43371),Ic=r(15299),Pc=r(19855),Dc=r(72466),Rc=r(39600),Ac=r(91785),jc=r(51594),Zc=r(7522);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 _c=e=>c().createElement(Zc.Z,Lc({message:x().text("No data available")},e));var Mc=r(6216),Vc=r(79002);const Bc=(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=Bc(),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 zc=r(45767),Fc=r(86619);const Hc=(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 Wc(){return Wc=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},Wc.apply(this,arguments)}const qc=(0,N.always)(32),Gc=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(Gr,Wc({getItemSize:qc,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(Xr,{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))};Gc.propTypes={selectedEntityTypes:U().array,onItemClick:U().func,focusIndex:U().number};const $c=(0,s.memo)(Gc),Yc=(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},Xc=e=>e.join(", "),Qc=e=>`calc(${(0,N.isNil)(e)?"100%":`${e}px`} - 35px)`,Jc=e=>{let{list:t,maxWidth:r}=e;const n=Yc(),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=Xc(t),u=l>0,p=u?Xc(t.slice(0,-l)):i;return c().createElement(le.ZP,{title:u?i:""},c().createElement("div",{className:n.listLabelContainer},c().createElement("div",{style:{width:Qc(r)},className:n.listLabel,ref:a},i),c().createElement("div",{className:n.visibleItemsLabel},p),u&&c().createElement("div",{className:n.hiddenCount},`+${l}`)))};Jc.propTypes={list:U().arrayOf(U().string).isRequired,maxWidth:U().number};const eu=Jc;function tu(){return tu=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},tu.apply(this,arguments)}function ru(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){nu(e,t,r[t])}))}return e}function nu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const au=e=>{let{entityTypes:t,selectedEntityTypes:r,single:n,placeholder:a,enableEmptyValueUnderline:l,onChange:o,classes:i={},ListLabelProps:p={},disabled:d=!1}=e;const m=Hc(),[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:ru({},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}=$r({items:C,open:g,onSelectFocusedItem:k,selectedItems:r,onClose:O}),D=(0,s.useRef)(),R=D.current?D.current.getBoundingClientRect().width:0,A=Math.max(R,255),j=0===r.length;return c().createElement(c().Fragment,null,c().createElement(Fc.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(eu,tu({},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(_t.Z,{size:"L",icon:zc.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:A,containerHeight:355,searchInputOnKeyDown:P,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":"entity-type-selector-popup"}},c().createElement($c,{items:C,onItemClick:S,selectedEntityTypes:r,width:A,height:245,focusIndex:I})))};au.propTypes={entityTypes:U().arrayOf(u.p8l),selectedEntityTypes:U().arrayOf(U().string).isRequired,onChange:U().func.isRequired,single:U().bool,enableEmptyValueUnderline:U().bool,placeholder:U().string,classes:U().shape({root:U().string,label:U().string,inputText:U().string,input:U().string}),ListLabelProps:U().shape({maxWidth:U().number}),disabled:U().bool};const lu=(0,s.memo)(au);var ou=r(7882),iu=r(97333);const su=e=>`rotateY(${e?180:0}deg)`,cu=e=>`rotateX(${e?180:0}deg)`,uu=e=>`rotateY(${e?0:-180}deg)`,pu=e=>`rotateX(${e?0:-180}deg)`,du=(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?uu(t):pu(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?su(t):cu(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",zIndex:2,display:"flex"}}}),mu=(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=du({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]))})),gu=()=>c().createElement("div",{style:{display:"none"}}),hu=e=>{let{widthToHide:t,children:r}=e;return c().createElement(wr.Z,{handleWidth:!0,render:e=>{let{width:n}=e;return n>t?c().createElement(c().Fragment,null,r):c().createElement(gu,null)}})};hu.propTypes={children:U().node,widthToHide:U().number.isRequired};const fu=hu;function bu(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){yu(e,t,r[t])}))}return e}function yu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xu=(0,N.range)(2,10).reduce(((e,t)=>bu({},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)"}}})),{}),Eu=(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":bu({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},xu,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function vu(){return vu=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},vu.apply(this,arguments)}const wu=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=Eu(),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(le.ZP,vu({title:l,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};wu.propTypes={pathToTitle:U().arrayOf(U().string).isRequired,children:U().node};const Ou=wu;var Cu=r(4614),Tu=r(61932);const Su=(0,T.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}});let ku;!function(e){e[e.INIT=1]="INIT",e[e.PROGRESS=2]="PROGRESS",e[e.SUCCESS=3]="SUCCESS",e[e.DONE=4]="DONE"}(ku||(ku={}));const Nu=e=>{let{classes:t={},tooltip:r="",onClick:n=On.ZT,mode:a=ku.INIT}=e;const l=Su();return c().createElement("div",{className:b()(l.root,t.root)},(()=>{switch(a){case ku.INIT:return c().createElement(ye.k,{className:t.button,size:"M",tooltipTitle:r,icon:Tu.Z,onClick:n});case ku.PROGRESS:return c().createElement(Cu.Z,{className:t.spinner,size:24});case ku.SUCCESS:return c().createElement(ge.Z,{className:b()(l.check,t.check)});default:return null}})())},Iu=(0,T.Z)({link:{textDecoration:"inherit",color:"inherit","&:visited":{textDecoration:"inherit",color:"inherit"}}}),Pu=e=>{let{to:t,children:r,onClick:n}=e;const a=Iu();return c().createElement("a",{href:t,onClick:e=>{n&&(n(),e.stopPropagation(),e.preventDefault())},className:a.link},r)},Du=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==")})},Ru=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"}}),ju=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(Ru,{isMlMatch:t})," "),c().createElement("div",{className:n.body},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},Zu=(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"}}))),Lu=e=>{let{isMlMatch:t,matchRules:r,className:n}=e;const a=Zu();return c().createElement("div",{className:b()(a.container,n)},c().createElement("div",{className:a.title},c().createElement(Ru,{isMlMatch:t})),c().createElement("div",{className:a.labelsContainer},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},_u=(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 Mu(){return Mu=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},Mu.apply(this,arguments)}const Vu=(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=_u();return c().createElement("div",Mu({onClick:a,ref:t,className:b()(i.container,l)},o),c().createElement(Ut,{expanded:n}),c().createElement("div",{className:i.label},r))}));Vu.displayName="MatchRuleBadge";const Bu=Vu,Uu=(0,T.Z)({container:{display:"flex",flexDirection:"column",alignItems:"flex-start"},rulesContainer:{marginLeft:"16px"},icon:{height:"17px",width:"15px",marginRight:"5px"}});function zu(){return zu=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},zu.apply(this,arguments)}const Fu=e=>c().createElement("svg",zu({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}))),Hu=(0,lt.Z)(Bu),Wu=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(Hu,{tooltipTitle:c().createElement(ju,{matchRules:r,isMlMatch:t}),tooltipPlacement:"bottom-start",onExpand:o,expanded:a},t?c().createElement(c().Fragment,null,c().createElement(Fu,{className:n.icon}),x().text("Match IQ")):x().text("Rules")),a?c().createElement(Lu,{className:n.rulesContainer,matchRules:r,isMlMatch:t}):null)};function qu(){return qu=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},qu.apply(this,arguments)}const Gu=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,qu({matchRules:l},n)),(0,N.isEmpty)(a)?null:c().createElement(r,qu({isMlMatch:!0,matchRules:a},n)))};Gu.propTypes={matchRules:u.p3$,Component:U().func};const $u=Gu,Yu=(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=Yu(),[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($u,{Component:Lu,matchRules:r,className:n.matchLabels}):null)},Xu=(0,T.Z)({container:{display:"flex",flexDirection:"column"},rulesWrapper:{display:"flex",flexDirection:"column"}}),Qu=(0,T.Z)({ruleWrapper:{paddingTop:"8px"},label:{fontWeight:500,fontSize:"12px"}}),Ju=e=>{let{transitiveMatchRules:t}=e;const r=Qu();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(ju,{matchRules:a}))})))};function ep(){return ep=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},ep.apply(this,arguments)}const tp=(0,lt.Z)(Bu),rp=e=>{let{transitiveMatchRules:t}=e;const r=Xu(),[n,a]=(0,s.useState)(!1),l=(0,s.useCallback)((()=>a((e=>!e))),[]);return c().createElement("div",{className:r.container},c().createElement(tp,{tooltipTitle:c().createElement(Ju,{transitiveMatchRules:t}),tooltipPlacement:"bottom-start",onExpand:l,expanded:n},x().text("Transitive matches")),n?t.map(((e,t)=>c().createElement(Ku,ep({key:t},e)))):null)},np=e=>{let{entitiesMap:t,entity:r,match:n,metadata:a}=e;return(0,u.Pcm)(n)?c().createElement(rp,{transitiveMatchRules:(0,u.wB1)(a,n,t)}):c().createElement($u,{matchRules:(0,u.LS0)(a,r.type,n.matchRules),Component:Wu})};var ap=r(73698);const lp=(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 op(){return op=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},op.apply(this,arguments)}const ip=e=>"onClick"in e,sp=e=>{let{optionsGroup:t,buttonsGroup:r,value:n,onChange:a,disabled:l=!1}=e;const o=lp();return c().createElement(ap.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(le.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(ip);return e.map(((e,r)=>{const{value:n,description:a,icon:l}=e,i={value:n,className:o.menuItem};return ip(e)&&(i.onClick=()=>e.onClick(n),i.className=b()(i.className,{[o.firstMenuItemButton]:r===t})),c().createElement(Va.Z,op({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 cp=r(16482),up=r(73272);function pp(){return pp=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},pp.apply(this,arguments)}const dp=e=>c().createElement("svg",pp({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"})),mp=(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}}))),gp=e=>{let{date:t,type:r,createdBy:n,step:a,children:l,Actions:o}=e;const i=mp(),[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(dp,{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(up.Z,{className:i.flag}),c().createElement("span",{className:i.date},x().date(t,"L")),c().createElement(Ns.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)};gp.propTypes={date:U().number,createdBy:U().string,type:U().string,step:U().string,children:U().oneOfType([U().node,U().arrayOf(U().node)]),Actions:U().node};const hp=gp,fp=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(K,{attrTypeUri:n,label:t}),c().createElement("span",{className:o.value,style:{color:(0,u.Uz2)(n,r,a)}},r))};fp.propTypes={label:U().string,value:U().oneOfType([U().string,U().number]),uri:U().string,rangeColorsConfig:U().object,className:U().string};const bp=fp,yp=(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 xp(){return xp=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},xp.apply(this,arguments)}const Ep=e=>{let{className:t,entity:r,scoresToShow:n,rangeColorsConfig:a,children:l,classes:o}=e;const i=yp({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,C=(0,u.BTI)(r);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(bt,{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(bp,xp({key:e.uri},e,{rangeColorsConfig:a}))))),!(0,u.ZiX)(O)&&c().createElement(le.ZP,{title:x().text("Copy to clipboard")},c().createElement(v.Z,{display:"inline",variant:"body2",className:i.entityId,onClick:d},x().text("Entity ID"),": ",C))))),l&&c().createElement("div",null,l)))};Ep.propTypes={className:U().string,entity:U().object,scoresToShow:U().arrayOf(U().string),rangeColorsConfig:U().object,children:U().node,classes:U().object};const vp=Ep,wp=(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 Op(){return Op=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},Op.apply(this,arguments)}const Cp=(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=wp(),{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",Op({className:b()(l.container,s)},a),c().createElement("div",{className:l.colorBox,style:n?void 0:{backgroundColor:x}}),c().createElement(bt,{entity:t,avatarClassName:l.avatar,imageClassName:l.image}),c().createElement("div",{className:l.info},c().createElement("div",{className:l.firstRow},c().createElement(Ee.Z,{value:(0,u.wwR)(t),className:l.link},c().createElement(di.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(di.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)))))})),Tp=(0,T.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));var Sp=r(6782);const kp="46px",Np=(0,T.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:kp},readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:kp}}))),Ip=e=>{let{className:t,rowData:r}=e;const n=Np();return c().createElement("div",{className:b()(n.readOnlyLogicOperatorContainer,t)},r&&r.operator?(0,Sp.Z)(r.operator):x().text("Where"))};Ip.propTypes={className:U().string,rowData:U().object};const Pp=Ip,Dp=e=>{let{className:t,rowData:r}=e;const n=Np();return c().createElement("div",{className:b()(n.readOnlyFilter,t)},r&&r.filter?(0,u.XS2)(r.filter):x().text("equals"))};Dp.propTypes={className:U().string,rowData:U().object};const Rp=Dp;const Ap=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=Pp,AttributeSelectorComponent:l,FilterSelectorComponent:o=Rp,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=Tp();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:U().shape({root:U().string,logicOperatorContainer:U().string,attributeSelectorContainer:U().string,filterSelectorContainer:U().string,valuesEditorContainer:U().string,actionsContainer:U().string}),rowData:Zi.Xw,previousRowData:Zi.Xw,LogicOperatorComponent:U().elementType,AttributeSelectorComponent:U().elementType,FilterSelectorComponent:U().elementType,ValuesEditorComponent:U().elementType,ActionsComponent:U().elementType,filterSelectorRef:U().object,attributeSelectorProps:U().shape({onRestoreFocus:U().func,onOpen:U().func,disablePopoverRestoreFocus:U().bool})};const jp=(0,s.memo)(Ap);function Zp(){return Zp=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},Zp.apply(this,arguments)}const Lp=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(jp,Zp({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))};Lp.propTypes={className:U().string,rowClasses:U().shape({root:U().string,logicOperatorContainer:U().string,attributeSelectorContainer:U().string,filterSelectorContainer:U().string,valuesEditorContainer:U().string,actionsContainer:U().string}),rowsData:U().arrayOf(Zi.Xw),LogicOperatorComponent:U().elementType,AttributeSelectorComponent:U().elementType,FilterSelectorComponent:U().elementType,ValuesEditorComponent:U().elementType,ActionsComponent:U().elementType,filterSelectorRef:U().object,filterSelectorRefIndex:U().number,lastRowAttributeSelectorProps:U().shape({onRestoreFocus:U().func,onOpen:U().func,disablePopoverRestoreFocus:U().bool})};const _p=(0,s.memo)(Lp);var Mp=r(15793);const Vp={BY_LABEL:(0,r(54573).c)({stringify:(0,N.prop)("label")})};var Bp=r(81521),Up=r(8978),zp=r(46847),Fp=r(15459);function Hp(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}const Wp=(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 qp(){return qp=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},qp.apply(this,arguments)}const Gp=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"]);Wp();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:Hp("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:Hp("rst__absoluteLineBlock",l,v)}))}})),C="rtl"===x?{right:o*w}:{left:o*w},u(c().createElement("div",qp({},E,{className:Hp("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}))))))};Gp.defaultProps={swapFrom:null,swapDepth:null,swapLength:null,canDrop:!1,draggedNode:null,rowDirection:"ltr"},Gp.propTypes={treeIndex:U().number.isRequired,treeId:U().string.isRequired,swapFrom:U().number,swapDepth:U().number,swapLength:U().number,scaffoldBlockPxWidth:U().number.isRequired,lowerSiblingCounts:U().arrayOf(U().number).isRequired,listIndex:U().number.isRequired,children:U().node.isRequired,connectDropTarget:U().func.isRequired,isOver:U().bool.isRequired,canDrop:U().bool,draggedNode:U().shape({}),getPrevRow:U().func.isRequired,node:U().shape({}).isRequired,path:U().arrayOf(U().oneOfType([U().string,U().number])).isRequired,rowDirection:U().string};const $p=Gp;function Yp(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 Xp(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=Xp({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 Qp(e){let{node:t,ignoreCollapsed:r=!0}=e;return Xp({getNodeKey:()=>{},ignoreCollapsed:r,node:t,currentIndex:0,targetIndex:-1}).nextIndex-1}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=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=Jp({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 ed(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=Yp({},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=ed({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 td(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;!t||t.length<1||Jp({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]})}function rd(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;return!t||t.length<1?[]:ed({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]}).node.children}function nd(e){let{treeData:t,expanded:r=!0}=e;return rd({treeData:t,callback:e=>{let{node:t}=e;return Yp({},t,{expanded:r})},getNodeKey:e=>{let{treeIndex:t}=e;return t},ignoreCollapsed:!1})}function ad(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 Yp({},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+Qp({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 ld(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,l=null,o=null;return{treeData:ad({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 od(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=Yp({},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+Qp({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=Yp({},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=od({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=Yp({},s,{children:y}),E={node:x,nextIndex:b};return null!==g&&(E.insertedTreeIndex=g,E.parentPath=[...m(x),...h],E.parentNode=f),E}function id(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=od({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 sd(e){let{treeData:t,getNodeKey:r,ignoreCollapsed:n=!0}=e;if(!t||t.length<1)return[];const a=[];return td({treeData:t,getNodeKey:r,ignoreCollapsed:n,callback:e=>{a.push(e)}}),a}function cd(e,t){return!!e.children&&"function"!=typeof e.children&&e.children.some((e=>e===t||cd(e,t)))}function ud(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,ud(r,t+1))),t):t}function pd(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(Yp({},b,{node:u,searchQuery:n}))&&(s===l&&(h=!0),s+=1,g=!0);let x=p;const E=Yp({},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=>Yp({},e,{treeIndex:null})))),g&&(m=[Yp({},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 dd={find:pd,getDepth:ud,isDescendant:cd,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?Yp({},e,{children:l[t].map((e=>o(e)))}):Yp({},e)};return l[a].map((e=>o(e)))},getFlatDataFromTree:sd,insertNode:id,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=rd({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=Yp({},t);if(o&&(d.expanded=!0),!d.children)return s=a+1,Yp({},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+Qp({node:d.children[e],ignoreCollapsed:l});return s=m,Yp({},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{ad({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:ld,removeNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e;return ad({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:null})},changeNodeAtPath:ad,toggleExpandedForAll:nd,map:rd,walk:td,getVisibleNodeInfoAtIndex:function(e){let{treeData:t,index:r,getNodeKey:n}=e;if(!t||t.length<1)return null;const a=Xp({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:Qp};function md(){return md=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},md.apply(this,arguments)}function gd(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){hd(e,t,r[t])}))}return e}function hd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fd=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:Hp("rst__loadingCirclePoint",N)}))))):a(c().createElement("div",{className:"rst__moveHandle"}),{dropEffect:"copy"}));const P=d&&cd(d,s),D=!E&&l;let R={left:-.5*t};return"rtl"===C&&(R={right:-.5*t}),c().createElement("div",md({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:Hp(s.expanded?"rst__collapseButton":"rst__expandButton",N),style:R,onClick:()=>r({node:s,path:m,treeIndex:g})}),s.expanded&&!l&&c().createElement("div",{style:{width:t},className:Hp("rst__lineChildren",N)})),c().createElement("div",{className:Hp("rst__rowWrapper",N)},n(c().createElement("div",{className:Hp("rst__row",D&&"rst__rowLandingPad",D&&!o&&"rst__rowCancelPad",h&&"rst__rowSearchMatch",f&&"rst__rowSearchFocus",N,y),style:gd({opacity:P?.5:1},x)},I,c().createElement("div",{className:Hp("rst__rowContents",!i&&"rst__rowContentsDragDisabled",N)},c().createElement("div",{className:Hp("rst__rowLabel",N)},c().createElement("span",{className:Hp("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)))))))))};fd.defaultProps={isSearchMatch:!1,isSearchFocus:!1,canDrag:!1,toggleChildrenVisibility:null,buttons:[],className:"",style:{},parentNode:null,draggedNode:null,canDrop:!1,title:null,subtitle:null,rowDirection:"ltr"},fd.propTypes={node:U().shape({}).isRequired,title:U().oneOfType([U().func,U().node]),subtitle:U().oneOfType([U().func,U().node]),path:U().arrayOf(U().oneOfType([U().string,U().number])).isRequired,treeIndex:U().number.isRequired,treeId:U().string.isRequired,isSearchMatch:U().bool,isSearchFocus:U().bool,canDrag:U().bool,scaffoldBlockPxWidth:U().number.isRequired,toggleChildrenVisibility:U().func,buttons:U().arrayOf(U().node),className:U().string,style:U().shape({}),connectDragPreview:U().func.isRequired,connectDragSource:U().func.isRequired,parentNode:U().shape({}),isDragging:U().bool.isRequired,didDrop:U().bool.isRequired,draggedNode:U().shape({}),isOver:U().bool.isRequired,canDrop:U().bool,rowDirection:U().string};const bd=fd;function yd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class xd 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){yd(e,t,r[t])}))}return e}({},l))))))}}xd.defaultProps={canDrop:!1,draggedNode:null},xd.propTypes={children:U().node.isRequired,connectDropTarget:U().func.isRequired,isOver:U().bool.isRequired,canDrop:U().bool,draggedNode:U().shape({}),treeId:U().string.isRequired,drop:U().func.isRequired};const Ed=xd,vd=(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"}}))),wd=e=>{let{isOver:t,canDrop:r}=e;return vd(),c().createElement("div",{className:Hp("rst__placeholder",r&&"rst__placeholderLandingPad",r&&!t&&"rst__placeholderCancelPad")})};wd.defaultProps={isOver:!1,canDrop:!1},wd.propTypes={isOver:U().bool,canDrop:U().bool};const Od=wd,Cd=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}},Td=Cd(id),Sd=Cd(sd),kd=Cd(Qp);function Nd(e){let{treeIndex:t}=e;return t}function Id(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=>Id(e))).join("")}function Pd(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]?Id(r[e]).indexOf(t)>-1:r[e]&&String(r[e]).indexOf(t)>-1}function Dd(e){let{node:t,path:r,treeIndex:n,searchQuery:a}=e;return Pd("title",a,t,r,n)||Pd("subtitle",a,t,r,n)}const Rd={defaultSearchMethod:Dd,defaultGetNodeKey:Nd};var Ad=r(75047);class jd{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=ud(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=Td({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,Sn.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,Sn.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,Sn.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 Zd(){return Zd=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},Zd.apply(this,arguments)}function Ld(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){_d(e,t,r[t])}))}return e}function _d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Md=1;const Vd=e=>{const t=Ld({},e,{style:Ld({},e.theme.style,e.style),innerStyle:Ld({},e.theme.innerStyle,e.innerStyle),reactVirtualizedListProps:Ld({},e.theme.reactVirtualizedListProps,e.reactVirtualizedListProps)}),r={nodeContentRenderer:bd,placeholderRenderer:Od,rowHeight:62,scaffoldBlockPxWidth:44,slideRegionSize:100,treeNodeRenderer:$p};return Object.keys(r).forEach((n=>{null===e[n]&&(t[n]=void 0!==e.theme[n]?e.theme[n]:r[n])})),t};class Bd extends s.Component{constructor(e){super(e);const{dndType:t,nodeContentRenderer:r,treeNodeRenderer:n,isVirtualized:a,slideRegionSize:l}=Vd(e);this.dndManager=new jd(this),this.treeId=`rst__${Md}`,Md+=1,this.dndType=t||this.treeId,this.nodeContentRenderer=this.dndManager.wrapSource(r),this.treePlaceholderRenderer=this.dndManager.wrapPlaceholder(Ed),this.treeNodeRenderer=this.dndManager.wrapTarget(n),a&&(this.scrollZoneVirtualList=(Up._t||Up.ZP)(Bp.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(){Bd.loadLazyChildren(this.props);const e=Bd.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,Bd.search(e,t,!0,!0,!0)):Object.assign(n,Bd.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&&td({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}=ld({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=ad({treeData:e,path:t,newNode:e=>{let{node:t}=e;return Ld({},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,Bd.loadLazyChildren(this.props),Object.assign(a,Bd.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=Ld({},n,{treeData:this.props.treeData}),this.setState(a))}}componentWillUnmount(){this.clearMonitorSubscription()}getRows(e){return Sd({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=ad({treeData:n.treeData,path:r,newNode:e=>{let{node:t}=e;return Ld({},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}=id({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}=pd({getNodeKey:o,treeData:p?nd({treeData:d.treeData,expanded:!1}):d.treeData,searchQuery:s,searchMethod:c||Dd,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}=ld({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=Td({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:ad({treeData:i,path:c,newNode:e=>{let{node:t}=e;return Ld({},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=ad({treeData:t.treeData,path:n,newNode:e=>{let{node:t}=e;return Ld({},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){td({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(ad({treeData:e.treeData,path:n,newNode:e=>{let{node:n}=e;return n===r?Ld({},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}=Vd(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,Zd({style:n,key:w,listIndex:r,getPrevRow:a,lowerSiblingCounts:m,swapFrom:o,swapLength:s,swapDepth:i},N),c().createElement(v,Zd({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}=Vd(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=Td({treeData:f,newNode:m,depth:g,minimumTreeIndex:h,expandParent:!0,getNodeKey:s}),t=h;x=e.treeIndex,E=1+kd({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=Ld({height:"100%"},C);const t=this.scrollZoneVirtualList;O=c().createElement(Bp.qj,null,(r=>{let{height:l,width:o}=r;return c().createElement(t,Zd({},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:Hp("rst__tree",r,b),style:C},O)}}Bd.propTypes={classes:U().object,dragDropManager:U().shape({getMonitor:U().func}).isRequired,treeData:U().arrayOf(U().object).isRequired,style:U().shape({}),className:U().string,innerStyle:U().shape({}),rowHeight:U().oneOfType([U().number,U().func]),slideRegionSize:U().number,reactVirtualizedListProps:U().shape({}),scaffoldBlockPxWidth:U().number,maxDepth:U().number,searchMethod:U().func,searchQuery:U().any,searchFocusOffset:U().number,searchFinishCallback:U().func,generateNodeProps:U().func,isVirtualized:U().bool,treeNodeRenderer:U().func,nodeContentRenderer:U().func,placeholderRenderer:U().func,theme:U().shape({style:U().shape({}),innerStyle:U().shape({}),reactVirtualizedListProps:U().shape({}),scaffoldBlockPxWidth:U().number,slideRegionSize:U().number,rowHeight:U().oneOfType([U().number,U().func]),treeNodeRenderer:U().func,nodeContentRenderer:U().func,placeholderRenderer:U().func}),getNodeKey:U().func,onChange:U().func.isRequired,onMoveNode:U().func,canDrag:U().oneOfType([U().func,U().bool]),canDrop:U().func,canNodeHaveChildren:U().func,shouldCopyOnOutsideDrop:U().oneOfType([U().func,U().bool]),onVisibilityToggle:U().func,dndType:U().string,onDragStateChanged:U().func,onlyExpandSearchedNodes:U().bool,rowDirection:U().string,onLazyLoadChildren:U().func,ignoreTreeChanges:U().bool},Bd.defaultProps={canDrag:!0,canDrop:null,canNodeHaveChildren:()=>!0,className:"",dndType:null,generateNodeProps:null,getNodeKey:Nd,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,zp.polyfill)(Bd);const Ud=(0,Fp.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"}})))(Bd),zd=e=>c().createElement(Sn.DndContext.Consumer,null,(t=>{let{dragDropManager:r}=t;return void 0===r?null:c().createElement(Ud,Zd({},e,{dragDropManager:r}))})),Fd=e=>c().createElement(Sn.DndProvider,{backend:kn.default},c().createElement(zd,e));var Hd=r(17822),Wd=r(31396);const qd=(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%"}}}}}))),Gd=e=>"horizontal"===e,$d=e=>{let{className:t,children:r,orientation:n,defaultSize:a,size:l,minSize:o,maxSize:i,allowResize:p,onChange:d}=e;const m=qd(),g=(0,Oc.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=()=>Gd(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(Gd(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(Wd.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))},Yd=U().oneOfType([U().number,U().string]);$d.propTypes={className:U().string,children:U().arrayOf(U().node).isRequired,orientation:U().oneOf(["horizontal","vertical"]).isRequired,defaultSize:Yd,size:Yd,minSize:Yd,maxSize:Yd,allowResize:U().bool,onChange:U().func};const Kd=$d;var Xd=r(15311);function Qd(){return Qd=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},Qd.apply(this,arguments)}function Jd(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){em(e,t,r[t])}))}return e}function em(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tm=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,Xd.y)({});return c().createElement(Vr.Z,Qd({classes:Jd({},t,{focused:n.white})},r))};var rm=r(72654);function nm(){return nm=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},nm.apply(this,arguments)}const am=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=Mr({containerWidth:l,containerHeight:o});return c().createElement("div",{className:p.root},u,c().createElement(Ye.Z,{open:t,onClose:a,anchorEl:r,placement:"bottom-start",transition:!0},(e=>{let{TransitionProps:t}=e;return c().createElement(rm.Z,t,c().createElement(Ge.Z,nm({elevation:2},i),c().createElement("div",{className:b()(d.container,n),style:{width:l}},c().createElement("div",{className:d.list},s))))})))};am.propTypes={open:U().bool,anchorEl:U().object,className:U().string,onClose:U().func,containerWidth:U().number,containerHeight:U().number,paperProps:U().object,listContent:U().element,externalInputField:U().element,classes:U().shape({root:U().string})},am.defaultProps={popoverAnchorOrigin:{vertical:"top",horizontal:"right"}};const lm=am,om=(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%"}}),im=e=>{let{value:t,onChange:r,options:n,classes:a={},emptyLabel:l}=e;const o=om(),[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(kc.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)}))};im.propTypes={value:U().string,onChange:U().func,options:U().arrayOf(U().shape({value:U().string,label:U().string})),classes:U().shape({root:U().string,onlyValue:U().string,select:U().string,selectMenu:U().string,textField:U().string}),emptyLabel:U().string};const sm=im,cm=(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,rt.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 um(){return um=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},um.apply(this,arguments)}const pm=e=>{let{buttonsProps:t,activeIndexId:r,className:n,onButtonClick:a}=e;const l=cm();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(ye.k,um({},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}`}))})))};function dm(){return dm=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},dm.apply(this,arguments)}const mm=e=>c().createElement("svg",dm({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),c().createElement("mask",{id:"AttributesList_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},c().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),c().createElement("g",{mask:"url(#AttributesList_svg__a)"},c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#AttributesList_svg__b)"}),c().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M187.761 56.865l58.639 58.639v148.871H93.383L52 225.083V56.865h135.761z",fill:"url(#AttributesList_svg__c)"}),c().createElement("path",{opacity:.06,fillRule:"evenodd",clipRule:"evenodd",d:"M47 58h202a7 7 0 017 7v157a7 7 0 01-7 7H47a7 7 0 01-7-7V65a7 7 0 017-7z",fill:"#000"}),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50 56h201a5 5 0 015 5v157a5 5 0 01-5 5H50a5 5 0 01-5-5V61a5 5 0 015-5z",fill:"#fff"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 72.635a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 84.635a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 163a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 175a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 193a3 3 0 013-3H190a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 205a3 3 0 013-3h74.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 103a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 115a3 3 0 013-3h64.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),c().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 133a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 145a3 3 0 013-3h74.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M92.514 108v-8h-2v40.365h11.178v-2h-9.178V110h9.178v-2h-9.178z",fill:"#2B98F0"}),c().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),c().createElement("path",{opacity:.6,fillRule:"evenodd",clipRule:"evenodd",d:"M50 22h186a6 6 0 016 6v18a6 6 0 01-6 6H50a6 6 0 01-6-6V28a6 6 0 016-6z",fill:"#fff"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M58 37a6 6 0 016-6h70a6 6 0 110 12H64a6 6 0 01-6-6zm90 0a6 6 0 016-6h10a6 6 0 110 12h-10a6 6 0 01-6-6z",fill:"#979797"})),c().createElement("defs",null,c().createElement("linearGradient",{id:"AttributesList_svg__b",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},c().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),c().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),c().createElement("linearGradient",{id:"AttributesList_svg__c",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},c().createElement("stop",{stopOpacity:.01}),c().createElement("stop",{offset:1})))),gm=(0,T.Z)((e=>({root:{display:"flex",flex:"1 1 auto",flexWrap:"nowrap",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"auto",height:"100%",minHeight:"350px",boxSizing:"border-box",padding:"40px"},logo:{width:"190px",height:"190px"},textBox:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:400,marginTop:"24px"},text:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"23px",textAlign:"center"},secondaryText:{color:e.palette.text.primary,fontSize:"14px",fontWeight:"normal",lineHeight:"16px",letterSpacing:"0.24px",textAlign:"center",paddingTop:"8px"}}))),hm=e=>{let{IconRenderer:t=mm,text:r,secondaryText:n}=e;const a=gm();return c().createElement("div",{className:a.root},c().createElement(t,{className:a.logo}),c().createElement("div",{className:a.textBox},c().createElement(v.Z,{className:a.text},r),n&&c().createElement(v.Z,{className:a.secondaryText},n)))},fm=(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})}}))),bm=e=>{let{width:t,open:r,children:n}=e;const a=fm();return c().createElement("div",{className:a.contentWrapper,style:{width:`${r?t:0}px`}},r&&c().createElement(c().Fragment,null,n))},ym=(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"}}),xm=e=>{let{onClose:t,mainTitle:r,secondTitle:n,content:a,rightContent:l}=e;const o=ym();return c().createElement("div",{className:o.container},c().createElement(ye.k,{size:"S",icon:Wn.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(Zr.Z,{orientation:"vertical",flexItem:!0,className:o.divider}),c().createElement(v.Z,{variant:"body1",color:"textSecondary",className:o.secondTitle},n),l))},Em=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(Pi,{className:r,avatarText:a[0],icon:l?(0,u.vPL)("https://s3.amazonaws.com/reltio.images/api",l):null,variant:"square"})};var vm=r(79935);const wm=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"}})};wm.propTypes={height:U().number,margin:U().number};const Om=wm,Cm=e=>{let{label:t}=e;return t||null},Tm=e=>{let{value:t}=e;return t||null},Sm=e=>{let{className:t,rowsData:r,columnsData:n,theadRowsNumber:a=0}=e;const l=e=>{const t=e.cellRenderer||Tm,r=e.headCellRenderer||Cm;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)))};Sm.propTypes={rowsData:U().arrayOf(U().shape({id:U().string,label:U().string,headCellRenderer:U().func,cellRenderer:U().func})),columnsData:U().arrayOf(U().object),theadRowsNumber:U().number,className:U().string};const km=(0,s.memo)(Sm);var Nm=r(83543);const Im=(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)"}}))),Pm=e=>{let{active:t,onClick:r,className:n}=e;const a=Im();return c().createElement(he.Z,{className:b()(a.viewMoreLessLink,n),onClick:r,underline:"none"},c().createElement(Nm.Z,{className:b()(a.arrow,{[a.rotated]:t})}),t?x().text("View less"):x().text("View more"))};Pm.propTypes={active:U().bool,onClick:U().func,className:U().string};const Dm=Pm;var Rm=r(29611),Am=r(50581),jm=r(21853);const Zm=(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"}}),Lm=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=Zm(),u=n&&n.length;return l?c().createElement(Rm.Z,{className:i.input,value:n,autoFocus:!0,placeholder:x().text("Search"),disableUnderline:!0,onChange:(0,N.pipe)(On.NA,a),startAdornment:c().createElement(Am.Z,{position:"start"},c().createElement(jm.Z,{className:i.startAdornment})),endAdornment:c().createElement(Am.Z,{position:"end"},u&&c().createElement(_t.Z,{size:"S",icon:Wn.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(Xa.Z,{className:i.searchButton,onClick:(0,N.pipe)(N.T,o)},c().createElement(jm.Z,null))};var _m,Mm=r(7907);!function(e){e.READING="READING",e.HOVERED="HOVERED",e.EDITING="EDITING"}(_m||(_m={}));const Vm=()=>{const[e,t]=(0,s.useState)(null),r=e===_m.READING,n=e===_m.EDITING,a=e===_m.HOVERED;(0,s.useEffect)((()=>{t(_m.READING)}),[]);const l=(0,s.useCallback)((0,u.DsO)(t,50),[]),o=(0,s.useCallback)((()=>{n||l(_m.HOVERED)}),[l,n]),i=(0,s.useCallback)((()=>{n||l(_m.READING)}),[l,n]);return{setReadingMode:(0,s.useCallback)((()=>t(_m.READING)),[t]),setEditingMode:(0,s.useCallback)((()=>t(_m.EDITING)),[t]),onMouseLeave:i,onMouseEnter:o,isReadingMode:r,isEditingMode:n,isHovered:a}};const Bm=(0,s.createContext)(null),Um=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(Bm.Provider,{value:r},t)},zm=e=>{const{getCrosswalkColor:t=(0,N.pipe)(u.uKF,u.CJp)}=(0,s.useContext)(Bm)||{};return e?t(e):""},Fm=()=>{const{highlightedCrosswalks:e=[]}=(0,s.useContext)(Bm)||{};return e},Hm=e=>{const{highlightedCrosswalks:t=[],setCrosswalkHighlighted:r=On.ZT}=(0,s.useContext)(Bm)||{},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])}},Wm=e=>{const{toggleCrosswalkFocus:t=On.ZT,focusedCrosswalks:r=[]}=(0,s.useContext)(Bm)||{};return{isFocused:!!e&&r.some((0,N.eqBy)(u.uKF,e)),toggleCrosswalkFocus:(0,s.useCallback)((()=>t(e)),[e,t])}};var qm=r(72753);const Gm=(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"}}}),$m=(0,T.Z)((()=>({label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",marginLeft:"2px",marginRight:"8px"}}))),Ym=e=>{let{crosswalk:t,color:r,className:n,focusable:a=!1}=e;const{toggleCrosswalkFocus:l,isFocused:o}=Wm(t),i=Gm({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(Em,{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(ye.k,{icon:qm.Z,className:i.eyeIcon,size:"XXS",tooltipTitle:x().text("Focus"),onClick:()=>l()})),c().createElement("div",{className:i.crosswalkValue},t.value)))},Km=(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 Xm(){return Xm=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},Xm.apply(this,arguments)}const Qm=e=>{const t=Km();return c().createElement(le.ZP,Xm({},e,{classes:t,arrow:!0}))},Jm=e=>{let{crosswalk:t,className:r}=e;const n=zm(t),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Hm(t),i=Gm({isOpaque:!a,color:n});return c().createElement(Qm,{title:c().createElement(Ym,{crosswalk:t,color:n}),placement:"top"},c().createElement("div",{className:b()(i.crosswalkIcon,r),onMouseEnter:()=>l(),onMouseLeave:()=>o()}))};var eg=r(27604);const tg=(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 rg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ng=[u.oS0.TYPE_TEXT,u.oS0.TYPE_BLOB],ag=e=>{let{attributeType:t,attributeValue:r,color:n,containerRef:a,onClose:l,onEdit:o}=e;const i=tg({color:n,containerWidth:a.current?a.current.getBoundingClientRect().width:0}),p=(0,u.PFL)(t),d=ca(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=ua(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){rg(e,t,r[t])}))}return e}({},r,n))}l()};return c().createElement(_r.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||ng.includes(p.type)?"Escape"===e.key&&l():f()},onBackdropClick:f},c().createElement(aa.Z,{autoFocus:!0,dataTypeDefinition:p,fieldName:(0,u.Tde)(t.uri),onChange:g,TextFieldProps:h,value:m,fullWidth:!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:"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 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:"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})),cg=e=>{let{isIgnored:t,onClick:r,disabled:n}=e;return c().createElement(ye.k,{disabled:n,showForDisabled:!0,icon:t?og:sg,tooltipTitle:n?x().text("You don't have permissions to ignore"):x().text("Ignore"),onClick:r,size:"XS",disableRipple:!0})};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 pg=e=>c().createElement("svg",ug({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 dg(){return dg=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},dg.apply(this,arguments)}const mg=e=>c().createElement("svg",dg({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})),gg=e=>{let{isPinned:t,onClick:r,disabled:n}=e;return c().createElement(ye.k,{disabled:n,showForDisabled:!0,onClick:r,icon:t?pg:mg,tooltipTitle:n?"You don't have permissions to pin":x().text("Pin"),size:"XS",disableRipple:!0})},hg=(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"}}))),fg=(0,lt.Z)(Va.Z),bg=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))},yg=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=(()=>{})}=e;const a=hg(),{disabled:l,text:o,tooltip:i,onClick:s,id:u="",icon:p,crosswalk:d,color:m}=r;return d?c().createElement(Ym,{className:a.sourceItem,color:m,crosswalk:d,focusable:!0}):c().createElement(fg,{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(bg,{icon:p,text:o,styles:a}))}));yg.displayName="CrosswalkMenuItem";const xg=yg;function Eg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vg=(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){Eg(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"}}))),wg=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}=Vm(),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),R=!P&&(!h&&N||a.ignored),A=zm(l),{isHighlighted:j,isDimmed:Z,highlightCrosswalk:L,removeHighlight:_}=Hm(l),M=vg({variant:S?"outlined":"filled",opaque:!Z,fullyColored:j,color:A}),V=[{crosswalk:l,color:A},{disabled:!N,text:x().text("Edit"),icon:c().createElement(eg.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(ra.Z,null),tooltip:I?null:x().text("You don't have permissions to delete"),onClick:()=>g({attributeType:n,attributeValue:a,crosswalks:[l]}),id:"delete"}],B=()=>{_(),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(at.Z,{value:(0,u.kDl)(a),dataTypeDefinition:(0,u.PFL)(n)})),c().createElement("div",{className:M.actions},D&&c().createElement(gg,{isPinned:a.pin,onClick:()=>m({attributeValue:a}),disabled:!N}),R&&c().createElement(cg,{isIgnored:a.ignored,onClick:()=>p({attributeValue:a}),disabled:!N}),y&&c().createElement(be.Z,{MenuItemRenderer:xg,menuId:`simple-attribute-additional-actions-${T}`,buttonComponent:ye.k,buttonProps:{icon:fe.Z,size:"XS",tooltipTitle:x().text("More actions")},onMenuClose:B,menuItems:V})),f&&c().createElement(ag,{attributeType:n,attributeValue:a,color:A,onClose:B,onEdit:e=>d({attributeType:n,attributeValue:e,crosswalk:l}),containerRef:C}))},Og=(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 Cg(){return Cg=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},Cg.apply(this,arguments)}const Tg=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=Og(),[{isDragItemOver:p},d]=(0,Sn.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(wg,Cg({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 Sg(){return Sg=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},Sg.apply(this,arguments)}const kg=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(Le.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(eh,Sg({key:e.uri,attributeValue:e,attributeType:n,onAdd:a,disableEdit:o},i)))))},Ng=e=>{let{children:t}=e;const r=$m();return c().createElement(v.Z,{component:"span",variant:"body2",classes:{body2:r.label}},t)},Ig=(0,T.Z)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary}})));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=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(),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,g.useSelector)(h.ZP.selectors.getUIPath),i=c().createElement(Ng,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(Qg,Pg({attributeValue:t,attributeType:r,attributeTypesList:s,label:i},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 Ag=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(Dg,Rg({key:e.uri,attributeValue:e},n)))))},jg=(0,T.Z)((()=>({image:{borderRadius:"4px",background:"white",display:"inline-block",verticalAlign:"middle"},imageContainer:{display:"inline",lineHeight:"45px",paddingRight:"8px"}})));function Zg(){return Zg=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},Zg.apply(this,arguments)}const Lg={imageWidth:55,imageHeight:45},_g=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=jg();return c().createElement(Qg,Zg({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:c().createElement(vr,{containerClassName:a.imageContainer,className:a.image,src:(0,u.Ysv)(t),size:Lg})},n))};function Mg(){return Mg=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},Mg.apply(this,arguments)}const Vg=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(_g,Mg({key:e.uri,attributeValue:e},n)))))},Bg=(0,T.Z)((()=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start"},complexAttributesWrapper:{width:"100%"}})));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)}function zg(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 Fg=e=>{let{attributeType:t,attributeValues:r=[],paging:n={},max:a=1/0,requestNextPage:l}=e,o=zg(e,["attributeType","attributeValues","paging","max","requestNextPage"]);const i=Bg(),[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(kg,Ug({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));case u.oS0.TYPE_REFERENCE:{const{crosswalksMap:r}=o,n=zg(o,["crosswalksMap"]);return c().createElement(Ag,Ug({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t,crosswalksMap:r},n))}case u.oS0.TYPE_IMAGE:return c().createElement(Vg,Ug({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));default:return c().createElement(Tg,Ug({attributeValues:e,attributeType:t},o))}})(b),h&&c().createElement(sr,{moreNumber:Math.min(a,y),valueNumber:y,onClick:()=>{r.length<m&&l(),d(p+a)}}),f&&c().createElement(ur,{onClick:()=>{d(a)}}))},Hg=(0,T.Z)((e=>({title:{fontSize:"12px",lineHeight:"14px",paddingBottom:"4px",display:"inline-block",color:e.palette.text.secondary}})));function Wg(){return Wg=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},Wg.apply(this,arguments)}const qg=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=Hg();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(Fg,Wg({attributeType:e,attributeValues:r[e.name],paging:(0,N.path)(["paging",e.uri],r)},n))))))},Gg=e=>{let{onClick:t}=e;return c().createElement(ye.k,{icon:ra.Z,tooltipTitle:x().text("Delete"),onClick:t,size:"XS",disableRipple:!0})},$g=(0,s.createContext)(null),Yg=e=>{let{children:t,attributeUris:r}=e;return c().createElement($g.Provider,{value:r},t)},Kg=e=>((0,s.useContext)($g)||[]).some((t=>(0,u.sOy)(t,e))),Xg=(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"}}}))),Qg=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=Xg(),{isReadingMode:b,onMouseEnter:y,onMouseLeave:x}=Vm(),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=Kg(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(Jm,{key:(0,u.uKF)(e),crosswalk:e,className:f.crosswalkIcon})))),c().createElement(vm.Z,null),c().createElement("div",{className:f.actions},O&&c().createElement(gg,{disabled:!E,isPinned:r.pin,onClick:()=>p({attributeValue:r})}),C&&c().createElement(cg,{disabled:!E,isIgnored:r.ignored,onClick:()=>d({attributeValue:r})}),T&&c().createElement(Gg,{onClick:()=>m({attributeType:t,attributeValue:r,crosswalks:l[r.uri]})}))),k&&c().createElement(qg,{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 Jg(){return Jg=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},Jg.apply(this,arguments)}const eh=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(Ng,null,(0,u.idV)(null==t?void 0:t.label));return c().createElement(Qg,Jg({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:a},n))};var th=r(33286),rh=r(49429),nh=r(55999),ah=r(79249);const lh=(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"}}),oh=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=lh();return c().createElement(Nn.Z,{open:t,onClose:a,classes:{paperScrollPaper:d.paper}},c().createElement(ah.Z,{classes:{root:d.title}},r),c().createElement(po.Z,{classes:{root:d.content}},c().createElement(nh.Z,{classes:{root:d.contentText}},n)),c().createElement(rh.Z,{className:d.actionButtons,disableSpacing:!0},a&&c().createElement(Le.Z,{onClick:a},l),c().createElement("div",null,o&&c().createElement(Le.Z,{onClick:o,classes:{root:d.discardButton}},i),c().createElement(Le.Z,{onClick:s,color:"primary",disabled:p,autoFocus:!0},u))))},ih=e=>{let{open:t,onClose:r,onConfirm:n}=e;return c().createElement(Nn.Z,{open:t},c().createElement(po.Z,null,c().createElement(nh.Z,null,x().text("Are you sure you want to delete this?"))),c().createElement(rh.Z,null,c().createElement(Le.Z,{onClick:r,color:"primary"},x().text("No")),c().createElement(Le.Z,{onClick:()=>{n(),r()},color:"primary"},x().text("Yes"))))};var sh=r(92332);const ch=(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}}))),uh=e=>{const t=ch();return c().createElement("div",{className:b()(t.headCell,t.coloredCell)},c().createElement(sh.default,e),e.children)},ph=(0,T.Z)({root:{marginBottom:"-6px"}}),dh=(0,Ri.Z)((0,N.pick)(["parentUri","parentTypeUri","onAdd","selectedAttributeTypes","onSelectAttributeTypes"]))((e=>{let{parentTypeUri:t,parentUri:r,selectedAttributeTypes:n,onSelectAttributeTypes:a,onAdd:l}=e;const o=ph(),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(en,{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 mh=(0,Ri.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(uh,r):c().createElement(uh,r,c().createElement(vm.Z,null),c().createElement(dh,null))})),gh=e=>{let{value:t}=e;const r=ch();return c().createElement("div",{className:r.cellValueWrapper},t)},hh=(0,T.Z)((()=>({simpleAttributeWrapper:{padding:"15px"},complexAttributeWrapper:{padding:"15px","& + &":{borderTop:"1px solid rgba(0,0,0,.1)"}}})));function fh(){return fh=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},fh.apply(this,arguments)}const bh=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=hh();return c().createElement("div",{className:n.simpleAttributeWrapper},c().createElement(Fg,fh({attributeValues:t},r)))};function yh(){return yh=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},yh.apply(this,arguments)}const xh=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=hh(),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(eh,yh({attributeValue:e},r)))));return c().createElement(c().Fragment,null,a)};function Eh(){return Eh=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},Eh.apply(this,arguments)}const vh=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=hh(),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(Dg,Eh({attributeValue:e,crosswalksMap:r},n)))));return c().createElement(c().Fragment,null,l)};function wh(){return wh=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},wh.apply(this,arguments)}const Oh=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=hh();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(_g,wh({attributeValue:e},r))))))};function Ch(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Th=(0,Ri.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(xh,t);case u.oS0.TYPE_REFERENCE:return c().createElement(vh,t);case u.oS0.TYPE_IMAGE:return c().createElement(Oh,t);default:return c().createElement(bh,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){Ch(e,t,r[t])}))}return e}({},t,{parentUri:i,onDelete:r,onEdit:n,onPin:a,onIgnore:l,onAdd:o,disableEdit:s,disableDelete:s}))})),Sh=e=>{let{value:{values:t,attributeType:r}}=e;const n=ch();return c().createElement("div",{className:n.cellValueWrapper},c().createElement(Q,{className:n.attributeTitle,label:r.label,attributeType:r}),c().createElement(Si,{values:t,attributeType:r,valueContainerClassName:n.ovValue}))},kh=e=>{let{value:t}=e;const r=ch();return c().createElement("div",{className:b()(r.cellValueWrapper,r.count)},t)};var Nh=r(11776),Ih=r(38402),Ph=r(49378),Dh=r(99144);const Rh=e=>{let{sourcesUriOrder:t}=e;const r=ch(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata);return c().createElement(c().Fragment,null,t.map((e=>c().createElement(Ih.Z,{key:e,className:r.popupItem},c().createElement(Em,{className:r.sourceIcon,sourceType:e}),c().createElement(Ph.Z,{primary:(0,u.tH7)(n,e),primaryTypographyProps:{variant:"body2"}})))))},Ah=e=>{let{attributeUri:t}=e;const r=ch(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),a=(0,u.zeJ)(n,t);return c().createElement(Ih.Z,{key:a.uri,className:r.popupItem},c().createElement(Ph.Z,{primary:(0,u.idV)(a.label),primaryTypographyProps:{variant:"body2"}}))},jh=(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")]]),Zh=(0,N.cond)([[(0,N.prop)("sourcesUriOrder"),e=>{let{sourcesUriOrder:t}=e;return c().createElement(Rh,{sourcesUriOrder:t})}],[(0,N.prop)("primaryAttributeUri"),e=>{let{primaryAttributeUri:t}=e;return c().createElement(Ah,{attributeUri:t})}],[(0,N.prop)("comparisonAttributeUri"),e=>{let{comparisonAttributeUri:t}=e;return c().createElement(Ah,{attributeUri:t})}]]),Lh=e=>{let{info:t}=e;const r=ch(),[n,a]=(0,s.useState)(null),l=()=>a(null);return c().createElement(c().Fragment,null,c().createElement(ye.k,{icon:Dh.Z,tooltipTitle:x().text("View details"),size:"XS",onClick:e=>a(e.currentTarget)}),c().createElement(_r.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(Xa.Z,{className:r.closeButton,onClick:l},c().createElement(Wn.default,null)),c().createElement(v.Z,{variant:"subtitle1",className:r.popupTitle},jh(t))),c().createElement(Nh.Z,{component:"div",className:r.popupItemsWrapper},Zh(t))))},_h=e=>{let{value:{ruleType:t,sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}=e;const l=ch(),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(Lh,{info:{sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}))};function Mh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vh=(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){Mh(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 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 Uh=(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=Vh({color:r,opacity:n,variant:a});return c().createElement("div",Bh({ref:t,className:b()(s.item,o)},i),l)})),zh=e=>{let{crosswalk:t}=e;const r=ch(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Hm(t);return c().createElement(Uh,{className:r.winnerSourceItem,color:(0,u.CJp)((0,u.uKF)(t)),opacity:a?.38:1,onMouseEnter:()=>l(),onMouseLeave:()=>o()},c().createElement(Em,{className:r.sourceIcon,sourceType:t.type}),c().createElement(Ph.Z,{primary:(0,u.tH7)(n,t.type),primaryTypographyProps:{variant:"body2"},classes:{primary:r.winnerSourceItemLabel}}))},Fh=e=>{let{value:{crosswalks:t}}=e;const r=ch();return c().createElement(Nh.Z,{component:"div"},t.map((e=>c().createElement(Ih.Z,{key:e.uri,className:r.winnerSourceItemWrapper},c().createElement(zh,{crosswalk:e})))))},Hh=[{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}],Wh=e=>(0,u.OXP)(e)&&!(0,u.ZiX)(e.uri),qh=["ovValues","ruleType","values"],Gh=e=>{switch(e){case"ovValues":return Sh;case"values":return Th;case"count":return kh;case"ruleType":return _h;case"winnerSources":return Fh;default:return gh}},$h=(0,N.pipe)(u.cwx,(0,N.sortWith)([(0,N.descend)((0,N.propOr)(-1,"priority"))]),(0,N.map)((0,N.prop)("uri"))),Yh=(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)),Kh=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)(Wh),(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||Wh(l))})),N.values,N.flatten)(t))),(0,N.uniqBy)((0,N.prop)("uri")))(e)},Xh=(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?mh:uh,rowCellValueRenderer:Gh(t)}})),Qh=(e,t,r,n,a,l)=>{switch(e){case"ovValues":return{attributeType:n,values:null==l?void 0:l.filter(Wh)};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)||[],...$h(e)]):void 0,p=Yh(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:Kh(l,a)};default:return null}};function Jh(){return Jh=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},Jh.apply(this,arguments)}const ef=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=ch(),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,Jh({key:t,value:e},l)))))};var tf=r(44962),rf=r(2682),nf=r(84899);const af=e=>{let{open:t,onClose:r,onConfirmEditWithoutIgnore:n,onConfirmEditWithIgnore:a}=e;const[l,o]=(0,s.useState)("without");return c().createElement(Nn.Z,{open:t,onEnter:()=>o("without")},c().createElement(po.Z,null,c().createElement(nh.Z,null,x().text("You are attempting to change a value that is presently ignored.")),c().createElement(la.Z,{component:"fieldset"},c().createElement(nf.Z,{component:"legend"},x().text("Please choose an option:")),c().createElement(rf.Z,{value:l,onChange:(0,N.pipe)(On.NA,o)},c().createElement(Rr.Z,{value:"without",control:c().createElement(tf.Z,null),label:x().text("Save without Ignore")}),c().createElement(Rr.Z,{value:"with",control:c().createElement(tf.Z,null),label:x().text("Save and apply Ignore to new value")})))),c().createElement(rh.Z,null,c().createElement(Le.Z,{onClick:r,color:"primary"},x().text("Cancel")),c().createElement(Le.Z,{onClick:()=>{"with"===l?a():n(),r()},color:"primary"},x().text("Ok"))))},lf=(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 of(){return of=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},of.apply(this,arguments)}const sf=(0,s.memo)((e=>{let{entity:t,isLoading:r,crosswalksMap:n,visibleColumns:a=qh,onChangeVisibleColumns:l,readOnly:o,onDelete:i=On.ZT,onPin:p=On.ZT,onIgnore:d=On.ZT,onEdit:m=On.ZT,onAdd:f=On.ZT,selectedAttributeTypes:b,onSelectAttributeTypes:y=On.ZT}=e;const E=lf(),v=(0,s.useMemo)((()=>(0,N.pipe)((0,N.filter)((e=>{let{id:t}=e;return a.includes(t)})),Xh)(Hh)),[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,Qh(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}=js(),D=(0,s.useCallback)((e=>c().createElement(Ss,of({onChangeHeight:P},e),c().createElement(ef,e))),[P]),R=(0,s.useCallback)((0,N.either)(I,(0,N.always)(68)),[I]),[A,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(rs,{columnsData:Hh,selectedColumns:a,onChangeColumns:l})),c().createElement("div",{className:E.tableContent},r&&c().createElement(Dn,null),c().createElement(Di.Z,{fixFirstColumn:!0,headRowHeight:48,defaultColumnWidth:250,defaultColumnMinWidth:200,columnsData:v,rowsData:k,renderRowCell:D,getRowCellHeight:R,context:M})),c().createElement(ih,{open:!!A,onClose:()=>j(null),onConfirm:()=>i(A)}),c().createElement(af,{open:!!Z,onClose:()=>L(null),onConfirmEditWithIgnore:()=>m(Z),onConfirmEditWithoutIgnore:()=>{d({attributeValue:Z.attributeValue}),m(Z)}}))}));function cf(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){uf(e,t,r[t])}))}return e}function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pf=[],df=e=>{let{entity:t,onLoad:r=On.ZT,onModify:n=On.ZT,onError:a=On.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)(pf),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(pf);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=On.ZT,onError:r=On.ZT,onLoad:n=On.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=>cf({},t,{[e]:cf({},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}},mf=e=>{let{onLoad:t=On.ZT,onSuccess:r=On.ZT,onError:n=On.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])}},gf=(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"}}),hf=e=>{let{crosswalk:t}=e;const r=gf(),n=zm(t),a=(0,g.useSelector)(h.ZP.selectors.getMetadata),l=(0,u.tH7)(a,t.type);return c().createElement(Uh,{color:n,className:r.crosswalkPreview},c().createElement(Em,{className:r.sourceIcon,sourceType:t.type}),c().createElement(v.Z,{className:r.sourceLabel,variant:"body2"},l))},ff=(0,s.memo)((()=>{var e;const t=gf(),{isDragging:r,clientOffset:n,item:a}=(0,Sn.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(hf,{crosswalk:a.crosswalk})))}));let bf;!function(e){e.Simple="simple",e.Empty="empty",e.Dependent="dependent"}(bf||(bf={}));const yf=(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"}}))),xf=(0,s.memo)((e=>{let{crosswalkType:t,focusable:r=!0}=e;const{isDimmed:n}=Hm(),a=yf({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(_t.Z,{size:"XXS",className:a.focusedIcon,icon:r&&qm.Z,disabled:!0}),c().createElement("div",{className:a.wrapper},c().createElement(Em,{className:a.sourceIcon,sourceType:t}),c().createElement(v.Z,{variant:"body2"},o)))}));var Ef=r(19540),vf=r(42484);function wf(){return wf=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},wf.apply(this,arguments)}const Of=e=>c().createElement("svg",wf({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"}))),Cf=(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"}}))),Tf=e=>{let{value:t}=e;const r=Cf();return c().createElement("div",{className:r.root},c().createElement(v.Z,{className:r.text,variant:"body2"},t),c().createElement(_t.Z,{size:"XXS",icon:Of,color:"primary",className:r.button,onClick:()=>navigator.clipboard.writeText(t)}))},Sf=(0,T.Z)((()=>({timestampEditorInput:{paddingTop:15,paddingBottom:15,fontSize:13},timestampEditor:{height:38}}))),kf=e=>{let{value:t,classes:r={},disabled:n=!1,onChange:a}=e;const l=Sf(),[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)}}})},Nf=(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"}}))),If=e=>{let{crosswalk:t,canEditAttribute:r=!0,onEditAttribute:n,onDeleteAttribute:a}=e;const l=Nf(),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(en,{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(Ml.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(Em,{className:l.sourceIcon,sourceType:t}),c().createElement(v.Z,{className:l.text,variant:"body2"},r))}case"sourceTable":return o?c().createElement(Nc.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(Nc.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(Tf,{value:t});case"deleteDate":return c().createElement(kf,{value:t&&rn().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(ye.k,{icon:ra.Z,disabled:!r,onClick:()=>f(e.uri),size:"XS",tooltipTitle:x().text("Delete attribute"),showForDisabled:!0}))):null)),c().createElement(ih,{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}}))},Pf=(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}}),Df=(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=zm(t),{toggleCrosswalkFocus:b,isFocused:y}=Wm(t),E=n?"#FFF":a?f:"#CACCD1",{isDimmed:w,highlightCrosswalk:O,removeHighlight:C}=Hm(t),[T]=Fm(),S=Pf({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),R=(0,u.tH7)(D,t.type),A=(0,u.nIW)(t.uri),j=(0,u.x_)(t),[,Z,L]=(0,Sn.useDrag)({item:{type:"Crosswalk",crosswalk:t},canDrag:!j}),_=!j&&"relation"!==t.ownerType;return(0,s.useEffect)((()=>{L((0,vf.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(ye.k,{size:"XXS",className:S.focusedIcon,icon:l&&qm.Z,onClick:()=>b(),disabled:!l,tooltipTitle:l&&x().text("Focus")}),c().createElement("div",{className:S.crosswalkWrapper},c().createElement(Uh,{ref:Z,className:S.header,color:E,variant:j?"outlined":"filled",onMouseEnter:()=>O(),onMouseLeave:()=>C()},r&&c().createElement(Ef.Z,{className:S.dependentIcon}),c().createElement(Ut,{onClick:()=>N((e=>!e)),expanded:k}),c().createElement(Em,{className:S.sourceIcon,sourceType:t.type}),c().createElement(di.C,{value:R},c().createElement(v.Z,{variant:"body2",noWrap:!0},R)),c().createElement(vm.Z,null),c().createElement(di.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(ye.k,{icon:ra.Z,disabled:i,onClick:()=>P(!0),size:"XS",tooltipTitle:i?x().text("You don't have permissions to delete"):x().text("Delete crosswalk"),showForDisabled:!0}),c().createElement(ih,{open:I,onConfirm:()=>{y&&b(),p(A)},onClose:()=>P(!1)})),c().createElement(If,{crosswalk:t,canEditAttribute:!o,onEditAttribute:(e,t)=>{d({crosswalkId:A,attributeName:e,value:t})},onDeleteAttribute:e=>{d({crosswalkId:A,attributeName:e})}}))))})),Rf=(0,T.Z)((()=>({root:{display:"flex",alignItems:"center",height:"28px",paddingLeft:"37px"}}))),Af=e=>{let{showMore:t,onClick:r}=e;const n=Rf();return c().createElement(he.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")))},jf=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=Fm();return(0,s.useEffect)((()=>{!l&&a&&r[bf.Dependent].some((e=>g.some((0,u.aFF)(e))))&&m()}),[g]),c().createElement(c().Fragment,null,0===r[bf.Simple].length&&0===r[bf.Empty].length&&c().createElement(xf,{crosswalkType:t,focusable:a}),r[bf.Simple].map((e=>c().createElement(Df,{key:e.uri,crosswalk:e,focusable:a,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),r[bf.Empty].map((e=>c().createElement(Df,{key:e.uri,crosswalk:e,focusable:a,isEmpty:!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),l&&r[bf.Dependent].map((e=>c().createElement(Df,{key:e.uri,crosswalk:e,isDependent:!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,focusable:a,isColored:n}))),r[bf.Dependent].length>0&&c().createElement(Af,{showMore:!l,onClick:()=>m()}))},Zf=(0,T.Z)({caption:{paddingLeft:15,paddingTop:16,paddingBottom:8},controlButtons:{display:"flex",justifyContent:"flex-end",paddingBottom:10,paddingTop:20},cancelButton:{marginRight:20}}),Lf=e=>{let{className:t,onAdd:r,onClose:n}=e;const a=Zf(),[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(If,{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(Le.Z,{className:a.cancelButton,onClick:n},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",onClick:()=>{r(l),n()},disabled:!l.type||!l.value},x().text("Add"))))},_f=e=>e[bf.Simple].length>0?1:e[bf.Dependent].length>0?e[bf.Empty].length>0?2:3:4,Mf=(0,N.evolve)({[bf.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}))}),Vf=(0,N.curry)(((e,t,r)=>{const n=(r||[]).reduce(((r,n)=>(r[n.type]||(r[n.type]={[bf.Simple]:[],[bf.Empty]:[],[bf.Dependent]:[]}),"relation"===n.ownerType?r[n.type][bf.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][bf.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][bf.Dependent].push(n):r[n.type][bf.Simple].push(n),r)),{});return Object.keys(n).sort(((e,t)=>_f(n[e])-_f(n[t])||(e<t?-1:1))).map((e=>({source:e,crosswalksByTypes:Mf(n[e])})))}));var Bf=r(17871);const Uf=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 zf=r(41039);const Ff="circle",Hf="polygon",Wf=.001;function qf(){return qf=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},qf.apply(this,arguments)}const Gf=e=>c().createElement("svg",qf({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 $f(){return $f=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},$f.apply(this,arguments)}const Yf=e=>c().createElement("svg",$f({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"})))),Kf=(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"}}),Xf=(0,lt.Z)(Le.Z),Qf=e=>{let{drawingMode:t,drawingModes:r=[],hasActiveOverlay:n,onDrawingModeChanged:a,onClearOverlay:l}=e;const o=Kf(),i=e=>()=>{a(e)};return c().createElement("div",{className:o.container},t||n?c().createElement(Xf,{tooltipTitle:x().text("Clear area"),className:o.button,onClick:n?l:i(null)},c().createElement(zf.Z,{className:o.icon})):r.map((e=>{const t=(e=>{switch(e){case Ff:return Gf;case Hf:return Yf;default:return null}})(e);return c().createElement(Xf,{tooltipTitle:x().text("Draw area"),key:e,className:o.button,onClick:i(e)},c().createElement(t,{className:o.icon}))})))},Jf=(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"}}}),eb=e=>{let{isSearchOnMapMove:t,onChangeIsSearchOnMapMove:r}=e;const n=Jf();return c().createElement(Rr.Z,{classes:{root:n.container,label:n.label},control:c().createElement(Dr.Z,{checked:t,onChange:e=>{r(e.target.checked)},color:"primary",className:n.checkbox}),label:x().text("Search as I move the map")})},tb=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]]},rb=e=>{switch(e){case Ff:return window.google.maps.drawing.OverlayType.CIRCLE;case Hf:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},nb=(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)}},ab=c().createContext({});ab.displayName="EntityMarkerContext";const lb=(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 ob(){return ob=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},ob.apply(this,arguments)}const ib=(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>'),sb=(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>'),cb=(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=lb(),l=(0,s.useRef)(),[o,i]=(0,s.useState)(!1),{activeEntityUri:p}=(0,s.useContext)(ab),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(Ye.Z,{anchorEl:l.current,open:o,className:a.popper,modal:!1,placement:"top"},c().createElement(Cp,{entity:t.entity,onMouseOver:h,onMouseOut:f})),c().createElement(Bf.Jx,ob({icon:{url:o||d?ib:sb,scaledSize:new google.maps.Size(22,32)},position:m,onClick:b,visible:!1!==t.visible,onMouseOver:h,onMouseOut:f},n)),c().createElement(Bf.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})))})),ub={CIRCLE:"circle",POLYGON:"polygon"},pb={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},db=.001,mb=(0,T.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});var gb=r(90690);function hb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fb=["drawing"],bb=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=mb(),{isLoaded:E,loadError:v}=(0,Bf.Ji)({googleMapsApiKey:r,libraries:fb}),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,gb.D)(t),o=(0,gb.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()+Wf,e.lng()+Wf)),n.extend(new window.google.maps.LatLng(e.lat()-Wf,e.lng()-Wf))}t.fitBounds(n),r&&nb(t,r,n)})(t,a,r):i&&r&&r!==o&&nb(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){hb(e,t,r[t])}))}return e}({},pb,p||{})),[p]),D=(0,s.useCallback)((e=>{f(e?tb(O):null),I(null),clearTimeout(w.current)}),[O,f]),R=(0,s.useCallback)((()=>{clearTimeout(w.current)}),[]),A=(0,s.useCallback)((()=>{o&&f(tb(O))}),[o,O,f]),j=(0,s.useCallback)((()=>{o&&(clearTimeout(w.current),w.current=setTimeout(A,1e3))}),[A,o]),Z=(0,s.useCallback)(((e,t)=>{const r=t||T&&{type:ub.POLYGON,overlay:T};if(!(0,N.isEmpty)(r)&&"function"==typeof b){const{overlay:e,type:t}=r,n={[ub.POLYGON]:()=>e.getPath().getArray().map((e=>[e.lat(),e.lng()])),[ub.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(cb,{key:t.id,marker:t,clusterer:e,onClick:y})));return v?null:E?c().createElement(Bf.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:{mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},onLoad:C,zoom:n,center:a,onZoomChanged:R,onDragStart:R,onIdle:j,mapContainerClassName:h},O&&i&&Boolean(d.length)&&c().createElement(Uf,{className:x.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:O},c().createElement(Qf,{hasActiveOverlay:!!u,drawingModes:d,drawingMode:k,onDrawingModeChanged:I,onClearOverlay:_})),O&&i&&c().createElement(Uf,{className:x.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:O},c().createElement(eb,{onChangeIsSearchOnMapMove:D,isSearchOnMapMove:o})),m?(V=g,c().createElement(Bf.XL,{options:V},M)):M(),!rb(k)&&u&&(0,N.propEq)("type",ub.POLYGON,u)&&c().createElement(Bf.mg,{onLoad:S,path:u.path,editable:!0,options:P,onMouseUp:Z,onDragEnd:Z}),i&&Boolean(d.length)&&c().createElement(Bf.j_,{onPolygonComplete:L(ub.POLYGON),onCircleComplete:L(ub.CIRCLE),drawingMode:rb(k),options:{drawingControl:!1,circleOptions:P,polygonOptions:P}})):l;var V},yb=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,ze._)(),{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 xb;!function(e){e.UPDATE="UPDATE",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(xb||(xb={}));var Eb=r(39034);const vb=e=>(0,N.pipe)((0,N.map)(e),(0,N.join)(" or ")),wb=e=>{const[t,r]=e;return rn()().subtract(t,r).valueOf()},Ob=(0,N.chain)((0,N.cond)([[(0,N.equals)(xb.MERGE),()=>[l.I.ENTITIES_MERGED,l.I.ENTITIES_MERGED_MANUALLY,l.I.ENTITIES_MERGED_ON_THE_FLY]],[(0,N.equals)(xb.UNMERGE),()=>[l.I.ENTITIES_SPLITTED]],[(0,N.equals)(xb.UPDATE),()=>[l.I.ENTITY_CHANGED]]])),Cb=(0,N.pipe)((0,N.defaultTo)([]),Ob,(0,N.concat)([l.I.ENTITY_CREATED,l.I.ENTITY_REMOVED,l.I.ENTITY_LOST_MERGE]),vb((e=>`equals(type, '${e}')`))),Tb=(0,N.pipe)((0,N.defaultTo)({}),(0,N.reject)(u.O27),(0,N.evolve)({users:vb((e=>`equals(user, '${(0,u.HRH)(e)}')`)),attributes:vb((e=>`changes(${(0,u.HRH)(e.value)})`)),dateRange:e=>{let{type:t,period:r}=e;switch(t){case Eb.K.WITHIN:return`gte(timestamp, ${wb(r)})`;case Eb.K.AGO:return`lte(timestamp, ${wb(r)})`;case Eb.K.BETWEEN:{const[e,t]=r;return`gte(timestamp, ${e.valueOf()}) and lte(timestamp, ${rn()(t).endOf("date").valueOf()})`}default:return""}}}),(0,N.over)((0,N.lensProp)("activities"),Cb),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 Sb(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){kb(e,t,r[t])}))}return e}function kb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nb=e=>{let{entity:t,enabled:r}=e;const[n,a]=(0,s.useState)({activities:[xb.MERGE,xb.UNMERGE,xb.UPDATE]}),[l,o]=(0,s.useState)(0),i=(0,s.useMemo)((()=>Tb(n)),[n]),[c,p]=(0,s.useState)(null),[d,m]=(0,s.useState)(null),[g,h]=(0,s.useState)(!1),f=(0,ze._)(),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)(Sb({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)(Sb({entityUri:b,historicUris:c,filter:i,showAll:x,offset:e},y))).then((e=>{m((t=>Sb({},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}},Ib={appearance:{},attributes:{},roles:[],tags:[]},Pb=(0,N.evolve)({refEntity:u.VGB,refRelation:u.VGB}),Db=e=>e?(0,N.evolve)({attributes:(0,N.map)((0,N.map)(Pb))})(e):e,Rb=()=>{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(Db(n===h.Z9.Current?a:l),Db(r));e(h.N5.history.actions.setHistoryDiff(o))}}),[t,n,e,a]),r||Ib};var Ab=r(57312);const jb=(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"}}))),Zb=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=jb({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,Ab.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 Lb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _b;!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"}(_b||(_b={}));const Mb=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){Lb(e,t,r[t])}))}return e}({},l.I,_b),Vb=e=>e===Mb.FAKE_FILTERED_INCOMING||e===Mb.FAKE_FILTERED_OUTGOING,Bb=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})},Ub=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"})))},zb=(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=Vb(p),f=h?s[0]:o,b=!(null!=s&&s.some((e=>r[e])));e.circles.push(c().createElement(Ub,{key:`circle-${f}-${l}`,x:m,y:g,color:(0,u.GtP)(f),isDashed:h,isCollapsed:b,showCollapseIcon:!!s,showLine:p===Mb.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===Mb.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(Bb,{key:`link-${t}-${d}`,x:m,y:g,toX:i,toY:s,isDashed:Vb(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)===Mb.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(Ub,{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))})),Fb=(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 Hb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wb=e=>{let{historyData:t,isLoading:r,canLoadMore:n,onLoadMore:a,entityUri:l,historyEvent:o,findPreviousChange:i}=e;const p=Fb(),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){Hb(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(Dn,null),c().createElement("div",{className:b()(p.graph,{[p.shadow]:E}),onScroll:S,ref:C},c().createElement(zb,{graphData:f}),c().createElement(wr.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(Zb,{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(Le.Z,{color:"primary",onClick:()=>a()},x().text("Show more"))))},qb=(0,T.Z)({root:{display:"flex",flexWrap:"wrap",padding:"10px 15px"}}),Gb=(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"}}),$b=e=>{let{value:t,isSelected:r=!0,onClick:n}=e;const a=(0,u.GtP)(t),l=Gb({color:a});return c().createElement("div",{className:b()(l.icon,{[l.inactive]:!r,[l.active]:r,[l.clickable]:!!n}),onClick:n})},Yb=e=>{let{values:t,selectedValues:r,entityUri:n,onSelectValues:a,className:l}=e;const o=qb();return c().createElement("div",{className:b()(o.root,l)},c().createElement($b,{value:n}),(null==t?void 0:t.length)>0&&t.map((e=>c().createElement($b,{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 Kb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xb=(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}),Qb=(0,T.Z)({root:{display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",height:"100%"},borderBottom:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"}}),Jb=(0,s.memo)((e=>{let{isLoading:t,historyWithTotal:r,contributorsUris:n,entityUri:a,canLoadMore:l,onLoadMore:o,historyEvent:i}=e;const u=Qb(),[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:Mb.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!==Mb.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!==Mb.ENTITY_CREATED||t.type!==Mb.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 Mb.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 Mb.ENTITY_LOST_MERGE:case Mb.RELATIONSHIP_CREATED:case Mb.RELATIONSHIP_REMOVED:case Mb.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){Kb(e,t,r[t])}))}return e}({},r);((t,r)=>{var n,l;switch(r.type){case Mb.ENTITY_CREATED:s(t,r);break;case Mb.ENTITIES_MERGED_ON_THE_FLY:case Mb.ENTITY_CHANGED:c(t,r);break;case Mb.ENTITY_LOST_MERGE:case Mb.ENTITY_REMOVED:u(t,r);break;case Mb.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?Mb.FAKE_UPDATE:Mb.FAKE_NAVIGATE_PROFILE,uri:t,user:r.user,timestamp:r.timestamp})}));break;case Mb.ENTITIES_MERGED:case Mb.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 Mb.ENTITIES_MERGED:case Mb.ENTITIES_MERGED_MANUALLY:l=Mb.FAKE_FILTERED_INCOMING;break;case Mb.ENTITIES_SPLITTED:l=Mb.FAKE_FILTERED_OUTGOING;break;default:return}const o={type:l,uri:t.uri,uris:[r],user:s,timestamp:i},u=Xb(n.lifeTime,t.timestamp);l===Mb.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(Yb,{values:n,selectedValues:p,onSelectValues:d,entityUri:a,className:u.borderBottom}),c().createElement(Wb,{historyData:m,isLoading:t,onLoadMore:o,canLoadMore:l,entityUri:a,historyEvent:i,findPreviousChange:g}))}));var ey=r(36444),ty=r(15791),ry=r(55234);const ny=[Eb.K.WITHIN,Eb.K.AGO,Eb.K.BETWEEN],ay=e=>({[Eb.K.WITHIN]:x().text("Within the last"),[Eb.K.AGO]:x().text("More than"),[Eb.K.BETWEEN]:x().text("Date range")}[e]||"");var ly=r(77875),oy=r(27446);const iy=(0,T.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},intervalContainer:{display:"flex",justifyContent:"space-between"},typeInput:{width:160,marginRight:10}}),sy=[null,null],cy=[null,"hours"],uy=e=>{let{value:t,onChange:r,className:n}=e;const a=iy(),l=e=>e===Eb.K.WITHIN||e===Eb.K.AGO,o=e=>e===Eb.K.BETWEEN,i=o(null==t?void 0:t.type)?t.period:sy,u=l(null==t?void 0:t.type)?t.period:cy,[p,d]=(0,s.useState)(i),[m,g]=(0,s.useState)(u),h=(null==t?void 0:t.type)||Eb.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(sy),g(cy))}),[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(Ml.Z,{label:"",className:a.typeInput,value:{value:h,label:ay(h)},options:ny.map((e=>({value:e,label:ay(e)}))),onChange:e=>{let{value:n}=e;(null==t?void 0:t.type)!==n&&r({period:f(n),type:n})}}),l(h)?c().createElement(ly.Z,{interval:m,onChange:y}):c().createElement(oy.Z,{values:p,onChange:y})))},py=[xb.UPDATE,xb.MERGE,xb.UNMERGE];function dy(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){my(e,t,r[t])}))}return e}function my(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gy={input:e=>dy({},e,{fontSize:"14px"}),menuPortal:e=>dy({},e,{zIndex:1300})},hy=(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"}}),fy=e=>{let{selectedHistoryActivityTypes:t,onChange:r,className:n}=e;const a=hy(),l=e=>{return{value:e,label:(t=e,{[xb.UPDATE]:x().text("Update"),[xb.MERGE]:x().text("Merge"),[xb.UNMERGE]:x().text("Unmerge")}[t]||"")};var t},o=e=>e.map(l),i=o(py);return c().createElement("div",{className:b()(a.root,n)},c().createElement(v.Z,{className:a.title,variant:"subtitle1"},x().text("Activity")),c().createElement(Mp.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:uc.Z},styles:gy,classes:a,menuPlacement:"bottom",menuPortalTarget:document.body}))},by=(0,T.Z)({icon:{margin:5},popup:{width:500,height:500,overflowY:"hidden",display:"flex",flexDirection:"column"},filterContainer:{padding:20,height:410,display:"flex",flexDirection:"column"},filterContainerScrollable:{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 yy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xy=e=>{let{filter:t,onApplyFilter:r,entityType:n}=e;const a=by(),[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){yy(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(_t.Z,{icon:ey.Z,size:"XS",onClick:e=>o(e.currentTarget),className:a.icon}),c().createElement(_r.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("div",{className:a.filterContainerScrollable},c().createElement(uy,{value:h,onChange:d("dateRange"),className:a.filterItem}),c().createElement(ty.Z,{selectedUsers:f,onChange:d("users"),className:a.filterItem}),c().createElement(fy,{selectedHistoryActivityTypes:m,onChange:d("activities"),className:a.filterItem}),c().createElement(ry.Z,{selectedAttributes:g,entityType:n,onChange:d("attributes"),className:a.filterItem,title:x().text("Attribute updated")}))),c().createElement("div",{className:a.filterControls},c().createElement(Le.Z,{onClick:()=>p(null),className:a.clearButton},x().text("Clear all")),c().createElement(Le.Z,{onClick:i},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",onClick:()=>{h&&(e=>{if(e.type===Eb.K.AGO||e.type===Eb.K.WITHIN){const[t,r]=e.period;return"Number"===(0,N.type)(t)&&"String"===(0,N.type)(r)&&t>0}if(e.type===Eb.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 Ey=r(98281);const vy=(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)"}}),wy=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=On.ZT}=e;const a=vy(),{text:l,selected:o,onClick:i}=r;return c().createElement(Va.Z,{classes:{root:a.menuItem},onClick:e=>{n(),i(e)},ref:t},o&&c().createElement(Ey.Z,{className:a.checkIcon}),c().createElement(v.Z,{classes:{root:a.menuText}},l))}));wy.displayName="MenuItemRenderer";const Oy=wy,Cy=()=>{const e=vy(),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(be.Z,{MenuItemRenderer:Oy,buttonComponent:_t.Z,buttonProps:{icon:fe.Z,size:"L",className:e.icon},menuId:"history-menu",menuItems:a})},Ty=(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}}),Sy=e=>{let{total:t,entityType:r,filter:n,onApplyFilter:a}=e;const l=Ty();return c().createElement("div",{className:l.root},c().createElement(v.Z,{variant:"h6"},x().text("History")),c().createElement(Zr.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(vm.Z,null),c().createElement(xy,{entityType:r,filter:n,onApplyFilter:a}),c().createElement(Cy,null))},ky=(0,T.Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),Ny=()=>{const e=ky(),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(Le.Z,{className:e.cancelButton,variant:"contained",color:"primary",onClick:n},x().text("Cancel"))):null},Iy=()=>c().createElement(hm,{text:x().text("History in the making"),secondaryText:x().text("When you create an event or perform an activity, it will show up here.")}),Py=(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 Dy(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){Ry(e,t,r[t])}))}return e}function Ry(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ay=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=Py(),{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)((()=>Dy({attributes:Dy({},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),R=(0,u.z7d)(w,O),A=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]),B=(0,s.useCallback)((e=>a(h.N5.modifiedEntities.actions.entityCreated(e))),[a]),U=(0,s.useCallback)((e=>a(h.N5.modifiedEntities.actions.entityDeleted(e))),[a]),z=(0,s.useCallback)((e=>{r&&U(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,U,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)(U),M))),[t,l,a,V,F,I]),q=(0,s.useCallback)((()=>{const e=k.current;r!==e&&(e?(B(e),r&&r.uri!==e.uri&&U(r.uri)):U(r.uri));const t=D.current;(0,N.differenceWith)(N.equals,P.current,t.map((0,N.prop)("uri"))).forEach(U),t.forEach(B),H(),M()}),[M,B,U,H,r]),G=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.addAttributes,a)(e.map((e=>Dy({},e,{viewId:l.id}))))),[l.id,a]),$=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.modifyAttribute,a)(Dy({},e,{viewId:l.id}))),[l.id,a]),Y=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.removeAttribute,a)(Dy({},e,{viewId:l.id}))),[l.id,a]),K=(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),B(a)}),[B,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===R&&c().createElement(vc,{className:E.item,relation:t.relation,inRelationTypes:w,outRelationTypes:O,onChange:_}),Boolean(g)&&c().createElement(c().Fragment,null,c().createElement(sa,{errorMessage:X},c().createElement(gl,{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:K,metadata:i,attributeTypesSelectionStrategy:u.wcJ})),c().createElement(Pa,{className:E.item,attrTypes:C,entity:T,showEmptyEditors:!0,crosswalks:t.crosswalks,mode:o,parentUri:m,onAddAttributes:G,onChangeAttribute:$,onDeleteAttribute:Y}))),c().createElement("div",{className:E.actionButtons},c().createElement(Le.Z,{onClick:q},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",disabled:!A,onClick:W},x().text("Apply"))),c().createElement(Zr.Z,null))};Ay.propTypes={connection:u.Rjq,modifiedEntity:u.pyR,allModifiedEntities:U().object,dispatch:U().func,config:u.PiC,mode:U().string,metadata:u.pGS,globalSearchRequestOptions:U().object,error:u.wfT};const jy=Ay,Zy=(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))}}))(jy),Ly=(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"}}))),_y=c().createContext(null);_y.displayName="WorkflowTasksContext";const My=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),iu.Z.addError({title:x().text("Error"),message:t||x().text("Something went wrong...")}))},Vy=()=>{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}},By=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((0,N.startsWith)("changeRequests/"))},Uy=e=>void 0===e||!0===e,zy=e=>({label:e,value:e}),Fy=e=>{let{assignee:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},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,ze._)(),p=(0,ze._)(),[d,m]=(0,s.useState)(null),[f,b]=(0,s.useState)(),[y,x]=(0,s.useState)(!1),E=Vy()("UPDATE_TASK")&&Uy(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(My)}}),[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(My).finally((()=>{x(!1)}))}}),[l,r,o,i,E]);return{assignee:d,getAssignees:v,updateAssignee:w,updateRequestIsInProgress:y,readOnly:!E}},Hy=e=>{let{taskId:t,assignee:r,isTaskOpen:n}=e;const{assignee:a,getAssignees:l,updateAssignee:o,updateRequestIsInProgress:i,readOnly:s}=Fy({taskId:t,assignee:r,isOpen:n}),u=i||s;return c().createElement(_a.Z,{isDisabled:u,getOptions:l,onChange:o,hideSelectedOptions:!1,label:x().text("Assigned to"),value:a,defaultOptions:!0,TextFieldProps:{disabled:u},height:40})},Wy=(0,T.Z)({dueDate:{marginTop:0,marginBottom:0},dueDateInput:{height:"40px"},inputLabel:{fontSize:"14px"}}),qy=e=>{let{taskId:t,dueDate:r,isTaskOpen:n,className:a}=e;const l=Wy(),{updateDueDate:o,updateRequestIsInProgress:i,readOnly:p}=(e=>{let{dueDate:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},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,ze._)(),[p,d]=(0,s.useState)(!1),m=Vy()("UPDATE_TASK")&&Uy(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(My).finally((()=>{d(!1)})))}),[l,r,o,i,a,c,t,m]),updateRequestIsInProgress:p,readOnly:!m}})({dueDate:r,taskId:t,isOpen:n});return c().createElement(Rc.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}}})},Gy=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)(_y)||{},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,ze._)(),[p,d]=(0,s.useState)(!1),m=Vy()("UPDATE_TASK")&&Uy(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(My).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(_a.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 $y=r(94842),Yy=r(98685);const Ky=(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"}}))),Xy=(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"}}))),Qy=(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)"}}}))),Jy=(0,T.Z)((e=>({messageContainer:{borderBottom:"1px solid rgba(0,0,0,0.3)",paddingBottom:"7px",marginBottom:"7px"}}))),ex=e=>{let{author:t,classes:r,message:n,time:a}=e;const l=Ky();return c().createElement("div",{className:l.comment},c().createElement(Ne.Z,{className:l.avatar},c().createElement(Yy.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)))};ex.defaultProps={classes:{}},ex.propTypes={classes:U().object,author:U().string,id:U().string,message:U().string,time:U().number};const tx=e=>{let{comments:t,onClick:r}=e;const n=Xy();return c().createElement(c().Fragment,null,c().createElement(ex,t[0]),c().createElement("div",{className:n.delimiter},c().createElement(Xa.Z,{className:n.circleButton,onClick:r},t.length-2)),c().createElement(ex,t[t.length-1]))};tx.propTypes={comments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number})),onClick:U().func};const rx=e=>{let{comments:t}=e;const r=Jy();return t.map((e=>{let{author:t,id:n,message:a,time:l}=e;return c().createElement(ex,{classes:{messageContainer:r.messageContainer},key:n,author:t,message:a,time:l})}))};rx.propTypes={comments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number}))};const nx=e=>{let{processInstanceComments:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},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,ze._)(),[p,d]=(0,s.useState)([]),[m,f]=(0,s.useState)(!1),b=Vy()("UPDATE_TASK")&&Uy(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(My).finally((()=>f(!1))))}),[o,r,i,l,c,a,b]);return{comments:p,requestIsInProgress:m,writeComment:y,readOnly:!b}},ax=e=>e.target.value,lx=e=>{let{processInstanceComments:t,taskId:r,isTaskOpen:n}=e;const a=Qy(),[l,o]=(0,s.useState)(!1),[i,u]=(0,s.useState)(""),{comments:p,writeComment:d,readOnly:m}=nx({processInstanceComments:t,taskId:r,isOpen:n}),g=(0,s.useCallback)((()=>{d(i),u("")}),[i,d]),h=(0,N.pipe)(ax,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(rx,{comments:p}):c().createElement(tx,{onClick:()=>o(!0),comments:p})),!m&&c().createElement(Rm.Z,{endAdornment:c().createElement(Am.Z,{position:"end"},c().createElement(_t.Z,{icon:$y.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}))};lx.propTypes={processInstanceComments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number})),taskId:U().string};const ox=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)(_y)||{},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)(Ga.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(My).finally((()=>{f(!1)})))}),[o,n,i,c,y,d,b,l]);return{actions:(0,s.useMemo)((()=>p===r&&Uy(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(be.Z,{buttonComponent:_t.Z,buttonProps:{icon:fe.Z,size:"L",disabled:o},menuId:"workflow-actions",menuItems:l}):null},ix=(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}}),sx=e=>{let{className:t,children:r,plain:n,first:a,last:l,transparent:o,divider:i}=e;const s=ix();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(Zr.Z,{className:s.rowDivider,light:!0,variant:"inset"})))};let cx={};const ux=["#DC057B","#5DC003","#FEC92F","#F57F27","#B71137","#056B97","#4499AE","#BD81BE","#5F3577","#A68560","#555962"];let px=0;function dx(){return dx=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},dx.apply(this,arguments)}const mx=e=>c().createElement("svg",dx({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"}))),gx=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)(By,(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 cx[r]||(cx[r]=ux[px],px++,px>ux.length-1&&(px=0)),cx[r]})({processDefinitionDisplayName:g}),O=Ly({color:w}),[C,T]=(0,s.useState)(!1),S=Vy()("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(sx,{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(up.Z,{className:O.flag}),c().createElement(le.ZP,{title:x().text("Due date")},c().createElement("span",{className:O.date},x().date(o,"L"))),c().createElement(Ns.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(mx,{className:O.commentsIcon}),c().createElement("div",{className:O.infoValue},f.length))),n||c().createElement(ox,{taskId:l,possibleActions:y,assignee:u,isTaskOpen:E}))))),C&&c().createElement(sx,{plain:!0},c().createElement("div",{className:O.controlsBox},c().createElement("div",{className:O.controlsInRow},c().createElement(qy,{taskId:l,dueDate:o,isTaskOpen:E}),c().createElement(Gy,{taskId:l,priority:i,className:O.priority,isTaskOpen:E})),c().createElement(Hy,{taskId:l,assignee:u,isTaskOpen:E})))),C&&c().createElement(c().Fragment,null,r,S&&c().createElement("div",{className:O.comments},c().createElement(lx,{taskId:l,processInstanceComments:f,isTaskOpen:E}))))};function hx(){return hx=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},hx.apply(this,arguments)}const fx=e=>c().createElement("svg",hx({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 bx,yx;!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"}(bx||(bx={})),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"}(yx||(yx={}));const xx=(e,t)=>{switch(e){case yx.CREATE_RELATIONSHIP:case yx.INSERT_ATTRIBUTE:return bx.ADDED;case yx.UPDATE_TAGS:case yx.UPDATE_ROLES:case yx.UPDATE_ATTRIBUTE:return bx.EDITED;case yx.DELETE_ATTRIBUTE:case yx.DELETE_RELATIONSHIP:return bx.DELETED;case yx.PIN_ATTRIBUTE:return null!=t&&t.pin?bx.PIN_DELETED:bx.PINNED;case yx.IGNORE_ATTRIBUTE:return null!=t&&t.ignored?bx.IGNORE_DELETED:bx.IGNORED}},Ex=e=>({[bx.ADDED]:x().text("added"),[bx.EDITED]:x().text("edited"),[bx.DELETED]:x().text("deleted"),[bx.PINNED]:x().text("pinned"),[bx.PIN_DELETED]:x().text("pin deleted"),[bx.IGNORED]:x().text("ignored"),[bx.IGNORE_DELETED]:x().text("ignore deleted")}[e]||""),vx=(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 wx(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){Ox(e,t,r[t])}))}return e}function Ox(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cx=(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]:[]},Tx=(0,N.curry)(((e,t,r)=>{const n=Ta(e,t.type,[],[]);return kx(e,n,r)})),Sx=(0,N.curry)(((e,t,r,n)=>{const a=(0,u.V3K)(e,t.type),l=(0,u.xF8)(e,t.type);return(0,N.flatten)([wx({level:1,label:(0,N.propOr)("","label",a),attributeType:a,attributeValue:wx({},t,r)},((e,t)=>{if(t===yx.CREATE_RELATIONSHIP||(0,u.O27)(e)){const e=xx(t);return e?{operation:e}:{}}return{}})(r,n)),kx(e,l,r,2)])})),kx=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return(0,N.flatten)(t.map((t=>Cx(r,t).map((r=>r.map((r=>Nx(e,t,r,n))))))).filter((0,N.complement)(N.isEmpty)))},Nx=(e,t,r,n)=>{switch(t.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return Ix(e,t,r,n);case u.oS0.TYPE_REFERENCE:return Px(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:yx.INSERT_ATTRIBUTE}})(t,r);return Dx(t,e,n)}}},Ix=(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},kx(e,a,r.value,n+1)]},Px=(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},kx(e,a,r.value,n+1)]},Dx=(e,t,r)=>{const{newValue:n,oldValue:a,type:l}=(e=>{let{newValue:t,oldValue:r,type:n}=e;return n===yx.UPDATE_ATTRIBUTE?{type:n,newValue:t,oldValue:r}:{type:n,newValue:r||t}})(t);return{attributeType:e,newValue:n,oldValue:a,operation:xx(l,a),label:(null==e?void 0:e.label)||(null==e?void 0:e.name),level:r}};function Rx(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){Ax(e,t,r[t])}))}return e}function Ax(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jx=["defaultProfilePicValue",u.xPW.tags.name,u.xPW.roles.name,u.xPW.startDate.name,u.xPW.endDate.name],Zx=e=>{let{newValue:t,oldValue:r}=e;const n=e=>isNaN(e)||(0,u.O27)(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:yx.UPDATE_ATTRIBUTE,oldValue:{value:n(r[0])},newValue:{value:n(t[0])}}]:l?[{type:yx.INSERT_ATTRIBUTE,newValue:{value:n(t[0])}}]:o?[{type:yx.DELETE_ATTRIBUTE,oldValue:{value:n(r[0])}}]:void 0},Lx=(e,t)=>{const{newValue:r=[],oldValue:n=[],type:a}=t,l=a===yx.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:yx.INSERT_ATTRIBUTE,newValue:{value:o.map(l).join(", ")}}),i.length&&s.push({type:yx.DELETE_ATTRIBUTE,oldValue:{value:i.map(l).join(", ")}}),s},_x=(e,t)=>{const r=(e=>{const{type:t,attributePath:r,refObjectURI:n,refAttributeType:a}=e,l=t===yx.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},Mx=(e,t)=>{const{attributes:r={},startDate:n,endDate:a}=t,{roles:l,tags:o,defaultProfilePicValue:i}=t,s=Rx({},r);return i&&(s.defaultProfilePicValue=[i]),l&&(s[u.xPW.roles.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:l.map((0,u.xqc)(e)).join(", ")}}]),o&&(s[u.xPW.tags.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:o.join(", ")}}]),n&&(s[u.xPW.startDate.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:n}}]),a&&(s[u.xPW.endDate.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:a}}]),s},Vx=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{type:a}=r;switch(a){case yx.UPDATE_PROFILE_PIC_BY_URL:n.defaultProfilePicValue=[r.newValue];break;case yx.UPDATE_TAGS:n[u.xPW.tags.name]=Lx(e,r);break;case yx.UPDATE_ROLES:n[u.xPW.roles.name]=Lx(e,r);break;case yx.UPDATE_START_DATE:n[u.xPW.startDate.name]=Zx(r);break;case yx.UPDATE_END_DATE:n[u.xPW.endDate.name]=Zx(r);break;case yx.CREATE_RELATIONSHIP:case yx.CREATE_ENTITY:return Rx({},n,Mx(e,r.newValue));case yx.INSERT_ATTRIBUTE:case yx.UPDATE_ATTRIBUTE:case yx.DELETE_ATTRIBUTE:case yx.PIN_ATTRIBUTE:case yx.IGNORE_ATTRIBUTE:_x(n,r)}return n},Bx=(0,T.Z)((e=>({linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"}}))),Ux=e=>{let{suggestionsCount:t,isExpanded:r,onClick:n,className:a}=e;const l=Bx();return c().createElement(he.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 zx=r(43525);const Fx=(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"}}}))),Hx=e=>{let{label:t,oldValue:r,newValue:n,operation:a,className:l}=e;const o=Fx(),i=r||n;return c().createElement("div",{className:b()(o.field,l)},c().createElement("span",{className:o.fieldName},t,":"),!(0,N.isNil)(i)&&c().createElement("span",{className:o.difference},i,n&&r&&c().createElement(c().Fragment,null,c().createElement(zx.Z,{className:o.arrow}),n)),a&&c().createElement(tt.Z,{variant:"outlined",label:Ex(a),className:b()(o.chip,a)}))},Wx=c().createContext(null);Wx.displayName="AttributesChangesContext";const qx=(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"}}}))),Gx=e=>{let{label:t,level:r,attributeType:n,attributeValue:a,oldValue:l,newValue:o,operation:i}=e;const p=qx({level:r}),d=(0,g.useSelector)(h.ZP.selectors.getEntityUri),m=(0,s.useContext)(Wx),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(Ee.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(at.Z,{value:t,dataTypeDefinition:vx(n,t)})}),[n]);return c().createElement(Hx,{className:p.change,label:x,oldValue:l&&E(l),newValue:o&&E(o),operation:i})},$x=(0,T.Z)({title:{fontSize:"12px",letterSpacing:0,lineHeight:"16px",fontWeight:500,marginTop:"8px"}});function Yx(){return Yx=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},Yx.apply(this,arguments)}const Kx=e=>{let{changes:t}=e;const r=$x();return c().createElement(c().Fragment,null,t.map(((e,t)=>(0,N.has)("level",e)?c().createElement(Gx,Yx({},e,{key:t})):c().createElement("div",{className:r.title,key:t},e.label))))},Xx=(0,N.pipe)((0,N.filter)((0,N.has)("operation")),N.length),Qx=(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"}}))),Jx=e=>{let{changes:t,objectsInfo:r,entityInfo:n,relationsInfo:a,max:l}=e;const o=Qx(),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]),Tx(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)=>Vx(e,r,n,t)),{}),i=n.map((r=>((e,t,r)=>(0,N.propOr)([],r.uri)(t).reduce(((t,n)=>Vx(e,r,n,t)),{}))(e,t,r)));return[l([(0,N.pipe)((0,N.omit)(jx),Tx(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(((r,n)=>{const a=(0,N.path)([r.uri,0,"type"],t);return Sx(e,r,i[n],a)})))]})(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)((()=>Xx(e)),[e]),i=(0,s.useMemo)((()=>Xx(l)),[l]);return{isExpanded:r,onToggle:a,itemsToShow:r?e:l,collapsedSuggestionsCount:o-i}}(m,l);return c().createElement(Wx.Provider,{value:r},c().createElement("div",{className:o.container},c().createElement(Ee.Z,{className:o.uri,value:(0,u.wwR)(n)},c().createElement("div",{className:o.label},(0,u.idV)(n.label))),c().createElement(Kx,{changes:y}),E>0&&c().createElement(Ux,{onClick:b,suggestionsCount:E,isExpanded:f,className:o.showMoreLink})))};function eE(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){tE(e,t,r[t])}))}return e}function tE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rE=(0,N.filter)((0,N.pipe)((0,N.prop)("uri"),u.WgC)),nE=(0,N.filter)((0,N.pipe)((0,N.prop)("uri"),u.bC9)),aE=(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),lE=(0,N.curry)(((e,t)=>({entity:t,relations:aE(e,t.uri)}))),oE=(0,N.curry)(((e,t)=>{const r=e[t.startObjectUri],n=[t];return r?{entity:eE({},r,{uri:t.startObjectUri}),relations:n}:{relations:n}})),iE=(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 sE(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=>{let{task:t}=e;const{objectURIs:r}=t,n=By(r),{dcr:a,groupedObjects:l}=(e=>{const[t,r]=(0,s.useState)([]),[n,a]=(0,s.useState)(null),l=(0,ze._)(),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=>eE({},t[e],{uri:e}))))(t))(t,n),i=(0,N.pipe)(rE,(0,N.map)(lE(l)))(l),s=(0,N.pipe)(nE,(0,N.map)(oE(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){sE(e,t,r[t])}))}return e}({},t,{entity:e[r]})));(0,N.pipe)(N.flatten,(0,N.reduce)(iE,{}),N.values,r)([i,c,t])})).catch(My),a(e)})).catch(My)}),[e,o]),{dcr:n,groupedObjects:t}})(n);return c().createElement(gx,{task:t,Icon:fx},a&&l.map(((e,t)=>c().createElement(sx,{key:t,last:t===l.length-1,divider:!0},c().createElement(Jx,{entityInfo:e.entity,relationsInfo:e.relations,changes:a.changes,objectsInfo:a.objectsInfo})))))},uE=(0,T.Z)({pmCard:{marginLeft:"-15px"}});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:"#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 mE=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]),gE=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=mE(S),I=mE(u.bFH),P=(0,N.prop)("uri",r),D=(0,ze._)(),R=(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)((()=>{R()}),[R]),{total:f,matches:y,entitiesMap:E,loadMatches:(0,s.useCallback)((()=>{R(!0)}),[R])}},hE=(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"}}),fE=e=>{let{children:t,entitiesMap:r,entity:n,match:a,metadata:l,className:o}=e;const i=hE();return c().createElement("div",{className:b()(i.root,o)},c().createElement("div",{className:i.profileCardWrapper},c().createElement(Cp,{entity:a.object,classes:{container:i.profileCardContainer},disableEntityTypeColor:!0}),t),c().createElement("div",{className:i.rulesContainer},c().createElement(np,{match:a,metadata:l,entitiesMap:r,entity:n})))},bE={showTransitiveMatches:!0,showInactiveEntities:!1},yE=e=>{let{task:t}=e;const r=uE(),{objectURIs:n}=t,a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),{matches:o,entitiesMap:i}=gE({enabled:!!a.uri,entity:a,filter:"",rowsPerPage:Number.MAX_SAFE_INTEGER,page:0,options:bE}),s=null==o?void 0:o.find((e=>{let{object:t}=e;return n.includes(t.uri)}));return c().createElement(gx,{task:t,Icon:dE},s&&c().createElement(sx,{last:!0},c().createElement("div",{className:r.pmCard},c().createElement(fE,{metadata:l,entity:a,match:s,entitiesMap:i}))))};function xE(){return xE=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},xE.apply(this,arguments)}const EE=e=>c().createElement("svg",xE({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 vE(){return vE=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},vE.apply(this,arguments)}const wE=e=>c().createElement("svg",vE({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 OE{}OE.build=e=>{let{task:t}=e;const{processType:r}=t;switch(r){case u.Yj_.dataChangeRequestReview:return c().createElement(cE,{task:t});case u.Yj_.potentialMatchReview:return c().createElement(yE,{task:t});case u.Yj_.recommendForDelete:return c().createElement(gx,{task:t,Icon:wE});default:return c().createElement(gx,{task:t,Icon:EE})}};const CE=OE,TE=e=>{let{task:t}=e;return CE.build({task:t})};var SE=r(8560);const kE=(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"}}))),NE=e=>{let{anchorEl:t,onClose:r}=e;const n=kE(),[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)(_y),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 My(e),e})).finally((()=>{o(!1)})))),[a,r,e,n,t]),loading:l}})(),y=Boolean(t);return c().createElement(c().Fragment,null,c().createElement(_r.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(Ml.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(Fc.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(Le.Z,{disabled:b,className:n.cancelButton,onClick:r},x().text("Cancel")),c().createElement(Le.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(SE.Z,{container:document.body},c().createElement(qn.Z,{open:p,autoHideDuration:5e3,onClose:()=>{d(!1)},message:x().text("A new workflow has started")})))},IE=(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"}}),PE=()=>{const e=IE(),[t,r]=(0,s.useState)(null),n=Vy(),a=n("START_PROCESS_INSTANCE"),l=n("VIEW_PROCESS_DEFINITIONS");return a&&l?c().createElement(c().Fragment,null,c().createElement(Le.Z,{color:"primary",className:e.button,onClick:e=>r(e.currentTarget)},c().createElement(Yr.Z,{className:e.icon}),c().createElement("div",{className:e.buttonLabel},x().text("Add"))),c().createElement(NE,{anchorEl:t,onClose:()=>r(null)})):null};function DE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RE=e=>{const{processTypes:t,assignee:r,showClosedTasks:n}=e||{},a=(0,ze._)(),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=Vy()("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)(AE(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){DE(e,t,r[t])}))}return e}({},r,t):r))))}),[]);return{tasks:f,total:y,loading:E,updateTaskState:O,loadWorkflowTasks:w}},AE=(e,t)=>r=>(!e||e.includes(r.processType))&&(!t||t===r.assignee);function jE(){return jE=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},jE.apply(this,arguments)}const ZE=e=>c().createElement("svg",jE({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:"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:"MergeDark_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"MergeDark_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#MergeDark_svg__a",transform:"rotate(90 12.045 12)"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#MergeDark_svg__b)",d:"M0 0h24v24H0z"}))),LE=(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 _E(){return _E=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},_E.apply(this,arguments)}let ME;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(ME||(ME={}));const VE=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=ME.iconButton,label:a,disabled:l,icon:o,onClick:i=On.ZT,onMenuClose:s=On.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=LE();return(()=>{switch(n){case"iconButton":return c().createElement(ye.k,_E({disabled:l,className:b()(p.iconButton,r),size:"S",tooltipTitle:a,onClick:i,icon:o},u));case"button":return c().createElement(Le.Z,_E({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(di.C,{value:a},c().createElement("div",{className:p.overflowStyle},a)));case"menuItem":{const e=()=>{s(),i()};return c().createElement(Va.Z,_E({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)))}}})()}));VE.displayName="ActionButton";const BE=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a,onError:l=On.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 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 zE=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=ME.iconButton,onMenuClose:a=On.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}=BE({entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:p});return c().createElement(VE,UE({className:r,disabled:l,mode:n,label:x().text("Merge"),icon:ZE,onClick:m,onMenuClose:a,ref:t},d))}));function FE(){return FE=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},FE.apply(this,arguments)}zE.displayName="mergeButton";const HE=e=>c().createElement("svg",FE({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:"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:"NotMatchDark_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"NotMatchDark_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#NotMatchDark_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#NotMatchDark_svg__b)",d:"M0 0h24v24H0z"}))),WE=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 qE(){return qE=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},qE.apply(this,arguments)}const GE=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=ME.iconButton,onMenuClose:a=On.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}=WE({entity:o,entities:i,onStartRequest:s,onFinishRequest:u});return c().createElement(VE,qE({className:r,disabled:l,mode:n,label:x().text("Not a match"),icon:HE,onClick:d,onMenuClose:a,ref:t},p))}));function $E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}GE.displayName="notMatchButton";const YE=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){$E(e,t,r[t])}))}return e}({},e,{[n]:(0,N.pipe)(a,r)})}),{})),[r,t])};function KE(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){XE(e,t,r[t])}))}return e}function XE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const QE=[],JE=e=>console.error("Collaboration error",e),ev=e=>{let{objectIds:t=QE,objectTypes:r,enabled:n=!0}=e;const a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getTenant),o=(0,g.useSelector)(h.ZP.selectors.getCollaborationPath),i=(0,g.useSelector)(h.ZP.selectors.isCollaborationEnabled)&&n,[c,p]=(0,s.useState)(null),[d,m]=(0,s.useState)([]),[f,b]=(0,s.useState)(null),[y,x]=(0,s.useState)(null),[E,v]=(0,s.useState)(!1),[w,O]=(0,s.useState)(!1),C=(0,s.useCallback)((e=>{b((t=>KE({},t,e)))}),[]),T=null==a?void 0:a.uri,S=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i&&T&&!(0,u.ZiX)(T)){const r=e=>{console.warn("Collaboration error",e),b(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?b:C),(0,N.otherwise)(r))({uris:e,tenant:l,collaborationPath:o})}else b(null)}),[C,o,T,i,l]);(0,s.useEffect)((()=>{S(t,!0)}),[t,S]);const k=(0,s.useCallback)(((e,t)=>{(0,u.liG)({collaborationPath:o,tenant:l,relatedObjectUri:e,pageToken:t}).then((e=>{let{items:r,nextPageToken:n}=e;m((e=>t?(0,N.uniqBy)((0,N.prop)("commentId"),[...e,...r]):r)),p(n)})).catch(JE)}),[o,l]),I=(0,s.useCallback)((e=>{O(!0),(0,u.d7q)({collaborationPath:o,tenant:l,commentId:e}).then(x).catch(JE).finally((()=>O(!1)))}),[o,l]),P=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i}=e;v(!0);const s={objectId:a,content:t,relatedObjectUris:i,objectType:n,visibility:"public",namedUsers:r,permanentLink:""};return(0,u.Yrx)({collaborationPath:o,tenant:l,data:s}).then((e=>{let[t]=e;return((e,t)=>{x(e),b((r=>KE({},r,{[t]:[...r[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),m((t=>[e,...t]))})(t,a)})).catch(JE).finally((()=>v(!1)))}),[o,l]),D=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i,commentId:s,replies:c}=e;v(!0);const p={objectId:a,content:t,relatedObjectUris:i,objectType:n,visibility:"public",namedUsers:r,permanentLink:"",commentId:s,replies:c};return(0,u.uAg)({collaborationPath:o,tenant:l,data:p}).then((e=>(e=>{x(e),m((0,N.map)((0,N.when)((0,N.propEq)("commentId",e.commentId),(0,N.always)(e))))})(KE({},e,{replies:c})))).catch(JE).finally((()=>v(!1)))}),[o,l]),R=(0,s.useCallback)((e=>{let{uri:t,commentId:r}=e;v(!0),(0,u.YFy)({collaborationPath:o,tenant:l,commentId:r}).then((()=>((e,t)=>{x(null),b((r=>{const n=r[t]||[];return KE({},r,{[t]:n.filter((t=>t.commentId!==e))})})),m((t=>t.filter((t=>t.commentId!==e))))})(r,t))).catch(JE).finally((()=>v(!1)))}),[o,l]),A=(0,s.useCallback)(((e,t,r)=>{const n="resolve"===e.action?"resolved":"open";x("resolved"===n?e=>{if(e)return null}:t=>{if(t)return KE({},t,{replies:[...t.replies,e]})}),b((e=>KE({},e,{[t]:e[t].map((e=>e.commentId===r?KE({},e,{status:n,replies:e.replies+1}):e))}))),m((t=>t.map((t=>t.commentId===r?KE({},t,{status:n,replies:[...t.replies,e]}):t))))}),[]),j=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,commentId:n,action:a,uri:i}=e;v(!0);const s={content:t,action:a,namedUsers:r};return(0,u.PP2)({collaborationPath:o,tenant:l,commentId:n,data:s}).then((e=>{let[t]=e;return A(t,i,n)})).catch(JE).finally((()=>v(!1)))}),[o,l,A]),Z=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;j({content:"",namedUsers:[],commentId:t,action:"resolve",uri:r})}),[j]),L=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;j({content:"",namedUsers:[],commentId:t,action:"reopen",uri:r})}),[j]);return{clearCurrentComment:(0,s.useCallback)((()=>{x(null)}),[]),comments:d,commentsMap:f,createComment:P,createReply:j,currentComment:y,deleteComment:R,editComment:D,getComment:I,getComments:k,getCommentsCount:S,loading:w,objectTypes:r,pageToken:c,reOpenThread:L,resolveThread:Z,sending:E}};function tv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rv=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,ze._)(),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){tv(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,gb.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}},nv=(e,t)=>{const r=(0,s.useRef)(!1);(0,s.useEffect)((()=>{t&&!r.current&&(r.current=!0,e())}),[e,t])};var av=r(11326);const lv=()=>{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 ov(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iv=(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){ov(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 sv=r(47081),cv=r(8007);const uv=c().createContext(!1);uv.displayName="ProfilePerspectiveViewContext";const pv=c().createContext("");pv.displayName="IdContext"}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_reltio_remotes=self.webpackChunk_reltio_remotes||[]).push([[934],{92934:(e,t,r)=>{r.r(t),r.d(t,{ALWAYS_VISIBLE_TYPE_URIS:()=>Ca,ActionButton:()=>VE,ActionButtonMode:()=>ME,ActivityLog:()=>n.Z,ActivityLogFilter:()=>a.Z,ActivityTypes:()=>l.I,AddWorkflowButton:()=>PE,ArrowExpandButton:()=>Ut,AsyncMountContext:()=>da,AttributeListItem:()=>m.Z,AttributeTitle:()=>Q,AttributesList:()=>Pa,AttributesPager:()=>to,AttributesTable:()=>sf,AttributesView:()=>ui,AutoSizeList:()=>Ni.Z,AvatarWithFallback:()=>Pi,BarChart:()=>Js.Z,BasicTable:()=>Di.Z,BasicTableContext:()=>Ai.X,BasicTablePagination:()=>ss.Z,BasicView:()=>O.Z,BasicViewContent:()=>Qs.Z,BasicViewHeader:()=>C.Z,BlockImageGalleryDialogContext:()=>Or,BranchDecorator:()=>D,COMMENTS_CONTAINER_VISIBILITY_AREA:()=>J,CardinalityMessage:()=>Zl,ChartsFactory:()=>nc.Z,ClickAwayProvider:()=>ic,CollaborationContext:()=>ne,CollaborationItem:()=>qe,CollapseButton:()=>Ns.Z,CollapseRowButton:()=>Ds,ColorBar:()=>sc.Z,ColumnFilterType:()=>Zi.Dq,ColumnsDataType:()=>Zi.uz,ColumnsSettings:()=>rs,CommentsContainer:()=>et,ConfigureColumnsPopup:()=>bc,ConfirmDeleteDialog:()=>ih,ConfirmationDialog:()=>oh,ConnectionRelationTypeSelector:()=>vc,CrosswalkDragLayer:()=>ff,CrosswalkEditor:()=>Lf,CrosswalkType:()=>bf,CrosswalksDisplayProvider:()=>Um,DEFAULT_OVERLAY_OPTIONS:()=>pb,DataTypeValue:()=>at.Z,DataTypeValueEditor:()=>aa.Z,DateEditor:()=>Rc.Z,DateRangeEditor:()=>Dc.Z,DateRangeTypes:()=>Eb.K,DefaultCellValueRenderer:()=>cs.Z,DeltaTypes:()=>o.w,Drawer:()=>Sc,DropDownEditor:()=>kc.Z,DropDownMenuButton:()=>be.Z,DropDownSelector:()=>_a.Z,DropdownIndicator:()=>cc.Z,DropdownIndicatorWithIconButton:()=>uc.Z,EMPTY_STATE_ICONS:()=>Vc.B9,EMPTY_STATE_VARIANTS:()=>Vc.tC,EditableAttribute:()=>Cl,EditableImageAttributesLine:()=>Jn,EmptyState:()=>Vc.ZP,EmptyStub:()=>On.Vd,EntitiesMapContext:()=>xe,EntityAvatar:()=>bt,EntityCreator:()=>al,EntityMarkerContext:()=>ab,EntitySelector:()=>gl,EntityTypeBadge:()=>Uc,EntityTypeIcon:()=>Ma.Z,EntityTypesSelector:()=>lu,EntityUriLink:()=>Ee.Z,ErrorBoundary:()=>ou.Z,ErrorMessage:()=>ta,ErrorPopup:()=>iu.Z,ErrorWrapper:()=>sa,ExpandableSearchInput:()=>Lm,ExpandedAttributesProvider:()=>Yg,ExpandedValueTooltip:()=>di.C,FacetViewHeader:()=>k,FileTypeEditor:()=>jc.Z,FilterButton:()=>is,FilterValueEditor:()=>Ic.Z,FlipCard:()=>mu,HideOnShrink:()=>fu,HierarchicalAttributeTooltip:()=>Ou,Highlighter:()=>Xr,HistoryActivityType:()=>xb,HistoryChangeTypes:()=>Mb,HistoryDiffContext:()=>ct,HistoryHeader:()=>Sy,HistoryPanelEmptyState:()=>Iy,HistoryView:()=>Jb,IdContext:()=>pv,ImageAttributesLine:()=>Mo,ImageGalleryDialog:()=>Co,ImportButton:()=>Nu,ImportModes:()=>ku,InlineAttributesPager:()=>Fg,InlineImageAttribute:()=>_g,InlineNestedAttribute:()=>eh,InlineReferenceAttribute:()=>Dg,LightArrowTooltip:()=>Qm,LinearLoadIndicator:()=>Dn,Link:()=>Pu,LoadingSpinner:()=>Du,MAP_DRAWING_MODES:()=>ub,MAP_MINIMUM_SCALE_RADIUS:()=>db,Marginator:()=>th.Z,MatchRulesBlock:()=>np,MenuWithPopper:()=>pc.Z,MergeButton:()=>zE,ModeSwitcher:()=>vo,ModeSwitcherSelect:()=>sp,MoreAttributesButton:()=>en,MultiSelect:()=>Mp.Z,MultiValueChip:()=>Vl.Z,MultipleInput:()=>cp.Z,NestedAttribute:()=>Kt,NestedAttributeEditor:()=>La,NoData:()=>_c,NoResults:()=>Mc.X,NotMatchButton:()=>GE,NumberEditor:()=>Pc.Z,OvIcon:()=>st,PieChart:()=>ec.Z,PivotingAttributeContext:()=>w,Popper:()=>Ye.Z,PopupBoundariesContext:()=>cv.p,PopupWithArrow:()=>Xe,PotentialMatchReviewCard:()=>hp,ProfileBand:()=>vp,ProfileBandHistory:()=>Ny,ProfileBandNavigation:()=>Xs,ProfileCard:()=>Cp,ProfileMatchCard:()=>fE,ProfilePerspectiveViewContext:()=>uv,QueryBuilderAttributeDataType:()=>Zi.eB,QueryBuilderAttributeType:()=>Zi.Xw,QueryBuilderRow:()=>jp,QueryBuilderRowsGroup:()=>_p,ReactSelectOptionFilters:()=>Vp,ReactSortableTree:()=>Fd,ReactSortableTreeHandlers:()=>Rd,ReactSortableTreeUtils:()=>dd,ReadOnlyAttribute:()=>ar,ReadOnlyAttributeValuesBlock:()=>Si,ReadOnlyAttributesList:()=>ri,ReadOnlyAttributesPager:()=>ti,ReferenceAttribute:()=>nr,ReferenceAttributeEditor:()=>wl,RelatedObjectUrisContext:()=>ae,RelationEditor:()=>Zy,RelationTypeSelector:()=>Ei,ReltioGridLayout:()=>Hd.Z,ReltioMap:()=>bb,ResizablePanes:()=>Kd,RowCellAutoSizer:()=>Ss,Score:()=>bp,ScoreLabel:()=>K,ScrollableTabs:()=>Mm.Z,SearchInput:()=>Vr.Z,SelectionPopup:()=>Ur,SelectionPopupPopper:()=>lm,SelectorWithOnlyOptionAutoSelect:()=>sm,SideButtonsPanel:()=>pm,SidePanel:()=>bm,SidePanelContentHeader:()=>xm,SidePanelEmptyState:()=>hm,SimpleAttribute:()=>Lt,SimpleAttributeEditor:()=>wa,SimpleDropDownSelector:()=>Ml.Z,SimpleMatchRulesBlock:()=>Wu,SimpleMatchRulesBuilder:()=>$u,SmallIconButton:()=>_t.Z,SmallIconButtonWithTooltip:()=>ye.k,SortingType:()=>Zi.nI,SourceCrosswalksRow:()=>jf,SourceIcon:()=>Em,Spacer:()=>vm.Z,TableContext:()=>Ai.X,TableWithBars:()=>tc.Z,TextEditor:()=>Nc.Z,TimestampEditor:()=>Ac.Z,TransitiveMatchBlock:()=>rp,TreeChart:()=>rc.Z,UsersContext:()=>Te,VerticalDivider:()=>Om,VerticalHeadingsTable:()=>km,ViewIdContext:()=>Ga.m,ViewMoreToggle:()=>Dm,VirtualGroupedList:()=>Gr,WhiteSearchInput:()=>tm,WorkflowComments:()=>lx,WorkflowTaskCard:()=>TE,WorkflowTasksContext:()=>_y,basicTableViewState:()=>Os,buildColumnsFilter:()=>ds.Tz,columnFilterToMdmFilter:()=>ds.su,createStandardAction:()=>On.zD,defaultGetRowCellHeight:()=>us.Z,defaultRenderRowCell:()=>ps.Z,getChecked:()=>On.IR,getValue:()=>On.NA,groupCrosswalksByTypesAndSources:()=>Vf,isIE:()=>On.w1,mergeClasses:()=>On.ze,noop:()=>On.ZT,parseJSON:()=>On.Rx,stopPropagation:()=>On.UW,toggleSortOrder:()=>On.Dh,useActions:()=>YE,useActivitiesLoader:()=>i.d,useAsyncMount:()=>ga,useAttributeExpanded:()=>Kg,useBasicTableCellRenderer:()=>Ms,useClickableStyle:()=>lc.d,useCollaboration:()=>ev,useConfigPermissions:()=>sv.l,useCrosswalkActions:()=>mf,useCrosswalkColor:()=>zm,useCrosswalkFocus:()=>Wm,useCrosswalkHighlight:()=>Hm,useDidUpdateEffect:()=>te.D,useDynamicRowCellHeight:()=>js,useHighlightedCrosswalks:()=>Fm,useHistory:()=>Nb,useHistoryDiff:()=>Rb,useHistorySlice:()=>yb,useKeyboardNavigation:()=>$r,useMarkAsNotMatchRequest:()=>WE,useMatchesLoader:()=>gE,useMergeAllRequest:()=>BE,useModifiedEntity:()=>df,usePagingSimulator:()=>mE,usePrevious:()=>gb.D,useProfileActivitiesLoader:()=>d,useRelationTypeSelector:()=>yc,useRelationsLoader:()=>rv,useRunOnceAfterValueInitialization:()=>nv,useSafePromise:()=>ze._,useSavedState:()=>av.a,useUsers:()=>lv,useWhyDidYouUpdate:()=>iv,useWorkflowAssignee:()=>Fy,useWorkflowCheckPermission:()=>Vy,useWorkflowComments:()=>nx,useWorkflowTasks:()=>RE,withAsyncMount:()=>fa,withFilterAtBottom:()=>ji.Z,withPercents:()=>ac.Z,withTableContext:()=>Ri.Z,withTooltip:()=>lt.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(58263),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 R(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){A(e,t,r[t])}))}return e}function A(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)(R({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)(R({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:R({},L.titleRow,{marginBottom:"3px"})}));var B=r(13980),U=r.n(B),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"],Y=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)]])()};Y.propTypes={label:U().string,attrTypeUri:U().string};const K=Y,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(K,{label:t,attrTypeUri:a.uri}),r&&c().createElement(z.Z,null))};X.propTypes={label:U().string,isRequired:U().bool,className:U().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";const ae=c().createContext([]);ae.displayName="RelatedObjectUrisContext";var le=r(80030);function oe(){return oe=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},oe.apply(this,arguments)}const ie=e=>c().createElement("svg",oe({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"})),se=(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"}}))),ce=c().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const a=se();return c().createElement(le.ZP,{title:x().text("Show comment")},c().createElement("div",{ref:t,className:a.root,onClick:n},c().createElement(ie,{className:a.icon}),c().createElement("div",{className:a.childrenWrapper},r)))}));ce.displayName="CommentButton";const ue=ce;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: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"})),me=e=>{let{className:t,onClick:r}=e;const n=se();return c().createElement(le.ZP,{title:x().text("Add comment")},c().createElement("div",{className:b()(n.root,t),onClick:r},c().createElement(de,{className:n.icon})))};var ge=r(27291),he=r(86689),fe=r(43054),be=r(98538),ye=r(39475);const xe=c().createContext({});xe.displayName="EntitiesMapContext";var Ee=r(18527);const ve=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},we=e=>`${x().date(e,"LT")} ${x().date(e,"LL")}`,Oe=(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"}}))),Ce=e=>{let{comment:t,className:r}=e;const n=Oe(),a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,s.useContext)(xe);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(Ee.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=ve(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(Ee.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(Ee.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=ve(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(Ee.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(Ee.Z,{className:n.link,value:(0,u.wwR)(l)},l.label?(0,u.idV)(l.label):(0,u.BTI)(l)))))}default:return null}})())},Te=c().createContext([]);Te.displayName="UsersContext";const Se=(0,T.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),ke=e=>{let{comment:t,className:r}=e;const n=Se(),a=(0,s.useContext)(Te);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(he.Z,{href:`mailto:${t.email}`},e):e})).map(((e,t)=>c().createElement(s.Fragment,{key:t},e))))};var Ne=r(43434);const Ie=(0,T.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));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=>{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=Ie();return c().createElement(Ne.Z,Pe({},n,{className:b()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))},Re=(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=Re(),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(De,{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},we(a.createdTime)),u&&c().createElement(be.Z,{buttonComponent:ye.k,buttonProps:{icon:fe.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(Ce,{comment:a,className:o.commentTarget}),c().createElement(ke,{comment:a,className:o.message}),c().createElement(E.Z,{className:o.buttons},c().createElement(he.Z,{className:o.button,onClick:t,component:"button"},x().text("Reply")),"open"===a.status&&c().createElement(he.Z,{disabled:m,className:o.button,onClick:()=>{p({commentId:a.commentId,uri:n})},component:"button"},x().text("Resolve")),"resolved"===a.status&&c().createElement(he.Z,{disabled:m,className:o.button,onClick:()=>{d({commentId:a.commentId,uri:n})},component:"button"},x().text("Re-open")))))},je=(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"}}))),Ze=e=>{let{className:t,reply:r}=e;const{createdBy:n,action:a,createdTime:l}=r,o=je();return c().createElement(E.Z,{className:b()(o.root,t)},c().createElement(De,{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(ke,{className:o.message,comment:r}),c().createElement(v.Z,{className:o.createdAt},we(l))))};var Le=r(77277),_e=r(2271);const Me=(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 Ve(){return Ve=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},Ve.apply(this,arguments)}const Be=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=Me(),l=(0,s.useContext)(Te);return c().createElement(_e.r,Ve({},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(_e.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"}}});var ze=r(29627);const Fe=e=>{switch(e){case"open":return x().text("Reply...");case"resolved":return x().text("Adding a comment will re-open this");default:return""}},He=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),R=(0,ze._)(),A=""!==O.trim(),j=P||A,Z=null==i?void 0:i.status,L=(e,t,r)=>{I(r),C(e),S(t)},_=()=>{null==p||p(),L("","",[])};return(0,s.useEffect)((()=>{o&&o.current.update()}),[o,j]),(0,s.useEffect)((()=>{u?C(i.content):_()}),[u]),c().createElement(E.Z,{className:b()(d.root,r)},c().createElement("form",{onSubmit:e=>{e.preventDefault();const t=(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})]]);return R(t()).then(_).catch(console.log)},className:d.form},c().createElement(E.Z,{className:d.main},c().createElement(De,{classes:{root:d.avatar}},m),c().createElement(Be,{className:d.textField,disabled:v,onChange:(e,t,r)=>{L(e,t,r)},inputRef:t,value:O,onFocus:()=>D(!0),onBlur:()=>D(!1),placeholder:Fe(Z)})),j&&c().createElement(E.Z,{className:d.buttons},c().createElement(Le.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"))(Z,u)),c().createElement(Le.Z,{disabled:v,onClick:()=>_(),className:d.button,variant:"outlined",color:"primary"},x().text("Cancel")))))},We=(0,T.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),qe=(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=We({classes:a}),[d,m]=(0,s.useState)(!1),g=c().createElement(He,{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(Ze,{key:e.replyId,className:p.repliedComment,reply:e}))))),g),!i&&g)}));var Ge=r(27556),$e=r(1292),Ye=r(7421);const Ke=(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)"}}}})),Xe=e=>{let{anchorEl:t,placement:r="top",arrow:n=!0,open:a,onClose:l=(()=>{}),children:o,className:i,popperRef:s}=e;const u=Ke(),[p,d]=c().useState(null);return c().createElement(Ye.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($e.Z,{onClickAway:e=>{var t;t=e.target,Array.from(document.querySelectorAll("[data-modal]")).some((e=>e.contains(t)))||l()}},c().createElement(Ge.Z,{className:u.popoverRoot},n?c().createElement("span",{className:u.arrow,ref:d}):null,c().createElement(E.Z,null,o)))))},Qe=(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"}}))),Je=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=Qe({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(Xe,{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(ye.k,{className:d.resolveButton,size:"S",onClick:()=>{g({commentId:i.commentId,uri:t})},disabled:f,showForDisabled:!0,tooltipTitle:x().text("Resolve"),icon:ge.Z,color:"primary"})),!h&&c().createElement(qe,{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}))},et=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;(0,te.D)((()=>{l&&l(h)}),[h]);const S=(0,s.useContext)(ae),k=(0,s.useMemo)((()=>S?[...a,...S]:a),[S,a]);return w&&c().createElement("div",{className:b()(u.root,t)},C&&c().createElement(me,{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(ue,{ref:r===(null==f?void 0:f.commentId)?d:null,key:r,onClick:()=>(e=>{x(e),g(!0)})(r)},1+t)})),c().createElement(Je,{anchorEl:p,open:h,onClose:()=>{d(null),E(),g(!1)},uri:r,relatedObjectUris:k,objectType:n,comment:f}))};var tt=r(7089),rt=r(41128);const nt=(0,T.Z)((e=>({container:{height:"16px",borderColor:(0,rt.U1)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}})));var at=r(67586),lt=r(78223);const ot=(0,lt.Z)(tt.Z),it=e=>{let{className:t,attributeType:r,nonOvValues:n=[],nonOvTotal:a}=e;const l=nt();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(at.Z,{value:(0,u.kDl)(e),dataTypeDefinition:(0,u.PFL)(r),rich:!1})))):null;return c().createElement(ot,{tooltipTitle:o,tooltipPlacement:"top",label:`+ ${a}`,variant:"outlined",classes:{root:b()(l.container,t),label:l.label}})};it.propTypes={className:U().string,nonOvTotal:U().number,attributeType:u.EMD,nonOvValues:U().arrayOf(U().oneOfType([u.cNQ,u.dMV,u.Rtp]))};const st=it,ct=c().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});ct.displayName="HistoryDiffContext";const ut=(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(ut(l,n[a])):(t.push(pt(n[a],l)),t)}}),[])},pt=(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"},dt=(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=mt(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}),[])},mt=(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(gt(a,l)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(dt(l,a,r,t))}return e}),[])},gt=(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 ht(){return ht=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},ht.apply(this,arguments)}const ft=e=>c().createElement("svg",ht({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"})),bt=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(Ne.Z,{className:b()(r,n),src:o,imgProps:{onError:s}},c().createElement("img",{className:n,src:i,alt:"fallback entity avatar",onError:s}))},yt=(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"}}))),xt=(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"}}});function Et(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vt=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,ze._)(),m=(0,g.useDispatch)(),f=yt(),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(ut(t,e)):r.push(pt([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){Et(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(bt,{entity:e,avatarClassName:f.profileIcon}),c().createElement(Ee.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"))))},wt=e=>{let{value:t,attributeType:r,children:n,className:a}=e;const l=xt(),o=yt(),i=(0,s.useContext)(w)||[],p=(0,u.QZu)(r),d=(0,g.useSelector)(h.ZP.selectors.getMetadata)||{},m=p?dt(r,t.value,i,d):gt(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(le.ZP,{interactive:!0,arrow:!0,placement:"right-start",classes:l,title:c().createElement(vt,{value:m,attributeType:r,config:b.popup})},c().createElement("span",{className:a},c().createElement(ft,{className:o.icon}),c().createElement("span",{className:o.content},n))):c().createElement(c().Fragment,null,n)};let Ot;!function(e){e.insertAttribute="insertAttribute",e.updateAttribute="updateAttribute",e.deleteAttribute="deleteAttribute"}(Ot||(Ot={}));const Ct={[Ot.insertAttribute]:{color:"#599E0E"},[Ot.updateAttribute]:{backgroundColor:"rgba(255, 187, 0, 0.12)",color:"#CC7500"},[Ot.deleteAttribute]:{backgroundColor:"rgba(255, 50, 0, 0.2)",color:"#CF0E26"}},Tt=e=>{switch(e){case"UPDATE_ATTRIBUTE":return Ot.updateAttribute;case"UNDO_IGNORE_ATTRIBUTE":case"INSERT_ATTRIBUTE":return Ot.insertAttribute;case"IGNORE_ATTRIBUTE":case"DELETE_ATTRIBUTE":return Ot.deleteAttribute;default:return""}},St="/",kt=(0,N.pipe)((0,N.split)(St),(0,N.propSatisfies)((0,N.lte)(2),"length")),Nt=(0,N.pipe)((0,N.split)(St),(0,N.slice)(0,-2),(0,N.join)(St)),It=(0,N.curry)(((e,t)=>(0,N.cond)([[(0,N.has)(e),(0,N.prop)(e)],[()=>kt(e),It(Nt(e))]])(t))),Pt=e=>(0,N.pipe)(N.keys,(0,N.any)((0,N.startsWith)(e+St))),Dt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=It(e,t);return(0,N.isNil)(r)?Pt(e)(t)?"UPDATE_ATTRIBUTE":"":r},Rt=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){jt(e,t,r[t])}))}return e}function jt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zt=(0,T.Z)({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{flex:1,wordBreak:"break-all"},updateAttribute:At({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ct[Ot.updateAttribute]),insertAttribute:At({width:"fit-content"},Ct[Ot.insertAttribute]),deleteAttribute:At({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},Ct[Ot.deleteAttribute]),multilineAttribute:{width:"fit-content"}}),Lt=e=>{let{className:t,attributeType:r=null,attributeValue:n,inlined:a}=e;const l=Zt(),{appearance:o}=(0,s.useContext)(ct),i=Dt(n.uri,o),p=Tt(i),d=c().createElement(at.Z,{value:(0,u.kDl)(n),dataTypeDefinition:(0,u.PFL)(r)});return a||p?c().createElement("div",{className:t},c().createElement(wt,{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(wt,{value:n,attributeType:r,key:n.uri},c().createElement("span",{className:l.attributeValue},d)),c().createElement(et,{className:l.commentsContainer,uri:n.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:n.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE}))};var _t=r(40435),Mt=r(98989);const Vt=(0,T.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function Bt(){return Bt=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},Bt.apply(this,arguments)}const Ut=e=>{const t=Vt(),{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(_t.Z,Bt({icon:Mt.Z,size:"XXS",disableRipple:!0,iconClassName:b()(t.expandIcon,{[t.expanded]:r}),className:b()(n,t.expandButton)},a))},zt=(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}}),Ft=e=>{let{attributeTypesList:t,attributeValue:r,label:n,expanded:a=!1,children:l,showNonOv:o}=e;const i=zt(),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(et,{uri:r.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:r.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE})),d&&c().createElement(ri,{attrTypes:t,entity:h,drawLines:!0,parentUri:p,showNonOv:o},l))};Ft.propTypes={children:U().node,label:U().oneOfType([U().string,U().node]),attributeTypesList:U().arrayOf(u.EMD),attributeValue:U().oneOfType([u.dMV,u.Rtp]),expanded:U().bool,showNonOv:U().bool};const Ht=Ft;function Wt(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){qt(e,t,r[t])}))}return e}function qt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gt=(0,T.Z)({label:{textDecoration:"none"},updateAttribute:Wt({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ct[Ot.updateAttribute]),insertAttribute:Wt({width:"fit-content"},Ct[Ot.insertAttribute]),deleteAttribute:Wt({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},Ct[Ot.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function $t(){return $t=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},$t.apply(this,arguments)}const Yt=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=Gt(),{appearance:l}=(0,s.useContext)(ct),o=(0,s.useMemo)((()=>{const e=Dt(t.uri,l),n=Tt(e),o=t.label?t.label:(0,u.Kxm)(t,r.dataLabelPattern);return c().createElement(wt,{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(Ht,$t({label:o,attributeValue:t,attributeTypesList:(0,u.EUG)({},r)},n))};Yt.propTypes=u.j2V;const Kt=(0,s.memo)(Yt);function Xt(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){Qt(e,t,r[t])}))}return e}function Qt(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)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:Xt({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},Ct[Ot.updateAttribute]),insertAttribute:Xt({width:"fit-content"},Ct[Ot.insertAttribute]),deleteAttribute:Xt({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},Ct[Ot.deleteAttribute])})));function er(){return er=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},er.apply(this,arguments)}const tr=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=Jt(),i=(0,u.bwT)(t),p=(0,s.useMemo)((()=>(0,u.EUG)(r,n)),[n,r]),{appearance:d}=(0,s.useContext)(ct),m=(0,s.useMemo)((()=>{const e=Dt(t.uri,d),r=Tt(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(Ht,er({attributeTypesList:p,attributeValue:t,label:m},l))};tr.propTypes=u.NkU;const rr=(0,s.memo)(tr),nr=(0,g.connect)((e=>({metadata:h.ZP.selectors.getMetadata(e),uiPath:h.ZP.selectors.getUIPath(e)})))(rr),ar=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(nr,t);default:return c().createElement(Lt,t)}}}.build(t,e)},lr=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:l,showNonOv:o,totalNonVisibleValues:i}=e;const s=M(),{label:p}=n;return c().createElement("div",{className:b()(s.collaborationWrapper,J)},c().createElement("div",{className:b()(s.titleRow,s.wrapper)},c().createElement(Q,{label:p,className:b()(s.title,a),attributeType:n}),c().createElement(st,{nonOvValues:r,attributeType:n,className:s.ovIcon,nonOvTotal:i}),c().createElement(ar,{className:b()(s.attribute,l),attributeValue:t,attributeType:n,showNonOv:o,inlined:!0})),c().createElement(et,{uri:t.uri,relatedObjectUris:(0,u.wp9)(u.q7e.ENTITY_ATTRIBUTE,{uri:t.uri}),objectType:u.q7e.ENTITY_ATTRIBUTE}))};var or=r(4426);const ir=(0,T.Z)({link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"}}),sr=e=>{let{moreNumber:t,valueNumber:r,onClick:n}=e;const a=ir();return c().createElement(he.Z,{component:"button",variant:"caption",className:a.link,onClick:n,underline:"none"},c().createElement(or.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 cr=r(96971);const ur=e=>{let{onClick:t}=e;const r=ir();return c().createElement(he.Z,{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},c().createElement(cr.Z,{className:r["svg-icon__root"]}),x().text("Show less"))},pr=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:l,parentUri:o,requestNextPageOfAttributeValues:i,titleClassName:u,contentClassName:p,showNonOv:d,totalNonVisibleValues:m}=e;const g=V(),[h,f]=(0,s.useState)(t),y=t<a,x=y&&h<a,E=y&&h>=a,{label:v}=l,w=r.slice(0,h),O=a-h;return c().createElement("div",{className:g.wrapper},c().createElement("div",{className:g.titleRow},c().createElement(Q,{label:v,className:b()(g.title,u),attributeType:l}),c().createElement(st,{nonOvValues:n,attributeType:l,className:g.ovIcon,nonOvTotal:m})),c().createElement("div",{className:g.attributes},w.map((e=>c().createElement(ar,{key:e.uri,className:b()(g.attribute,p),attributeValue:e,attributeType:l,showNonOv:d})))),x&&c().createElement(sr,{moreNumber:(0,N.min)(t,O),valueNumber:O,onClick:()=>{r.length<a&&i({parentUri:o,attributeTypeUri:l.uri,attributeTypeName:l.name,values:r,defaultMaxValues:t}),f(h+t)}}),E&&c().createElement(ur,{onClick:()=>{f(t)}}))};var dr=r(80079);function mr(){return mr=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},mr.apply(this,arguments)}const gr=e=>c().createElement("svg",mr({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"}))),hr=(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 fr(){return fr=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},fr.apply(this,arguments)}const br="loading",yr="loaded",xr="error",Er={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},vr=(0,s.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=Er.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||Er.SMALL,p=hr(i),[d,m]=(0,s.useState)(br);(0,s.useEffect)((()=>{m(br)}),[t]);const g=d===br,h=d===yr;return d===xr?c().createElement("div",fr({className:b()(p.defaultContainer,p.image,r)},o),c().createElement(dr.Z,{className:p.defaultImage})):c().createElement("div",{className:b()(p.root,n)},!(0,u.O27)(t)&&c().createElement("img",fr({src:t,className:b()(p.image,r,{[p.hideImage]:g}),onLoad:()=>{m(yr)},onError:()=>{m(xr)},alt:"image"},o)),g&&c().createElement("div",fr({className:b()(p.defaultContainer,p.image,r)},o),c().createElement(gr,{className:p.defaultImage})),h&&l)}));var wr=r(88267);const Or=c().createContext(!1);Or.displayName="BlockImageGalleryDialogContext";var Cr=r(45203),Tr=r(15762);const Sr=(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 kr=r(60905);const Nr=(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)"}}))),Ir=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:n}=e;const a=Nr(),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(kr.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(kr.Z,{item:!0,key:l},c().createElement(vr,{onClick:()=>r(t),className:b()(a.thumb,{[a.inactiveThumb]:n!==t}),src:(0,u.efz)({value:o})}))}))))},Pr=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}=e;const l=Sr(),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(_t.Z,{icon:Cr.Z,className:b()(l.arrowButton,l.arrowButtonPrev),onClick:()=>{a(n-1)},size:"XL"}),c().createElement(vr,{containerClassName:l.mainImageContainer,className:l.mainImage,size:i&&Er.OVERRIDE,src:i}),n!==r.length-1&&c().createElement(_t.Z,{icon:Tr.Z,className:b()(l.arrowButton,l.arrowButtonNext),onClick:()=>{a(n+1)},size:"XL"})),c().createElement(Ir,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}))};var Dr=r(21324),Rr=r(5806),Ar=r(33016),jr=r(36138),Zr=r(85256);const Lr=(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 _r=r(79784);const Mr=(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 Vr=r(33662);const Br=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=Mr({containerWidth:i,containerHeight:s}),h=c().createElement(c().Fragment,null,!a&&c().createElement("div",{className:g.header},t),!l&&c().createElement(Vr.Z,{onSearch:n,autofocus:!0,onKeyDown:u,inputRef:d,classes:{root:g.searchInputContainer},placeholder:x().text("Search & add attributes"),height:40}));return c().createElement(_r.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))};Br.propTypes={className:U().string,title:U().string,headerPlacement:U().oneOf(["top","bottom"]),onSearch:U().func,searchInputOnKeyDown:U().func,containerWidth:U().number,containerHeight:U().number,hideTitle:U().bool,hideSearchInput:U().bool,searchInputRef:U().shape({current:U().instanceOf(Element)}),children:U().node},Br.defaultProps={anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}};const Ur=Br,zr=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 Fr=r(50166);const Hr=(0,T.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),Wr=e=>e.titleItemIndex===e.index,qr=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=Hr(),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&&(Wr(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=>Wr(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(wr.Z,{handleHeight:!0,onResize:g,targetDomEl:b.current}),c().createElement(Fr.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&&Wr(u.listItem)&&(p=c-(u.offset-n));break;case"backward":{const e=o>-1&&(d=o,t.findIndex(((e,t)=>Wr(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))};qr.propTypes={items:U().arrayOf(U().object).isRequired,getItemSize:U().func.isRequired,renderItem:U().func.isRequired,width:U().oneOfType([U().number,U().string]),height:U().number.isRequired,renderGroupTitle:U().func,fixedTitle:U().bool,hideSubtitles:U().bool,itemKey:U().func,disableHorizontalScrollbar:U().bool,focusIndex:U().number,onInnerContainerResize:U().func};const Gr=qr,$r=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&&Wr(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||Wr(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 Yr=r(65549);const Kr=(0,T.Z)({highlight:{fontWeight:600}}),Xr=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)},Qr=(0,N.curry)(((e,t)=>(0,N.filter)((t=>t.label.toLowerCase().includes(e.toLowerCase())))(t))),Jr=e=>{let{label:t,popupTitle:r=t,data:n,dense:a,onApply:l}=e;const o=Lr(),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)(Qr(d),(0,N.map)((e=>({item:{id:e.uri,label:e.label,attrType:e}}))))(n)),[n,d]),E=(0,s.useMemo)((()=>zr(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}=$r({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(Xr,{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(Le.Z,{color:"primary",onClick:()=>p(!u),ref:i,className:o.moreButton},c().createElement(Yr.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(Gr,{getItemSize:v,renderItem:I,items:E,height:S,containerWidth:320,focusIndex:O})))};Jr.propTypes={label:U().string,popupTitle:U().string,data:U().array,dense:U().bool,onApply:U().func};const en=Jr;var tn=r(95038),rn=r.n(tn);const nn={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)")}},an=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)?rn()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,N.path)(["CreationTimestamp",0,"value"],e)?rn()(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},ln=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},on=(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}))},sn=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=ln(t.attributes);return on(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}),[])},cn=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),un=(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:{}}),pn=e=>{let{attributeType:t,onAddAttributes:r,uri:n}=e;const a=un(),l=ln(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(en,{label:x().text("Attributes"),data:l,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:n}))))}}),c().createElement(Zr.Z,{className:a.divider})))},dn=(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"}}))),mn=e=>{let{title:t,content:r,isLink:n,children:a}=e;const l=dn();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))},gn=(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"}}),hn=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const a=gn(),l=(0,g.useSelector)(h.ZP.selectors.getIsViewMode),o=(i=t,s=n,on(Object.keys(nn),s).map((e=>an(i,e)?{title:nn[e],value:an(i,e),isLink:cn(e)}:null)).filter(Boolean));var i,s;const u=sn(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(mn,{key:t,isLink:n,title:t,content:r})})),l&&u.map((e=>{let{attrType:r,values:n}=e;return c().createElement(ti,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:a.title,contentClassName:a.content,parentUri:t.uri})})))};var fn=r(94438),bn=r(52669),yn=r(81556);const xn=(0,T.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),En=e=>{let{checked:t,className:r,onClick:n}=e;const a=xn(),l=t?yn.Z:bn.Z;return c().createElement(l,{className:b()(a.root,r),onClick:n})};function vn(){return vn=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},vn.apply(this,arguments)}const wn=e=>c().createElement("svg",vn({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 On=r(79573);const Cn=(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"}}))),Tn=(0,s.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:l=On.ZT,onSelect:o=On.ZT,onShareLink:i,onSetAsDefault:u,onDelete:p,onDownload:d=On.ZT,onClick:m}=e,g=Cn(),[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(En,{className:g.checkedIcon,checked:n,onClick:E(n)}),w&&c().createElement("div",{className:g.actions},c().createElement(_t.Z,{onClick:d,className:g.actionButton,icon:wn}),c().createElement(be.Z,{menuId:`image-overlay-actions-${t}`,buttonComponent:_t.Z,buttonProps:{icon:fe.Z,className:b()(g.actionButton,g.dropDownMenuButton)},menuItems:y})),O&&c().createElement(Le.Z,{className:g.button,variant:"outlined",onClick:l},x().text("Deselect")))}));var Sn=r(13896),kn=r(58651),Nn=r(8629),In=r(67358);const Pn=(0,T.Z)({loadingOverlay:{position:"absolute",width:"100%",height:"100%",top:0,left:0,opacity:.37,zIndex:10,backgroundColor:"#fff"},transparent:{backgroundColor:"transparent"},relativePosition:{"&$loadingOverlay":{position:"relative"}}}),Dn=e=>{let{transparent:t=!1,relativePosition:r=!1}=e;const n=Pn();return c().createElement(c().Fragment,null,c().createElement("div",{className:b()(n.loadingOverlay,{[n.transparent]:t,[n.relativePosition]:r})},c().createElement(In.Z,{color:"secondary"})))};var Rn=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}}))),jn=e=>0===e.trim().length,Zn=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(Ge.Z,{className:r.paper},c().createElement(Rn.Z,{value:n,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);a(t),r||jn(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(Le.Z,{disabled:Boolean(l)||jn(n),variant:"outlined",color:"primary",onClick:()=>{t(n),a(""),o(null)}},x().text("Send"))),l&&c().createElement(v.Z,{className:r.errorMessage},l))};var Ln=r(83997);const _n=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Mn=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:_n.join(","),id:"upload-image-button",type:"file"}),c().createElement("label",{htmlFor:"upload-image-button"},c().createElement(Le.Z,{className:t,variant:"contained",color:"primary",component:"span"},x().text("Select image"))))};function Vn(){return Vn=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},Vn.apply(this,arguments)}const Bn=e=>c().createElement("svg",Vn({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"}}))),zn=e=>{let{onAppendFile:t,className:r}=e;const n=Un(),[{canDrop:a,isOver:l},o]=(0,Sn.useDrop)({accept:[Ln.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(Bn,{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(Mn,{onAppendFile:t}))},Fn=(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"}}))),Hn=e=>{let{children:t,className:r}=e;const n=Fn();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 Wn=r(87685),qn=r(37265);const Gn=(0,T.Z)({closeIcon:{color:"#fff"}}),$n=e=>{let{error:t,onClose:r}=e;const n=Gn();return c().createElement(qn.Z,{open:Boolean(t),onClose:r,message:t,action:c().createElement(ye.k,{className:n.closeIcon,tooltipTitle:x().text("Close"),icon:Wn.default,onClick:r})})},Yn=(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=Yn(),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(Sn.DndProvider,{backend:kn.default},c().createElement(Nn.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(zn,{className:a.targetBox,onAppendFile:e=>{const t=Number((e.size/1024/1024).toFixed(2)),r=_n.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(Hn,{className:a.divider},x().text("or")),c().createElement(Zn,{onSend:e=>{b(e)}})),p&&c().createElement(Dn,null),c().createElement($n,{error:m,onClose:()=>f(null)})))},Xn={imageMargin:4,imageWidth:Er.SMALL.imageWidth,imageHeight:Er.SMALL.imageHeight},Qn=(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"}}))),Jn=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:n,onChangeAttribute:a,requestNextPageOfAttributeValues:l,parentUri:o,paging:i,showNonOv:p,imageSize:d=Xn}=e;const m=Qn(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(Tn,{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(Lo,{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(vr,{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(_t.Z,{className:m.uploadButton,iconClassName:m.uploadIcon,icon:fn.Z}))),c().createElement(Kn,{open:x,onUpload:w,onClose:v}))},ea=(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"}}))),ta=e=>{let{className:t,message:r}=e;const n=ea();return r?c().createElement(v.Z,{variant:"caption",className:b()(n.caption,t)},r):null};var ra=r(22983);const na=(0,T.Z)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center"},"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 aa=r(65314),la=r(42494),oa=r(74828);function ia(){return ia=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},ia.apply(this,arguments)}const sa=(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=ea(),i=!!t;return c().createElement(la.Z,ia({className:b()(o.wrapper,n,null==a?void 0:a.root),error:!0},l),r,i&&c().createElement(oa.Z,{className:b()(o.helperText,null==a?void 0:a.helperText)},c().createElement(ta,{message:t})))})),ca=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}},ua=(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&&rn()(t).format("YYYY-MM-DD")||"";case u.oS0.TYPE_TIMESTAMP:return t&&rn()(t).format()||"";case u.oS0.TYPE_ACTIVENESS_DATE:case u.oS0.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}},pa=(0,N.curry)(((e,t,r)=>({value:ua(t,r),uri:e.uri,attributeType:t}))),da=c().createContext({enabled:!1,queueSizeThreshold:0});da.Provider.propTypes={value:U().shape({enabled:U().bool,queueSizeThreshold:U().number})},da.displayName="AsyncMountContext";let ma=0;const ga=()=>{const e=(0,s.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,s.useContext)(da),[n,a]=(0,s.useState)(!t||t&&ma<r);e.current&&ma++;const l=(0,s.useRef)();return(0,s.useEffect)((()=>{if(ma--,!n)return l.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(l.current)}),[]),e.current=!1,n};function ha(){return ha=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},ha.apply(this,arguments)}const fa=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,s.forwardRef)(((r,n)=>ga()?c().createElement(e,ha({},r,{ref:n})):t&&c().createElement(t,ha({},r,{ref:n}))));return r.displayName="WithAsyncMount",r};function ba(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){ya(e,t,r[t])}))}return e}function ya(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xa={};function Ea(){return Ea=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},Ea.apply(this,arguments)}const va=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=na(),w="deleted"===f,O="edited"===f,C=(0,u.KIu)(o),T=(0,u.PFL)(n),S=ca(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,R=(0,u.e$p)(l),A=(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=>ba({},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 ba({},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=xa[e];return(0,N.equals)(t,r)?r:((0,N.equals)(null==r?void 0:r.parents,t.parents)&&(t.parents=r.parents),xa[e]=t,t)})(o,f)}var a,l})(e,r,null==n?void 0:n.uri):null)),j=()=>{l&&d((0,u.iFp)(l))},Z=!!i&&k&&!n.singleValue,L=!w&&!!s&&P,_=!!R,M=w?{disabled:!0}:{};return c().createElement("div",{className:b()(E.editor,t)},c().createElement(sa,{errorMessage:R,className:E.errorWrapper},c().createElement("div",{className:b()(E["editor-value"],{[E.deleted]:w},{[E["editor-read-only-value"]]:!D})},D?c().createElement(aa.Z,Ea({fieldName:(0,u.Tde)(n.uri),value:S,dataTypeDefinition:T,error:_,onChange:(0,N.pipe)(pa(r,n),p,j),fullWidth:!0},A,y,M)):c().createElement(at.Z,{value:(0,u.kDl)(r),dataTypeDefinition:T}))),c().createElement("div",{className:E["editor-actions"]},O&&c().createElement(v.Z,{variant:"caption",className:E.editedLabel},"(",x().text("edited"),")"),Z&&c().createElement(_t.Z,{icon:Yr.Z,onClick:i,size:"L",className:b()(E.addButton,E.button)}),m&&m({attributeType:n,attributeValue:r}),L&&c().createElement(_t.Z,{className:E.button,icon:ra.Z,onClick:()=>{s({uri:r.uri,attributeType:n}),(0,u.PcX)(l)!==u.NIO.missed&&j()},size:"L"})))};va.propTypes={className:U().string,attributeValue:u.cNQ,attributeType:u.EMD,ownError:u.wfT,isReltioCrosswalk:U().bool,state:U().oneOf(["deleted","edited"]),mode:u.XGc,onAddOneMore:U().func,onDeleteAttribute:U().func,onChangeAttribute:U().func,onDeactivateError:U().func,additionalControlsRenderer:U().func};const wa=(0,s.memo)(fa(va,(()=>{const e=na();return c().createElement("div",{className:e.placeholder})}))),Oa=(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}}))),Ca=[u.xPW.roles.uri,u.xPW.tags.uri],Ta=(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)}))},Sa=(e,t)=>(0,N.partition)((0,N.pipe)((0,N.path)(["attrType","uri"]),(0,N.includes)(N.__,e)),t),ka=c().createContext(null);function Na(){return Na=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},Na.apply(this,arguments)}const Ia=e=>{let{attrTypes:t,entity:r,parentUri:n,showEmptyEditors:a,mode:l,crosswalks:o,drawLines:i,children:p,className:d,alwaysVisibleTypeUris:m=Ca,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)(ka),C=(0,s.useMemo)((()=>(0,u.Gtj)(t,l,r,a,y,O)),[t,l,r,a,y,O]),[T,S]=(0,s.useMemo)((()=>Sa(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,Na({},I,{plain:!0}),v.length>0&&c().createElement(en,{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(to,{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})})))};Ia.propTypes={attrTypes:U().array,entity:U().object,parentUri:U().string,children:U().node,showEmptyEditors:U().bool,mode:u.XGc,crosswalks:U().array,drawLines:U().bool,showNonOv:U().bool,className:U().string,alwaysVisibleTypeUris:U().array,onAddAttributes:U().func,onChangeAttribute:U().func,onDeleteAttribute:U().func,additionalControlsRenderer:U().func};const Pa=(0,s.memo)(Ia);function Da(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ra=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=Oa(),N="deleted"===T,I="edited"===T,P=a.uri,D=(0,u.ZiX)(P),[R,A]=(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&&A(!0)}),[o,L]),(0,s.useEffect)((()=>{N&&A(!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(Le.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:()=>A((e=>!e)),expanded:R,className:k.expandButton,disabled:N}),c().createElement(sa,{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(_t.Z,{icon:ra.Z,onClick:()=>E({uri:P,attributeType:n,attributeValue:a}),size:"L"}))),R&&c().createElement(Pa,{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))};Ra.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){Da(e,t,r[t])}))}return e}({label:U().string,children:U().node,attributeTypesList:U().arrayOf(u.EMD),attributeValue:U().oneOfType([u.dMV,u.Rtp])},u.KVe);const Aa=Ra;function ja(){return ja=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},ja.apply(this,arguments)}const Za=e=>{const{attributeValue:t,attributeType:r}=e,n=(0,u.Kxm)(t,r.dataLabelPattern);return c().createElement(Aa,ja({label:(0,u.idV)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))};Za.propTypes=u.j2V;const La=(0,s.memo)(Za);var _a=r(84425),Ma=r(42662),Va=r(12231);const Ba=(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"}}))),za=(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"}}))),Fa=(0,T.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}});function Ha(){return Ha=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},Ha.apply(this,arguments)}const Wa=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=Ba(),{uri:o,entityType:i,label:s,secondaryLabel:u}=a;return""!==o?c().createElement(Va.Z,Ha({className:l.entityContainer,ref:t,key:o,onClick:()=>n({label:s,uri:o,entityType:i})},r),c().createElement(Ma.Z,{className:l.entityAvatar,entityType:i}),c().createElement("span",{className:l.entityLabel},s,u&&c().createElement("span",{className:l.entitySecondaryLabel},", ",u))):c().createElement(Va.Z,Ha({className:l.entityContainer,ref:t,key:o},r,{disabled:!0}),c().createElement("span",{className:l.emptyEntityLabel},x().text("No results found")))};Wa.propTypes={innerRef:U().oneOfType([U().oneOf([null]),U().func,U().shape({current:U().any.isRequired})]),innerProps:U().object.isRequired,selectOption:U().func.isRequired,data:U().shape({uri:U().string.isRequired,label:U().string.isRequired,entityType:u.pyR.isRequired})};const qa=Wa;var Ga=r(12212);const $a=e=>{const{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:n},children:a,data:l}=e,o=Ua(),i=(0,g.useDispatch)(),p=(0,s.useContext)(Ga.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))};$a.propTypes={children:U().string,data:U().object.isRequired,selectProps:U().object.isRequired};const Ya=$a;var Ka=r(33375),Xa=r(61837);const Qa=e=>{const{selectProps:{onClear:t}}=e,r=Fa();return c().createElement(Xa.Z,{onClick:t},c().createElement(Ka.Z,{className:r.clearIcon}))};Qa.propTypes={selectProps:U().object.isRequired};const Ja=Qa,el=e=>e&&e.attributes,tl=e=>{let{entity:t,entityType:r,attributeTypesSelectionStrategy:n=el,mode:a,onAddAttributes:l,onDeleteAttribute:o,onChangeAttribute:i}=e;const u=(0,s.useMemo)((()=>n(r)),[n,r]);return t?c().createElement(Pa,{attrTypes:u,entity:t,showEmptyEditors:!0,drawLines:!0,parentUri:t.uri,mode:a,crosswalks:t.crosswalks,onAddAttributes:l,onChangeAttribute:i,onDeleteAttribute:o}):null};tl.propTypes={entityUri:U().string,parentUri:U().string,entity:U().object,entityType:U().object,attributeTypesSelectionStrategy:U().func,mode:u.XGc,onAddAttributes:U().func,onDeleteAttribute:U().func,onChangeAttribute:U().func};const rl=tl,nl={onAddAttributes:h.N5.actions.addAttributes,onDeleteAttribute:h.N5.actions.removeAttribute,onChangeAttribute:h.N5.actions.modifyAttribute},al=(0,g.connect)(((e,t)=>({entity:t.entityUri&&h.ZP.selectors.getModifiedEntity(e,t.entityUri)})),nl)(rl);var ll=r(92391);const{Group:ol}=ll.F,il=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,l=za();return c().createElement(ol,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(Yr.Z,{className:l.addIcon}),x().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};il.propTypes={selectProps:U().object.isRequired,data:U().object,children:U().array};const sl=il,cl=(0,T.Z)({creatorWrapper:{marginTop:"20px"}});function ul(){return ul=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},ul.apply(this,arguments)}function pl(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){dl(e,t,r[t])}))}return e}function dl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ml=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=cl(),[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=pl({},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:sl,GroupHeading:On.Vd}:{},D=I?{ClearIndicator:Ja}:{};return c().createElement(c().Fragment,null,c().createElement(_a.Z,ul({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=>pl({},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:pl({Option:qa,SingleValue:Ya},P,D),currentEntityType:T,isClearable:!0,disableLinkClick:m},g)),I&&c().createElement("div",{className:h.creatorWrapper},c().createElement(al,{mode:n,attributeTypesSelectionStrategy:d,entityType:T,entityUri:t.entityUri})))};ml.propTypes={entity:u.oZZ,entityTypesUris:U().arrayOf(U().string),max:U().number,mode:u.XGc,dispatch:U().func,metadata:u.pGS,onChange:U().func.isRequired,onCreate:U().func,attributeTypesSelectionStrategy:U().func,globalSearchRequestOptions:U().object,disableLinkClick:U().bool};const gl=ml,hl=(0,T.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function fl(){return fl=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},fl.apply(this,arguments)}function bl(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){yl(e,t,r[t])}))}return e}function yl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xl=e=>{const t=hl(),{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]),R=(0,s.useCallback)((e=>{r&&l(r.uri);const t=x.current,n=!(0,N.isEmpty)(e)&&e.uri===(0,u.bwT)(t),a=bl({},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]),A=(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});R(a),o(a)}),[D,g,O,n,R,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,fl({},p,{label:(0,u.idV)(C),attributeTypesList:P,crosswalks:S,metadata:n}),c().createElement(sa,{errorMessage:L},c().createElement(gl,{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?R:void 0,onCreate:Z?A:void 0,metadata:n,attributeTypesSelectionStrategy:D})))};xl.propTypes=bl({},u.NkU,{modifiedEntity:u.pyR,metadata:u.pGS,globalSearchRequestOptions:U().object,onDeleteModifiedEntity:U().func,onUpdateModifiedEntity:U().func,onDeactivateError:U().func});const El=(0,s.memo)(xl),vl={onDeleteModifiedEntity:h.N5.modifiedEntities.actions.entityDeleted,onUpdateModifiedEntity:h.N5.modifiedEntities.actions.entityCreated,onDeactivateError:h.N5.errors.actions.errorDeactivated},wl=(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"])}}),vl)(El);function Ol(){return Ol=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},Ol.apply(this,arguments)}const Cl=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(La,t);case u.oS0.TYPE_REFERENCE:return c().createElement(wl,t);default:return c().createElement(wa,Ol({isReltioCrosswalk:(0,u.KVV)(o,t.attributeValue)},s))}}}.build(t,e)},Tl=(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",color:e.palette.text.secondary},typeError:{marginLeft:"12px"},ovIcon:{marginLeft:"8px",marginTop:"-1px",textIndent:0},titleWrapper:{flex:1,paddingBottom:"3px"}}))),Sl=e=>x().text("${value}",{value:1===e?x().text("value"):x().text("values")}),kl=(0,N.has)("minValue"),Nl=(0,N.has)("maxValue"),Il=(0,N.pipe)(Nl,N.not),Pl=(0,N.propSatisfies)((e=>1===e),"minValue"),Dl=e=>{let{minValue:t}=e;return x().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:x().number(t,"0"),minValueCaption:Sl(t)})},Rl=e=>{let{maxValue:t}=e;return x().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:x().number(t,"0"),maxValueCaption:Sl(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:Sl(t)})}],[(0,N.allPass)([Pl,Nl]),Rl],[(0,N.allPass)([Pl,Il]),(0,N.always)("")],[(0,N.allPass)([kl,Nl]),e=>{let{minValue:t,maxValue:r}=e;return x().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:Dl({minValue:t}),maxValue:x().number(r,"0"),maxValueCaption:Sl(r)})}],[Nl,Rl],[kl,Dl],[N.T,(0,N.always)("")]]),jl=e=>{let{cardinality:t}=e;const r=Tl();return c().createElement(v.Z,{variant:"caption",className:r.caption},Al(t))};jl.propTypes={cardinality:u.oA3};const Zl=jl,Ll=(0,N.filter)((0,N.propSatisfies)(u.ZiX,"uri")),_l=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,nonVisibleValues:f,onAddAttributes:b,onDeleteAttribute:y,onChangeAttribute:x,onDeactivateError:E,additionalControlsRenderer:v,requestNextPageOfAttributeValues:w}=e;const O=Tl(),[C,T]=(0,s.useState)(t),[S,k]=(0,s.useState)(!1),{label:I,required:P,cardinality:R,name:A,uri:j}=n,Z=(0,u.KIu)(l),L=(0,s.useContext)(ka),_=(0,s.useMemo)((()=>null==L?void 0:L.includes(j)),[j,L]),M=(0,u.O27)(r),V=(!S&&i||P||_)&&M,B=(0,s.useRef)((0,u.gjI)({parentUri:a,attributeType:n})),U=(0,s.useCallback)((()=>{T(C+1);const e={parentUri:a,index:C,attributeType:n};return b(V&&!(0,u.YkM)(n.type)?[e,e]:[e])}),[C,b,a,n,V]),z=(0,s.useCallback)((0,N.pipe)(y,N.T,k),[y,k]);if(M&&!V)return null;if(V&&M&&(r=[B.current]),(0,u.O27)(r))return null;const F=(Ll(r)||[]).length,H=h?"totalValues":"totalOvValues",W=(0,N.ifElse)((0,N.has)(H),(0,N.pipe)((0,N.prop)(H),(0,N.add)(F)),(0,N.always)(r.length))(m),q=null!=m&&m.totalValues?m.totalValues-W:null==f?void 0:f.length,G=t<W,$=G&&C<W,Y=G&&C>=W,K=r.slice(0,C),X=K?K.length-1:0,J=W-C;return c().createElement(D,{enabled:o},c().createElement("div",{className:O.wrapper},c().createElement("div",{className:O.titleWrapper},c().createElement(Q,{label:I,isRequired:P,className:O.title,attributeType:n}),c().createElement(st,{nonOvValues:f,attributeType:n,className:O.ovIcon,nonOvTotal:q})),Z&&c().createElement(Zl,{cardinality:R}),Z&&c().createElement(ta,{message:p,className:O.typeError}),c().createElement("div",{className:O.attributesWrapper},K.map(((e,t)=>c().createElement(Cl,{key:e.uri,attributeValue:e,attributeType:n,lazy:V&&!P,showEmptyEditors:i,errors:d,ownError:(0,u.ADq)(e,t,n.uri,d),mode:l,crosswalks:g,onAddOneMore:X===t?U:null,onAddAttributes:b,onDeleteAttribute:z,onChangeAttribute:x,onDeactivateError:E,additionalControlsRenderer:v}))),$&&c().createElement(sr,{moreNumber:(0,N.min)(t,J),valueNumber:J,onClick:()=>{r.length<W&&w({parentUri:a,attributeTypeUri:j,attributeTypeName:A,values:r,defaultMaxValues:t}),T(C+t)}}),Y&&c().createElement(ur,{onClick:()=>{T(t)}}))))};var Ml=r(90590),Vl=r(92145);const Bl=(0,T.Z)({valueContainer:{marginLeft:"8px",width:0}}),Ul={MultiValue:Vl.Z},zl=e=>{let{values:t}=e;const r=Bl(),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(Ml.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 Fl=r(7766);const Hl=e=>e?`?filter=${(0,u.Uqd)()((e=>[{filter:"containsWordStartingWith",fieldName:"tags",values:[e]}])(e))}`:"",Wl=[{fieldName:"tags",orderType:"reversedCount"}],ql=e=>(0,u.FK9)({query:Hl(e),body:Wl}).then((e=>Object.keys(e.tags))),Gl=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(Fl.Z,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r,onChange:l,getSuggestions:ql})};function $l(){return $l=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},$l.apply(this,arguments)}function Yl(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,onDeleteAttribute:o,showEmptyEditors: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,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","showEmptyEditors"]);const d=Tl(),{label:m,required:g,cardinality:h}=r,f=(0,u.KIu)(a),[b,y]=(0,s.useState)(!1),x=(0,s.useCallback)((0,N.pipe)(o,N.T,y),[o,y]),v=(0,u.O27)(t),w=!b&&i&&v,O=(0,s.useRef)((0,u.gjI)({parentUri:n,attributeType:r}));return(0,u.j2U)(r)&&v&&!w?null:c().createElement(E.Z,{className:d.wrapper},c().createElement(Q,{label:m,isRequired:g,className:d.title,attributeType:r}),f&&c().createElement(Zl,{cardinality:h}),f&&c().createElement(ta,{message:l}),c().createElement(E.Z,{className:d.attributesWrapper},(()=>{switch(r.uri){case u.xPW.tags.uri:return c().createElement(Gl,{values:t});case u.xPW.roles.uri:return c().createElement(zl,{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){Yl(e,t,r[t])}))}return e}({},O.current,{value:t[0]||""});return c().createElement(Cl,$l({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:x},p))}}})()))};function Xl(){return Xl=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},Xl.apply(this,arguments)}var Ql;!function(e){e.imageLine="imageLine",e.special="special",e.default="default"}(Ql||(Ql={}));const Jl=(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=Tl(),w=(0,N.partition)(u.OXP),[O,C]=w(t),T=g?t:O,S=g?[]:C,k={errorMessage:p,errors:s,mode:n,parentUri:i,onAddAttributes:h,onDeleteAttribute:f,onChangeAttribute:b,onDeactivateError:y,additionalControlsRenderer:x,showEmptyEditors:m};return(()=>{switch((0,N.cond)([[u.kqr,(0,N.always)(Ql.special)],[u.Or$,(0,N.always)(Ql.imageLine)],[N.T,(0,N.always)(Ql.default)]])(r)){case Ql.special:return c().createElement(D,{enabled:l},c().createElement(Kl,Xl({values:T,attributeType:r},k)));case Ql.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(Jn,{attributeValues:T,attributeType:r,paging:o,onDeleteAttribute:f,parentUri:i,onChangeAttribute:b,requestNextPageOfAttributeValues:E,showNonOv:g})));default:return c().createElement(_l,Xl({values:T,attributeType:r,max:d,paging:o,crosswalks:a,drawLines:l,requestNextPageOfAttributeValues:E,showNonOv:g,nonVisibleValues:S},k))}})()})),eo={requestNextPageOfAttributeValues:h.N5.actions.requestNextPageOfAttributeValues,onDeactivateError:h.N5.errors.actions.errorDeactivated},to=(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)}}),eo)(Jl),ro=(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"}}),no=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=ro(),g=sn(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(to,{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(Zr.Z,{className:m.divider}),c().createElement(E.Z,{className:m.actions},c().createElement(Le.Z,{disabled:!a,onClick:s,className:m.cancelButton},x().text("Cancel")),c().createElement(Le.Z,{disabled:!a,onClick:p,color:"primary"},x().text("Apply")))))},ao={palette:{type:"dark",primary:u.rSc.palette.primary,secondary:u.rSc.palette.secondary}},lo=(0,Ar.Z)(ao),oo=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)(Ga.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(jr.ThemeProvider,{theme:lo},c().createElement(E.Z,null,c().createElement(pn,{attributeType:r,uri:null==d?void 0:d.uri,onAddAttributes:b?a:void 0}),c().createElement(hn,{attributeType:r,attributeValue:d,imageAttributeFieldsOrder:t}),b&&c().createElement(no,{mode:f,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:d,hasChanges:m,onDeleteAttribute:o,onChangeAttribute:l,onAddAttributes:a,onCancel:i,onApply:p})))},io=(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}}))),so=e=>{let{className:t,attributeValue:r,handleSetAsDefault:n,attributeType:a}=e;const l=io(),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(Rr.Z,{classes:{root:l.formControlLabel,label:l.checkboxLabel},control:c().createElement(Dr.Z,{className:l.checkbox,checked:m,onChange:y,color:"default"}),label:x().text("Set as default")}),c().createElement(oo,{attributeType:a,imageAttributeFieldsOrder:d,attributeValue:r}))))},co=(0,T.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),uo=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=co();return c().createElement(E.Z,{className:p.root},c().createElement(Pr,{attributeValueIndex:o,setAttributeValueIndex:u,attributeValues:t,className:p.main}),c().createElement(so,{handleSetAsDefault:a,attributeValue:t[o],className:p.details,attributeType:l}))};var po=r(38724),mo=r(70331),go=r(15223),ho=r(73115);function fo(){return fo=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},fo.apply(this,arguments)}const bo=e=>c().createElement("svg",fo({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 yo=r(38592);const xo=(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,rt.U1)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,rt.U1)(e.palette.primary.main,.24)}}}))),Eo=(0,lt.Z)(Le.Z),vo=e=>{let{className:t,classes:r={},modes:n=[],modeId:a,onChange:l}=e;const o=xo();return c().createElement(yo.Z,{className:t},n.map((e=>{let{id:t,title:n,tooltipTitle:i,Icon:s}=e;return c().createElement(Eo,{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})))},wo=(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 Oo;!function(e){e.GALLERY_MODE="gallery",e.DETAILS_MODE="details"}(Oo||(Oo={}));const Co=e=>{let{open:t,mode:r,children:n,header:a,onClose:l,onChangeMode:o}=e;const i=wo(),u=(0,s.useMemo)((()=>[{id:Oo.GALLERY_MODE,title:x().text("Gallery"),Icon:ho.Z},{id:Oo.DETAILS_MODE,title:x().text("Details"),Icon:bo}]),[]);return c().createElement(Nn.Z,{classes:{paper:i.paper},open:t,BackdropProps:{className:i.backdrop},fullScreen:!0},c().createElement(mo.Z,{classes:{colorPrimary:i.appBar}},c().createElement(go.Z,{className:i.toolbar},c().createElement(E.Z,{className:i.headerLeft},c().createElement(ye.k,{tooltipTitle:x().text("Close"),onClick:l,className:i.closeButton,iconClassName:i.closeIcon,icon:Wn.default}),null==a?void 0:a.left),c().createElement(E.Z,{className:i.headerCenter},c().createElement(vo,{modes:u,modeId:r,onChange:o,className:i.modeSwitcher})),c().createElement(E.Z,{className:i.headerRight},null==a?void 0:a.right))),c().createElement(po.Z,{className:i.content},n))},To=(0,T.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),So=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:a,onShareLink:l,onSetAsDefault:o,onDownload:i,onClickImage:s,onDelete:u}=e;const p=To(),d=e=>c().createElement(Tn,{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(kr.Z,{container:!0},t.map((e=>{let{id:t,src:r}=e;return c().createElement(kr.Z,{key:t,classes:{item:p.item},item:!0},c().createElement(vr,{size:Er.LARGE,onClick:()=>s(t),src:r,overlay:d(t)}))}))))},ko=(0,T.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),No=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:a}=e;const l=ko(),o=t.length===r.length;return c().createElement(he.Z,{component:"button",underline:"none",classes:{button:l.selectButton},onClick:o?a:n},o?x().text("Clear selection"):x().text("Select all images"))};var Io=r(35292);const Po=(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)"}}))),Do=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:a}=e;const l=Po();return c().createElement(c().Fragment,null,n&&c().createElement(Le.Z,{variant:"contained",color:"primary",onClick:n,startIcon:c().createElement(fn.Z,null)},x().text("Upload")),t&&n&&c().createElement("div",{className:l.divider}),t&&c().createElement(ye.k,{className:l.downloadButton,tooltipTitle:x().text("Download selected items"),icon:wn,onClick:t}),r&&c().createElement(ye.k,{className:l.shareButton,tooltipTitle:x().text("Copy link"),icon:Io.Z,onClick:r}),a&&c().createElement(ye.k,{className:l.deleteButton,tooltipTitle:x().text("Delete selected items"),icon:ra.Z,onClick:a}))},Ro=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)(Oo.GALLERY_MODE),v=(0,g.useSelector)(h.ZP.selectors.getIsViewMode);(0,s.useEffect)((()=>{E(a?Oo.DETAILS_MODE:Oo.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===Oo.GALLERY_MODE,k=x===Oo.DETAILS_MODE,I=b.length>0,P=k||S&&I,D=!v&&P,R=!v&&(k||S&&!I),A=S&&I&&c().createElement(No,{items:w,selectedItems:b,onClearAll:()=>{y([])},onSelectAll:()=>{y((0,N.pluck)("id",w))}}),j=c().createElement(Do,{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:R?m:void 0});return c().createElement(Co,{mode:x,open:r,onChangeMode:E,header:{left:A,right:j},onClose:n},S&&c().createElement(So,{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(Oo.DETAILS_MODE)},onDelete:v?void 0:T}),k&&c().createElement(uo,{handleSetAsDefault:C,setCurrentAttributeValueUri:l,currentAttributeValueUri:a,attributeValues:t,attributeType:o}))};var Ao=r(94079);const jo=(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 Zo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lo=e=>{let{attributeType:t,attributeValues:r=[],renderImage:n,overlay:a=!1,countFixedItems:l=0,children:o,onUpload:i,onDeleteAttribute:p,imageSize:d=Xn,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=jo(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)(Or),[P,D]=(0,s.useState)(!1),[R,A]=(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||(A(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),B=(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]),U=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){Zo(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:L},a&&{onDownload:M,onShareLink:V,onSetAsDefault:B});return c().createElement(c().Fragment,null,c().createElement(wr.Z,{handleWidth:!0,onResize:Z}),c().createElement(Ro,{attributeValues:r,open:P,onClose:_,setCurrentAttributeValueUri:A,currentAttributeValueUri:R,attributeType:t,onDownload:M,onShareLink:V,onSetAsDefault:B,onUpload:i,onDeleteAttribute:p}),c().createElement("div",{className:O.imageBox},o,r.slice(0,T).map(n(U)),k>0&&c().createElement("div",{className:O.moreButtonContainer},c().createElement("div",{className:O.moreButton,onClick:()=>L()},c().createElement(v.Z,{className:O.number},`+${k}`)))))},_o=(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:Ct[Ot.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:Ct[Ot.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ct[Ot.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ct[Ot.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${Ct[Ot.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"}}))),Mo=e=>{let{attributeType:t,attributeValues:r=[],paging:n,parentUri:a,requestNextPageOfAttributeValues:l,showNonOv:o,imageSize:i=Xn}=e;const p=_o(i),{appearance:d}=(0,s.useContext)(ct);return c().createElement(Lo,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,u.efz)(e),{uri:n}=e,a=Dt(n,d),l=Tt(a);return c().createElement("div",{className:b()(p.image,{[p[l+"Image"]]:l}),key:n},c().createElement(vr,{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 Vo=r(20404);const Bo=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){zo(e,t,r[t])}))}return e}function zo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fo=(0,T.Z)({insertAttribute:Uo({width:"fit-content"},Ct[Ot.insertAttribute]),deleteAttribute:Uo({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},Ct[Ot.deleteAttribute])}),Ho=e=>{let{value:t}=e;const r=Fo(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),{appearance:a}=(0,s.useContext)(ct),l=Rt("roles",t,a),o=Tt(l);return c().createElement("span",{className:r[o]},(0,u.xqc)(n,t))},Wo=e=>{let{className:t,values:r}=e;return c().createElement(Bo,{values:r,className:t,Component:Ho})},qo=e=>{let{value:t}=e;const r=Fo(),n=(0,g.useSelector)(h.ZP.selectors.getUIPath),a=(0,g.useSelector)(h.ZP.selectors.getEntity),{appearance:l}=(0,s.useContext)(ct),o=Rt("tags",t,l),i=Tt(o);return c().createElement(he.Z,{underline:"none",className:r[i],href:(0,u.hgZ)({uiPath:n,tag:t,entityUri:a.uri})},t)},Go=e=>{let{className:t,values:r}=e;return c().createElement(Bo,{values:r,className:t,Component:qo})},$o=e=>{let{values:t,attributeType:r}=e;const n=M(),{label:a}=r;return c().createElement("div",{className:b()(n.titleRow,n.wrapper)},(l=n.titleIcon,r.uri===u.xPW.tags.uri?c().createElement(Vo.Z,{className:l}):null),c().createElement(Q,{label:a,className:n.title,attributeType:r}),(e=>{switch(r.uri){case u.xPW.tags.uri:return c().createElement(Go,{className:e,values:t});case u.xPW.roles.uri:return c().createElement(Wo,{className:e,values:t});default:return c().createElement(ar,{className:e,attributeValue:{value:t[0]},attributeType:r,inlined:!0})}})(n.attribute));var l},Yo="oneLine",Ko="multiLine",Xo="imageLine",Qo="special",Jo=(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,showNonOv:d}=e;const m=_(),g=(0,N.partition)(u.OXP);if(!t||!t.length)return null;const[h,f]=g(t),y=d?t:h,x=d?[]:f,E=d?"totalValues":"totalOvValues",v=(0,N.ifElse)((0,N.has)(E),(0,N.prop)(E),(0,N.always)(y.length))(a),w=null!=a&&a.totalValues?a.totalValues-v:x.length,O=1===v&&!(0,u.YkM)(r);return c().createElement(D,{enabled:n,className:b()({[m.paddingWrapperWithLines]:n})},c().createElement("div",{className:b()({[m.paddingWrapper]:!n})},(()=>{switch((0,N.cond)([[u.kqr,(0,N.always)(Qo)],[u.Or$,(0,N.always)(Xo)],[(0,N.always)(O),(0,N.always)(Yo)],[N.T,(0,N.always)(Ko)]])(r)){case Yo:return c().createElement(lr,{value:y[0],nonVisibleValues:x,totalNonVisibleValues:w,attributeType:r,titleClassName:s,contentClassName:p,showNonOv:d});case Ko:return c().createElement(pr,{values:y,nonVisibleValues:x,totalVisibleValues:v,totalNonVisibleValues:w,attributeType:r,parentUri:l,max:o,requestNextPageOfAttributeValues:i,titleClassName:s,contentClassName:p,showNonOv:d});case Xo:return c().createElement(c().Fragment,null,c().createElement(Q,{label:null==r?void 0:r.label,attributeType:r}),c().createElement(Mo,{attributeValues:y,attributeType:r,paging:a,parentUri:l,requestNextPageOfAttributeValues:i,showNonOv:d}));case Qo:return c().createElement($o,{values:y,attributeType:r})}})()))})),ei={requestNextPageOfAttributeValues:h.N5.actions.requestNextPageOfAttributeValues},ti=(0,g.connect)(((e,t)=>{let{max:r}=t;return{max:r||h.ZP.selectors.getDefaultMaxValues(e)}}),ei)(Jo),ri=(0,s.memo)((e=>{let{attrTypes:t,entity:r,parentUri:n,drawLines:a,children:l,className:o,max:i,alwaysVisibleTypeUris:p=Ca,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)((()=>Sa(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(ti,{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(sr,{onClick:()=>{g(1/0)}}),E&&c().createElement(ur,{onClick:()=>{g(i)}}))})),ni=(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)"}}),ai=(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=ni(),d=(0,g.useSelector)(h.ZP.selectors.getPivotingAttributes),m=(0,s.useMemo)((()=>Ta(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(ri,{entity:r,attrTypes:m,parentUri:r.uri,drawLines:!1,max:i}):c().createElement(v.Z,{className:p.noData},x().text("No data found"))))):null})),li=(0,T.Z)({attributesContainer:{padding:"0 16px 16px 16px"},header:{marginBottom:"4px"},noCaption:{paddingTop:"16px"}});function oi(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){ii(e,t,r[t])}))}return e}function ii(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const si=(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=li(),m=(0,g.useDispatch)(),f=(0,s.useContext)(Ga.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)((()=>Ta(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=>oi({},e,{viewId:f}))))),[f,m]),T=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.modifyAttribute,m)(oi({},e,{viewId:f}))),[f,m]),S=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.removeAttribute,m)(oi({},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(ka.Provider,{value:x},c().createElement(Pa,{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 ci(){return ci=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},ci.apply(this,arguments)}const ui=(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(ai,ci({attributesCount:r},a)):c().createElement(si,ci({mode:t,pinnedAttributes:n},a))})),pi=(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 di=r(83088);function mi(){return mi=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},mi.apply(this,arguments)}const gi=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const l=pi(),{value:o,label:i,startObject:s,endObject:u}=a,p=s.objectType.label+" ↔ "+u.objectType.label;return c().createElement(Va.Z,mi({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(Ma.Z,{className:l.iconTop,entityType:s.objectType}),c().createElement(Ma.Z,{className:l.iconBottom,entityType:u.objectType})),c().createElement("div",{className:l.text},c().createElement(di.C,{value:i},c().createElement(v.Z,{className:b()(l.textItem,l.primaryTextItem)},i)),c().createElement(di.C,{value:p},c().createElement(v.Z,{color:"textSecondary",className:b()(l.textItem,l.secondaryTextItem)},p))))};gi.propTypes={innerRef:U().oneOfType([U().oneOf([null]),U().func,U().shape({current:U().any.isRequired})]),innerProps:U().object.isRequired,selectOption:U().func.isRequired,data:U().shape({value:U().string.isRequired,label:U().string.isRequired,startObject:U().object,endObject:U().object})};const hi=gi;function fi(){return fi=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},fi.apply(this,arguments)}function bi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yi=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){bi(e,t,r[t])}))}return e}({},(0,N.defaultTo)({},a),{"data-reltio-id":"relation-type-selector"})),[a]);return c().createElement(_a.Z,fi({value:t,options:r,onChange:n,label:x().text("Select relationship type "),components:{Option:hi},TextFieldProps:o},l))},xi=U().shape({label:U().string.isRequired,value:U().string.isRequired,startObject:U().object,endObject:U().object});yi.propTypes={value:xi,options:U().arrayOf(xi),onChange:U().func};const Ei=yi;function vi(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){wi(e,t,r[t])}))}return e}function wi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oi(){return Oi=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},Oi.apply(this,arguments)}function Ci(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 Ti=e=>{let{values:t,valueContainerClassName:r}=e,n=Ci(e,["values","valueContainerClassName"]);return c().createElement(c().Fragment,null,(t||[]).map((e=>c().createElement("div",{key:e.uri,className:r},c().createElement(ar,Oi({attributeValue:e},n))))))},Si=(0,s.memo)((e=>{let{expanded:t}=e,r=Ci(e,["expanded"]);const{attributeType:n,values:a,valueContainerClassName:l}=r;switch(n.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_REFERENCE:return Ti(vi({expanded:t},r));case u.oS0.TYPE_IMAGE:return c().createElement("div",{className:l},c().createElement(Mo,{attributeType:n,attributeValues:a,imageSize:{imageHeight:40,imageWidth:40,imageMargin:2}}));default:return Ti(vi({},r))}}));var ki,Ni=r(44938);function Ii(){return Ii=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},Ii.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"}(ki||(ki={}));const Pi=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?ki.ICON_MODE:ki.TEXT_MODE)}),[r,n]);const i=()=>{o(ki.ERROR_MODE)};switch(l){case ki.ICON_MODE:return c().createElement(Ne.Z,Ii({className:t,src:r,onError:i},a));case ki.TEXT_MODE:case ki.ERROR_MODE:return c().createElement(Ne.Z,Ii({className:t},a),n);default:return null}};var Di=r(45108),Ri=r(30488),Ai=r(38748),ji=r(25843),Zi=r(53862);function Li(){return Li=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},Li.apply(this,arguments)}const _i=e=>c().createElement("svg",Li({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 Mi(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}const Bi=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}.`))})),zi=(0,N.curry)(((e,t)=>{let{groupId:r}=e;return r===t.id})),Fi=(0,N.propOr)(!0,"hideable"),Hi=(e,t)=>{const r=((e,t)=>e.find((0,N.either)(zi(t),Ui(t))))(e,t);return r?(r.children=Hi(r.children||[],t),e):e.concat(t)},Wi=(0,N.curry)(((e,t)=>u.P6Y.strings.search(t.label,e)||(t.children||[]).some(Wi(e)))),qi=(0,N.reduce)(((e,t)=>Hi(e,{id:t.id,groupId:t.groupId,label:t.label,attrType:t.dataTypeDefinition})),[]),Gi=(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)(Wi(e)),(0,N.chain)((t=>[{item:Mi({},t,{filterText:e}),level:r},...t.children?Gi(e,t.children,r+1):[]])))(t)})),$i=(0,N.has)("columns"),Yi=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],Xi=(e,t)=>{const r=Ki(t),n=t=>e.includes(t.id);return Bi(t)?r.every(n):r.some(n)},Qi=(0,T.Z)({popup:{minWidth:"200px"},groupItem:{backgroundColor:"rgba(0,0,0,0.04)"}}),Ji=e=>{let{item:t,onClick:r,checked:n,level:a,style:l,isFocused:o,isGroupItem:i}=e;const s=Qi();return c().createElement(m.Z,{key:t.id,onClick:r,checked:n,level:a,data:t,label:c().createElement(Xr,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:l,isFocused:o,hideIcon:i,className:b()({[s.groupItem]:i})})};Ji.propTypes={item:U().shape({label:U().string,filterText:U().string}),level:U().number,onClick:U().func,checked:U().bool,style:U().object,isGroupItem:U().bool,isFocused:U().bool};const es=Ji,ts=e=>{let{columnsData:t,selectedColumns:r,onChangeColumns:n,title:a,tooltipTitle:l}=e;const o=Qi(),[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)($i,Yi)),(0,N.filter)((0,N.either)(Bi,Fi)),qi,Gi(t))(e))(t,d)),[t,d]),h=(0,u.fW1)("label")(g)||308,f=(0,s.useMemo)((()=>zr(g)),[g]),b=(0,s.useCallback)((e=>{const t=(0,N.pipe)(Ki,(0,N.pluck)("id"))(e),a=Xi(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}=$r({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(ye.k,{tooltipTitle:l||x().text("Show/hide columns"),size:"L",icon:_i,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(Gr,{fixedTitle:!1,height:w,renderItem:(e,t,n)=>{let{item:a,level:l=0}=t;return c().createElement(es,{style:e,item:a,level:l,isFocused:E===n,checked:Xi(r,a),isGroupItem:Bi(a),onClick:b})},items:f,getItemSize:()=>32,containerWidth:h,focusIndex:E})))};ts.propTypes={columnsData:Zi.uz,selectedColumns:U().arrayOf(U().string),onChangeColumns:U().func,title:U().string,tooltipTitle:U().string};const rs=ts;function ns(){return ns=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},ns.apply(this,arguments)}const as=e=>c().createElement("svg",ns({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})),ls=(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"}}))),os=e=>{let{enabled:t,onClick:r}=e;const n=ls();return c().createElement(le.ZP,{title:t?x().text("Clear all filters"):x().text("Filter")},c().createElement(Xa.Z,{onClick:r,classes:{root:n.button}},t?c().createElement(c().Fragment,null,c().createElement(as,{className:n["filterIcon--enabled"]}),c().createElement(Wn.default,{color:"primary",className:n.closeIcon})):c().createElement(as,null)))};os.propTypes={enabled:U().bool,onClick:U().func};const is=os;var ss=r(42011),cs=r(46728),us=r(85103),ps=r(1928),ds=r(9377);function ms(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}const hs="CHANGE_COLUMNS",fs="TOGGLE_FILTERS",bs="CHANGE_FILTER",ys="TOGGLE_SORT",xs="CHANGE_PAGE",Es="CHANGE_ROWS_PER_PAGE",vs={changeColumns:(0,On.zD)(hs),toggleFilters:(0,On.zD)(fs),changeFilter:(0,On.zD)(bs),toggleSort:(0,On.zD)(ys),changePage:(0,On.zD)(xs),changeRowsPerPage:(0,On.zD)(Es)},ws=(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)},Os={reducer:(e,t)=>{switch(t.type){case hs:{const r=t.payload;return ws(e,r)}case fs:{const t=!e.filters;return ms({},e,{filters:t?{}:null,page:t?e.page:0})}case bs:{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 ys:{const r=t.payload,n=(0,N.path)(["sorting","field"],e),a=(0,N.path)(["sorting","order"],e);return ms({},e,{sorting:{field:r,order:(0,On.Dh)(r===n?a:null)},page:0})}case xs:return ms({},e,{page:t.payload});case Es:return ms({},e,{rowsPerPage:t.payload});default:return e}},actions:vs,changeVisibleColumns:ws};var Cs=r(76625);const Ts=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(wr.Z,{handleHeight:!0,onResize:d}),c().createElement(Cs.Z,{rootRef:a},r))};Ts.propTypes={onChangeHeight:U().func,children:U().node};const Ss=Ts;var ks=r(3073),Ns=r(28831);const Is=(0,T.Z)((()=>({hidden:{visibility:"hidden"}}))),Ps=e=>{let{rowIndex:t,rowValue:r,className:n}=e;const a=Is(),{toggleRowCollapse:l,getIsRowCollapsible:o,getIsRowCollapsed:i}=(0,s.useContext)(ks.x),u=o(r),p=i(t);return c().createElement(Ns.Z,{className:b()(n,{[a.hidden]:!u}),isOpen:!p,onClick:e=>{l(t),e.stopPropagation()}})};Ps.propTypes={rowIndex:U().number,rowValue:U().object,className:U().string};const Ds=Ps;function Rs(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}]`},js=()=>{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){Rs(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 Zs=r(21697),Ls=r(8233);function _s(){return _s=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},_s.apply(this,arguments)}const Ms=e=>{let{rowsData:t,columnsData:r,renderRowCell:n=ps.Z,getRowCellHeight:a=us.Z,defaultRowHeight:l=48,maxRowValuesCount:o=1/0}=e;const{tableRowsData:i,collapseContextValue:u}=(0,Ls.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,Zs.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(ks.x.Provider,{value:u},c().createElement("div",_s({},o,{style:{height:n(l)}}),i.length>0&&(0,Zs.getCellContentFromRowsData)({columnIndex:r.findIndex((0,N.propEq)("id",a)),headData:r,rowsData:i,rowIndex:l,getHeightForSubRow:t})))};return a.propTypes={columnId:U().string,rowIndex:U().number},{getRowHeight:n,CellRenderer:a}}),[i,l,u,r])};var Vs=r(67766),Bs=r(42767);const Us=(0,T.Z)({container:{display:"flex",alignItems:"center"},link:{whiteSpace:"nowrap",marginRight:"9px"}}),zs=(0,lt.Z)(he.Z),Fs=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(zs,{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(ye.k,{size:"L",icon:Vs.Z,tooltipTitle:x().text("Go to previous profile"),onClick:r,disabled:l,showForDisabled:!0}),c().createElement(ye.k,{size:"L",icon:Bs.Z,tooltipTitle:x().text("Go to next profile"),onClick:n,disabled:o,showForDisabled:!0}))};function Hs(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){Ws(e,t,r[t])}))}return e}function Ws(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class qs{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=Hs({},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 Gs(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){$s(e,t,r[t])}))}return e}function $s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Ys{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:Gs({},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),Xs=()=>{const{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}=(()=>{const e=(0,ze._)(),t=(0,ze._)(),r=(0,ze._)(),{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)(Ga.m),x=(0,g.useDispatch)(),[E,v]=(0,s.useState)(!1),w=(0,s.useMemo)((()=>((e,t)=>{switch(e){case"search":return new qs(t);case"graphsearch":return new Ys(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(Fs,{total:e,onPrev:t,onNext:r,onSearchResultsClick:n,isPrevDisabled:a,isNextDisabled:l}):null};var Qs=r(82068),Js=r(72668),ec=r(38037),tc=r(62321),rc=r(56215),nc=r(12960),ac=r(39878),lc=r(59383);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 ic=e=>c().createElement($e.Z,oc({mouseEvent:"onMouseDown"},e));var sc=r(89902),cc=r(78501),uc=r(59952),pc=r(51556);const dc=(0,T.Z)((()=>({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}})));function mc(){return mc=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},mc.apply(this,arguments)}function gc(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){hc(e,t,r[t])}))}return e}function hc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fc=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:gc({},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)((()=>zr(O)),[O]),{focusIndex:T,handleKeyDown:S}=$r({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(Xr,{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=dc();return c().createElement(Ur,mc({open:t,className:b()(D.container,D.popupContainer),anchorEl:r,onClose:l,onSearch:a,title:o,containerWidth:P,searchInputOnKeyDown:S},f),c().createElement(Gr,{height:300,renderItem:I,items:C,hideSubtitles:!0,getItemSize:()=>32,containerWidth:P,focusIndex:T,renderGroupTitle:h}))};fc.propTypes={open:U().bool,hideCheckBox:U().bool,anchorEl:U().any,selected:U().array,data:U().array,filterText:U().string,titleText:U().string,onClose:U().func,onListItemClick:U().func,onSearch:U().func,renderGroupTitle:U().func},fc.defaultProps={data:[],selected:[],titleText:x().text("Show/hide columns"),filterText:""};const bc=fc,yc=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 xc(){return xc=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},xc.apply(this,arguments)}const Ec=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}=yc({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(Ei,xc({value:d(t,m),options:m,onChange:g},i))};Ec.propTypes={className:U().string,relation:u.bNA,inRelationTypes:U().arrayOf(u.IYE),outRelationTypes:U().arrayOf(u.IYE),applyFirstByDefault:U().bool,reversedContextLabels:U().bool,onChange:U().func};const vc=Ec;var wc=r(4190),Oc=r(60364);function Cc(){return Cc=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},Cc.apply(this,arguments)}const Tc=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,Oc.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(wc.ZP,Cc({open:t},n),a&&r)};Tc.displayName="Drawer";const Sc=Tc;var kc=r(1128),Nc=r(43371),Ic=r(15299),Pc=r(19855),Dc=r(72466),Rc=r(39600),Ac=r(91785),jc=r(51594),Zc=r(7522);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 _c=e=>c().createElement(Zc.Z,Lc({message:x().text("No data available")},e));var Mc=r(6216),Vc=r(79002);const Bc=(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=Bc(),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 zc=r(45767),Fc=r(86619);const Hc=(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 Wc(){return Wc=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},Wc.apply(this,arguments)}const qc=(0,N.always)(32),Gc=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(Gr,Wc({getItemSize:qc,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(Xr,{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))};Gc.propTypes={selectedEntityTypes:U().array,onItemClick:U().func,focusIndex:U().number};const $c=(0,s.memo)(Gc),Yc=(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},Xc=e=>e.join(", "),Qc=e=>`calc(${(0,N.isNil)(e)?"100%":`${e}px`} - 35px)`,Jc=e=>{let{list:t,maxWidth:r}=e;const n=Yc(),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=Xc(t),u=l>0,p=u?Xc(t.slice(0,-l)):i;return c().createElement(le.ZP,{title:u?i:""},c().createElement("div",{className:n.listLabelContainer},c().createElement("div",{style:{width:Qc(r)},className:n.listLabel,ref:a},i),c().createElement("div",{className:n.visibleItemsLabel},p),u&&c().createElement("div",{className:n.hiddenCount},`+${l}`)))};Jc.propTypes={list:U().arrayOf(U().string).isRequired,maxWidth:U().number};const eu=Jc;function tu(){return tu=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},tu.apply(this,arguments)}function ru(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){nu(e,t,r[t])}))}return e}function nu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const au=e=>{let{entityTypes:t,selectedEntityTypes:r,single:n,placeholder:a,enableEmptyValueUnderline:l,onChange:o,classes:i={},ListLabelProps:p={},disabled:d=!1}=e;const m=Hc(),[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:ru({},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}=$r({items:C,open:g,onSelectFocusedItem:k,selectedItems:r,onClose:O}),D=(0,s.useRef)(),R=D.current?D.current.getBoundingClientRect().width:0,A=Math.max(R,255),j=0===r.length;return c().createElement(c().Fragment,null,c().createElement(Fc.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(eu,tu({},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(_t.Z,{size:"L",icon:zc.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:A,containerHeight:355,searchInputOnKeyDown:P,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":"entity-type-selector-popup"}},c().createElement($c,{items:C,onItemClick:S,selectedEntityTypes:r,width:A,height:245,focusIndex:I})))};au.propTypes={entityTypes:U().arrayOf(u.p8l),selectedEntityTypes:U().arrayOf(U().string).isRequired,onChange:U().func.isRequired,single:U().bool,enableEmptyValueUnderline:U().bool,placeholder:U().string,classes:U().shape({root:U().string,label:U().string,inputText:U().string,input:U().string}),ListLabelProps:U().shape({maxWidth:U().number}),disabled:U().bool};const lu=(0,s.memo)(au);var ou=r(7882),iu=r(97333);const su=e=>`rotateY(${e?180:0}deg)`,cu=e=>`rotateX(${e?180:0}deg)`,uu=e=>`rotateY(${e?0:-180}deg)`,pu=e=>`rotateX(${e?0:-180}deg)`,du=(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?uu(t):pu(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?su(t):cu(t),transformStyle:"preserve-3d",transition:"0.7s",width:"100%",zIndex:2,display:"flex"}}}),mu=(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=du({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]))})),gu=()=>c().createElement("div",{style:{display:"none"}}),hu=e=>{let{widthToHide:t,children:r}=e;return c().createElement(wr.Z,{handleWidth:!0,render:e=>{let{width:n}=e;return n>t?c().createElement(c().Fragment,null,r):c().createElement(gu,null)}})};hu.propTypes={children:U().node,widthToHide:U().number.isRequired};const fu=hu;function bu(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){yu(e,t,r[t])}))}return e}function yu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xu=(0,N.range)(2,10).reduce(((e,t)=>bu({},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)"}}})),{}),Eu=(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":bu({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},xu,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function vu(){return vu=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},vu.apply(this,arguments)}const wu=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=Eu(),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(le.ZP,vu({title:l,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};wu.propTypes={pathToTitle:U().arrayOf(U().string).isRequired,children:U().node};const Ou=wu;var Cu=r(4614),Tu=r(61932);const Su=(0,T.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}});let ku;!function(e){e[e.INIT=1]="INIT",e[e.PROGRESS=2]="PROGRESS",e[e.SUCCESS=3]="SUCCESS",e[e.DONE=4]="DONE"}(ku||(ku={}));const Nu=e=>{let{classes:t={},tooltip:r="",onClick:n=On.ZT,mode:a=ku.INIT}=e;const l=Su();return c().createElement("div",{className:b()(l.root,t.root)},(()=>{switch(a){case ku.INIT:return c().createElement(ye.k,{className:t.button,size:"M",tooltipTitle:r,icon:Tu.Z,onClick:n});case ku.PROGRESS:return c().createElement(Cu.Z,{className:t.spinner,size:24});case ku.SUCCESS:return c().createElement(ge.Z,{className:b()(l.check,t.check)});default:return null}})())},Iu=(0,T.Z)({link:{textDecoration:"inherit",color:"inherit","&:visited":{textDecoration:"inherit",color:"inherit"}}}),Pu=e=>{let{to:t,children:r,onClick:n}=e;const a=Iu();return c().createElement("a",{href:t,onClick:e=>{n&&(n(),e.stopPropagation(),e.preventDefault())},className:a.link},r)},Du=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==")})},Ru=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"}}),ju=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(Ru,{isMlMatch:t})," "),c().createElement("div",{className:n.body},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},Zu=(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"}}))),Lu=e=>{let{isMlMatch:t,matchRules:r,className:n}=e;const a=Zu();return c().createElement("div",{className:b()(a.container,n)},c().createElement("div",{className:a.title},c().createElement(Ru,{isMlMatch:t})),c().createElement("div",{className:a.labelsContainer},r.map((e=>c().createElement("div",{key:e.uri},`- ${e.label}`)))))},_u=(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 Mu(){return Mu=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},Mu.apply(this,arguments)}const Vu=(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=_u();return c().createElement("div",Mu({onClick:a,ref:t,className:b()(i.container,l)},o),c().createElement(Ut,{expanded:n}),c().createElement("div",{className:i.label},r))}));Vu.displayName="MatchRuleBadge";const Bu=Vu,Uu=(0,T.Z)({container:{display:"flex",flexDirection:"column",alignItems:"flex-start"},rulesContainer:{marginLeft:"16px"},icon:{height:"17px",width:"15px",marginRight:"5px"}});function zu(){return zu=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},zu.apply(this,arguments)}const Fu=e=>c().createElement("svg",zu({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}))),Hu=(0,lt.Z)(Bu),Wu=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(Hu,{tooltipTitle:c().createElement(ju,{matchRules:r,isMlMatch:t}),tooltipPlacement:"bottom-start",onExpand:o,expanded:a},t?c().createElement(c().Fragment,null,c().createElement(Fu,{className:n.icon}),x().text("Match IQ")):x().text("Rules")),a?c().createElement(Lu,{className:n.rulesContainer,matchRules:r,isMlMatch:t}):null)};function qu(){return qu=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},qu.apply(this,arguments)}const Gu=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,qu({matchRules:l},n)),(0,N.isEmpty)(a)?null:c().createElement(r,qu({isMlMatch:!0,matchRules:a},n)))};Gu.propTypes={matchRules:u.p3$,Component:U().func};const $u=Gu,Yu=(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=Yu(),[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($u,{Component:Lu,matchRules:r,className:n.matchLabels}):null)},Xu=(0,T.Z)({container:{display:"flex",flexDirection:"column"},rulesWrapper:{display:"flex",flexDirection:"column"}}),Qu=(0,T.Z)({ruleWrapper:{paddingTop:"8px"},label:{fontWeight:500,fontSize:"12px"}}),Ju=e=>{let{transitiveMatchRules:t}=e;const r=Qu();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(ju,{matchRules:a}))})))};function ep(){return ep=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},ep.apply(this,arguments)}const tp=(0,lt.Z)(Bu),rp=e=>{let{transitiveMatchRules:t}=e;const r=Xu(),[n,a]=(0,s.useState)(!1),l=(0,s.useCallback)((()=>a((e=>!e))),[]);return c().createElement("div",{className:r.container},c().createElement(tp,{tooltipTitle:c().createElement(Ju,{transitiveMatchRules:t}),tooltipPlacement:"bottom-start",onExpand:l,expanded:n},x().text("Transitive matches")),n?t.map(((e,t)=>c().createElement(Ku,ep({key:t},e)))):null)},np=e=>{let{entitiesMap:t,entity:r,match:n,metadata:a}=e;return(0,u.Pcm)(n)?c().createElement(rp,{transitiveMatchRules:(0,u.wB1)(a,n,t)}):c().createElement($u,{matchRules:(0,u.LS0)(a,r.type,n.matchRules),Component:Wu})};var ap=r(73698);const lp=(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 op(){return op=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},op.apply(this,arguments)}const ip=e=>"onClick"in e,sp=e=>{let{optionsGroup:t,buttonsGroup:r,value:n,onChange:a,disabled:l=!1}=e;const o=lp();return c().createElement(ap.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(le.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(ip);return e.map(((e,r)=>{const{value:n,description:a,icon:l}=e,i={value:n,className:o.menuItem};return ip(e)&&(i.onClick=()=>e.onClick(n),i.className=b()(i.className,{[o.firstMenuItemButton]:r===t})),c().createElement(Va.Z,op({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 cp=r(16482),up=r(73272);function pp(){return pp=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},pp.apply(this,arguments)}const dp=e=>c().createElement("svg",pp({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"})),mp=(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}}))),gp=e=>{let{date:t,type:r,createdBy:n,step:a,children:l,Actions:o}=e;const i=mp(),[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(dp,{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(up.Z,{className:i.flag}),c().createElement("span",{className:i.date},x().date(t,"L")),c().createElement(Ns.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)};gp.propTypes={date:U().number,createdBy:U().string,type:U().string,step:U().string,children:U().oneOfType([U().node,U().arrayOf(U().node)]),Actions:U().node};const hp=gp,fp=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(K,{attrTypeUri:n,label:t}),c().createElement("span",{className:o.value,style:{color:(0,u.Uz2)(n,r,a)}},r))};fp.propTypes={label:U().string,value:U().oneOfType([U().string,U().number]),uri:U().string,rangeColorsConfig:U().object,className:U().string};const bp=fp,yp=(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 xp(){return xp=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},xp.apply(this,arguments)}const Ep=e=>{let{className:t,entity:r,scoresToShow:n,rangeColorsConfig:a,children:l,classes:o}=e;const i=yp({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,C=(0,u.BTI)(r);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(bt,{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(bp,xp({key:e.uri},e,{rangeColorsConfig:a}))))),!(0,u.ZiX)(O)&&c().createElement(le.ZP,{title:x().text("Copy to clipboard")},c().createElement(v.Z,{display:"inline",variant:"body2",className:i.entityId,onClick:d},x().text("Entity ID"),": ",C))))),l&&c().createElement("div",null,l)))};Ep.propTypes={className:U().string,entity:U().object,scoresToShow:U().arrayOf(U().string),rangeColorsConfig:U().object,children:U().node,classes:U().object};const vp=Ep,wp=(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 Op(){return Op=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},Op.apply(this,arguments)}const Cp=(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=wp(),{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",Op({className:b()(l.container,s)},a),c().createElement("div",{className:l.colorBox,style:n?void 0:{backgroundColor:x}}),c().createElement(bt,{entity:t,avatarClassName:l.avatar,imageClassName:l.image}),c().createElement("div",{className:l.info},c().createElement("div",{className:l.firstRow},c().createElement(Ee.Z,{value:(0,u.wwR)(t),className:l.link},c().createElement(di.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(di.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)))))})),Tp=(0,T.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));var Sp=r(6782);const kp="46px",Np=(0,T.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:kp},readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:kp}}))),Ip=e=>{let{className:t,rowData:r}=e;const n=Np();return c().createElement("div",{className:b()(n.readOnlyLogicOperatorContainer,t)},r&&r.operator?(0,Sp.Z)(r.operator):x().text("Where"))};Ip.propTypes={className:U().string,rowData:U().object};const Pp=Ip,Dp=e=>{let{className:t,rowData:r}=e;const n=Np();return c().createElement("div",{className:b()(n.readOnlyFilter,t)},r&&r.filter?(0,u.XS2)(r.filter):x().text("equals"))};Dp.propTypes={className:U().string,rowData:U().object};const Rp=Dp;const Ap=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=Pp,AttributeSelectorComponent:l,FilterSelectorComponent:o=Rp,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=Tp();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:U().shape({root:U().string,logicOperatorContainer:U().string,attributeSelectorContainer:U().string,filterSelectorContainer:U().string,valuesEditorContainer:U().string,actionsContainer:U().string}),rowData:Zi.Xw,previousRowData:Zi.Xw,LogicOperatorComponent:U().elementType,AttributeSelectorComponent:U().elementType,FilterSelectorComponent:U().elementType,ValuesEditorComponent:U().elementType,ActionsComponent:U().elementType,filterSelectorRef:U().object,attributeSelectorProps:U().shape({onRestoreFocus:U().func,onOpen:U().func,disablePopoverRestoreFocus:U().bool})};const jp=(0,s.memo)(Ap);function Zp(){return Zp=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},Zp.apply(this,arguments)}const Lp=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(jp,Zp({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))};Lp.propTypes={className:U().string,rowClasses:U().shape({root:U().string,logicOperatorContainer:U().string,attributeSelectorContainer:U().string,filterSelectorContainer:U().string,valuesEditorContainer:U().string,actionsContainer:U().string}),rowsData:U().arrayOf(Zi.Xw),LogicOperatorComponent:U().elementType,AttributeSelectorComponent:U().elementType,FilterSelectorComponent:U().elementType,ValuesEditorComponent:U().elementType,ActionsComponent:U().elementType,filterSelectorRef:U().object,filterSelectorRefIndex:U().number,lastRowAttributeSelectorProps:U().shape({onRestoreFocus:U().func,onOpen:U().func,disablePopoverRestoreFocus:U().bool})};const _p=(0,s.memo)(Lp);var Mp=r(15793);const Vp={BY_LABEL:(0,r(54573).c)({stringify:(0,N.prop)("label")})};var Bp=r(81521),Up=r(8978),zp=r(46847),Fp=r(15459);function Hp(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}const Wp=(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 qp(){return qp=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},qp.apply(this,arguments)}const Gp=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"]);Wp();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:Hp("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:Hp("rst__absoluteLineBlock",l,v)}))}})),C="rtl"===x?{right:o*w}:{left:o*w},u(c().createElement("div",qp({},E,{className:Hp("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}))))))};Gp.defaultProps={swapFrom:null,swapDepth:null,swapLength:null,canDrop:!1,draggedNode:null,rowDirection:"ltr"},Gp.propTypes={treeIndex:U().number.isRequired,treeId:U().string.isRequired,swapFrom:U().number,swapDepth:U().number,swapLength:U().number,scaffoldBlockPxWidth:U().number.isRequired,lowerSiblingCounts:U().arrayOf(U().number).isRequired,listIndex:U().number.isRequired,children:U().node.isRequired,connectDropTarget:U().func.isRequired,isOver:U().bool.isRequired,canDrop:U().bool,draggedNode:U().shape({}),getPrevRow:U().func.isRequired,node:U().shape({}).isRequired,path:U().arrayOf(U().oneOfType([U().string,U().number])).isRequired,rowDirection:U().string};const $p=Gp;function Yp(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 Xp(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=Xp({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 Qp(e){let{node:t,ignoreCollapsed:r=!0}=e;return Xp({getNodeKey:()=>{},ignoreCollapsed:r,node:t,currentIndex:0,targetIndex:-1}).nextIndex-1}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=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=Jp({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 ed(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=Yp({},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=ed({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 td(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;!t||t.length<1||Jp({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]})}function rd(e){let{treeData:t,getNodeKey:r,callback:n,ignoreCollapsed:a=!0}=e;return!t||t.length<1?[]:ed({callback:n,getNodeKey:r,ignoreCollapsed:a,isPseudoRoot:!0,node:{children:t},currentIndex:-1,path:[],lowerSiblingCounts:[]}).node.children}function nd(e){let{treeData:t,expanded:r=!0}=e;return rd({treeData:t,callback:e=>{let{node:t}=e;return Yp({},t,{expanded:r})},getNodeKey:e=>{let{treeIndex:t}=e;return t},ignoreCollapsed:!1})}function ad(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 Yp({},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+Qp({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 ld(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e,l=null,o=null;return{treeData:ad({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 od(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=Yp({},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+Qp({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=Yp({},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=od({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=Yp({},s,{children:y}),E={node:x,nextIndex:b};return null!==g&&(E.insertedTreeIndex=g,E.parentPath=[...m(x),...h],E.parentNode=f),E}function id(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=od({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 sd(e){let{treeData:t,getNodeKey:r,ignoreCollapsed:n=!0}=e;if(!t||t.length<1)return[];const a=[];return td({treeData:t,getNodeKey:r,ignoreCollapsed:n,callback:e=>{a.push(e)}}),a}function cd(e,t){return!!e.children&&"function"!=typeof e.children&&e.children.some((e=>e===t||cd(e,t)))}function ud(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,ud(r,t+1))),t):t}function pd(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(Yp({},b,{node:u,searchQuery:n}))&&(s===l&&(h=!0),s+=1,g=!0);let x=p;const E=Yp({},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=>Yp({},e,{treeIndex:null})))),g&&(m=[Yp({},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 dd={find:pd,getDepth:ud,isDescendant:cd,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?Yp({},e,{children:l[t].map((e=>o(e)))}):Yp({},e)};return l[a].map((e=>o(e)))},getFlatDataFromTree:sd,insertNode:id,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=rd({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=Yp({},t);if(o&&(d.expanded=!0),!d.children)return s=a+1,Yp({},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+Qp({node:d.children[e],ignoreCollapsed:l});return s=m,Yp({},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{ad({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:ld,removeNodeAtPath:function(e){let{treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a=!0}=e;return ad({treeData:t,path:r,getNodeKey:n,ignoreCollapsed:a,newNode:null})},changeNodeAtPath:ad,toggleExpandedForAll:nd,map:rd,walk:td,getVisibleNodeInfoAtIndex:function(e){let{treeData:t,index:r,getNodeKey:n}=e;if(!t||t.length<1)return null;const a=Xp({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:Qp};function md(){return md=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},md.apply(this,arguments)}function gd(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){hd(e,t,r[t])}))}return e}function hd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fd=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:Hp("rst__loadingCirclePoint",N)}))))):a(c().createElement("div",{className:"rst__moveHandle"}),{dropEffect:"copy"}));const P=d&&cd(d,s),D=!E&&l;let R={left:-.5*t};return"rtl"===C&&(R={right:-.5*t}),c().createElement("div",md({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:Hp(s.expanded?"rst__collapseButton":"rst__expandButton",N),style:R,onClick:()=>r({node:s,path:m,treeIndex:g})}),s.expanded&&!l&&c().createElement("div",{style:{width:t},className:Hp("rst__lineChildren",N)})),c().createElement("div",{className:Hp("rst__rowWrapper",N)},n(c().createElement("div",{className:Hp("rst__row",D&&"rst__rowLandingPad",D&&!o&&"rst__rowCancelPad",h&&"rst__rowSearchMatch",f&&"rst__rowSearchFocus",N,y),style:gd({opacity:P?.5:1},x)},I,c().createElement("div",{className:Hp("rst__rowContents",!i&&"rst__rowContentsDragDisabled",N)},c().createElement("div",{className:Hp("rst__rowLabel",N)},c().createElement("span",{className:Hp("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)))))))))};fd.defaultProps={isSearchMatch:!1,isSearchFocus:!1,canDrag:!1,toggleChildrenVisibility:null,buttons:[],className:"",style:{},parentNode:null,draggedNode:null,canDrop:!1,title:null,subtitle:null,rowDirection:"ltr"},fd.propTypes={node:U().shape({}).isRequired,title:U().oneOfType([U().func,U().node]),subtitle:U().oneOfType([U().func,U().node]),path:U().arrayOf(U().oneOfType([U().string,U().number])).isRequired,treeIndex:U().number.isRequired,treeId:U().string.isRequired,isSearchMatch:U().bool,isSearchFocus:U().bool,canDrag:U().bool,scaffoldBlockPxWidth:U().number.isRequired,toggleChildrenVisibility:U().func,buttons:U().arrayOf(U().node),className:U().string,style:U().shape({}),connectDragPreview:U().func.isRequired,connectDragSource:U().func.isRequired,parentNode:U().shape({}),isDragging:U().bool.isRequired,didDrop:U().bool.isRequired,draggedNode:U().shape({}),isOver:U().bool.isRequired,canDrop:U().bool,rowDirection:U().string};const bd=fd;function yd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class xd 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){yd(e,t,r[t])}))}return e}({},l))))))}}xd.defaultProps={canDrop:!1,draggedNode:null},xd.propTypes={children:U().node.isRequired,connectDropTarget:U().func.isRequired,isOver:U().bool.isRequired,canDrop:U().bool,draggedNode:U().shape({}),treeId:U().string.isRequired,drop:U().func.isRequired};const Ed=xd,vd=(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"}}))),wd=e=>{let{isOver:t,canDrop:r}=e;return vd(),c().createElement("div",{className:Hp("rst__placeholder",r&&"rst__placeholderLandingPad",r&&!t&&"rst__placeholderCancelPad")})};wd.defaultProps={isOver:!1,canDrop:!1},wd.propTypes={isOver:U().bool,canDrop:U().bool};const Od=wd,Cd=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}},Td=Cd(id),Sd=Cd(sd),kd=Cd(Qp);function Nd(e){let{treeIndex:t}=e;return t}function Id(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=>Id(e))).join("")}function Pd(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]?Id(r[e]).indexOf(t)>-1:r[e]&&String(r[e]).indexOf(t)>-1}function Dd(e){let{node:t,path:r,treeIndex:n,searchQuery:a}=e;return Pd("title",a,t,r,n)||Pd("subtitle",a,t,r,n)}const Rd={defaultSearchMethod:Dd,defaultGetNodeKey:Nd};var Ad=r(75047);class jd{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=ud(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=Td({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,Sn.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,Sn.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,Sn.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 Zd(){return Zd=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},Zd.apply(this,arguments)}function Ld(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){_d(e,t,r[t])}))}return e}function _d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Md=1;const Vd=e=>{const t=Ld({},e,{style:Ld({},e.theme.style,e.style),innerStyle:Ld({},e.theme.innerStyle,e.innerStyle),reactVirtualizedListProps:Ld({},e.theme.reactVirtualizedListProps,e.reactVirtualizedListProps)}),r={nodeContentRenderer:bd,placeholderRenderer:Od,rowHeight:62,scaffoldBlockPxWidth:44,slideRegionSize:100,treeNodeRenderer:$p};return Object.keys(r).forEach((n=>{null===e[n]&&(t[n]=void 0!==e.theme[n]?e.theme[n]:r[n])})),t};class Bd extends s.Component{constructor(e){super(e);const{dndType:t,nodeContentRenderer:r,treeNodeRenderer:n,isVirtualized:a,slideRegionSize:l}=Vd(e);this.dndManager=new jd(this),this.treeId=`rst__${Md}`,Md+=1,this.dndType=t||this.treeId,this.nodeContentRenderer=this.dndManager.wrapSource(r),this.treePlaceholderRenderer=this.dndManager.wrapPlaceholder(Ed),this.treeNodeRenderer=this.dndManager.wrapTarget(n),a&&(this.scrollZoneVirtualList=(Up._t||Up.ZP)(Bp.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(){Bd.loadLazyChildren(this.props);const e=Bd.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,Bd.search(e,t,!0,!0,!0)):Object.assign(n,Bd.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&&td({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}=ld({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=ad({treeData:e,path:t,newNode:e=>{let{node:t}=e;return Ld({},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,Bd.loadLazyChildren(this.props),Object.assign(a,Bd.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=Ld({},n,{treeData:this.props.treeData}),this.setState(a))}}componentWillUnmount(){this.clearMonitorSubscription()}getRows(e){return Sd({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=ad({treeData:n.treeData,path:r,newNode:e=>{let{node:t}=e;return Ld({},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}=id({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}=pd({getNodeKey:o,treeData:p?nd({treeData:d.treeData,expanded:!1}):d.treeData,searchQuery:s,searchMethod:c||Dd,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}=ld({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=Td({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:ad({treeData:i,path:c,newNode:e=>{let{node:t}=e;return Ld({},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=ad({treeData:t.treeData,path:n,newNode:e=>{let{node:t}=e;return Ld({},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){td({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(ad({treeData:e.treeData,path:n,newNode:e=>{let{node:n}=e;return n===r?Ld({},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}=Vd(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,Zd({style:n,key:w,listIndex:r,getPrevRow:a,lowerSiblingCounts:m,swapFrom:o,swapLength:s,swapDepth:i},N),c().createElement(v,Zd({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}=Vd(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=Td({treeData:f,newNode:m,depth:g,minimumTreeIndex:h,expandParent:!0,getNodeKey:s}),t=h;x=e.treeIndex,E=1+kd({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=Ld({height:"100%"},C);const t=this.scrollZoneVirtualList;O=c().createElement(Bp.qj,null,(r=>{let{height:l,width:o}=r;return c().createElement(t,Zd({},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:Hp("rst__tree",r,b),style:C},O)}}Bd.propTypes={classes:U().object,dragDropManager:U().shape({getMonitor:U().func}).isRequired,treeData:U().arrayOf(U().object).isRequired,style:U().shape({}),className:U().string,innerStyle:U().shape({}),rowHeight:U().oneOfType([U().number,U().func]),slideRegionSize:U().number,reactVirtualizedListProps:U().shape({}),scaffoldBlockPxWidth:U().number,maxDepth:U().number,searchMethod:U().func,searchQuery:U().any,searchFocusOffset:U().number,searchFinishCallback:U().func,generateNodeProps:U().func,isVirtualized:U().bool,treeNodeRenderer:U().func,nodeContentRenderer:U().func,placeholderRenderer:U().func,theme:U().shape({style:U().shape({}),innerStyle:U().shape({}),reactVirtualizedListProps:U().shape({}),scaffoldBlockPxWidth:U().number,slideRegionSize:U().number,rowHeight:U().oneOfType([U().number,U().func]),treeNodeRenderer:U().func,nodeContentRenderer:U().func,placeholderRenderer:U().func}),getNodeKey:U().func,onChange:U().func.isRequired,onMoveNode:U().func,canDrag:U().oneOfType([U().func,U().bool]),canDrop:U().func,canNodeHaveChildren:U().func,shouldCopyOnOutsideDrop:U().oneOfType([U().func,U().bool]),onVisibilityToggle:U().func,dndType:U().string,onDragStateChanged:U().func,onlyExpandSearchedNodes:U().bool,rowDirection:U().string,onLazyLoadChildren:U().func,ignoreTreeChanges:U().bool},Bd.defaultProps={canDrag:!0,canDrop:null,canNodeHaveChildren:()=>!0,className:"",dndType:null,generateNodeProps:null,getNodeKey:Nd,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,zp.polyfill)(Bd);const Ud=(0,Fp.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"}})))(Bd),zd=e=>c().createElement(Sn.DndContext.Consumer,null,(t=>{let{dragDropManager:r}=t;return void 0===r?null:c().createElement(Ud,Zd({},e,{dragDropManager:r}))})),Fd=e=>c().createElement(Sn.DndProvider,{backend:kn.default},c().createElement(zd,e));var Hd=r(17822),Wd=r(31396);const qd=(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%"}}}}}))),Gd=e=>"horizontal"===e,$d=e=>{let{className:t,children:r,orientation:n,defaultSize:a,size:l,minSize:o,maxSize:i,allowResize:p,onChange:d}=e;const m=qd(),g=(0,Oc.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=()=>Gd(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(Gd(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(Wd.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))},Yd=U().oneOfType([U().number,U().string]);$d.propTypes={className:U().string,children:U().arrayOf(U().node).isRequired,orientation:U().oneOf(["horizontal","vertical"]).isRequired,defaultSize:Yd,size:Yd,minSize:Yd,maxSize:Yd,allowResize:U().bool,onChange:U().func};const Kd=$d;var Xd=r(15311);function Qd(){return Qd=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},Qd.apply(this,arguments)}function Jd(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){em(e,t,r[t])}))}return e}function em(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tm=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,Xd.y)({});return c().createElement(Vr.Z,Qd({classes:Jd({},t,{focused:n.white})},r))};var rm=r(72654);function nm(){return nm=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},nm.apply(this,arguments)}const am=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=Mr({containerWidth:l,containerHeight:o});return c().createElement("div",{className:p.root},u,c().createElement(Ye.Z,{open:t,onClose:a,anchorEl:r,placement:"bottom-start",transition:!0},(e=>{let{TransitionProps:t}=e;return c().createElement(rm.Z,t,c().createElement(Ge.Z,nm({elevation:2},i),c().createElement("div",{className:b()(d.container,n),style:{width:l}},c().createElement("div",{className:d.list},s))))})))};am.propTypes={open:U().bool,anchorEl:U().object,className:U().string,onClose:U().func,containerWidth:U().number,containerHeight:U().number,paperProps:U().object,listContent:U().element,externalInputField:U().element,classes:U().shape({root:U().string})},am.defaultProps={popoverAnchorOrigin:{vertical:"top",horizontal:"right"}};const lm=am,om=(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%"}}),im=e=>{let{value:t,onChange:r,options:n,classes:a={},emptyLabel:l}=e;const o=om(),[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(kc.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)}))};im.propTypes={value:U().string,onChange:U().func,options:U().arrayOf(U().shape({value:U().string,label:U().string})),classes:U().shape({root:U().string,onlyValue:U().string,select:U().string,selectMenu:U().string,textField:U().string}),emptyLabel:U().string};const sm=im,cm=(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,rt.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 um(){return um=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},um.apply(this,arguments)}const pm=e=>{let{buttonsProps:t,activeIndexId:r,className:n,onButtonClick:a}=e;const l=cm();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(ye.k,um({},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}`}))})))};function dm(){return dm=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},dm.apply(this,arguments)}const mm=e=>c().createElement("svg",dm({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),c().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),c().createElement("mask",{id:"AttributesList_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},c().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),c().createElement("g",{mask:"url(#AttributesList_svg__a)"},c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#AttributesList_svg__b)"}),c().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M187.761 56.865l58.639 58.639v148.871H93.383L52 225.083V56.865h135.761z",fill:"url(#AttributesList_svg__c)"}),c().createElement("path",{opacity:.06,fillRule:"evenodd",clipRule:"evenodd",d:"M47 58h202a7 7 0 017 7v157a7 7 0 01-7 7H47a7 7 0 01-7-7V65a7 7 0 017-7z",fill:"#000"}),c().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50 56h201a5 5 0 015 5v157a5 5 0 01-5 5H50a5 5 0 01-5-5V61a5 5 0 015-5z",fill:"#fff"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 72.635a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 84.635a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 163a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 175a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 193a3 3 0 013-3H190a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 205a3 3 0 013-3h74.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 103a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 115a3 3 0 013-3h64.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),c().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),c().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),c().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 133a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 145a3 3 0 013-3h74.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M92.514 108v-8h-2v40.365h11.178v-2h-9.178V110h9.178v-2h-9.178z",fill:"#2B98F0"}),c().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),c().createElement("path",{opacity:.6,fillRule:"evenodd",clipRule:"evenodd",d:"M50 22h186a6 6 0 016 6v18a6 6 0 01-6 6H50a6 6 0 01-6-6V28a6 6 0 016-6z",fill:"#fff"}),c().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M58 37a6 6 0 016-6h70a6 6 0 110 12H64a6 6 0 01-6-6zm90 0a6 6 0 016-6h10a6 6 0 110 12h-10a6 6 0 01-6-6z",fill:"#979797"})),c().createElement("defs",null,c().createElement("linearGradient",{id:"AttributesList_svg__b",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},c().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),c().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),c().createElement("linearGradient",{id:"AttributesList_svg__c",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},c().createElement("stop",{stopOpacity:.01}),c().createElement("stop",{offset:1})))),gm=(0,T.Z)((e=>({root:{display:"flex",flex:"1 1 auto",flexWrap:"nowrap",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"auto",height:"100%",minHeight:"350px",boxSizing:"border-box",padding:"40px"},logo:{width:"190px",height:"190px"},textBox:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:400,marginTop:"24px"},text:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"23px",textAlign:"center"},secondaryText:{color:e.palette.text.primary,fontSize:"14px",fontWeight:"normal",lineHeight:"16px",letterSpacing:"0.24px",textAlign:"center",paddingTop:"8px"}}))),hm=e=>{let{IconRenderer:t=mm,text:r,secondaryText:n}=e;const a=gm();return c().createElement("div",{className:a.root},c().createElement(t,{className:a.logo}),c().createElement("div",{className:a.textBox},c().createElement(v.Z,{className:a.text},r),n&&c().createElement(v.Z,{className:a.secondaryText},n)))},fm=(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})}}))),bm=e=>{let{width:t,open:r,children:n}=e;const a=fm();return c().createElement("div",{className:a.contentWrapper,style:{width:`${r?t:0}px`}},r&&c().createElement(c().Fragment,null,n))},ym=(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"}}),xm=e=>{let{onClose:t,mainTitle:r,secondTitle:n,content:a,rightContent:l}=e;const o=ym();return c().createElement("div",{className:o.container},c().createElement(ye.k,{size:"S",icon:Wn.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(Zr.Z,{orientation:"vertical",flexItem:!0,className:o.divider}),c().createElement(v.Z,{variant:"body1",color:"textSecondary",className:o.secondTitle},n),l))},Em=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(Pi,{className:r,avatarText:a[0],icon:l?(0,u.vPL)("https://s3.amazonaws.com/reltio.images/api",l):null,variant:"square"})};var vm=r(79935);const wm=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"}})};wm.propTypes={height:U().number,margin:U().number};const Om=wm,Cm=e=>{let{label:t}=e;return t||null},Tm=e=>{let{value:t}=e;return t||null},Sm=e=>{let{className:t,rowsData:r,columnsData:n,theadRowsNumber:a=0}=e;const l=e=>{const t=e.cellRenderer||Tm,r=e.headCellRenderer||Cm;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)))};Sm.propTypes={rowsData:U().arrayOf(U().shape({id:U().string,label:U().string,headCellRenderer:U().func,cellRenderer:U().func})),columnsData:U().arrayOf(U().object),theadRowsNumber:U().number,className:U().string};const km=(0,s.memo)(Sm);var Nm=r(83543);const Im=(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)"}}))),Pm=e=>{let{active:t,onClick:r,className:n}=e;const a=Im();return c().createElement(he.Z,{className:b()(a.viewMoreLessLink,n),onClick:r,underline:"none"},c().createElement(Nm.Z,{className:b()(a.arrow,{[a.rotated]:t})}),t?x().text("View less"):x().text("View more"))};Pm.propTypes={active:U().bool,onClick:U().func,className:U().string};const Dm=Pm;var Rm=r(29611),Am=r(50581),jm=r(21853);const Zm=(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"}}),Lm=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=Zm(),u=n&&n.length;return l?c().createElement(Rm.Z,{className:i.input,value:n,autoFocus:!0,placeholder:x().text("Search"),disableUnderline:!0,onChange:(0,N.pipe)(On.NA,a),startAdornment:c().createElement(Am.Z,{position:"start"},c().createElement(jm.Z,{className:i.startAdornment})),endAdornment:c().createElement(Am.Z,{position:"end"},u&&c().createElement(_t.Z,{size:"S",icon:Wn.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(Xa.Z,{className:i.searchButton,onClick:(0,N.pipe)(N.T,o)},c().createElement(jm.Z,null))};var _m,Mm=r(7907);!function(e){e.READING="READING",e.HOVERED="HOVERED",e.EDITING="EDITING"}(_m||(_m={}));const Vm=()=>{const[e,t]=(0,s.useState)(null),r=e===_m.READING,n=e===_m.EDITING,a=e===_m.HOVERED;(0,s.useEffect)((()=>{t(_m.READING)}),[]);const l=(0,s.useCallback)((0,u.DsO)(t,50),[]),o=(0,s.useCallback)((()=>{n||l(_m.HOVERED)}),[l,n]),i=(0,s.useCallback)((()=>{n||l(_m.READING)}),[l,n]);return{setReadingMode:(0,s.useCallback)((()=>t(_m.READING)),[t]),setEditingMode:(0,s.useCallback)((()=>t(_m.EDITING)),[t]),onMouseLeave:i,onMouseEnter:o,isReadingMode:r,isEditingMode:n,isHovered:a}};const Bm=(0,s.createContext)(null),Um=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(Bm.Provider,{value:r},t)},zm=e=>{const{getCrosswalkColor:t=(0,N.pipe)(u.uKF,u.CJp)}=(0,s.useContext)(Bm)||{};return e?t(e):""},Fm=()=>{const{highlightedCrosswalks:e=[]}=(0,s.useContext)(Bm)||{};return e},Hm=e=>{const{highlightedCrosswalks:t=[],setCrosswalkHighlighted:r=On.ZT}=(0,s.useContext)(Bm)||{},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])}},Wm=e=>{const{toggleCrosswalkFocus:t=On.ZT,focusedCrosswalks:r=[]}=(0,s.useContext)(Bm)||{};return{isFocused:!!e&&r.some((0,N.eqBy)(u.uKF,e)),toggleCrosswalkFocus:(0,s.useCallback)((()=>t(e)),[e,t])}};var qm=r(72753);const Gm=(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"}}}),$m=(0,T.Z)((()=>({label:{fontSize:"13px",lineHeight:"15px",letterSpacing:"normal",marginLeft:"2px",marginRight:"8px"}}))),Ym=e=>{let{crosswalk:t,color:r,className:n,focusable:a=!1}=e;const{toggleCrosswalkFocus:l,isFocused:o}=Wm(t),i=Gm({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(Em,{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(ye.k,{icon:qm.Z,className:i.eyeIcon,size:"XXS",tooltipTitle:x().text("Focus"),onClick:()=>l()})),c().createElement("div",{className:i.crosswalkValue},t.value)))},Km=(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 Xm(){return Xm=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},Xm.apply(this,arguments)}const Qm=e=>{const t=Km();return c().createElement(le.ZP,Xm({},e,{classes:t,arrow:!0}))},Jm=e=>{let{crosswalk:t,className:r}=e;const n=zm(t),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Hm(t),i=Gm({isOpaque:!a,color:n});return c().createElement(Qm,{title:c().createElement(Ym,{crosswalk:t,color:n}),placement:"top"},c().createElement("div",{className:b()(i.crosswalkIcon,r),onMouseEnter:()=>l(),onMouseLeave:()=>o()}))};var eg=r(27604);const tg=(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 rg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ng=[u.oS0.TYPE_TEXT,u.oS0.TYPE_BLOB],ag=e=>{let{attributeType:t,attributeValue:r,color:n,containerRef:a,onClose:l,onEdit:o}=e;const i=tg({color:n,containerWidth:a.current?a.current.getBoundingClientRect().width:0}),p=(0,u.PFL)(t),d=ca(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=ua(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){rg(e,t,r[t])}))}return e}({},r,n))}l()};return c().createElement(_r.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||ng.includes(p.type)?"Escape"===e.key&&l():f()},onBackdropClick:f},c().createElement(aa.Z,{autoFocus:!0,dataTypeDefinition:p,fieldName:(0,u.Tde)(t.uri),onChange:g,TextFieldProps:h,value:m,fullWidth:!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:"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 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:"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})),cg=e=>{let{isIgnored:t,onClick:r,disabled:n}=e;return c().createElement(ye.k,{disabled:n,showForDisabled:!0,icon:t?og:sg,tooltipTitle:n?x().text("You don't have permissions to ignore"):x().text("Ignore"),onClick:r,size:"XS",disableRipple:!0})};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 pg=e=>c().createElement("svg",ug({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 dg(){return dg=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},dg.apply(this,arguments)}const mg=e=>c().createElement("svg",dg({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})),gg=e=>{let{isPinned:t,onClick:r,disabled:n}=e;return c().createElement(ye.k,{disabled:n,showForDisabled:!0,onClick:r,icon:t?pg:mg,tooltipTitle:n?"You don't have permissions to pin":x().text("Pin"),size:"XS",disableRipple:!0})},hg=(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"}}))),fg=(0,lt.Z)(Va.Z),bg=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))},yg=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=(()=>{})}=e;const a=hg(),{disabled:l,text:o,tooltip:i,onClick:s,id:u="",icon:p,crosswalk:d,color:m}=r;return d?c().createElement(Ym,{className:a.sourceItem,color:m,crosswalk:d,focusable:!0}):c().createElement(fg,{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(bg,{icon:p,text:o,styles:a}))}));yg.displayName="CrosswalkMenuItem";const xg=yg;function Eg(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vg=(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){Eg(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"}}))),wg=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}=Vm(),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),R=!P&&(!h&&N||a.ignored),A=zm(l),{isHighlighted:j,isDimmed:Z,highlightCrosswalk:L,removeHighlight:_}=Hm(l),M=vg({variant:S?"outlined":"filled",opaque:!Z,fullyColored:j,color:A}),V=[{crosswalk:l,color:A},{disabled:!N,text:x().text("Edit"),icon:c().createElement(eg.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(ra.Z,null),tooltip:I?null:x().text("You don't have permissions to delete"),onClick:()=>g({attributeType:n,attributeValue:a,crosswalks:[l]}),id:"delete"}],B=()=>{_(),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(at.Z,{value:(0,u.kDl)(a),dataTypeDefinition:(0,u.PFL)(n)})),c().createElement("div",{className:M.actions},D&&c().createElement(gg,{isPinned:a.pin,onClick:()=>m({attributeValue:a}),disabled:!N}),R&&c().createElement(cg,{isIgnored:a.ignored,onClick:()=>p({attributeValue:a}),disabled:!N}),y&&c().createElement(be.Z,{MenuItemRenderer:xg,menuId:`simple-attribute-additional-actions-${T}`,buttonComponent:ye.k,buttonProps:{icon:fe.Z,size:"XS",tooltipTitle:x().text("More actions")},onMenuClose:B,menuItems:V})),f&&c().createElement(ag,{attributeType:n,attributeValue:a,color:A,onClose:B,onEdit:e=>d({attributeType:n,attributeValue:e,crosswalk:l}),containerRef:C}))},Og=(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 Cg(){return Cg=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},Cg.apply(this,arguments)}const Tg=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=Og(),[{isDragItemOver:p},d]=(0,Sn.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(wg,Cg({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 Sg(){return Sg=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},Sg.apply(this,arguments)}const kg=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(Le.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(eh,Sg({key:e.uri,attributeValue:e,attributeType:n,onAdd:a,disableEdit:o},i)))))},Ng=e=>{let{children:t}=e;const r=$m();return c().createElement(v.Z,{component:"span",variant:"body2",classes:{body2:r.label}},t)},Ig=(0,T.Z)((e=>({label:{color:e.palette.primary.main,textDecoration:"none"},relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary}})));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=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(),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),o=(0,g.useSelector)(h.ZP.selectors.getUIPath),i=c().createElement(Ng,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(Qg,Pg({attributeValue:t,attributeType:r,attributeTypesList:s,label:i},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 Ag=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(Dg,Rg({key:e.uri,attributeValue:e},n)))))},jg=(0,T.Z)((()=>({image:{borderRadius:"4px",background:"white",display:"inline-block",verticalAlign:"middle"},imageContainer:{display:"inline",lineHeight:"45px",paddingRight:"8px"}})));function Zg(){return Zg=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},Zg.apply(this,arguments)}const Lg={imageWidth:55,imageHeight:45},_g=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=jg();return c().createElement(Qg,Zg({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:c().createElement(vr,{containerClassName:a.imageContainer,className:a.image,src:(0,u.Ysv)(t),size:Lg})},n))};function Mg(){return Mg=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},Mg.apply(this,arguments)}const Vg=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(_g,Mg({key:e.uri,attributeValue:e},n)))))},Bg=(0,T.Z)((()=>({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start"},complexAttributesWrapper:{width:"100%"}})));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)}function zg(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 Fg=e=>{let{attributeType:t,attributeValues:r=[],paging:n={},max:a=1/0,requestNextPage:l}=e,o=zg(e,["attributeType","attributeValues","paging","max","requestNextPage"]);const i=Bg(),[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(kg,Ug({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));case u.oS0.TYPE_REFERENCE:{const{crosswalksMap:r}=o,n=zg(o,["crosswalksMap"]);return c().createElement(Ag,Ug({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t,crosswalksMap:r},n))}case u.oS0.TYPE_IMAGE:return c().createElement(Vg,Ug({className:i.complexAttributesWrapper,attributeValues:e,attributeType:t},o));default:return c().createElement(Tg,Ug({attributeValues:e,attributeType:t},o))}})(b),h&&c().createElement(sr,{moreNumber:Math.min(a,y),valueNumber:y,onClick:()=>{r.length<m&&l(),d(p+a)}}),f&&c().createElement(ur,{onClick:()=>{d(a)}}))},Hg=(0,T.Z)((e=>({title:{fontSize:"12px",lineHeight:"14px",paddingBottom:"4px",display:"inline-block",color:e.palette.text.secondary}})));function Wg(){return Wg=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},Wg.apply(this,arguments)}const qg=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=Hg();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(Fg,Wg({attributeType:e,attributeValues:r[e.name],paging:(0,N.path)(["paging",e.uri],r)},n))))))},Gg=e=>{let{onClick:t}=e;return c().createElement(ye.k,{icon:ra.Z,tooltipTitle:x().text("Delete"),onClick:t,size:"XS",disableRipple:!0})},$g=(0,s.createContext)(null),Yg=e=>{let{children:t,attributeUris:r}=e;return c().createElement($g.Provider,{value:r},t)},Kg=e=>((0,s.useContext)($g)||[]).some((t=>(0,u.sOy)(t,e))),Xg=(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"}}}))),Qg=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=Xg(),{isReadingMode:b,onMouseEnter:y,onMouseLeave:x}=Vm(),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=Kg(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(Jm,{key:(0,u.uKF)(e),crosswalk:e,className:f.crosswalkIcon})))),c().createElement(vm.Z,null),c().createElement("div",{className:f.actions},O&&c().createElement(gg,{disabled:!E,isPinned:r.pin,onClick:()=>p({attributeValue:r})}),C&&c().createElement(cg,{disabled:!E,isIgnored:r.ignored,onClick:()=>d({attributeValue:r})}),T&&c().createElement(Gg,{onClick:()=>m({attributeType:t,attributeValue:r,crosswalks:l[r.uri]})}))),k&&c().createElement(qg,{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 Jg(){return Jg=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},Jg.apply(this,arguments)}const eh=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(Ng,null,(0,u.idV)(null==t?void 0:t.label));return c().createElement(Qg,Jg({attributeValue:t,attributeType:r,attributeTypesList:r.attributes,label:a},n))};var th=r(33286),rh=r(49429),nh=r(55999),ah=r(79249);const lh=(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"}}),oh=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=lh();return c().createElement(Nn.Z,{open:t,onClose:a,classes:{paperScrollPaper:d.paper}},c().createElement(ah.Z,{classes:{root:d.title}},r),c().createElement(po.Z,{classes:{root:d.content}},c().createElement(nh.Z,{classes:{root:d.contentText}},n)),c().createElement(rh.Z,{className:d.actionButtons,disableSpacing:!0},a&&c().createElement(Le.Z,{onClick:a},l),c().createElement("div",null,o&&c().createElement(Le.Z,{onClick:o,classes:{root:d.discardButton}},i),c().createElement(Le.Z,{onClick:s,color:"primary",disabled:p,autoFocus:!0},u))))},ih=e=>{let{open:t,onClose:r,onConfirm:n}=e;return c().createElement(Nn.Z,{open:t},c().createElement(po.Z,null,c().createElement(nh.Z,null,x().text("Are you sure you want to delete this?"))),c().createElement(rh.Z,null,c().createElement(Le.Z,{onClick:r,color:"primary"},x().text("No")),c().createElement(Le.Z,{onClick:()=>{n(),r()},color:"primary"},x().text("Yes"))))};var sh=r(92332);const ch=(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}}))),uh=e=>{const t=ch();return c().createElement("div",{className:b()(t.headCell,t.coloredCell)},c().createElement(sh.default,e),e.children)},ph=(0,T.Z)({root:{marginBottom:"-6px"}}),dh=(0,Ri.Z)((0,N.pick)(["parentUri","parentTypeUri","onAdd","selectedAttributeTypes","onSelectAttributeTypes"]))((e=>{let{parentTypeUri:t,parentUri:r,selectedAttributeTypes:n,onSelectAttributeTypes:a,onAdd:l}=e;const o=ph(),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(en,{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 mh=(0,Ri.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(uh,r):c().createElement(uh,r,c().createElement(vm.Z,null),c().createElement(dh,null))})),gh=e=>{let{value:t}=e;const r=ch();return c().createElement("div",{className:r.cellValueWrapper},t)},hh=(0,T.Z)((()=>({simpleAttributeWrapper:{padding:"15px"},complexAttributeWrapper:{padding:"15px","& + &":{borderTop:"1px solid rgba(0,0,0,.1)"}}})));function fh(){return fh=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},fh.apply(this,arguments)}const bh=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=hh();return c().createElement("div",{className:n.simpleAttributeWrapper},c().createElement(Fg,fh({attributeValues:t},r)))};function yh(){return yh=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},yh.apply(this,arguments)}const xh=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=hh(),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(eh,yh({attributeValue:e},r)))));return c().createElement(c().Fragment,null,a)};function Eh(){return Eh=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},Eh.apply(this,arguments)}const vh=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=hh(),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(Dg,Eh({attributeValue:e,crosswalksMap:r},n)))));return c().createElement(c().Fragment,null,l)};function wh(){return wh=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},wh.apply(this,arguments)}const Oh=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=hh();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(_g,wh({attributeValue:e},r))))))};function Ch(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Th=(0,Ri.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(xh,t);case u.oS0.TYPE_REFERENCE:return c().createElement(vh,t);case u.oS0.TYPE_IMAGE:return c().createElement(Oh,t);default:return c().createElement(bh,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){Ch(e,t,r[t])}))}return e}({},t,{parentUri:i,onDelete:r,onEdit:n,onPin:a,onIgnore:l,onAdd:o,disableEdit:s,disableDelete:s}))})),Sh=e=>{let{value:{values:t,attributeType:r}}=e;const n=ch();return c().createElement("div",{className:n.cellValueWrapper},c().createElement(Q,{className:n.attributeTitle,label:r.label,attributeType:r}),c().createElement(Si,{values:t,attributeType:r,valueContainerClassName:n.ovValue}))},kh=e=>{let{value:t}=e;const r=ch();return c().createElement("div",{className:b()(r.cellValueWrapper,r.count)},t)};var Nh=r(11776),Ih=r(38402),Ph=r(49378),Dh=r(99144);const Rh=e=>{let{sourcesUriOrder:t}=e;const r=ch(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata);return c().createElement(c().Fragment,null,t.map((e=>c().createElement(Ih.Z,{key:e,className:r.popupItem},c().createElement(Em,{className:r.sourceIcon,sourceType:e}),c().createElement(Ph.Z,{primary:(0,u.tH7)(n,e),primaryTypographyProps:{variant:"body2"}})))))},Ah=e=>{let{attributeUri:t}=e;const r=ch(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),a=(0,u.zeJ)(n,t);return c().createElement(Ih.Z,{key:a.uri,className:r.popupItem},c().createElement(Ph.Z,{primary:(0,u.idV)(a.label),primaryTypographyProps:{variant:"body2"}}))},jh=(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")]]),Zh=(0,N.cond)([[(0,N.prop)("sourcesUriOrder"),e=>{let{sourcesUriOrder:t}=e;return c().createElement(Rh,{sourcesUriOrder:t})}],[(0,N.prop)("primaryAttributeUri"),e=>{let{primaryAttributeUri:t}=e;return c().createElement(Ah,{attributeUri:t})}],[(0,N.prop)("comparisonAttributeUri"),e=>{let{comparisonAttributeUri:t}=e;return c().createElement(Ah,{attributeUri:t})}]]),Lh=e=>{let{info:t}=e;const r=ch(),[n,a]=(0,s.useState)(null),l=()=>a(null);return c().createElement(c().Fragment,null,c().createElement(ye.k,{icon:Dh.Z,tooltipTitle:x().text("View details"),size:"XS",onClick:e=>a(e.currentTarget)}),c().createElement(_r.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(Xa.Z,{className:r.closeButton,onClick:l},c().createElement(Wn.default,null)),c().createElement(v.Z,{variant:"subtitle1",className:r.popupTitle},jh(t))),c().createElement(Nh.Z,{component:"div",className:r.popupItemsWrapper},Zh(t))))},_h=e=>{let{value:{ruleType:t,sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}=e;const l=ch(),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(Lh,{info:{sourcesUriOrder:r,primaryAttributeUri:n,comparisonAttributeUri:a}}))};function Mh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vh=(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){Mh(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 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 Uh=(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=Vh({color:r,opacity:n,variant:a});return c().createElement("div",Bh({ref:t,className:b()(s.item,o)},i),l)})),zh=e=>{let{crosswalk:t}=e;const r=ch(),n=(0,g.useSelector)(h.ZP.selectors.getMetadata),{isDimmed:a,highlightCrosswalk:l,removeHighlight:o}=Hm(t);return c().createElement(Uh,{className:r.winnerSourceItem,color:(0,u.CJp)((0,u.uKF)(t)),opacity:a?.38:1,onMouseEnter:()=>l(),onMouseLeave:()=>o()},c().createElement(Em,{className:r.sourceIcon,sourceType:t.type}),c().createElement(Ph.Z,{primary:(0,u.tH7)(n,t.type),primaryTypographyProps:{variant:"body2"},classes:{primary:r.winnerSourceItemLabel}}))},Fh=e=>{let{value:{crosswalks:t}}=e;const r=ch();return c().createElement(Nh.Z,{component:"div"},t.map((e=>c().createElement(Ih.Z,{key:e.uri,className:r.winnerSourceItemWrapper},c().createElement(zh,{crosswalk:e})))))},Hh=[{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}],Wh=e=>(0,u.OXP)(e)&&!(0,u.ZiX)(e.uri),qh=["ovValues","ruleType","values"],Gh=e=>{switch(e){case"ovValues":return Sh;case"values":return Th;case"count":return kh;case"ruleType":return _h;case"winnerSources":return Fh;default:return gh}},$h=(0,N.pipe)(u.cwx,(0,N.sortWith)([(0,N.descend)((0,N.propOr)(-1,"priority"))]),(0,N.map)((0,N.prop)("uri"))),Yh=(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)),Kh=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)(Wh),(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||Wh(l))})),N.values,N.flatten)(t))),(0,N.uniqBy)((0,N.prop)("uri")))(e)},Xh=(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?mh:uh,rowCellValueRenderer:Gh(t)}})),Qh=(e,t,r,n,a,l)=>{switch(e){case"ovValues":return{attributeType:n,values:null==l?void 0:l.filter(Wh)};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)||[],...$h(e)]):void 0,p=Yh(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:Kh(l,a)};default:return null}};function Jh(){return Jh=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},Jh.apply(this,arguments)}const ef=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=ch(),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,Jh({key:t,value:e},l)))))};var tf=r(44962),rf=r(2682),nf=r(84899);const af=e=>{let{open:t,onClose:r,onConfirmEditWithoutIgnore:n,onConfirmEditWithIgnore:a}=e;const[l,o]=(0,s.useState)("without");return c().createElement(Nn.Z,{open:t,onEnter:()=>o("without")},c().createElement(po.Z,null,c().createElement(nh.Z,null,x().text("You are attempting to change a value that is presently ignored.")),c().createElement(la.Z,{component:"fieldset"},c().createElement(nf.Z,{component:"legend"},x().text("Please choose an option:")),c().createElement(rf.Z,{value:l,onChange:(0,N.pipe)(On.NA,o)},c().createElement(Rr.Z,{value:"without",control:c().createElement(tf.Z,null),label:x().text("Save without Ignore")}),c().createElement(Rr.Z,{value:"with",control:c().createElement(tf.Z,null),label:x().text("Save and apply Ignore to new value")})))),c().createElement(rh.Z,null,c().createElement(Le.Z,{onClick:r,color:"primary"},x().text("Cancel")),c().createElement(Le.Z,{onClick:()=>{"with"===l?a():n(),r()},color:"primary"},x().text("Ok"))))},lf=(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 of(){return of=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},of.apply(this,arguments)}const sf=(0,s.memo)((e=>{let{entity:t,isLoading:r,crosswalksMap:n,visibleColumns:a=qh,onChangeVisibleColumns:l,readOnly:o,onDelete:i=On.ZT,onPin:p=On.ZT,onIgnore:d=On.ZT,onEdit:m=On.ZT,onAdd:f=On.ZT,selectedAttributeTypes:b,onSelectAttributeTypes:y=On.ZT}=e;const E=lf(),v=(0,s.useMemo)((()=>(0,N.pipe)((0,N.filter)((e=>{let{id:t}=e;return a.includes(t)})),Xh)(Hh)),[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,Qh(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}=js(),D=(0,s.useCallback)((e=>c().createElement(Ss,of({onChangeHeight:P},e),c().createElement(ef,e))),[P]),R=(0,s.useCallback)((0,N.either)(I,(0,N.always)(68)),[I]),[A,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(rs,{columnsData:Hh,selectedColumns:a,onChangeColumns:l})),c().createElement("div",{className:E.tableContent},r&&c().createElement(Dn,null),c().createElement(Di.Z,{fixFirstColumn:!0,headRowHeight:48,defaultColumnWidth:250,defaultColumnMinWidth:200,columnsData:v,rowsData:k,renderRowCell:D,getRowCellHeight:R,context:M})),c().createElement(ih,{open:!!A,onClose:()=>j(null),onConfirm:()=>i(A)}),c().createElement(af,{open:!!Z,onClose:()=>L(null),onConfirmEditWithIgnore:()=>m(Z),onConfirmEditWithoutIgnore:()=>{d({attributeValue:Z.attributeValue}),m(Z)}}))}));function cf(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){uf(e,t,r[t])}))}return e}function uf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pf=[],df=e=>{let{entity:t,onLoad:r=On.ZT,onModify:n=On.ZT,onError:a=On.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)(pf),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(pf);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=On.ZT,onError:r=On.ZT,onLoad:n=On.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=>cf({},t,{[e]:cf({},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}},mf=e=>{let{onLoad:t=On.ZT,onSuccess:r=On.ZT,onError:n=On.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])}},gf=(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"}}),hf=e=>{let{crosswalk:t}=e;const r=gf(),n=zm(t),a=(0,g.useSelector)(h.ZP.selectors.getMetadata),l=(0,u.tH7)(a,t.type);return c().createElement(Uh,{color:n,className:r.crosswalkPreview},c().createElement(Em,{className:r.sourceIcon,sourceType:t.type}),c().createElement(v.Z,{className:r.sourceLabel,variant:"body2"},l))},ff=(0,s.memo)((()=>{var e;const t=gf(),{isDragging:r,clientOffset:n,item:a}=(0,Sn.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(hf,{crosswalk:a.crosswalk})))}));let bf;!function(e){e.Simple="simple",e.Empty="empty",e.Dependent="dependent"}(bf||(bf={}));const yf=(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"}}))),xf=(0,s.memo)((e=>{let{crosswalkType:t,focusable:r=!0}=e;const{isDimmed:n}=Hm(),a=yf({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(_t.Z,{size:"XXS",className:a.focusedIcon,icon:r&&qm.Z,disabled:!0}),c().createElement("div",{className:a.wrapper},c().createElement(Em,{className:a.sourceIcon,sourceType:t}),c().createElement(v.Z,{variant:"body2"},o)))}));var Ef=r(19540),vf=r(42484);function wf(){return wf=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},wf.apply(this,arguments)}const Of=e=>c().createElement("svg",wf({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"}))),Cf=(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"}}))),Tf=e=>{let{value:t}=e;const r=Cf();return c().createElement("div",{className:r.root},c().createElement(v.Z,{className:r.text,variant:"body2"},t),c().createElement(_t.Z,{size:"XXS",icon:Of,color:"primary",className:r.button,onClick:()=>navigator.clipboard.writeText(t)}))},Sf=(0,T.Z)((()=>({timestampEditorInput:{paddingTop:15,paddingBottom:15,fontSize:13},timestampEditor:{height:38}}))),kf=e=>{let{value:t,classes:r={},disabled:n=!1,onChange:a}=e;const l=Sf(),[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)}}})},Nf=(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"}}))),If=e=>{let{crosswalk:t,canEditAttribute:r=!0,onEditAttribute:n,onDeleteAttribute:a}=e;const l=Nf(),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(en,{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(Ml.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(Em,{className:l.sourceIcon,sourceType:t}),c().createElement(v.Z,{className:l.text,variant:"body2"},r))}case"sourceTable":return o?c().createElement(Nc.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(Nc.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(Tf,{value:t});case"deleteDate":return c().createElement(kf,{value:t&&rn().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(ye.k,{icon:ra.Z,disabled:!r,onClick:()=>f(e.uri),size:"XS",tooltipTitle:x().text("Delete attribute"),showForDisabled:!0}))):null)),c().createElement(ih,{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}}))},Pf=(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}}),Df=(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=zm(t),{toggleCrosswalkFocus:b,isFocused:y}=Wm(t),E=n?"#FFF":a?f:"#CACCD1",{isDimmed:w,highlightCrosswalk:O,removeHighlight:C}=Hm(t),[T]=Fm(),S=Pf({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),R=(0,u.tH7)(D,t.type),A=(0,u.nIW)(t.uri),j=(0,u.x_)(t),[,Z,L]=(0,Sn.useDrag)({item:{type:"Crosswalk",crosswalk:t},canDrag:!j}),_=!j&&"relation"!==t.ownerType;return(0,s.useEffect)((()=>{L((0,vf.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(ye.k,{size:"XXS",className:S.focusedIcon,icon:l&&qm.Z,onClick:()=>b(),disabled:!l,tooltipTitle:l&&x().text("Focus")}),c().createElement("div",{className:S.crosswalkWrapper},c().createElement(Uh,{ref:Z,className:S.header,color:E,variant:j?"outlined":"filled",onMouseEnter:()=>O(),onMouseLeave:()=>C()},r&&c().createElement(Ef.Z,{className:S.dependentIcon}),c().createElement(Ut,{onClick:()=>N((e=>!e)),expanded:k}),c().createElement(Em,{className:S.sourceIcon,sourceType:t.type}),c().createElement(di.C,{value:R},c().createElement(v.Z,{variant:"body2",noWrap:!0},R)),c().createElement(vm.Z,null),c().createElement(di.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(ye.k,{icon:ra.Z,disabled:i,onClick:()=>P(!0),size:"XS",tooltipTitle:i?x().text("You don't have permissions to delete"):x().text("Delete crosswalk"),showForDisabled:!0}),c().createElement(ih,{open:I,onConfirm:()=>{y&&b(),p(A)},onClose:()=>P(!1)})),c().createElement(If,{crosswalk:t,canEditAttribute:!o,onEditAttribute:(e,t)=>{d({crosswalkId:A,attributeName:e,value:t})},onDeleteAttribute:e=>{d({crosswalkId:A,attributeName:e})}}))))})),Rf=(0,T.Z)((()=>({root:{display:"flex",alignItems:"center",height:"28px",paddingLeft:"37px"}}))),Af=e=>{let{showMore:t,onClick:r}=e;const n=Rf();return c().createElement(he.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")))},jf=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=Fm();return(0,s.useEffect)((()=>{!l&&a&&r[bf.Dependent].some((e=>g.some((0,u.aFF)(e))))&&m()}),[g]),c().createElement(c().Fragment,null,0===r[bf.Simple].length&&0===r[bf.Empty].length&&c().createElement(xf,{crosswalkType:t,focusable:a}),r[bf.Simple].map((e=>c().createElement(Df,{key:e.uri,crosswalk:e,focusable:a,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),r[bf.Empty].map((e=>c().createElement(Df,{key:e.uri,crosswalk:e,focusable:a,isEmpty:!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,isColored:n}))),l&&r[bf.Dependent].map((e=>c().createElement(Df,{key:e.uri,crosswalk:e,isDependent:!0,disableEdit:o,disableDelete:i,onDelete:d,onEdit:p,focusable:a,isColored:n}))),r[bf.Dependent].length>0&&c().createElement(Af,{showMore:!l,onClick:()=>m()}))},Zf=(0,T.Z)({caption:{paddingLeft:15,paddingTop:16,paddingBottom:8},controlButtons:{display:"flex",justifyContent:"flex-end",paddingBottom:10,paddingTop:20},cancelButton:{marginRight:20}}),Lf=e=>{let{className:t,onAdd:r,onClose:n}=e;const a=Zf(),[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(If,{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(Le.Z,{className:a.cancelButton,onClick:n},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",onClick:()=>{r(l),n()},disabled:!l.type||!l.value},x().text("Add"))))},_f=e=>e[bf.Simple].length>0?1:e[bf.Dependent].length>0?e[bf.Empty].length>0?2:3:4,Mf=(0,N.evolve)({[bf.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}))}),Vf=(0,N.curry)(((e,t,r)=>{const n=(r||[]).reduce(((r,n)=>(r[n.type]||(r[n.type]={[bf.Simple]:[],[bf.Empty]:[],[bf.Dependent]:[]}),"relation"===n.ownerType?r[n.type][bf.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][bf.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][bf.Dependent].push(n):r[n.type][bf.Simple].push(n),r)),{});return Object.keys(n).sort(((e,t)=>_f(n[e])-_f(n[t])||(e<t?-1:1))).map((e=>({source:e,crosswalksByTypes:Mf(n[e])})))}));var Bf=r(17871);const Uf=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 zf=r(41039);const Ff="circle",Hf="polygon",Wf=.001;function qf(){return qf=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},qf.apply(this,arguments)}const Gf=e=>c().createElement("svg",qf({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 $f(){return $f=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},$f.apply(this,arguments)}const Yf=e=>c().createElement("svg",$f({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"})))),Kf=(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"}}),Xf=(0,lt.Z)(Le.Z),Qf=e=>{let{drawingMode:t,drawingModes:r=[],hasActiveOverlay:n,onDrawingModeChanged:a,onClearOverlay:l}=e;const o=Kf(),i=e=>()=>{a(e)};return c().createElement("div",{className:o.container},t||n?c().createElement(Xf,{tooltipTitle:x().text("Clear area"),className:o.button,onClick:n?l:i(null)},c().createElement(zf.Z,{className:o.icon})):r.map((e=>{const t=(e=>{switch(e){case Ff:return Gf;case Hf:return Yf;default:return null}})(e);return c().createElement(Xf,{tooltipTitle:x().text("Draw area"),key:e,className:o.button,onClick:i(e)},c().createElement(t,{className:o.icon}))})))},Jf=(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"}}}),eb=e=>{let{isSearchOnMapMove:t,onChangeIsSearchOnMapMove:r}=e;const n=Jf();return c().createElement(Rr.Z,{classes:{root:n.container,label:n.label},control:c().createElement(Dr.Z,{checked:t,onChange:e=>{r(e.target.checked)},color:"primary",className:n.checkbox}),label:x().text("Search as I move the map")})},tb=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]]},rb=e=>{switch(e){case Ff:return window.google.maps.drawing.OverlayType.CIRCLE;case Hf:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},nb=(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)}},ab=c().createContext({});ab.displayName="EntityMarkerContext";const lb=(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 ob(){return ob=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},ob.apply(this,arguments)}const ib=(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>'),sb=(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>'),cb=(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=lb(),l=(0,s.useRef)(),[o,i]=(0,s.useState)(!1),{activeEntityUri:p}=(0,s.useContext)(ab),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(Ye.Z,{anchorEl:l.current,open:o,className:a.popper,modal:!1,placement:"top"},c().createElement(Cp,{entity:t.entity,onMouseOver:h,onMouseOut:f})),c().createElement(Bf.Jx,ob({icon:{url:o||d?ib:sb,scaledSize:new google.maps.Size(22,32)},position:m,onClick:b,visible:!1!==t.visible,onMouseOver:h,onMouseOut:f},n)),c().createElement(Bf.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})))})),ub={CIRCLE:"circle",POLYGON:"polygon"},pb={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},db=.001,mb=(0,T.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});var gb=r(90690);function hb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fb=["drawing"],bb=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=mb(),{isLoaded:E,loadError:v}=(0,Bf.Ji)({googleMapsApiKey:r,libraries:fb}),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,gb.D)(t),o=(0,gb.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()+Wf,e.lng()+Wf)),n.extend(new window.google.maps.LatLng(e.lat()-Wf,e.lng()-Wf))}t.fitBounds(n),r&&nb(t,r,n)})(t,a,r):i&&r&&r!==o&&nb(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){hb(e,t,r[t])}))}return e}({},pb,p||{})),[p]),D=(0,s.useCallback)((e=>{f(e?tb(O):null),I(null),clearTimeout(w.current)}),[O,f]),R=(0,s.useCallback)((()=>{clearTimeout(w.current)}),[]),A=(0,s.useCallback)((()=>{o&&f(tb(O))}),[o,O,f]),j=(0,s.useCallback)((()=>{o&&(clearTimeout(w.current),w.current=setTimeout(A,1e3))}),[A,o]),Z=(0,s.useCallback)(((e,t)=>{const r=t||T&&{type:ub.POLYGON,overlay:T};if(!(0,N.isEmpty)(r)&&"function"==typeof b){const{overlay:e,type:t}=r,n={[ub.POLYGON]:()=>e.getPath().getArray().map((e=>[e.lat(),e.lng()])),[ub.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(cb,{key:t.id,marker:t,clusterer:e,onClick:y})));return v?null:E?c().createElement(Bf.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:{mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},onLoad:C,zoom:n,center:a,onZoomChanged:R,onDragStart:R,onIdle:j,mapContainerClassName:h},O&&i&&Boolean(d.length)&&c().createElement(Uf,{className:x.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:O},c().createElement(Qf,{hasActiveOverlay:!!u,drawingModes:d,drawingMode:k,onDrawingModeChanged:I,onClearOverlay:_})),O&&i&&c().createElement(Uf,{className:x.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:O},c().createElement(eb,{onChangeIsSearchOnMapMove:D,isSearchOnMapMove:o})),m?(V=g,c().createElement(Bf.XL,{options:V},M)):M(),!rb(k)&&u&&(0,N.propEq)("type",ub.POLYGON,u)&&c().createElement(Bf.mg,{onLoad:S,path:u.path,editable:!0,options:P,onMouseUp:Z,onDragEnd:Z}),i&&Boolean(d.length)&&c().createElement(Bf.j_,{onPolygonComplete:L(ub.POLYGON),onCircleComplete:L(ub.CIRCLE),drawingMode:rb(k),options:{drawingControl:!1,circleOptions:P,polygonOptions:P}})):l;var V},yb=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,ze._)(),{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 xb;!function(e){e.UPDATE="UPDATE",e.MERGE="MERGE",e.UNMERGE="UNMERGE"}(xb||(xb={}));var Eb=r(39034);const vb=e=>(0,N.pipe)((0,N.map)(e),(0,N.join)(" or ")),wb=e=>{const[t,r]=e;return rn()().subtract(t,r).valueOf()},Ob=(0,N.chain)((0,N.cond)([[(0,N.equals)(xb.MERGE),()=>[l.I.ENTITIES_MERGED,l.I.ENTITIES_MERGED_MANUALLY,l.I.ENTITIES_MERGED_ON_THE_FLY]],[(0,N.equals)(xb.UNMERGE),()=>[l.I.ENTITIES_SPLITTED]],[(0,N.equals)(xb.UPDATE),()=>[l.I.ENTITY_CHANGED]]])),Cb=(0,N.pipe)((0,N.defaultTo)([]),Ob,(0,N.concat)([l.I.ENTITY_CREATED,l.I.ENTITY_REMOVED,l.I.ENTITY_LOST_MERGE]),vb((e=>`equals(type, '${e}')`))),Tb=(0,N.pipe)((0,N.defaultTo)({}),(0,N.reject)(u.O27),(0,N.evolve)({users:vb((e=>`equals(user, '${(0,u.HRH)(e)}')`)),attributes:vb((e=>`changes(${(0,u.HRH)(e.value)})`)),dateRange:e=>{let{type:t,period:r}=e;switch(t){case Eb.K.WITHIN:return`gte(timestamp, ${wb(r)})`;case Eb.K.AGO:return`lte(timestamp, ${wb(r)})`;case Eb.K.BETWEEN:{const[e,t]=r;return`gte(timestamp, ${e.valueOf()}) and lte(timestamp, ${rn()(t).endOf("date").valueOf()})`}default:return""}}}),(0,N.over)((0,N.lensProp)("activities"),Cb),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 Sb(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){kb(e,t,r[t])}))}return e}function kb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nb=e=>{let{entity:t,enabled:r}=e;const[n,a]=(0,s.useState)({activities:[xb.MERGE,xb.UNMERGE,xb.UPDATE]}),[l,o]=(0,s.useState)(0),i=(0,s.useMemo)((()=>Tb(n)),[n]),[c,p]=(0,s.useState)(null),[d,m]=(0,s.useState)(null),[g,h]=(0,s.useState)(!1),f=(0,ze._)(),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)(Sb({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)(Sb({entityUri:b,historicUris:c,filter:i,showAll:x,offset:e},y))).then((e=>{m((t=>Sb({},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}},Ib={appearance:{},attributes:{},roles:[],tags:[]},Pb=(0,N.evolve)({refEntity:u.VGB,refRelation:u.VGB}),Db=e=>e?(0,N.evolve)({attributes:(0,N.map)((0,N.map)(Pb))})(e):e,Rb=()=>{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(Db(n===h.Z9.Current?a:l),Db(r));e(h.N5.history.actions.setHistoryDiff(o))}}),[t,n,e,a]),r||Ib};var Ab=r(57312);const jb=(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"}}))),Zb=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=jb({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,Ab.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 Lb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _b;!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"}(_b||(_b={}));const Mb=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){Lb(e,t,r[t])}))}return e}({},l.I,_b),Vb=e=>e===Mb.FAKE_FILTERED_INCOMING||e===Mb.FAKE_FILTERED_OUTGOING,Bb=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})},Ub=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"})))},zb=(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=Vb(p),f=h?s[0]:o,b=!(null!=s&&s.some((e=>r[e])));e.circles.push(c().createElement(Ub,{key:`circle-${f}-${l}`,x:m,y:g,color:(0,u.GtP)(f),isDashed:h,isCollapsed:b,showCollapseIcon:!!s,showLine:p===Mb.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===Mb.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(Bb,{key:`link-${t}-${d}`,x:m,y:g,toX:i,toY:s,isDashed:Vb(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)===Mb.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(Ub,{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))})),Fb=(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 Hb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wb=e=>{let{historyData:t,isLoading:r,canLoadMore:n,onLoadMore:a,entityUri:l,historyEvent:o,findPreviousChange:i}=e;const p=Fb(),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){Hb(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(Dn,null),c().createElement("div",{className:b()(p.graph,{[p.shadow]:E}),onScroll:S,ref:C},c().createElement(zb,{graphData:f}),c().createElement(wr.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(Zb,{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(Le.Z,{color:"primary",onClick:()=>a()},x().text("Show more"))))},qb=(0,T.Z)({root:{display:"flex",flexWrap:"wrap",padding:"10px 15px"}}),Gb=(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"}}),$b=e=>{let{value:t,isSelected:r=!0,onClick:n}=e;const a=(0,u.GtP)(t),l=Gb({color:a});return c().createElement("div",{className:b()(l.icon,{[l.inactive]:!r,[l.active]:r,[l.clickable]:!!n}),onClick:n})},Yb=e=>{let{values:t,selectedValues:r,entityUri:n,onSelectValues:a,className:l}=e;const o=qb();return c().createElement("div",{className:b()(o.root,l)},c().createElement($b,{value:n}),(null==t?void 0:t.length)>0&&t.map((e=>c().createElement($b,{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 Kb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xb=(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}),Qb=(0,T.Z)({root:{display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",height:"100%"},borderBottom:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"}}),Jb=(0,s.memo)((e=>{let{isLoading:t,historyWithTotal:r,contributorsUris:n,entityUri:a,canLoadMore:l,onLoadMore:o,historyEvent:i}=e;const u=Qb(),[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:Mb.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!==Mb.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!==Mb.ENTITY_CREATED||t.type!==Mb.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 Mb.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 Mb.ENTITY_LOST_MERGE:case Mb.RELATIONSHIP_CREATED:case Mb.RELATIONSHIP_REMOVED:case Mb.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){Kb(e,t,r[t])}))}return e}({},r);((t,r)=>{var n,l;switch(r.type){case Mb.ENTITY_CREATED:s(t,r);break;case Mb.ENTITIES_MERGED_ON_THE_FLY:case Mb.ENTITY_CHANGED:c(t,r);break;case Mb.ENTITY_LOST_MERGE:case Mb.ENTITY_REMOVED:u(t,r);break;case Mb.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?Mb.FAKE_UPDATE:Mb.FAKE_NAVIGATE_PROFILE,uri:t,user:r.user,timestamp:r.timestamp})}));break;case Mb.ENTITIES_MERGED:case Mb.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 Mb.ENTITIES_MERGED:case Mb.ENTITIES_MERGED_MANUALLY:l=Mb.FAKE_FILTERED_INCOMING;break;case Mb.ENTITIES_SPLITTED:l=Mb.FAKE_FILTERED_OUTGOING;break;default:return}const o={type:l,uri:t.uri,uris:[r],user:s,timestamp:i},u=Xb(n.lifeTime,t.timestamp);l===Mb.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(Yb,{values:n,selectedValues:p,onSelectValues:d,entityUri:a,className:u.borderBottom}),c().createElement(Wb,{historyData:m,isLoading:t,onLoadMore:o,canLoadMore:l,entityUri:a,historyEvent:i,findPreviousChange:g}))}));var ey=r(36444),ty=r(15791),ry=r(55234);const ny=[Eb.K.WITHIN,Eb.K.AGO,Eb.K.BETWEEN],ay=e=>({[Eb.K.WITHIN]:x().text("Within the last"),[Eb.K.AGO]:x().text("More than"),[Eb.K.BETWEEN]:x().text("Date range")}[e]||"");var ly=r(77875),oy=r(27446);const iy=(0,T.Z)({root:{flex:1},title:{paddingBottom:"10px",paddingLeft:"5px",fontSize:"14px"},intervalContainer:{display:"flex",justifyContent:"space-between"},typeInput:{width:160,marginRight:10}}),sy=[null,null],cy=[null,"hours"],uy=e=>{let{value:t,onChange:r,className:n}=e;const a=iy(),l=e=>e===Eb.K.WITHIN||e===Eb.K.AGO,o=e=>e===Eb.K.BETWEEN,i=o(null==t?void 0:t.type)?t.period:sy,u=l(null==t?void 0:t.type)?t.period:cy,[p,d]=(0,s.useState)(i),[m,g]=(0,s.useState)(u),h=(null==t?void 0:t.type)||Eb.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(sy),g(cy))}),[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(Ml.Z,{label:"",className:a.typeInput,value:{value:h,label:ay(h)},options:ny.map((e=>({value:e,label:ay(e)}))),onChange:e=>{let{value:n}=e;(null==t?void 0:t.type)!==n&&r({period:f(n),type:n})}}),l(h)?c().createElement(ly.Z,{interval:m,onChange:y}):c().createElement(oy.Z,{values:p,onChange:y})))},py=[xb.UPDATE,xb.MERGE,xb.UNMERGE];function dy(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){my(e,t,r[t])}))}return e}function my(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gy={input:e=>dy({},e,{fontSize:"14px"}),menuPortal:e=>dy({},e,{zIndex:1300})},hy=(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"}}),fy=e=>{let{selectedHistoryActivityTypes:t,onChange:r,className:n}=e;const a=hy(),l=e=>{return{value:e,label:(t=e,{[xb.UPDATE]:x().text("Update"),[xb.MERGE]:x().text("Merge"),[xb.UNMERGE]:x().text("Unmerge")}[t]||"")};var t},o=e=>e.map(l),i=o(py);return c().createElement("div",{className:b()(a.root,n)},c().createElement(v.Z,{className:a.title,variant:"subtitle1"},x().text("Activity")),c().createElement(Mp.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:uc.Z},styles:gy,classes:a,menuPlacement:"bottom",menuPortalTarget:document.body}))},by=(0,T.Z)({icon:{margin:5},popup:{width:500,height:500,overflowY:"hidden",display:"flex",flexDirection:"column"},filterContainer:{padding:20,height:410,display:"flex",flexDirection:"column"},filterContainerScrollable:{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 yy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xy=e=>{let{filter:t,onApplyFilter:r,entityType:n}=e;const a=by(),[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){yy(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(_t.Z,{icon:ey.Z,size:"XS",onClick:e=>o(e.currentTarget),className:a.icon}),c().createElement(_r.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("div",{className:a.filterContainerScrollable},c().createElement(uy,{value:h,onChange:d("dateRange"),className:a.filterItem}),c().createElement(ty.Z,{selectedUsers:f,onChange:d("users"),className:a.filterItem}),c().createElement(fy,{selectedHistoryActivityTypes:m,onChange:d("activities"),className:a.filterItem}),c().createElement(ry.Z,{selectedAttributes:g,entityType:n,onChange:d("attributes"),className:a.filterItem,title:x().text("Attribute updated")}))),c().createElement("div",{className:a.filterControls},c().createElement(Le.Z,{onClick:()=>p(null),className:a.clearButton},x().text("Clear all")),c().createElement(Le.Z,{onClick:i},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",onClick:()=>{h&&(e=>{if(e.type===Eb.K.AGO||e.type===Eb.K.WITHIN){const[t,r]=e.period;return"Number"===(0,N.type)(t)&&"String"===(0,N.type)(r)&&t>0}if(e.type===Eb.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 Ey=r(98281);const vy=(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)"}}),wy=(0,s.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=On.ZT}=e;const a=vy(),{text:l,selected:o,onClick:i}=r;return c().createElement(Va.Z,{classes:{root:a.menuItem},onClick:e=>{n(),i(e)},ref:t},o&&c().createElement(Ey.Z,{className:a.checkIcon}),c().createElement(v.Z,{classes:{root:a.menuText}},l))}));wy.displayName="MenuItemRenderer";const Oy=wy,Cy=()=>{const e=vy(),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(be.Z,{MenuItemRenderer:Oy,buttonComponent:_t.Z,buttonProps:{icon:fe.Z,size:"L",className:e.icon},menuId:"history-menu",menuItems:a})},Ty=(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}}),Sy=e=>{let{total:t,entityType:r,filter:n,onApplyFilter:a}=e;const l=Ty();return c().createElement("div",{className:l.root},c().createElement(v.Z,{variant:"h6"},x().text("History")),c().createElement(Zr.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(vm.Z,null),c().createElement(xy,{entityType:r,filter:n,onApplyFilter:a}),c().createElement(Cy,null))},ky=(0,T.Z)({root:{display:"flex",alignItems:"flex-start"},slice:{fontWeight:500},cancelButton:{width:"88px",flexShrink:0,marginLeft:"15px"}}),Ny=()=>{const e=ky(),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(Le.Z,{className:e.cancelButton,variant:"contained",color:"primary",onClick:n},x().text("Cancel"))):null},Iy=()=>c().createElement(hm,{text:x().text("History in the making"),secondaryText:x().text("When you create an event or perform an activity, it will show up here.")}),Py=(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 Dy(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){Ry(e,t,r[t])}))}return e}function Ry(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ay=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=Py(),{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)((()=>Dy({attributes:Dy({},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),R=(0,u.z7d)(w,O),A=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]),B=(0,s.useCallback)((e=>a(h.N5.modifiedEntities.actions.entityCreated(e))),[a]),U=(0,s.useCallback)((e=>a(h.N5.modifiedEntities.actions.entityDeleted(e))),[a]),z=(0,s.useCallback)((e=>{r&&U(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,U,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)(U),M))),[t,l,a,V,F,I]),q=(0,s.useCallback)((()=>{const e=k.current;r!==e&&(e?(B(e),r&&r.uri!==e.uri&&U(r.uri)):U(r.uri));const t=D.current;(0,N.differenceWith)(N.equals,P.current,t.map((0,N.prop)("uri"))).forEach(U),t.forEach(B),H(),M()}),[M,B,U,H,r]),G=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.addAttributes,a)(e.map((e=>Dy({},e,{viewId:l.id}))))),[l.id,a]),$=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.modifyAttribute,a)(Dy({},e,{viewId:l.id}))),[l.id,a]),Y=(0,s.useCallback)((e=>(0,N.pipe)(h.N5.actions.removeAttribute,a)(Dy({},e,{viewId:l.id}))),[l.id,a]),K=(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),B(a)}),[B,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===R&&c().createElement(vc,{className:E.item,relation:t.relation,inRelationTypes:w,outRelationTypes:O,onChange:_}),Boolean(g)&&c().createElement(c().Fragment,null,c().createElement(sa,{errorMessage:X},c().createElement(gl,{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:K,metadata:i,attributeTypesSelectionStrategy:u.wcJ})),c().createElement(Pa,{className:E.item,attrTypes:C,entity:T,showEmptyEditors:!0,crosswalks:t.crosswalks,mode:o,parentUri:m,onAddAttributes:G,onChangeAttribute:$,onDeleteAttribute:Y}))),c().createElement("div",{className:E.actionButtons},c().createElement(Le.Z,{onClick:q},x().text("Cancel")),c().createElement(Le.Z,{color:"primary",disabled:!A,onClick:W},x().text("Apply"))),c().createElement(Zr.Z,null))};Ay.propTypes={connection:u.Rjq,modifiedEntity:u.pyR,allModifiedEntities:U().object,dispatch:U().func,config:u.PiC,mode:U().string,metadata:u.pGS,globalSearchRequestOptions:U().object,error:u.wfT};const jy=Ay,Zy=(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))}}))(jy),Ly=(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"}}))),_y=c().createContext(null);_y.displayName="WorkflowTasksContext";const My=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),iu.Z.addError({title:x().text("Error"),message:t||x().text("Something went wrong...")}))},Vy=()=>{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}},By=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((0,N.startsWith)("changeRequests/"))},Uy=e=>void 0===e||!0===e,zy=e=>({label:e,value:e}),Fy=e=>{let{assignee:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},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,ze._)(),p=(0,ze._)(),[d,m]=(0,s.useState)(null),[f,b]=(0,s.useState)(),[y,x]=(0,s.useState)(!1),E=Vy()("UPDATE_TASK")&&Uy(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(My)}}),[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(My).finally((()=>{x(!1)}))}}),[l,r,o,i,E]);return{assignee:d,getAssignees:v,updateAssignee:w,updateRequestIsInProgress:y,readOnly:!E}},Hy=e=>{let{taskId:t,assignee:r,isTaskOpen:n}=e;const{assignee:a,getAssignees:l,updateAssignee:o,updateRequestIsInProgress:i,readOnly:s}=Fy({taskId:t,assignee:r,isOpen:n}),u=i||s;return c().createElement(_a.Z,{isDisabled:u,getOptions:l,onChange:o,hideSelectedOptions:!1,label:x().text("Assigned to"),value:a,defaultOptions:!0,TextFieldProps:{disabled:u},height:40})},Wy=(0,T.Z)({dueDate:{marginTop:0,marginBottom:0},dueDateInput:{height:"40px"},inputLabel:{fontSize:"14px"}}),qy=e=>{let{taskId:t,dueDate:r,isTaskOpen:n,className:a}=e;const l=Wy(),{updateDueDate:o,updateRequestIsInProgress:i,readOnly:p}=(e=>{let{dueDate:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},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,ze._)(),[p,d]=(0,s.useState)(!1),m=Vy()("UPDATE_TASK")&&Uy(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(My).finally((()=>{d(!1)})))}),[l,r,o,i,a,c,t,m]),updateRequestIsInProgress:p,readOnly:!m}})({dueDate:r,taskId:t,isOpen:n});return c().createElement(Rc.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}}})},Gy=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)(_y)||{},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,ze._)(),[p,d]=(0,s.useState)(!1),m=Vy()("UPDATE_TASK")&&Uy(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(My).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(_a.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 $y=r(94842),Yy=r(98685);const Ky=(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"}}))),Xy=(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"}}))),Qy=(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)"}}}))),Jy=(0,T.Z)((e=>({messageContainer:{borderBottom:"1px solid rgba(0,0,0,0.3)",paddingBottom:"7px",marginBottom:"7px"}}))),ex=e=>{let{author:t,classes:r,message:n,time:a}=e;const l=Ky();return c().createElement("div",{className:l.comment},c().createElement(Ne.Z,{className:l.avatar},c().createElement(Yy.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)))};ex.defaultProps={classes:{}},ex.propTypes={classes:U().object,author:U().string,id:U().string,message:U().string,time:U().number};const tx=e=>{let{comments:t,onClick:r}=e;const n=Xy();return c().createElement(c().Fragment,null,c().createElement(ex,t[0]),c().createElement("div",{className:n.delimiter},c().createElement(Xa.Z,{className:n.circleButton,onClick:r},t.length-2)),c().createElement(ex,t[t.length-1]))};tx.propTypes={comments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number})),onClick:U().func};const rx=e=>{let{comments:t}=e;const r=Jy();return t.map((e=>{let{author:t,id:n,message:a,time:l}=e;return c().createElement(ex,{classes:{messageContainer:r.messageContainer},key:n,author:t,message:a,time:l})}))};rx.propTypes={comments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number}))};const nx=e=>{let{processInstanceComments:t,taskId:r,isOpen:n}=e;const{updateTaskState:a}=(0,s.useContext)(_y)||{},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,ze._)(),[p,d]=(0,s.useState)([]),[m,f]=(0,s.useState)(!1),b=Vy()("UPDATE_TASK")&&Uy(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(My).finally((()=>f(!1))))}),[o,r,i,l,c,a,b]);return{comments:p,requestIsInProgress:m,writeComment:y,readOnly:!b}},ax=e=>e.target.value,lx=e=>{let{processInstanceComments:t,taskId:r,isTaskOpen:n}=e;const a=Qy(),[l,o]=(0,s.useState)(!1),[i,u]=(0,s.useState)(""),{comments:p,writeComment:d,readOnly:m}=nx({processInstanceComments:t,taskId:r,isOpen:n}),g=(0,s.useCallback)((()=>{d(i),u("")}),[i,d]),h=(0,N.pipe)(ax,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(rx,{comments:p}):c().createElement(tx,{onClick:()=>o(!0),comments:p})),!m&&c().createElement(Rm.Z,{endAdornment:c().createElement(Am.Z,{position:"end"},c().createElement(_t.Z,{icon:$y.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}))};lx.propTypes={processInstanceComments:U().arrayOf(U().shape({author:U().string,id:U().string,message:U().string,time:U().number})),taskId:U().string};const ox=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)(_y)||{},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)(Ga.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(My).finally((()=>{f(!1)})))}),[o,n,i,c,y,d,b,l]);return{actions:(0,s.useMemo)((()=>p===r&&Uy(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(be.Z,{buttonComponent:_t.Z,buttonProps:{icon:fe.Z,size:"L",disabled:o},menuId:"workflow-actions",menuItems:l}):null},ix=(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}}),sx=e=>{let{className:t,children:r,plain:n,first:a,last:l,transparent:o,divider:i}=e;const s=ix();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(Zr.Z,{className:s.rowDivider,light:!0,variant:"inset"})))};let cx={};const ux=["#DC057B","#5DC003","#FEC92F","#F57F27","#B71137","#056B97","#4499AE","#BD81BE","#5F3577","#A68560","#555962"];let px=0;function dx(){return dx=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},dx.apply(this,arguments)}const mx=e=>c().createElement("svg",dx({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"}))),gx=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)(By,(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 cx[r]||(cx[r]=ux[px],px++,px>ux.length-1&&(px=0)),cx[r]})({processDefinitionDisplayName:g}),O=Ly({color:w}),[C,T]=(0,s.useState)(!1),S=Vy()("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(sx,{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(up.Z,{className:O.flag}),c().createElement(le.ZP,{title:x().text("Due date")},c().createElement("span",{className:O.date},x().date(o,"L"))),c().createElement(Ns.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(mx,{className:O.commentsIcon}),c().createElement("div",{className:O.infoValue},f.length))),n||c().createElement(ox,{taskId:l,possibleActions:y,assignee:u,isTaskOpen:E}))))),C&&c().createElement(sx,{plain:!0},c().createElement("div",{className:O.controlsBox},c().createElement("div",{className:O.controlsInRow},c().createElement(qy,{taskId:l,dueDate:o,isTaskOpen:E}),c().createElement(Gy,{taskId:l,priority:i,className:O.priority,isTaskOpen:E})),c().createElement(Hy,{taskId:l,assignee:u,isTaskOpen:E})))),C&&c().createElement(c().Fragment,null,r,S&&c().createElement("div",{className:O.comments},c().createElement(lx,{taskId:l,processInstanceComments:f,isTaskOpen:E}))))};function hx(){return hx=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},hx.apply(this,arguments)}const fx=e=>c().createElement("svg",hx({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 bx,yx;!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"}(bx||(bx={})),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"}(yx||(yx={}));const xx=(e,t)=>{switch(e){case yx.CREATE_RELATIONSHIP:case yx.INSERT_ATTRIBUTE:return bx.ADDED;case yx.UPDATE_TAGS:case yx.UPDATE_ROLES:case yx.UPDATE_ATTRIBUTE:return bx.EDITED;case yx.DELETE_ATTRIBUTE:case yx.DELETE_RELATIONSHIP:return bx.DELETED;case yx.PIN_ATTRIBUTE:return null!=t&&t.pin?bx.PIN_DELETED:bx.PINNED;case yx.IGNORE_ATTRIBUTE:return null!=t&&t.ignored?bx.IGNORE_DELETED:bx.IGNORED}},Ex=e=>({[bx.ADDED]:x().text("added"),[bx.EDITED]:x().text("edited"),[bx.DELETED]:x().text("deleted"),[bx.PINNED]:x().text("pinned"),[bx.PIN_DELETED]:x().text("pin deleted"),[bx.IGNORED]:x().text("ignored"),[bx.IGNORE_DELETED]:x().text("ignore deleted")}[e]||""),vx=(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 wx(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){Ox(e,t,r[t])}))}return e}function Ox(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cx=(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]:[]},Tx=(0,N.curry)(((e,t,r)=>{const n=Ta(e,t.type,[],[]);return kx(e,n,r)})),Sx=(0,N.curry)(((e,t,r,n)=>{const a=(0,u.V3K)(e,t.type),l=(0,u.xF8)(e,t.type);return(0,N.flatten)([wx({level:1,label:(0,N.propOr)("","label",a),attributeType:a,attributeValue:wx({},t,r)},((e,t)=>{if(t===yx.CREATE_RELATIONSHIP||(0,u.O27)(e)){const e=xx(t);return e?{operation:e}:{}}return{}})(r,n)),kx(e,l,r,2)])})),kx=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return(0,N.flatten)(t.map((t=>Cx(r,t).map((r=>r.map((r=>Nx(e,t,r,n))))))).filter((0,N.complement)(N.isEmpty)))},Nx=(e,t,r,n)=>{switch(t.type){case u.oS0.TYPE_NESTED:case u.oS0.TYPE_IMAGE:return Ix(e,t,r,n);case u.oS0.TYPE_REFERENCE:return Px(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:yx.INSERT_ATTRIBUTE}})(t,r);return Dx(t,e,n)}}},Ix=(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},kx(e,a,r.value,n+1)]},Px=(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},kx(e,a,r.value,n+1)]},Dx=(e,t,r)=>{const{newValue:n,oldValue:a,type:l}=(e=>{let{newValue:t,oldValue:r,type:n}=e;return n===yx.UPDATE_ATTRIBUTE?{type:n,newValue:t,oldValue:r}:{type:n,newValue:r||t}})(t);return{attributeType:e,newValue:n,oldValue:a,operation:xx(l,a),label:(null==e?void 0:e.label)||(null==e?void 0:e.name),level:r}};function Rx(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){Ax(e,t,r[t])}))}return e}function Ax(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jx=["defaultProfilePicValue",u.xPW.tags.name,u.xPW.roles.name,u.xPW.startDate.name,u.xPW.endDate.name],Zx=e=>{let{newValue:t,oldValue:r}=e;const n=e=>isNaN(e)||(0,u.O27)(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:yx.UPDATE_ATTRIBUTE,oldValue:{value:n(r[0])},newValue:{value:n(t[0])}}]:l?[{type:yx.INSERT_ATTRIBUTE,newValue:{value:n(t[0])}}]:o?[{type:yx.DELETE_ATTRIBUTE,oldValue:{value:n(r[0])}}]:void 0},Lx=(e,t)=>{const{newValue:r=[],oldValue:n=[],type:a}=t,l=a===yx.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:yx.INSERT_ATTRIBUTE,newValue:{value:o.map(l).join(", ")}}),i.length&&s.push({type:yx.DELETE_ATTRIBUTE,oldValue:{value:i.map(l).join(", ")}}),s},_x=(e,t)=>{const r=(e=>{const{type:t,attributePath:r,refObjectURI:n,refAttributeType:a}=e,l=t===yx.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},Mx=(e,t)=>{const{attributes:r={},startDate:n,endDate:a}=t,{roles:l,tags:o,defaultProfilePicValue:i}=t,s=Rx({},r);return i&&(s.defaultProfilePicValue=[i]),l&&(s[u.xPW.roles.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:l.map((0,u.xqc)(e)).join(", ")}}]),o&&(s[u.xPW.tags.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:o.join(", ")}}]),n&&(s[u.xPW.startDate.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:n}}]),a&&(s[u.xPW.endDate.name]=[{type:yx.INSERT_ATTRIBUTE,newValue:{value:a}}]),s},Vx=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{type:a}=r;switch(a){case yx.UPDATE_PROFILE_PIC_BY_URL:n.defaultProfilePicValue=[r.newValue];break;case yx.UPDATE_TAGS:n[u.xPW.tags.name]=Lx(e,r);break;case yx.UPDATE_ROLES:n[u.xPW.roles.name]=Lx(e,r);break;case yx.UPDATE_START_DATE:n[u.xPW.startDate.name]=Zx(r);break;case yx.UPDATE_END_DATE:n[u.xPW.endDate.name]=Zx(r);break;case yx.CREATE_RELATIONSHIP:case yx.CREATE_ENTITY:return Rx({},n,Mx(e,r.newValue));case yx.INSERT_ATTRIBUTE:case yx.UPDATE_ATTRIBUTE:case yx.DELETE_ATTRIBUTE:case yx.PIN_ATTRIBUTE:case yx.IGNORE_ATTRIBUTE:_x(n,r)}return n},Bx=(0,T.Z)((e=>({linkLabel:{color:e.palette.primary.main,fontSize:"12px",letterSpacing:0,lineHeight:"16px"}}))),Ux=e=>{let{suggestionsCount:t,isExpanded:r,onClick:n,className:a}=e;const l=Bx();return c().createElement(he.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 zx=r(43525);const Fx=(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"}}}))),Hx=e=>{let{label:t,oldValue:r,newValue:n,operation:a,className:l}=e;const o=Fx(),i=r||n;return c().createElement("div",{className:b()(o.field,l)},c().createElement("span",{className:o.fieldName},t,":"),!(0,N.isNil)(i)&&c().createElement("span",{className:o.difference},i,n&&r&&c().createElement(c().Fragment,null,c().createElement(zx.Z,{className:o.arrow}),n)),a&&c().createElement(tt.Z,{variant:"outlined",label:Ex(a),className:b()(o.chip,a)}))},Wx=c().createContext(null);Wx.displayName="AttributesChangesContext";const qx=(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"}}}))),Gx=e=>{let{label:t,level:r,attributeType:n,attributeValue:a,oldValue:l,newValue:o,operation:i}=e;const p=qx({level:r}),d=(0,g.useSelector)(h.ZP.selectors.getEntityUri),m=(0,s.useContext)(Wx),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(Ee.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(at.Z,{value:t,dataTypeDefinition:vx(n,t)})}),[n]);return c().createElement(Hx,{className:p.change,label:x,oldValue:l&&E(l),newValue:o&&E(o),operation:i})},$x=(0,T.Z)({title:{fontSize:"12px",letterSpacing:0,lineHeight:"16px",fontWeight:500,marginTop:"8px"}});function Yx(){return Yx=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},Yx.apply(this,arguments)}const Kx=e=>{let{changes:t}=e;const r=$x();return c().createElement(c().Fragment,null,t.map(((e,t)=>(0,N.has)("level",e)?c().createElement(Gx,Yx({},e,{key:t})):c().createElement("div",{className:r.title,key:t},e.label))))},Xx=(0,N.pipe)((0,N.filter)((0,N.has)("operation")),N.length),Qx=(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"}}))),Jx=e=>{let{changes:t,objectsInfo:r,entityInfo:n,relationsInfo:a,max:l}=e;const o=Qx(),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]),Tx(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)=>Vx(e,r,n,t)),{}),i=n.map((r=>((e,t,r)=>(0,N.propOr)([],r.uri)(t).reduce(((t,n)=>Vx(e,r,n,t)),{}))(e,t,r)));return[l([(0,N.pipe)((0,N.omit)(jx),Tx(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(((r,n)=>{const a=(0,N.path)([r.uri,0,"type"],t);return Sx(e,r,i[n],a)})))]})(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)((()=>Xx(e)),[e]),i=(0,s.useMemo)((()=>Xx(l)),[l]);return{isExpanded:r,onToggle:a,itemsToShow:r?e:l,collapsedSuggestionsCount:o-i}}(m,l);return c().createElement(Wx.Provider,{value:r},c().createElement("div",{className:o.container},c().createElement(Ee.Z,{className:o.uri,value:(0,u.wwR)(n)},c().createElement("div",{className:o.label},(0,u.idV)(n.label))),c().createElement(Kx,{changes:y}),E>0&&c().createElement(Ux,{onClick:b,suggestionsCount:E,isExpanded:f,className:o.showMoreLink})))};function eE(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){tE(e,t,r[t])}))}return e}function tE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rE=(0,N.filter)((0,N.pipe)((0,N.prop)("uri"),u.WgC)),nE=(0,N.filter)((0,N.pipe)((0,N.prop)("uri"),u.bC9)),aE=(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),lE=(0,N.curry)(((e,t)=>({entity:t,relations:aE(e,t.uri)}))),oE=(0,N.curry)(((e,t)=>{const r=e[t.startObjectUri],n=[t];return r?{entity:eE({},r,{uri:t.startObjectUri}),relations:n}:{relations:n}})),iE=(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 sE(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=>{let{task:t}=e;const{objectURIs:r}=t,n=By(r),{dcr:a,groupedObjects:l}=(e=>{const[t,r]=(0,s.useState)([]),[n,a]=(0,s.useState)(null),l=(0,ze._)(),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=>eE({},t[e],{uri:e}))))(t))(t,n),i=(0,N.pipe)(rE,(0,N.map)(lE(l)))(l),s=(0,N.pipe)(nE,(0,N.map)(oE(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){sE(e,t,r[t])}))}return e}({},t,{entity:e[r]})));(0,N.pipe)(N.flatten,(0,N.reduce)(iE,{}),N.values,r)([i,c,t])})).catch(My),a(e)})).catch(My)}),[e,o]),{dcr:n,groupedObjects:t}})(n);return c().createElement(gx,{task:t,Icon:fx},a&&l.map(((e,t)=>c().createElement(sx,{key:t,last:t===l.length-1,divider:!0},c().createElement(Jx,{entityInfo:e.entity,relationsInfo:e.relations,changes:a.changes,objectsInfo:a.objectsInfo})))))},uE=(0,T.Z)({pmCard:{marginLeft:"-15px"}});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:"#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 mE=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]),gE=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=mE(S),I=mE(u.bFH),P=(0,N.prop)("uri",r),D=(0,ze._)(),R=(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)((()=>{R()}),[R]),{total:f,matches:y,entitiesMap:E,loadMatches:(0,s.useCallback)((()=>{R(!0)}),[R])}},hE=(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"}}),fE=e=>{let{children:t,entitiesMap:r,entity:n,match:a,metadata:l,className:o}=e;const i=hE();return c().createElement("div",{className:b()(i.root,o)},c().createElement("div",{className:i.profileCardWrapper},c().createElement(Cp,{entity:a.object,classes:{container:i.profileCardContainer},disableEntityTypeColor:!0}),t),c().createElement("div",{className:i.rulesContainer},c().createElement(np,{match:a,metadata:l,entitiesMap:r,entity:n})))},bE={showTransitiveMatches:!0,showInactiveEntities:!1},yE=e=>{let{task:t}=e;const r=uE(),{objectURIs:n}=t,a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getMetadata),{matches:o,entitiesMap:i}=gE({enabled:!!a.uri,entity:a,filter:"",rowsPerPage:Number.MAX_SAFE_INTEGER,page:0,options:bE}),s=null==o?void 0:o.find((e=>{let{object:t}=e;return n.includes(t.uri)}));return c().createElement(gx,{task:t,Icon:dE},s&&c().createElement(sx,{last:!0},c().createElement("div",{className:r.pmCard},c().createElement(fE,{metadata:l,entity:a,match:s,entitiesMap:i}))))};function xE(){return xE=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},xE.apply(this,arguments)}const EE=e=>c().createElement("svg",xE({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 vE(){return vE=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},vE.apply(this,arguments)}const wE=e=>c().createElement("svg",vE({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 OE{}OE.build=e=>{let{task:t}=e;const{processType:r}=t;switch(r){case u.Yj_.dataChangeRequestReview:return c().createElement(cE,{task:t});case u.Yj_.potentialMatchReview:return c().createElement(yE,{task:t});case u.Yj_.recommendForDelete:return c().createElement(gx,{task:t,Icon:wE});default:return c().createElement(gx,{task:t,Icon:EE})}};const CE=OE,TE=e=>{let{task:t}=e;return CE.build({task:t})};var SE=r(8560);const kE=(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"}}))),NE=e=>{let{anchorEl:t,onClose:r}=e;const n=kE(),[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)(_y),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 My(e),e})).finally((()=>{o(!1)})))),[a,r,e,n,t]),loading:l}})(),y=Boolean(t);return c().createElement(c().Fragment,null,c().createElement(_r.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(Ml.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(Fc.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(Le.Z,{disabled:b,className:n.cancelButton,onClick:r},x().text("Cancel")),c().createElement(Le.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(SE.Z,{container:document.body},c().createElement(qn.Z,{open:p,autoHideDuration:5e3,onClose:()=>{d(!1)},message:x().text("A new workflow has started")})))},IE=(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"}}),PE=()=>{const e=IE(),[t,r]=(0,s.useState)(null),n=Vy(),a=n("START_PROCESS_INSTANCE"),l=n("VIEW_PROCESS_DEFINITIONS");return a&&l?c().createElement(c().Fragment,null,c().createElement(Le.Z,{color:"primary",className:e.button,onClick:e=>r(e.currentTarget)},c().createElement(Yr.Z,{className:e.icon}),c().createElement("div",{className:e.buttonLabel},x().text("Add"))),c().createElement(NE,{anchorEl:t,onClose:()=>r(null)})):null};function DE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RE=e=>{const{processTypes:t,assignee:r,showClosedTasks:n}=e||{},a=(0,ze._)(),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=Vy()("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)(AE(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){DE(e,t,r[t])}))}return e}({},r,t):r))))}),[]);return{tasks:f,total:y,loading:E,updateTaskState:O,loadWorkflowTasks:w}},AE=(e,t)=>r=>(!e||e.includes(r.processType))&&(!t||t===r.assignee);function jE(){return jE=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},jE.apply(this,arguments)}const ZE=e=>c().createElement("svg",jE({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:"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:"MergeDark_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"MergeDark_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#MergeDark_svg__a",transform:"rotate(90 12.045 12)"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#MergeDark_svg__b)",d:"M0 0h24v24H0z"}))),LE=(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 _E(){return _E=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},_E.apply(this,arguments)}let ME;!function(e){e.iconButton="iconButton",e.button="button",e.menuItem="menuItem"}(ME||(ME={}));const VE=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=ME.iconButton,label:a,disabled:l,icon:o,onClick:i=On.ZT,onMenuClose:s=On.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=LE();return(()=>{switch(n){case"iconButton":return c().createElement(ye.k,_E({disabled:l,className:b()(p.iconButton,r),size:"S",tooltipTitle:a,onClick:i,icon:o},u));case"button":return c().createElement(Le.Z,_E({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(di.C,{value:a},c().createElement("div",{className:p.overflowStyle},a)));case"menuItem":{const e=()=>{s(),i()};return c().createElement(Va.Z,_E({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)))}}})()}));VE.displayName="ActionButton";const BE=e=>{let{entities:t,entity:r,onFinishRequest:n,onStartRequest:a,onError:l=On.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 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 zE=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=ME.iconButton,onMenuClose:a=On.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}=BE({entity:o,entities:i,onStartRequest:s,onFinishRequest:u,onError:p});return c().createElement(VE,UE({className:r,disabled:l,mode:n,label:x().text("Merge"),icon:ZE,onClick:m,onMenuClose:a,ref:t},d))}));function FE(){return FE=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},FE.apply(this,arguments)}zE.displayName="mergeButton";const HE=e=>c().createElement("svg",FE({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:"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:"NotMatchDark_svg__a"})),c().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},c().createElement("mask",{id:"NotMatchDark_svg__b",fill:"#fff"},c().createElement("use",{xlinkHref:"#NotMatchDark_svg__a"})),c().createElement("path",{fillOpacity:.54,fill:"#000",mask:"url(#NotMatchDark_svg__b)",d:"M0 0h24v24H0z"}))),WE=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 qE(){return qE=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},qE.apply(this,arguments)}const GE=(0,s.forwardRef)(((e,t)=>{let{className:r,mode:n=ME.iconButton,onMenuClose:a=On.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}=WE({entity:o,entities:i,onStartRequest:s,onFinishRequest:u});return c().createElement(VE,qE({className:r,disabled:l,mode:n,label:x().text("Not a match"),icon:HE,onClick:d,onMenuClose:a,ref:t},p))}));function $E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}GE.displayName="notMatchButton";const YE=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){$E(e,t,r[t])}))}return e}({},e,{[n]:(0,N.pipe)(a,r)})}),{})),[r,t])};function KE(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){XE(e,t,r[t])}))}return e}function XE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const QE=[],JE=e=>console.error("Collaboration error",e),ev=e=>{let{objectIds:t=QE,objectTypes:r,enabled:n=!0}=e;const a=(0,g.useSelector)(h.ZP.selectors.getEntity),l=(0,g.useSelector)(h.ZP.selectors.getTenant),o=(0,g.useSelector)(h.ZP.selectors.getCollaborationPath),i=(0,g.useSelector)(h.ZP.selectors.isCollaborationEnabled)&&n,[c,p]=(0,s.useState)(null),[d,m]=(0,s.useState)([]),[f,b]=(0,s.useState)(null),[y,x]=(0,s.useState)(null),[E,v]=(0,s.useState)(!1),[w,O]=(0,s.useState)(!1),C=(0,s.useCallback)((e=>{b((t=>KE({},t,e)))}),[]),T=null==a?void 0:a.uri,S=(0,s.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i&&T&&!(0,u.ZiX)(T)){const r=e=>{console.warn("Collaboration error",e),b(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?b:C),(0,N.otherwise)(r))({uris:e,tenant:l,collaborationPath:o})}else b(null)}),[C,o,T,i,l]);(0,s.useEffect)((()=>{S(t,!0)}),[t,S]);const k=(0,s.useCallback)(((e,t)=>{(0,u.liG)({collaborationPath:o,tenant:l,relatedObjectUri:e,pageToken:t}).then((e=>{let{items:r,nextPageToken:n}=e;m((e=>t?(0,N.uniqBy)((0,N.prop)("commentId"),[...e,...r]):r)),p(n)})).catch(JE)}),[o,l]),I=(0,s.useCallback)((e=>{O(!0),(0,u.d7q)({collaborationPath:o,tenant:l,commentId:e}).then(x).catch(JE).finally((()=>O(!1)))}),[o,l]),P=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i}=e;v(!0);const s={objectId:a,content:t,relatedObjectUris:i,objectType:n,visibility:"public",namedUsers:r,permanentLink:""};return(0,u.Yrx)({collaborationPath:o,tenant:l,data:s}).then((e=>{let[t]=e;return((e,t)=>{x(e),b((r=>KE({},r,{[t]:[...r[t]||[],{commentId:e.commentId,replies:0,status:"open"}]}))),m((t=>[e,...t]))})(t,a)})).catch(JE).finally((()=>v(!1)))}),[o,l]),D=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,objectType:n,uri:a,relatedObjectUris:i,commentId:s,replies:c}=e;v(!0);const p={objectId:a,content:t,relatedObjectUris:i,objectType:n,visibility:"public",namedUsers:r,permanentLink:"",commentId:s,replies:c};return(0,u.uAg)({collaborationPath:o,tenant:l,data:p}).then((e=>(e=>{x(e),m((0,N.map)((0,N.when)((0,N.propEq)("commentId",e.commentId),(0,N.always)(e))))})(KE({},e,{replies:c})))).catch(JE).finally((()=>v(!1)))}),[o,l]),R=(0,s.useCallback)((e=>{let{uri:t,commentId:r}=e;v(!0),(0,u.YFy)({collaborationPath:o,tenant:l,commentId:r}).then((()=>((e,t)=>{x(null),b((r=>{const n=r[t]||[];return KE({},r,{[t]:n.filter((t=>t.commentId!==e))})})),m((t=>t.filter((t=>t.commentId!==e))))})(r,t))).catch(JE).finally((()=>v(!1)))}),[o,l]),A=(0,s.useCallback)(((e,t,r)=>{const n="resolve"===e.action?"resolved":"open";x("resolved"===n?e=>{if(e)return null}:t=>{if(t)return KE({},t,{replies:[...t.replies,e]})}),b((e=>KE({},e,{[t]:e[t].map((e=>e.commentId===r?KE({},e,{status:n,replies:e.replies+1}):e))}))),m((t=>t.map((t=>t.commentId===r?KE({},t,{status:n,replies:[...t.replies,e]}):t))))}),[]),j=(0,s.useCallback)((e=>{let{content:t,namedUsers:r,commentId:n,action:a,uri:i}=e;v(!0);const s={content:t,action:a,namedUsers:r};return(0,u.PP2)({collaborationPath:o,tenant:l,commentId:n,data:s}).then((e=>{let[t]=e;return A(t,i,n)})).catch(JE).finally((()=>v(!1)))}),[o,l,A]),Z=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;j({content:"",namedUsers:[],commentId:t,action:"resolve",uri:r})}),[j]),L=(0,s.useCallback)((e=>{let{commentId:t,uri:r}=e;j({content:"",namedUsers:[],commentId:t,action:"reopen",uri:r})}),[j]);return{clearCurrentComment:(0,s.useCallback)((()=>{x(null)}),[]),comments:d,commentsMap:f,createComment:P,createReply:j,currentComment:y,deleteComment:R,editComment:D,getComment:I,getComments:k,getCommentsCount:S,loading:w,objectTypes:r,pageToken:c,reOpenThread:L,resolveThread:Z,sending:E}};function tv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rv=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,ze._)(),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){tv(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,gb.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}},nv=(e,t)=>{const r=(0,s.useRef)(!1);(0,s.useEffect)((()=>{t&&!r.current&&(r.current=!0,e())}),[e,t])};var av=r(11326);const lv=()=>{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 ov(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iv=(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){ov(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 sv=r(47081),cv=r(8007);const uv=c().createContext(!1);uv.displayName="ProfilePerspectiveViewContext";const pv=c().createContext("");pv.displayName="IdContext"}}]);
|