Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
assets.GlossaryRouter.9bf1d89926b9972b5b0a.js Maven / Gradle / Ivy
"use strict";(self.webpackChunkopen_metadata=self.webpackChunkopen_metadata||[]).push([[5855,3982,7109],{23982:function(e,t,n){n.r(t),n.d(t,{ReactComponent:function(){return s}});var a,r,l=n(67294);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?j:[{id:null!==(t=null==L?void 0:L.id)&&void 0!==t?t:"",type:"user"}],o={name:n.trim(),displayName:null==a?void 0:a.trim(),description:r,reviewers:z.filter(Boolean),owners:s,tags:l||[],mutuallyExclusive:Boolean(i),domain:null==k?void 0:k.fullyQualifiedName};I(o)}},(0,v.GL)(Q),a.createElement("div",{className:"m-y-xs"},(0,v.rz)(P),Boolean(j.length)&&a.createElement(y.Z,{wrap:!0,"data-testid":"owner-container",size:[8,8]},a.createElement(b.V,{owners:j}))),a.createElement("div",{className:"m-y-xs"},(0,v.rz)(V),Boolean(z.length)&&a.createElement(y.Z,{wrap:!0,"data-testid":"reviewers-container",size:[8,8]},a.createElement(b.V,{owners:z}))),a.createElement("div",{className:"m-t-xss"},(0,v.rz)(Y),k&&a.createElement(T.y,{domain:k,entityFqn:"",entityId:"",entityType:h.py.GLOSSARY,hasPermission:!1})),a.createElement(y.Z,{className:"w-full justify-end","data-testid":"cta-buttons",size:16},a.createElement(p.Z,{"data-testid":"cancel-glossary",type:"link",onClick:x},S("label.cancel")),a.createElement(p.Z,{"data-testid":"save-glossary",disabled:!i,htmlType:"submit",loading:s,type:"primary"},S("label.save")))))),minWidth:700,flex:.7},pageTitle:S("label.add-entity",{entity:S("label.glossary")}),secondPanel:{children:U,className:"p-md p-t-xl content-resizable-panel-container",minWidth:400,flex:.3}})},_=n(72819),q=n(1222),J=n(93895),B=n(12981),W=n(96840),H=n(73553),K=n(46321),$=function(){var e=(0,r.k6)(),t=(0,i.BL)().permissions,n=(0,o.CR)((0,a.useState)([]),2),u=n[0],d=n[1],m=(0,o.CR)((0,a.useState)(!1),2),p=m[0],y=m[1],f=(0,o.CR)((0,a.useState)(!1),2),E=f[0],v=f[1],g=(0,o.CR)((0,a.useState)([]),2),h=g[0],M=g[1],N=(0,c.$)().t,T=(0,a.useMemo)((function(){return(0,B.P_)(_.OX.Create,s.A.GLOSSARY,t)}),[t]),b=function(t){void 0===t&&(t=""),e.push((0,W.$x)(t))},A=(0,a.useCallback)((function(){b()}),[]),D=(0,a.useCallback)((function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t,n,a;return(0,o.Jh)(this,(function(r){switch(r.label){case 0:v(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,(0,q.Cn)(e)];case 2:return t=r.sent(),b(null!==(a=t.fullyQualifiedName)&&void 0!==a?a:""),[3,5];case 3:return n=r.sent(),i=(0,J.B)(n,l.c9.alreadyExist)?N("server.entity-already-exist",{entity:N("label.glossary"),entityPlural:N("label.glossary-lowercase-plural"),name:e.name}):n,s=N("server.add-entity-error",{entity:N("label.glossary-lowercase")}),(0,K.Eo)(i,s),[3,5];case 4:return v(!1),[7];case 5:return[2]}var i,s}))}))}),[]);return(0,a.useEffect)((function(){M([{name:N("label.glossary"),url:(0,W.$x)()},{name:N("label.add-entity",{entity:N("label.glossary")}),url:"",activeTitle:!0}])}),[]),a.createElement("div",{className:"self-center"},a.createElement(F,{allowAccess:T,fetchTags:function(){y(!0),(0,H.bn)().then((function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t;return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return e.data?[4,(0,H.bM)(e.data)]:[3,2];case 1:return t=n.sent(),d(t),[3,3];case 2:(0,K.Eo)(N("server.entity-fetch-error",{entity:N("label.tag-plural")})),n.label=3;case 3:return[2]}}))}))})).catch((function(e){(0,K.Eo)(e,N("server.entity-fetch-error",{entity:N("label.tag-plural")}))})).finally((function(){y(!1)}))},header:N("label.add-entity",{entity:N("label.glossary")}),isLoading:E,isTagLoading:p,slashedBreadcrumb:h,tagList:u,onCancel:A,onSave:D}))},X=n(34901),ee=n(96486),te=n(26396),ne=n(35850),ae=n(73546),re=n(3460),le=n(70431),ie=n(59583),se=n(14024),oe=(se.qb.Draft,se.qb.Approved,{Create:!1,Delete:!1,EditAll:!1,EditCustomFields:!1,EditDataProfile:!1,EditDescription:!1,EditDisplayName:!1,EditLineage:!1,EditOwners:!1,EditQueries:!1,EditSampleData:!1,EditTags:!1,EditTests:!1,EditTier:!1,ViewAll:!0,ViewDataProfile:!1,ViewQueries:!1,ViewSampleData:!1,ViewTests:!1,ViewUsage:!1}),ce={Create:!1,Delete:!1,EditAll:!1,ViewAll:!0},ue=(se.qb.Draft,se.lP.User,se.qb.Draft,se.lP.User,se.qb.Draft,se.lP.User,se.lP.User,se.lP.User,se.lP.User,se.lP.User,se.lP.User,se.lP.User,se.lP.User,se.lP.User,se.lP.User,se.lP.User,se.lP.User,se.lP.User,se.lP.User,n(76373)),de=n(62748),me=n(5199),pe=n(50922),ye=n(71230),fe=n(15746),Ee=n(25499),ve=n(58968),ge=n(58369),he=n(24671),Me=n(902),Ne=n(39895),Te=n(57081),be=n(75705),Ae=n(94199),De=n(23031),we=n(38780),xe=n(57599),Ie=n(23909);!function(e){e.System="system",e.User="user"}(Q||(Q={})),function(e){e.Automated="Automated",e.Derived="Derived",e.Manual="Manual",e.Propagated="Propagated"}(P||(P={})),function(e){e.Classification="Classification",e.Glossary="Glossary"}(V||(V={})),function(e){e.Confirmed="Confirmed",e.Suggested="Suggested"}(Y||(Y={}));var Se,Ce=n(79618),Le=n(41101),Oe=n(78153),Ze=n(1727),je=function(e){var t,n,r,i=e.permissions,s=e.selectedData,c=e.isGlossary,u=e.onUpdate,d=e.isVersionView,f=e.onThreadLinkSelect,E=e.refreshGlossaryTerms,v=e.entityType,g=e.editCustomAttributePermission,M=e.onExtensionUpdate,N=(0,a.useMemo)((function(){return i.EditAll||i.EditReviewers}),[i]),b=(0,a.useMemo)((function(){return i.ViewAll}),[i]),A=(0,a.useMemo)((function(){var e,t=[],n=[];return null===(e=s.reviewers)||void 0===e||e.forEach((function(e){e.inherited?t.push(e):n.push(e)})),{inheritedReviewers:t,assignedReviewers:n,hasReviewers:s.reviewers&&s.reviewers.length>0}}),[s.reviewers]),D=A.assignedReviewers,w=A.hasReviewers,x=function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t,n,a,r;return(0,o.Jh)(this,(function(l){switch(l.label){case 0:return t=null!=e?e:[],(0,ee.isEqual)(t,D)?[3,2]:(n=(0,ee.cloneDeep)(s),a=t.filter((function(e){return(0,ee.includes)(D,e)})),r=t.filter((function(e){return!(0,ee.includes)(D,e)})).map((function(e){return{id:e.id,type:e.type}})),n=(0,o.pi)((0,o.pi)({},n),{reviewers:(0,o.ev)((0,o.ev)([],(0,o.CR)(a)),(0,o.CR)(r))}),[4,u(n)]);case 1:l.sent(),l.label=2;case 2:return[2]}}))}))},I=function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t;return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return t=(0,o.pi)((0,o.pi)({},s),{owners:e}),[4,u(t)];case 1:return n.sent(),null==E||E(),[2]}}))}))},S=(0,a.useMemo)((function(){return d?(0,Me.o2)(s,s.changeDescription):s.tags}),[d,s]);return a.createElement(ye.Z,{"data-testid":"entity-right-panel",gutter:[0,40]},a.createElement(fe.Z,{span:24},a.createElement(T.y,{showDomainHeading:!0,domain:s.domain,entityFqn:null!==(t=s.fullyQualifiedName)&&void 0!==t?t:"",entityId:null!==(n=s.id)&&void 0!==n?n:"",entityType:c?h.py.GLOSSARY:h.py.GLOSSARY_TERM,hasPermission:!!c&&i.EditAll})),a.createElement(fe.Z,{"data-testid":"glossary-right-panel-owner-link",span:"24"},a.createElement("div",{className:"d-flex items-center m-b-xs"},a.createElement(m.Z.Text,{className:"right-panel-label"},(0,De.t)("label.owner")),(i.EditOwners||i.EditAll)&&s.owners&&s.owners.length>0&&a.createElement(Ie.C,{hasPermission:i.EditOwners||i.EditAll,listHeight:200,multiple:{user:!0,team:!1},owner:s.owners,onUpdate:function(e){return I(e)}},a.createElement(Ae.Z,{title:(0,De.t)("label.edit-entity",{entity:(0,De.t)("label.owner")})},a.createElement(p.Z,{className:"cursor-pointer flex-center m-l-xss","data-testid":"edit-owner",icon:a.createElement(we.ReactComponent,{color:l.MJ,width:"14px"}),size:"small",type:"text"})))),a.createElement(y.Z,{className:"m-r-xss",size:4},(0,Me.xg)(s,null!=d&&d,h.GB.OWNERS,i.EditOwners||i.EditAll)),0===(null===(r=s.owners)||void 0===r?void 0:r.length)&&(i.EditOwners||i.EditAll)&&a.createElement(Ie.C,{hasPermission:i.EditOwners||i.EditAll,listHeight:200,multiple:{user:!0,team:!1},owner:s.owners,onUpdate:function(e){return I(e)}},a.createElement(Le.Z,{className:"text-primary cursor-pointer",dataTestId:"edit-owner",icon:a.createElement(xe.ReactComponent,{height:16,name:"plus",width:16}),label:(0,De.t)("label.add"),tooltip:""}))),a.createElement(fe.Z,{"data-testid":"glossary-reviewer",span:"24"},a.createElement("div",{className:"d-flex items-center "+(w?"m-b-xss":"")},a.createElement(m.Z.Text,{className:"right-panel-label","data-testid":"glossary-reviewer-heading-name"},(0,De.t)("label.reviewer-plural")),N&&w&&a.createElement(Ie.C,{previewSelected:!0,hasPermission:N,label:(0,De.t)("label.reviewer-plural"),listHeight:200,multiple:{user:!0,team:!1},owner:null!=D?D:[],popoverProps:{placement:"topLeft"},onUpdate:x},a.createElement(Ae.Z,{title:(0,De.t)("label.edit-entity",{entity:(0,De.t)("label.reviewer-plural")})},a.createElement(p.Z,{className:"cursor-pointer flex-center m-l-xss","data-testid":"edit-reviewer-button",icon:a.createElement(we.ReactComponent,{color:l.MJ,width:"14px"}),size:"small",type:"text"})))),a.createElement("div",null,a.createElement("div",{"data-testid":"glossary-reviewer-name"},(0,Me.xg)(s,null!=d&&d,h.GB.REVIEWERS,N)),N&&!w&&a.createElement(Ie.C,{previewSelected:!0,hasPermission:N,label:(0,De.t)("label.reviewer-plural"),listHeight:200,multiple:{user:!0,team:!1},owner:null!=D?D:[],popoverProps:{placement:"topLeft"},onUpdate:x},a.createElement(Le.Z,{className:"text-primary cursor-pointer",icon:a.createElement(xe.ReactComponent,{height:16,name:"plus",width:16}),label:(0,De.t)("label.add"),tooltip:""})))),c&&a.createElement(fe.Z,{span:"24"},a.createElement("div",{"data-testid":"glossary-tags-name"},a.createElement(Oe.Z,{displayType:Ze.F.READ_MORE,entityFqn:s.fullyQualifiedName,entityType:h.py.GLOSSARY,permission:i.EditAll||i.EditTags,selectedTags:null!=S?S:[],tagType:V.Classification,onSelectionChange:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t;return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return e?(t=(0,o.pi)((0,o.pi)({},s),{tags:e}),[4,u(t)]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},onThreadLinkSelect:f}))),a.createElement(fe.Z,{span:"22"},!c&&s&&a.createElement(Ce.t,{isRenderedInRightPanel:!0,entityDetails:s,entityType:v,handleExtensionUpdate:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){return(0,o.Jh)(this,(function(t){switch(t.label){case 0:return[4,null==M?void 0:M(e)];case 1:return t.sent(),[2]}}))}))},hasEditAccess:Boolean(g),hasPermission:b,maxDataCap:5})))},Re=n(57254),ke=n(16165),ze=n(13013),Ge=n(77677),Ue=n(94184),Qe=n.n(Ue),Pe=n(97188),Ve=n(98661),Ye=n(23982),Fe=n(8645),_e=n(4357),qe=n(8655),Je=n(75111),Be=n(96071),We=n(33669),He=n(14128),Ke=n(6711),$e=n(9939),Xe=n(76974),et=n(73213),tt=n(66537),nt=n(69959),at=n(65428),rt=n(50146),lt=n(34041),it=function(e){var t=e.selectedData,n=e.onCancel,r=e.onSubmit,i=(0,c.$)().t,s=(0,o.CR)(d.Z.useForm(),1)[0],u=(0,o.CR)((0,a.useState)({isSaving:!1,isFetching:!0}),2),m=u[0],p=u[1],y=(0,o.CR)((0,a.useState)([]),2),f=y[0],E=y[1];return(0,a.useEffect)((function(){(0,o.mG)(void 0,void 0,void 0,(function(){var e,n;return(0,o.Jh)(this,(function(a){switch(a.label){case 0:p((function(e){return(0,o.pi)((0,o.pi)({},e),{isFetching:!0})})),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,q.yg)({glossary:t.glossary.id,limit:l.AL})];case 2:return e=a.sent().data,E(e.filter((function(e){return e.id!==t.id})).map((function(e){var t;return{label:(0,he.C_)(e),value:null!==(t=e.fullyQualifiedName)&&void 0!==t?t:""}}))),[3,5];case 3:return n=a.sent(),(0,K.Eo)(n),[3,5];case 4:return p((function(e){return(0,o.pi)((0,o.pi)({},e),{isFetching:!1})})),[7];case 5:return[2]}}))}))}),[]),a.createElement(rt.Z,{open:!0,cancelText:i("label.cancel"),okButtonProps:{form:"change-parent-hierarchy-modal",htmlType:"submit",loading:m.isSaving},okText:i("label.submit"),title:i("label.change-entity",{entity:i("label.parent")}),onCancel:n},a.createElement(d.Z,{form:s,id:"change-parent-hierarchy-modal",layout:"vertical",onFinish:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){return(0,o.Jh)(this,(function(t){switch(t.label){case 0:return p((function(e){return(0,o.pi)((0,o.pi)({},e),{isSaving:!0})})),[4,r(e.parent)];case 1:return t.sent(),p((function(e){return(0,o.pi)((0,o.pi)({},e),{isSaving:!1})})),[2]}}))}))}},a.createElement(d.Z.Item,{label:i("label.select-field",{field:i("label.parent")}),name:"parent",rules:[{required:!0,message:i("label.field-required",{field:i("label.parent")})}]},a.createElement(lt.Z,{"data-testid":"change-parent-select",loading:m.isFetching,options:f,placeholder:i("label.select-field",{field:i("label.parent")})}))))},st=n(97696),ot=n(96294),ct=function(e){var t,n=e.selectedData,u=e.permissions,d=e.onUpdate,f=e.onDelete,E=e.isGlossary,v=e.onAssetAdd,g=e.onAddGlossaryTerm,N=e.updateVote,T=e.isVersionView,b=(0,c.$)().t,A=(0,r.k6)(),D=(0,M.N)().currentUser,w=(0,r.UO)().version,x=(0,tt.f)().fqn,I=(0,r.UO)().id,S=(0,Ke.l)().showModal,C=(0,o.CR)((0,a.useState)([]),2),L=C[0],O=C[1],Z=(0,o.CR)((0,a.useState)(!1),2),j=Z[0],R=Z[1],k=(0,o.CR)((0,a.useState)(!1),2),z=k[0],G=k[1],U=(0,o.CR)((0,a.useState)(!1),2),Q=U[0],P=U[1],V=(0,o.CR)((0,a.useState)(),2),Y=V[0],F=V[1],H=(0,o.CR)((0,a.useState)(!1),2),$=H[0],te=H[1],ne=(0,o.CR)((0,a.useState)(!1),2),ae=ne[0],re=ne[1],le=(0,i.BL)().permissions,ie=(0,a.useMemo)((function(){return(0,B.P_)(_.OX.Create,s.A.GLOSSARY_TERM,le)}),[le]),oe=(0,a.useMemo)((function(){return(0,B.P_)(_.OX.All,s.A.GLOSSARY_TERM,le)||(0,B.P_)(_.OX.EditAll,s.A.GLOSSARY_TERM,le)}),[le]),ce=(0,a.useMemo)((function(){var e;return E?null:null!==(e=n.status)&&void 0!==e?e:se.qb.Approved}),[E,n]),ue=(0,a.useMemo)((function(){return u.EditAll||u.EditDisplayName}),[u]),de=(0,a.useMemo)((function(){var e;return(0,he.s3)(null!==(e=null==D?void 0:D.id)&&void 0!==e?e:"",n.votes)}),[n.votes,D]),me=(0,a.useMemo)((function(){var e,t;return E?a.createElement(Ve.ReactComponent,{className:"align-middle",color:l.MJ,height:36,name:"folder",width:32}):(null===(e=n.style)||void 0===e?void 0:e.iconURL)?a.createElement("img",{className:"align-middle object-contain","data-testid":"icon",height:36,src:null===(t=n.style)||void 0===t?void 0:t.iconURL,width:32}):a.createElement(Pe.ReactComponent,{className:"align-middle",color:l.MJ,height:36,name:"doc",width:32})}),[n,E]),Ee=(0,a.useCallback)((function(){g(E?void 0:n)}),[x]),ve=[{label:b("label.glossary-term"),key:"1",onClick:Ee},{label:b("label.asset-plural"),key:"2",onClick:v}],ge=(0,a.useCallback)((function(){return(0,o.mG)(void 0,void 0,void 0,(function(){return(0,o.Jh)(this,(function(e){return n&&S({name:(null==n?void 0:n.fullyQualifiedName)||"",onExport:q.vr}),[2]}))}))}),[n]),Me=(0,o.ev)((0,o.ev)((0,o.ev)((0,o.ev)((0,o.ev)([],(0,o.CR)(E&&oe?[{label:a.createElement(He.v,{description:b("message.export-entity-help",{entity:b("label.glossary-term-lowercase-plural")}),icon:_e.ReactComponent,id:"export-button",name:b("label.export")}),key:"export-button",onClick:function(e){e.domEvent.stopPropagation(),ge(),R(!1)}},{label:a.createElement(He.v,{description:b("message.import-entity-help",{entity:b("label.glossary-term-lowercase")}),icon:qe.ReactComponent,id:"import-button",name:b("label.import")}),key:"import-button",onClick:function(e){e.domEvent.stopPropagation(),function(){var e;A.push((0,W.Px)(null!==(e=n.fullyQualifiedName)&&void 0!==e?e:"",h.uk.IMPORT))}(),R(!1)}}]:[])),(0,o.CR)(ue?[{label:a.createElement(He.v,{description:b("message.rename-entity",{entity:b(E?"label.glossary":"label.glossary-term")}),icon:we.ReactComponent,id:"rename-button",name:b("label.rename")}),key:"rename-button",onClick:function(e){e.domEvent.stopPropagation(),P(!0),R(!1)}}]:[])),(0,o.CR)((null==u?void 0:u.EditAll)&&!E?[{label:a.createElement(He.v,{description:b("message.edit-entity-style-description",{entity:b("label.glossary-term")}),icon:We.ReactComponent,id:"rename-button",name:b("label.style")}),key:"edit-style-button",onClick:function(e){e.domEvent.stopPropagation(),te(!0),R(!1)}}]:[])),(0,o.CR)(E?[]:[{label:a.createElement(He.v,{description:b("message.modify-hierarchy-entity-description",{entity:b("label.term")}),icon:Ye.ReactComponent,id:"change-parent-button",name:b("label.change-parent-entity",{entity:b("label.term")})}),key:"change-parent-button",onClick:function(e){e.domEvent.stopPropagation(),re(!0),R(!1)}}])),(0,o.CR)(u.Delete?[{label:a.createElement(He.v,{description:b("message.delete-entity-type-action-description",{entityType:b(E?"label.glossary":"label.glossary-term")}),icon:Fe.ReactComponent,id:"delete-button",name:b("label.delete")}),key:"delete-button",onClick:function(e){e.domEvent.stopPropagation(),G(!0),R(!1)}}]:[])),Ne=(0,a.useMemo)((function(){var e;if(!E){var t=null!==(e=n.status)&&void 0!==e?e:se.qb.Approved;return a.createElement(ot.k,{status:t})}return null}),[E,n]),Te=(0,a.useMemo)((function(){return u.Create||ie?E?a.createElement(p.Z,{className:"m-l-xs","data-testid":"add-new-tag-button-header",size:"middle",type:"primary",onClick:Ee},b("label.add-entity",{entity:b("label.term-lowercase")})):a.createElement(a.Fragment,null,ce&&ce===se.qb.Approved&&a.createElement(ze.Z,{className:"m-l-xs",menu:{items:ve},placement:"bottomRight",trigger:["click"]},a.createElement(p.Z,{"data-testid":"glossary-term-add-button-menu",type:"primary"},a.createElement(y.Z,null,b("label.add"),a.createElement(Re.Z,null))))):null}),[E,u,ie,ve,ce]);return(0,a.useEffect)((function(){var e=n.fullyQualifiedName,t=n.name;!function(e){if(e){var t=E?[]:nt.Z.split(e),n=[],a=(0,o.ev)([{name:"Glossaries",url:(0,W.$x)(t[0]),activeTitle:!1}],(0,o.CR)(t.slice(0,-1).map((function(e){return n.push(e),{name:e,url:(0,W.$x)(n.join(et.o)),activeTitle:!1}}))));O(a)}}(e||t)}),[n]),(0,a.useEffect)((function(){T&&(0,o.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),E?[4,(0,q.xR)(I)]:[3,2];case 1:return e=n.sent(),[3,4];case 2:return[4,(0,q.CU)(I)];case 3:e=n.sent(),n.label=4;case 4:return F(e),[3,6];case 5:return t=n.sent(),(0,K.Eo)(t),[3,6];case 6:return[2]}}))}))}),[I]),a.createElement(a.Fragment,null,a.createElement(ye.Z,{gutter:[0,16],justify:"space-between",wrap:!1},a.createElement(fe.Z,{className:"d-flex",flex:"auto"},a.createElement($e.g,{badge:Ne,breadcrumb:L,entityData:n,entityType:h.py.GLOSSARY_TERM,icon:me,serviceName:"",titleColor:E||null===(t=n.style)||void 0===t?void 0:t.color})),a.createElement(fe.Z,{flex:"360px"},a.createElement("div",{className:"d-flex gap-2 justify-end"},Te,a.createElement(Ge.default,{className:"p-l-xs",size:"small"},N&&a.createElement(at.Z,{voteStatus:de,votes:n.votes,onUpdateVote:N}),n&&n.version&&a.createElement(Ae.Z,{title:b("label."+(T?"exit-version-history":"version-plural-history"))},a.createElement(p.Z,{className:Qe()("",{"text-primary border-primary":w}),"data-testid":"version-button",icon:a.createElement(ke.Z,{component:Je.ReactComponent}),onClick:function(){return(0,o.mG)(void 0,void 0,void 0,(function(){var e;return(0,o.Jh)(this,(function(t){return e=T?(0,W.$x)(null==Y?void 0:Y.fullyQualifiedName):E?(0,W.p3)(n.id,(0,ee.toString)(n.version)):(0,W.tP)(n.id,(0,ee.toString)(n.version)),A.push(e),[2]}))}))}},a.createElement(m.Z.Text,{className:Qe()("",{"text-primary":w})},(0,ee.toString)(n.version)))),!T&&Me.length>0&&a.createElement(ze.Z,{align:{targetOffset:[-12,0]},className:"m-l-xs",menu:{items:Me},open:j,overlayClassName:"glossary-manage-dropdown-list-container",overlayStyle:{width:"350px"},placement:"bottomRight",trigger:["click"],onOpenChange:R},a.createElement(Ae.Z,{placement:"topRight",title:b("label.manage-entity",{entity:b(E?"label.glossary":"label.glossary-term")})},a.createElement(p.Z,{className:"glossary-manage-dropdown-button tw-px-1.5","data-testid":"manage-button",icon:a.createElement(Be.ReactComponent,{className:"vertical-align-inherit manage-dropdown-icon"}),onClick:function(){return R(!0)}}))))))),n&&a.createElement(pe.Z,{bodyText:(0,J.fP)(n.name,""),entityName:n.name,entityType:"Glossary",visible:z,onCancel:function(){return G(!1)},onConfirm:function(){return(0,o.mG)(void 0,void 0,void 0,(function(){var e;return(0,o.Jh)(this,(function(t){switch(t.label){case 0:return e=n.id,[4,f(e)];case 1:return t.sent(),G(!1),[2]}}))}))}}),a.createElement(Xe.Z,{allowRename:!0,entity:n,title:b("label.edit-entity",{entity:b("label.name")}),visible:Q,onCancel:function(){return P(!1)},onSave:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t,a,r;return(0,o.Jh)(this,(function(l){switch(l.label){case 0:return t=e.name,a=e.displayName,(0,ee.cloneDeep)(n),r=(0,o.pi)((0,o.pi)({},n),{name:(null==t?void 0:t.trim())||n.name,displayName:null==a?void 0:a.trim()}),[4,d(r)];case 1:return l.sent(),P(!1),[2]}}))}))}}),a.createElement(st.Z,{open:$,style:n.style,onCancel:function(){return te(!1)},onSubmit:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t,a;return(0,o.Jh)(this,(function(r){switch(r.label){case 0:return t={color:e.color?e.color:void 0,iconURL:e.iconURL?e.iconURL:void 0},a=(0,o.pi)((0,o.pi)({},n),{style:t}),[4,d(a)];case 1:return r.sent(),te(!1),[2]}}))}))}}),ae&&a.createElement(it,{selectedData:n,onCancel:function(){return re(!1)},onSubmit:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t,a,r,l,i,s;return(0,o.Jh)(this,(function(c){switch(c.label){case 0:t=(0,o.pi)((0,o.pi)({},n),{parent:{fullyQualifiedName:e}}),a=(0,X.qu)(n,t),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,(0,q.zx)(n.id,a)];case 2:return r=c.sent(),l=r.fullyQualifiedName,i=r.name,A.push((0,W.$x)(null!=l?l:i)),[3,5];case 3:return s=c.sent(),(0,K.Eo)(s),[3,5];case 4:return re(!1),[7];case 5:return[2]}}))}))}}))},ut=n(17405),dt=n(53014),mt=n(14129),pt=n(57865),yt=n(76),ft=n(83227),Et=n(2144),vt=n(33394),gt=n(84519),ht=n(63111),Mt=n(51654),Nt=n(38048),Tt=n(42163),bt=n(92693),At=n(35342),Dt=n(61105),wt=n(9446),xt=n(37565),It=(0,n(30270).Ue)()((function(e,t){return{glossaries:[],activeGlossary:{},glossaryChildTerms:[],setGlossaries:function(t){e({glossaries:t})},updateGlossary:function(n){var a=t().glossaries.map((function(e){return e.fullyQualifiedName===n.fullyQualifiedName?n:e}));e({glossaries:a})},setActiveGlossary:function(t){e({activeGlossary:t})},updateActiveGlossary:function(n){var a=t(),r=a.activeGlossary,l=a.glossaries,i=(0,o.pi)((0,o.pi)({},r),n);e({activeGlossary:i});var s=l.findIndex((function(e){return e.fullyQualifiedName===i.fullyQualifiedName}));-1!==s&&(l[s]=i)},setGlossaryChildTerms:function(t){e({glossaryChildTerms:t})}}})),St=function(e){var t,n,r,i=e.refreshGlossaryTerms,s=e.permissions,u=e.isGlossary,d=e.termsLoading,m=e.onAddGlossaryTerm,f=e.onEditGlossaryTerm,E=e.className,v=It(),g=v.activeGlossary,N=v.glossaryChildTerms,T=v.setGlossaryChildTerms,A=(0,M.N)().theme,D=(0,c.$)().t,w=null!==(t=N)&&void 0!==t?t:[],x=(0,o.CR)((0,a.useState)(),2),I=x[0],S=x[1],C=(0,o.CR)((0,a.useState)(!1),2),L=C[0],O=C[1],Z=(0,o.CR)((0,a.useState)(!1),2),j=Z[0],R=Z[1],k=(0,o.CR)((0,a.useState)(!1),2),z=k[0],G=k[1],U=(0,o.CR)((0,a.useState)([]),2),Q=U[0],P=U[1],V=(0,a.useMemo)((function(){var e;return u?null:null!==(e=g.status)&&void 0!==e?e:se.qb.Approved}),[u,g]),Y=(0,a.useMemo)((function(){return(0,wt.i9)(w)}),[w]),F=(0,a.useMemo)((function(){var e=[{title:D("label.term-plural"),dataIndex:"name",key:"name",className:"glossary-name-column",ellipsis:!0,width:"40%",render:function(e,t){var n,r,l=(0,he.C_)(t);return a.createElement(a.Fragment,null,(null===(n=t.style)||void 0===n?void 0:n.iconURL)&&a.createElement("img",{className:"m-r-xss vertical-baseline","data-testid":"tag-icon",height:12,src:t.style.iconURL}),a.createElement(yt.Link,{className:"cursor-pointer vertical-baseline","data-testid":l,style:{color:null===(r=t.style)||void 0===r?void 0:r.color},to:(0,W.$x)(t.fullyQualifiedName||t.name)},l))}},{title:D("label.description"),dataIndex:"description",key:"description",width:s.Create?"21%":"33%",render:function(e){return e.trim()?a.createElement(Nt.Z,{enableSeeMoreVariant:!0,markdown:e,maxLength:120}):a.createElement("span",{className:"text-grey-muted"},D("label.no-description"))}},{title:D("label.owner"),dataIndex:"owners",key:"owners",width:"17%",render:function(e){return a.createElement(b.V,{owners:e})}},{title:D("label.status"),dataIndex:"status",key:"status",width:"12%",filterIcon:function(e){return a.createElement(ut.Z,{style:{color:e?A.primaryColor:void 0}})},filters:wt.hn,render:function(e,t){var n,r=null!==(n=t.status)&&void 0!==n?n:se.qb.Approved;return a.createElement(Tt.Z,{dataTestId:t.fullyQualifiedName+"-status",label:r,status:wt._k[r]})},onFilter:function(e,t){return t.status===e}}];return s.Create&&e.push({title:D("label.action-plural"),key:"new-term",width:"10%",render:function(e,t){var n,r=(null!==(n=t.status)&&void 0!==n?n:se.qb.Approved)===se.qb.Approved;return a.createElement("div",{className:"d-flex items-center"},r&&a.createElement(Ae.Z,{title:D("label.add-entity",{entity:D("label.glossary-term")})},a.createElement(p.Z,{className:"add-new-term-btn text-grey-muted flex-center","data-testid":"add-classification",icon:a.createElement(Mt.ReactComponent,{color:l.MJ,width:"14px"}),size:"small",type:"text",onClick:function(){m(t)}})),a.createElement(Ae.Z,{title:D("label.edit-entity",{entity:D("label.glossary-term")})},a.createElement(p.Z,{className:"cursor-pointer flex-center","data-testid":"edit-button",icon:a.createElement(we.ReactComponent,{color:l.MJ,width:"14px"}),size:"small",type:"text",onClick:function(){return f(t)}})))}}),e}),[w,s]),_=(0,a.useMemo)((function(){return{expandIcon:function(e){var t,n=e.expanded,r=e.onExpand,i=e.record,s=i.children,o=i.childrenCount;return null!==(t=null!=o?o:null==s?void 0:s.length)&&void 0!==t&&t?a.createElement(a.Fragment,null,a.createElement(ft.ReactComponent,{className:"m-r-xs drag-icon",height:12,width:8}),a.createElement(dt.Z,{className:"m-r-xs vertical-baseline",component:n?Et.ReactComponent:vt.ReactComponent,"data-testid":"expand-icon",style:{fontSize:"10px",color:l.y3},onClick:function(e){return r(i,e)}})):a.createElement(a.Fragment,null,a.createElement(ft.ReactComponent,{className:"m-r-xs drag-icon",height:12,width:8}),a.createElement("span",{className:"expand-cell-empty-icon-container"}))},expandedRowKeys:Q,onExpand:function(e,t){return(0,o.mG)(void 0,void 0,void 0,(function(){var n,r,l,i,s;return(0,o.Jh)(this,(function(c){switch(c.label){case 0:return e?(null==(n=t.children)?void 0:n.length)?[3,2]:[4,(0,q.Kc)(t.fullyQualifiedName||"")]:[3,3];case 1:r=c.sent().data,l=null!==(i=(0,ee.cloneDeep)(w))&&void 0!==i?i:[],(0,wt.n7)(l,null!==(s=t.fullyQualifiedName)&&void 0!==s?s:"").children=r,T(l),n=r,c.label=2;case 2:return P((0,o.ev)((0,o.ev)([],(0,o.CR)(Q)),[t.fullyQualifiedName||""])),[2,n];case 3:P(Q.filter((function(e){return e!==t.fullyQualifiedName}))),c.label=4;case 4:return[2,a.createElement(ne.Z,null)]}}))}))}}}),[w,T,Q]),B=(0,a.useCallback)((function(e,t){return(0,o.mG)(void 0,void 0,void 0,(function(){var n,a;return(0,o.Jh)(this,(function(r){return n=2===nt.Z.split(null!==(a=e.fullyQualifiedName)&&void 0!==a?a:"").length,(0,ee.isUndefined)(t)&&n||e.id===(null==t?void 0:t.id)||(S({from:e,to:t}),O(!0)),[2]}))}))}),[]),H=function(e){return G(e)},$=(0,a.useCallback)((function(){O(!1),G(!1)}),[]),ae=(0,a.useMemo)((function(){return Q.length===Y.length}),[Q,Y]);return d?a.createElement(ne.Z,null):(0,ee.isEmpty)(w)?a.createElement(te.Z,{className:"m-t-xlg",doc:bt.cK,heading:D("label.glossary-term"),permission:s.Create,placeholderText:D("message.no-glossary-term"),type:s.Create&&V===se.qb.Approved?Dt.Wx.CREATE:Dt.Wx.NO_DATA,onClick:function(){m(u?void 0:g)}}):a.createElement(ye.Z,{className:E,gutter:[0,16]},a.createElement(fe.Z,{span:24},a.createElement("div",{className:"d-flex justify-end"},a.createElement(p.Z,{className:"text-primary m-b-sm","data-testid":"expand-collapse-all-button",size:"small",type:"text",onClick:function(){Q.length===Y.length?P([]):(0,o.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return R(!0),[4,(0,q.yg)({glossary:(null==g?void 0:g.id)||"",limit:l.AL,fields:[h.GB.OWNERS,h.GB.PARENT,h.GB.CHILDREN]})];case 1:return e=n.sent().data,T((0,wt.fX)(e)),t=e.reduce((function(e,t){var n,a;return(null===(n=t.children)||void 0===n?void 0:n.length)&&e.push(null!==(a=t.fullyQualifiedName)&&void 0!==a?a:""),e}),[]),P(t),R(!1),[2]}}))}))}},a.createElement(y.Z,{align:"center",size:4},ae?a.createElement(gt.ReactComponent,{color:l.MJ,height:"14px"}):a.createElement(ht.ReactComponent,{color:l.MJ,height:"14px"}),D(ae?"label.collapse-all":"label.expand-all")))),w.length>0?a.createElement(mt.W,{backend:pt.PD},a.createElement(xt.Z,{bordered:!0,className:Qe()("drop-over-background",{"drop-over-table":z}),columns:F,components:At.SX,dataSource:w,expandable:_,loading:j,pagination:!1,rowKey:"fullyQualifiedName",size:"small",tableLayout:"fixed",onHeaderRow:function(){return{handleMoveRow:B,handleTableHover:H}},onRow:function(e,t){return{index:t,handleMoveRow:B,handleTableHover:H,record:e}}})):a.createElement(te.Z,null),a.createElement(rt.Z,{centered:!0,destroyOnClose:!0,closable:!1,confirmLoading:j,"data-testid":"confirmation-modal",maskClosable:!1,okText:D("label.confirm"),open:L,title:D("label.move-the-entity",{entity:D("label.glossary-term")}),onCancel:$,onOk:function(){return(0,o.mG)(void 0,void 0,void 0,(function(){var e,t,n,a;return(0,o.Jh)(this,(function(r){switch(r.label){case 0:if(!I)return[3,5];R(!0),e=(0,o.pi)((0,o.pi)({},I.from),{parent:(0,ee.isUndefined)(I.to)?null:{fullyQualifiedName:I.to.fullyQualifiedName}}),t=(0,X.qu)(I.from,e),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,(0,q.zx)((null===(a=I.from)||void 0===a?void 0:a.id)||"",t)];case 2:return r.sent(),i&&i(),[3,5];case 3:return n=r.sent(),(0,K.Eo)(n),[3,5];case 4:return R(!1),O(!1),G(!1),[7];case 5:return[2]}}))}))}},a.createElement(J.u1,{i18nKey:"message.entity-transfer-message",renderElement:a.createElement("strong",null),values:{from:null==I?void 0:I.from.name,to:null!==(r=null===(n=null==I?void 0:I.to)||void 0===n?void 0:n.name)&&void 0!==r?r:g&&(0,he.C_)(g),entity:(0,ee.isUndefined)(null==I?void 0:I.to)?"":D("label.term-lowercase")}}))))},Ct=n(20100),Lt={};Lt.styleTagTransform=z(),Lt.setAttributes=Z(),Lt.insert=L().bind(null,"head"),Lt.domAPI=S(),Lt.insertStyleElement=R(),x()(Ct.Z,Lt),Ct.Z&&Ct.Z.locals&&Ct.Z.locals,function(e){e.TERMS="terms",e.ACTIVITY_FEED="activity_feed"}(Se||(Se={}));var Ot,Zt=function(e){var t=e.permissions,n=e.updateGlossary,i=e.updateVote,s=e.handleGlossaryDelete,u=e.termsLoading,d=e.refreshGlossaryTerms,m=e.onAddGlossaryTerm,p=e.onEditGlossaryTerm,f=e.isVersionView,E=e.onThreadLinkSelect,v=(0,c.$)().t,g=(0,r.k6)(),M=It().activeGlossary,N=(0,r.UO)().tab,T=(0,o.CR)((0,a.useState)(ve.lh),2),b=T[0],D=T[1],w=(0,o.CR)((0,a.useState)(!1),2),x=w[0],I=w[1],S=(0,a.useCallback)((function(e){D(e)}),[]),C=function(){var e;(0,J.Aq)(h.py.GLOSSARY,null!==(e=M.fullyQualifiedName)&&void 0!==e?e:"",S)},L=function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){return(0,o.Jh)(this,(function(t){switch(t.label){case 0:return[4,n(e)];case 1:return t.sent(),C(),[2]}}))}))},O=function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t;return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return M.description===e?[3,2]:(t=(0,o.pi)((0,o.pi)({},M),{description:e}),[4,L(t)]);case 1:return n.sent(),I(!1),[3,3];case 2:I(!1),n.label=3;case 3:return[2]}}))}))},Z=(0,a.useMemo)((function(){return f?(0,Me._Y)(M.changeDescription,ge.Sn.DESCRIPTION,M.description):M.description}),[M,f]),j=(0,a.useMemo)((function(){return f?(0,Me._Y)(M.changeDescription,ge.Sn.NAME,M.name):M.name}),[M,f]),R=(0,a.useMemo)((function(){return f?(0,Me._Y)(M.changeDescription,ge.Sn.DISPLAYNAME,M.displayName):M.displayName}),[M,f]),k=(0,a.useMemo)((function(){return a.createElement(ye.Z,{className:"h-full",gutter:[32,0]},a.createElement(fe.Z,{className:"glossary-height-with-resizable-panel",span:24},a.createElement(A.Z,{firstPanel:{className:"glossary-resizable-panel-container",children:a.createElement("div",{className:"p-y-md p-x-md glossary-content-container"},a.createElement(y.Z,{className:"w-full",direction:"vertical",size:24},a.createElement(Te.Z,{description:Z,entityFqn:M.fullyQualifiedName,entityName:(0,he.C_)(M),entityType:h.py.GLOSSARY,hasEditAccess:t.EditDescription||t.EditAll,isDescriptionExpanded:(0,ee.isEmpty)(M.children),isEdit:x,owner:null==M?void 0:M.owners,showActions:!M.deleted,onCancel:function(){return I(!1)},onDescriptionEdit:function(){return I(!0)},onDescriptionUpdate:O,onThreadLinkSelect:E}),a.createElement(St,{isGlossary:!0,permissions:t,refreshGlossaryTerms:d,termsLoading:u,onAddGlossaryTerm:m,onEditGlossaryTerm:p}))),minWidth:800,flex:.75},secondPanel:{children:a.createElement(je,{isGlossary:!0,entityType:h.py.GLOSSARY_TERM,isVersionView:f,permissions:t,refreshGlossaryTerms:d,selectedData:M,onThreadLinkSelect:E,onUpdate:L}),minWidth:320,flex:.25,className:"entity-resizable-right-panel-container glossary-resizable-panel-container"}})))}),[f,t,M,u,Z,x]),z=(0,a.useMemo)((function(){var e;return(0,o.ev)([{label:a.createElement(be.Z,{id:Se.TERMS,isActive:N===Se.TERMS,name:v("label.term-plural")}),key:Se.TERMS,children:k}],(0,o.CR)(f?[]:[{label:a.createElement(be.Z,{count:b.totalCount,id:Se.ACTIVITY_FEED,isActive:N===Se.ACTIVITY_FEED,name:v("label.activity-feed-and-task-plural")}),key:Se.ACTIVITY_FEED,children:a.createElement(Ne.K,{refetchFeed:!0,entityFeedTotalCount:b.totalCount,entityType:h.py.GLOSSARY,fqn:null!==(e=M.fullyQualifiedName)&&void 0!==e?e:"",hasGlossaryReviewer:!(0,ee.isEmpty)(M.reviewers),owners:M.owners,onFeedUpdate:C,onUpdateEntityDetails:ee.noop})}]))}),[k,M.fullyQualifiedName,b.conversationCount,b.totalTasksCount,N,f]);return(0,a.useEffect)((function(){C()}),[M.fullyQualifiedName]),a.createElement(ye.Z,{className:"glossary-details","data-testid":"glossary-details",gutter:[0,16]},a.createElement(fe.Z,{className:"p-x-md",span:24},a.createElement(ct,{isGlossary:!0,isVersionView:f,permissions:t,selectedData:(0,o.pi)((0,o.pi)({},M),{displayName:R,name:j}),updateVote:i,onAddGlossaryTerm:m,onDelete:s,onUpdate:L})),a.createElement(fe.Z,{span:24},a.createElement(Ee.Z,{activeKey:null!=N?N:Se.TERMS,className:"glossary-details-page-tabs","data-testid":"tabs",items:z,onChange:function(e){var t;e!==N&&g.push((0,l.kJ)(null!==(t=M.fullyQualifiedName)&&void 0!==t?t:"",e))}})))},jt=n(4107),Rt=n(16139),kt=function(e){var t,n,r,l,i,s=e.editMode,c=e.onSave,m=e.glossaryTerm,f=e.formRef,h=(0,M.N)().currentUser,N=null!==(t=d.Z.useWatch("owners",f))&&void 0!==t?t:[],T=Array.isArray(N)?N:[N],A=null!==(n=d.Z.useWatch("reviewers",f))&&void 0!==n?n:[],D=Array.isArray(A)?A:[A],w=d.Z.useWatch("mutuallyExclusive",f),x=function(e){return e.map((function(e){return e.value}))};(0,a.useEffect)((function(){if((null==m?void 0:m.reviewers)&&m.reviewers.length>0&&f.setFieldValue("reviewers",null==m?void 0:m.reviewers),s&&m){var e=m.name,t=m.displayName,n=m.description,a=m.synonyms,r=m.tags,l=m.references,i=m.mutuallyExclusive,o=m.reviewers,c=m.owners,u=m.relatedTerms,d=m.style;f.setFieldsValue({name:e,displayName:t,description:n,synonyms:a,tags:r,references:l,mutuallyExclusive:i,relatedTerms:null==u?void 0:u.map((function(e){var t;return null!==(t=e.fullyQualifiedName)&&void 0!==t?t:""}))}),o&&f.setFieldValue("reviewers",o),(null==d?void 0:d.color)&&f.setFieldValue("color",d.color),(null==d?void 0:d.iconURL)&&f.setFieldValue("iconURL",d.iconURL),c&&f.setFieldValue("owners",c)}}),[s,m,null==m?void 0:m.reviewers,f]);var I=[{name:"name",id:"root/name",label:(0,De.t)("label.name"),required:!0,placeholder:(0,De.t)("label.name"),type:E.Uv.TEXT,props:{"data-testid":"name"},rules:g.m},{name:"displayName",id:"root/displayName",label:(0,De.t)("label.display-name"),required:!1,placeholder:(0,De.t)("label.display-name"),type:E.Uv.TEXT,props:{"data-testid":"display-name"}},{name:"description",required:!0,label:(0,De.t)("label.description"),id:"root/description",type:E.Uv.DESCRIPTION,props:{"data-testid":"description",initialValue:"",height:"auto"},rules:[{required:!0,whitespace:!0,message:(0,De.t)("label.field-required",{field:(0,De.t)("label.description")})}]},{name:"tags",required:!1,label:(0,De.t)("label.tag-plural"),id:"root/tags",type:E.Uv.TAG_SUGGESTION,props:{"data-testid":"tags-container",initialOptions:null===(r=null==m?void 0:m.tags)||void 0===r?void 0:r.map((function(e){return{label:e.tagFQN,value:e.tagFQN,data:e}}))}},{name:"synonyms",required:!1,label:(0,De.t)("label.synonym-plural"),id:"root/synonyms",type:E.Uv.SELECT,props:{className:"glossary-select","data-testid":"synonyms",mode:"tags",placeholder:(0,De.t)("message.synonym-placeholder"),open:!1}},{name:"relatedTerms",required:!1,label:(0,De.t)("label.related-term-plural"),id:"root/relatedTerms",type:E.Uv.ASYNC_SELECT_LIST,props:{className:"glossary-select","data-testid":"related-terms",mode:"multiple",placeholder:(0,De.t)("label.add-entity",{entity:(0,De.t)("label.related-term-plural")}),fetchOptions:H.nj,initialOptions:null===(l=null==m?void 0:m.relatedTerms)||void 0===l?void 0:l.map((function(e){return{label:e.fullyQualifiedName,value:e.fullyQualifiedName,data:e}})),filterOptions:[null!==(i=null==m?void 0:m.fullyQualifiedName)&&void 0!==i?i:""]}},{name:"iconURL",id:"root/iconURL",label:(0,De.t)("label.icon-url"),required:!1,placeholder:(0,De.t)("label.icon-url"),type:E.Uv.TEXT,helperText:(0,De.t)("message.govern-url-size-message"),props:{"data-testid":"icon-url",tooltipPlacement:"right"}},{name:"color",id:"root/color",label:(0,De.t)("label.color"),required:!1,type:E.Uv.COLOR_PICKER,rules:[{pattern:Rt.H1,message:(0,De.t)("message.hex-color-validation")}]},{name:"mutuallyExclusive",label:(0,De.t)("label.mutually-exclusive"),type:E.Uv.SWITCH,required:!1,props:{"data-testid":"mutually-exclusive-button"},id:"root/mutuallyExclusive",formItemLayout:E.EP.HORIZONTAL,helperText:(0,De.t)("message.mutually-exclusive-alert",{entity:(0,De.t)("label.glossary-term"),"child-entity":(0,De.t)("label.glossary-term")}),helperTextType:E.fn.ALERT,showHelperText:Boolean(w)}],S={name:"owners",id:"root/owner",required:!1,label:(0,De.t)("label.owner"),type:E.Uv.USER_TEAM_SELECT,props:{hasPermission:!0,children:a.createElement(p.Z,{"data-testid":"add-owner",icon:a.createElement(u.Z,{style:{color:"white",fontSize:"12px"}}),size:"small",type:"primary"}),multiple:{user:!0,team:!1}},formItemLayout:E.EP.HORIZONTAL,formItemProps:{valuePropName:"owners",trigger:"onUpdate"}},C={name:"reviewers",id:"root/reviewers",required:!1,label:(0,De.t)("label.reviewer-plural"),type:E.Uv.USER_TEAM_SELECT,props:{hasPermission:!0,filterCurrentUser:!0,popoverProps:{placement:"topLeft"},multiple:{user:!0,team:!1},previewSelected:!0,label:(0,De.t)("label.reviewer-plural"),children:a.createElement(p.Z,{"data-testid":"add-reviewers",icon:a.createElement(u.Z,{style:{color:"white",fontSize:"12px"}}),size:"small",type:"primary"})},formItemLayout:E.EP.HORIZONTAL,formItemProps:{valuePropName:"selectedUsers",trigger:"onUpdate"}};return a.createElement(a.Fragment,null,a.createElement(d.Z,{form:f,initialValues:{description:s&&m?m.description:""},layout:"vertical",onFinish:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t,n,a,r,l,i,u,d,p,y,f,E,v,g,M,N,b,A,w,I,S;return(0,o.Jh)(this,(function(o){switch(o.label){case 0:return t=e.name,n=e.displayName,a=void 0===n?"":n,r=e.description,l=void 0===r?"":r,i=e.synonyms,u=void 0===i?[]:i,d=e.tags,p=void 0===d?[]:d,y=e.mutuallyExclusive,f=void 0!==y&&y,E=e.references,v=void 0===E?[]:E,g=e.relatedTerms,M=void 0===g?[]:g,N=e.color,b=e.iconURL,A=T.length>0?T:[{id:null!==(S=null==h?void 0:h.id)&&void 0!==S?S:"",type:"user"}],w={color:N,iconURL:b},I={name:t.trim(),displayName:null==a?void 0:a.trim(),description:l,reviewers:D,relatedTerms:s?M.map((function(e){var t,n,a,r;return(0,ee.isString)(e)?null===(n=null===(t=null==m?void 0:m.relatedTerms)||void 0===t?void 0:t.find((function(t){return t.fullyQualifiedName===e})))||void 0===n?void 0:n.id:e.data?e.data.id:null===(r=null===(a=null==m?void 0:m.relatedTerms)||void 0===a?void 0:a.find((function(t){return t.fullyQualifiedName===e.value})))||void 0===r?void 0:r.id})):x(M),references:v.length>0?v:void 0,synonyms:u,mutuallyExclusive:f,tags:p,owners:A,style:(0,ee.isEmpty)(w)?void 0:w},[4,c(I)];case 1:return o.sent(),[2]}}))}))}},(0,v.GL)(I),a.createElement(d.Z.List,{name:"references"},(function(e,t){var n=t.add,r=t.remove;return a.createElement(a.Fragment,null,a.createElement(d.Z.Item,{className:"form-item-horizontal",colon:!1,label:(0,De.t)("label.reference-plural")},a.createElement(p.Z,{"data-testid":"add-reference",icon:a.createElement(u.Z,{style:{color:"white",fontSize:"12px"}}),size:"small",type:"primary",onClick:function(){n()}})),e.map((function(e,t){return a.createElement(ye.Z,{gutter:[8,0],key:e.key},a.createElement(fe.Z,{span:11},a.createElement(d.Z.Item,{name:[e.name,"name"],rules:[{required:!0,message:""+(0,De.t)("message.field-text-is-required",{fieldText:(0,De.t)("label.name")})}]},a.createElement(jt.Z,{id:"name-"+t,placeholder:(0,De.t)("label.name")}))),a.createElement(fe.Z,{span:11},a.createElement(d.Z.Item,{name:[e.name,"endpoint"],rules:[{required:!0,message:(0,De.t)("message.valid-url-endpoint"),type:"url"}]},a.createElement(jt.Z,{id:"url-"+t,placeholder:(0,De.t)("label.endpoint")}))),a.createElement(fe.Z,{span:2},a.createElement(p.Z,{icon:a.createElement(Fe.ReactComponent,{width:16}),size:"small",type:"text",onClick:function(){r(e.name)}})))})))})),a.createElement("div",{className:"m-t-xss"},(0,v.rz)(S),Boolean(T.length)&&a.createElement(y.Z,{wrap:!0,"data-testid":"owner-container",size:[8,8]},a.createElement(b.V,{owners:T}))),a.createElement("div",{className:"m-t-xss"},(0,v.rz)(C),Boolean(D.length)&&a.createElement(y.Z,{wrap:!0,"data-testid":"reviewers-container",size:[8,8]},a.createElement(b.V,{owners:D})))))},zt=function(e){var t=e.editMode,n=e.visible,r=e.glossaryTermFQN,l=e.onSave,i=e.onCancel,s=(0,c.$)().t,u=(0,o.CR)((0,f.useForm)(),1)[0],d=(0,o.CR)((0,a.useState)(!0),2),m=d[0],y=d[1],E=(0,o.CR)((0,a.useState)(!1),2),v=E[0],g=E[1],M=(0,o.CR)((0,a.useState)(),2),N=M[0],T=M[1],b=(0,a.useMemo)((function(){return s(t?"label.edit-entity":"label.add-entity",{entity:s("label.glossary-term")})}),[t]),A=(0,a.useCallback)((function(){return(0,o.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),[4,(0,q.GM)(r,{fields:[h.GB.OWNERS,h.GB.REVIEWERS,h.GB.TAGS,h.GB.RELATED_TERMS]})];case 1:return e=n.sent(),T(e),[3,4];case 2:return t=n.sent(),(0,K.Eo)(t),[3,4];case 3:return y(!1),[7];case 4:return[2]}}))}))}),[r]);return(0,a.useEffect)((function(){t?A():y(!1),!n&&u.resetFields()}),[n]),a.createElement(rt.Z,{centered:!0,destroyOnClose:!0,cancelText:s("label.cancel"),className:"edit-glossary-modal",closable:!1,"data-testid":"edit-glossary-modal",footer:[a.createElement(p.Z,{key:"cancel-btn",type:"link",onClick:i},s("label.cancel")),a.createElement(p.Z,{"data-testid":"save-glossary-term",key:"save-btn",loading:v,type:"primary",onClick:u.submit},s("label.save"))],maskClosable:!1,okText:s("label.save"),open:n,title:b,width:800,onCancel:i},m?a.createElement(ne.Z,null):a.createElement(kt,{editMode:t,formRef:u,glossaryTerm:N,onCancel:i,onSave:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){return(0,o.Jh)(this,(function(t){switch(t.label){case 0:g(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,l(e)];case 2:return t.sent(),[3,4];case 3:return g(!1),[7];case 4:return[2]}}))}))}}))},Gt=n(22653),Ut=n(39117),Qt=n(40734),Pt=n(18700),Vt=n(66208),Yt=n(8035),Ft=n(90058),_t=n(82833),qt=n(76772),Jt=n(87109),Bt=n(29108),Wt=n(89084);!function(e){e[e.INITIAL=0]="INITIAL",e[e.VALIDATING=1]="VALIDATING",e[e.FAILED=2]="FAILED",e[e.UPDATING=3]="UPDATING",e[e.SUCCESS=4]="SUCCESS"}(Ot||(Ot={}));var Ht=function(e){var t=e.glossaryTerm,n=e.onValidationSuccess,r=e.onCancel,l=e.updatedTags,i=(0,o.CR)((0,a.useState)(),2),s=i[0],u=i[1],d=(0,o.CR)((0,a.useState)(),2),f=d[0],E=d[1],v=(0,o.CR)((0,a.useState)(Ot.INITIAL),2),g=v[0],h=v[1],M=(0,c.$)().t,N=function(){return(0,o.mG)(void 0,void 0,void 0,(function(){var e,a,i;return(0,o.Jh)(this,(function(s){switch(s.label){case 0:h(Ot.VALIDATING),s.label=1;case 1:return s.trys.push([1,10,,11]),[4,(0,q.tc)((0,o.pi)((0,o.pi)({},t),{tags:l}),!0)];case 2:if((e=s.sent()).status!==Wt.q.Success)return[3,8];h(Ot.UPDATING),s.label=3;case 3:return s.trys.push([3,5,6,7]),[4,n()];case 4:return s.sent(),h(Ot.SUCCESS),[3,7];case 5:return s.sent(),[3,7];case 6:return setTimeout(r,500),[7];case 7:return[3,9];case 8:h(Ot.FAILED),u(e),s.label=9;case 9:return[3,11];case 10:return a=s.sent(),E(null===(i=a.response)||void 0===i?void 0:i.data),h(Ot.FAILED),[3,11];case 11:return[2]}}))}))},T=(0,a.useMemo)((function(){return[{title:M("label.asset-plural"),dataIndex:"request",key:"request",render:function(e){var t;return a.createElement(yt.Link,{target:"_blank",to:(0,he.pI)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"",e.type)},e.fullyQualifiedName)}},{title:M("label.failure-reason"),dataIndex:"message",key:"message",render:function(e){return a.createElement(m.Z.Paragraph,null,e)}}]}),[]),b=g===Ot.VALIDATING?10:g===Ot.UPDATING?60:100,A=(0,a.useMemo)((function(){var e,n=a.createElement("div",{className:"d-flex justify-between"},a.createElement(m.Z.Text,{type:"secondary"},(null==s?void 0:s.numberOfRowsFailed)&&s.numberOfRowsFailed+" "+M("label.failed")),a.createElement(p.Z,{onClick:r},M("label.cancel"))),l=a.createElement("div",{className:"text-center"},a.createElement(_t.Z,{percent:b,status:"normal",type:"circle"}));switch(g){case Ot.INITIAL:return{footer:null,content:a.createElement("div",{className:"d-flex items-center flex-column gap-2"},a.createElement(ke.Z,{className:"m-b-lg",component:Jt.ReactComponent,style:{fontSize:"60px"}}),a.createElement(m.Z.Title,{level:5},M("message.tag-update-confirmation")),a.createElement(m.Z.Text,{className:"text-center"},M("message.glossary-tag-update-description")," ",a.createElement("span",{className:"font-medium"},(0,he.C_)(t))),a.createElement("div",{className:"m-t-lg"},a.createElement(y.Z,{size:8},a.createElement(p.Z,{onClick:r},M("label.no-comma-cancel")),a.createElement(p.Z,{type:"primary",onClick:N},M("label.yes-comma-confirm")))))};case Ot.VALIDATING:return{content:l,footer:n};case Ot.FAILED:return{content:a.createElement("div",{className:"d-flex flex-column gap-2"},s&&a.createElement(a.Fragment,null,a.createElement(xt.Z,{bordered:!0,columns:T,dataSource:null!==(e=null==s?void 0:s.failedRequest)&&void 0!==e?e:[],pagination:{pageSize:5,showSizeChanger:!0},rowKey:function(e){var t;return null===(t=e.request)||void 0===t?void 0:t.id}}),a.createElement(qt.Z,{className:"m-t-sm",message:M("message.glossary-tag-assignment-help-message"),type:"warning"})),(null==f?void 0:f.code)===Bt.q.BAD_REQUEST&&a.createElement(qt.Z,{message:f.message,type:"warning"})),footer:a.createElement("div",{className:"d-flex justify-between"},a.createElement(m.Z.Text,{type:"secondary"},(null==s?void 0:s.numberOfRowsFailed)&&s.numberOfRowsFailed+" "+M("label.failed")),a.createElement(p.Z,{onClick:r},M("label.cancel")))};case Ot.UPDATING:case Ot.SUCCESS:return{content:l,footer:a.createElement(p.Z,{onClick:r},M("label.cancel"))}}}),[g,s]),D=(0,a.useMemo)((function(){switch(g){case Ot.VALIDATING:case Ot.UPDATING:case Ot.SUCCESS:return M("message.glossary-tag-update-modal-title-validating");case Ot.FAILED:return M("message.glossary-tag-update-modal-title-failed");default:return}}),[g]);return a.createElement(rt.Z,{centered:!0,open:!0,closable:!1,closeIcon:null,footer:A.footer,title:D,width:g===Ot.FAILED?750:void 0,onCancel:r},A.content)},Kt=n(60331),$t=n(49795),Xt=n(52114),en=function(e){var t=e.references,n=e.isVisible,r=e.onClose,l=e.onSave,i=(0,c.$)().t,s=(0,o.CR)(d.Z.useForm(),1)[0],u=(0,o.CR)((0,a.useState)(!1),2),m=u[0],y=u[1];return(0,a.useEffect)((function(){if(n){var e=t.length>0?t:[{name:"",endpoint:""}];s.setFieldValue("references",e)}}),[n]),a.createElement(rt.Z,{destroyOnClose:!0,"data-testid":"glossary-term-references-modal",footer:[a.createElement(p.Z,{key:"cancel-btn",type:"link",onClick:r},i("label.cancel")),a.createElement(p.Z,{"data-testid":"save-btn",key:"save-btn",loading:m,type:"primary",onClick:s.submit},i("label.save"))],open:n,title:i("label.reference-plural"),onCancel:r},a.createElement(d.Z,{className:"reference-edit-form",form:s,onFinish:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){return(0,o.Jh)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,4,5]),y(!0),[4,s.validateFields()];case 1:return t.sent(),[4,l(e.references)];case 2:case 3:return t.sent(),[3,5];case 4:return y(!1),[7];case 5:return[2]}}))}))}},a.createElement(d.Z.List,{name:"references"},(function(e,t){var n=t.add,r=t.remove;return a.createElement(a.Fragment,null,e.map((function(e){var t=e.key,n=e.name,l=(0,o._T)(e,["key","name"]);return a.createElement(ye.Z,{gutter:8,key:t},a.createElement(fe.Z,{span:12},a.createElement(d.Z.Item,(0,o.pi)({className:"w-full"},l,{name:[n,"name"],rules:[{required:!0,message:i("label.field-required",{field:i("label.name")})}]}),a.createElement(jt.Z,{placeholder:i("label.name")}))),a.createElement(fe.Z,{span:11},a.createElement(d.Z.Item,(0,o.pi)({className:"w-full"},l,{name:[n,"endpoint"],rules:[{required:!0,message:i("label.field-required",{field:i("label.endpoint")})},{type:"url",message:i("message.endpoint-should-be-valid")}]}),a.createElement(jt.Z,{placeholder:i("label.endpoint")}))),a.createElement(fe.Z,{span:1},a.createElement(p.Z,{icon:a.createElement(dt.Z,{className:"align-middle",component:Fe.ReactComponent,style:{fontSize:"16px"}}),size:"small",type:"text",onClick:function(){return r(n)}})))})),a.createElement(d.Z.Item,null,a.createElement(p.Z,{className:"text-primary d-flex items-center","data-testid":"add-references-button",icon:a.createElement(xe.ReactComponent,{className:"anticon"}),size:"small",onClick:function(){return n()}},i("label.add"))))}))))},tn=function(e){var t=e.glossaryTerm,n=e.permissions,r=e.onGlossaryTermUpdate,i=e.isVersionView,s=(0,o.CR)((0,a.useState)([]),2),c=s[0],u=s[1],d=(0,o.CR)((0,a.useState)(!0),2),f=d[0],E=d[1];(0,a.useEffect)((function(){u(t.references?t.references:[])}),[t.references]);var v=(0,a.useCallback)((function(e,t){var n,r;return(null==t?void 0:t.added)?(n=l.K8,r="text-success"):(null==t?void 0:t.removed)?(n=l.CF,r="text-grey-muted"):(n=l.y3,r="text-body"),a.createElement(Kt.Z,{className:Qe()("m-r-xs m-t-xs d-flex items-center term-reference-tag bg-white",{"diff-added":null==t?void 0:t.added},{"diff-removed ":null==t?void 0:t.removed}),key:e.name},a.createElement(Ae.Z,{placement:"bottomLeft",title:e.name},a.createElement("a",{"data-testid":"reference-link-"+e.name,href:null==e?void 0:e.endpoint,rel:"noopener noreferrer",target:"_blank"},a.createElement("div",{className:"d-flex items-center"},a.createElement(dt.Z,{className:"m-r-xss",component:$t.ReactComponent,"data-testid":"external-link-icon",style:(0,o.pi)((0,o.pi)({},l.K$),{color:n})}),a.createElement("span",{className:r},e.name)))))}),[]),g=(0,a.useCallback)((function(){var e,n,r=t.changeDescription,i=(0,Me.gY)(ge.Sn.REFERENCES,r),s=JSON.parse(null!==(e=(0,Me.r9)(i))&&void 0!==e?e:"[]"),o=JSON.parse(null!==(n=(0,Me.TL)(i))&&void 0!==n?n:"[]"),c=t.references?t.references.filter((function(e){return!s.find((function(t){return t.name===e.name}))})):[];return(0,ee.isEmpty)(c)&&(0,ee.isEmpty)(s)&&(0,ee.isEmpty)(o)?a.createElement("div",null,l.lH):a.createElement("div",{className:"d-flex flex-wrap"},c.map((function(e){return v(e)})),s.map((function(e){return v(e,{added:!0})})),o.map((function(e){return v(e,{removed:!0})})))}),[t]);return a.createElement("div",{"data-testid":"references-container"},a.createElement("div",{className:"w-full"},a.createElement(y.Z,{className:"w-full","data-testid":"section-"+(0,De.t)("label.reference-plural")},a.createElement("div",{className:"flex-center"},a.createElement(m.Z.Text,{className:"right-panel-label"},(0,De.t)("label.reference-plural")),c.length>0&&n.EditAll&&a.createElement(Ae.Z,{title:n.EditAll?(0,De.t)("label.edit-entity",{entity:(0,De.t)("label.reference-plural")}):Xt.oH},a.createElement(p.Z,{className:"cursor-pointer flex-center m-l-xss","data-testid":"edit-button",disabled:!n.EditAll,icon:a.createElement(we.ReactComponent,{color:l.MJ,width:"14px"}),size:"small",type:"text",onClick:function(){return E(!1)}})))),a.createElement(a.Fragment,null,i?g():a.createElement("div",{className:"d-flex flex-wrap"},c.map((function(e){return v(e)})),n.EditAll&&0===c.length&&a.createElement(Le.Z,{className:"text-primary cursor-pointer",dataTestId:"term-references-add-button",icon:a.createElement(xe.ReactComponent,{height:16,name:"plus",width:16}),label:(0,De.t)("label.add"),tooltip:"",onClick:function(){E(!1)}}),!n.EditAll&&0===c.length&&a.createElement("div",null,l.lH)))),a.createElement(en,{isVisible:!f,references:c||[],onClose:function(){E(!0)},onSave:function(e,n){return(0,o.mG)(void 0,void 0,void 0,(function(){var a,l;return(0,o.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),a=e.filter((function(e){return e.endpoint&&e.name})),(0,ee.isEqual)(a,t.references)?[3,2]:(l=(0,ee.cloneDeep)(t),l=(0,o.pi)((0,o.pi)({},l),{references:a}),[4,r(l)]);case 1:i.sent(),n&&u(a),i.label=2;case 2:return E(!0),[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}}))}))}}))},nn=n(54549),an=n(79508),rn=function(e){var t=e.permissions,n=e.glossaryTerm,r=e.onGlossaryTermUpdate,i=e.isVersionView,s=(0,o.CR)((0,a.useState)(!0),2),c=s[0],u=s[1],d=(0,o.CR)((0,a.useState)([]),2),f=d[0],E=d[1],v=(0,o.CR)((0,a.useState)(!1),2),g=v[0],h=v[1],M=function(){return a.createElement("div",{className:"d-flex flex-wrap"},f.map((function(e){return a.createElement(Le.Z,{className:"glossary-synonym-tag",key:e,label:e})})),t.EditAll&&0===f.length&&a.createElement(Le.Z,{className:"text-primary cursor-pointer",dataTestId:"synonym-add-button",icon:a.createElement(xe.ReactComponent,{height:16,name:"plus",width:16}),label:(0,De.t)("label.add"),tooltip:"",onClick:function(){u(!1)}}),!t.EditAll&&0===f.length&&a.createElement("div",null,l.lH))},N=(0,a.useCallback)((function(){var e,t;if(!i)return M();var r=n.changeDescription,s=(0,Me.gY)(ge.Sn.SYNONYMS,r),o=JSON.parse(null!==(e=(0,Me.r9)(s))&&void 0!==e?e:"[]"),c=JSON.parse(null!==(t=(0,Me.TL)(s))&&void 0!==t?t:"[]"),u=n.synonyms?n.synonyms.filter((function(e){return!(0,ee.isEmpty)(e)&&!o.find((function(t){return t===e}))})):[];return(0,ee.isEmpty)(u)&&(0,ee.isEmpty)(o)&&(0,ee.isEmpty)(c)?a.createElement("div",null,l.lH):a.createElement("div",{className:"d-flex flex-wrap"},u.map((function(e){return!(0,ee.isEmpty)(e)&&a.createElement(Le.Z,{className:"glossary-synonym-tag",key:e,label:e})})),o.map((function(e){return!(0,ee.isEmpty)(e)&&a.createElement(Le.Z,{className:"glossary-synonym-tag",key:e,label:e,versionData:{added:!0}})})),c.map((function(e){return!(0,ee.isEmpty)(e)&&a.createElement(Le.Z,{className:"glossary-synonym-tag",key:e,label:e,versionData:{removed:!0}})})))}),[n,i,M]);return(0,a.useEffect)((function(){var e;(null===(e=n.synonyms)||void 0===e?void 0:e.length)&&E(n.synonyms.filter((function(e){return!(0,ee.isEmpty)(e)})))}),[n]),a.createElement("div",{className:"flex flex-col m-r-xs","data-testid":"synonyms-container"},a.createElement("div",{className:"d-flex items-center"},a.createElement(m.Z.Text,{className:"right-panel-label"},(0,De.t)("label.synonym-plural")),t.EditAll&&f.length>0&&c&&a.createElement(Ae.Z,{placement:"top",title:t.EditAll?(0,De.t)("label.edit-entity",{entity:(0,De.t)("label.synonym-plural")}):Xt.oH},a.createElement(p.Z,{className:"cursor-pointer flex-center m-l-xss","data-testid":"edit-button",disabled:!t.EditAll,icon:a.createElement(we.ReactComponent,{color:l.MJ,width:"14px"}),size:"small",type:"text",onClick:function(){return u(!1)}}))),c?N():a.createElement(a.Fragment,null,a.createElement(y.Z,{className:"justify-end w-full m-b-xs",size:8},a.createElement(p.Z,{className:"w-6 p-x-05","data-testid":"cancel-synonym-btn",icon:a.createElement(nn.Z,{size:12}),size:"small",onClick:function(){E(n.synonyms||[]),u(!0)}}),a.createElement(p.Z,{className:"w-6 p-x-05","data-testid":"save-synonym-btn",icon:a.createElement(an.Z,{size:12}),loading:g,size:"small",type:"primary",onClick:function(){return(0,o.mG)(void 0,void 0,void 0,(function(){var e;return(0,o.Jh)(this,(function(t){switch(t.label){case 0:return(0,ee.isEqual)(f,n.synonyms)?[3,2]:(e=(0,ee.cloneDeep)(n),e=(0,o.pi)((0,o.pi)({},e),{synonyms:f}),h(!0),[4,r(e)]);case 1:t.sent(),h(!1),t.label=2;case 2:return u(!0),[2]}}))}))}})),a.createElement(lt.Z,{className:"glossary-select w-full",id:"synonyms-select",mode:"tags",open:!1,placeholder:(0,De.t)("label.add-entity",{entity:(0,De.t)("label.synonym-plural")}),value:f,onChange:function(e){return E(e)}})))},ln=n(20839),sn=function(e){var t,n=e.isVersionView,i=e.glossaryTerm,s=e.permissions,c=e.onGlossaryTermUpdate,u=(0,r.k6)(),d=(0,o.CR)((0,a.useState)(!0),2),y=d[0],f=d[1],E=(0,o.CR)((0,a.useState)([]),2),v=E[0],g=E[1],M=(0,a.useMemo)((function(){var e;return null!==(e=v.map((function(e){return{label:(0,he.C_)(e),value:e.fullyQualifiedName,data:e}})))&&void 0!==e?e:[]}),[v]);(0,a.useEffect)((function(){var e;i&&g((null!==(e=i.relatedTerms)&&void 0!==e?e:[]).map((function(e){return(0,o.pi)((0,o.pi)({},e),{value:e.id,label:e.displayName||e.name,key:e.id})})))}),[i]);var N=(0,a.useCallback)((function(e,t){return a.createElement(Le.Z,{className:"cursor-pointer",icon:a.createElement(Pe.ReactComponent,{height:12,name:"folder"}),key:e.fullyQualifiedName,label:(0,he.C_)(e),tooltip:a.createElement("div",{className:"p-xss"},a.createElement("strong",null,e.fullyQualifiedName),a.createElement("div",null,e.description)),versionData:t,onClick:function(){var t;t=e.fullyQualifiedName||"",u.push((0,W.$x)(t))}})}),[]),T=(0,a.useCallback)((function(){var e,t,n=i.changeDescription,r=(0,Me.gY)(ge.Sn.RELATEDTERMS,n),s=JSON.parse(null!==(e=(0,Me.r9)(r))&&void 0!==e?e:"[]"),o=JSON.parse(null!==(t=(0,Me.TL)(r))&&void 0!==t?t:"[]"),c=i.relatedTerms?i.relatedTerms.filter((function(e){return!s.find((function(t){return t.id===e.id}))})):[];return(0,ee.isEmpty)(c)&&(0,ee.isEmpty)(s)&&(0,ee.isEmpty)(o)?a.createElement("div",null,l.lH):a.createElement("div",{className:"d-flex flex-wrap"},c.map((function(e){return N(e)})),s.map((function(e){return N(e,{added:!0})})),o.map((function(e){return N(e,{removed:!0})})))}),[i]),b=(0,a.useMemo)((function(){return n?T():a.createElement("div",{className:"d-flex flex-wrap"},s.EditAll&&0===v.length&&a.createElement(Le.Z,{className:"text-primary cursor-pointer",dataTestId:"related-term-add-button",icon:a.createElement(xe.ReactComponent,{height:16,name:"plus",width:16}),label:(0,De.t)("label.add"),tooltip:"",onClick:function(){f(!1)}}),v.map((function(e){return N(e)})),!s.EditAll&&0===v.length&&a.createElement("div",null,l.lH))}),[s,v,n,T,N]);return a.createElement("div",{className:"flex flex-col","data-testid":"related-term-container"},a.createElement("div",{className:"d-flex items-center"},a.createElement(m.Z.Text,{className:"right-panel-label"},(0,De.t)("label.related-term-plural")),s.EditAll&&v.length>0&&a.createElement(Ae.Z,{title:s.EditAll?(0,De.t)("label.edit-entity",{entity:(0,De.t)("label.related-term-plural")}):Xt.oH},a.createElement(p.Z,{className:"cursor-pointer flex-center m-l-xss","data-testid":"edit-button",disabled:!s.EditAll,icon:a.createElement(we.ReactComponent,{color:l.MJ,width:"14px"}),size:"small",type:"text",onClick:function(){return f(!1)}}))),y?b:a.createElement(ln.Z,{defaultValue:v.map((function(e){var t;return null!==(t=e.fullyQualifiedName)&&void 0!==t?t:""})),filterOptions:[null!==(t=null==i?void 0:i.fullyQualifiedName)&&void 0!==t?t:""],placeholder:(0,De.t)("label.add-entity",{entity:(0,De.t)("label.related-term-plural")}),tagData:M,onCancel:function(){f(!0)},onSubmit:function(e){return(0,o.mG)(void 0,void 0,Promise,(function(){var t,n;return(0,o.Jh)(this,(function(a){switch(a.label){case 0:return(0,ee.isArray)(e)?(t=e.map((function(e){var t;return(0,he.hL)((0,ee.isUndefined)(e.data)?null===(t=i.relatedTerms)||void 0===t?void 0:t.find((function(t){return t.fullyQualifiedName===e.value})):e.data,h.py.GLOSSARY_TERM)})),n=(0,o.pi)((0,o.pi)({},i),{relatedTerms:t}),[4,c(n)]):[2];case 1:return a.sent(),f(!0),[2]}}))}))}}))},on=function(e){var t=e.selectedData,n=e.permissions,r=e.onUpdate,l=e.isGlossary,i=e.isVersionView,s=e.onThreadLinkSelect,c=e.editCustomAttributePermission,u=e.onExtensionUpdate,d=(0,o.CR)((0,a.useState)(!1),2),m=d[0],p=d[1],f=(0,o.CR)((0,a.useState)(),2),E=f[0],v=f[1],g=(0,a.useMemo)((function(){return n.EditAll||n.EditTags}),[n]),M=(0,a.useMemo)((function(){return i?(0,Me._Y)(t.changeDescription,ge.Sn.DESCRIPTION,t.description):t.description}),[t,i]),N=(0,a.useMemo)((function(){return i?(0,Me.o2)(t,t.changeDescription):t.tags}),[i,t]);return a.createElement(ye.Z,{className:"glossary-overview-tab h-full",gutter:[32,0]},a.createElement(fe.Z,{span:24},a.createElement(A.Z,{firstPanel:{children:a.createElement("div",{"data-testid":"updated-by-container"},a.createElement(ye.Z,{className:"p-md p-r-0",gutter:[0,32]},a.createElement(fe.Z,{span:24},a.createElement(Te.Z,{description:M,entityFqn:t.fullyQualifiedName,entityName:(0,he.C_)(t),entityType:h.py.GLOSSARY_TERM,hasEditAccess:n.EditDescription||n.EditAll,isEdit:m,owner:null==t?void 0:t.owners,showActions:!t.deleted,onCancel:function(){return p(!1)},onDescriptionEdit:function(){return p(!0)},onDescriptionUpdate:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var n;return(0,o.Jh)(this,(function(a){return t.description!==e?(n=(0,o.pi)((0,o.pi)({},t),{description:e}),r(n),p(!1)):p(!1),[2]}))}))},onThreadLinkSelect:s})),a.createElement(fe.Z,{span:24},a.createElement(ye.Z,{gutter:[0,40]},!l&&a.createElement(a.Fragment,null,a.createElement(fe.Z,{span:12},a.createElement(rn,{glossaryTerm:t,isVersionView:i,permissions:n,onGlossaryTermUpdate:r})),a.createElement(fe.Z,{span:12},a.createElement(sn,{glossaryTerm:t,isVersionView:i,permissions:n,onGlossaryTermUpdate:r})),a.createElement(fe.Z,{span:12},a.createElement(tn,{glossaryTerm:t,isVersionView:i,permissions:n,onGlossaryTermUpdate:r}))),a.createElement(fe.Z,{span:12},a.createElement(y.Z,{className:"w-full",direction:"vertical"},a.createElement(Oe.Z,{displayType:Ze.F.READ_MORE,entityFqn:t.fullyQualifiedName,entityType:h.py.GLOSSARY_TERM,permission:g,selectedTags:null!=N?N:[],tagType:Ft.c6.Classification,onSelectionChange:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){return(0,o.Jh)(this,(function(t){return v(e),[2]}))}))},onThreadLinkSelect:s}))))))),minWidth:800,flex:.75},secondPanel:{children:a.createElement(je,{editCustomAttributePermission:c,entityType:h.py.GLOSSARY_TERM,isGlossary:!1,isVersionView:i,permissions:n,selectedData:t,onExtensionUpdate:u,onThreadLinkSelect:s,onUpdate:r}),minWidth:320,flex:.25,className:"entity-resizable-right-panel-container"}})),E&&a.createElement(Ht,{glossaryTerm:t,updatedTags:E,onCancel:function(){return v(void 0)},onValidationSuccess:function(){return(0,o.mG)(void 0,void 0,void 0,(function(){return(0,o.Jh)(this,(function(e){switch(e.label){case 0:return t?[4,r((0,o.pi)((0,o.pi)({},t),{tags:E}))]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}}))},cn=function(e){var t=e.glossaryTerm,n=e.handleGlossaryTermUpdate,i=e.handleGlossaryTermDelete,s=e.permissions,c=e.refreshGlossaryTerms,u=e.onAssetClick,d=e.isSummaryPanelOpen,m=e.termsLoading,p=e.onAddGlossaryTerm,y=e.onEditGlossaryTerm,f=e.updateVote,E=e.refreshActiveGlossaryTerm,v=e.isVersionView,g=e.onThreadLinkSelect,M=(0,r.UO)(),N=M.tab,T=M.version,b=(0,tt.f)().fqn,A=(0,r.k6)(),D=(0,a.useRef)(null),w=(0,o.CR)((0,a.useState)(!1),2),x=w[0],I=w[1],S=(0,o.CR)((0,a.useState)(ve.lh),2),C=S[0],L=S[1],O=(0,o.CR)((0,a.useState)(0),2),Z=O[0],j=O[1],R=It().glossaryChildTerms,k=null!=R?R:[],z=(0,a.useMemo)((function(){var e;return(null!==(e=t.status)&&void 0!==e?e:se.qb.Approved)===se.qb.Approved?s:ce}),[t,s]),G=(0,a.useMemo)((function(){return null!=N?N:"overview"}),[N]),U=function(e){A.push({pathname:T?(0,W.tP)(b,T,e):(0,l.kJ)(b,e)})},Q=(0,a.useCallback)((function(e){L(e)}),[]),P=function(){var e;(0,J.Aq)(h.py.GLOSSARY_TERM,null!==(e=t.fullyQualifiedName)&&void 0!==e?e:"",Q)},V=function(){return(0,o.mG)(void 0,void 0,void 0,(function(){var e,n,a;return(0,o.Jh)(this,(function(r){switch(r.label){case 0:if(!t)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),e=(0,Qt.Yd)((0,Qt.i3)(t.fullyQualifiedName)),[4,(0,Ut.rg)("",1,0,'(tags.tagFQN:"'+e+'")',"","",Gt.W.ALL)];case 2:return n=r.sent(),j(null!==(a=n.data.hits.total.value)&&void 0!==a?a:0),[3,4];case 3:return r.sent(),j(0),[3,4];case 4:return[2]}}))}))},Y=(0,a.useCallback)((function(){var e;V(),null===(e=D.current)||void 0===e||e.refreshAssets(),"assets"!==N&&U("assets")}),[D,N]),F=(0,a.useCallback)((function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){return(0,o.Jh)(this,(function(a){switch(a.label){case 0:return[4,n((0,o.pi)((0,o.pi)({},t),{extension:e.extension}))];case 1:return a.sent(),[2]}}))}))}),[t,n]),_=function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){return(0,o.Jh)(this,(function(t){switch(t.label){case 0:return[4,n(e)];case 1:return t.sent(),P(),[2]}}))}))},q=(0,a.useMemo)((function(){var e,n;return(0,o.ev)([{label:a.createElement("div",{"data-testid":"overview"},(0,De.t)("label.overview")),key:"overview",children:a.createElement(on,{editCustomAttributePermission:!v&&(s.EditAll||s.EditCustomFields),isGlossary:!1,isVersionView:v,permissions:s,selectedData:t,onExtensionUpdate:F,onThreadLinkSelect:g,onUpdate:_})}],(0,o.CR)(v?[]:[{label:a.createElement("div",{"data-testid":"terms"},(0,De.t)("label.glossary-term-plural"),a.createElement("span",{className:"p-l-xs "},(0,J.yh)(k.length,"","terms"===G))),key:"terms",children:a.createElement(St,{className:"p-md glossary-term-table-container",isGlossary:!1,permissions:s,refreshGlossaryTerms:c,termsLoading:m,onAddGlossaryTerm:p,onEditGlossaryTerm:y})},{label:a.createElement("div",{"data-testid":"assets"},(0,De.t)("label.asset-plural"),a.createElement("span",{className:"p-l-xs "},(0,J.yh)(null!=Z?Z:0,"","assets"===G))),key:"assets",children:a.createElement(Vt.Z,{assetCount:Z,entityFqn:null!==(e=t.fullyQualifiedName)&&void 0!==e?e:"",isSummaryPanelOpen:d,permissions:z,ref:D,onAddAsset:function(){return I(!0)},onAssetClick:u,onRemoveAsset:Y})},{label:a.createElement(be.Z,{count:C.totalCount,id:Se.ACTIVITY_FEED,isActive:G===Se.ACTIVITY_FEED,name:(0,De.t)("label.activity-feed-and-task-plural")}),key:Se.ACTIVITY_FEED,children:a.createElement(Ne.K,{entityType:h.py.GLOSSARY_TERM,fqn:null!==(n=t.fullyQualifiedName)&&void 0!==n?n:"",hasGlossaryReviewer:!(0,ee.isEmpty)(t.reviewers),owners:t.owners,onFeedUpdate:P,onUpdateEntityDetails:E})},{label:a.createElement(be.Z,{id:h.M8.CUSTOM_PROPERTIES,name:(0,De.t)("label.custom-property-plural")}),key:h.M8.CUSTOM_PROPERTIES,children:t&&a.createElement("div",{className:"m-sm"},a.createElement(Ce.t,{entityDetails:t,entityType:h.py.GLOSSARY_TERM,handleExtensionUpdate:F,hasEditAccess:!v&&(s.EditAll||s.EditCustomFields),hasPermission:s.ViewAll,isVersionView:v}))}]))}),[t,s,m,G,Z,C.conversationCount,C.totalTasksCount,d,v,z,Y,F]);(0,a.useEffect)((function(){setTimeout((function(){V()}),500),P()}),[b]);var B=(0,a.useMemo)((function(){return v?(0,Me._Y)(t.changeDescription,ge.Sn.NAME,t.name):t.name}),[t,v]),H=(0,a.useMemo)((function(){return v?(0,Me._Y)(t.changeDescription,ge.Sn.DISPLAYNAME,t.displayName):t.displayName}),[t,v]);return a.createElement(a.Fragment,null,a.createElement(ye.Z,{"data-testid":"glossary-term",gutter:[0,8]},a.createElement(fe.Z,{className:"p-x-md",span:24},a.createElement(ct,{isGlossary:!1,isVersionView:v,permissions:s,selectedData:(0,o.pi)((0,o.pi)({},t),{displayName:H,name:B}),updateVote:f,onAddGlossaryTerm:p,onAssetAdd:function(){return I(!0)},onDelete:i,onUpdate:_})),a.createElement(fe.Z,{span:24},a.createElement(Ee.Z,{destroyInactiveTabPane:!0,activeKey:G,className:"glossary-tabs custom-tab-spacing",items:q,onChange:U}))),t.fullyQualifiedName&&x&&a.createElement(Pt.f,{entityFqn:t.fullyQualifiedName,open:x,queryFilter:(0,wt.dj)(t.fullyQualifiedName),type:Yt.V.GLOSSARY,onCancel:function(){return I(!1)},onSave:Y}))},un=n(37598),dn={};dn.styleTagTransform=z(),dn.setAttributes=Z(),dn.insert=L().bind(null,"head"),dn.domAPI=S(),dn.insertStyleElement=R(),x()(un.Z,dn),un.Z&&un.Z.locals&&un.Z.locals;var mn=n(24461),pn=n(16798),yn=n(60715),fn=n(86442),En=["Entity created","Entity updated"],vn=n(61843),gn=n(37310),hn=function(e){var t=e.csvImportResult,n=(0,pn.vE)().readString,r=(0,c.$)().t,l=(0,o.CR)((0,a.useState)([]),2),i=l[0],s=l[1],u=(0,o.CR)((0,a.useState)(!1),2),d=u[0],p=u[1],f=(0,a.useMemo)((function(){return[{title:r("label.status"),dataIndex:"status",key:"status",fixed:!0,render:function(e,t){return a.createElement(y.Z,{align:"start","data-testid":"status-container",style:{maxWidth:200}},e===vn.q.Failure?a.createElement(a.Fragment,null,a.createElement(yn.ReactComponent,{className:"m-t-xss","data-testid":"failure-badge",height:16,width:16}),t.details):a.createElement(fn.ReactComponent,{className:"m-t-xss","data-testid":"success-badge",height:16,width:16}))}},{title:r("label.parent"),dataIndex:"parent",key:"parent",fixed:!0,render:function(e){return a.createElement(m.Z.Paragraph,{style:{width:200}},(0,ee.isEmpty)(e)?"--":e)}},{title:r("label.name"),dataIndex:"name*",key:"name",fixed:!0,render:function(e){return a.createElement(m.Z.Paragraph,{style:{width:200}},e)}},{title:r("label.display-name"),dataIndex:"displayName",key:"displayName",render:function(e){return a.createElement(m.Z.Paragraph,{style:{width:200}},(0,ee.isEmpty)(e)?"--":e)}},{title:r("label.description"),dataIndex:"description",key:"description",width:300,render:function(e){return a.createElement(m.Z.Paragraph,{ellipsis:{rows:2},style:{width:300},title:e},(0,ee.isEmpty)(e)?"--":e)}},{title:r("label.synonym-lowercase-plural"),dataIndex:"synonyms",key:"synonyms",render:function(e){var t=null==e?void 0:e.split(";").join(", ");return a.createElement(m.Z.Paragraph,{style:{width:200}},(0,ee.isEmpty)(e)?"--":t)}},{title:r("label.related-term-plural"),dataIndex:"relatedTerms",key:"relatedTerms",render:function(e){var t=null==e?void 0:e.split(";").join(", ");return a.createElement(m.Z.Paragraph,{style:{width:200}},(0,ee.isEmpty)(e)?"--":t)}},{title:r("label.reference-plural"),dataIndex:"references",key:"relatedTerms",render:function(e){return a.createElement(m.Z.Paragraph,{style:{width:200,maxWidth:300}},(0,ee.isEmpty)(e)?"--":e)}},{title:r("label.tag-plural"),dataIndex:"tags",key:"tags",render:function(e){var t=null==e?void 0:e.split(";").join(", ");return a.createElement(m.Z.Paragraph,{style:{width:200}},(0,ee.isEmpty)(e)?"--":t)}}]}),[]);return(0,a.useEffect)((function(){p(!0),t.importResultsCsv&&n(t.importResultsCsv,{worker:!0,complete:function(e){s((0,gn.b)(e.data).map((function(e){var t;return(0,o.pi)((0,o.pi)({},e),{key:e["name*"],status:En.includes(null!==(t=e.details)&&void 0!==t?t:"")?vn.q.Success:vn.q.Failure})}))),p(!1)}})}),[t.importResultsCsv]),a.createElement(xt.Z,{bordered:!0,columns:f,"data-testid":"import-result-table",dataSource:i,loading:d,pagination:!1,rowKey:"name",scroll:{x:!0},size:"small"})},Mn=n(24030),Nn={};Nn.styleTagTransform=z(),Nn.setAttributes=Z(),Nn.insert=L().bind(null,"head"),Nn.domAPI=S(),Nn.insertStyleElement=R(),x()(Mn.Z,Nn),Mn.Z&&Mn.Z.locals&&Mn.Z.locals;var Tn=function(e){var t=e.glossaryName,n=(0,c.$)().t,l=(0,r.k6)(),i=(0,o.CR)((0,a.useState)(),2),s=i[0],u=i[1],d=(0,a.useMemo)((function(){return[{name:n("label.glossary-plural"),url:(0,W.$x)(),activeTitle:!1},{name:t,url:(0,W.$x)(t)}]}),[t]),p=function(){l.push((0,W.$x)(t))};return a.createElement(ye.Z,{className:"import-glossary p-x-md",gutter:[16,8]},a.createElement(fe.Z,{span:24},a.createElement(D.Z,{titleLinks:d})),a.createElement(fe.Z,{span:24},a.createElement(m.Z.Title,{"data-testid":"title",level:5},n("label.import-entity",{entity:n("label.glossary-term-plural")}))),a.createElement(fe.Z,{span:24},a.createElement(mn.v,{entityName:t,onCancel:p,onImport:function(e,t,n){return void 0===n&&(n=!0),(0,o.mG)(void 0,void 0,void 0,(function(){var a,r;return(0,o.Jh)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,(0,q.wE)(e,t,n)];case 1:return a=l.sent(),u(a),[2,a];case 2:return r=l.sent(),(0,K.Eo)(r),[2];case 3:return[2]}}))}))},onSuccess:p},s?a.createElement(hn,{csvImportResult:s}):a.createElement(a.Fragment,null))))},bn=(0,re.w)((function(e){var t,n=e.isGlossaryActive,u=e.selectedData,d=e.onGlossaryTermUpdate,m=e.updateGlossary,p=e.updateVote,y=e.onGlossaryDelete,f=e.onGlossaryTermDelete,E=e.isVersionsView,v=e.onAssetClick,g=e.isSummaryPanelOpen,M=e.refreshActiveGlossaryTerm,N=(0,c.$)().t,T=(0,r.UO)(),b=T.action,A=T.tab,D=(0,r.k6)(),w=(0,o.CR)((0,a.useState)(""),2),x=w[0],I=w[1],S=(0,o.CR)((0,a.useState)(ie.T.Conversation),2),C=S[0],L=S[1],O=(0,de.$J)(),Z=O.postFeed,j=O.deleteFeed,R=O.updateFeed,k=(0,o.CR)((0,a.useState)(null),2),z=k[0],G=k[1],U=(0,i.BL)().getEntityPermission,Q=(0,o.CR)((0,a.useState)(!0),2),P=Q[0],V=Q[1],Y=(0,o.CR)((0,a.useState)(!1),2),F=Y[0],_=Y[1],W=(0,o.CR)((0,a.useState)(!1),2),H=W[0],$=W[1],te=(0,o.CR)((0,a.useState)(B.Bd),2),ae=te[0],re=te[1],se=(0,o.CR)((0,a.useState)(B.Bd),2),ce=se[0],ye=se[1],fe=(0,o.CR)((0,a.useState)(!1),2),Ee=fe[0],ve=fe[1],ge=(0,o.CR)((0,a.useState)(!1),2),he=ge[0],Me=ge[1],Ne=It(),Te=Ne.activeGlossary,be=Ne.setGlossaryChildTerms,Ae=null!=Te?Te:{},De=Ae.id,we=Ae.fullyQualifiedName,xe=(0,a.useMemo)((function(){return b===h.uk.IMPORT}),[b]),Ie=function(e,t){I(e),t&&L(t)},Se=(0,a.useCallback)((function(e){void 0===e&&(e=!1),function(e,t){(0,o.mG)(void 0,void 0,void 0,(function(){var n,a,r,l,i;return(0,o.Jh)(this,(function(s){switch(s.label){case 0:t?_(!0):V(!0),s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,(0,q.Kc)(null!==(i=null!==(l=null==e?void 0:e.glossary)&&void 0!==l?l:null==e?void 0:e.parent)&&void 0!==i?i:"")];case 2:return n=s.sent().data,a=n.map((function(e){var t;return null!==(t=e.childrenCount)&&void 0!==t&&t?(0,o.pi)((0,o.pi)({},e),{children:[]}):e})),be(a),[3,5];case 3:return r=s.sent(),(0,K.Eo)(r),[3,5];case 4:return t?_(!1):V(!1),[7];case 5:return[2]}}))}))}(n?{glossary:we}:{parent:we},e)}),[we,n]),Ce=function(e,t){Me(e),G(t),ve(!0)},Le=(0,a.useCallback)((function(){Se(!0),n||"terms"===A||D.push((0,l.kJ)(u.fullyQualifiedName||"","terms")),ve(!1)}),[n,A,u]),Oe=function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t,n,a,r;return(0,o.Jh)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,(0,q.n_)((0,o.pi)((0,o.pi)({},e),{glossary:(null===(n=null==z?void 0:z.glossary)||void 0===n?void 0:n.name)||(null!==(a=u.fullyQualifiedName)&&void 0!==a?a:""),parent:null==z?void 0:z.fullyQualifiedName}))];case 1:return l.sent(),Le(),[3,3];case 2:return t=l.sent(),(null===(r=t.response)||void 0===r?void 0:r.status)===le.N.CONFLICT?(0,K.Eo)(N("server.entity-already-exist",{entity:N("label.glossary-term"),entityPlural:N("label.glossary-term-lowercase-plural"),name:e.name})):(0,K.Eo)(t,N("server.create-entity-error",{entity:N("label.glossary-term-lowercase")})),[3,3];case 3:return[2]}}))}))};return(0,a.useEffect)((function(){De&&!b&&(Se(),n?E?re(oe):(0,o.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,U(s.A.GLOSSARY,null==u?void 0:u.id)];case 1:return e=n.sent(),re(e),[3,3];case 2:return t=n.sent(),(0,K.Eo)(t),[3,3];case 3:return[2]}}))})):E?ye(oe):(0,o.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,U(s.A.GLOSSARY_TERM,null==u?void 0:u.id)];case 1:return e=n.sent(),ye(e),[3,3];case 2:return t=n.sent(),(0,K.Eo)(t),[3,3];case 3:return[2]}}))})))}),[De,n,E,b]),xe?a.createElement(Tn,{glossaryName:null!==(t=u.fullyQualifiedName)&&void 0!==t?t:""}):a.createElement(a.Fragment,null,P&&a.createElement(ne.Z,null),!P&&!(0,ee.isEmpty)(u)&&(n?a.createElement(Zt,{handleGlossaryDelete:y,isVersionView:E,permissions:ae,refreshGlossaryTerms:function(){return Se(!0)},termsLoading:F,updateGlossary:m,updateVote:p,onAddGlossaryTerm:function(e){return Ce(!1,null!=e?e:null)},onEditGlossaryTerm:function(e){return Ce(!0,null!=e?e:null)},onThreadLinkSelect:Ie}):a.createElement(cn,{glossaryTerm:u,handleGlossaryTermDelete:f,handleGlossaryTermUpdate:d,isSummaryPanelOpen:g,isVersionView:E,permissions:ce,refreshActiveGlossaryTerm:M,refreshGlossaryTerms:function(){return Se(!0)},termsLoading:F,updateVote:p,onAddGlossaryTerm:function(e){return Ce(!1,null!=e?e:null)},onAssetClick:v,onEditGlossaryTerm:function(e){return Ce(!0,e)},onThreadLinkSelect:Ie})),u&&a.createElement(pe.Z,{bodyText:(0,J.fP)(u.name,""),entityName:u.name,entityType:"Glossary",visible:H,onCancel:function(){return $(!1)},onConfirm:function(){return(0,o.mG)(void 0,void 0,void 0,(function(){var e;return(0,o.Jh)(this,(function(t){switch(t.label){case 0:return e=u.id,n?[4,y(e)]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,f(e)];case 3:t.sent(),t.label=4;case 4:return $(!1),[2]}}))}))}}),Ee&&a.createElement(zt,{editMode:he,glossaryTermFQN:null==z?void 0:z.fullyQualifiedName,visible:Ee,onCancel:function(){return ve(!1)},onSave:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t,n,a,r,l,i,s,c,u,d,m,p,y;return(0,o.Jh)(this,(function(f){switch(f.label){case 0:return t=(0,ee.cloneDeep)(z),he?t&&z?(a=(n=e||{}).name,r=n.displayName,l=n.description,i=n.synonyms,s=n.tags,c=n.references,u=n.mutuallyExclusive,d=n.reviewers,m=n.owners,p=n.relatedTerms,y=n.style,t.name=a,t.style=y,t.displayName=r,t.description=l,t.synonyms=i,t.tags=s,t.mutuallyExclusive=u,t.reviewers=d,t.owners=m,t.references=c,t.relatedTerms=null==p?void 0:p.map((function(e){return{id:e,type:"glossaryTerm"}})),[4,(E=z,v=t,(0,o.mG)(void 0,void 0,void 0,(function(){var e,t,n;return(0,o.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),e=(0,X.qu)(E,v),[4,(0,q.zx)(null==E?void 0:E.id,e)];case 1:if(!a.sent())throw N("server.entity-updating-error",{entity:N("label.glossary-term")});return Le(),[3,3];case 2:return t=a.sent(),(null===(n=t.response)||void 0===n?void 0:n.status)===le.N.CONFLICT?(0,K.Eo)(N("server.entity-already-exist",{entity:N("label.glossary-term"),entityPlural:N("label.glossary-term-lowercase-plural"),name:v.name})):(0,K.Eo)(t,N("server.entity-updating-error",{entity:N("label.glossary-term-lowercase")})),[3,3];case 3:return[2]}}))})))]):[3,2]:[3,3];case 1:f.sent(),f.label=2;case 2:return[3,5];case 3:return[4,Oe(e)];case 4:f.sent(),f.label=5;case 5:return[2]}var E,v}))}))}}),x?a.createElement(me.Z,{createThread:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t;return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,ue.Kl)(e)];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),(0,K.Eo)(t,N("server.create-entity-error",{entity:N("label.conversation")})),[3,3];case 3:return[2]}}))}))},deletePostHandler:j,open:Boolean(x),postFeedHandler:Z,threadLink:x,threadType:C,updateThreadHandler:R,onCancel:function(){I("")}}):null)})),An=n(76709),Dn=n(28682),wn=n(88816),xn=n(75883),In=function(e){var t=e.glossaries,n=(0,c.$)().t,u=(0,i.BL)().permissions,d=(0,tt.f)().fqn,y=(0,r.k6)(),f=(0,a.useMemo)((function(){return(0,B.P_)(_.OX.Create,s.A.GLOSSARY,u)}),[u]),E=(0,a.useMemo)((function(){return d?nt.Z.split(d)[0]:t[0].fullyQualifiedName}),[d]),v=(0,a.useMemo)((function(){return t.reduce((function(e,t){var n;return(0,o.ev)((0,o.ev)([],(0,o.CR)(e)),[{key:null!==(n=t.fullyQualifiedName)&&void 0!==n?n:"",label:(0,he.C_)(t),icon:a.createElement(Ve.ReactComponent,{height:16,width:16})}])}),[])}),[t]);return a.createElement(wn.Z,{id:"glossary"},a.createElement(xn.Z,{loading:0===t.length},a.createElement(ye.Z,{className:"p-y-xs",gutter:[0,16]},a.createElement(fe.Z,{className:"p-x-sm",span:24},a.createElement(m.Z.Text,{strong:!0,className:"m-b-0"},n("label.glossary"))),f&&a.createElement(fe.Z,{className:"p-x-sm",span:24},a.createElement(p.Z,{block:!0,className:"text-primary","data-testid":"add-glossary",onClick:function(){y.push(l.Z6.ADD_GLOSSARY)}},a.createElement("div",{className:"flex-center"},a.createElement(xe.ReactComponent,{className:"anticon m-r-xss"}),n("label.add")))),a.createElement(fe.Z,{span:24},v.length?a.createElement(Dn.Z,{className:"custom-menu","data-testid":"glossary-left-panel",items:v,mode:"inline",selectedKeys:[E],onClick:function(e){y.push((0,W.$x)(e.key))}}):a.createElement("p",{className:"text-grey-muted text-center"},a.createElement("span",null,n("label.no-glossary-found")))))))},Sn=function(){var e=(0,c.$)().t,t=(0,i.BL)().permissions,n=(0,tt.f)().fqn,u=(0,r.k6)(),d=(0,r.UO)().action,m=(0,o.CR)((0,a.useState)(!0),2),p=m[0],y=m[1],f=(0,o.CR)((0,a.useState)(!0),2),E=f[0],v=f[1],g=(0,o.CR)((0,a.useState)(),2),M=g[0],N=g[1],T=It(),b=T.glossaries,A=T.setGlossaries,D=T.activeGlossary,w=T.setActiveGlossary,x=T.updateActiveGlossary,I=(0,a.useMemo)((function(){return d===h.uk.IMPORT}),[d]),S=(0,a.useMemo)((function(){return v(!0),w({}),!n||1===nt.Z.split(n).length}),[n]),C=(0,a.useMemo)((function(){return(0,B.P_)(_.OX.Create,S?s.A.GLOSSARY:s.A.GLOSSARY_TERM,t)}),[t,S]),L=(0,a.useMemo)((function(){return(0,B.P_)(_.OX.ViewBasic,S?s.A.GLOSSARY:s.A.GLOSSARY_TERM,t)}),[t,S]),O=(0,a.useMemo)((function(){return(0,B.P_)(_.OX.ViewAll,S?s.A.GLOSSARY:s.A.GLOSSARY_TERM,t)}),[t,S]),Z=function(){return(0,o.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,o.Jh)(this,(function(n){switch(n.label){case 0:v(!0),y(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,q.Uv)({fields:[h.GB.OWNERS,h.GB.TAGS,h.GB.REVIEWERS,h.GB.VOTES,h.GB.DOMAIN],limit:l.SF})];case 2:return e=n.sent().data,A(e),[3,5];case 3:return t=n.sent(),(0,K.Eo)(t),[3,5];case 4:return y(!1),v(!1),[7];case 5:return[2]}}))}))};(0,a.useEffect)((function(){Z()}),[]);var j=function(){return(0,o.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,o.Jh)(this,(function(a){switch(a.label){case 0:v(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,q.GM)(n,{fields:[h.GB.RELATED_TERMS,h.GB.REVIEWERS,h.GB.TAGS,h.GB.OWNERS,h.GB.CHILDREN,h.GB.VOTES,h.GB.DOMAIN,h.GB.EXTENSION]})];case 2:return e=a.sent(),w(e),[3,5];case 3:return t=a.sent(),(0,K.Eo)(t),[3,5];case 4:return v(!1),[7];case 5:return[2]}}))}))};(0,a.useEffect)((function(){v(!0),b.length&&(S?(w(b.find((function(e){return e.fullyQualifiedName===n}))||b[0]),!n&&b[0].fullyQualifiedName&&u.replace((0,W.$x)(b[0].fullyQualifiedName)),v(!1)):j())}),[S,n,b]);var R=(0,a.useCallback)((function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t,n,a,r,l;return(0,o.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),nt.Z.split(null!==(a=null==D?void 0:D.fullyQualifiedName)&&void 0!==a?a:"").length<=1?[4,(0,q.kq)(null!==(r=null==D?void 0:D.id)&&void 0!==r?r:"",e)]:[3,2];case 1:return t=i.sent().entity.votes,x({votes:t}),[3,4];case 2:return[4,(0,q.nz)(null!==(l=null==D?void 0:D.id)&&void 0!==l?l:"",e)];case 3:t=i.sent().entity.votes,x({votes:t}),i.label=4;case 4:return[3,6];case 5:return n=i.sent(),(0,K.Eo)(n),[3,6];case 6:return[2]}}))}))}),[x,D]),k=(0,a.useCallback)((function(t){return(0,o.mG)(void 0,void 0,void 0,(function(){var n,a,r;return(0,o.Jh)(this,(function(l){switch(l.label){case 0:if(n=(0,X.qu)(D,t),(0,ee.isEmpty)(n))return[2];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,(0,q.zx)(null==D?void 0:D.id,n)];case 2:if(!(a=l.sent()))throw e("server.entity-updating-error",{entity:e("label.glossary-term")});return w(a),(null==D?void 0:D.name)!==t.name&&(u.push((0,W.$x)(a.fullyQualifiedName)),Z()),[3,4];case 3:return r=l.sent(),(0,K.Eo)(r),[3,4];case 4:return[2]}}))}))}),[D]),z=(0,a.useCallback)((function(e){N(e)}),[]);return p?a.createElement(ne.Z,null):L||O?0!==b.length||p?a.createElement(An.Z,{className:"glossary-page-layout",leftPanel:S&&!I&&a.createElement(In,{glossaries:b}),pageTitle:e("label.glossary"),rightPanel:M&&a.createElement(ae.Z,{entityDetails:M,handleClosePanel:function(){return N(void 0)},highlights:{"tag.name":[n]}}),rightPanelWidth:400},E?a.createElement(ne.Z,null):a.createElement(bn,{isGlossaryActive:S,isSummaryPanelOpen:Boolean(M),isVersionsView:!1,refreshActiveGlossaryTerm:j,selectedData:D,updateGlossary:function(e){return(0,o.mG)(void 0,void 0,void 0,(function(){var t,n,a;return(0,o.Jh)(this,(function(r){switch(r.label){case 0:t=(0,X.qu)(D,e),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(0,q.Q6)(null==D?void 0:D.id,t)];case 2:return n=r.sent(),x((0,o.pi)((0,o.pi)({},e),n)),(null==D?void 0:D.name)!==e.name&&(u.push((0,W.$x)(n.fullyQualifiedName)),Z()),[3,4];case 3:return a=r.sent(),(0,K.Eo)(a),[3,4];case 4:return[2]}}))}))},updateVote:R,onAssetClick:z,onGlossaryDelete:function(t){return(0,o.mG)(void 0,void 0,void 0,(function(){var n,a,r;return(0,o.Jh)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,(0,q.cr)(t)];case 1:return l.sent(),(0,K.XA)(e("server.entity-deleted-successfully",{entity:e("label.glossary")})),y(!0),n=b.filter((function(e){return e.id!==t})),a=n.length>0?(0,W.$x)(n[0].fullyQualifiedName):(0,W.$x)(),u.push(a),Z(),[3,3];case 2:return r=l.sent(),(0,K.Eo)(r,e("server.delete-entity-error",{entity:e("label.glossary")})),[3,3];case 3:return[2]}}))}))},onGlossaryTermDelete:function(t){return(0,o.mG)(void 0,void 0,void 0,(function(){var a,r,l;return(0,o.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(0,q.tk)(t)];case 1:return i.sent(),(0,K.XA)(e("server.entity-deleted-successfully",{entity:e("label.glossary-term")})),a=void 0,n&&((r=nt.Z.split(n)).pop(),a=r.join(et.o)),y(!0),u.push((0,W.$x)(a)),Z(),[3,3];case 2:return l=i.sent(),(0,K.Eo)(l,e("server.delete-entity-error",{entity:e("label.glossary-term")})),[3,3];case 3:return[2]}}))}))},onGlossaryTermUpdate:k})):a.createElement(te.Z,{buttonId:"add-glossary",className:"mt-0-important",doc:bt.cK,heading:e("label.glossary"),permission:C,type:C?Dt.Wx.CREATE:Dt.Wx.NO_DATA,onClick:function(){u.push(l.Z6.ADD_GLOSSARY)}}):a.createElement(te.Z,{type:Dt.Wx.PERMISSION})},Cn=n(43745),Ln=function(e){var t=e.isGlossary,n=void 0!==t&&t,l=(0,r.k6)(),i=(0,r.UO)(),s=i.version,c=i.tab,u=void 0===c?"overview":c,d=i.id,m=(0,o.CR)((0,a.useState)({}),2),p=m[0],y=m[1],f=(0,o.CR)((0,a.useState)(),2),E=f[0],v=f[1],g=(0,o.CR)((0,a.useState)(!0),2),M=g[0],N=g[1],T=It().setActiveGlossary;return(0,a.useEffect)((function(){(0,o.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,o.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),n?[4,(0,q.YF)(d)]:[3,2];case 1:return e=a.sent(),[3,4];case 2:return[4,(0,q.hs)(d)];case 3:e=a.sent(),a.label=4;case 4:return y(e),[3,6];case 5:return t=a.sent(),(0,K.Eo)(t),[3,6];case 6:return[2]}}))}))}),[d]),(0,a.useEffect)((function(){(0,o.mG)(void 0,void 0,void 0,(function(){var e,t,a;return(0,o.Jh)(this,(function(r){switch(r.label){case 0:N(!0),r.label=1;case 1:return r.trys.push([1,6,7,8]),n?[4,(0,q.QR)(d,s)]:[3,3];case 2:return t=r.sent(),[3,5];case 3:return[4,(0,q.hw)(d,s)];case 4:t=r.sent(),r.label=5;case 5:return v(e=t),T(e),[3,8];case 6:return a=r.sent(),(0,K.Eo)(a),[3,8];case 7:return N(!1),[7];case 8:return[2]}}))}))}),[d,s]),a.createElement(An.Z,{pageTitle:"Glossary version"},a.createElement("div",{className:"version-data"},M?a.createElement(ne.Z,null):a.createElement(bn,{isVersionsView:!0,isGlossaryActive:n,isSummaryPanelOpen:!1,selectedData:E,updateGlossary:function(){return Promise.resolve()},onGlossaryDelete:function(){return Promise.resolve()},onGlossaryTermDelete:function(){return Promise.resolve()},onGlossaryTermUpdate:function(){return Promise.resolve()}})),a.createElement(Cn.Z,{currentVersion:(0,ee.toString)(s),entityType:h.py.GLOSSARY,versionHandler:function(e){var t=n?(0,W.p3)(d,e):(0,W.tP)(d,e,u);l.push(t)},versionList:p,onBack:function(){var e=(0,W.$x)(null==E?void 0:E.fullyQualifiedName);l.push(e)}}))},On=n(21559),Zn=function(){var e=(0,i.BL)().permissions,t=(0,a.useMemo)((function(){return B.NE.hasViewPermissions(s.A.GLOSSARY,e)}),[e]);return a.createElement(r.rs,null,a.createElement(r.AW,{exact:!0,component:$,path:l.Z6.ADD_GLOSSARY}),a.createElement(r.AW,{exact:!0,component:function(){return a.createElement(Ln,{isGlossary:!0})},path:l.Z6.GLOSSARY_VERSION}),a.createElement(r.AW,{exact:!0,component:Ln,path:[l.Z6.GLOSSARY_TERMS_VERSION_TAB,l.Z6.GLOSSARY_TERMS_VERSION]}),a.createElement(On.Z,{exact:!0,component:Sn,hasPermission:t,path:[l.Z6.GLOSSARY,l.Z6.GLOSSARY_DETAILS,l.Z6.GLOSSARY_DETAILS_WITH_ACTION]}),a.createElement(On.Z,{exact:!0,component:Sn,hasPermission:t,path:[l.Z6.GLOSSARY_DETAILS_WITH_TAB,l.Z6.GLOSSARY_DETAILS_WITH_SUBTAB]}))}},88816:function(e,t,n){var a=n(94184),r=n.n(a),l=n(96486),i=n(67294);t.Z=function(e){var t=e.children,n=e.id,a=e.className;return i.createElement("div",{className:r()(a,"left-panel-card"),"data-testid":(0,l.lowerCase)(n)+"-left-panel"},t)}},75883:function(e,t,n){var a=n(19586),r=n(71230),l=n(15746),i=n(96486),s=n(67294),o=n(97638),c=n(70866);t.Z=function(e){var t=e.loading,n=e.children;return t?s.createElement("div",{className:"m-b-md p-md"},s.createElement(a.Z,{active:!0,paragraph:{rows:0}}),s.createElement(r.Z,{gutter:32,justify:"space-between"},s.createElement(l.Z,{span:24},s.createElement(c.Z,null)),s.createElement(l.Z,{className:"m-t-md",span:24},s.createElement(c.Z,null)),s.createElement(l.Z,{className:"m-t-md",span:24},(0,o.kK)().map((function(){return s.createElement(c.Z,{className:"p-xs",key:(0,i.uniqueId)()})}))))):n}}}]);