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.SettingsRouter.9bf1d89926b9972b5b0a.js Maven / Gradle / Ivy
"use strict";(self.webpackChunkopen_metadata=self.webpackChunkopen_metadata||[]).push([[5601,312,6796,4566,2481],{70312:function(e,t,n){n.r(t),n.d(t,{ReactComponent:function(){return i}});var a,l=n(67294);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t .ant-space-item:last-child {\n width: 100%;\n}\n.app-details-page-layout .lazy-log-container .react-lazylog-searchbar {\n position: absolute;\n z-index: 9;\n top: -30px;\n background: unset;\n padding: unset;\n}\n.app-details-page-layout .lazy-log-container .react-lazylog-searchbar .react-lazylog-searchbar-input {\n height: 30px;\n border-radius: 4px;\n background: unset;\n color: #292929;\n}\n.app-details-page-layout .lazy-log-container .react-lazylog-searchbar-filter,\n.app-details-page-layout .lazy-log-container .react-lazylog-searchbar-matches {\n display: none;\n}\n.app-details-page-layout .request-badge.success .ant-badge-count {\n background-color: #48ca9e;\n color: #292929;\n}\n.app-details-page-layout .request-badge.failed .ant-badge-count {\n background-color: #f24822;\n color: #292929;\n}\n.app-details-page-layout .request-badge.running .ant-badge-count {\n background-color: var(--ant-primary-color);\n}\n.update-schedule-modal .ant-modal-body {\n overflow-y: auto;\n}\n',""]),t.Z=i},72901:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2024 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n.entity-stats {\n width: -webkit-max-content;\n width: max-content;\n}\n.entity-stats .ant-typography {\n font-weight: 500;\n}\n.entity-stats.total {\n background-color: var(--ant-primary-1);\n border: 1px solid var(--ant-primary-color);\n}\n.entity-stats.total .ant-typography {\n color: var(--ant-primary-color);\n}\n.entity-stats.success {\n background-color: #ebf9f4;\n border: 1px solid var(--ant-success-color);\n}\n.entity-stats.success .ant-typography {\n color: var(--ant-success-color);\n}\n.entity-stats.failure {\n background-color: #ff9a8e40;\n border: 1px solid #cb2431;\n}\n.entity-stats.failure .ant-typography {\n color: #cb2431;\n}\n',""]),t.Z=i},91833:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2024 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* navbar+tab_height+padding = 64+46+12 */\n.setting-card-item {\n height: 100%;\n border: 1px solid #7575751a;\n border-radius: 10px;\n transition: 0.3s ease-in-out;\n cursor: pointer;\n}\n.setting-card-item:hover {\n border: 1px solid var(--ant-primary-color);\n}\n.setting-card-item .ant-card-body {\n padding: 60px 20px 40px;\n text-align: center;\n}\n.setting-card-item .ant-card-body .setting-card-icon-container .setting-card-icon svg {\n font-size: 50px;\n fill: transparent;\n}\n.setting-card-item .ant-card-body .setting-card-item-content {\n margin-top: 24px;\n}\n.setting-card-item .ant-card-body .setting-card-item-content .setting-card-title {\n font-size: 18px;\n font-weight: 600;\n}\n.setting-card-item .ant-card-body .setting-card-item-content .setting-card-description {\n margin-top: 5px;\n font-size: 14px;\n font-weight: 400;\n color: #757575;\n}\n',""]),t.Z=i},39647:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* navbar+tab_height+padding = 64+46+12 */\n.team-list-container {\n padding: 20px 0;\n}\n.team-list-container .ant-btn {\n border-radius: 4px;\n}\n.teams-list-table .ant-table-row .ant-table-cell:first-child,\n.list-table .ant-table-row .ant-table-cell:first-child,\n.teams-list-table .ant-table-thead .ant-table-cell:first-child,\n.list-table .ant-table-thead .ant-table-cell:first-child {\n padding-left: 16px;\n}\n.remove-icon .ant-btn {\n height: 22px;\n width: 22px;\n}\n.roles-and-policy > .ant-space-item:first-child {\n align-self: flex-end;\n}\n.teams-list-table .ant-table-thead tr > th {\n border-right: 0px !important;\n border-bottom: 1px solid #0000001a;\n}\n.teams-list-table .ant-table-bordered .ant-table-container .ant-table-content table tbody tr td {\n border-right: none;\n background: #f8f9fa;\n}\n.teams-list-table .ant-table-bordered .ant-table-container .ant-table-content table tbody tr .ant-table-cell-row-hover {\n background: #f1f1f3;\n}\n.teams-list-table .ant-table-bordered .ant-table-container .ant-table-content table tbody .ant-table-row-level-0 td {\n background: #fff;\n}\n.teams-list-table .ant-table-bordered .ant-table-container .ant-table-content table tbody .ant-table-row-level-0 .ant-table-cell-row-hover {\n background: #f1f1f3;\n}\n.teams-list-table .ant-table-bordered .ant-table-container .ant-table-content table tbody .drop-over-having-child td {\n background: #e8f4ff;\n}\n.teams-layout {\n margin: -12px 0;\n}\n.teams-layout .ant-card-head-title {\n padding-top: 0;\n padding-bottom: 12px;\n}\n.teams-layout .teams-profile {\n background-color: #0950c51a;\n}\n.teams-layout .teams-profile-container {\n background: #f4f8ff;\n}\n.teams-layout .teams-profile-container .ant-card {\n background: none;\n}\n.teams-layout .teams-profile-container .ant-collapse-header {\n padding-left: 0;\n}\n.teams-layout .teams-profile-container .ant-collapse-header .ant-collapse-expand-icon {\n padding-top: 10px;\n}\n.teams-layout .teams-profile-container .ant-collapse-arrow {\n top: 35px !important;\n}\n.teams-layout .teams-profile-container .domain-link {\n font-size: 14px;\n}\n.teams-layout .teams-tabs-content-container {\n width: 100%;\n}\n.teams-layout .teams-tabs-content-container .teams-scroll-component {\n width: 100%;\n height: calc(100vh - 120px);\n overflow-y: scroll;\n}\n.team-assets-right-panel .summary-panel-container {\n height: 100%;\n border: 0;\n}\n',""]),t.Z=i},48166:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,"/*\n * Copyright 2024 Collate.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n.white-label-config-card {\n background-color: #f9f9f9;\n padding: 16px;\n border-radius: 10px;\n}\n.white-label-config-card .ant-card-head {\n border-bottom: none;\n}\n.white-label-config-card .ant-card-head .ant-card-head-wrapper .ant-card-head-title {\n color: #292929;\n font-size: 16px;\n font-weight: 500;\n}\n.white-label-config-card .ant-input[type='color'],\n.white-label-config-card .ant-input[type='text'] {\n height: 40px;\n}\n.white-label-card-wrapper {\n display: flex;\n flex-direction: column;\n gap: 24px;\n}\n.preview-image {\n background-color: #fff;\n border: 1px dashed #9ca3af;\n padding: 8px;\n border-radius: 4px;\n}\n.theme-preview .ant-card-body {\n display: flex;\n flex-direction: row;\n gap: 16px;\n padding: 8px 0px;\n}\n.custom-theme-beta-tag .ant-badge-count {\n background-color: var(--ant-primary-color);\n color: #fff;\n padding: 0 4px;\n margin-left: 2px;\n font-size: 10px;\n}\n",""]),t.Z=i},36561:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2023 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n.customize-landing-page .ant-card-head {\n border: none;\n}\n',""]),t.Z=i},37645:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n.custom-properties-schemaEditor {\n border: 1px solid #dce3ec;\n border-radius: 6px;\n}\n',""]),t.Z=i},33560:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n.side-panel-icons {\n color: #515151;\n height: 16px;\n width: 16px;\n}\n',""]),t.Z=i},500:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* navbar+tab_height+padding = 64+46+12 */\n.policies-detail .list-table .ant-table-row .ant-table-cell:first-child,\n.policies-detail .list-table .ant-table-thead .ant-table-cell:first-child {\n padding-left: 16px;\n}\n.policies-detail .ant-collapse {\n background-color: #fff;\n border: 1px solid #0000001a;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.12);\n border-radius: 4px;\n}\n.policies-detail .ant-collapse .ant-collapse-item .ant-collapse-header {\n padding: 16px;\n align-items: flex-start;\n}\n.policies-detail .ant-collapse .ant-collapse-item .ant-collapse-header .ant-collapse-arrow {\n color: #292929;\n font-size: 14px;\n}\n.policies-detail .ant-collapse .ant-collapse-content {\n border-top: none;\n}\n.policies-detail .ant-collapse .ant-collapse-content .ant-collapse-content-box {\n padding-top: 0px;\n}\n.policies-detail .ant-space.tabpane-space > .ant-space-item:first-child {\n align-self: flex-end;\n}\n',""]),t.Z=i},47871:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n.policies-list-container .ant-btn {\n border-radius: 4px;\n}\n.policies-list-table .ant-table-row .ant-table-cell:first-child,\n.policies-list-table .ant-table-thead .ant-table-cell:first-child {\n padding-left: 16px;\n}\n',""]),t.Z=i},14716:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2024 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* navbar+tab_height+padding = 64+46+12 */\n.profiler-configuration-page-container {\n width: 70%;\n margin: 16px auto 0;\n padding-bottom: 16px;\n}\n.profiler-configuration-page-container .ant-form-item {\n margin: 0px;\n}\n.profiler-configuration-page-container .ant-card {\n border-radius: 10px;\n}\n.profiler-configuration-form-item-container {\n background-color: #f9f9f9;\n}\n.profiler-configuration-form-item-container .ant-card-body {\n padding: 20px;\n}\n',""]),t.Z=i},66093:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n.ant-attribute-modal .ant-modal-body {\n padding: 16px 8px;\n}\n.ant-attribute-modal .ant-modal-body .ant-row {\n padding: 16px;\n cursor: pointer;\n}\n.ant-attribute-modal .ant-modal-body .ant-row.ant-search-box-row {\n padding-top: 0px;\n}\n.ant-attribute-modal .ant-modal-body .ant-row.selected {\n background-color: var(--ant-primary-1);\n}\n',""]),t.Z=i},3878:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n.roles-detail .list-table .ant-table-row .ant-table-cell:first-child,\n.roles-detail .list-table .ant-table-thead .ant-table-cell:first-child {\n padding-left: 16px;\n}\n.roles-detail .role-detail-tab.ant-space > .ant-space-item:first-child {\n align-self: flex-end;\n}\n.link-hover:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n',""]),t.Z=i},9591:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n.roles-list-container .ant-btn {\n border-radius: 4px;\n}\n.roles-list-table .ant-table-row .ant-table-cell:first-child,\n.roles-list-table .ant-table-thead .ant-table-cell:first-child {\n padding-left: 16px;\n}\n',""]),t.Z=i},64738:function(e,t,n){var a=n(8081),l=n.n(a),r=n(23645),i=n.n(r)()(l());i.push([e.id,'/*\n * Copyright 2022 Collate.\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n.user-listing .ant-btn,\n.reactive-modal .ant-btn {\n border-radius: 4px;\n}\n.user-listing .user-list-table .ant-table-row .ant-table-cell:first-child,\n.reactive-modal .user-list-table .ant-table-row .ant-table-cell:first-child,\n.user-listing .user-list-table .ant-table-thead .ant-table-cell:first-child,\n.reactive-modal .user-list-table .ant-table-thead .ant-table-cell:first-child {\n padding-left: 16px;\n}\n.action-icons .ant-btn {\n height: 20px;\n width: 20px;\n padding: 0px;\n}\n',""]),t.Z=i},92070:function(e,t,n){n.r(t),n.d(t,{default:function(){return Rr}});var a,l=n(67294),r=n(15137),i=n(62761),s=n(96162),o=n(46481),c=n(7161),u=n(81048);!function(e){e.BusinessUnit="BusinessUnit",e.Department="Department",e.Division="Division",e.Group="Group",e.Organization="Organization"}(a||(a={}));var d=n(70655),m=n(49409),p=n(71230),f=n(15746),E=n(56256),y=n(19586),v=n(4107),h=n(71577),b=n(50963),g=n(96486),C=n(68432),Z=n(30743),N=n(35850),S=n(89011),T=n(97359),x=n(36169),w=n(23051),I=n(5397),A=n(55538),R=n(48794),M=n(66537),k=n(1600),L=n(63866),D=n(96840),O=n(46321),P=n(20897),U=n(77743),z=n(88433),G=function(){var e,t,n=(0,C.$)().t,a=(0,d.CR)((0,b.useForm)(),1)[0],o=(0,r.k6)(),c=(0,M.f)().fqn,u=(0,R.N)(),G=u.setInlineAlertDetails,_=u.inlineAlertDetails,B=(0,I.o)().getResourceLimit,j=(0,d.CR)((0,l.useState)(0),2),F=j[0],H=j[1],V=(0,d.CR)((0,l.useState)([]),2),W=V[0],J=V[1],q=(0,d.CR)((0,l.useState)(!1),2),Q=q[0],Y=q[1],K=(0,d.CR)((0,l.useState)(),2),$=K[0],X=K[1],ee=(0,l.useMemo)((function(){return[{name:n("label.setting-plural"),url:i.Z6.SETTINGS},{name:n("label.notification-plural"),url:(0,D.si)(s.CZ.NOTIFICATIONS)},{name:n(c?"label.edit-entity":"label.create-entity",{entity:n("label.alert")}),url:""}]}),[c]);(0,l.useEffect)((function(){(0,d.mG)(void 0,void 0,void 0,(function(){var e;return(0,d.Jh)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,3,4]),H((function(e){return e+1})),[4,(0,k.UT)()];case 1:return e=t.sent(),J(e.data),[3,4];case 2:return t.sent(),(0,O.Eo)(n("server.entity-fetch-error",{entity:n("label.config")})),[3,4];case 3:return H((function(e){return e-1})),[7];case 4:return[2]}}))})),c&&(0,d.mG)(void 0,void 0,void 0,(function(){var e,t,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,3,4]),H((function(e){return e+1})),[4,(0,k.$K)(c)];case 1:return e=l.sent(),t=(0,d.pi)((0,d.pi)({},e),{timeout:null!==(a=e.destinations[0].timeout)&&void 0!==a?a:10,destinations:e.destinations.map((function(e){var t=e.category===A.bz.External;return(0,d.pi)((0,d.pi)({},e),{destinationType:t?e.type:e.category})}))}),X(t),[3,4];case 2:return l.sent(),(0,O.Eo)(n("server.entity-fetch-error",{entity:n("label.alert")}),c),[3,4];case 3:return H((function(e){return e-1})),[7];case 4:return[2]}}))}))}),[c]);var te=(0,l.useMemo)((function(){return!(0,g.isEmpty)(c)}),[c]),ne=(0,l.useCallback)((function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,3,4]),Y(!0),[4,(0,L.Xn)({data:e,fqn:c,createAlertAPI:k.hm,updateAlertAPI:k.NY,afterSaveAction:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(t){switch(t.label){case 0:return c?[3,2]:[4,B("eventsubscription",!0,!0)];case 1:t.sent(),t.label=2;case 2:return o.push((0,D.X9)(e.name)),[2]}}))}))},setInlineAlertDetails:G})];case 1:case 2:return t.sent(),[3,4];case 3:return Y(!1),[7];case 4:return[2]}}))}))}),[c,o]),ae=(0,d.CR)(null!==(e=m.Z.useWatch(["resources"],a))&&void 0!==e?e:[],1)[0],le=(0,l.useMemo)((function(){var e;return null===(e=W.find((function(e){return e.name===ae})))||void 0===e?void 0:e.supportedFilters}),[W,ae]),re=(0,l.useMemo)((function(){return!ae||!(0,g.isEmpty)(le)}),[ae,le]);return F>0?l.createElement(N.Z,null):l.createElement(S.Z,{hideSecondPanel:!0,className:"content-height-with-resizable-panel",firstPanel:{className:"content-resizable-panel-container",children:l.createElement("div",{className:"steps-form-container"},l.createElement(p.Z,{className:"page-container",gutter:[16,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:ee})),l.createElement(f.Z,{span:24},l.createElement(E.Z.Title,{level:5},n("label."+(te?"edit":"add")+"-entity",{entity:n("label.alert")})),l.createElement(E.Z.Text,null,n("message.alerts-description"))),l.createElement(f.Z,{span:24},l.createElement(m.Z,{className:"alerts-notification-form",form:a,initialValues:(0,d.pi)((0,d.pi)({},$),{resources:null===(t=null==$?void 0:$.filteringRules)||void 0===t?void 0:t.resources}),validateMessages:i.NG,onFinish:ne},F>0?l.createElement(y.Z,{title:!0,paragraph:{rows:8}}):l.createElement(p.Z,{gutter:[20,20]},l.createElement(f.Z,{span:24},l.createElement(m.Z.Item,{label:n("label.name"),labelCol:{span:24},name:"name",rules:w.m},l.createElement(v.Z,{disabled:te,placeholder:n("label.name")}))),l.createElement(f.Z,{span:24},l.createElement(m.Z.Item,{label:n("label.description"),labelCol:{span:24},name:"description",trigger:"onTextChange",valuePropName:"initialValue"},l.createElement(T.Z,{"data-testid":"description",height:"200px",initialValue:""}))),l.createElement(f.Z,{span:24},l.createElement(P.Z,{filterResources:W})),re&&l.createElement(f.Z,{span:24},l.createElement(z.Z,{supportedFilters:le})),l.createElement(m.Z.Item,{hidden:!0,initialValue:A.NK.Notification,name:"alertType"}),l.createElement(m.Z.Item,{hidden:!0,initialValue:A.lP.User,name:"provider"}),l.createElement(f.Z,{span:24},l.createElement(U.Z,null)),!(0,g.isUndefined)(_)&&l.createElement(f.Z,{span:24},l.createElement(Z.Z,(0,d.pi)({},_))),l.createElement(f.Z,{flex:"auto"}),l.createElement(f.Z,{flex:"300px",pull:"right"},l.createElement(h.Z,{className:"m-l-sm float-right","data-testid":"save-button",htmlType:"submit",loading:Q,type:"primary"},n("label.save")),l.createElement(h.Z,{className:"float-right","data-testid":"cancel-button",onClick:function(){return o.goBack()}},n("label.cancel")))))))),minWidth:700,flex:.7},pageTitle:n("label.entity-detail-plural",{entity:n("label.alert")}),secondPanel:{children:l.createElement(l.Fragment,null),minWidth:0,className:"content-resizable-panel-container"}})},_=n(84729),B=n(91894),j=n(19650),F=n(27049),H=n(76),V=n(38780),W=n(8645),J=n(22087),q=function(e){var t,n,a,r,i,s=e.alerts,o=e.onDelete,c=e.pageHeaderData,u=e.allowDelete,d=void 0===u||u,m=e.breadcrumb,y=e.allowEdit,v=void 0===y||y,b=(0,C.$)().t;return l.createElement(p.Z,{align:"middle",className:"page-container",gutter:[16,16]},l.createElement(f.Z,{span:24},l.createElement("div",{className:"d-flex items-center justify-between"},m?l.createElement(x.Z,{titleLinks:m}):null,c?l.createElement(J.Z,{data:c}):null,l.createElement(j.Z,{size:16},v&&l.createElement(H.Link,{to:L.us+"/"+(null==s?void 0:s.id)},l.createElement(h.Z,{className:"flex flex-center",icon:l.createElement(V.ReactComponent,{height:12})},b("label.edit"))),d&&l.createElement(h.Z,{className:"flex flex-center",icon:l.createElement(W.ReactComponent,{height:12}),onClick:o},b("label.delete"))))),l.createElement(f.Z,{span:24},l.createElement(B.Z,null,l.createElement(j.Z,{direction:"vertical",size:8},l.createElement(E.Z.Title,{className:"m-0",level:5},b("label.trigger")),l.createElement(E.Z.Text,{"data-testid":"display-name-entities"},null===(a=null===(n=null===(t=null==s?void 0:s.filteringRules)||void 0===t?void 0:t.resources)||void 0===n?void 0:n.map(L.Hg))||void 0===a?void 0:a.join(", "))),l.createElement(F.Z,null),l.createElement(E.Z.Title,{level:5},b("label.filter-plural")),l.createElement(E.Z.Paragraph,null,null===(i=null===(r=null==s?void 0:s.filteringRules)||void 0===r?void 0:r.rules)||void 0===i?void 0:i.map((function(e){var t,n=(0,g.isArray)(e.condition)?e.condition.join(", "):e.condition,a=e.effect===A.Qm.Include?"===":"!==",r=(0,L.m8)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"");return l.createElement(l.Fragment,{key:e.name},l.createElement(E.Z.Text,{code:!0},r+" "+a+" "+n),l.createElement("br",null))}))),l.createElement(F.Z,null),l.createElement(E.Z.Title,{level:5},b("label.destination")),l.createElement(p.Z,{gutter:[16,16]}))))},Q=n(24671),Y=function(){var e=(0,d.CR)((0,l.useState)(!1),2),t=e[0],n=e[1],a=(0,d.CR)((0,l.useState)(),2),r=a[0],i=a[1],s=(0,C.$)().t,o=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,t,a,l,r;return(0,d.Jh)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,3,4]),n(!0),[4,(0,k.$K)("ActivityFeedAlert")];case 1:return e=o.sent(),t=null!==(r=null===(l=null===(a=e.filteringRules)||void 0===a?void 0:a.rules)||void 0===l?void 0:l.map((function(e){var t=(0,d.CR)(e.condition.split("("),2),n=t[0],a=t[1];return(0,d.pi)((0,d.pi)({},e),{fullyQualifiedName:n,condition:a.replaceAll("'","").replace(new RegExp("\\)"),"").split(",").map(g.trim)})})))&&void 0!==r?r:[],i((0,d.pi)((0,d.pi)({},e),{filteringRules:(0,d.pi)((0,d.pi)({},e.filteringRules),{rules:t})})),[3,4];case 2:return o.sent(),(0,O.Eo)(s("server.entity-fetch-error",{entity:s("label.activity-feed-plural")})),[3,4];case 3:return n(!1),[7];case 4:return[2]}}))}))}),[]);(0,l.useEffect)((function(){o()}),[]);var c=(0,l.useMemo)((function(){return{header:(0,Q.C_)(r),subHeader:(null==r?void 0:r.description)||""}}),[r]);return t?l.createElement(B.Z,{loading:t}):r?l.createElement(q,{alerts:r,allowDelete:!1,pageHeaderData:c,onDelete:g.noop}):l.createElement(N.Z,null)},K=n(16165),$=n(79166),X=n(34962),ee=n(2548),te=n(97725),ne=n(76709),ae=n(16139),le=n(53026),re=n(17309),ie=n(75312),se=n(78770),oe=n(58804),ce=n(82819),ue=n(93379),de=n.n(ue),me=n(7795),pe=n.n(me),fe=n(90569),Ee=n.n(fe),ye=n(3565),ve=n.n(ye),he=n(19216),be=n.n(he),ge=n(44589),Ce=n.n(ge),Ze=n(48166),Ne={};Ne.styleTagTransform=Ce(),Ne.setAttributes=ve(),Ne.insert=Ee().bind(null,"head"),Ne.domAPI=pe(),Ne.insertStyleElement=be(),de()(Ze.Z,Ne),Ze.Z&&Ze.Z.locals&&Ze.Z.locals;var Se=function(){var e=(0,r.k6)(),t=(0,R.N)(),n=t.applicationConfig,a=t.setApplicationConfig,i=(0,C.$)().t,o=(0,d.CR)(m.Z.useForm(),1)[0],c=(0,d.CR)((0,l.useState)(!1),2),u=c[0],y=c[1],v=(0,d.CR)((0,l.useState)(!1),2),b=v[0],Z=v[1],N=(0,d.CR)((0,l.useState)((0,d.pi)((0,d.pi)({},null==n?void 0:n.customLogoConfig),null==n?void 0:n.customTheme)),2),S=N[0],T=N[1],w=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.PREFERENCES,i("label.theme"))}),[]),I=[{name:"primaryColor",id:"primaryColor",label:"Primary Color",required:!1,type:re.Uv.COLOR_PICKER,rules:[{pattern:ae.H1,message:i("message.hex-color-validation")}],props:{"data-testid":"primaryColor"}},{name:"errorColor",id:"errorColor",label:"Error Color",required:!1,type:re.Uv.COLOR_PICKER,rules:[{pattern:ae.H1,message:i("message.hex-color-validation")}],props:{"data-testid":"errorColor"}},{name:"successColor",id:"successColor",label:"Success Color",required:!1,type:re.Uv.COLOR_PICKER,rules:[{pattern:ae.H1,message:i("message.hex-color-validation")}],props:{"data-testid":"successColor"}},{name:"warningColor",id:"warningColor",label:"Warning Color",required:!1,type:re.Uv.COLOR_PICKER,rules:[{pattern:ae.H1,message:i("message.hex-color-validation")}],props:{"data-testid":"warningColor"}},{name:"infoColor",id:"infoColor",label:"Info Color",required:!1,type:re.Uv.COLOR_PICKER,rules:[{pattern:ae.H1,message:i("message.hex-color-validation")}],props:{"data-testid":"infoColor"}}],A=[{name:"customLogoUrlPath",label:i("label.logo-url"),type:re.Uv.TEXT,required:!1,id:"root/customLogoUrlPath",placeholder:"URL path for the login page logo",props:{"data-testid":"customLogoUrlPath",autoFocus:!0},rules:[{type:"url",message:i("message.entity-is-not-valid-url",{entity:i("label.logo-url")})}]},{name:"customMonogramUrlPath",label:i("label.monogram-url"),type:re.Uv.TEXT,required:!1,id:"root/customMonogramUrlPath",placeholder:"URL path for the navbar logo",props:{"data-testid":"customMonogramUrlPath"},rules:[{type:"url",message:i("message.entity-is-not-valid-url",{entity:i("label.monogram-url")})}]},{name:"customFaviconUrlPath",label:i("label.favicon-url"),type:re.Uv.TEXT,required:!1,id:"root/customFaviconUrlPath",placeholder:"URL path for the favicon",props:{"data-testid":"customFaviconUrlPath"},rules:[{type:"url",message:i("message.entity-is-not-valid-url",{entity:i("label.favicon-url")})}]}];return(0,l.useEffect)((function(){var e=(0,d.pi)((0,d.pi)({},null==n?void 0:n.customLogoConfig),null==n?void 0:n.customTheme);T(e),o.setFieldsValue(e)}),[n]),l.createElement(ne.Z,{pageTitle:i("label.theme")},l.createElement(p.Z,{align:"middle",className:"page-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:w})),l.createElement(f.Z,{span:24},l.createElement(p.Z,{align:"middle",justify:"space-between"},l.createElement(f.Z,{span:24},l.createElement(j.Z,{className:"w-full justify-between"},l.createElement(J.Z,{data:{header:i("label.theme"),subHeader:i("message.appearance-configuration-message")}}),l.createElement(h.Z,{"data-testid":"reset-button",loading:b,type:"primary",onClick:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,t,n;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:Z(!0),l.label=1;case 1:return l.trys.push([1,3,4,5]),e={customLogoConfig:{customLogoUrlPath:"",customMonogramUrlPath:"",customFaviconUrlPath:""},customTheme:{primaryColor:"",errorColor:"",successColor:"",warningColor:"",infoColor:""}},t={config_type:le.Sd.CustomUIThemePreference,config_value:e},[4,(0,ie.Br)(t)];case 2:return l.sent(),a((0,d.pi)((0,d.pi)({},e),{customTheme:(0,ce.I)(e.customTheme)})),[3,5];case 3:return n=l.sent(),(0,O.Eo)(n),[3,5];case 4:return Z(!1),[7];case 5:return[2]}}))}))}},i("label.reset")))))),l.createElement(f.Z,{span:24},l.createElement(m.Z,{form:o,initialValues:(0,d.pi)((0,d.pi)({},null==n?void 0:n.customLogoConfig),null==n?void 0:n.customTheme),layout:"vertical",onFinish:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,l,r,i,s,o,c,u,m,p;return(0,d.Jh)(this,(function(d){switch(d.label){case 0:y(!0),d.label=1;case 1:return d.trys.push([1,3,4,5]),t={customLogoConfig:{customLogoUrlPath:null!==(r=null==e?void 0:e.customLogoUrlPath)&&void 0!==r?r:"",customMonogramUrlPath:null!==(i=null==e?void 0:e.customMonogramUrlPath)&&void 0!==i?i:"",customFaviconUrlPath:null!==(s=null==e?void 0:e.customFaviconUrlPath)&&void 0!==s?s:""},customTheme:{primaryColor:null!==(o=null==e?void 0:e.primaryColor)&&void 0!==o?o:"",errorColor:null!==(c=null==e?void 0:e.errorColor)&&void 0!==c?c:"",successColor:null!==(u=null==e?void 0:e.successColor)&&void 0!==u?u:"",warningColor:null!==(m=null==e?void 0:e.warningColor)&&void 0!==m?m:"",infoColor:null!==(p=null==e?void 0:e.infoColor)&&void 0!==p?p:""}},n={config_type:le.Sd.CustomUIThemePreference,config_value:t},[4,(0,ie.Br)(n)];case 2:return d.sent(),a(t),[3,5];case 3:return l=d.sent(),(0,O.Eo)(l),[3,5];case 4:return y(!1),[7];case 5:return[2]}}))}))},onValuesChange:function(e,t){return T((0,d.pi)({},t))}},l.createElement("div",{className:"white-label-card-wrapper m-b-md"},l.createElement(B.Z,{className:"white-label-config-card",title:i("label.custom-logo")},l.createElement(p.Z,{className:"w-full",gutter:[16,16]},A.map((function(e){return l.createElement(f.Z,{className:"w-full",key:e.id,span:24},l.createElement(p.Z,{gutter:[48,16]},l.createElement(f.Z,{span:12},(0,se.rz)(e)),l.createElement(f.Z,null,l.createElement(te.Z,{className:"preview-image",height:70,isMonoGram:"customLogoUrlPath"!==e.name,src:S[e.name],width:"customLogoUrlPath"!==e.name?75:120}))))})))),l.createElement(B.Z,{className:"white-label-config-card",title:l.createElement("div",{className:"d-flex items-center"},l.createElement(E.Z.Text,null,i("label.custom-theme")),l.createElement($.Z,{className:"custom-theme-beta-tag",count:i("label.beta"),"data-testid":"custom-theme-beta-tag",offset:[10,0],size:"small"}))},l.createElement(p.Z,{className:"w-full",gutter:[16,16]},I.map((function(e){var t=S[e.name];return l.createElement(f.Z,{className:"w-full",key:e.id,span:24},l.createElement(p.Z,{gutter:[48,16]},l.createElement(f.Z,{span:12},(0,se.rz)(e)),l.createElement(f.Z,{style:{placeSelf:"center"}},l.createElement(B.Z,{className:"theme-preview"},l.createElement(h.Z,{style:{background:t,color:"white",width:"86px"}},(0,g.startCase)((0,g.toString)(e.name).replace("Color",""))),l.createElement(h.Z,{icon:l.createElement(K.Z,{component:ee.ReactComponent}),style:{width:"56px",color:t,borderColor:t}}),l.createElement(h.Z,{style:{color:t,borderColor:t,width:"86px"},type:"default"},(0,g.startCase)((0,g.toString)(e.name).replace("Color",""))),l.createElement(X.ReactComponent,{style:{color:t},width:32}),l.createElement(h.Z,{style:{color:t,padding:0},type:"link"},i("label.link"))))))}))))),l.createElement(j.Z,{className:"w-full justify-end appearance-cta-buttons","data-testid":"cta-buttons",size:16},l.createElement(h.Z,{"data-testid":"cancel-btn",type:"link",onClick:function(){return e.goBack()}},i("label.cancel")),l.createElement(h.Z,{"data-testid":"save-btn",htmlType:"submit",loading:u,type:"primary"},i("label.save")))))))},Te=n(12028),xe=n(26396),we=n(71112),Ie=n(54585),Ae=n(43104),Re=n(61105),Me=n(34530),ke=n(502),Le=n(802),De=n(46199),Oe=function(){var e=(0,C.$)().t,t=(0,Le.C)(),n=t.currentPage,a=t.paging,o=t.pageSize,c=t.handlePagingChange,u=t.handlePageChange,m=t.handlePageSizeChange,E=t.showPagination,v=(0,r.k6)(),b=(0,d.CR)((0,l.useState)(!0),2),Z=b[0],N=b[1],S=(0,d.CR)((0,l.useState)(),2),T=S[0],w=S[1],I=(0,d.CR)((0,l.useState)(!1),2),A=I[0],R=I[1],M=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.APPLICATIONS)}),[]),k=(0,l.useCallback)((function(e,t){return void 0===e&&(e=!1),(0,d.mG)(void 0,void 0,void 0,(function(){var n,a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,3,4]),N(!0),[4,(0,De.AY)({after:null==t?void 0:t.after,before:null==t?void 0:t.before,limit:o,include:e?Me.y.Deleted:Me.y.NonDeleted})];case 1:return n=i.sent(),a=n.data,l=n.paging,w(a),c(l),[3,4];case 2:return r=i.sent(),(0,O.Eo)(r),[3,4];case 3:return N(!1),[7];case 4:return[2]}}))}))}),[o,c]),L=(0,l.useMemo)((function(){return A?l.createElement(f.Z,{className:"mt-24 text-center",span:24},l.createElement(xe.Z,{heading:e("label.application-plural")})):l.createElement(f.Z,{className:"mt-24 text-center",span:24},l.createElement(xe.Z,{heading:e("label.application-plural"),type:Re.Wx.CUSTOM},l.createElement("div",null,e("message.no-installed-applications-found"))))}),[A]);return(0,l.useEffect)((function(){k()}),[o]),l.createElement(ne.Z,{pageTitle:e("label.application-plural")},l.createElement(p.Z,{className:"page-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:M})),l.createElement(f.Z,{span:16},l.createElement(J.Z,{data:Ae.j.APPLICATION})),l.createElement(f.Z,{className:"d-flex justify-end",span:8},l.createElement(j.Z,{size:"middle"},l.createElement("div",null,l.createElement(Te.Z,{checked:A,"data-testid":"show-disabled",onClick:function(e){R(e),k(e)}}),l.createElement("span",{className:"m-l-xs"},e("label.disabled"))),l.createElement(ke.Z,{resource:"app"},l.createElement(h.Z,{"data-testid":"add-application",type:"primary",onClick:function(){v.push(i.Z6.MARKETPLACE)}},e("label.add-entity",{entity:e("label.app-plural")})))))),l.createElement(p.Z,{className:"page-container m-t-lg"},Z&&[1,2,3].map((function(e){return l.createElement(f.Z,{key:e,span:8},l.createElement(B.Z,{className:"w-400"},l.createElement(y.Z,{active:!0,paragraph:!0,title:!0})))})),(0,g.isEmpty)(T)&&!Z&&L,!Z&&l.createElement(l.Fragment,null,l.createElement(f.Z,{span:24},l.createElement("div",{className:"d-flex flex-wrap gap-3"},null==T?void 0:T.map((function(t){var n,a;return l.createElement(Ie.Z,{appName:null!==(n=t.fullyQualifiedName)&&void 0!==n?n:"",className:"w-400",deleted:t.deleted,description:null!==(a=t.description)&&void 0!==a?a:"",key:(0,g.uniqueId)(),linkTitle:e("label.configure"),showDescription:!1,title:(0,Q.C_)(t),onClick:function(){return function(e){var t;v.push((0,D.aZ)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:""))}(t)}})})))),l.createElement(f.Z,{span:24},E&&l.createElement(we.Z,{currentPage:n,pageSize:o,paging:a,pagingHandler:function(e){var t,n=e.currentPage,l=e.cursorType;u(n),l&&k(A,((t={})[l]=a[l],t.total=a.total,t))},onShowSizeChange:m})))))},Pe=n(53014),Ue=n(94199),ze=n(92693),Ge=n(64632),_e=n(88835),Be=n(85087),je=n(31928),Fe=n(92342),He=n(89368),Ve=n(38048),We=n(59817),Je=n(37565),qe=function(e){var t=e.showDeleted,n=e.handleAddBotClick,a=e.handleShowDeleted,r=(0,Be.a)().isAdminUser,o=(0,C.$)().t,c=(0,d.CR)((0,l.useState)([]),2),u=c[0],m=c[1],E=(0,d.CR)((0,l.useState)(),2),y=E[0],v=E[1],b=(0,d.CR)((0,l.useState)(!0),2),Z=b[0],N=b[1],S=(0,I.o)().getResourceLimit,T=(0,Le.C)(),w=T.currentPage,A=T.paging,R=T.pageSize,M=T.handlePagingChange,k=T.handlePageChange,L=T.handlePageSizeChange,D=T.showPagination,P=(0,d.CR)((0,l.useState)(!1),2),U=P[0],z=P[1],G=(0,d.CR)((0,l.useState)([]),2),_=G[0],B=G[1],F=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.BOTS)}),[]),V=function(e,t){return(0,d.mG)(void 0,void 0,void 0,(function(){var n,a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,3,4]),N(!0),[4,(0,je.Ww)({after:null==t?void 0:t.after,before:null==t?void 0:t.before,limit:R,include:e?Me.y.Deleted:Me.y.NonDeleted})];case 1:return n=i.sent(),a=n.data,l=n.paging,M(l),m(a),B(a),!e&&(0,g.isEmpty)(a)?z(!0):z(!1),[3,4];case 2:return r=i.sent(),(0,O.Eo)(r.message),[3,4];case 3:return N(!1),[7];case 4:return[2]}}))}))},q=(0,l.useMemo)((function(){return[{title:o("label.name"),dataIndex:"displayName",key:"displayName",width:200,render:function(e,t){var n=(0,Q.C_)(t),a=t.fullyQualifiedName||t.name||"";return l.createElement(H.Link,{"data-testid":"bot-link-"+n,to:(0,i.mn)(a)},n)}},{title:o("label.description"),dataIndex:"description",key:"description",render:function(e,t){return(null==t?void 0:t.description)?l.createElement(Ve.Z,{markdown:(null==t?void 0:t.description)||""}):l.createElement("span",{"data-testid":"no-description"},o("label.no-entity",{entity:o("label.description")}))}},{title:o("label.action-plural"),dataIndex:"id",key:"id",width:90,render:function(e,t){var n=t.provider===_e.l.System,a=o(n?"message.ingestion-bot-cant-be-deleted":r?"label.delete":"message.admin-only-action"),i=!r||n;return l.createElement(Ue.Z,{placement:"topRight",title:a},l.createElement(h.Z,{"data-testid":"bot-delete-"+t.name,disabled:i,icon:l.createElement(Pe.Z,{className:"align-middle",component:W.ReactComponent,style:{fontSize:"16px"}}),type:"text",onClick:function(){return v(t)}}))}}]}),[]),Y=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(e){switch(e.label){case 0:return[4,S("bot",!0,!0)];case 1:return e.sent(),V(t),[2]}}))}))}),[y]);(0,l.useEffect)((function(){m([]),B([]),V(t)}),[t,R]);var K=o("label.add-entity",{entity:o("label.bot")});return U?l.createElement(p.Z,null,l.createElement(f.Z,{className:"w-full d-flex justify-end"},l.createElement(j.Z,{align:"end",size:5},l.createElement(Te.Z,{checked:t,id:"switch-deleted",size:"small",onClick:a}),l.createElement("label",{htmlFor:"switch-deleted"},o("label.show-deleted")))),l.createElement(f.Z,{className:"w-full"},l.createElement(xe.Z,{className:"mt-24",doc:ze.Kb,heading:o("label.bot"),permission:r,type:Re.Wx.CREATE,onClick:n}))):l.createElement(p.Z,{className:"page-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:F})),l.createElement(f.Z,{span:12},l.createElement(J.Z,{data:Ae.j.BOTS})),l.createElement(f.Z,{span:12},l.createElement(j.Z,{align:"center",className:"w-full justify-end",size:16},l.createElement(j.Z,{align:"end",size:5},l.createElement(Te.Z,{checked:t,"data-testid":"switch-deleted",id:"switch-deleted",onClick:a}),l.createElement("label",{htmlFor:"switch-deleted"},o("label.show-deleted"))),l.createElement(Ue.Z,{placement:"topLeft",title:!r&&o("message.admin-only-action")},l.createElement(ke.Z,{resource:"bot"},l.createElement(h.Z,{"data-testid":"add-bot",disabled:!r,type:"primary",onClick:n},K))))),l.createElement(f.Z,{span:8},l.createElement(We.Z,{removeMargin:!0,placeholder:o("label.search-for-type",{type:o("label.bot-plural")})+"...",typingInterval:500,onSearch:function(e){if(e){var t=(0,g.lowerCase)(e),n=u.filter((function(e){var n,a;return e.name.includes(t)||(null===(n=e.displayName)||void 0===n?void 0:n.includes(t))||(null===(a=e.description)||void 0===a?void 0:a.includes(t))}));B(n)}else B(u)}})),l.createElement(f.Z,{span:24},l.createElement(Je.Z,{bordered:!0,columns:q,dataSource:_,loading:Z,locale:{emptyText:l.createElement(He.Z,null)},pagination:!1,rowKey:"name",size:"small"})),l.createElement(f.Z,{span:24},D&&l.createElement(we.Z,{currentPage:w,pageSize:R,paging:A,pagingHandler:function(e){var t,n=e.currentPage,a=e.cursorType;k(n),a&&V(!1,((t={})[a]=A[a],t.total=A.total,t))},onShowSizeChange:L})),l.createElement(Fe.Z,{afterDeleteAction:Y,allowSoftDelete:!t,entityId:(null==y?void 0:y.id)||"",entityName:(0,Q.C_)(y),entityType:Ge.py.BOT,visible:Boolean(y),onCancel:function(){v(void 0)}}))},Qe=function(){var e=(0,C.$)().t,t=(0,r.k6)(),n=(0,d.CR)((0,l.useState)(!1),2),a=n[0],s=n[1];return l.createElement(ne.Z,{pageTitle:e("label.entity-detail-plural",{entity:e("label.table")}),title:"Table details"},l.createElement(qe,{handleAddBotClick:function(){t.push((0,i.FO)(!0))},handleShowDeleted:function(e){s(e)},showDeleted:a}))},Ye=n(1261),Ke=n(85071),$e=function(){var e=(0,C.$)().t,t=(0,r.k6)(),n=(0,d.CR)(m.Z.useForm(),1)[0],a=(0,d.CR)((0,l.useState)(""),2),o=a[0],c=a[1],u=(0,d.CR)((0,l.useState)(!1),2),E=u[0],y=u[1],v=(0,d.CR)((0,l.useState)(!1),2),b=v[0],g=v[1],Z=function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),y(!0),[4,(0,ie.jv)()];case 1:return e=a.sent(),n.setFieldsValue((0,d.pi)({},null!=e?e:{})),[3,4];case 2:return t=a.sent(),(0,O.Eo)(t),[3,4];case 3:return y(!1),[7];case 4:return[2]}}))}))},T=(0,l.useMemo)((function(){return[{name:e("label.setting-plural"),url:(0,D.si)()},{name:e("label.login-configuration"),url:(0,D.si)(s.CZ.PREFERENCES,s.lx.LOGIN_CONFIGURATION)},{name:e("label.edit-entity",{entity:e("label.login-configuration")}),url:""}]}),[]),w=[{name:"maxLoginFailAttempts",label:e("label.max-login-fail-attempt-plural"),type:re.Uv.NUMBER,required:!1,id:"root/maxLoginFailAttempts",props:{"data-testid":"maxLoginFailAttempts",size:"default",style:{width:"100%"},autoFocus:!0},rules:[{min:0,type:"number"}]},{name:"accessBlockTime",label:e("label.access-block-time"),type:re.Uv.NUMBER,required:!1,id:"root/accessBlockTime",props:{"data-testid":"accessBlockTime",size:"default",style:{width:"100%"}},rules:[{min:0,type:"number"}]},{name:"jwtTokenExpiryTime",label:e("label.jwt-token-expiry-time"),type:re.Uv.NUMBER,required:!1,id:"root/jwtTokenExpiryTime",props:{"data-testid":"jwtTokenExpiryTime",size:"default",style:{width:"100%"}},rules:[{min:0,type:"number"}]}],I=function(){return t.goBack()};(0,l.useEffect)((function(){Z()}),[]);var A=l.createElement("div",{className:"max-width-md w-9/10 service-form-container"},l.createElement(x.Z,{titleLinks:T}),l.createElement(m.Z,{className:"m-t-md","data-testid":"custom-login-config-form",form:n,layout:"vertical",validateMessages:i.NG,onFinish:function(t){return(0,d.mG)(void 0,void 0,void 0,(function(){var n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,3,4]),g(!0),n={config_type:le.Sd.LoginConfiguration,config_value:t},[4,(0,ie.Br)(n)];case 1:return l.sent(),(0,O.XA)(e("server.update-entity-success",{entity:e("label.login-configuration")})),I(),[3,4];case 2:return a=l.sent(),(0,O.Eo)(a),[3,4];case 3:return g(!1),[7];case 4:return[2]}}))}))},onFocus:function(e){e.preventDefault(),e.stopPropagation(),c(e.target.id)}},(0,se.GL)(w),l.createElement(p.Z,{justify:"end"},l.createElement(f.Z,null,l.createElement(h.Z,{"data-testid":"cancel-button",type:"link",onClick:I},e("label.cancel"))),l.createElement(f.Z,null,l.createElement(h.Z,{"data-testid":"save-button",htmlType:"submit",loading:b,type:"primary"},e("label.save")))))),R=l.createElement(Ye.Z,{activeField:o,serviceName:Ke.uB,serviceType:Ke.rn});return(0,l.useEffect)((function(){Z()}),[]),E?l.createElement(N.Z,null):l.createElement(S.Z,{className:"content-height-with-resizable-panel",firstPanel:{children:A,minWidth:700,flex:.7,className:"content-resizable-panel-container"},pageTitle:e("label.edit-entity",{entity:e("label.service")}),secondPanel:{children:R,className:"service-doc-panel content-resizable-panel-container",minWidth:400,flex:.3}})},Xe=n(68628),et=function(){var e,t,n,a=(0,C.$)().t,o=(0,R.N)().authConfig,c=(0,r.k6)(),u=(0,d.CR)((0,l.useState)(!1),2),m=u[0],y=u[1],v=(0,d.CR)((0,l.useState)(),2),b=v[0],g=v[1],Z=(0,l.useMemo)((function(){return(null==o?void 0:o.provider)===le.Ho.Basic||(null==o?void 0:o.provider)===le.Ho.LDAP}),[o]),S=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.PREFERENCES,a("label.login-configuration"))}),[]);return(0,l.useEffect)((function(){Z&&(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),y(!0),[4,(0,ie.jv)()];case 1:return e=n.sent(),g(e),[3,4];case 2:return t=n.sent(),(0,O.Eo)(t),[3,4];case 3:return y(!1),[7];case 4:return[2]}}))}))}),[Z]),m?l.createElement(N.Z,null):l.createElement(ne.Z,{pageTitle:a("label.login")},l.createElement(p.Z,{className:"page-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:S})),l.createElement(f.Z,{span:24},l.createElement(p.Z,{align:"middle",justify:"space-between"},l.createElement(f.Z,null,l.createElement(J.Z,{data:Ae.j.LOGIN_CONFIGURATION})),l.createElement(f.Z,null,l.createElement(h.Z,{"data-testid":"edit-button",icon:l.createElement(K.Z,{component:V.ReactComponent,size:12}),onClick:function(){c.push(i.Z6.SETTINGS_EDIT_CUSTOM_LOGIN_CONFIG)}},a("label.edit"))))),l.createElement(f.Z,{span:12},l.createElement(p.Z,{align:"middle"},l.createElement(f.Z,{span:24},l.createElement(E.Z.Text,{className:"m-0 text-grey-muted"},a("label.max-login-fail-attempt-plural"),l.createElement(Ue.Z,{placement:"top",title:a("message.login-fail-attempt-message"),trigger:"hover"},l.createElement(Xe.Z,{className:"m-x-xss","data-testid":"max-login-fail-attampts-url-info",style:{color:i.$K}})))),l.createElement(f.Z,{span:24},l.createElement(E.Z.Text,{"data-testid":"max-login-fail-attampts"},null!==(e=null==b?void 0:b.maxLoginFailAttempts)&&void 0!==e?e:i.lH)))),l.createElement(f.Z,{span:12},l.createElement(p.Z,{align:"middle"},l.createElement(f.Z,{span:24},l.createElement(E.Z.Text,{className:"m-0 text-grey-muted"},a("label.access-block-time"),l.createElement(Ue.Z,{placement:"top",title:a("message.access-block-time-message"),trigger:"hover"},l.createElement(Xe.Z,{className:"m-x-xss","data-testid":"access-block-time-info",style:{color:i.$K}})))),l.createElement(f.Z,{span:24},l.createElement(E.Z.Text,{"data-testid":"access-block-time"},null!==(t=null==b?void 0:b.accessBlockTime)&&void 0!==t?t:i.lH)))),l.createElement(f.Z,{span:12},l.createElement(p.Z,{align:"middle"},l.createElement(f.Z,{span:24},l.createElement(E.Z.Text,{className:"m-0 text-grey-muted"},a("label.jwt-token-expiry-time"),l.createElement(Ue.Z,{placement:"top",title:a("message.jwt-token-expiry-time-message"),trigger:"hover"},l.createElement(Xe.Z,{className:"m-x-xss","data-testid":"jwt-token-expiry-time-info",style:{color:i.$K}})))),l.createElement(f.Z,{span:24},l.createElement(E.Z.Text,{"data-testid":"jwt-token-expiry-time"},null!==(n=null==b?void 0:b.jwtTokenExpiryTime)&&void 0!==n?n:i.lH," ",a("label.second-plural")))))))},tt=n(13347),nt=n(56018),at=n(93895),lt=n(36561),rt={};rt.styleTagTransform=Ce(),rt.setAttributes=ve(),rt.insert=Ee().bind(null,"head"),rt.domAPI=pe(),rt.insertStyleElement=be(),de()(lt.Z,rt),lt.Z&<.Z.locals&<.Z.locals;var it=function(){var e=(0,C.$)().t,t=(0,r.k6)(),n=(0,R.N)().theme,a=(0,d.CR)((0,l.useState)(!0),2),i=a[0],o=a[1],c=(0,d.CR)((0,l.useState)(),2),u=c[0],m=c[1],v=(0,Le.C)(),b=v.currentPage,Z=v.handlePageChange,N=v.handlePageSizeChange,S=v.pageSize,T=v.paging,w=v.handlePagingChange,I=v.showPagination,A=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.PREFERENCES,e("label.customize-entity",{entity:e("label.landing-page")}))}),[]),M=function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l;return(0,d.Jh)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,3,4]),o(!0),[4,(0,nt.XQ)({after:null==e?void 0:e.after,before:null==e?void 0:e.before,limit:S})];case 1:return t=r.sent(),n=t.data,a=t.paging,m(n),w(a),[3,4];case 2:return l=r.sent(),(0,O.Eo)(l),[3,4];case 3:return o(!1),[7];case 4:return[2]}}))}))};(0,l.useEffect)((function(){M()}),[S]);var k=(0,l.useMemo)((function(){return l.createElement(f.Z,{className:"mt-24 text-center",span:24},l.createElement(xe.Z,{className:"m-t-lg",type:Re.Wx.CUSTOM},l.createElement(E.Z.Paragraph,{className:"w-max-500"},l.createElement(at.u1,{i18nKey:"message.no-persona-message",renderElement:l.createElement(H.Link,{style:{color:n.primaryColor},to:(0,D.si)(s.CZ.MEMBERS,s.lx.PERSONA)}),values:{link:e("label.here-lowercase")}}))))}),[]),L=(0,l.useMemo)((function(){return((0,g.isEmpty)(u)||(0,g.isUndefined)(u))&&!i}),[u,i]);return l.createElement(ne.Z,{pageTitle:e("label.customize-entity",{entity:e("label.landing-page")})},l.createElement(p.Z,{className:"customize-landing-page user-listing p-b-md page-container","data-testid":"custom-page-setting-component",gutter:[16,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:A})),l.createElement(f.Z,{span:18},l.createElement(J.Z,{data:Ae.j.CUSTOM_PAGE})),i?[1,2,3].map((function(e){return l.createElement(f.Z,{key:e,span:8},l.createElement(B.Z,null,l.createElement(y.Z,{active:!0,paragraph:!0,title:!0})))})):null==u?void 0:u.map((function(n){var a;return l.createElement(f.Z,{key:n.id,span:8},l.createElement(B.Z,{bodyStyle:{height:"100%"},className:"h-full","data-testid":"persona-details-card-"+n.name,extra:l.createElement(h.Z,{className:"text-link-color","data-testid":"customize-page-button",size:"small",type:"text",onClick:function(){return function(e){e.fullyQualifiedName&&t.push((0,oe.Ub)(e.fullyQualifiedName,tt.G.LandingPage))}(n)}},e("label.customize-entity",{entity:e("label.landing-page")})),title:(0,Q.C_)(n)},n.description?l.createElement(Ve.Z,{markdown:null!==(a=n.description)&&void 0!==a?a:""}):l.createElement(E.Z.Text,{className:"text-grey-muted"},e("label.no-description"))))})),L&&k,l.createElement(f.Z,{span:24},I&&l.createElement(we.Z,{currentPage:b,pageSize:S,paging:T,pagingHandler:function(e){var t,n=e.currentPage,a=e.cursorType;Z(n),a&&M(((t={})[a]=T[a],t))},onShowSizeChange:N}))))},st=n(25499),ot=n(34901),ct=n(75705),ut=n(21467),dt=n(52114),mt=n(79317),pt=n(52977),ft=n(50146),Et=n(39819),yt=function(e){var t=e.customProperty,n=e.onCancel,a=e.visible,r=e.onSave,i=(0,C.$)().t,s=(0,d.CR)(m.Z.useForm(),1)[0],o=(0,d.CR)((0,l.useState)(!1),2),c=o[0],u=o[1],p=(0,l.useMemo)((function(){var e,n=null!==(e=t.propertyType.name)&&void 0!==e?e:"";return{hasEnumConfig:"enum"===n,hasEntityReferenceConfig:Et.FM.includes(n)}}),[t]),f=p.hasEnumConfig,y=p.hasEntityReferenceConfig,v=[{name:"description",required:!0,label:i("label.description"),id:"root/description",type:re.Uv.DESCRIPTION,props:{"data-testid":"description",initialValue:t.description}}],h={name:"customPropertyConfig",required:!1,label:i("label.enum-value-plural"),id:"root/customPropertyConfig",type:re.Uv.SELECT,props:{"data-testid":"customPropertyConfig",mode:"tags",placeholder:i("label.enum-value-plural"),onChange:function(e){var n,a,l=null===(n=t.customPropertyConfig)||void 0===n?void 0:n.config,r=(0,g.uniq)((0,d.ev)((0,d.ev)([],(0,d.CR)(e)),(0,d.CR)(null!==(a=null==l?void 0:l.values)&&void 0!==a?a:[])));s.setFieldsValue({customPropertyConfig:r})}},rules:[{required:!0,message:i("label.field-required",{field:i("label.enum-value-plural")})}]},b={name:"customPropertyConfig",required:!1,label:i("label.entity-reference-types"),id:"root/customPropertyConfig",type:re.Uv.SELECT,props:{"data-testid":"customPropertyConfig",mode:"multiple",options:Et.Qx,placeholder:i("label.entity-reference-types"),onChange:function(e){var n,a=null===(n=t.customPropertyConfig)||void 0===n?void 0:n.config,l=(0,g.uniq)((0,d.ev)((0,d.ev)([],(0,d.CR)(e)),(0,d.CR)(null!=a?a:[])));s.setFieldsValue({customPropertyConfig:l})}},rules:[{required:!0,message:i("label.field-required",{field:i("label.entity-reference-types")})}]},Z={name:"multiSelect",label:i("label.multi-select"),type:re.Uv.SWITCH,required:!1,props:{"data-testid":"multiSelect"},id:"root/multiSelect",formItemLayout:re.EP.HORIZONTAL},N=(0,l.useMemo)((function(){var e,n,a;if(f){var l=null===(e=t.customPropertyConfig)||void 0===e?void 0:e.config;return{description:t.description,customPropertyConfig:null!==(n=null==l?void 0:l.values)&&void 0!==n?n:[],multiSelect:Boolean(null==l?void 0:l.multiSelect)}}return{description:t.description,customPropertyConfig:null===(a=t.customPropertyConfig)||void 0===a?void 0:a.config}}),[t,f]),S=l.createElement(E.Z.Text,{className:"text-grey-muted",style:{display:"block",marginTop:"-18px"}},"Note: "+i("message.updating-existing-not-possible-can-add-new-values"));return l.createElement(ft.Z,{centered:!0,destroyOnClose:!0,cancelButtonProps:{disabled:c},closable:!1,"data-testid":"edit-custom-property-modal",maskClosable:!1,okButtonProps:{htmlType:"submit",form:"edit-custom-property-form",loading:c},okText:i("label.save"),open:a,title:l.createElement(E.Z.Text,null,i("label.edit-entity-name",{entityType:i("label.property"),entityName:t.name})),width:750,onCancel:n},l.createElement(m.Z,{form:s,id:"edit-custom-property-form",initialValues:N,layout:"vertical",onFinish:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(t){switch(t.label){case 0:return u(!0),[4,r(e)];case 1:return t.sent(),u(!1),[2]}}))}))}},(0,se.GL)(v),!(0,g.isUndefined)(t.customPropertyConfig)&&l.createElement(l.Fragment,null,f&&l.createElement(l.Fragment,null,(0,se.GL)([h]),S,(0,se.GL)([Z])),y&&l.createElement(l.Fragment,null,(0,se.GL)([b]),S))))},vt=function(e){var t=e.customProperties,n=e.updateEntityType,a=e.hasAccess,r=e.isLoading,i=e.isButtonLoading,s=(0,C.$)().t,o=(0,d.CR)((0,l.useState)({}),2),c=o[0],u=o[1],m=(0,d.CR)((0,l.useState)(Re.k8.NO_OPERATION),2),p=m[0],f=m[1],y=function(){u({}),f(Re.k8.NO_OPERATION)};(0,l.useEffect)((function(){i||y()}),[i]);var v=(0,l.useMemo)((function(){return!(0,g.isEmpty)(c)&&p===Re.k8.DELETE}),[c,p]),b=(0,l.useMemo)((function(){return!(0,g.isEmpty)(c)&&p===Re.k8.UPDATE}),[c,p]),Z=(0,l.useMemo)((function(){return[{title:s("label.name"),dataIndex:"name",key:"name",render:function(e,t){return(0,Q.C_)(t)},sorter:Q.$L},{title:s("label.type"),dataIndex:"propertyType",key:"propertyType",render:function(e){return(0,Q.C_)(e)}},{title:s("label.config"),dataIndex:"customPropertyConfig",key:"customPropertyConfig",render:function(e,t){var n;if((0,g.isUndefined)(e))return l.createElement("span",null,"--");var a=e.config;return(0,g.isArray)(a)&&!(0,g.isEmpty)(a)?l.createElement(E.Z.Text,{"data-testid":t.name+"-config"},JSON.stringify(null!=a?a:[])):(0,g.isString)(a)||(0,g.isArray)(a)?l.createElement(E.Z.Text,null,a):l.createElement("div",{className:"w-full d-flex gap-2 flex-column","data-testid":"enum-config"},l.createElement(E.Z.Text,null,JSON.stringify(null!==(n=null==a?void 0:a.values)&&void 0!==n?n:[])),l.createElement(E.Z.Text,null,s("label.multi-select"),":"," ",(null==a?void 0:a.multiSelect)?s("label.yes"):s("label.no")))}},{title:s("label.description"),dataIndex:"description",key:"description",width:300,render:function(e){return e?l.createElement(Ve.Z,{markdown:e||""}):l.createElement(E.Z.Text,{className:"text-grey-muted ","data-testid":"no-description"},s("label.no-description"))}},{title:s("label.action-plural"),dataIndex:"actions",key:"actions",width:80,fixed:"right",render:function(e,t){return l.createElement(j.Z,{align:"center",size:14},l.createElement(Ue.Z,{title:a?s("label.edit-entity",{entity:s("label.property")}):dt.oH},l.createElement(h.Z,{className:"cursor-pointer p-0","data-testid":"edit-button",disabled:!a,size:"small",type:"text",onClick:function(){u(t),f(Re.k8.UPDATE)}},l.createElement(V.ReactComponent,{name:s("label.edit"),width:16}))),l.createElement(Ue.Z,{title:a?s("label.delete-entity",{entity:s("label.property")}):dt.oH},l.createElement(h.Z,{className:"cursor-pointer p-0","data-testid":"delete-button",disabled:!a,size:"small",type:"text",onClick:function(){u(t),f(Re.k8.DELETE)}},l.createElement(W.ReactComponent,{name:s("label.delete"),width:16}))))}}]}),[a]);return l.createElement(l.Fragment,null,l.createElement(Je.Z,{bordered:!0,columns:Z,"data-testid":"entity-custom-properties-table",dataSource:t,loading:r,locale:{emptyText:l.createElement(xe.Z,{className:"mt-xs",doc:ze.Wl,heading:s("label.property"),permission:a,type:Re.Wx.CREATE})},pagination:!1,rowKey:"name",scroll:mt.K,size:"small"}),l.createElement(pt.Z,{bodyText:s("message.are-you-sure-delete-property",{propertyName:c.name}),cancelText:s("label.cancel"),confirmText:s("label.confirm"),header:s("label.delete-property-name",{propertyName:c.name}),isLoading:i,visible:v,onCancel:y,onConfirm:function(){var e=t.filter((function(e){return e.name!==c.name}));n(e)}}),b&&l.createElement(yt,{customProperty:c,visible:b,onCancel:y,onSave:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:return a=t.map((function(t){if(t.name===c.name){var n=e.customPropertyConfig,a="enum"===c.propertyType.name;return(0,d.pi)((0,d.pi)((0,d.pi)({},t),{description:e.description}),n?{customPropertyConfig:{config:a?{multiSelect:Boolean(null==e?void 0:e.multiSelect),values:n}:n}}:{})}return t})),[4,n(a)];case 1:return l.sent(),y(),[2]}}))}))}}))},ht=n(226),bt=n(12981),gt=n(37645),Ct={};Ct.styleTagTransform=Ce(),Ct.setAttributes=ve(),Ct.insert=Ee().bind(null,"head"),Ct.domAPI=pe(),Ct.insertStyleElement=be(),de()(gt.Z,Ct),gt.Z&>.Z.locals&>.Z.locals;var Zt,Nt,St=function(){var e=(0,C.$)().t,t=(0,r.UO)().tab,n=(0,r.k6)(),a=(0,d.CR)((0,l.useState)(Ge.M8.CUSTOM_PROPERTIES),2),u=a[0],m=a[1],E=(0,d.CR)((0,l.useState)(!1),2),y=E[0],v=E[1],b=(0,d.CR)((0,l.useState)(!1),2),Z=b[0],N=b[1],S=(0,d.CR)((0,l.useState)({}),2),T=S[0],w=S[1],I=(0,d.CR)((0,l.useState)(!1),2),A=I[0],R=I[1],M=(0,l.useMemo)((function(){return i.uW[t]}),[t]),k=(0,o.BL)().getEntityPermission,L=(0,d.CR)((0,l.useState)(bt.Bd),2),D=L[0],P=L[1],U=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.CUSTOM_PROPERTIES,(0,g.startCase)(t))}),[t]),z=(0,l.useMemo)((function(){return D.EditAll}),[D,t]),G=(0,l.useCallback)((function(e){m(e)}),[]),_=(0,l.useCallback)((function(){var e=(0,i.Vw)(M);n.push(e)}),[M,n]),B=(0,l.useCallback)((function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l;return(0,d.Jh)(this,(function(r){switch(r.label){case 0:R(!0),t=(0,ot.qu)(T,(0,d.pi)((0,d.pi)({},T),{customProperties:e})),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,(0,ht.TJ)(null!==(l=T.id)&&void 0!==l?l:"",t)];case 2:return n=r.sent(),w((function(e){return(0,d.pi)((0,d.pi)({},e),{customProperties:n.customProperties})})),[3,5];case 3:return a=r.sent(),(0,O.Eo)(a),[3,5];case 4:return R(!1),[7];case 5:return[2]}}))}))}),[T]),j=(0,l.useMemo)((function(){switch(M){case i.uW.tables:return Ae.j.TABLES_CUSTOM_ATTRIBUTES;case i.uW.topics:return Ae.j.TOPICS_CUSTOM_ATTRIBUTES;case i.uW.dashboards:return Ae.j.DASHBOARD_CUSTOM_ATTRIBUTES;case i.uW.dashboardDataModels:return Ae.j.DASHBOARD_DATA_MODEL_CUSTOM_ATTRIBUTES;case i.uW.pipelines:return Ae.j.PIPELINES_CUSTOM_ATTRIBUTES;case i.uW.mlmodels:return Ae.j.ML_MODELS_CUSTOM_ATTRIBUTES;case i.uW.containers:return Ae.j.CONTAINER_CUSTOM_ATTRIBUTES;case i.uW.searchIndexes:return Ae.j.SEARCH_INDEX_CUSTOM_ATTRIBUTES;case i.uW.storedProcedures:return Ae.j.STORED_PROCEDURE_CUSTOM_ATTRIBUTES;case i.uW.glossaryTerm:return Ae.j.GLOSSARY_TERM_CUSTOM_ATTRIBUTES;case i.uW.databases:return Ae.j.DATABASE_CUSTOM_ATTRIBUTES;case i.uW.databaseSchemas:return Ae.j.DATABASE_SCHEMA_CUSTOM_ATTRIBUTES;case i.uW.apiEndpoints:return Ae.j.API_ENDPOINT_CUSTOM_ATTRIBUTES;case i.uW.apiCollections:return Ae.j.API_COLLECTION_CUSTOM_ATTRIBUTES;default:return Ae.j.TABLES_CUSTOM_ATTRIBUTES}}),[M]);(0,l.useEffect)((function(){var e;(0,g.isUndefined)(t)||(m(Ge.M8.CUSTOM_PROPERTIES),N(!1),e=M,(0,d.mG)(void 0,void 0,void 0,(function(){var t,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:v(!0),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,(0,ht.ov)(e)];case 2:return t=a.sent(),w(t),[3,4];case 3:return n=a.sent(),(0,O.Eo)(n),N(!0),[3,4];case 4:return v(!1),[2]}}))})))}),[M]),(0,l.useEffect)((function(){(null==T?void 0:T.id)&&(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,k(c.A.TYPE,T.id)];case 1:return e=n.sent(),P(e),[3,3];case 2:return t=n.sent(),(0,O.Eo)(t),[3,3];case 3:return[2]}}))}))}),[T]);var F=(0,l.useMemo)((function(){var t=T.customProperties,n=T.schema;return[{label:l.createElement(ct.Z,{count:(null!=t?t:[]).length,id:Ge.M8.CUSTOM_PROPERTIES,isActive:u===Ge.M8.CUSTOM_PROPERTIES,name:e("label.custom-property-plural")}),key:Ge.M8.CUSTOM_PROPERTIES,children:l.createElement("div",{"data-testid":"entity-custom-fields"},l.createElement("div",{className:"flex justify-end"},z&&l.createElement(h.Z,{className:"m-b-md p-y-xss p-x-xs rounded-4","data-testid":"add-field-button",size:"middle",type:"primary",onClick:_},e("label.add-entity",{entity:e("label.property")}))),l.createElement(vt,{customProperties:null!=t?t:[],hasAccess:z,isButtonLoading:A,isLoading:y,updateEntityType:B}))},{label:e("label.schema"),key:Ge.M8.SCHEMA,children:l.createElement("div",{"data-testid":"entity-schema"},l.createElement(ut.Z,{className:"custom-properties-schemaEditor p-y-md",editorClass:"custom-entity-schema",value:JSON.parse(null!=n?n:"{}")}))}]}),[T.schema,z,A,j,y,u,_,B]);return Z?l.createElement(xe.Z,null):l.createElement(ne.Z,{pageTitle:e("label.custom-property")},l.createElement(p.Z,{className:"page-container","data-testid":"custom-entity-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:U})),l.createElement(f.Z,{span:24},l.createElement(J.Z,{data:j})),l.createElement(f.Z,{className:"global-settings-tabs",span:24},l.createElement(st.Z,{items:F,key:t,onChange:G}))))},Tt=n(34041);!function(e){e.Collate="collate",e.Openmetadata="openmetadata"}(Zt||(Zt={})),function(e){e.SMTP="SMTP",e.SMTPTLS="SMTP_TLS",e.Smtps="SMTPS"}(Nt||(Nt={}));var xt=Object.values(Nt).map((function(e){return{label:e,value:e}})),wt=["templates"],It=m.Z.Item,At=function(e){var t=e.emailConfigValues,n=e.isLoading,a=e.onCancel,r=e.onFocus,s=e.onSubmit,o=(0,C.$)().t,c=(0,d.CR)(m.Z.useForm(),1)[0];return l.createElement(m.Z,{"data-testid":"email-config-form",form:c,id:"email-config-form",initialValues:t,layout:"vertical",name:"email-configuration",validateMessages:i.NG,onFinish:s,onFocus:r},l.createElement(It,{label:o("label.username"),name:"username"},l.createElement(v.Z,{"data-testid":"username-input",id:"root/username"})),l.createElement(It,{label:o("label.password"),name:"password"},l.createElement(v.Z,{"data-testid":"password-input",id:"root/password",type:"password"})),l.createElement(It,{label:o("label.sender-email"),name:"senderMail",rules:[{required:!0}]},l.createElement(v.Z,{"data-testid":"sender-email-input",id:"root/senderMail",type:"email"})),l.createElement(It,{label:o("label.open-metadata-url"),name:"openMetadataUrl",rules:[{required:!0}]},l.createElement(v.Z,{"data-testid":"open-metadata-url-input",id:"root/openMetadataUrl-input"})),l.createElement(It,{label:o("label.server-endpoint"),name:"serverEndpoint",rules:[{required:!0}]},l.createElement(v.Z,{"data-testid":"server-endpoint-input",id:"root/serverEndpoint"})),l.createElement(It,{label:o("label.server-port"),name:"serverPort",rules:[{required:!0}]},l.createElement(v.Z,{"data-testid":"server-port-input",id:"root/serverPort",type:"number"})),l.createElement(It,{label:o("label.emailing-entity"),name:"emailingEntity"},l.createElement(v.Z,{"data-testid":"emailing-entity-input",id:"root/emailingEntity"})),l.createElement(It,{name:"enableSmtpServer"},l.createElement(p.Z,null,l.createElement(f.Z,{span:8},o("label.enable-smtp-server")),l.createElement(f.Z,{span:16},l.createElement(Te.Z,{"data-testid":"smtp-server-input",defaultChecked:null==t?void 0:t.enableSmtpServer,id:"root/enableSmtpServer",onChange:function(e){return c.setFieldsValue({enableSmtpServer:e})}})))),l.createElement(It,{label:o("label.support-url"),name:"supportUrl"},l.createElement(v.Z,{"data-testid":"support-url-input",id:"root/supportUrl"})),l.createElement(It,{label:o("label.transportation-strategy"),name:"transportationStrategy"},l.createElement(Tt.Z,{"data-testid":"transportation-strategy-input",id:"root/transportationStrategy",options:xt})),l.createElement(p.Z,{justify:"end"},l.createElement(f.Z,null,l.createElement(h.Z,{type:"link",onClick:a},o("label.cancel"))),l.createElement(f.Z,null,l.createElement(h.Z,{htmlType:"submit",loading:n,type:"primary"},o("label.submit")))))},Rt=function(){var e=this,t=(0,C.$)().t,n=(0,r.k6)(),a=(0,d.CR)((0,l.useState)(),2),i=a[0],o=a[1],c=(0,d.CR)((0,l.useState)(!1),2),u=c[0],m=c[1],p=(0,d.CR)((0,l.useState)(!1),2),f=p[0],E=p[1],v=(0,d.CR)((0,l.useState)(""),2),h=v[0],b=v[1],g=(0,l.useMemo)((function(){return[{name:t("label.setting-plural"),url:(0,D.si)()},{name:t("label.email"),url:(0,D.si)(s.CZ.PREFERENCES,s.lx.EMAIL)},{name:t("label.edit-entity",{entity:t("label.email-configuration")}),url:""}]}),[]),Z=(0,l.useCallback)((function(){return(0,d.mG)(e,void 0,void 0,(function(){var e,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),m(!0),[4,(0,ie.nL)(le.Sd.EmailConfiguration)];case 1:return e=a.sent().data,o(e.config_value),[3,4];case 2:return n=a.sent(),(0,O.Eo)(n,t("server.entity-fetch-error",{entity:t("label.email-configuration-lowercase")})),[3,4];case 3:return m(!1),[7];case 4:return[2]}}))}))}),[]),N=(0,l.useCallback)((function(){n.push((0,D.si)(s.CZ.PREFERENCES,s.lx.EMAIL))}),[n]),T=(0,l.useCallback)((function(n){return(0,d.mG)(e,void 0,void 0,(function(){var e,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,3,4]),E(!0),e={config_type:le.Sd.EmailConfiguration,config_value:n},[4,(0,ie.Br)(e)];case 1:return l.sent(),(0,O.XA)(t("server.update-entity-success",{entity:t("label.email-configuration")})),N(),[3,4];case 2:return a=l.sent(),(0,O.Eo)(a,t("server.entity-updating-error",{entity:t("label.email-configuration-lowercase")})),[3,4];case 3:return E(!1),[7];case 4:return[2]}}))}))}),[]),w=(0,l.useCallback)((function(e){b(e.target.id)}),[]);(0,l.useEffect)((function(){Z()}),[]);var I=l.createElement("div",{className:"max-width-md w-9/10 service-form-container"},l.createElement(x.Z,{titleLinks:g}),l.createElement("div",{className:"m-t-md"},u?l.createElement(y.Z,{title:!0,paragraph:{rows:8}}):l.createElement(At,{emailConfigValues:i,isLoading:f,onCancel:N,onFocus:w,onSubmit:T}))),A=l.createElement(Ye.Z,{activeField:h,serviceName:Ke.DE,serviceType:Ke.rn});return l.createElement(S.Z,{className:"content-height-with-resizable-panel",firstPanel:{children:I,minWidth:700,flex:.7,className:"content-resizable-panel-container"},pageTitle:t("label.add-entity",{entity:t("label.service")}),secondPanel:{children:A,className:"service-doc-panel content-resizable-panel-container",minWidth:400,flex:.3}})},Mt=n(70866),kt=function(e){var t=e.onCancel,n=(0,C.$)().t,a=(0,d.CR)(m.Z.useForm(),1)[0],r=(0,d.CR)((0,l.useState)(!1),2),s=r[0],o=r[1];return l.createElement(ft.Z,{destroyOnClose:!0,open:!0,closable:!1,closeIcon:null,"data-testid":"test-email-modal",maskClosable:!1,okButtonProps:{htmlType:"submit",id:"test-email-form",form:"test-email-form",loading:s},okText:n("label.test"),title:n("label.test-email-connection"),onCancel:t},l.createElement(m.Z,{"data-testid":"test-email-form",form:a,id:"test-email-form",layout:"vertical",validateMessages:i.NG,onFinish:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,3,4]),o(!0),[4,(0,ie.HY)(e)];case 1:return n=l.sent(),(0,O.XA)(n.data),[3,4];case 2:return a=l.sent(),(0,O.Eo)(a),[3,4];case 3:return o(!1),t(),[7];case 4:return[2]}}))}))}},l.createElement(m.Z.Item,{label:n("label.email"),name:"email",rules:[{type:"email",required:!0}]},l.createElement(v.Z,{autoFocus:!0,"data-testid":"test-email-input",placeholder:n("label.enter-entity",{entity:n("label.email-lowercase")})}))))},Lt=n(74475),Dt=function(){var e=this,t=(0,C.$)().t,n=(0,r.k6)(),a=(0,Be.a)().isAdminUser,o=(0,d.CR)((0,l.useState)(),2),c=o[0],u=o[1],m=(0,d.CR)((0,l.useState)(!1),2),v=m[0],b=m[1],Z=(0,d.CR)((0,l.useState)(!1),2),N=Z[0],S=Z[1],T=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.PREFERENCES,t("label.email"))}),[]),w=(0,l.useCallback)((function(){return(0,d.mG)(e,void 0,void 0,(function(){var e,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),b(!0),[4,(0,ie.nL)(le.Sd.EmailConfiguration)];case 1:return e=a.sent().data,u(e.config_value),[3,4];case 2:return n=a.sent(),(0,O.Eo)(n,t("server.entity-fetch-error",{entity:t("label.email-configuration-lowercase")})),[3,4];case 3:return b(!1),[7];case 4:return[2]}}))}))}),[u]),I=(0,l.useCallback)((function(){S((function(e){return!e}))}),[S]),A=(0,l.useMemo)((function(){return(0,g.isUndefined)(c)?null:Object.keys(c).sort().filter((function(e){return!wt.includes(e)})).map((function(e){var t=function(e){switch(e){case"emailingEntity":return Lt.Z.t("label.emailing-entity");case"enableSmtpServer":return Lt.Z.t("label.enable-smtp-server");case"openMetadataUrl":return Lt.Z.t("label.open-metadata-url");case"password":return Lt.Z.t("label.password");case"senderMail":return Lt.Z.t("label.sender-email");case"serverEndpoint":return Lt.Z.t("label.server-endpoint");case"serverPort":return Lt.Z.t("label.server-port");case"supportUrl":return Lt.Z.t("label.support-url");case"transportationStrategy":return Lt.Z.t("label.transportation-strategy");case"username":return Lt.Z.t("label.username");default:return""}}(e),n=c[e],a=(0,g.isBoolean)(n)||(0,g.isNumber)(n)?""+n:n;return l.createElement(f.Z,{key:t,span:12},l.createElement(p.Z,{align:"middle"},l.createElement(f.Z,{span:24},l.createElement(E.Z.Text,{className:"m-0 text-grey-muted"},t+":")),l.createElement(f.Z,{span:24},l.createElement(E.Z.Text,{className:""},(0,g.isEmpty)(a)?"--":a))))}))}),[c]),R=(0,l.useMemo)((function(){return(0,g.isUndefined)(c)&&!v?l.createElement(xe.Z,{className:"mt-24",heading:t("label.email-configuration-lowercase"),type:Re.Wx.CREATE}):l.createElement(l.Fragment,null,v?l.createElement(y.Z,{title:!0,paragraph:{rows:8}}):l.createElement(l.Fragment,null,l.createElement(p.Z,{align:"middle",gutter:[16,16]},A)))}),[v,c,A]);return(0,l.useEffect)((function(){w()}),[]),l.createElement(ne.Z,{pageTitle:t("label.email")},l.createElement(p.Z,{align:"middle",className:"page-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:T})),l.createElement(f.Z,{span:24},l.createElement(p.Z,{align:"top",justify:"space-between"},l.createElement(f.Z,null,l.createElement(J.Z,{data:{header:t("label.email"),subHeader:t("message.email-configuration-message")}})),l.createElement(f.Z,{className:"d-flex"},a&&(null==c?void 0:c.senderMail)&&l.createElement(h.Z,{type:"primary",onClick:I},t("label.test-email")),v?l.createElement(Mt.Z,null):l.createElement(h.Z,{className:"m-l-md",icon:!(0,g.isUndefined)(c)&&l.createElement(Pe.Z,{component:V.ReactComponent,size:12}),onClick:function(){n.push(i.Z6.SETTINGS_EDIT_EMAIL_CONFIG)}},(0,g.isUndefined)(c)?t("label.add"):t("label.edit"))))),l.createElement(f.Z,{span:24},R)),N&&l.createElement(kt,{onCancel:I}))},Ot=n(91833),Pt={};Pt.styleTagTransform=Ce(),Pt.setAttributes=ve(),Pt.insert=Ee().bind(null,"head"),Pt.domAPI=pe(),Pt.insertStyleElement=be(),de()(Ot.Z,Pt),Ot.Z&&Ot.Z.locals&&Ot.Z.locals;var Ut=function(e){var t,n=e.data,a=e.onClick,r=(0,C.$)().t,i=(0,l.useCallback)((function(){return a(n.key)}),[]);return l.createElement(B.Z,{className:"setting-card-item","data-testid":n.key,onClick:i},l.createElement("div",{className:"setting-card-icon-container"},l.createElement(Pe.Z,{className:"setting-card-icon",component:n.icon})),l.createElement("div",{className:"setting-card-item-content"},l.createElement(E.Z.Text,{className:"setting-card-title"},null!==(t=n.category)&&void 0!==t?t:n.label," ",Boolean(null==n?void 0:n.isBeta)&&l.createElement($.Z,{className:"service-beta-tag",count:r("label.beta")})),l.createElement(E.Z.Paragraph,{className:"setting-card-description",ellipsis:{rows:2}},n.description)))},zt=n(52011),Gt=n(95462),_t=function(){var e,t,n=(0,C.$)().t,i=(0,r.k6)(),c=(0,r.UO)().settingCategory,u=(0,o.BL)().permissions,m=(0,Be.a)().isAdminUser,E=(0,l.useMemo)((function(){return(0,oe.Mx)(c)}),[c]),y=(0,l.useMemo)((function(){var e,t=Gt.Z.getGlobalSettingsMenuWithPermission(u,m).find((function(e){return e.key===c}));return t&&(t=(0,d.pi)((0,d.pi)({},t),{items:null===(e=null==t?void 0:t.items)||void 0===e?void 0:e.filter((function(e){return e.isProtected}))})),t}),[c,u,m]),v=(0,l.useCallback)((function(e){var t=(0,d.CR)(e.split("."),2),n=t[0],l=t[1];switch(l){case s.lx.TEAMS:i.push((0,D.KH)(a.Organization));break;case s.lx.SEARCH:n===s.CZ.PREFERENCES?i.push((0,D.Ec)(n,l,zt.i.ON_DEMAND)):i.push((0,D.si)(n,l));break;default:i.push((0,D.si)(n,l))}}),[]);return l.createElement(ne.Z,{pageTitle:n("label.setting-plural")},l.createElement(p.Z,{className:"page-container",gutter:[0,20]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:E})),l.createElement(f.Z,{span:24},l.createElement(j.Z,{className:"w-full d-flex justify-between"},l.createElement(J.Z,{data:{header:null==y?void 0:y.category,subHeader:null!==(e=null==y?void 0:y.description)&&void 0!==e?e:""}}))),l.createElement(f.Z,{span:24},l.createElement(p.Z,{gutter:[20,20]},null===(t=null==y?void 0:y.items)||void 0===t?void 0:t.map((function(e){return l.createElement(f.Z,{key:null==e?void 0:e.key,span:6},l.createElement(Ut,{data:e,onClick:v}))}))))))},Bt=n(33560),jt={};jt.styleTagTransform=Ce(),jt.setAttributes=ve(),jt.insert=Ee().bind(null,"head"),jt.domAPI=pe(),jt.insertStyleElement=be(),de()(Bt.Z,jt),Bt.Z&&Bt.Z.locals&&Bt.Z.locals;var Ft,Ht,Vt=function(){var e=(0,r.k6)(),t=(0,C.$)().t,n=(0,o.BL)().permissions,a=(0,Be.a)().isAdminUser,i=(0,d.CR)((0,l.useState)([]),2),s=i[0],c=i[1],u=(0,l.useMemo)((function(){return Gt.Z.getGlobalSettingsMenuWithPermission(n,a).filter((function(e){var t=(0,oe.SC)(e);return(0,g.isUndefined)(t.isProtected)?!!(t.items&&t.items.length>0):t.isProtected}))}),[n,a]),m=(0,l.useCallback)((function(t){e.push((0,D.si)(t))}),[]);return(0,l.useEffect)((function(){c(u)}),[]),(0,g.isEmpty)(u)?l.createElement(xe.Z,{type:Re.Wx.PERMISSION}):l.createElement(ne.Z,{pageTitle:t("label.setting-plural")},l.createElement(p.Z,{className:"page-container",gutter:[0,20]},l.createElement(f.Z,{span:24},l.createElement(J.Z,{data:Ae.j.SETTING})),l.createElement(f.Z,{span:24},l.createElement(p.Z,{gutter:[20,20]},s.map((function(e){return l.createElement(f.Z,{key:null==e?void 0:e.key,span:6},l.createElement(Ut,{data:e,onClick:m}))}))))))},Wt=function(){var e,t=(0,C.$)().t,n=(0,r.k6)(),a=(0,d.CR)((0,l.useState)(0),2),i=a[0],o=a[1],c=(0,d.CR)((0,l.useState)([]),2),u=c[0],m=c[1],y=(0,d.CR)((0,l.useState)(),2),v=y[0],b=y[1],Z=(0,Le.C)(),N=Z.pageSize,S=Z.currentPage,T=Z.handlePageChange,w=Z.handlePageSizeChange,R=Z.handlePagingChange,M=Z.showPagination,L=Z.paging,P=(0,I.o)().getResourceLimit,U=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.NOTIFICATIONS)}),[]),z=(0,l.useCallback)((function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var n,a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:o((function(e){return e+1})),i.label=1;case 1:return i.trys.push([1,6,7,8]),[4,(0,k.BN)({after:null==e?void 0:e.after,before:null==e?void 0:e.before,limit:N,alertType:A.NK.Notification})];case 2:return n=i.sent(),a=n.data,l=n.paging,(0,g.isUndefined)(null==e?void 0:e.after)?[4,(0,k.$K)("ActivityFeedAlert")]:[3,4];case 3:return r=i.sent(),m((0,d.ev)([r],(0,d.CR)(a))),[3,5];case 4:m(a),i.label=5;case 5:return R(l),[3,8];case 6:return i.sent(),(0,O.Eo)(t("server.entity-fetch-error",{entity:t("label.alert-plural")})),[3,8];case 7:return o((function(e){return e-1})),[7];case 8:return[2]}}))}))}),[N]);(0,l.useEffect)((function(){z()}),[N]);var G=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e;return(0,d.Jh)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),b(void 0),[4,P("eventsubscription",!0,!0)];case 1:return t.sent(),z(),[3,3];case 2:return e=t.sent(),(0,O.Eo)(e),[3,3];case 3:return[2]}}))}))}),[z]),_=(0,l.useCallback)((function(e){var t,n=e.cursorType,a=e.currentPage;n&&(z(((t={})[n]=L[n],t)),T(a))}),[L]),B=(0,l.useMemo)((function(){return[{title:t("label.name"),dataIndex:"name",width:"200px",key:"name",render:function(e,t){return t.fullyQualifiedName&&l.createElement(H.Link,{"data-testid":"alert-name",to:(0,D.X9)(t.fullyQualifiedName)},e)}},{title:t("label.trigger"),dataIndex:["filteringRules","resources"],width:"200px",key:"FilteringRules.resources",render:function(e){return(null==e?void 0:e.join(", "))||"--"}},{title:t("label.description"),dataIndex:"description",flex:!0,key:"description",render:function(e){return(0,g.isEmpty)(e)?l.createElement(E.Z.Text,{className:"text-grey-muted"},t("label.no-entity",{entity:t("label.description")})):e}},{title:t("label.action-plural"),dataIndex:"fullyQualifiedName",width:120,key:"fullyQualifiedName",render:function(e,n){return l.createElement("div",{className:"d-flex items-center"},l.createElement(Ue.Z,{placement:"bottom",title:t("label.edit")},l.createElement(H.Link,{to:(0,D.pd)(e)},l.createElement(h.Z,{className:"flex flex-center","data-testid":"alert-edit-"+n.name,disabled:n.provider===A.lP.System,icon:l.createElement(V.ReactComponent,{height:16}),type:"text"}))),l.createElement(Ue.Z,{placement:"bottom",title:t("label.delete")},l.createElement(h.Z,{className:"flex flex-center","data-testid":"alert-delete-"+n.name,disabled:n.provider===A.lP.System,icon:l.createElement(W.ReactComponent,{height:16}),type:"text",onClick:function(){return b(n)}})))}}]}),[G]);return l.createElement(ne.Z,{pageTitle:t("label.alert-plural")},l.createElement(p.Z,{className:"page-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:U})),l.createElement(f.Z,{span:24},l.createElement("div",{className:"d-flex justify-between"},l.createElement(J.Z,{data:Ae.j.NOTIFICATION}),l.createElement(ke.Z,{resource:"eventsubscription"},l.createElement(h.Z,{"data-testid":"create-notification",type:"primary",onClick:function(){return n.push((0,D.si)(s.CZ.NOTIFICATIONS,s.lx.ADD_NOTIFICATION))}},t("label.add-entity",{entity:t("label.alert")}))))),l.createElement(f.Z,{span:24},l.createElement(Je.Z,{bordered:!0,columns:B,dataSource:u,loading:Boolean(i),locale:{emptyText:l.createElement(xe.Z,{permission:!0,className:"p-y-md",doc:ze.co,heading:t("label.alert"),type:Re.Wx.CREATE,onClick:function(){return n.push((0,D.si)(s.CZ.NOTIFICATIONS,s.lx.ADD_NOTIFICATION))}})},pagination:!1,rowKey:"id",size:"small"})),l.createElement(f.Z,{span:24},M&&l.createElement(we.Z,{currentPage:S,pageSize:N,paging:L,pagingHandler:_,onShowSizeChange:w}),l.createElement(Fe.Z,{afterDeleteAction:G,allowSoftDelete:!1,entityId:null!==(e=null==v?void 0:v.id)&&void 0!==e?e:"",entityName:(0,Q.C_)(v),entityType:Ge.py.SUBSCRIPTION,visible:Boolean(v),onCancel:function(){b(void 0)}}))))},Jt=n(61455),qt=n(39117),Qt=function(){var e=(0,C.$)().t,t=(0,d.CR)((0,l.useState)(!1),2),n=t[0],a=t[1],r=(0,d.CR)((0,l.useState)(),2),i=r[0],o=r[1],c=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.PREFERENCES,e("label.health-check"))}),[]),u=function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:a(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,qt.d6)()];case 2:return e=n.sent(),o(e),[3,5];case 3:return t=n.sent(),(0,O.Eo)(t),[3,5];case 4:return a(!1),[7];case 5:return[2]}}))}))};return(0,l.useEffect)((function(){u()}),[]),n?l.createElement(N.Z,null):l.createElement(ne.Z,{pageTitle:e("label.health-check")},l.createElement(p.Z,{className:"page-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:c})),l.createElement(f.Z,{span:24},l.createElement(p.Z,{align:"middle",justify:"space-between"},l.createElement(f.Z,null,l.createElement(J.Z,{data:Ae.j.OM_HEALTH})),l.createElement(f.Z,null,l.createElement(h.Z,{type:"primary",onClick:u},e("label.refresh"))))),i&&(0,g.map)(i,(function(e,t){var n;return e&&l.createElement(f.Z,{"data-testid":t,key:t,span:24},l.createElement(Jt.Z,{isTestingConnection:!1,testConnectionStep:{name:(0,g.startCase)(t),mandatory:!0,description:null!==(n=e.description)&&void 0!==n?n:""},testConnectionStepResult:(0,d.pi)({name:(0,g.startCase)(t),passed:Boolean(e.passed),mandatory:!0,message:e.passed?e.message:e.description},e.passed?{}:{errorLog:e.message})}))}))))},Yt=n(68260),Kt=n(57081),$t=n(44654),Xt=n(15815),en=n(45366),tn=n(91631),nn=n(54566),an=n(23313),ln=n(45633),rn=function(e){var t=e.users,n=e.onRemoveUser,a=(0,d.CR)((0,l.useState)(!0),2),r=a[0],i=a[1],s=(0,d.CR)((0,l.useState)([]),2),o=s[0],c=s[1],u=(0,d.CR)((0,l.useState)(),2),m=u[0],p=u[1],f=(0,C.$)().t,E=(0,l.useCallback)((function(e){p({state:!0,user:e})}),[]),y=(0,l.useCallback)((function(){p(void 0)}),[]),v=(0,l.useCallback)((function(){(0,g.isNil)(m)||(0,g.isNil)(n)||n(m.user.id),y()}),[m,y]);(0,l.useEffect)((function(){(0,d.mG)(void 0,void 0,void 0,(function(){var e,n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,3,4]),i(!0),e=t.map((function(e){return(0,an.GA)(e.id,{fields:[Ge.GB.TEAMS,Ge.GB.ROLES]})})),[4,Promise.allSettled(e)];case 1:return n=l.sent(),a=n.filter((function(e){return"fulfilled"===e.status})).map((function(e){return e.value})),c(a),[3,4];case 2:return l.sent(),[3,4];case 3:return i(!1),[7];case 4:return[2]}}))}))}),[t]);var b=(0,l.useMemo)((function(){return{title:f("label.action-plural"),dataIndex:"id",key:"id",width:90,render:function(e,t){return n&&l.createElement(Ue.Z,{title:f("label.remove-entity",{entity:f("label.user")})},l.createElement(h.Z,{"data-testid":"remove-user-btn",icon:l.createElement(nn.ReactComponent,{height:16,name:f("label.remove"),width:16}),type:"text",onClick:function(){return E(t)}}))}}}),[n]),Z=(0,l.useMemo)((function(){return(0,d.ev)((0,d.ev)([],(0,d.CR)((0,ln.y5)(r))),[b])}),[r]);return l.createElement(l.Fragment,null,l.createElement(Je.Z,{bordered:!0,columns:Z,dataSource:r?t:o,loading:r,locale:{emptyText:l.createElement(xe.Z,{permission:!0,className:"p-y-md",heading:f("label.user"),type:Re.Wx.ASSIGN})},pagination:!1,rowKey:"fullyQualifiedName",size:"small"}),Boolean(null==m?void 0:m.state)&&l.createElement(ft.Z,{cancelText:f("label.cancel"),"data-testid":"remove-confirmation-modal",okText:f("label.confirm"),open:Boolean(null==m?void 0:m.state),title:f("label.removing-user"),onCancel:y,onOk:v},f("message.are-you-sure-want-to-text",{text:f("label.remove-entity-lowercase",{entity:null==m?void 0:m.user.name})})))},sn=function(){var e,t,n=(0,M.f)().fqn,a=(0,r.k6)(),i=(0,d.CR)((0,l.useState)(),2),u=i[0],m=i[1],E=(0,d.CR)((0,l.useState)(!0),2),y=E[0],v=E[1],b=(0,d.CR)((0,l.useState)(!1),2),Z=b[0],S=b[1],T=(0,C.$)().t,w=(0,d.CR)((0,l.useState)(bt.Bd),2),I=w[0],A=w[1],R=(0,o.BL)().getEntityPermissionByFqn,k=(0,l.useMemo)((function(){return[{name:T("label.persona-plural"),url:(0,D.si)(s.CZ.MEMBERS,s.lx.PERSONA)},{name:(0,Q.C_)(u),url:""}]}),[u]);(0,l.useEffect)((function(){R(c.A.PERSONA,n).then(A)}),[]),(0,l.useEffect)((function(){n&&(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),v(!0),[4,(0,nt.ws)(n)];case 1:return e=a.sent(),m(e),[3,4];case 2:return t=a.sent(),(0,O.Eo)(t),[3,4];case 3:return v(!1),[7];case 4:return[2]}}))}))}),[n]);var L=(0,l.useCallback)((function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:if(!u)return[2];t=(0,ot.qu)(u,(0,d.pi)((0,d.pi)({},u),e)),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,(0,nt.Iu)(null==u?void 0:u.id,t)];case 2:return n=l.sent(),m(n),[3,5];case 3:return a=l.sent(),(0,O.Eo)(a),[3,5];case 4:return S(!1),[7];case 5:return[2]}}))}))}),[u]),P=(0,l.useCallback)((function(e){var t,n=null===(t=null==u?void 0:u.users)||void 0===t?void 0:t.filter((function(t){return t.id!==e}));L({users:n})}),[u]);return y?l.createElement(N.Z,null):(0,g.isUndefined)(u)?l.createElement(Xt.Z,{size:Re.NO.LARGE}):l.createElement(ne.Z,{pageTitle:u.name},l.createElement(p.Z,{className:"m-b-md page-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement("div",{className:"d-flex justify-between items-start"},l.createElement("div",{className:"w-full"},l.createElement(x.Z,{titleLinks:k}),l.createElement(tn.Z,{className:"m-t-xs",displayName:u.displayName,icon:l.createElement(Pe.Z,{component:Yt.ReactComponent,style:{fontSize:"36px"}}),name:null==u?void 0:u.name,serviceName:u.name})),l.createElement($t.Z,{afterDeleteAction:function(){a.push((0,D.si)(s.CZ.MEMBERS,s.lx.PERSONA))},allowSoftDelete:!1,canDelete:I.EditAll||I.Delete,deleted:!1,displayName:(0,Q.C_)(u),editDisplayNamePermission:I.EditAll||I.EditDescription,entityFQN:u.fullyQualifiedName,entityId:u.id,entityName:u.name,entityType:Ge.py.PERSONA,onEditDisplayName:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l;return(0,d.Jh)(this,(function(r){switch(r.label){case 0:if(!u)return[2];t=(0,d.pi)((0,d.pi)({},u),e),n=(0,ot.qu)(u,t),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,(0,nt.Iu)(null==u?void 0:u.id,n)];case 2:return a=r.sent(),m(a),[3,5];case 3:return l=r.sent(),(0,O.Eo)(l),[3,5];case 4:return S(!1),[7];case 5:return[2]}}))}))}}))),l.createElement(f.Z,{span:24},l.createElement(Kt.Z,{hasEditAccess:!0,description:u.description,entityType:Ge.py.PERSONA,isEdit:Z,showCommentsIcon:!1,onCancel:function(){return S(!1)},onDescriptionEdit:function(){return S(!0)},onDescriptionUpdate:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l;return(0,d.Jh)(this,(function(r){switch(r.label){case 0:if(!u)return[2];t=(0,d.pi)((0,d.pi)({},u),{description:e}),n=(0,ot.qu)(u,t),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,(0,nt.Iu)(null==u?void 0:u.id,n)];case 2:return a=r.sent(),m(a),[3,5];case 3:return l=r.sent(),(0,O.Eo)(l),[3,5];case 4:return S(!1),[7];case 5:return[2]}}))}))}})),l.createElement(f.Z,{span:24},l.createElement(st.Z,{defaultActiveKey:"users",items:[{label:"Users",key:"users",children:l.createElement(rn,{users:null!==(e=u.users)&&void 0!==e?e:[],onRemoveUser:P})}],tabBarExtraContent:l.createElement(en.l,{hasPermission:!0,multiSelect:!0,selectedUsers:null!==(t=u.users)&&void 0!==t?t:[],onUpdate:function(e){return L({users:e})}},l.createElement(h.Z,{"data-testid":"add-persona-button",size:"small",type:"primary"},T("label.add-entity",{entity:T("label.user")})))}))))},on=n(35295),cn=n(49101),un=n(91024),dn=n(83663),mn=n(666),pn=n(37878),fn=function(e){var t,n,a=e.onCancel,r=e.onSave,s=e.persona,o=(0,d.CR)((0,un.Z)(),1)[0],c=(0,d.CR)((0,l.useState)(!1),2),u=c[0],p=c[1],f=(0,C.$)().t,E=null!==(n=null!==(t=m.Z.useWatch("users",o))&&void 0!==t?t:null==s?void 0:s.users)&&void 0!==n?n:[],y=!(0,g.isEmpty)(s),v=(0,l.useCallback)((function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l,i,o,c;return(0,d.Jh)(this,(function(u){switch(u.label){case 0:return u.trys.push([0,5,6,7]),p(!0),t=e.users,n=null!==(o=null==t?void 0:t.map((function(e){return e.id})))&&void 0!==o?o:[],a=null===(c=e.domain)||void 0===c?void 0:c.fullyQualifiedName,s&&y?(l=(0,ot.qu)(s,e),[4,(0,nt.Iu)(null==s?void 0:s.id,l)]):[3,2];case 1:return u.sent(),[3,4];case 2:return[4,(0,nt.Tt)((0,d.pi)((0,d.pi)({},e),{users:n,domain:a}))];case 3:u.sent(),u.label=4;case 4:return r(),[3,7];case 5:return i=u.sent(),(0,O.Eo)(i),[3,7];case 6:return p(!1),[7];case 7:return[2]}}))}))}),[y,s]),b=(0,l.useMemo)((function(){return[{name:"name",required:!0,label:f("label.name"),id:"root/name",type:re.Uv.TEXT,props:{"data-testid":"name",autoComplete:"off"},placeholder:f("label.name"),rules:w.m},{name:"displayName",required:!1,label:f("label.display-name"),id:"root/displayName",type:re.Uv.TEXT,props:{"data-testid":"displayName",autoComplete:"off"},placeholder:f("label.display-name")},{name:"description",required:!1,label:f("label.description"),id:"root/description",type:re.Uv.DESCRIPTION,props:{"data-testid":"description",initialValue:"",height:"auto"}}]}),[]),Z=(0,l.useMemo)((function(){return{name:"users",required:!1,label:f("label.user-plural"),id:"root/users",formItemProps:{valuePropName:"selectedUsers",trigger:"onUpdate",initialValue:[]},formItemLayout:re.EP.HORIZONTAL,type:re.Uv.USER_MULTI_SELECT,props:{"data-testid":"user",hasPermission:!0,children:l.createElement(h.Z,{"data-testid":"add-users",icon:l.createElement(cn.Z,{style:{color:"white",fontSize:"12px"}}),size:"small",type:"primary"})}}}),[]),N=(0,l.useCallback)((function(){return null==o?void 0:o.submit()}),[o]);return l.createElement(dn.Z,{centered:!0,destroyOnClose:!0,open:!0,cancelText:f("label.cancel"),closable:!1,closeIcon:null,confirmLoading:u,"data-testid":"add-edit-persona-modal",okText:f(y?"label.update":"label.create"),title:(0,g.isEmpty)(s)?"Add Persona":"Edit Persona",width:750,onCancel:a,onOk:N},l.createElement(m.Z,{form:o,initialValues:s,layout:"vertical",validateMessages:i.NG,onFinish:v},(0,se.GL)(b),l.createElement("div",null,(0,se.rz)(Z),Boolean(E.length)&&l.createElement(j.Z,{wrap:!0,className:"m--t-md","data-testid":"users-container",size:[8,8]},E.map((function(e){var t;return l.createElement(mn.w,{id:null!==(t=e.name)&&void 0!==t?t:e.id,key:e.id,name:(0,Q.C_)(e),size:pn.e.small})}))))))},En=function(e){var t,n=e.persona,a=(0,r.k6)(),i=(0,C.$)().t,s=(0,l.useCallback)((function(){n.fullyQualifiedName&&a.push((0,D.PK)(n.fullyQualifiedName))}),[n]);return l.createElement(B.Z,{bodyStyle:{height:"100%"},className:"h-full cursor-pointer","data-testid":"persona-details-card",onClick:s},l.createElement(j.Z,{className:"justify-between h-full",direction:"vertical"},l.createElement(B.Z.Meta,{description:n.description?l.createElement(Ve.Z,{className:"text-grey-muted max-two-lines",markdown:null!==(t=n.description)&&void 0!==t?t:""}):l.createElement(E.Z.Text,{className:"text-grey-muted"},i("label.no-description")),title:(0,Q.C_)(n)})))},yn=function(){var e=(0,Be.a)().isAdminUser,t=(0,C.$)().t,n=(0,d.CR)((0,l.useState)(),2),a=n[0],r=n[1],i=(0,d.CR)((0,l.useState)(),2),o=i[0],c=i[1],u=(0,d.CR)((0,l.useState)(!1),2),m=u[0],E=u[1],v=(0,Le.C)(),b=v.currentPage,Z=v.handlePageChange,N=v.pageSize,S=v.handlePageSizeChange,T=v.paging,w=v.handlePagingChange,I=v.showPagination,A=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.MEMBERS,t("label.persona-plural"))}),[]),R=(0,l.useCallback)((function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,3,4]),E(!0),[4,(0,nt.XQ)({limit:N,fields:Ge.GB.USERS,after:null==e?void 0:e.after,before:null==e?void 0:e.before})];case 1:return t=l.sent(),n=t.data,a=t.paging,r(n),w(a),[3,4];case 2:return l.sent(),[3,4];case 3:return E(!1),[7];case 4:return[2]}}))}))}),[]);(0,l.useEffect)((function(){R()}),[N]);var M=function(){c({})},k=(0,l.useMemo)((function(){return l.createElement(f.Z,{className:"mt-24 text-center",span:24},l.createElement(xe.Z,{heading:t("label.persona"),permission:e,type:Re.Wx.CREATE,onClick:M}))}),[e]),L=function(){c(void 0)};return l.createElement(ne.Z,{pageTitle:t("label.persona-plural")},l.createElement(p.Z,{className:"user-listing page-container p-b-md","data-testid":"user-list-v1-component",gutter:[16,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:A})),l.createElement(f.Z,{span:18},l.createElement(J.Z,{data:Ae.j.PERSONAS})),l.createElement(f.Z,{span:6},l.createElement(j.Z,{align:"center",className:"w-full justify-end",size:16},l.createElement(h.Z,{"data-testid":"add-persona-button",type:"primary",onClick:M},t("label.add-entity",{entity:t("label.persona")})))),m?[1,2,3].map((function(e){return l.createElement(f.Z,{key:e,span:8},l.createElement(on.Z,null,l.createElement(y.Z,{active:!0,paragraph:!0,title:!0})))})):null==a?void 0:a.map((function(e){return l.createElement(f.Z,{key:e.id,span:8},l.createElement(En,{persona:e}))})),(0,g.isEmpty)(a)&&!m&&k,I&&l.createElement(f.Z,{span:24},l.createElement(we.Z,{currentPage:b,pageSize:N,paging:T,pagingHandler:function(e){var t,n=e.currentPage,a=e.cursorType;Z(n),a&&R(((t={})[a]=T[a],t))},onShowSizeChange:S})),Boolean(o)&&l.createElement(fn,{persona:o,onCancel:L,onSave:function(){L(),R()}})))},vn=n(23031);!function(e){e.Allow="allow",e.Deny="deny"}(Ft||(Ft={})),function(e){e.All="All",e.Create="Create",e.CreateIngestionPipelineAutomator="CreateIngestionPipelineAutomator",e.Delete="Delete",e.DeleteTestCaseFailedRowsSample="DeleteTestCaseFailedRowsSample",e.Deploy="Deploy",e.EditAll="EditAll",e.EditCustomFields="EditCustomFields",e.EditDataProfile="EditDataProfile",e.EditDescription="EditDescription",e.EditDisplayName="EditDisplayName",e.EditIngestionPipelineStatus="EditIngestionPipelineStatus",e.EditKnowledgePanel="EditKnowledgePanel",e.EditLifeCycle="EditLifeCycle",e.EditLineage="EditLineage",e.EditOwners="EditOwners",e.EditPage="EditPage",e.EditPolicy="EditPolicy",e.EditQueries="EditQueries",e.EditReviewers="EditReviewers",e.EditRole="EditRole",e.EditSampleData="EditSampleData",e.EditStatus="EditStatus",e.EditTags="EditTags",e.EditTeams="EditTeams",e.EditTests="EditTests",e.EditTier="EditTier",e.EditUsage="EditUsage",e.EditUsers="EditUsers",e.GenerateToken="GenerateToken",e.Kill="Kill",e.Trigger="Trigger",e.ViewAll="ViewAll",e.ViewBasic="ViewBasic",e.ViewDataProfile="ViewDataProfile",e.ViewQueries="ViewQueries",e.ViewSampleData="ViewSampleData",e.ViewTestCaseFailedRowsSample="ViewTestCaseFailedRowsSample",e.ViewTests="ViewTests",e.ViewUsage="ViewUsage"}(Ht||(Ht={}));var hn=n(80897),bn=n(54680),gn=n(49288),Cn=n(40734),Zn=Tt.Z.Option,Nn=function(e){var t=e.ruleData,n=e.setRuleData,a=(0,C.$)().t,r=(0,d.CR)((0,l.useState)([]),2),i=r[0],s=r[1],o=(0,d.CR)((0,l.useState)([]),2),c=o[0],u=o[1],p=(0,d.CR)((0,l.useState)([]),2),f=p[0],E=p[1],y=(0,d.CR)((0,l.useState)(""),2),h=y[0],b=y[1],Z=(0,d.CR)((0,l.useState)(!1),2),N=Z[0],S=Z[1],x=(0,d.CR)((0,l.useState)(!1),2),I=x[0],A=x[1],R=(0,l.useMemo)((function(){return[{title:"All",value:"All",key:"all",children:i.filter((function(e){return!bt.mH.includes(e.name||"")})).map((function(e){return{title:(0,g.startCase)(e.name),value:e.name,key:e.name}}))}]}),[i]),M=(0,l.useMemo)((function(){var e=i.filter((function(e){var n;return bt.mH.includes(e.name||"")?bt.mH.some((function(e){var n;return null===(n=t.resources)||void 0===n?void 0:n.includes(e)})):null===(n=t.resources)||void 0===n?void 0:n.includes(e.name||"")})),n=e.reduce((function(e,t){return(0,g.uniq)((0,d.ev)((0,d.ev)([],(0,d.CR)(e)),(0,d.CR)(t.operations||[])))}),[]).filter((function(e){return e!==Ht.All}));return[{title:"All",value:Ht.All,key:"All",children:n.map((function(e){return{title:e,value:e,key:e}}))}]}),[t.resources,i]),k=function(e){return e.reduce((function(e,t){var n=(t.examples||[]).map((function(e){return{label:e,value:e}}));return(0,g.uniqBy)((0,d.ev)((0,d.ev)([],(0,d.CR)(e)),(0,d.CR)(n)),"value")}),[])};return(0,l.useEffect)((function(){(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,hn.cN)()];case 1:return e=n.sent(),s(e.data||[]),[3,3];case 2:return t=n.sent(),(0,O.Eo)(t),[3,3];case 3:return[2]}}))})),(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,hn.QW)()];case 1:return e=n.sent(),u(e.data||[]),[3,3];case 2:return t=n.sent(),(0,O.Eo)(t),[3,3];case 3:return[2]}}))}))}),[]),(0,l.useEffect)((function(){E(k(c))}),[c]),l.createElement(l.Fragment,null,l.createElement(m.Z.Item,{label:a("label.rule-name")+":",name:"ruleName",rules:w.m},l.createElement(v.Z,{"data-testid":"rule-name",placeholder:a("label.rule-name"),type:"text",value:t.name,onChange:function(e){return n((function(t){return(0,d.pi)((0,d.pi)({},t),{name:e.target.value})}))}})),l.createElement(m.Z.Item,{label:a("label.description"),name:"ruleDescription"},l.createElement(T.Z,{height:"200px",initialValue:t.description||"",placeHolder:a("message.write-your-description"),style:{margin:0},onTextChange:function(e){return n((function(t){return(0,d.pi)((0,d.pi)({},t),{description:e})}))}})),l.createElement(m.Z.Item,{label:a("label.resource-plural")+":",name:"resources",rules:[{required:!0,message:a("label.field-required-plural",{field:a("label.resource-plural")})}]},l.createElement(bn.Z,{treeCheckable:!0,autoClearSearchValue:!1,className:"w-full","data-testid":"resources",placeholder:a("label.select-field",{field:a("label.resource-plural")}),showCheckedStrategy:bn.Z.SHOW_PARENT,treeData:R,onChange:function(e){n((function(t){return(0,d.pi)((0,d.pi)({},t),{resources:e})}))}})),l.createElement(m.Z.Item,{label:a("label.operation-plural")+":",name:"operations",rules:[{required:!0,message:a("label.field-required-plural",{field:a("label.operation-plural")})}]},l.createElement(bn.Z,{treeCheckable:!0,autoClearSearchValue:!1,className:"w-full","data-testid":"operations",placeholder:a("label.select-field",{field:a("label.operation-plural")}),showCheckedStrategy:bn.Z.SHOW_PARENT,treeData:M,onChange:function(e){n((function(t){return(0,d.pi)((0,d.pi)({},t),{operations:e})}))}})),l.createElement(m.Z.Item,{label:a("label.effect")+":",name:"ruleEffect",rules:[{required:!0,message:a("label.field-required",{field:a("label.effect")})}]},l.createElement(Tt.Z,{"data-testid":"effect",placeholder:a("label.select-field",{field:a("label.rule-effect")}),value:t.effect,onChange:function(e){return n((function(t){return(0,d.pi)((0,d.pi)({},t),{effect:e})}))}},l.createElement(Zn,{key:Ft.Allow},(0,g.capitalize)(Ft.Allow)),l.createElement(Zn,{key:Ft.Deny},(0,g.capitalize)(Ft.Deny)))),l.createElement(m.Z.Item,{label:a("label.condition")+":",name:"condition"},l.createElement(l.Fragment,null,l.createElement(gn.Z,{"data-testid":"condition",options:f,placeholder:"Condition",value:t.condition,onChange:function(e){var t;n((function(t){return(0,d.pi)((0,d.pi)({},t),{condition:e})})),!e&&b(""),t=e,(0,d.mG)(void 0,void 0,void 0,(function(){var e,n,l;return(0,d.Jh)(this,(function(r){switch(r.label){case 0:if(e=a("message.field-text-is-invalid",{fieldText:a("label.condition")}),!t)return[3,5];S(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,(0,hn.dV)(t)];case 2:return n=r.sent(),[200,204].includes(n.status)?(b(""),A(!0)):b(e),[3,5];case 3:return l=r.sent(),b((0,Cn.HR)(l,e)),A(!1),[3,5];case 4:return S(!1),[7];case 5:return[2]}}))}))},onSearch:function(e){E(e?function(t){return t.filter((function(t){return t.value.includes(e)}))}:k(c))}}),h&&l.createElement("div",{className:"m-t-xss","data-testid":"condition-error",role:"alert"},"❌ "+a("label.invalid-condition")+" : "+h),N&&l.createElement("div",{className:"m-t-xss",role:"alert"},a("label.validating-condition")),I&&!N&&!h&&l.createElement("div",{className:"m-t-xss","data-testid":"condition-success",role:"alert"},"✅ "+a("label.valid-condition")))))},Sn=(0,D.DW)(s.lx.POLICIES),Tn=[{name:(0,vn.t)("label.setting-plural"),url:(0,D.si)()},{name:(0,vn.t)("label.policy-plural"),url:Sn},{name:(0,vn.t)("label.add-new-entity",{entity:(0,vn.t)("label.policy")}),url:""}],xn=function(){var e=(0,r.k6)(),t=(0,d.CR)((0,l.useState)(""),2),n=t[0],a=t[1],s=(0,d.CR)((0,l.useState)(""),2),o=s[0],c=s[1],u=(0,d.CR)((0,l.useState)({name:"",description:"",resources:[],operations:[],condition:"",effect:Ft.Allow}),2),p=u[0],f=u[1],y=(0,d.CR)((0,l.useState)(!1),2),b=y[0],C=y[1];return l.createElement(S.Z,{className:"content-height-with-resizable-panel",firstPanel:{className:"content-resizable-panel-container",children:l.createElement("div",{className:"max-width-md w-9/10 service-form-container","data-testid":"add-policy-container"},l.createElement(x.Z,{titleLinks:Tn}),l.createElement("div",{className:"m-t-md"},l.createElement(E.Z.Paragraph,{className:"text-base","data-testid":"form-title"},(0,vn.t)("label.add-new-entity",{entity:(0,vn.t)("label.policy")})),l.createElement(m.Z,{"data-testid":"policy-form",id:"policy-form",initialValues:{ruleEffect:p.effect},layout:"vertical",onFinish:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,a,l,r,s,c;return(0,d.Jh)(this,(function(u){switch(u.label){case 0:t=(0,d.pi)((0,d.pi)({},p),{name:(0,g.trim)(p.name)}),a=t.condition,l=(0,d._T)(t,["condition"]),r={name:(0,g.trim)(n),description:o,rules:[a?(0,d.pi)((0,d.pi)({},l),{condition:a}):l]},C(!0),u.label=1;case 1:return u.trys.push([1,3,4,5]),[4,(0,hn.u$)(r)];case 2:return(s=u.sent())&&e.push((0,D.Hr)(s.fullyQualifiedName||"")),[3,5];case 3:return c=u.sent(),(0,O.Eo)((0,at.B)(c,i.c9.alreadyExist)?(0,vn.t)("server.entity-already-exist",{entity:(0,vn.t)("label.policy"),entityPlural:(0,vn.t)("label.policy-lowercase-plural"),name:r.name}):c),[3,5];case 4:return C(!1),[7];case 5:return[2]}}))}))}},l.createElement(m.Z.Item,{label:(0,vn.t)("label.name")+":",name:"name",rules:w.m},l.createElement(v.Z,{"data-testid":"policy-name",placeholder:(0,vn.t)("label.policy-name"),type:"text",value:n,onChange:function(e){return a(e.target.value)}})),l.createElement(m.Z.Item,{label:(0,vn.t)("label.description")+":",name:"description"},l.createElement(T.Z,{height:"200px",initialValue:o,placeHolder:(0,vn.t)("message.write-your-description"),style:{margin:0},onTextChange:function(e){return c(e)}})),l.createElement(F.Z,{"data-testid":"add-rule-divider"},(0,vn.t)("label.add-entity",{entity:(0,vn.t)("label.rule")})),l.createElement(Nn,{ruleData:p,setRuleData:f}),l.createElement(j.Z,{align:"center",className:"w-full justify-end"},l.createElement(h.Z,{"data-testid":"cancel-btn",type:"link",onClick:function(){e.push(Sn)}},(0,vn.t)("label.cancel")),l.createElement(h.Z,{"data-testid":"submit-btn",form:"policy-form",htmlType:"submit",loading:b,type:"primary"},(0,vn.t)("label.submit")))))),minWidth:700,flex:.7},pageTitle:(0,vn.t)("label.add-entity",{entity:(0,vn.t)("label.policy")}),secondPanel:{children:l.createElement(l.Fragment,null,l.createElement(E.Z.Paragraph,{className:"text-base font-medium"},(0,vn.t)("label.add-entity",{entity:(0,vn.t)("label.policy")})),l.createElement(E.Z.Text,null,(0,vn.t)("message.add-policy-message"))),className:"p-md p-t-xl content-resizable-panel-container",minWidth:400,flex:.3}})},wn=n(70431),In=(0,D.DW)(s.lx.POLICIES),An=function(){var e=(0,C.$)().t,t=(0,r.k6)(),n=(0,M.f)().fqn,a=(0,d.CR)((0,l.useState)(!1),2),i=a[0],s=a[1],o=(0,d.CR)((0,l.useState)({}),2),c=o[0],u=o[1],y=(0,d.CR)((0,l.useState)({name:"",description:"",resources:[],operations:[],condition:"",effect:Ft.Allow}),2),v=y[0],b=y[1],Z=(0,l.useMemo)((function(){return[{name:e("label.setting-plural"),url:(0,D.si)()},{name:e("label.policy-plural"),url:In},{name:(0,Q.C_)(c),url:(0,D.Hr)(n)},{name:e("label.add-new-entity",{entity:e("label.rule")}),url:""}]}),[n,c]),S=function(){t.push((0,D.Hr)(n))};return(0,l.useEffect)((function(){(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:s(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,hn.u7)(n,""+(Ge.GB.OWNERS,Ge.GB.LOCATION,Ge.GB.TEAMS,Ge.GB.ROLES))];case 2:return e=a.sent(),u(null!=e?e:{}),[3,5];case 3:return t=a.sent(),(0,O.Eo)(t),[3,5];case 4:return s(!1),[7];case 5:return[2]}}))}))}),[n]),i?l.createElement(N.Z,null):l.createElement(ne.Z,{pageTitle:e("label.add-new-entity",{entity:e("label.rule")})},l.createElement(p.Z,{className:"h-auto p-y-xss",gutter:[16,16]},l.createElement(f.Z,{offset:5,span:14},l.createElement(x.Z,{className:"m-b-md",titleLinks:Z}),l.createElement(E.Z.Paragraph,{className:"text-base","data-testid":"add-rule-title"},e("label.add-new-entity",{entity:e("label.rule")})),l.createElement(m.Z,{"data-testid":"rule-form",id:"rule-form",initialValues:{ruleEffect:v.effect},layout:"vertical",onFinish:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l,r,i;return(0,d.Jh)(this,(function(s){switch(s.label){case 0:t=(0,d.pi)((0,d.pi)({},v),{name:(0,g.trim)(v.name)}),n=t.condition,a=(0,d._T)(t,["condition"]),l=(0,ot.qu)(c,(0,d.pi)((0,d.pi)({},c),{rules:(0,d.ev)((0,d.ev)([],(0,d.CR)(c.rules)),[n?(0,d.pi)((0,d.pi)({},a),{condition:n}):a])})),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,(0,hn.$j)(l,c.id)];case 2:return s.sent()&&S(),[3,4];case 3:return r=s.sent(),(null===(i=r.response)||void 0===i?void 0:i.status)===wn.N.CONFLICT?(0,O.Eo)(e("server.entity-already-exist",{entity:e("label.rule"),entityPlural:e("label.rule-lowercase-plural"),name:v.name})):(0,O.Eo)(r,e("server.create-entity-error",{entity:e("label.rule-lowercase")})),[3,4];case 4:return[2]}}))}))}},l.createElement(Nn,{ruleData:v,setRuleData:b}),l.createElement(j.Z,{align:"center",className:"w-full justify-end"},l.createElement(h.Z,{"data-testid":"cancel-btn",type:"link",onClick:S},e("label.cancel")),l.createElement(h.Z,{"data-testid":"submit-btn",form:"rule-form",htmlType:"submit",type:"primary"},e("label.submit")))))))},Rn=(0,D.DW)(s.lx.POLICIES),Mn={name:"",description:"",resources:[],operations:[],condition:"",effect:Ft.Allow},kn=function(){var e=(0,C.$)().t,t=(0,r.k6)(),n=(0,M.f)(),a=n.fqn,i=n.ruleName,s=(0,d.CR)((0,l.useState)(!1),2),o=s[0],c=s[1],u=(0,d.CR)((0,l.useState)({}),2),y=u[0],v=u[1],b=(0,d.CR)((0,l.useState)(Mn),2),Z=b[0],S=b[1],T=(0,l.useMemo)((function(){return[{name:"Settings",url:(0,D.si)()},{name:"Policies",url:Rn},{name:(0,Q.C_)(y),url:(0,D.Hr)(a)},{name:i,url:""}]}),[a,y,i]),w=function(){t.push((0,D.Hr)(a))};return(0,l.useEffect)((function(){(0,d.mG)(void 0,void 0,void 0,(function(){var e,t,n;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:c(!0),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,(0,hn.u7)(a,""+(Ge.GB.OWNERS,Ge.GB.LOCATION,Ge.GB.TEAMS,Ge.GB.ROLES))];case 2:return(e=l.sent())?(v(e),t=e.rules.find((function(e){return e.name===i})),S(null!=t?t:Mn)):v({}),[3,5];case 3:return n=l.sent(),(0,O.Eo)(n),[3,5];case 4:return c(!1),[7];case 5:return[2]}}))}))}),[a]),o?l.createElement(N.Z,null):l.createElement(ne.Z,{pageTitle:e("label.edit-entity",{entity:e("label.rule")})},l.createElement(p.Z,{className:"h-auto p-y-xss",gutter:[16,16]},l.createElement(f.Z,{offset:5,span:14},l.createElement(x.Z,{className:"m-b-md",titleLinks:T}),l.createElement(B.Z,null,l.createElement(E.Z.Paragraph,{className:"text-base","data-testid":"edit-rule-title"},e("label.edit-entity",{entity:e("label.rule")})," ",'"'+i+'"'),l.createElement(m.Z,{"data-testid":"rule-form",id:"rule-form",initialValues:{ruleEffect:Z.effect,ruleName:Z.name,resources:Z.resources,operations:Z.operations,condition:Z.condition},layout:"vertical",onFinish:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l,r;return(0,d.Jh)(this,(function(s){switch(s.label){case 0:t=y.rules,n=t.map((function(e){if(e.name===i){var t=(0,d.pi)((0,d.pi)({},Z),{name:(0,g.trim)(Z.name)}),n=t.condition,a=(0,d._T)(t,["condition"]);return n?(0,d.pi)((0,d.pi)({},a),{condition:n}):a}return e})),a=(0,ot.qu)(y,(0,d.pi)((0,d.pi)({},y),{rules:n})),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,(0,hn.$j)(a,y.id)];case 2:return s.sent()&&w(),[3,4];case 3:return l=s.sent(),(null===(r=l.response)||void 0===r?void 0:r.status)===wn.N.CONFLICT?(0,O.Eo)(e("server.entity-already-exist",{entity:e("label.rule"),entityPlural:e("label.rule-lowercase-plural"),name:Z.name})):(0,O.Eo)(l,e("server.entity-updating-error",{entity:e("label.rule-lowercase")})),[3,4];case 4:return[2]}}))}))}},l.createElement(Nn,{ruleData:Z,setRuleData:S}),l.createElement(j.Z,{align:"center",className:"w-full justify-end"},l.createElement(h.Z,{"data-testid":"cancel-btn",type:"link",onClick:w},e("label.cancel")),l.createElement(h.Z,{"data-testid":"submit-btn",form:"rule-form",htmlType:"submit",type:"primary"},e("label.submit"))))))))},Ln=n(44545),Dn=n(13013),On=n(28682),Pn=n(11484),Un=n(500),zn={};zn.styleTagTransform=Ce(),zn.setAttributes=ve(),zn.insert=Ee().bind(null,"head"),zn.domAPI=pe(),zn.insertStyleElement=be(),de()(Un.Z,zn),Un.Z&&Un.Z.locals&&Un.Z.locals;var Gn=n(2307),_n=function(e){var t=e.list,n=e.type,a=e.onDelete,r=e.hasAccess,i=(0,C.$)().t,s=(0,l.useMemo)((function(){return[{title:i("label.name"),dataIndex:"name",width:"200px",key:"name",render:function(e,t){var a="";switch(n){case"role":a=(0,D.Uy)(t.fullyQualifiedName||"");break;case"team":a=(0,D.KH)(t.fullyQualifiedName||"")}return l.createElement(H.Link,{className:"link-hover",to:a},(0,Q.C_)(t))}},{title:i("label.description"),dataIndex:"description",key:"description",render:function(e,t){return l.createElement(Ve.Z,{markdown:(null==t?void 0:t.description)||""})}},{title:i("label.action-plural"),dataIndex:"actions",width:"80px",key:"actions",render:function(e,t){return l.createElement(Ue.Z,{title:i(r?"label.remove":"message.no-permission-for-action")},l.createElement(h.Z,{"data-testid":"remove-action-"+(0,Q.C_)(t),disabled:!r,type:"text",onClick:function(){return a(t)}},l.createElement(Pe.Z,{className:"align-middle",component:nn.ReactComponent,style:{fontSize:"16px"}})))}}]}),[]);return l.createElement(Gn.Z,{bordered:!0,className:"list-table",columns:s,dataSource:t,pagination:!1,rowKey:"id",size:"small"})},Bn=st.Z.TabPane,jn=function(){var e,t,n=(0,C.$)().t,a=(0,r.k6)(),i=(0,M.f)().fqn,o=(0,d.CR)((0,l.useState)({}),2),c=o[0],u=o[1],m=(0,d.CR)((0,l.useState)(!1),2),y=m[0],v=m[1],b=(0,d.CR)((0,l.useState)(!1),2),Z=b[0],S=b[1],T=(0,d.CR)((0,l.useState)(!1),2),w=T[0],I=T[1],A=(0,d.CR)((0,l.useState)(),2),R=A[0],k=A[1],L=(0,D.si)(s.CZ.ACCESS,s.lx.POLICIES),P=(0,l.useMemo)((function(){return(0,Q.C_)(c)}),[c]),U=(0,l.useMemo)((function(){return[{name:n("label.policy-plural"),url:L},{name:P,url:""}]}),[P,L]),z=(0,l.useCallback)((function(e){return l.createElement(Dn.Z,{overlay:l.createElement(On.Z,{items:[{label:l.createElement(h.Z,{className:"p-0","data-testid":"edit-rule",type:"text",onClick:function(t){t.stopPropagation(),a.push((0,D.do)(i,e.name||""))}},l.createElement(j.Z,{align:"center"},l.createElement(V.ReactComponent,{width:"16px"}),n("label.edit"))),key:"edit-button"},{label:l.createElement(h.Z,{className:"p-0","data-testid":"delete-rule",type:"text",onClick:function(t){var n;t.stopPropagation(),n=e,(0,d.mG)(void 0,void 0,void 0,(function(){var e,t,a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:e=(null!==(r=c.rules)&&void 0!==r?r:[]).filter((function(e){return e.name!==n.name})),t=(0,ot.qu)(c,(0,d.pi)((0,d.pi)({},c),{rules:e})),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,(0,hn.$j)(t,c.id)];case 2:return a=i.sent(),u(a),[3,4];case 3:return l=i.sent(),(0,O.Eo)(l),[3,4];case 4:return[2]}}))}))}},l.createElement(j.Z,{align:"center"},l.createElement(Pe.Z,{className:"align-middle",component:W.ReactComponent,style:{fontSize:"16px"}}),n("label.delete"))),key:"delete-button"}]}),placement:"bottomRight",trigger:["click"]},l.createElement(Ue.Z,{placement:"topRight",title:n("label.manage-entity",{entity:n("label.rule")})},l.createElement(h.Z,{"data-testid":"manage-button-"+e.name,icon:l.createElement(Ln.Z,{className:"text-grey-body",rotate:90}),size:"small",type:"text",onClick:function(e){e.stopPropagation()}})))}),[c]);return(0,l.useEffect)((function(){(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:v(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,hn.u7)(i,""+(Ge.GB.OWNERS,Ge.GB.LOCATION,Ge.GB.TEAMS,Ge.GB.ROLES))];case 2:return e=n.sent(),u(null!=e?e:{}),[3,5];case 3:return t=n.sent(),(0,O.Eo)(t),[3,5];case 4:return v(!1),[7];case 5:return[2]}}))}))}),[i]),y?l.createElement(N.Z,null):l.createElement(ne.Z,{pageTitle:n("label.policy-plural")},l.createElement("div",{className:"page-container","data-testid":"policy-details-container"},l.createElement(x.Z,{titleLinks:U}),l.createElement(l.Fragment,null,(0,g.isEmpty)(c)?l.createElement(xe.Z,null,l.createElement("div",{className:"text-center"},l.createElement("p",null,n("message.no-entity-found-for-name",{entity:n("label.policy-lowercase"),name:i})),l.createElement(h.Z,{size:"small",type:"primary",onClick:function(){return a.push(L)}},n("label.go-back")))):l.createElement("div",{className:"policies-detail","data-testid":"policy-details"},l.createElement(E.Z.Title,{className:"m-b-0 m-t-xs","data-testid":"heading",level:5},P),l.createElement(Kt.Z,{hasEditAccess:!0,className:"m-y-md",description:c.description||"",entityFqn:c.fullyQualifiedName,entityName:P,entityType:Ge.py.POLICY,isEdit:w,showCommentsIcon:!1,onCancel:function(){return I(!1)},onDescriptionEdit:function(){return I(!0)},onDescriptionUpdate:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:t=(0,ot.qu)(c,(0,d.pi)((0,d.pi)({},c),{description:e})),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,(0,hn.$j)(t,c.id)];case 2:return n=l.sent(),u((0,d.pi)((0,d.pi)({},c),{description:n.description})),[3,5];case 3:return a=l.sent(),(0,O.Eo)(a),[3,5];case 4:return I(!1),[7];case 5:return[2]}}))}))}}),l.createElement(st.Z,{defaultActiveKey:"rules"},l.createElement(Bn,{key:"rules",tab:n("label.rule-plural")},(0,g.isEmpty)(c.rules)?l.createElement(xe.Z,null):l.createElement(j.Z,{className:"w-full tabpane-space",direction:"vertical"},l.createElement(h.Z,{"data-testid":"add-rule",type:"primary",onClick:function(){return a.push((0,D.qW)(i))}},n("label.add-entity",{entity:n("label.rule")})),l.createElement(j.Z,{className:"w-full",direction:"vertical",size:20},c.rules.map((function(e){var t,a,r;return l.createElement(B.Z,{"data-testid":"rule-card",key:e.name||"rule"},l.createElement(j.Z,{align:"baseline",className:"w-full justify-between p-b-lg",direction:"horizontal"},l.createElement(E.Z.Text,{className:"font-medium text-base text-grey-body","data-testid":"rule-name"},e.name),z(e)),l.createElement(j.Z,{className:"w-full",direction:"vertical",size:12},e.description&&l.createElement(p.Z,{"data-testid":"description"},l.createElement(f.Z,{span:2},l.createElement(E.Z.Text,{className:"text-grey-muted"},n("label.description")+":")),l.createElement(f.Z,{span:22},l.createElement(Ve.Z,{markdown:e.description||""}))),l.createElement(p.Z,{"data-testid":"resources"},l.createElement(f.Z,{span:2},l.createElement(E.Z.Text,{className:"text-grey-muted m-b-0"},n("label.resource-plural")+":")),l.createElement(f.Z,{span:22},l.createElement(E.Z.Text,{className:"text-grey-body"},null===(a=null===(t=e.resources)||void 0===t?void 0:t.map((function(e){return(0,g.startCase)(e)})))||void 0===a?void 0:a.join(", ")))),l.createElement(p.Z,{"data-testid":"operations"},l.createElement(f.Z,{span:2},l.createElement(E.Z.Text,{className:"text-grey-muted"},n("label.operation-plural")+":")),l.createElement(f.Z,{span:22},l.createElement(E.Z.Text,{className:"text-grey-body"},null===(r=e.operations)||void 0===r?void 0:r.join(", ")))),l.createElement(p.Z,{"data-testid":"effect"},l.createElement(f.Z,{span:2},l.createElement(E.Z.Text,{className:"text-grey-muted"},n("label.effect")+":")),l.createElement(f.Z,{span:22},l.createElement(E.Z.Text,{className:"text-grey-body"},(0,g.startCase)(e.effect)))),e.condition&&l.createElement(p.Z,{"data-testid":"condition"},l.createElement(f.Z,{span:2},l.createElement(E.Z.Text,{className:"text-grey-muted"},n("label.condition")+":")),l.createElement(f.Z,{span:22},l.createElement("code",null,e.condition)))))}))))),l.createElement(Bn,{key:"roles",tab:n("label.role-plural")},l.createElement(_n,{hasAccess:!0,list:null!==(e=c.roles)&&void 0!==e?e:[],type:"role",onDelete:function(e){return k({record:e,attribute:"roles"})}})),l.createElement(Bn,{key:"teams",tab:n("label.team-plural")},l.createElement(_n,{hasAccess:!0,list:null!==(t=c.teams)&&void 0!==t?t:[],type:"team",onDelete:function(e){return k({record:e,attribute:"teams"})}}))))),R&&l.createElement(ft.Z,{centered:!0,closable:!1,confirmLoading:Z,maskClosable:!1,okText:n("label.confirm"),open:!(0,g.isUndefined)(R.record),title:n("label.remove-entity",{entity:(0,Q.C_)(R.record)})+" "+n("label.from-lowercase")+" "+P,onCancel:function(){return k(void 0)},onOk:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(e){switch(e.label){case 0:return[4,(t=R.record,n=R.attribute,(0,d.mG)(void 0,void 0,void 0,(function(){var e,a,l,r,i,s,o;return(0,d.Jh)(this,(function(m){switch(m.label){case 0:return S(!0),"roles"!==n?[3,1]:(function(e){(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l,r,i,s;return(0,d.Jh)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,4,5]),[4,(0,hn.n5)(e.fullyQualifiedName||"","policies")];case 1:return t=o.sent(),n=(null!==(i=t.policies)&&void 0!==i?i:[]).filter((function(e){return e.id!==c.id})),a=(0,ot.qu)(t,(0,d.pi)((0,d.pi)({},t),{policies:n})),[4,(0,hn.sZ)(a,t.id)];case 2:return o.sent()&&(l=(null!==(s=c.roles)&&void 0!==s?s:[]).filter((function(t){return t.id!==e.id})),u((function(e){return(0,d.pi)((0,d.pi)({},e),{roles:l})}))),[3,5];case 3:return r=o.sent(),(0,O.Eo)(r),[3,5];case 4:return S(!1),[7];case 5:return[2]}}))}))}(t),[3,7]);case 1:return"teams"!==n?[3,2]:(function(e){(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l,r,i,s;return(0,d.Jh)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,4,5]),[4,(0,Pn.Xv)(e.fullyQualifiedName||"",{fields:Ge.GB.POLICIES})];case 1:return t=o.sent(),n=(null!==(i=t.policies)&&void 0!==i?i:[]).filter((function(e){return e.id!==c.id})),a=(0,ot.qu)(t,(0,d.pi)((0,d.pi)({},t),{policies:n})),[4,(0,Pn.Cp)(t.id,a)];case 2:return o.sent()&&(l=(null!==(s=c.teams)&&void 0!==s?s:[]).filter((function(t){return t.id!==e.id})),u((function(e){return(0,d.pi)((0,d.pi)({},e),{teams:l})}))),[3,5];case 3:return r=o.sent(),(0,O.Eo)(r),[3,5];case 4:return S(!1),[7];case 5:return[2]}}))}))}(t),[3,7]);case 2:e=null!==(o=c[n])&&void 0!==o?o:[],a=e.filter((function(e){return e.id!==t.id})),l=(0,ot.qu)(c,(0,d.pi)((0,d.pi)({},c),((s={})[n]=a,s))),m.label=3;case 3:return m.trys.push([3,5,6,7]),[4,(0,hn.$j)(l,c.id)];case 4:return r=m.sent(),u(r),[3,7];case 5:return i=m.sent(),(0,O.Eo)(i),[3,7];case 6:return S(!1),[7];case 7:return[2]}}))})))];case 1:return e.sent(),k(void 0),[2]}var t,n}))}))}},l.createElement(E.Z.Text,null,n("message.are-you-sure-you-want-to-remove-child-from-parent",{child:(0,Q.C_)(R.record),parent:P})))))},Fn=n(55241),Hn=n(60331),Vn=n(72819),Wn=n(47871),Jn={};Jn.styleTagTransform=Ce(),Jn.setAttributes=ve(),Jn.insert=Ee().bind(null,"head"),Jn.domAPI=pe(),Jn.insertStyleElement=be(),de()(Wn.Z,Jn),Wn.Z&&Wn.Z.locals&&Wn.Z.locals;var qn,Qn,Yn=function(){var e=(0,C.$)().t,t=(0,r.k6)(),n=(0,d.CR)((0,l.useState)(),2),a=n[0],u=n[1],m=(0,d.CR)((0,l.useState)([]),2),E=m[0],y=m[1],v=(0,d.CR)((0,l.useState)(!0),2),b=v[0],Z=v[1],N=(0,Le.C)(i.Ou),S=N.currentPage,T=N.handlePageChange,w=N.paging,I=N.handlePagingChange,A=N.pageSize,R=N.handlePageSizeChange,M=N.showPagination,k=(0,o.BL)().permissions,L=(0,l.useMemo)((function(){return!(0,g.isEmpty)(k)&&(0,bt.P_)(Vn.OX.Create,c.A.POLICY,k)}),[k]),P=(0,l.useMemo)((function(){return!(0,g.isEmpty)(k)&&(0,bt.P_)(Vn.OX.Delete,c.A.POLICY,k)}),[k]),U=(0,l.useMemo)((function(){return!(0,g.isEmpty)(k)&&(null===bt.NE||void 0===bt.NE?void 0:bt.NE.hasViewPermissions(c.A.ROLE,k))}),[k]),z=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.ACCESS,e("label.policy-plural"))}),[]),G=(0,l.useMemo)((function(){return[{title:e("label.name"),dataIndex:"name",width:"200px",key:"name",render:function(e,t){return l.createElement(H.Link,{className:"link-hover","data-testid":"policy-name",to:t.fullyQualifiedName?(0,D.Hr)(t.fullyQualifiedName):""},(0,Q.C_)(t))}},{title:e("label.description"),dataIndex:"description",key:"description",render:function(e,t){return(0,g.isEmpty)(null==t?void 0:t.description)?i.lH:l.createElement(Ve.Z,{markdown:(null==t?void 0:t.description)||""})}},{title:e("label.role-plural"),dataIndex:"roles",width:"250px",key:"roles",render:function(e,t){var n,a,r,i=null!==(a=null===(n=t.roles)||void 0===n?void 0:n.length)&&void 0!==a?a:0,s=i>bt.YD;return(null===(r=t.roles)||void 0===r?void 0:r.length)?l.createElement(j.Z,{wrap:!0,"data-testid":"role-link",size:4},t.roles.slice(0,bt.YD).map((function(e){var t;return U?l.createElement(H.Link,{key:(0,g.uniqueId)(),to:(0,D.Uy)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"")},(0,Q.C_)(e)):l.createElement(Ue.Z,{key:(0,g.uniqueId)(),title:dt._D},(0,Q.C_)(e))})),s&&l.createElement(Fn.Z,{className:"cursor-pointer",content:l.createElement(j.Z,{wrap:!0,size:4},t.roles.slice(bt.YD).map((function(e){return U?l.createElement(H.Link,{key:(0,g.uniqueId)(),to:(0,D.Uy)(e.fullyQualifiedName||"")},(0,Q.C_)(e)):l.createElement(Ue.Z,{key:(0,g.uniqueId)(),title:dt._D},(0,Q.C_)(e))}))),overlayClassName:"w-40 text-center",trigger:"click"},l.createElement(Hn.Z,{className:"m-l-xss","data-testid":"plus-more-count"},"+"+(i-bt.YD)+" more"))):"-- "}},{title:e("label.action-plural"),dataIndex:"actions",width:"80px",align:"center",key:"actions",render:function(t,n){return l.createElement(Ue.Z,{placement:"left",title:P?e("label.delete-entity",{entity:e("label.policy")}):dt.oH},l.createElement(h.Z,{"data-testid":"delete-action-"+(0,Q.C_)(n),disabled:!P,icon:l.createElement(W.ReactComponent,{name:e("label.delete"),width:"16px"}),type:"text",onClick:function(){return u(n)}}))}}]}),[]),_=function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:Z(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,hn.Ko)("roles",null==e?void 0:e.after,null==e?void 0:e.before,A)];case 2:return t=a.sent(),y(t.data||[]),I(t.paging),[3,5];case 3:return n=a.sent(),(0,O.Eo)(n),[3,5];case 4:return Z(!1),[7];case 5:return[2]}}))}))},B=(0,l.useCallback)((function(){_()}),[_]),F=function(){t.push(i.Z6.ADD_POLICY)};return(0,l.useEffect)((function(){_()}),[A]),l.createElement(ne.Z,{pageTitle:e("label.policy-plural")},l.createElement(p.Z,{className:"policies-list-container page-container","data-testid":"policies-list-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:z})),l.createElement(f.Z,{span:24},l.createElement(j.Z,{className:"w-full justify-between"},l.createElement(J.Z,{data:Ae.j.POLICIES}),L&&l.createElement(h.Z,{"data-testid":"add-policy",type:"primary",onClick:F},e("label.add-entity",{entity:e("label.policy")})))),l.createElement(f.Z,{span:24},l.createElement(Je.Z,{bordered:!0,className:"policies-list-table",columns:G,"data-testid":"policies-list-table",dataSource:E,loading:b,locale:{emptyText:l.createElement(xe.Z,{heading:e("label.policy"),permission:L,type:Re.Wx.CREATE,onClick:F})},pagination:!1,rowKey:"id",size:"small"}),a&&P&&l.createElement(Fe.Z,{afterDeleteAction:B,allowSoftDelete:!1,deleteMessage:e("message.are-you-sure-delete-entity",{entity:(0,Q.C_)(a)}),entityId:a.id,entityName:(0,Q.C_)(a),entityType:Ge.py.POLICY,visible:!(0,g.isUndefined)(a),onCancel:function(){return u(void 0)}})),l.createElement(f.Z,{span:24},M&&l.createElement(we.Z,{currentPage:S,pageSize:A,paging:w,pagingHandler:function(e){var t,n=e.currentPage,a=e.cursorType;T(n),a&&w&&_(((t={})[a]=w[a],t.total=null==w?void 0:w.total,t))},onShowSizeChange:R}))))},Kn=n(54549),$n=n(56275);!function(e){e.AggState="AGG_STATE",e.Aggregatefunction="AGGREGATEFUNCTION",e.Array="ARRAY",e.Bigint="BIGINT",e.Binary="BINARY",e.Bit="BIT",e.Bitmap="BITMAP",e.Blob="BLOB",e.Boolean="BOOLEAN",e.Bytea="BYTEA",e.Byteint="BYTEINT",e.Bytes="BYTES",e.CIDR="CIDR",e.Char="CHAR",e.Clob="CLOB",e.Date="DATE",e.Datetime="DATETIME",e.Datetimerange="DATETIMERANGE",e.Decimal="DECIMAL",e.Double="DOUBLE",e.Enum="ENUM",e.Error="ERROR",e.Fixed="FIXED",e.Float="FLOAT",e.Geography="GEOGRAPHY",e.Geometry="GEOMETRY",e.Hll="HLL",e.Hllsketch="HLLSKETCH",e.Image="IMAGE",e.Inet="INET",e.Int="INT",e.Interval="INTERVAL",e.Ipv4="IPV4",e.Ipv6="IPV6",e.JSON="JSON",e.Largeint="LARGEINT",e.Long="LONG",e.Longblob="LONGBLOB",e.Lowcardinality="LOWCARDINALITY",e.Macaddr="MACADDR",e.Map="MAP",e.Mediumblob="MEDIUMBLOB",e.Mediumtext="MEDIUMTEXT",e.Money="MONEY",e.Ntext="NTEXT",e.Null="NULL",e.Number="NUMBER",e.Numeric="NUMERIC",e.PGLsn="PG_LSN",e.PGSnapshot="PG_SNAPSHOT",e.Point="POINT",e.Polygon="POLYGON",e.QuantileState="QUANTILE_STATE",e.Record="RECORD",e.Rowid="ROWID",e.Set="SET",e.Smallint="SMALLINT",e.Spatial="SPATIAL",e.String="STRING",e.Struct="STRUCT",e.Super="SUPER",e.Table="TABLE",e.Text="TEXT",e.Time="TIME",e.Timestamp="TIMESTAMP",e.Timestampz="TIMESTAMPZ",e.Tinyint="TINYINT",e.Tsquery="TSQUERY",e.Tsvector="TSVECTOR",e.Tuple="TUPLE",e.TxidSnapshot="TXID_SNAPSHOT",e.UUID="UUID",e.Uint="UINT",e.Union="UNION",e.Unknown="UNKNOWN",e.Varbinary="VARBINARY",e.Varchar="VARCHAR",e.Variant="VARIANT",e.XML="XML",e.Year="YEAR"}(qn||(qn={})),function(e){e.ColumnCount="columnCount",e.ColumnNames="columnNames",e.CountInSet="countInSet",e.DistinctCount="distinctCount",e.DistinctProportion="distinctProportion",e.DuplicateCount="duplicateCount",e.FirstQuartile="firstQuartile",e.Histogram="histogram",e.ILikeCount="iLikeCount",e.ILikeRatio="iLikeRatio",e.InterQuartileRange="interQuartileRange",e.LikeCount="likeCount",e.LikeRatio="likeRatio",e.Max="max",e.MaxLength="maxLength",e.Mean="mean",e.Median="median",e.Min="min",e.MinLength="minLength",e.NonParametricSkew="nonParametricSkew",e.NotLikeCount="notLikeCount",e.NotRegexCount="notRegexCount",e.NullCount="nullCount",e.NullProportion="nullProportion",e.RegexCount="regexCount",e.RowCount="rowCount",e.Stddev="stddev",e.Sum="sum",e.System="system",e.ThirdQuartile="thirdQuartile",e.UniqueCount="uniqueCount",e.UniqueProportion="uniqueProportion",e.ValuesCount="valuesCount"}(Qn||(Qn={}));var Xn=n(14716),ea={};ea.styleTagTransform=Ce(),ea.setAttributes=ve(),ea.insert=Ee().bind(null,"head"),ea.domAPI=pe(),ea.insertStyleElement=be(),de()(Xn.Z,ea),Xn.Z&&Xn.Z.locals&&Xn.Z.locals;var ta=function(){var e=(0,d.CR)(m.Z.useForm(),1)[0],t=(0,r.k6)(),n=(0,d.CR)((0,l.useState)(!0),2),a=n[0],i=n[1],o=(0,d.CR)((0,l.useState)(!1),2),c=o[0],u=o[1],y=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.PREFERENCES,(0,vn.t)("label.profiler-configuration"))}),[]),v=m.Z.useWatch("metricConfiguration",e),b=(0,l.useMemo)((function(){return(0,g.values)(qn).map((function(e){return{label:e,key:e,value:e,disabled:null==v?void 0:v.some((function(t){return(null==t?void 0:t.dataType)===e}))}}))}),[v]);return(0,l.useEffect)((function(){(0,d.mG)(void 0,void 0,void 0,(function(){var t,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:i(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,ie.nL)(le.Sd.ProfilerConfiguration)];case 2:return t=a.sent().data,e.setFieldsValue((0,g.isEmpty)(null===(n=null==t?void 0:t.config_value)||void 0===n?void 0:n.metricConfiguration)?$n.p7:null==t?void 0:t.config_value),[3,5];case 3:return a.sent(),[3,5];case 4:return i(!1),[7];case 5:return[2]}}))}))}),[]),a?l.createElement(N.Z,null):l.createElement(ne.Z,{pageTitle:(0,vn.t)("label.profiler-configuration")},l.createElement(p.Z,{align:"middle",className:"profiler-configuration-page-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:y})),l.createElement(f.Z,{span:24},l.createElement(J.Z,{data:{header:(0,vn.t)("label.profiler-configuration"),subHeader:(0,vn.t)("message.page-sub-header-for-profiler-configuration")}})),l.createElement(f.Z,{span:24},l.createElement(B.Z,{className:"profiler-configuration-form-item-container"},l.createElement(m.Z,{"data-testid":"profiler-config-form",form:e,id:"profiler-config",layout:"vertical",onFinish:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:u(!0),t=null===(a=e.metricConfiguration)||void 0===a?void 0:a.map((function(e){return(0,g.isEqual)(e.metrics,["all"])?(0,d.pi)((0,d.pi)({},e),{metrics:(0,g.values)(Qn)}):e})),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,(0,ie.Br)({config_type:le.Sd.ProfilerConfiguration,config_value:{metricConfiguration:t}})];case 2:return l.sent(),(0,O.XA)((0,vn.t)("server.update-entity-success",{entity:(0,vn.t)("label.profiler-configuration")})),[3,5];case 3:return n=l.sent(),(0,O.Eo)(n),[3,5];case 4:return u(!1),[7];case 5:return[2]}}))}))}},l.createElement(m.Z.List,{name:"metricConfiguration"},(function(t,n){var a=n.add,r=n.remove;return l.createElement(p.Z,{gutter:[16,16]},l.createElement(f.Z,{span:24},l.createElement(E.Z.Text,{className:"text-grey-muted"},(0,vn.t)("label.add-entity",{entity:(0,vn.t)("label.metric-configuration")}))),l.createElement(f.Z,{span:10},(0,vn.t)("label.data-type"),l.createElement("span",{className:"text-failure"},"*")),l.createElement(f.Z,{span:11},(0,vn.t)("label.metric-type")),l.createElement(f.Z,{span:3},(0,vn.t)("label.disable")),t.map((function(t){var n=t.key,a=t.name;return l.createElement(l.Fragment,{key:n},l.createElement(f.Z,{span:10},l.createElement(m.Z.Item,{name:[a,"dataType"],rules:[{required:!0,message:(0,vn.t)("message.field-text-is-required",{fieldText:(0,vn.t)("label.data-type")})}]},l.createElement(Tt.Z,{allowClear:!0,"data-testid":"data-type-select",options:b,placeholder:(0,vn.t)("label.select-field",{field:(0,vn.t)("label.data-type")})}))),l.createElement(f.Z,{span:11},l.createElement(m.Z.Item,{noStyle:!0,shouldUpdate:function(e,t){var n,l,r,i;return!(0,g.isEqual)(null===(l=null===(n=e.metricConfiguration)||void 0===n?void 0:n[a])||void 0===l?void 0:l.disabled,null===(i=null===(r=t.metricConfiguration)||void 0===r?void 0:r[a])||void 0===i?void 0:i.disabled)}},(function(){return l.createElement(m.Z.Item,{name:[a,"metrics"]},l.createElement(bn.Z,{allowClear:!0,treeCheckable:!0,"data-testid":"metric-type-select",disabled:e.getFieldValue(["metricConfiguration",a,"disabled"]),maxTagCount:5,placeholder:(0,vn.t)("label.select-field",{field:(0,vn.t)("label.metric-type")}),showCheckedStrategy:bn.Z.SHOW_PARENT,treeData:$n.bA}))}))),l.createElement(f.Z,{className:"d-flex justify-between",span:3},l.createElement(m.Z.Item,{name:[a,"disabled"],valuePropName:"checked"},l.createElement(Te.Z,{"data-testid":"disabled-switch"})),l.createElement(m.Z.Item,null,l.createElement(h.Z,{"data-testid":"remove-filter-"+a,icon:l.createElement(Kn.Z,null),size:"small",onClick:function(){return r(a)}}))))})),l.createElement(f.Z,{span:24},l.createElement(h.Z,{"data-testid":"add-fields",type:"primary",onClick:function(){return a()}},(0,vn.t)("label.add-entity",{entity:(0,vn.t)("label.field")}))))}))))),l.createElement(f.Z,{className:"d-flex justify-end gap-2",span:24},l.createElement(h.Z,{"data-testid":"cancel-button",onClick:function(){return t.goBack()}},(0,vn.t)("label.cancel")),l.createElement(h.Z,{"data-testid":"save-button",form:"profiler-config",htmlType:"submit",loading:c,type:"primary"},(0,vn.t)("label.save")))))},na=Tt.Z.Option,aa=(0,D.DW)(s.lx.ROLES),la=[{name:(0,vn.t)("label.setting-plural"),url:(0,D.si)()},{name:(0,vn.t)("label.role-plural"),url:aa},{name:(0,vn.t)("label.add-new-entity",{entity:(0,vn.t)("label.role")}),url:""}],ra=function(){var e=(0,r.k6)(),t=(0,d.CR)((0,l.useState)([]),2),n=t[0],a=t[1],s=(0,d.CR)((0,l.useState)(""),2),o=s[0],c=s[1],u=(0,d.CR)((0,l.useState)(""),2),p=u[0],f=u[1],y=(0,d.CR)((0,l.useState)([]),2),b=y[0],C=y[1],Z=(0,d.CR)((0,l.useState)(!1),2),N=Z[0],I=Z[1];return(0,l.useEffect)((function(){(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,hn.Ko)(""+(Ge.GB.OWNERS,Ge.GB.LOCATION,Ge.GB.TEAMS,Ge.GB.ROLES),void 0,void 0,100)];case 1:return e=n.sent(),a(e.data||[]),[3,3];case 2:return t=n.sent(),(0,O.Eo)(t),[3,3];case 3:return[2]}}))}))}),[]),l.createElement(S.Z,{className:"content-height-with-resizable-panel",firstPanel:{className:"content-resizable-panel-container",children:l.createElement("div",{className:"max-width-md w-9/10 service-form-container","data-testid":"add-role-container"},l.createElement(x.Z,{titleLinks:la}),l.createElement("div",{className:"m-t-md"},l.createElement(E.Z.Paragraph,{className:"text-base","data-testid":"form-title"},(0,vn.t)("label.add-new-entity",{entity:(0,vn.t)("label.role")})),l.createElement(m.Z,{"data-testid":"role-form",id:"role-form",layout:"vertical",onFinish:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:I(!0),t={name:(0,g.trim)(o),description:p,policies:b.map((function(e){return e}))},l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,(0,hn._d)(t)];case 2:return(n=l.sent())&&e.push((0,D.Uy)(n.fullyQualifiedName||"")),[3,5];case 3:return a=l.sent(),(0,O.Eo)((0,at.B)(a,i.c9.alreadyExist)?(0,vn.t)("server.entity-already-exist",{entity:(0,vn.t)("label.role"),entityPlural:(0,vn.t)("label.role-lowercase-plural"),name:t.name}):a),[3,5];case 4:return I(!1),[7];case 5:return[2]}}))}))}},l.createElement(m.Z.Item,{label:(0,vn.t)("label.name")+":",name:"name",rules:w.m},l.createElement(v.Z,{"data-testid":"name",placeholder:(0,vn.t)("label.role-name"),type:"text",value:o,onChange:function(e){return c(e.target.value)}})),l.createElement(m.Z.Item,{label:(0,vn.t)("label.description")+":",name:"description"},l.createElement(T.Z,{height:"200px",initialValue:p,placeHolder:(0,vn.t)("message.write-your-description"),style:{margin:0},onTextChange:function(e){return f(e)}})),l.createElement(m.Z.Item,{label:(0,vn.t)("label.select-a-policy")+":",name:"policies",rules:[{required:!0,message:(0,vn.t)("message.at-least-one-policy")}]},l.createElement(Tt.Z,{"data-testid":"policies",mode:"multiple",placeholder:(0,vn.t)("label.select-a-policy"),value:b,onChange:function(e){return C(e)}},n.map((function(e){return l.createElement(na,{key:e.fullyQualifiedName},e.displayName||e.name)})))),l.createElement(j.Z,{align:"center",className:"w-full justify-end"},l.createElement(h.Z,{"data-testid":"cancel-btn",type:"link",onClick:function(){e.push(aa)}},(0,vn.t)("label.cancel")),l.createElement(h.Z,{"data-testid":"submit-btn",form:"role-form",htmlType:"submit",loading:N,type:"primary"},(0,vn.t)("label.submit")))))),minWidth:700,flex:.7},pageTitle:(0,vn.t)("label.add-new-entity",{entity:(0,vn.t)("label.role")}),secondPanel:{children:l.createElement(l.Fragment,null,l.createElement(E.Z.Paragraph,{className:"text-base font-medium"},(0,vn.t)("label.add-entity",{entity:(0,vn.t)("label.role")})),l.createElement(E.Z.Text,null,(0,vn.t)("message.add-role-message"))),className:"p-md p-t-xl content-resizable-panel-container",minWidth:400,flex:.3}})},ia=n(76570),sa=n(79508),oa=n(94184),ca=n.n(oa),ua=n(66093),da={};da.styleTagTransform=Ce(),da.setAttributes=ve(),da.insert=Ee().bind(null,"head"),da.domAPI=pe(),da.insertStyleElement=be(),de()(ua.Z,da),ua.Z&&ua.Z.locals&&ua.Z.locals;var ma=function(e){var t=e.isOpen,n=e.onSave,a=e.onCancel,r=e.title,i=e.type,s=e.selectedKeys,o=e.isModalLoading,c=(0,C.$)().t,u=(0,d.CR)((0,l.useState)([]),2),m=u[0],E=u[1],y=(0,d.CR)((0,l.useState)([]),2),h=y[0],b=y[1],Z=(0,d.CR)((0,l.useState)(!1),2),S=Z[0],T=Z[1],x=(0,d.CR)((0,l.useState)(s),2),w=x[0],I=x[1];return(0,l.useEffect)((function(){(0,d.mG)(void 0,void 0,void 0,(function(){var e,t,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:T(!0),a.label=1;case 1:switch(a.trys.push([1,8,9,10]),e={data:[]},i){case Ge.py.POLICY:return[3,2];case Ge.py.ROLE:return[3,4]}return[3,6];case 2:return[4,(0,hn.Ko)("",void 0,void 0,100)];case 3:return e=a.sent(),[3,7];case 4:return[4,(0,hn.F3)("",void 0,void 0,!1,100)];case 5:return e=a.sent(),[3,7];case 6:return[3,7];case 7:return t=(e.data||[]).map((function(e){return{id:e.id,name:e.name,displayName:e.displayName,type:i,description:e.description}})),E(t),b(t),[3,10];case 8:return n=a.sent(),(0,O.Eo)(n),[3,10];case 9:return T(!1),[7];case 10:return[2]}}))}))}),[]),l.createElement(ft.Z,{centered:!0,className:"ant-attribute-modal",closable:!1,confirmLoading:o,"data-testid":"modal-container",maskClosable:!1,okText:"Submit",open:t,title:l.createElement("span",{"data-testid":"modal-title"},r," ",l.createElement("span",{className:"text-grey-muted text-sm"},"("+w.length+"/"+m.length+" selected)")),width:750,onCancel:a,onOk:function(){return n(w)}},S?l.createElement(N.Z,null):l.createElement(l.Fragment,null,l.createElement(p.Z,{className:"ant-search-box-row"},l.createElement(f.Z,{span:24},l.createElement(v.Z,{"data-testid":"search-input",placeholder:c("label.search-entity",{entity:i}),prefix:l.createElement(ia.Z,{style:{color:"#37352F4D"}}),onChange:function(e){return t=e.target.value,void b(t?m.filter((function(e){var n,a,l;return(null===(n=e.name)||void 0===n?void 0:n.includes(t))||(null===(a=e.displayName)||void 0===a?void 0:a.includes(t))||(null===(l=e.description)||void 0===l?void 0:l.includes(t))})):m);var t}}))),(0,g.isEmpty)(h)?l.createElement(xe.Z,{className:"mt-0-important p-y-lg",type:Re.Wx.FILTER}):h.map((function(e){return l.createElement(p.Z,{className:ca()({selected:w.includes(e.id)}),"data-testid":"policy-row",gutter:[16,16],key:e.id,onClick:function(){return t=e.id,n=w.includes(t),void I(n?function(e){return e.filter((function(e){return e!==t}))}:function(e){return(0,d.ev)((0,d.ev)([],(0,d.CR)(e)),[t])});var t,n}},l.createElement(f.Z,{span:6},(0,Q.C_)(e)),l.createElement(f.Z,{span:16},l.createElement(Ve.Z,{markdown:e.description||""})),l.createElement(f.Z,{span:2},w.includes(e.id)&&l.createElement(sa.Z,{className:"text-primary"})))}))))},pa=n(3878),fa={};fa.styleTagTransform=Ce(),fa.setAttributes=ve(),fa.insert=Ee().bind(null,"head"),fa.domAPI=pe(),fa.insertStyleElement=be(),de()(pa.Z,fa),pa.Z&&pa.Z.locals&&pa.Z.locals;var Ea=n(25213),ya=function(e){var t=e.list,n=e.type,a=e.onDelete,r=e.hasAccess,s=(0,C.$)().t,o=(0,l.useMemo)((function(){return[{title:s("label.name"),dataIndex:"name",width:"200px",key:"name",render:function(e,t){var a="";switch(n){case"policy":a=(0,D.Hr)(t.fullyQualifiedName||"");break;case"team":a=(0,D.KH)(t.fullyQualifiedName||"");break;case"user":a=(0,i.ZG)(t.fullyQualifiedName||"")}return l.createElement(H.Link,{className:"link-hover","data-testid":"entity-name",to:a},(0,Q.C_)(t))}},{title:s("label.description"),dataIndex:"description",key:"description",render:function(e,t){return l.createElement(Ve.Z,{markdown:(null==t?void 0:t.description)||""})}},{title:s("label.action-plural"),dataIndex:"actions",width:"80px",key:"actions",render:function(e,t){return l.createElement(Ue.Z,{title:s(r?"label.remove":"message.no-permission-for-action")},l.createElement(h.Z,{"data-testid":"remove-action-"+(0,Q.C_)(t),disabled:!r,type:"text",onClick:function(){return a(t)}},l.createElement(Pe.Z,{className:"align-middle",component:nn.ReactComponent,style:{fontSize:"16px"}})))}}]}),[]);return l.createElement(Ea.Z,{bordered:!0,className:"list-table",columns:o,dataSource:t,pagination:!1,rowKey:"id",size:"small"})},va=st.Z.TabPane,ha=function(){var e,t,n,a=(0,r.k6)(),i=(0,C.$)().t,o=(0,M.f)().fqn,c=(0,d.CR)((0,l.useState)({}),2),u=c[0],m=c[1],p=(0,d.CR)((0,l.useState)(!1),2),f=p[0],y=p[1],v=(0,d.CR)((0,l.useState)(!1),2),b=v[0],Z=v[1],S=(0,d.CR)((0,l.useState)(!1),2),T=S[0],w=S[1],I=(0,d.CR)((0,l.useState)(),2),A=I[0],R=I[1],k=(0,d.CR)((0,l.useState)(),2),L=k[0],P=k[1],U=(0,D.si)(s.CZ.ACCESS,s.lx.ROLES),z=(0,l.useMemo)((function(){return(0,Q.C_)(u)}),[u]),G=(0,l.useMemo)((function(){return[{name:i("label.role-plural"),url:U},{name:z,url:""}]}),[U,z]);return(0,l.useEffect)((function(){(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:y(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,hn.n5)(o,"policies,teams,users")];case 2:return e=n.sent(),m(null!=e?e:{}),[3,5];case 3:return t=n.sent(),(0,O.Eo)(t),[3,5];case 4:return y(!1),[7];case 5:return[2]}}))}))}),[o]),f?l.createElement(N.Z,null):l.createElement(ne.Z,{pageTitle:i("label.role-plural")},l.createElement("div",{className:"page-container","data-testid":"role-details-container"},l.createElement(x.Z,{titleLinks:G}),l.createElement(l.Fragment,null,(0,g.isEmpty)(u)?l.createElement(xe.Z,{type:Re.Wx.CUSTOM},l.createElement("div",{className:"text-center"},l.createElement("p",null,i("message.no-entity-found-for-name",{entity:i("label.role"),name:o})),l.createElement(h.Z,{ghost:!0,className:"m-t-sm",type:"primary",onClick:function(){return a.push(U)}},i("label.go-back")))):l.createElement("div",{className:"roles-detail","data-testid":"role-details"},l.createElement(E.Z.Title,{className:"m-b-0 m-t-xs","data-testid":"heading",level:5},z),l.createElement(Kt.Z,{hasEditAccess:!0,className:"m-y-md",description:u.description||"",entityFqn:u.fullyQualifiedName,entityName:z,entityType:Ge.py.ROLE,isEdit:T,showCommentsIcon:!1,onCancel:function(){return w(!1)},onDescriptionEdit:function(){return w(!0)},onDescriptionUpdate:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:t=(0,ot.qu)(u,(0,d.pi)((0,d.pi)({},u),{description:e})),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,(0,hn.sZ)(t,u.id)];case 2:return n=l.sent(),m((0,d.pi)((0,d.pi)({},u),{description:n.description})),[3,5];case 3:return a=l.sent(),(0,O.Eo)(a),[3,5];case 4:return w(!1),[7];case 5:return[2]}}))}))}}),l.createElement(st.Z,{"data-testid":"tabs",defaultActiveKey:"policies"},l.createElement(va,{key:"policies",tab:i("label.policy-plural")},l.createElement(j.Z,{className:"role-detail-tab w-full",direction:"vertical"},l.createElement(h.Z,{"data-testid":"add-policy",type:"primary",onClick:function(){return P({type:Ge.py.POLICY,selectedData:u.policies||[]})}},i("label.add-entity",{entity:i("label.policy")})),l.createElement(ya,{hasAccess:!0,list:null!==(e=u.policies)&&void 0!==e?e:[],type:"policy",onDelete:function(e){return R({record:e,attribute:"policies"})}}))),l.createElement(va,{key:"teams",tab:i("label.team-plural")},l.createElement(ya,{hasAccess:!0,list:null!==(t=u.teams)&&void 0!==t?t:[],type:"team",onDelete:function(e){return R({record:e,attribute:"teams"})}})),l.createElement(va,{key:"users",tab:i("label.user-plural")},l.createElement(ya,{hasAccess:!0,list:null!==(n=u.users)&&void 0!==n?n:[],type:"user",onDelete:function(e){return R({record:e,attribute:"users"})}}))))),A&&l.createElement(ft.Z,{centered:!0,closable:!1,confirmLoading:b,maskClosable:!1,okText:i("label.confirm"),open:!(0,g.isUndefined)(A.record),title:i("label.remove-entity",{entity:(0,Q.C_)(A.record)})+" "+i("label.from-lowercase")+" "+z,onCancel:function(){return R(void 0)},onOk:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(e){switch(e.label){case 0:return[4,(t=A.record,n=A.attribute,(0,d.mG)(void 0,void 0,void 0,(function(){var e,a,l,r,i,s,o;return(0,d.Jh)(this,(function(c){switch(c.label){case 0:return Z(!0),"teams"!==n?[3,1]:(function(e){(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l,r,i,s;return(0,d.Jh)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,4,5]),[4,(0,Pn.Xv)(e.fullyQualifiedName||"",{fields:Ge.GB.DEFAULT_ROLES})];case 1:return t=o.sent(),n=(null!==(i=t.defaultRoles)&&void 0!==i?i:[]).filter((function(e){return e.id!==u.id})),a=(0,ot.qu)(t,(0,d.pi)((0,d.pi)({},t),{defaultRoles:n})),[4,(0,Pn.Cp)(t.id,a)];case 2:return o.sent()&&(l=(null!==(s=u.teams)&&void 0!==s?s:[]).filter((function(t){return t.id!==e.id})),m((function(e){return(0,d.pi)((0,d.pi)({},e),{teams:l})}))),[3,5];case 3:return r=o.sent(),(0,O.Eo)(r),[3,5];case 4:return Z(!1),[7];case 5:return[2]}}))}))}(t),[3,7]);case 1:return"users"!==n?[3,2]:(function(e){(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l,r,i,s;return(0,d.Jh)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,4,5]),[4,(0,an.gs)(e.fullyQualifiedName||"",{fields:Ge.GB.ROLES})];case 1:return t=o.sent(),n=(null!==(i=t.roles)&&void 0!==i?i:[]).filter((function(e){return e.id!==u.id})),a=(0,ot.qu)(t,(0,d.pi)((0,d.pi)({},t),{roles:n})),[4,(0,an.f_)(t.id,a)];case 2:return o.sent()&&(l=(null!==(s=u.users)&&void 0!==s?s:[]).filter((function(t){return t.id!==e.id})),m((function(e){return(0,d.pi)((0,d.pi)({},e),{users:l})}))),[3,5];case 3:return r=o.sent(),(0,O.Eo)(r),[3,5];case 4:return Z(!1),[7];case 5:return[2]}}))}))}(t),[3,7]);case 2:e=null!==(o=u[n])&&void 0!==o?o:[],a=e.filter((function(e){return e.id!==t.id})),l=(0,ot.qu)(u,(0,d.pi)((0,d.pi)({},u),((s={})[n]=a,s))),c.label=3;case 3:return c.trys.push([3,5,6,7]),[4,(0,hn.sZ)(l,u.id)];case 4:return r=c.sent(),m(r),[3,7];case 5:return i=c.sent(),(0,O.Eo)(i),[3,7];case 6:return Z(!1),[7];case 7:return[2]}}))})))];case 1:return e.sent(),R(void 0),[2]}var t,n}))}))}},l.createElement(E.Z.Text,null,i("message.are-you-sure-you-want-to-remove-child-from-parent",{child:(0,Q.C_)(A.record),parent:z}))),L&&l.createElement(ma,{isModalLoading:b,isOpen:!(0,g.isUndefined)(L),selectedKeys:L.selectedData.map((function(e){return e.id})),title:i("label.add")+" "+L.type,type:L.type,onCancel:function(){return P(void 0)},onSave:function(e){return t=e,(0,d.mG)(void 0,void 0,void 0,(function(){var e,n,a,l;return(0,d.Jh)(this,(function(r){switch(r.label){case 0:if(!L)return[3,5];Z(!0),e=t.map((function(e){var t=L.selectedData.find((function(t){return t.id===e}));return t||{id:e,type:L.type}})),n=(0,ot.qu)(u,(0,d.pi)((0,d.pi)({},u),{policies:e})),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,(0,hn.sZ)(n,u.id)];case 2:return a=r.sent(),m(a),P(void 0),[3,5];case 3:return l=r.sent(),(0,O.Eo)(l),[3,5];case 4:return Z(!1),[7];case 5:return[2]}}))}));var t}})))},ba=n(9591),ga={};ga.styleTagTransform=Ce(),ga.setAttributes=ve(),ga.insert=Ee().bind(null,"head"),ga.domAPI=pe(),ga.insertStyleElement=be(),de()(ba.Z,ga),ba.Z&&ba.Z.locals&&ba.Z.locals;var Ca,Za=function(){var e=(0,r.k6)(),t=(0,C.$)().t,n=(0,d.CR)((0,l.useState)([]),2),a=n[0],u=n[1],m=(0,d.CR)((0,l.useState)(!1),2),E=m[0],y=m[1],v=(0,d.CR)((0,l.useState)(),2),b=v[0],Z=v[1],N=(0,Le.C)(i.Ou),S=N.currentPage,T=N.pageSize,w=N.paging,I=N.handlePageChange,A=N.handlePageSizeChange,R=N.handlePagingChange,M=N.showPagination,k=(0,o.BL)().permissions,L=(0,l.useMemo)((function(){return!(0,g.isEmpty)(k)&&(0,bt.P_)(Vn.OX.Create,c.A.ROLE,k)}),[k]),P=(0,l.useMemo)((function(){return!(0,g.isEmpty)(k)&&(null===bt.NE||void 0===bt.NE?void 0:bt.NE.hasViewPermissions(c.A.POLICY,k))}),[k]),U=(0,l.useMemo)((function(){return!(0,g.isEmpty)(k)&&(0,bt.P_)(Vn.OX.Delete,c.A.ROLE,k)}),[k]),z=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.ACCESS,t("label.role-plural"))}),[]),G=(0,l.useMemo)((function(){return[{title:t("label.name"),dataIndex:"name",width:"200px",key:"name",render:function(e,t){var n;return l.createElement(H.Link,{className:"link-hover","data-testid":"role-name",to:(0,D.Uy)(null!==(n=t.fullyQualifiedName)&&void 0!==n?n:"")},(0,Q.C_)(t))}},{title:t("label.description"),dataIndex:"description",key:"description",render:function(e,t){return(0,g.isEmpty)(null==t?void 0:t.description)?i.lH:l.createElement(Ve.Z,{markdown:(null==t?void 0:t.description)||""})}},{title:t("label.policy-plural"),dataIndex:"policies",width:"250px",key:"policies",render:function(e,t){var n,a,r,i=null!==(a=null===(n=t.policies)||void 0===n?void 0:n.length)&&void 0!==a?a:0,s=i>bt.YD;return(null===(r=t.policies)||void 0===r?void 0:r.length)?l.createElement(j.Z,{wrap:!0,"data-testid":"policy-link",size:4},t.policies.slice(0,bt.YD).map((function(e){return P?l.createElement(H.Link,{key:(0,g.uniqueId)(),to:(0,D.Hr)(e.fullyQualifiedName||"")},(0,Q.C_)(e)):l.createElement(Ue.Z,{key:(0,g.uniqueId)(),title:dt._D},(0,Q.C_)(e))})),s&&l.createElement(Fn.Z,{className:"cursor-pointer",content:l.createElement(j.Z,{wrap:!0,size:4},t.policies.slice(bt.YD).map((function(e){return P?l.createElement(H.Link,{key:(0,g.uniqueId)(),to:(0,D.Hr)(e.fullyQualifiedName||"")},(0,Q.C_)(e)):l.createElement(Ue.Z,{key:(0,g.uniqueId)(),title:dt._D},(0,Q.C_)(e))}))),overlayClassName:"w-40 text-center",trigger:"click"},l.createElement(Hn.Z,{className:"m-l-xss","data-testid":"plus-more-count"},"+"+(i-bt.YD)+" more"))):"-- "}},{title:t("label.action-plural"),dataIndex:"actions",width:"80px",align:"center",key:"actions",render:function(e,n){return l.createElement(Ue.Z,{placement:"left",title:U?t("label.delete-entity",{entity:t("label.role-plural")}):dt.oH},l.createElement(h.Z,{"data-testid":"delete-action-"+(0,Q.C_)(n),disabled:!U,icon:l.createElement(W.ReactComponent,{name:t("label.delete"),width:"16px"}),type:"text",onClick:function(){return Z(n)}}))}}]}),[]),_=function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:y(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(0,hn.F3)("policies",null==e?void 0:e.after,null==e?void 0:e.before,void 0,T)];case 2:return t=a.sent(),u(t.data||[]),R(t.paging),[3,5];case 3:return n=a.sent(),(0,O.Eo)(n),[3,5];case 4:return y(!1),[7];case 5:return[2]}}))}))},B=(0,l.useCallback)((function(){_()}),[_]),F=function(){e.push(i.Z6.ADD_ROLE)};return(0,l.useEffect)((function(){_()}),[T]),l.createElement(ne.Z,{pageTitle:t("label.role-plural")},l.createElement(p.Z,{className:"roles-list-container page-container","data-testid":"roles-list-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:z})),l.createElement(f.Z,{span:24},l.createElement(j.Z,{className:"w-full justify-between"},l.createElement(J.Z,{data:Ae.j.ROLES}),L&&l.createElement(h.Z,{"data-testid":"add-role",type:"primary",onClick:F},t("label.add-entity",{entity:t("label.role")})))),l.createElement(f.Z,{span:24},l.createElement(Je.Z,{bordered:!0,className:"roles-list-table",columns:G,"data-testid":"roles-list-table",dataSource:a,loading:E,locale:{emptyText:l.createElement(xe.Z,{heading:t("label.role"),permission:L,type:Re.Wx.CREATE,onClick:F})},pagination:!1,rowKey:"name",size:"small"}),b&&l.createElement(Fe.Z,{afterDeleteAction:B,allowSoftDelete:!1,deleteMessage:t("message.are-you-sure-delete-entity",{entity:(0,Q.C_)(b)}),entityId:b.id,entityName:(0,Q.C_)(b),entityType:Ge.py.ROLE,visible:!(0,g.isUndefined)(b),onCancel:function(){return Z(void 0)}})),l.createElement(f.Z,{span:24},M&&l.createElement(we.Z,{currentPage:S,pageSize:T,paging:w,pagingHandler:function(e){var t,n=e.currentPage,a=e.cursorType;I(n),a&&w&&_(((t={})[a]=w[a],t.total=w.total,t))},onShowSizeChange:A}))))},Na=n(80129),Sa=n.n(Na),Ta=n(17405),xa=n(5302),wa=n(19894),Ia=n(97354),Aa=n(75838),Ra=n(65898),Ma=n(8013),ka=n(15399),La=function(e){var t=e.serviceName,n=e.className,a=(0,R.N)().theme,r=(0,d.CR)((0,l.useState)([]),2),i=r[0],s=r[1],o=(0,wa.w)(),c=o.isAirflowAvailable,u=o.isFetchingStatus,m=(0,d.CR)((0,l.useState)([]),2),E=m[0],y=m[1],v=(0,d.CR)((0,l.useState)([]),2),b=v[0],Z=v[1],S=(0,d.CR)((0,l.useState)(!1),2),T=S[0],x=S[1],w=(0,d.CR)((0,l.useState)(!1),2),I=w[0],A=w[1],M=(0,d.CR)((0,l.useState)(),2),k=M[0],L=M[1],D=(0,Le.C)(),P=D.handlePageChange,U=D.paging,z=D.handlePagingChange,G=D.pageSize,_=(0,C.$)().t,B=(0,l.useCallback)((function(e){return l.createElement(Ta.Z,{style:{color:e?a.primaryColor:void 0}})}),[a]),j=(0,l.useMemo)((function(){return[{title:_("label.type"),dataIndex:"pipelineType",key:"pipelineType",filterDropdown:Ma.x,filterIcon:B,filters:(0,g.map)(xa.Hz,(function(e){return{text:(0,g.startCase)(e),value:e}})),filtered:!(0,g.isNil)(k),filteredValue:k}]}),[B,k]),F=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,t,n,a,l;return(0,d.Jh)(this,(function(r){switch(r.label){case 0:e=null!==(a=null==i?void 0:i.filter((function(e){return e.fullyQualifiedName&&b.indexOf(e.fullyQualifiedName)>-1})))&&void 0!==a?a:[],t=null===(l=null!=e?e:[])||void 0===l?void 0:l.map((function(e){var t;return(0,Ia.aw)(null!==(t=e.id)&&void 0!==t?t:"")})),x(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,Promise.all(t)];case 2:return r.sent(),(0,O.XA)(_("label.pipeline-plural")+" "+_("label.re-deploy")+" "+_("label.successfully-lowercase")),[3,5];case 3:return n=r.sent(),(0,O.Eo)(n,_("server.ingestion-workflow-operation-error",{operation:"updating",displayName:""})),[3,5];case 4:return L(void 0),Z([]),x(!1),[7];case 5:return[2]}}))}))}),[i,b]),H=(0,l.useCallback)((function(e){var n=e.paging,a=e.pipelineType,l=e.limit;return(0,d.mG)(void 0,void 0,void 0,(function(){var e,r,i;return(0,d.Jh)(this,(function(o){switch(o.label){case 0:A(!0),o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,(0,Ia.Pj)({arrQueryFields:[Ge.GB.OWNERS],serviceType:"testSuites"===t?Ge.py.TEST_SUITE:(0,Aa.Yz)(t),paging:n,pipelineType:a,limit:l})];case 2:return e=o.sent(),r=e.data,i=e.paging,s(r),z(i),[3,5];case 3:return o.sent(),[3,5];case 4:return A(!1),[7];case 5:return[2]}}))}))}),[t]),V=(0,l.useCallback)((function(e){var t,n=e.cursorType,a=e.currentPage;n&&(H({paging:(t={},t[n]=U[n],t),limit:G}),P(a))}),[H,U,P]);(0,l.useEffect)((function(){c&&H({limit:G})}),[t,c]);var W=(0,l.useCallback)((function(e,t){var n=t.pipelineType;L(n),H({pipelineType:n,limit:G})}),[H]),J=(0,l.useCallback)((function(e,t){y(t),Z(e)}),[]),q=(0,l.useMemo)((function(){return{type:"checkbox",onChange:J,getCheckboxProps:function(e){return{name:e.fullyQualifiedName}},selectedRowKeys:b}}),[J,b]);return u?l.createElement(N.Z,null):c?l.createElement(p.Z,{className:n,gutter:[16,16]},l.createElement(f.Z,{className:"text-right",span:24},l.createElement(h.Z,{"data-testid":"bulk-re-deploy-button",disabled:0===(null==E?void 0:E.length),loading:T,type:"primary",onClick:F},_("label.re-deploy"))),l.createElement(f.Z,{span:24},l.createElement(ka.Z,{enableActions:!1,extraTableProps:{rowSelection:q,onChange:W},ingestionData:i,ingestionPagingInfo:D,isLoading:I,pipelineTypeColumnObj:j,serviceName:t,onPageChange:V}))):l.createElement(Ra.Z,null)},Da=n(55846),Oa=n(22653),Pa=n(89204),Ua=n(99166),za=n(55742),Ga=n(70312),_a=n(36796);!function(e){e[e.CARD=1]="CARD",e[e.TABLE=2]="TABLE"}(Ca||(Ca={}));var Ba,ja=function(e){var t=e.tableProps,n=e.cardRenderer,a=e.searchProps,r=a.search,i=a.onSearch,s=e.handleDeletedSwitchChange,o=e.deleted,c=void 0!==o&&o,u=(0,d.CR)((0,l.useState)(Ca.TABLE),2),m=u[0],y=u[1],v=(0,C.$)().t,h=(0,l.useMemo)((function(){var e,a;return(0,g.isEmpty)(t.dataSource)?null===(e=t.locale)||void 0===e?void 0:e.emptyText:l.createElement(p.Z,{gutter:[16,16]},(null!==(a=t.dataSource)&&void 0!==a?a:[]).map((function(e){return n(e)})))}),[t,n]);return l.createElement(p.Z,{gutter:[16,16]},l.createElement(f.Z,{span:10},l.createElement(We.Z,{removeMargin:!0,placeholder:v("label.search-entity",{entity:v("label.service-plural")}),searchValue:r,onSearch:i})),l.createElement(f.Z,{className:"text-right",span:14},l.createElement(j.Z,{align:"center"},!(0,g.isUndefined)(s)&&l.createElement("span",null,l.createElement(Te.Z,{checked:c,"data-testid":"show-deleted-switch",onChange:s}),l.createElement(E.Z.Text,{className:"m-l-xs"},v("label.deleted"))),l.createElement(za.ZP.Group,{value:m,onChange:function(e){return y(e.target.value)}},l.createElement(za.ZP.Button,{value:Ca.CARD},l.createElement(K.Z,{component:Ga.ReactComponent,"data-testid":"grid"})),l.createElement(za.ZP.Button,{value:Ca.TABLE},l.createElement(K.Z,{component:_a.ReactComponent,"data-testid":"list"}))))),l.createElement(f.Z,{span:24},m===Ca.TABLE?l.createElement(Je.Z,(0,d.pi)({},t)):h))},Fa=n(50404),Ha=function(e){var t=e.serviceName,n=(0,R.N)().theme,a=(0,C.$)().t,s=(0,wa.w)(),c=s.isFetchingStatus,u=s.platform,m=(0,r.k6)(),y=function(){m.push((0,D.C1)(t))},v=(0,d.CR)((0,l.useState)(!0),2),b=v[0],Z=v[1],N=(0,d.CR)((0,l.useState)([]),2),S=N[0],T=N[1],x=(0,d.CR)((0,l.useState)(""),2),w=x[0],I=x[1],A=(0,d.CR)((0,l.useState)(),2),M=A[0],k=A[1],L=(0,Le.C)(),P=L.paging,U=L.handlePagingChange,z=L.currentPage,G=L.handlePageChange,_=L.pageSize,B=L.handlePageSizeChange,F=L.showPagination,V=(0,d.CR)((0,l.useState)(!1),2),W=V[0],q=V[1],Y=(0,o.BL)().permissions,K=(0,l.useMemo)((function(){return u===i.rr}),[u]),$=(0,l.useMemo)((function(){switch(I(""),k([]),t){case Pa.u.DATABASE_SERVICES:return Oa.W.DATABASE_SERVICE;case Pa.u.DASHBOARD_SERVICES:return Oa.W.DASHBOARD_SERVICE;case Pa.u.MESSAGING_SERVICES:return Oa.W.MESSAGING_SERVICE;case Pa.u.PIPELINE_SERVICES:return Oa.W.PIPELINE_SERVICE;case Pa.u.ML_MODEL_SERVICES:return Oa.W.ML_MODEL_SERVICE;case Pa.u.STORAGE_SERVICES:return Oa.W.STORAGE_SERVICE;case Pa.u.SEARCH_SERVICES:return Oa.W.SEARCH_SERVICE;case Pa.u.API_SERVICES:return Oa.W.API_SERVICE_INDEX}return Oa.W.DATABASE_SERVICE}),[t]),X=(0,l.useCallback)((function(e){var n=e.search,l=e.currentPage,r=e.after,s=e.before,o=e.filters,c=e.limit;return(0,d.mG)(void 0,void 0,void 0,(function(){var e,u,m,p,f,E,y,v;return(0,d.Jh)(this,(function(d){switch(d.label){case 0:Z(!0),d.label=1;case 1:return d.trys.push([1,6,7,8]),e=[],!n&&(0,g.isEmpty)(o)?[3,3]:[4,(0,Ua.u8)({search:n,searchIndex:$,limit:null!=c?c:_,currentPage:l,filters:o,deleted:W})];case 2:return u=d.sent().hits,m=u.hits,p=u.total,e=m.map((function(e){return e._source})),U({total:p.value}),[3,5];case 3:return[4,(0,Ua.U2)({serviceName:t,limit:null!=c?c:_,after:r,before:s,include:W?Me.y.Deleted:Me.y.NonDeleted})];case 4:f=d.sent(),E=f.data,y=f.paging,e=E,U(y),d.label=5;case 5:return T(t===Pa.u.METADATA_SERVICES?e.filter((function(e){return e.fullyQualifiedName!==Da.rn})):e),[3,8];case 6:return v=d.sent(),T([]),U(i.OQ),(0,O.Eo)(v,a("server.entity-fetch-error",{entity:a("label.service-plural")})),[3,8];case 7:return Z(!1),[7];case 8:return[2]}}))}))}),[$,t,W]),ee=(0,l.useMemo)((function(){return!(0,g.isEmpty)(Y)&&(0,bt.P_)(Vn.OX.Create,(0,Aa.rq)(t),Y)}),[Y,t]),te=(0,l.useCallback)((function(){return q((function(e){return!e}))}),[]),ne=(0,l.useCallback)((function(){switch(t){case Pa.u.DATABASE_SERVICES:return Ae.j.DATABASES_SERVICES;case Pa.u.DASHBOARD_SERVICES:return Ae.j.DASHBOARD_SERVICES;case Pa.u.MESSAGING_SERVICES:return Ae.j.MESSAGING_SERVICES;case Pa.u.METADATA_SERVICES:return Ae.j.METADATA_SERVICES;case Pa.u.ML_MODEL_SERVICES:return Ae.j.ML_MODELS_SERVICES;case Pa.u.PIPELINE_SERVICES:return Ae.j.PIPELINES_SERVICES;case Pa.u.STORAGE_SERVICES:return Ae.j.STORAGE_SERVICES;case Pa.u.SEARCH_SERVICES:return Ae.j.SEARCH_SERVICES;case Pa.u.API_SERVICES:return Ae.j.API_SERVICES;default:return Ae.j.DATABASES_SERVICES}}),[t]),ae=(0,l.useMemo)((function(){return ee&&(0,g.isEmpty)(w)&&(0,g.isEmpty)(M)?l.createElement(xe.Z,{className:"p-lg",doc:ze.lS,heading:Da.N9[t],permission:ee,type:Re.Wx.CREATE,onClick:y}):l.createElement(xe.Z,{className:"mt-24",type:Re.Wx.NO_DATA})}),[ee,Da.N9,t,w,M,ee,y]),le=(0,l.useMemo)((function(){return(0,g.map)((0,Aa.u0)(t),(function(e){return{text:(0,g.startCase)(e),value:e}}))}),[t]),re=[{title:a("label.name"),dataIndex:"name",key:"name",width:200,render:function(e,n){var a;return l.createElement("div",{className:"d-flex gap-2 items-center"},(0,at.Y9)(n.serviceType||"","w-4"),l.createElement(H.Link,{className:"max-two-lines","data-testid":"service-name-"+e,to:(0,i.LE)(null!==(a=n.fullyQualifiedName)&&void 0!==a?a:n.name,t)},(0,Q.C_)(n)))}},{title:a("label.description"),dataIndex:"description",key:"description",width:200,render:function(e){return e?l.createElement(Ve.Z,{className:"max-two-lines",enableSeeMoreVariant:!1,markdown:e}):l.createElement("span",{className:"text-grey-muted"},a("label.no-description"))}},{title:a("label.type"),dataIndex:"serviceType",key:"serviceType",width:200,filterDropdown:Ma.x,filterIcon:function(e){return l.createElement(Ta.Z,{style:{color:e?n.primaryColor:void 0}})},filtered:!(0,g.isEmpty)(M),filteredValue:M,filters:le,render:function(e){return l.createElement("span",{className:"font-normal text-grey-body"},e)}},{title:a("label.owner"),dataIndex:"owners",key:"owners",width:200,render:function(e){return l.createElement(Fa.V,{owners:e})}}],ie=(0,l.useCallback)((function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(t){return I(e),[2]}))}))}),[X]);return(0,l.useEffect)((function(){X({search:w,limit:_,filters:(null==M?void 0:M.length)?"("+M.map((function(e){return"serviceType:"+e})).join(" ")+")":void 0})}),[$,_,t,w,M,W]),l.createElement(p.Z,{className:"justify-center m-b-md","data-testid":"services-container",gutter:[16,16]},l.createElement(f.Z,{span:24},l.createElement(j.Z,{className:"w-full justify-between m-b-lg","data-testid":"header"},l.createElement(J.Z,{data:ne()}),c?l.createElement(Mt.Z,{size:"default"}):l.createElement(Ue.Z,{placement:"left",title:ee?a("label.add-entity",{entity:a("label.service")}):dt.oH},ee&&!K&&l.createElement(ke.Z,{resource:"dataAssets"},l.createElement(h.Z,{className:"m-b-xs","data-testid":"add-service-button",size:"middle",type:"primary",onClick:y},a("label.add-new-entity",{entity:a("label.service")})))))),l.createElement(f.Z,{span:24},l.createElement(ja,{cardRenderer:function(e){var n;return l.createElement(f.Z,{key:e.name,lg:8,xl:6},l.createElement(on.Z,{className:"w-full",size:"small"},l.createElement("div",{className:"d-flex justify-between text-grey-muted","data-testid":"service-card"},l.createElement(p.Z,{gutter:[0,6]},l.createElement(f.Z,{span:24},l.createElement(H.Link,{className:"no-underline",to:(0,i.LE)(null!==(n=e.fullyQualifiedName)&&void 0!==n?n:e.name,t)},l.createElement(E.Z.Text,{className:"text-base text-grey-body font-medium truncate w-48 d-inline-block","data-testid":"service-name-"+e.name,title:(0,Q.C_)(e)},(0,Q.C_)(e))),l.createElement("div",{className:"p-t-xs text-grey-body break-all description-text","data-testid":"service-description"},e.description?l.createElement(Ve.Z,{className:"max-two-lines",enableSeeMoreVariant:!1,markdown:e.description}):l.createElement("span",{className:"text-grey-muted"},a("label.no-description"))),(0,Aa.NZ)(e,t)),l.createElement(f.Z,{span:24},l.createElement("div",{className:"m-b-xss","data-testid":"service-type"},l.createElement("label",{className:"m-b-0"},a("label.type")+":"),l.createElement("span",{className:"font-normal m-l-xss text-grey-body"},e.serviceType)))),l.createElement("div",{className:"d-flex flex-col justify-between flex-none"},l.createElement("div",{className:"d-flex justify-end","data-testid":"service-icon"},(0,at.Y9)(e.serviceType||"","h-7"))))))},deleted:W,handleDeletedSwitchChange:te,searchProps:{onSearch:ie,search:w},tableProps:{bordered:!0,columns:re,dataSource:S,rowKey:"fullyQualifiedName",loading:b,locale:{emptyText:ae},pagination:!1,size:"small",onChange:function(e,t){k(t.serviceType)}}})),l.createElement(f.Z,{span:24},F&&l.createElement(we.Z,{currentPage:z,pageSize:_,paging:P,pagingHandler:function(e){var t,n=e.cursorType,a=e.currentPage;n&&X(((t={})[n]=P[n],t)),G(a)},onShowSizeChange:B})))},Va=function(){var e,t=(0,r.UO)().tab,n=(0,r.TH)(),a=(0,r.k6)(),i=(0,C.$)().t,c=(0,Be.a)().isAdminUser,u=null!==(e=Sa().parse(n.search.startsWith("?")?n.search.substring(1):n.search).tab)&&void 0!==e?e:t===s.lx.DATA_OBSERVABILITY?"pipelines":"services",m=(0,l.useMemo)((function(){var e;return t===s.lx.DATA_OBSERVABILITY?"dataObservabilityServices":null!==(e=Da.v0[t])&&void 0!==e?e:Pa.u.DATABASE_SERVICES}),[t]),E=(0,o.BL)().permissions,y=(0,l.useMemo)((function(){return!(0,g.isEmpty)(E)&&bt.NE.hasViewPermissions((0,Aa.rq)(t),E)}),[E]),v=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.SERVICES,t===s.lx.DATA_OBSERVABILITY?i("label.data-observability"):(0,g.capitalize)(t))}),[]);return y?l.createElement(ne.Z,{pageTitle:m},l.createElement(p.Z,{className:"page-container",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:v})),l.createElement(f.Z,{span:24},l.createElement(st.Z,{destroyInactiveTabPane:!0,activeKey:u,items:(0,d.ev)((0,d.ev)([],(0,d.CR)("dataObservabilityServices"===m?[]:[{key:"services",children:l.createElement(Ha,{serviceName:m}),label:"Services"}])),(0,d.CR)(c&&"apiServices"!==m?[{key:"pipelines",children:l.createElement(La,{serviceName:"dataObservabilityServices"===m?"testSuites":m}),label:"Pipelines"}]:[])),onChange:function(e){return a.push({search:"tab="+e})}})))):l.createElement(p.Z,null,l.createElement(f.Z,{span:24},l.createElement(xe.Z,{type:Re.Wx.PERMISSION})))},Wa=n(24461),Ja=n(16798),qa=n(60715),Qa=n(86442),Ya=n(61843),Ka=n(37310),$a=function(e){var t=e.csvImportResult,n=(0,Ja.vE)().readString,a=(0,C.$)().t,r=(0,d.CR)((0,l.useState)([]),2),i=r[0],s=r[1],o=(0,d.CR)((0,l.useState)(!0),2),c=o[0],u=o[1],m=(0,l.useMemo)((function(){var e=[{title:a("label.status"),dataIndex:"status",key:"status",fixed:!0,render:function(e,t){return l.createElement(j.Z,{align:"start","data-testid":"status-container",style:{maxWidth:200}},e===Ya.q.Success&&l.createElement(Qa.ReactComponent,{className:"m-t-xss","data-testid":"success-badge",height:16,width:16}),e===Ya.q.Failure&&l.createElement(l.Fragment,null,l.createElement(qa.ReactComponent,{className:"m-t-xss","data-testid":"failure-badge",height:16,width:16}),t.details))}},{title:a("label.name"),dataIndex:"name*",key:"name",fixed:!0,render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e)}},{title:a("label.display-name"),dataIndex:"displayName",key:"displayName",render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e||"--")}},{title:a("label.description"),dataIndex:"description",key:"description",width:300,render:function(e){return l.createElement(E.Z.Paragraph,{ellipsis:{rows:2},style:{width:300},title:e},e||"--")}},{title:a("label.team-type"),dataIndex:"teamType*",key:"parent",render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e||"--")}},{title:a("label.parent"),dataIndex:"parents*",key:"parent",render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e||"--")}},{title:a("label.owner"),dataIndex:"Owner",key:"Owner",render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e||"--")}},{title:a("label.joinable"),dataIndex:"isJoinable",key:"isJoinable",render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e||"--")}},{title:a("label.role-plural"),dataIndex:"defaultRoles",key:"defaultRoles",render:function(e){return l.createElement(E.Z.Paragraph,null,e||"--")}},{title:a("label.policy-plural"),dataIndex:"policies",key:"policies",render:function(e){return l.createElement(E.Z.Paragraph,null,e||"--")}}];return e}),[i]);return(0,l.useEffect)((function(){u(!0),t.importResultsCsv?n(t.importResultsCsv,{worker:!0,complete:function(e){s((0,Ka.b)(e.data).map((function(e){return(0,d.pi)((0,d.pi)({},e),{key:e["name*"]})}))),u(!1)}}):u(!1)}),[t.importResultsCsv]),l.createElement(Je.Z,{bordered:!0,columns:m,"data-testid":"import-result-table",dataSource:i,loading:c,pagination:!1,rowKey:"name*",scroll:{x:!0},size:"small"})},Xa=function(e){var t=e.csvImportResult,n=(0,Ja.vE)().readString,a=(0,C.$)().t,r=(0,d.CR)((0,l.useState)([]),2),i=r[0],s=r[1],o=(0,d.CR)((0,l.useState)(!0),2),c=o[0],u=o[1],m=(0,l.useMemo)((function(){return[{title:a("label.status"),dataIndex:"status",key:"status",fixed:!0,render:function(e,t){return l.createElement(j.Z,{align:"start","data-testid":"status-container",style:{maxWidth:200}},e===Ya.q.Success&&l.createElement(Qa.ReactComponent,{className:"m-t-xss","data-testid":"success-badge",height:16,width:16}),e===Ya.q.Failure&&l.createElement(l.Fragment,null,l.createElement(qa.ReactComponent,{className:"m-t-xss","data-testid":"failure-badge",height:16,width:16}),t.details))}},{title:a("label.name"),dataIndex:"name*",key:"name",fixed:!0,render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e)}},{title:a("label.display-name"),dataIndex:"displayName",key:"displayName",render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e||"--")}},{title:a("label.description"),dataIndex:"description",key:"description",width:300,render:function(e){return l.createElement(E.Z.Paragraph,{ellipsis:{rows:2},style:{width:300},title:e},e||"--")}},{title:a("label.email"),dataIndex:"email*",key:"email",render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e||"--")}},{title:a("label.timezone"),dataIndex:"timezone",key:"timezone",render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e||"--")}},{title:a("label.admin"),dataIndex:"isAdmin",key:"isAdmin",render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e||"--")}},{title:a("label.team-plural"),dataIndex:"teams*",key:"teams*",render:function(e){return l.createElement(E.Z.Paragraph,{style:{width:200}},e||"--")}},{title:a("label.role-plural"),dataIndex:"Roles",key:"Roles",render:function(e){return l.createElement(E.Z.Paragraph,null,e||"--")}}]}),[i]);return(0,l.useEffect)((function(){u(!0),t.importResultsCsv?n(t.importResultsCsv,{worker:!0,complete:function(e){s((0,Ka.b)(e.data).map((function(e){return(0,d.pi)((0,d.pi)({},e),{key:e["name*"]})}))),u(!1)}}):u(!1)}),[t.importResultsCsv]),l.createElement(Je.Z,{bordered:!0,className:"vertical-top-align-td",columns:m,"data-testid":"import-result-table",dataSource:i,loading:c,pagination:!1,rowKey:"name*",scroll:{x:!0},size:"small"})};!function(e){e.USERS="users",e.TEAMS="teams"}(Ba||(Ba={}));var el,tl=function(){var e=(0,M.f)().fqn,t=(0,r.k6)(),n=(0,r.TH)(),i=(0,C.$)().t,s=(0,o.BL)().getEntityPermissionByFqn,u=(0,l.useMemo)((function(){var e=n.search;return Sa().parse(e.startsWith("?")?e.substring(1):e)}),[n.search]).type,m=(0,d.CR)((0,l.useState)(!0),2),y=m[0],v=m[1],h=(0,d.CR)((0,l.useState)(),2),b=h[0],Z=h[1],S=(0,d.CR)((0,l.useState)(),2),T=S[0],w=S[1],I=(0,d.CR)((0,l.useState)(),2),A=I[0],R=I[1],k=(0,l.useMemo)((function(){var e;return A?[{name:(0,Q.C_)(A),url:(0,D.KH)(null!==(e=A.fullyQualifiedName)&&void 0!==e?e:A.name)}]:[]}),[A]),L=(0,l.useMemo)((function(){return(0,g.isUndefined)(T)?l.createElement(l.Fragment,null):u===Ba.USERS?l.createElement(Xa,{csvImportResult:T}):l.createElement($a,{csvImportResult:T})}),[T,u]),P=function(){var e;A&&t.push({pathname:(0,D.KH)(null!==(e=A.fullyQualifiedName)&&void 0!==e?e:A.name),search:Sa().stringify({activeTab:u})})};return(0,l.useEffect)((function(){var t;e?(t=e,(0,d.mG)(void 0,void 0,void 0,(function(){var e,n;return(0,d.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,s(c.A.TEAM,t)];case 2:return e=a.sent(),Z(e),[3,5];case 3:return n=a.sent(),(0,O.Eo)(n),[3,5];case 4:return v(!1),[7];case 5:return[2]}}))}))):v(!1)}),[]),(0,l.useEffect)((function(){var t;((null==b?void 0:b.Create)||(null==b?void 0:b.EditAll))&&(t=e,(0,d.mG)(void 0,void 0,void 0,(function(){var e,n;return(0,d.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,Pn.Xv)(t)];case 2:return e=a.sent(),R(e),[3,5];case 3:return n=a.sent(),(0,O.Eo)(n),[3,5];case 4:return v(!1),[7];case 5:return[2]}}))})))}),[b]),y?l.createElement(N.Z,null):(null==b?void 0:b.Create)&&(null==b?void 0:b.EditAll)?(0,g.isUndefined)(A)?l.createElement(xe.Z,null):A.teamType===a.Group&&u===Ba.TEAMS?l.createElement(xe.Z,{type:Re.Wx.CUSTOM},l.createElement("div",{className:"m-t-sm text-center text-sm font-normal"},l.createElement(E.Z.Paragraph,{className:"w-80"},i("message.group-type-team-not-allowed-to-have-sub-team")))):l.createElement(ne.Z,{pageTitle:i("label.import-entity",{entity:u===Ba.USERS?i("label.user-plural"):i("label.team-plural")})},l.createElement(p.Z,{className:"import-teams w-full page-container","data-testid":"import-teams",gutter:[16,8]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:k})),l.createElement(f.Z,{span:24},l.createElement(E.Z.Title,{"data-testid":"title",level:5},i("label.import-entity",{entity:u===Ba.USERS?i("label.user-plural"):i("label.team-plural")}))),l.createElement(f.Z,{span:24},l.createElement(Wa.v,{entityName:A.name,onCancel:P,onImport:function(e,t,n){return void 0===n&&(n=!0),(0,d.mG)(void 0,void 0,void 0,(function(){var a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:a=u===Ba.USERS?Pn.vi:Pn.sZ,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,a(e,t,n)];case 2:return l=i.sent(),w(l),[2,l];case 3:return r=i.sent(),(0,O.Eo)(r),[2];case 4:return[2]}}))}))},onSuccess:P},L)))):l.createElement(xe.Z,{type:Re.Wx.PERMISSION})},nl=n(51890),al=n(27279),ll=n(76410),rl=n(4357),il=n(8655),sl=n(16687),ol=n(32481),cl=n(71761),ul=n(55546),dl=n(56709),ml=n(38100),pl=n(29452),fl=n(35342),El=function(e,t){return e.filter((function(e){return e.deleted===t})).sort((function(e,t){return(0,Q.C_)(e).toLowerCase().localeCompare((0,Q.C_)(t).toLowerCase())}))},yl=function(e,t){return(0,vn.t)("message.delete-team-message",{teamName:e,deleteType:t})},vl=function(e){switch(e){case a.Organization:return[a.BusinessUnit,a.Division,a.Department,a.Group];case a.BusinessUnit:case a.Division:return[a.Division,a.Department,a.Group];case a.Department:return[a.Department,a.Group];case a.Group:return[a.Group]}},hl=n(14128),bl=n(6711),gl=n(73546),Cl=n(66208),Zl=n(8035),Nl=function(e){var t=e.list,n=e.type,a=e.onDelete,r=e.hasAccess,i=e.isTeamDeleted,s=(0,C.$)().t,o=(0,l.useMemo)((function(){return[{title:s("label.name"),dataIndex:"name",width:"200px",key:"name",render:function(e,t){var a="";switch(n){case Ge.py.POLICY:a=(0,D.Hr)(t.fullyQualifiedName||"");break;case Ge.py.ROLE:a=(0,D.Uy)(t.fullyQualifiedName||"")}return l.createElement(H.Link,{className:"cursor-pointer","data-testid":"entity-name",to:a},(0,Q.C_)(t))}},{title:s("label.description"),dataIndex:"description",key:"description",render:function(e,t){return l.createElement(Ve.Z,{markdown:(null==t?void 0:t.description)||""})}},{title:s("label.action-plural"),dataIndex:"actions",width:"80px",key:"actions",render:function(e,t){return l.createElement(Ue.Z,{placement:"left",title:r?s("label.remove"):dt.oH},l.createElement(h.Z,{"data-testid":"remove-action-"+(0,Q.C_)(t),disabled:!r,type:"text",onClick:function(){return a(t)}},l.createElement(Pe.Z,{className:"align-middle",component:nn.ReactComponent,style:{fontSize:"16px"}})))}}].filter((function(e){return"actions"!==e.key||!i}))}),[i]);return l.createElement(Gn.Z,{bordered:!0,className:"list-table",columns:o,dataSource:t,pagination:!1,rowKey:"id",size:"small"})};!function(e){e.TEAMS="teams",e.USERS="users",e.ASSETS="assets",e.ROLES="roles",e.POLICIES="policies"}(el||(el={}));var Sl=n(14129),Tl=n(57865),xl=n(38333),wl=n(39647),Il={};Il.styleTagTransform=Ce(),Il.setAttributes=ve(),Il.insert=Ee().bind(null,"head"),Il.domAPI=pe(),Il.insertStyleElement=be(),de()(wl.Z,Il),wl.Z&&wl.Z.locals&&wl.Z.locals;var Al,Rl=function(e){var t,n,r=e.currentTeam,s=e.data,o=e.onTeamExpand,c=e.isFetchingAllTeamAdvancedDetails,u=(0,C.$)().t,m=(0,d.CR)((0,l.useState)(!1),2),p=m[0],f=m[1],v=(0,d.CR)((0,l.useState)(!1),2),h=v[0],b=v[1],Z=(0,d.CR)((0,l.useState)(),2),N=Z[0],S=Z[1],T=(0,d.CR)((0,l.useState)(!1),2),x=T[0],w=T[1],I=(0,l.useMemo)((function(){return[{title:u("label.team-plural"),dataIndex:"teams",className:"whitespace-nowrap",key:"teams",render:function(e,t){return l.createElement(H.Link,{className:"link-hover",to:(0,D.KH)(t.fullyQualifiedName||t.name)},(0,Q.C_)(t))}},{title:u("label.type"),dataIndex:"teamType",width:120,key:"teamType"},{title:u("label.sub-team-plural"),dataIndex:"childrenCount",width:100,key:"subTeams",render:function(e){return c?l.createElement(y.Z,{active:c,paragraph:{rows:0}}):null!=e?e:0}},{title:u("label.user-plural"),dataIndex:"userCount",width:60,key:"users",render:function(e){return c?l.createElement(y.Z,{active:c,paragraph:{rows:0}}):null!=e?e:0}},{title:u("label.entity-count",{entity:u("label.asset")}),dataIndex:"owns",width:120,key:"owns",render:function(e){var t;return c?l.createElement(y.Z,{active:c,paragraph:{rows:0}}):null!==(t=null==e?void 0:e.length)&&void 0!==t?t:0}},{title:u("label.description"),dataIndex:"description",width:300,key:"description",render:function(e){return(0,g.isEmpty)(e)?l.createElement(E.Z.Paragraph,{className:"m-b-0"},i.lH):l.createElement(Ve.Z,{markdown:e,maxLength:i.Gg,showReadMoreBtn:!1})}}]}),[s,c,o]),A=(0,l.useCallback)((function(e){return w(e)}),[]),R=(0,l.useCallback)((function(e,t){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(n){return e.id===(null==t?void 0:t.id)?[2]:!(0,g.isUndefined)(t)&&(l=e.teamType,(r=null==t?void 0:t.teamType)===a.Group||r===a.Division&&l===a.BusinessUnit||r===a.Department&&l===a.BusinessUnit||r===a.Department&&l===a.Division)?((0,O.Eo)(u("message.error-team-transfer-message",{dragTeam:e.teamType,dropTeam:t.teamType})),[2]):(S({from:e,to:t}),f(!0),[2]);var l,r}))}))}),[]),M=(0,l.useCallback)((function(){f(!1),w(!1)}),[]),k=(0,l.useMemo)((function(){return(0,d.pi)((0,d.pi)({},(0,xl.Bn)(!0)),{onExpand:function(e,t){e&&(0,g.isEmpty)(t.children)&&o(!1,t.fullyQualifiedName,!0)}})}),[o]);return l.createElement(l.Fragment,null,l.createElement(Sl.W,{backend:Tl.PD},l.createElement(Je.Z,{bordered:!0,className:ca()("teams-list-table drop-over-background",{"drop-over-table":x}),columns:I,components:fl.SX,"data-testid":"team-hierarchy-table",dataSource:s,expandable:k,loading:h,locale:{emptyText:l.createElement(He.Z,null)},pagination:!1,rowKey:"name",size:"small",onHeaderRow:function(){return{handleMoveRow:R,handleTableHover:A}},onRow:function(e,t){return{index:t,handleMoveRow:R,handleTableHover:A,record:e}}})),l.createElement(ft.Z,{centered:!0,destroyOnClose:!0,closable:!1,confirmLoading:h,"data-testid":"confirmation-modal",maskClosable:!1,okText:u("label.confirm"),open:p,title:u("label.move-the-entity",{entity:u("label.team")}),onCancel:M,onOk:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,t,n,a,l,i;return(0,d.Jh)(this,(function(s){switch(s.label){case 0:if(!N)return[3,6];b(!0),s.label=1;case 1:return s.trys.push([1,4,5,6]),e=null===(i=N.to)||void 0===i?void 0:i.id,[4,(0,Pn.Xv)(N.from.name,{fields:[Ge.GB.USERS,Ge.GB.DEFAULT_ROLES,Ge.GB.POLICIES,Ge.GB.OWNERS,Ge.GB.PARENTS,Ge.GB.CHILDREN],include:Me.y.All})];case 2:return t=s.sent(),n=(0,d.pi)((0,d.pi)({},t),{parents:e?[{id:e,type:"team"}]:void 0}),a=(0,ot.qu)(t,n),[4,(0,Pn.Cp)(t.id,a)];case 3:return s.sent(),o(!0,null==r?void 0:r.name),(0,O.XA)(u("message.team-moved-success")),[3,6];case 4:return l=s.sent(),(0,O.Eo)(l,u("server.team-moved-error")),[3,6];case 5:return b(!1),f(!1),w(!1),[7];case 6:return[2]}}))}))}},l.createElement(at.u1,{i18nKey:"message.entity-transfer-message",renderElement:l.createElement("strong",null),values:{from:null==N?void 0:N.from.name,to:null!==(n=null===(t=null==N?void 0:N.to)||void 0===t?void 0:t.name)&&void 0!==n?n:(0,Q.C_)(r),entity:u("label.team-lowercase")}})))},Ml=n(68855),kl=function(e){var t=e.currentTeam,n=e.updateTeamHandler,a=e.entityPermissions,r=(0,C.$)().t,s=(0,d.CR)((0,l.useState)(!1),2),o=s[0],c=s[1],u=(0,d.CR)((0,l.useState)(!1),2),m=u[0],p=u[1],f=(0,d.CR)((0,l.useState)(t?t.displayName:""),2),y=f[0],b=f[1],Z=(0,Be.a)().isAdminUser,N=(0,R.N)().currentUser,S=(0,l.useMemo)((function(){return t}),[t]).owners,T=(0,l.useMemo)((function(){return N&&(0,at.Xp)(null!=S?S:[],N)}),[S,N]),x=(0,l.useMemo)((function(){return{hasEditPermission:a.EditAll,hasEditDisplayNamePermission:a.EditDisplayName||a.EditAll,hasAccess:Z}}),[a]),w=x.hasEditDisplayNamePermission,I=x.hasAccess,A=function(){return(0,d.mG)(void 0,void 0,Promise,(function(){var e;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:return(0,g.isEmpty)(y)?[2,(0,O.Eo)(r("label.field-required",{field:r("label.display-name")}))]:t?(c(!0),e=(0,d.pi)((0,d.pi)({},t),{displayName:y}),[4,n(e)]):[3,2];case 1:a.sent(),c(!1),a.label=2;case 2:return p(!1),[2]}}))}))},M=(0,l.useCallback)((function(){b(t?(0,Q.C_)(t):""),p(!1)}),[t]),k=(0,l.useMemo)((function(){return m?l.createElement(j.Z,{onClick:function(e){return e.stopPropagation()}},l.createElement(v.Z,{className:"w-48","data-testid":"team-name-input",placeholder:r("message.enter-comma-separated-field",{field:r("label.term-lowercase")}),type:"text",value:y,onChange:function(e){return b(e.target.value)}}),l.createElement(j.Z,{"data-testid":"buttons",size:4},l.createElement(h.Z,{className:"rounded-4 text-sm p-xss","data-testid":"cancelAssociatedTag",disabled:o,type:"primary",onMouseDown:M},l.createElement(Kn.Z,null)),l.createElement(h.Z,{className:"rounded-4 text-sm p-xss","data-testid":"saveAssociatedTag",loading:o,type:"primary",onMouseDown:A},l.createElement(sa.Z,null)))):l.createElement(l.Fragment,null,l.createElement(l.Fragment,null,y?l.createElement(E.Z.Title,{className:"m-b-0 w-max-200","data-testid":"team-heading",ellipsis:{tooltip:!0},level:5},y):l.createElement(E.Z.Text,{className:"m-b-0 text-grey-muted text-sm","data-testid":"team-heading"},r("label.no-entity",{entity:r("label.display-name")})),(I||T)&&!t.deleted&&l.createElement(Ue.Z,{placement:"right",title:w?r("label.edit-entity",{entity:r("label.display-name")}):r("message.no-permission-for-action")},l.createElement(h.Z,{className:"p-0 flex-center","data-testid":"edit-team-name",disabled:!w,icon:l.createElement(V.ReactComponent,{color:i.MJ,width:"16px"}),size:"small",type:"text",onClick:function(e){e.stopPropagation(),p(!0)}}))),t.deleted&&l.createElement("div",{className:"deleted-badge-button text-xs flex-center","data-testid":"deleted-badge"},l.createElement(Ml.Z,{className:"m-r-xss"}),r("label.deleted")))}),[y,m,w,t,o]);return(0,l.useEffect)((function(){var e;t&&b(null!==(e=t.displayName)&&void 0!==e?e:t.name)}),[t]),l.createElement(j.Z,{size:4},k)},Ll=n(66318),Dl=function(e){var t=e.handleShowTypeSelector,n=e.showGroupOption,r=e.teamType,i=e.updateTeamType,s=e.parentTeamType,o=(0,d.CR)((0,l.useState)(r),2),c=o[0],u=o[1],m=(0,l.useMemo)((function(){var e=vl(s).map((function(e){return{label:e,value:e}}));return n?e:e.filter((function(e){return e.value!==a.Group}))}),[s,n]);return l.createElement(j.Z,{align:"center",className:"team-type-select","data-testid":"team-type-select",size:4,onClick:function(e){return e.stopPropagation()}},l.createElement(Tt.Z,{defaultActiveFirstOption:!0,options:m,value:c,onSelect:function(e){u(e)}}),l.createElement(j.Z,{className:"m-l-xs",size:4},l.createElement(h.Z,{className:"h-8 p-x-xss","data-testid":"cancel-btn",size:"small",type:"primary",onClick:function(){t(!1)}},l.createElement(Kn.Z,null)),l.createElement(h.Z,{className:"h-8 p-x-xss","data-testid":"save-btn",size:"small",type:"primary",onClick:function(){i&&i(c)}},l.createElement(sa.Z,null))))},Ol=function(e){var t=e.subscription,n=e.hasEditPermission,a=e.updateTeamSubscription,r=(0,d.CR)((0,b.useForm)(),1)[0],s=(0,C.$)().t,o=(0,d.CR)((0,l.useState)(!1),2),c=o[0],u=o[1],p=(0,d.CR)((0,l.useState)(!1),2),f=p[0],y=p[1],Z=(0,l.useCallback)((function(e){var t=function(e){switch(e){case fl.oz.SLACK:return pl.ReactComponent;case fl.oz.G_CHAT:return dl.ReactComponent;default:return ml.ReactComponent}}(e);return l.createElement(t,{className:"align-middle","data-testid":e+"-icon",height:20,width:20})}),[]),N=(0,g.isEmpty)(m.Z.useWatch("webhook",r)),S=(0,l.useCallback)((function(e,t){return l.createElement(E.Z.Link,{href:t.endpoint,target:"_blank"},Z(e))}),[]),T=(0,l.useMemo)((function(){var e,a=null===(e=Object.entries(null!=t?t:{}))||void 0===e?void 0:e[0];return(0,g.isEmpty)(t)?n?l.createElement("div",{className:"flex-center gap-2"},l.createElement(E.Z.Text,{className:"font-medium","data-testid":"subscription-no-data"},s("label.none")),l.createElement(Ue.Z,{title:s("label.edit-entity",{entity:s("label.subscription")})},l.createElement(V.ReactComponent,{className:"cursor-pointer",color:i.MJ,"data-testid":"edit-team-subscription",width:14,onClick:function(e){e.stopPropagation(),u(!0)}}))):l.createElement(E.Z.Text,{className:"font-medium","data-testid":"subscription-no-data"},i.lH):S(a[0],a[1])}),[t,n]);return(0,l.useEffect)((function(){N&&r.setFieldValue("endpoint","")}),[N]),(0,l.useEffect)((function(){if(t){var e=Object.entries(t)[0];r.setFieldsValue({webhook:e[0],endpoint:e[1].endpoint})}}),[t,c]),l.createElement(j.Z,{align:"center","data-testid":"teams-subscription"},l.createElement(E.Z.Text,{className:"right-panel-label font-normal"},s("label.subscription")+" :"),T,!c&&!(0,g.isEmpty)(t)&&n&&l.createElement(Ue.Z,{title:s("label.edit-entity",{entity:s("label.subscription")})},l.createElement(V.ReactComponent,(0,d.pi)({className:"cursor-pointer align-middle",color:i.MJ,"data-testid":"edit-team-subscription"},i.K$,{onClick:function(e){e.stopPropagation(),u(!0)}}))),c&&l.createElement(h.Z,{className:"remove-button-default-styling",onClick:function(e){return e.stopPropagation()}},l.createElement(ft.Z,{centered:!0,open:!0,closable:!1,confirmLoading:f,maskClosable:!1,okButtonProps:{form:"subscription-form",type:"primary",htmlType:"submit"},okText:s("label.confirm"),title:s("label.add-entity",{entity:s("label.subscription")}),onCancel:function(){return u(!1)}},l.createElement(m.Z,{"data-testid":"subscription-modal",form:r,id:"subscription-form",layout:"vertical",onFinish:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(t){switch(t.label){case 0:y(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,a(N?void 0:e)];case 2:case 3:return t.sent(),[3,5];case 4:return u(!1),y(!1),[7];case 5:return[2]}}))}))}},l.createElement(m.Z.Item,{label:s("label.webhook"),name:"webhook"},l.createElement(Tt.Z,{options:fl.Nz,placeholder:s("label.select-field",{field:s("label.condition")})})),l.createElement(m.Z.Item,{label:s("label.endpoint"),name:"endpoint",rules:[{required:!N,message:s("label.field-required-plural",{field:s("label.endpoint")})},{type:"url",message:s("message.endpoint-should-be-valid")}]},l.createElement(v.Z,{disabled:N,placeholder:s("label.enter-entity-value",{entity:s("label.endpoint")})}))))))},Pl=function(e){var t,n=e.parentTeams,r=e.isGroupType,s=e.childTeamsCount,o=e.entityPermissions,c=e.currentTeam,u=e.updateTeamHandler,p=e.isTeamDeleted,f=(0,C.$)().t,y=(0,Be.a)().isAdminUser,b=(0,d.CR)((0,l.useState)(!1),2),Z=b[0],N=b[1],S=(0,d.CR)((0,l.useState)(!1),2),T=S[0],x=S[1],w=(0,d.CR)((0,l.useState)(!1),2),I=w[0],A=w[1],M=(0,R.N)().currentUser,k=(0,l.useMemo)((function(){return c}),[c]),L=k.email,D=k.owners,O=k.teamType,P=k.id,U=k.fullyQualifiedName,z=(0,l.useMemo)((function(){return{hasEditPermission:o.EditAll&&!p,hasAccess:y&&!p}}),[o,p]),G=z.hasEditPermission,_=z.hasAccess,B=(0,l.useMemo)((function(){var e;return null!==(e=null==D?void 0:D.some((function(e){return e.id===(null==M?void 0:M.id)})))&&void 0!==e&&e}),[D,M]),H=(0,l.useMemo)((function(){return(o.EditAll||B)&&!p}),[o,B,p]),W=function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:return c?(A(!0),t=(0,d.pi)((0,d.pi)({},c),{email:(0,g.isEmpty)(e.email)?void 0:e.email}),[4,u(t)]):[3,2];case 1:n.sent(),A(!1),n.label=2;case 2:return N(!1),[2]}}))}))},J=(0,l.useCallback)((function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:return c?(t=(0,d.pi)((0,d.pi)({},c),{owners:e}),[4,u(t)]):[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}),[c]),q=function(e){return(0,d.mG)(void 0,void 0,Promise,(function(){var t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:return c?(t=(0,d.pi)((0,d.pi)({},c),{teamType:e}),[4,u(t)]):[3,2];case 1:n.sent(),x(!1),n.label=2;case 2:return[2]}}))}))},Q=(0,l.useMemo)((function(){return l.createElement(j.Z,{align:"center",size:4},l.createElement(E.Z.Text,{className:"text-grey-muted"},f("label.email")+" :"),Z?l.createElement(m.Z,{initialValues:{email:L},onClick:function(e){return e.stopPropagation()},onFinish:W},l.createElement(j.Z,{align:"baseline"},l.createElement(m.Z.Item,{className:"m-b-0",name:"email",rules:[{pattern:ae.Ln,type:"email",message:f("message.field-text-is-invalid",{fieldText:f("label.email")})}]},l.createElement(v.Z,{className:"w-48","data-testid":"email-input",placeholder:f("label.enter-entity",{entity:f("label.email-lowercase")})})),l.createElement(j.Z,{size:4},l.createElement(h.Z,{className:"h-8 p-x-xss","data-testid":"cancel-edit-email",disabled:I,size:"small",type:"primary",onClick:function(){return N(!1)}},l.createElement(Kn.Z,null)),l.createElement(h.Z,{className:"h-8 p-x-xss","data-testid":"save-edit-email",htmlType:"submit",loading:I,size:"small",type:"primary"},l.createElement(sa.Z,null))))):l.createElement(j.Z,{align:"center"},l.createElement(E.Z.Text,{className:"font-medium","data-testid":"email-value"},null!=L?L:i.lH),G&&l.createElement(Ue.Z,{title:f("label.edit-entity",{entity:f("label.email")})},l.createElement(h.Z,{className:"flex-center p-0","data-testid":"edit-email",icon:l.createElement(V.ReactComponent,(0,d.pi)({color:i.MJ},i.K$)),size:"small",type:"text",onClick:function(e){e.stopPropagation(),N(!0)}}))))}),[L,Z,G,I]),Y=(0,l.useMemo)((function(){var e,t;return O===a.Organization?null:l.createElement(j.Z,{size:4},l.createElement(F.Z,{type:"vertical"}),l.createElement(E.Z.Text,{className:"text-grey-muted"},f("label.type")+" :"),T?l.createElement(Dl,{handleShowTypeSelector:x,parentTeamType:null!==(t=null===(e=(0,g.last)(n))||void 0===e?void 0:e.teamType)&&void 0!==t?t:a.Organization,showGroupOption:!s,teamType:null!=O?O:a.Department,updateTeamType:G?q:void 0}):l.createElement(l.Fragment,null,l.createElement(E.Z.Text,{className:"font-medium","data-testid":"team-type"},O),G&&!r&&l.createElement(Ue.Z,{title:f("label.edit-entity",{entity:f("label.team-type")})},l.createElement(h.Z,{className:"flex-center p-0","data-testid":"edit-team-type-icon",icon:l.createElement(V.ReactComponent,(0,d.pi)({color:i.MJ},i.K$)),size:"small",type:"text",onClick:function(e){e.stopPropagation(),x(!0)}}))))}),[O,n,r,s,T,G,q,x]);return l.createElement(j.Z,{size:0},l.createElement(Ll.y,{multiple:!0,domain:c.domains,entityFqn:null!=U?U:"",entityId:null!=P?P:"",entityType:Ge.py.TEAM,hasPermission:G}),l.createElement(F.Z,{type:"vertical"}),l.createElement(Fa.V,{className:"text-sm",hasPermission:_,owners:D,onUpdate:J}),l.createElement(F.Z,{type:"vertical"}),Q,l.createElement(F.Z,{type:"vertical"}),l.createElement(Ol,{hasEditPermission:H,subscription:null===(t=c.profile)||void 0===t?void 0:t.subscription,updateTeamSubscription:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:return c?(t=(0,d.pi)((0,d.pi)({},c),{profile:{subscription:(0,g.isEmpty)(e)?void 0:(n={},n[null!==(a=null==e?void 0:e.webhook)&&void 0!==a?a:""]={endpoint:null==e?void 0:e.endpoint},n)}}),[4,u(t)]):[3,2];case 1:l.sent(),l.label=2;case 2:return[2]}}))}))}}),Y)},Ul=n(22334),zl=function(e){var t,n,a=e.permission,o=e.currentTeam,c=e.onAddUser,u=e.onRemoveUser,m=(0,C.$)().t,E=(0,r.k6)(),y=(0,d.CR)((0,l.useState)(),2),v=y[0],b=y[1],Z=(0,bl.l)().showModal,N=function(e){var t,n=null===(t=o.users)||void 0===t?void 0:t.find((function(t){return t.id===e}));b(n)},S=(0,d.CR)((0,l.useState)(!0),2),T=S[0],x=S[1],w=(0,d.CR)((0,l.useState)([]),2),I=w[0],A=w[1],R=(0,d.CR)((0,l.useState)(""),2),M=R[0],k=R[1],L=(0,Le.C)(i.Ou),O=L.currentPage,P=L.pageSize,U=L.paging,z=L.handlePageChange,G=L.handlePageSizeChange,_=L.handlePagingChange,B=L.showPagination,F=function(e,t){void 0===t&&(t={}),x(!0),(0,an.Rf)((0,d.pi)({fields:""+Ge.GB.ROLES,limit:P,team:e},t)).then((function(e){e.data&&(A(e.data),_(e.paging))})).catch((function(){A([]),_({total:0})})).finally((function(){x(!1)}))},H=function(e,t){x(!0),(0,qt.rg)(e,t,P,"(teams.id:"+(null==o?void 0:o.id)+")","","",Oa.W.USER).then((function(e){var t=(0,Ul.wB)(e.data.hits.hits);A(t),_({total:e.data.hits.total.value})})).catch((function(){A([])})).finally((function(){return x(!1)}))};(0,l.useEffect)((function(){F(o.name)}),[o,P]);var V=(0,l.useMemo)((function(){var e;return null!==(e=o.deleted)&&void 0!==e&&e}),[o]),W=(0,l.useMemo)((function(){return(0,d.ev)((0,d.ev)([],(0,d.CR)((0,ln.y5)().filter((function(e){return"teams"!==e.key})))),[{title:m("label.action-plural"),dataIndex:"actions",key:"actions",width:90,render:function(e,t){return l.createElement(j.Z,{align:"center",className:"w-full justify-center remove-icon",size:8},l.createElement(Ue.Z,{placement:"left",title:a.EditAll?m("label.remove"):m("message.no-permission-for-action")},l.createElement(h.Z,{"data-testid":"remove-user-btn",disabled:!a.EditAll,icon:l.createElement(nn.ReactComponent,{height:16,name:m("label.remove"),width:16}),type:"text",onClick:function(){return N(t.id)}})))}}]).filter((function(e){return"actions"!==e.key||!V}))}),[N,a,V]),J=(0,l.useMemo)((function(){return(0,g.orderBy)(I,["name"],"asc")}),[I]),q=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(e){return(null==o?void 0:o.name)&&Z({name:o.name,onExport:Pn.hh}),[2]}))}))}),[o,Pn.hh]),Y=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(e){return E.push({pathname:(0,D.Ec)(s.CZ.MEMBERS,s.lx.TEAMS,o.name,Ge.uk.IMPORT),search:Sa().stringify({type:Ba.USERS})}),[2]}))}))}),[]),K=(0,l.useMemo)((function(){var e=[{label:l.createElement(hl.v,{description:m("message.export-entity-help",{entity:m("label.user-lowercase")}),icon:rl.ReactComponent,id:"export",name:m("label.export")}),onClick:q,key:"export-button"}];return a.EditAll&&e.push({label:l.createElement(hl.v,{description:m("message.import-entity-help",{entity:m("label.team-lowercase")}),icon:il.ReactComponent,id:"import-button",name:m("label.import")}),onClick:Y,key:"import-button"}),e}),[q,Y,a]),$=(0,l.useMemo)((function(){return V?m("message.this-action-is-not-allowed-for-deleted-entities"):a.EditAll?m("label.add-new-entity",{entity:m("label.user")}):m("message.no-permission-for-action")}),[a,V]);return!(0,g.isEmpty)(I)||M||T?l.createElement(p.Z,{className:"p-y-md",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(p.Z,{justify:"space-between"},l.createElement(f.Z,{span:8},l.createElement(We.Z,{removeMargin:!0,placeholder:m("label.search-for-type",{type:m("label.user-lowercase")}),searchValue:M,typingInterval:500,onSearch:function(e){var t;k(e),t=i.j2,z(null!=t?t:i.j2),e?H(e,i.j2):F(o.name)}})),!o.deleted&&l.createElement(f.Z,null,l.createElement(j.Z,null,I.length>0&&a.EditAll&&l.createElement(en.l,{hasPermission:!0,selectedUsers:null!==(n=o.users)&&void 0!==n?n:[],onUpdate:c},l.createElement(h.Z,{"data-testid":"add-new-user",type:"primary"},m("label.add-entity",{entity:m("label.user")}))),l.createElement($t.Z,{canDelete:!1,displayName:(0,Q.C_)(o),entityName:o.name,entityType:Ge.py.USER,extraDropdownContent:K}))))),l.createElement(f.Z,{span:24},l.createElement(Je.Z,{bordered:!0,className:"teams-list-table",columns:W,dataSource:J,loading:T,locale:{emptyText:l.createElement(He.Z,null)},pagination:!1,rowKey:"name",size:"small"})),l.createElement(f.Z,{span:24},B&&l.createElement(we.Z,{currentPage:O,isNumberBased:Boolean(M),pageSize:P,paging:U,pagingHandler:function(e){var t,n=e.cursorType,a=e.currentPage;M?(z(a),H(M,a)):n&&(z(a),F(o.name,((t={})[n]=U[n],t)))},onShowSizeChange:G})),l.createElement(ft.Z,{cancelText:m("label.cancel"),"data-testid":"confirmation-modal",okText:m("label.confirm"),open:Boolean(v),title:m("label.removing-user"),onCancel:function(){return b(void 0)},onOk:function(){(null==v?void 0:v.id)&&u(v.id).then((function(){b(void 0)}))}},m("message.are-you-sure-want-to-text",{text:m("label.remove-entity",{entity:(0,Q.C_)(v)})}))):l.createElement(xe.Z,{button:l.createElement(j.Z,null,l.createElement(en.l,{hasPermission:!0,selectedUsers:null!==(t=o.users)&&void 0!==t?t:[],onUpdate:c},l.createElement(Ue.Z,{placement:"topRight",title:$},l.createElement(h.Z,{ghost:!0,className:ca()({"p-x-lg":a.EditAll&&!V}),"data-testid":"add-new-user",disabled:!a.EditAll||V,icon:l.createElement(cn.Z,null),type:"primary"},m("label.add")))),!V&&l.createElement($t.Z,{canDelete:!1,displayName:(0,Q.C_)(o),entityName:o.name,entityType:Ge.py.USER,extraDropdownContent:K})),className:"mt-0-important",heading:m("label.user"),permission:a.EditAll,type:Re.Wx.ASSIGN})},Gl=function(e){var t,n=e.assetsCount,u=e.currentTeam,m=e.isDescriptionEditable,y=e.isTeamMemberLoading,v=e.childTeams,b=e.onTeamExpand,Z=e.handleAddTeam,S=e.updateTeamHandler,T=e.onDescriptionUpdate,w=e.descriptionHandler,I=e.showDeletedTeam,A=e.onShowDeletedTeamChange,M=e.handleJoinTeamClick,k=e.handleLeaveTeamClick,L=e.handleAddUser,P=e.removeUserFromTeam,U=e.afterDeleteAction,z=e.parentTeams,G=e.entityPermissions,_=e.isFetchingAdvancedDetails,F=e.isFetchingAllTeamAdvancedDetails,H=(0,C.$)().t,V=(0,r.k6)(),W=(0,r.TH)(),J=(0,Be.a)().isAdminUser,q=(0,R.N)().currentUser,Y=(0,l.useMemo)((function(){var e=W.search;return Sa().parse(e.startsWith("?")?e.substring(1):e)}),[W.search]).activeTab,K=u.name===a.Organization,$=u.teamType===a.Group,X={user:void 0,state:!1,leave:!1},ee=(0,o.BL)().permissions,te=(0,l.useMemo)((function(){return Y||($?el.USERS:el.TEAMS)}),[Y,$]),ne=(0,d.CR)((0,l.useState)(X),2),ae=ne[0],le=ne[1],re=(0,d.CR)((0,l.useState)(""),2),ie=re[0],se=re[1],ce=(0,d.CR)((0,l.useState)([]),2),ue=ce[0],de=ce[1],me=(0,d.CR)((0,l.useState)([]),2),pe=me[0],fe=me[1],Ee=(0,d.CR)((0,l.useState)(),2),ye=Ee[0],ve=Ee[1],he=(0,d.CR)((0,l.useState)(),2),be=he[0],ge=he[1],Ce=(0,d.CR)((0,l.useState)(!1),2),Ze=Ce[0],Ne=Ce[1],Se=(0,d.CR)((0,l.useState)(),2),we=Se[0],Ie=Se[1],Ae=(0,bl.l)().showModal,Me=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.MEMBERS,H("label.team-plural"))}),[]),ke=H("label.add-entity",{entity:H("label.policy")}),Le=H("label.add-entity",{entity:H("label.role")}),De=H("label.add-entity",{entity:H("label.team")}),Oe=(0,l.useMemo)((function(){var e;return null!==(e=u.deleted)&&void 0!==e&&e}),[u]),Pe=(0,l.useMemo)((function(){return K&&u&&u.childrenCount?u.childrenCount+1:ue.length}),[ue,K,u.childrenCount]),_e=(0,l.useMemo)((function(){return!(0,g.isEmpty)(ee)&&(0,bt.P_)(Vn.OX.Create,c.A.TEAM,ee)}),[ee]),je=(0,l.useCallback)((function(e,t){void 0===t&&(t=!1);var n=(0,d.ev)([],(0,d.CR)(null==u?void 0:u.users)).find((function(t){return t.id===e}));le({user:n,state:!0,leave:t})}),[u,le]),Fe=(0,l.useCallback)((function(e){var t=e.permission,n=e.onClick,a=e.heading,r=e.doc,i=e.button,s=e.children,o=e.type,c=void 0===o?Re.Wx.CREATE:o;return l.createElement(xe.Z,{button:i,className:"mt-0-important",doc:r,heading:a,permission:t,type:c,onClick:n},s)}),[]),He=function(){if(u){var e=(0,d.pi)((0,d.pi)({},u),{isJoinable:!u.isJoinable});S(e,!1)}},Ve=(0,l.useCallback)((function(e){var t;if(e.stopPropagation(),q&&u){var n=(0,g.cloneDeep)(null!==(t=q.teams)&&void 0!==t?t:[]);n.push({id:u.id,type:ul.jc.TEAM,name:u.name});var a=(0,d.pi)((0,d.pi)({},q),{teams:n}),l=(0,ot.qu)(q,a);M(q.id,l)}}),[q,u,M]),Je=function(e){var t;se(e),e?(t=e,(0,d.mG)(void 0,void 0,void 0,(function(){var e,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,(0,qt.vt)(t,Oa.W.TEAM)];case 1:return e=a.sent(),n=e.data.suggest["metadata-suggest"][0].options.map((function(e){return e._source})),de(n),[3,3];case 2:return a.sent(),de([]),[3,3];case 3:return[2]}}))}))):de(El(null!=v?v:[],I))},qe=function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e;return(0,d.Jh)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,Pn.kt)(u.id)];case 1:if(!t.sent())throw H("message.entity-restored-error",{entity:H("label.team")});return U(!0),(0,O.XA)(H("message.entity-restored-success",{entity:H("label.team")})),[3,3];case 2:return e=t.sent(),(0,O.Eo)(e,H("message.entity-restored-error",{entity:H("label.team")})),[3,3];case 3:return[2]}}))}))};(0,l.useEffect)((function(){if(u){var e=z&&!K?z.map((function(e){var t,n;return{name:(0,Q.C_)(e),url:(0,D.KH)(null!==(n=null!==(t=e.name)&&void 0!==t?t:e.fullyQualifiedName)&&void 0!==n?n:"")}})):[],t=(0,d.ev)((0,d.ev)([],(0,d.CR)(e)),[{name:(0,Q.C_)(u),url:""}]);fe(t)}}),[u,z,I]),(0,l.useEffect)((function(){de(El(null!=v?v:[],I)),se("")}),[v,I]);var Qe=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(e){return(null==u?void 0:u.name)&&Ae({name:null==u?void 0:u.name,onExport:Pn._9}),[2]}))}))}),[u]),Ye=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(e){return V.push({pathname:(0,D.Ec)(s.CZ.MEMBERS,s.lx.TEAMS,u.name,Ge.uk.IMPORT),search:Sa().stringify({type:Ba.TEAMS})}),[2]}))}))}),[]),Ke=(0,l.useMemo)((function(){var e=[{label:l.createElement(hl.v,{description:H("message.export-entity-help",{entity:H("label.team-lowercase")}),icon:rl.ReactComponent,id:"export",name:H("label.export")}),onClick:Qe,key:"export-button"}];return G.Create&&e.push({label:l.createElement(hl.v,{description:H("message.import-entity-help",{entity:H("label.team-lowercase")}),icon:il.ReactComponent,id:"import-button",name:H("label.import")}),onClick:Ye,key:"import-button"}),e}),[Ye,Qe,G]),$e=(0,l.useMemo)((function(){var e,t;return(0,d.ev)((0,d.ev)((0,d.ev)([],(0,d.CR)($||Oe?[]:Ke)),(0,d.CR)(!(null===(t=null===(e=u.parents)||void 0===e?void 0:e[0])||void 0===t?void 0:t.deleted)&&Oe?[{label:l.createElement(hl.v,{description:H("message.restore-deleted-team"),icon:sl.ReactComponent,id:"restore-team-dropdown",name:H("label.restore-entity",{entity:H("label.team")})}),onClick:qe,key:"restore-team-dropdown"}]:[])),(0,d.CR)(Oe?[]:[{label:l.createElement(hl.v,{description:H("message.access-to-collaborate"),icon:ol.ReactComponent,id:"open-group-dropdown",name:l.createElement(p.Z,null,l.createElement(f.Z,{span:21},l.createElement(E.Z.Text,{className:"font-medium","data-testid":"open-group-label"},H("label.public-team"))),l.createElement(f.Z,{span:3},l.createElement(Te.Z,{checked:u.isJoinable,size:"small"})))}),onClick:He,key:"open-group-dropdown"}]))}),[G,u,Oe,v,I,Qe]),Xe=(0,l.useMemo)((function(){var e;return Boolean(null===(e=null==q?void 0:q.teams)||void 0===e?void 0:e.find((function(e){return e.id===u.id})))}),[u.id,q]),et=(0,l.useCallback)((function(){return Z(!0)}),[Z]),tt=(0,l.useMemo)((function(){var e=_e?H("label.add-entity",{entity:H("label.team")}):H("message.no-permission-for-action");return Oe&&(e=H("message.this-action-is-not-allowed-for-deleted-entities")),0!==u.childrenCount||ie?l.createElement(p.Z,{className:"team-list-container",gutter:[0,16],justify:"space-between"},l.createElement(f.Z,{span:8},l.createElement(We.Z,{removeMargin:!0,placeholder:H("label.search-entity",{entity:H("label.team")}),searchValue:ie,typingInterval:500,onSearch:Je})),l.createElement(f.Z,null,l.createElement(j.Z,{align:"center"},l.createElement("span",null,l.createElement(Te.Z,{checked:I,"data-testid":"show-deleted",onClick:A}),l.createElement(E.Z.Text,{className:"m-l-xs"},H("label.deleted"))),_e&&!Oe&&l.createElement(h.Z,{"data-testid":"add-team",type:"primary",onClick:et},De))),l.createElement(f.Z,{span:24},l.createElement(Rl,{currentTeam:u,data:ue,isFetchingAllTeamAdvancedDetails:F,onTeamExpand:b}))):l.createElement(xe.Z,{icon:l.createElement(ll.ReactComponent,{className:"h-32 w-32"}),type:Re.Wx.CUSTOM},l.createElement(E.Z.Paragraph,{style:{marginBottom:"0"}},H("message.adding-new-entity-is-easy-just-give-it-a-spin",{entity:H("label.team")})),l.createElement(E.Z.Paragraph,null,l.createElement(at.u1,{i18nKey:"message.refer-to-our-doc",renderElement:l.createElement("a",{href:ze.cK,rel:"noreferrer",target:"_blank"}),values:{doc:H("label.doc-plural-lowercase")}})),l.createElement(Ue.Z,{placement:"top",title:e},l.createElement(h.Z,{ghost:!0,"data-testid":"add-placeholder-button",disabled:!_e||Oe,icon:l.createElement(cn.Z,null),type:"primary",onClick:et},H("label.add"))))}),[De,ie,Oe,u,ue,I,_e,F,b,et,Je,A]),nt=(0,l.useMemo)((function(){return l.createElement(zl,{currentTeam:u,permission:G,onAddUser:L,onRemoveUser:P})}),[u,y,G,L,P]),lt=(0,l.useMemo)((function(){return l.createElement(Cl.Z,{isSummaryPanelOpen:!0,assetCount:n,isEntityDeleted:Oe,noDataPlaceholder:H("message.adding-new-asset-to-team"),permissions:G,type:Zl.V.TEAM,onAddAsset:function(){return V.push(i.Z6.EXPLORE)},onAssetClick:Ie})}),[G,n,Ie,Oe]),rt=(0,l.useMemo)((function(){var e,t;return(0,g.isEmpty)(null!==(e=u.defaultRoles)&&void 0!==e?e:[])?Fe({permission:G.EditAll,heading:H("label.role"),doc:ze._F,children:H("message.assigning-team-entity-description",{entity:H("label.role-lowercase"),name:u.name}),type:Re.Wx.ASSIGN,button:l.createElement(Ue.Z,{placement:"bottomRight",title:Oe?H("message.this-action-is-not-allowed-for-deleted-entities"):H("label.add-entity",{entity:H("label.role")})},l.createElement(h.Z,{ghost:!0,className:ca()({"p-x-lg":G.EditAll&&!Oe}),"data-testid":"add-placeholder-button",disabled:Oe,icon:l.createElement(cn.Z,null),type:"primary",onClick:function(){var e;return ve({type:Ge.py.ROLE,selectedData:null!==(e=u.defaultRoles)&&void 0!==e?e:[]})}},H("label.add")))}):l.createElement(p.Z,{className:"roles-and-policy p-y-md",gutter:[0,10]},G.EditAll&&!Oe&&l.createElement(f.Z,{className:"d-flex justify-end",span:24},l.createElement(h.Z,{"data-testid":"add-role",type:"primary",onClick:function(){var e;return ve({type:Ge.py.ROLE,selectedData:null!==(e=u.defaultRoles)&&void 0!==e?e:[]})}},Le)),l.createElement(f.Z,{span:24},l.createElement(Nl,{hasAccess:G.EditAll,isTeamDeleted:Oe,list:null!==(t=u.defaultRoles)&&void 0!==t?t:[],type:Ge.py.ROLE,onDelete:function(e){return ge({record:e,attribute:"defaultRoles"})}})))}),[u,G,Le,Oe]),it=(0,l.useMemo)((function(){var e;return(0,g.isEmpty)(u.policies)?Fe({permission:G.EditAll,children:H("message.assigning-team-entity-description",{entity:H("label.policy-lowercase-plural"),name:u.name}),type:Re.Wx.ASSIGN,button:l.createElement(Ue.Z,{placement:"bottomRight",title:Oe?H("message.this-action-is-not-allowed-for-deleted-entities"):H("label.add-entity",{entity:H("label.policy")})},l.createElement(h.Z,{ghost:!0,className:ca()({"p-x-lg":G.EditAll&&!Oe}),"data-testid":"add-placeholder-button",disabled:Oe,icon:l.createElement(cn.Z,null),type:"primary",onClick:function(){var e;return ve({type:Ge.py.POLICY,selectedData:null!==(e=u.policies)&&void 0!==e?e:[]})}},H("label.add")))}):l.createElement(p.Z,{className:"roles-and-policy p-y-md",gutter:[0,10]},G.EditAll&&!Oe&&l.createElement(f.Z,{className:"d-flex justify-end",span:24},l.createElement(h.Z,{"data-testid":"add-policy",title:G.EditAll?ke:H("message.no-permission-for-action"),type:"primary",onClick:function(){var e;return ve({type:Ge.py.POLICY,selectedData:null!==(e=u.policies)&&void 0!==e?e:[]})}},ke)),l.createElement(f.Z,{span:24},l.createElement(Nl,{hasAccess:G.EditAll,isTeamDeleted:Oe,list:null!==(e=u.policies)&&void 0!==e?e:[],type:Ge.py.POLICY,onDelete:function(e){return ge({record:e,attribute:"policies"})}})))}),[u,G,ke,Oe]),ut=(0,l.useMemo)((function(){return!K&&!(0,g.isUndefined)(q)&&(Xe?l.createElement(h.Z,{ghost:!0,"data-testid":"leave-team-button",type:"primary",onClick:function(e){e.stopPropagation(),je(q.id,!0)}},H("label.leave-team")):(Boolean(u.isJoinable)||J)&&l.createElement(h.Z,{"data-testid":"join-teams",type:"primary",onClick:Ve},H("label.join-team")))}),[q,Xe,J,Ve,je]),dt=(0,l.useMemo)((function(){var e,t,n,a;return l.createElement(l.Fragment,null,l.createElement(j.Z,{wrap:!0,className:"w-full justify-between"},l.createElement(j.Z,{className:"w-full",size:"middle"},l.createElement(nl.C,{className:"teams-profile",size:40},l.createElement(cl.ReactComponent,{className:"text-primary",width:20})),l.createElement("div",{className:"d-flex flex-column gap-1"},!K&&l.createElement(x.Z,{titleLinks:pe}),l.createElement(kl,{currentTeam:u,entityPermissions:G,updateTeamHandler:S}))),l.createElement(j.Z,{align:"center"},ut,K?l.createElement($t.Z,{canDelete:!1,displayName:(0,Q.C_)(u),entityName:null!==(a=u.fullyQualifiedName)&&void 0!==a?a:u.name,entityType:Ge.py.TEAM,extraDropdownContent:(0,d.ev)([],(0,d.CR)(Ke))}):G.EditAll&&l.createElement($t.Z,{isRecursiveDelete:!0,afterDeleteAction:U,allowSoftDelete:!u.deleted,canDelete:G.EditAll,displayName:(0,Q.C_)(u),entityId:u.id,entityName:null!==(e=u.fullyQualifiedName)&&void 0!==e?e:u.name,entityType:Ge.py.TEAM,extraDropdownContent:$e,hardDeleteMessagePostFix:yl(null!==(t=u.fullyQualifiedName)&&void 0!==t?t:u.name,H("label.permanently-lowercase")),softDeleteMessagePostFix:yl(null!==(n=u.fullyQualifiedName)&&void 0!==n?n:u.name,H("label.soft-lowercase"))}))),l.createElement("div",{className:"p-t-md p-l-xss"},l.createElement(Pl,{childTeamsCount:v.length,currentTeam:u,entityPermissions:G,isGroupType:$,isTeamDeleted:Oe,parentTeams:z,updateTeamHandler:S})))}),[Oe,$,z,v,u,K,pe,G,ut,$e,S,U,yl]),mt=(0,l.useCallback)((function(e){switch(e){case el.ASSETS:return lt;case el.POLICIES:return it;case el.ROLES:return rt;case el.TEAMS:return tt;case el.USERS:return nt}}),[lt,it,rt,tt,nt]),pt=(0,l.useCallback)((function(e){return l.createElement(p.Z,{className:"teams-tabs-content-container p-x-lg"},l.createElement(f.Z,{className:"teams-scroll-component",span:we?18:24},_?l.createElement(N.Z,null):mt(e)),we&&l.createElement(f.Z,{className:"border-left team-assets-right-panel",span:6},l.createElement(gl.Z,{entityDetails:we,handleClosePanel:function(){return Ie(void 0)}})))}),[we,_,mt]),Et=(0,l.useMemo)((function(){return function(e,t,n,a,l){var r,i,s,o,c={teams:{name:(0,vn.t)("label.team-plural"),count:a,key:el.TEAMS},users:{name:(0,vn.t)("label.user-plural"),count:null!==(i=null===(r=e.users)||void 0===r?void 0:r.length)&&void 0!==i?i:0,key:el.USERS},assets:{name:(0,vn.t)("label.asset-plural"),count:l,key:el.ASSETS},roles:{name:(0,vn.t)("label.role-plural"),count:null===(s=null==e?void 0:e.defaultRoles)||void 0===s?void 0:s.length,key:el.ROLES},policies:{name:(0,vn.t)("label.policy-plural"),count:null===(o=null==e?void 0:e.policies)||void 0===o?void 0:o.length,key:el.POLICIES}},u=[c.roles,c.policies];return n?(0,d.ev)([c.teams],(0,d.CR)(u)):t?(0,d.ev)([c.users,c.assets],(0,d.CR)(u)):(0,d.ev)([c.teams,c.users],(0,d.CR)(u))}(u,$,K,Pe,n).map((function(e){return(0,d.pi)((0,d.pi)({},e),{label:l.createElement(ct.Z,{count:e.count,id:e.key,isActive:te===e.key,name:e.name}),children:pt(e.key)})}))}),[u,ie,Pe,te,n,mt,pt]),yt=(0,l.useMemo)((function(){return(G.EditDescription||G.EditAll)&&!Oe}),[G,Oe]);return y>0?l.createElement(N.Z,null):(0,g.isEmpty)(u)?Fe({onClick:function(){return Z(!0)},permission:_e,heading:H("label.team-plural"),doc:ze.E6}):l.createElement("div",{className:"teams-layout"},l.createElement(p.Z,{className:"h-full","data-testid":"team-details-container"},K&&l.createElement(f.Z,{className:"p-x-lg p-y-sm",span:24},l.createElement(x.Z,{titleLinks:Me})),l.createElement(f.Z,{className:"teams-profile-container p-x-lg","data-testid":"team-detail-header",span:24},l.createElement(al.Z,{accordion:!0,bordered:!1,className:"header-collapse-custom-collapse"},l.createElement(al.Z.Panel,{className:"header-collapse-custom-panel","data-testid":"team-details-collapse",header:dt,key:"1"},l.createElement(p.Z,null,l.createElement(f.Z,{className:"border-top",span:24},l.createElement(B.Z,{className:"ant-card-feed card-body-border-none card-padding-y-0 p-y-sm","data-testid":"teams-description"},l.createElement(Kt.Z,{description:null!==(t=u.description)&&void 0!==t?t:"",entityName:(0,Q.C_)(u),entityType:Ge.py.TEAM,hasEditAccess:yt,isEdit:m,showCommentsIcon:!1,onCancel:function(){return w(!1)},onDescriptionEdit:function(){return w(!0)},onDescriptionUpdate:T}))))))),l.createElement(f.Z,{className:"m-t-sm",span:24},l.createElement(st.Z,{destroyInactiveTabPane:!0,activeKey:te,className:"entity-details-page-tabs",items:Et,onChange:function(e){V.push({search:Sa().stringify({activeTab:e})})}})),l.createElement(ft.Z,{cancelText:H("label.cancel"),okText:H("label.confirm"),open:ae.state,title:ae.leave?H("label.leave-team"):H("label.removing-user"),onCancel:function(){return le(X)},onOk:function(){var e;ae.leave?(0,d.mG)(void 0,void 0,void 0,(function(){var e,t,n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:return q&&u?(e=(e=(0,g.cloneDeep)(null!==(a=q.teams)&&void 0!==a?a:[])).filter((function(e){return e.id!==u.id})),t=(0,d.pi)((0,d.pi)({},q),{teams:e}),n=(0,ot.qu)(q,t),[4,k(q.id,n)]):[3,2];case 1:l.sent(),l.label=2;case 2:return[2]}}))})).then((function(){le(X)})):P(null===(e=ae.user)||void 0===e?void 0:e.id).then((function(){le(X)}))}},function(e){var t,n,a,l,r=e?H("message.leave-the-team-team-name",{teamName:null!==(t=null==u?void 0:u.displayName)&&void 0!==t?t:null==u?void 0:u.name}):H("label.remove-entity",{entity:null!==(a=null===(n=ae.user)||void 0===n?void 0:n.displayName)&&void 0!==a?a:null===(l=ae.user)||void 0===l?void 0:l.name});return H("message.are-you-sure-want-to-text",{text:r})}(ae.leave)),ye&&l.createElement(ma,{isModalLoading:Ze,isOpen:!(0,g.isUndefined)(ye),selectedKeys:ye.selectedData.map((function(e){return e.id})),title:H("label.add")+" "+ye.type,type:ye.type,onCancel:function(){return ve(void 0)},onSave:function(e){return t=e,(0,d.mG)(void 0,void 0,void 0,(function(){var e,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:if(!ye)return[3,2];switch(Ne(!0),e=(0,d.pi)({},u),n=t.map((function(e){var t=ye.selectedData.find((function(t){return t.id===e}));return null!=t?t:{id:e,type:ye.type}})),ye.type){case Ge.py.ROLE:e=(0,d.pi)((0,d.pi)({},e),{defaultRoles:n});break;case Ge.py.POLICY:e=(0,d.pi)((0,d.pi)({},e),{policies:n})}return[4,S(e)];case 1:a.sent(),ve(void 0),Ne(!1),a.label=2;case 2:return[2]}}))}));var t}}),be&&l.createElement(ft.Z,{centered:!0,closable:!1,confirmLoading:Ze,maskClosable:!1,okText:H("label.confirm"),open:!(0,g.isUndefined)(be.record),title:H("label.remove-entity",{entity:(0,Q.C_)(null==be?void 0:be.record)})+" "+H("label.from-lowercase")+" "+(0,Q.C_)(u),onCancel:function(){return ge(void 0)},onOk:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(e){switch(e.label){case 0:return[4,(t=be.record,n=be.attribute,(0,d.mG)(void 0,void 0,void 0,(function(){var e,a,l,r,i;return(0,d.Jh)(this,(function(s){switch(s.label){case 0:return Ne(!0),e=null!==(i=u[n])&&void 0!==i?i:[],a=e.filter((function(e){return e.id!==t.id})),l=(0,d.pi)((0,d.pi)({},u),((r={})[n]=a,r)),[4,S(l)];case 1:return s.sent(),Ne(!1),[2]}}))})))];case 1:return e.sent(),ge(void 0),[2]}var t,n}))}))}},l.createElement(E.Z.Text,null,H("message.are-you-sure-you-want-to-remove-child-from-parent",{child:(0,Q.C_)(be.record),parent:(0,Q.C_)(u)})))))};!function(e){e.BusinessUnit="BusinessUnit",e.Department="Department",e.Division="Division",e.Group="Group",e.Organization="Organization"}(Al||(Al={}));var _l=n(34005),Bl=function(e){var t,n=e.visible,r=e.onCancel,s=e.onSave,o=e.isLoading,c=e.parentTeamType,u=(0,C.$)().t,p=(0,d.CR)((0,b.useForm)(),1)[0],f=(0,d.CR)((0,l.useState)(""),2),E=f[0],y=f[1],Z=(0,d.CR)((0,l.useState)([]),2),N=Z[0],S=Z[1],x=(0,l.useRef)(),I=(0,_l.z)().activeDomainEntityRef,A=null!==(t=m.Z.useWatch("domains",p))&&void 0!==t?t:[],R=(0,l.useMemo)((function(){return vl(c).map((function(e){return{label:e,value:e}}))}),[c]),M={name:"domains",id:"root/domains",required:!1,label:u("label.domain"),type:re.Uv.DOMAIN_SELECT,props:{selectedDomain:I?[I]:void 0,multiple:!0,children:l.createElement(h.Z,{"data-testid":"add-domain",icon:l.createElement(cn.Z,{style:{color:"white",fontSize:"12px"}}),size:"small",type:"primary"})},formItemLayout:re.EP.HORIZONTAL,formItemProps:{valuePropName:"selectedDomain",trigger:"onUpdate",initialValue:I?[I]:void 0}},k={name:"isJoinable",label:u("label.public-team"),type:re.Uv.SWITCH,required:!1,props:{"data-testid":"isJoinable-switch-button"},id:"isJoinable-switch-button",formItemLayout:re.EP.HORIZONTAL,helperText:u("message.access-to-collaborate")};return(0,l.useEffect)((function(){n&&(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,Pn.LK)()];case 1:return e=n.sent().data,S(e),[3,3];case 2:return t=n.sent(),(0,O.Eo)(t,u("server.unexpected-response")),[3,3];case 3:return[2]}}))}))}),[n]),l.createElement(ft.Z,{centered:!0,closable:!1,confirmLoading:o,maskClosable:!1,okButtonProps:{form:"add-team-form",type:"primary",htmlType:"submit"},okText:u("label.save"),open:n,title:u("label.add-entity",{entity:u("label.team")}),width:750,onCancel:r},l.createElement(m.Z,{form:p,id:"add-team-form",initialValues:{teamType:a.Group,isJoinable:!1},layout:"vertical",name:"add-team-nest-messages",validateMessages:i.NG,onFinish:function(e){e=(0,d.pi)((0,d.pi)({},e),{name:(0,g.trim)(e.name),displayName:(0,g.trim)(e.displayName),description:E}),s(e)}},l.createElement(m.Z.Item,{label:u("label.name"),name:"name",rules:(0,d.ev)((0,d.ev)([],(0,d.CR)(w.m)),[{validator:function(e,t){return N.some((function(e){return(0,g.toLower)(e.name)===(0,g.toLower)(t)}))?Promise.reject(u("message.entity-already-exists",{entity:u("label.name")})):Promise.resolve()}}])},l.createElement(v.Z,{"data-testid":"name",placeholder:u("label.enter-entity",{entity:u("label.name")})})),l.createElement(m.Z.Item,{label:u("label.display-name"),name:"displayName",rules:[{required:!0,type:"string",whitespace:!0,min:1,max:128}]},l.createElement(v.Z,{"data-testid":"display-name",placeholder:u("message.enter-display-name")})),l.createElement(m.Z.Item,{label:u("label.email"),name:"email",rules:[{type:"email"}]},l.createElement(v.Z,{"data-testid":"email",placeholder:u("label.enter-entity",{entity:u("label.email-lowercase")})})),l.createElement(m.Z.Item,{label:u("label.team-type"),name:"teamType"},l.createElement(Tt.Z,{"data-testid":"team-selector",options:R,placeholder:u("message.select-team")})),(0,se.rz)(k),l.createElement(m.Z.Item,{label:u("label.description"),name:"description",style:{marginBottom:0}},l.createElement(T.Z,{"data-testid":"description",initialValue:"",ref:x,onTextChange:function(e){return y(e)}})),l.createElement("div",{className:"m-t-xs"},(0,se.rz)(M),A&&l.createElement(Ll.y,{multiple:!0,domain:A,entityFqn:"",entityId:"",entityType:Ge.py.GLOSSARY,hasPermission:!1}))))},jl=function(){var e=(0,r.k6)(),t=(0,C.$)().t,n=(0,o.BL)().getEntityPermissionByFqn,a=(0,M.f)().fqn,i=(0,d.CR)((0,l.useState)([]),2),s=i[0],u=i[1],m=(0,d.CR)((0,l.useState)({}),2),p=m[0],f=m[1],E=(0,d.CR)((0,l.useState)(0),2),y=E[0],v=E[1],h=(0,d.CR)((0,l.useState)(!1),2),b=h[0],Z=h[1],S=(0,d.CR)((0,l.useState)(!0),2),T=S[0],x=S[1],w=(0,d.CR)((0,l.useState)(!1),2),I=w[0],A=w[1],k=(0,d.CR)((0,l.useState)(!1),2),L=k[0],P=k[1],U=(0,d.CR)((0,l.useState)(!1),2),z=U[0],G=U[1],_=(0,d.CR)((0,l.useState)(0),2),B=_[0],j=_[1],F=(0,d.CR)((0,l.useState)([]),2),H=F[0],V=F[1],W=(0,R.N)().updateCurrentUser,J=(0,d.CR)((0,l.useState)(bt.Bd),2),q=J[0],Y=J[1],K=(0,d.CR)((0,l.useState)(!1),2),$=K[0],X=K[1],ee=(0,d.CR)((0,l.useState)(!1),2),te=ee[0],ae=ee[1],le=(0,l.useMemo)((function(){return q.ViewAll||q.ViewBasic}),[q]),re=function(e){A(e)},ie=function(e){P(e)},se=function(e,t,n){var a,l;try{for(var r=(0,d.XA)(e),i=r.next();!i.done;i=r.next()){var s=i.value;if(s.fullyQualifiedName===t){s.children=n;break}s.children&&s.children.length>0&&se(s.children,t,n)}}catch(e){a={error:e}}finally{try{i&&!i.done&&(l=r.return)&&l.call(r)}finally{if(a)throw a.error}}},oe=function(e,n,a){return void 0===e&&(e=!0),void 0===a&&(a=!1),(0,d.mG)(void 0,void 0,void 0,(function(){var l,r,i,o;return(0,d.Jh)(this,(function(c){switch(c.label){case 0:e&&v((function(e){return++e})),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,(0,Pn.LK)({parentTeam:null!=n?n:"organization",include:Me.y.All,fields:[Ge.GB.USER_COUNT,Ge.GB.CHILDREN_COUNT,Ge.GB.OWNS,Ge.GB.PARENTS]})];case 2:return l=c.sent().data,r=l.map((function(e){return(0,d.pi)((0,d.pi)({},e),{key:e.fullyQualifiedName,children:e.childrenCount&&e.childrenCount>0?[]:void 0})})),a?(i=(0,g.cloneDeep)(s),se(i,n||"",r),u(i)):u(r),[3,5];case 3:return o=c.sent(),(0,O.Eo)(o,t("server.unexpected-response")),[3,5];case 4:return ae(!1),[7];case 5:return e&&v((function(e){return--e})),[2]}}))}))},ce=function(e,n,a){return void 0===n&&(n=!1),void 0===a&&(a=!0),(0,d.mG)(void 0,void 0,void 0,(function(){var l,r,i;return(0,d.Jh)(this,(function(s){switch(s.label){case 0:x(a),s.label=1;case 1:return s.trys.push([1,7,,8]),[4,(0,Pn.Xv)(e,{fields:Ge.GB.PARENTS,include:Me.y.All})];case 2:return(l=s.sent())?(V((function(e){return n?[l]:(0,d.ev)([l],(0,d.CR)(e))})),(0,g.isEmpty)(l.parents)||!(null===(i=l.parents)||void 0===i?void 0:i[0].name)?[3,4]:[4,ce(l.parents[0].name,!1,a)]):[3,5];case 3:s.sent(),s.label=4;case 4:return[3,6];case 5:throw t("server.unexpected-response");case 6:return[3,8];case 7:return r=s.sent(),(0,O.Eo)(r,t("server.unexpected-response")),[3,8];case 8:return[2]}}))}))},ue=function(e,n){return void 0===n&&(n=!1),(0,d.mG)(void 0,void 0,void 0,(function(){var a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:x(n),i.label=1;case 1:return i.trys.push([1,5,6,7]),[4,(0,Pn.Xv)(e,{fields:[Ge.GB.USERS,Ge.GB.PARENTS,Ge.GB.PROFILE,Ge.GB.OWNERS],include:Me.y.All})];case 2:return a=i.sent(),f(a),(0,g.isEmpty)(a.parents)||!(null===(r=a.parents)||void 0===r?void 0:r[0].name)?[3,4]:[4,ce(a.parents[0].name,!0,n)];case 3:i.sent(),i.label=4;case 4:return[3,7];case 5:return l=i.sent(),(0,O.Eo)(l,t("server.unexpected-response")),[3,7];case 6:return x(!1),[7];case 7:return[2]}}))}))},de=(0,l.useCallback)((function(){var e,n;n=a,(0,d.mG)(void 0,void 0,void 0,(function(){var e,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:X(!0),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,(0,Pn.Xv)(n,{fields:[Ge.GB.USERS,Ge.GB.DEFAULT_ROLES,Ge.GB.POLICIES,Ge.GB.CHILDREN_COUNT,Ge.GB.DOMAINS],include:Me.y.All})];case 2:return e=l.sent(),f((function(t){return(0,d.pi)((0,d.pi)({},t),e)})),function(e){(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:if(!e.id||e.teamType!==Al.Group)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,(0,qt.rg)("",0,0,"owners.id:"+e.id,"","",Oa.W.ALL)];case 2:return t=i.sent(),n=null!==(r=null===(l=null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.hits)||void 0===l?void 0:l.total.value)&&void 0!==r?r:0,j(n),[3,4];case 3:return i.sent(),[3,4];case 4:return[2]}}))}))}(e),[3,5];case 3:return a=l.sent(),(0,O.Eo)(a,t("server.unexpected-response")),[3,5];case 4:return X(!1),[7];case 5:return[2]}}))})),e=a,(0,d.mG)(void 0,void 0,void 0,(function(){var n,a,l;return(0,d.Jh)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,Pn.LK)({parentTeam:null!=e?e:"organization",include:Me.y.All})];case 1:return n=r.sent().data,a=n.map((function(e){return(0,d.pi)((0,d.pi)({},e),{key:e.fullyQualifiedName,children:e.childrenCount&&e.childrenCount>0?[]:void 0})})),u(a),ae(!0),[3,3];case 2:return l=r.sent(),(0,O.Eo)(l,t("server.unexpected-response")),[3,3];case 3:return[2]}}))}))}),[a]),me=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,t;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:x(!0),l.label=1;case 1:return l.trys.push([1,5,6,7]),[4,n(c.A.TEAM,a)];case 2:return e=l.sent(),Y(e),e.ViewAll||e.ViewBasic?[4,ue(a,!0)]:[3,4];case 3:l.sent(),de(),l.label=4;case 4:return[3,7];case 5:return t=l.sent(),(0,O.Eo)(t),[3,7];case 6:return x(!1),[7];case 7:return[2]}}))}))}),[a]);return(0,l.useEffect)((function(){me()}),[a]),(0,l.useEffect)((function(){te&&a&&oe(!1,a)}),[te,a]),T?l.createElement(N.Z,null):le?(0,g.isEmpty)(p)?l.createElement(xe.Z,null):l.createElement(ne.Z,{pageTitle:t("label.team-plural")},l.createElement(Gl,{afterDeleteAction:function(t){t?(f((function(e){return e?(0,d.pi)((0,d.pi)({},e),{deleted:!(null==e?void 0:e.deleted)}):e})),u((function(e){return e.map((function(e){return(0,d.pi)((0,d.pi)({},e),{deleted:!(null==e?void 0:e.deleted)})}))}))):e.push((0,D.KH)(Al.Organization))},assetsCount:B,childTeams:s,currentTeam:p,descriptionHandler:re,entityPermissions:q,handleAddTeam:ie,handleAddUser:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var n,a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:if((0,g.isUndefined)(p)||(0,g.isUndefined)(p.users))return[3,4];n=(0,d.pi)((0,d.pi)({},p),{users:e}),a=(0,ot.qu)(p,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,(0,Pn.Cp)(p.id,a)];case 2:return l=i.sent(),f((function(e){return(0,d.pi)((0,d.pi)({},e),l)})),[3,4];case 3:return r=i.sent(),(0,O.Eo)(r,t("server.entity-updating-error",{entity:t("label.team")})),[3,4];case 4:return[2]}}))}))},handleJoinTeamClick:function(e,n){return(0,d.mG)(void 0,void 0,void 0,(function(){var a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(0,an.f_)(e,n)];case 1:return a=i.sent(),l=(0,Q.hL)(a,Ge.py.USER),f((function(e){return(0,d.pi)((0,d.pi)({},e),{users:e.users?(0,d.ev)([l],(0,d.CR)(e.users)):[l]})})),W(a),(0,O.XA)(t("server.join-team-success"),2e3),[3,3];case 2:return r=i.sent(),(0,O.Eo)(r,t("server.join-team-error")),[3,3];case 3:return[2]}}))}))},handleLeaveTeamClick:function(e,n){return(0,d.mG)(void 0,void 0,void 0,(function(){var a,l;return(0,d.Jh)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,an.f_)(e,n)];case 1:return a=r.sent(),W(a),f((function(e){return(0,d.pi)((0,d.pi)({},e),{users:(0,g.filter)(e.users,(function(e){return e.id!==a.id}))})})),(0,O.XA)(t("server.leave-team-success"),2e3),[3,3];case 2:return l=r.sent(),(0,O.Eo)(l,t("server.leave-team-error")),[3,3];case 3:return[2]}}))}))},isDescriptionEditable:I,isFetchingAdvancedDetails:$,isFetchingAllTeamAdvancedDetails:te,isTeamMemberLoading:y,parentTeams:H,removeUserFromTeam:function(e){var n,a=null===(n=null==p?void 0:p.users)||void 0===n?void 0:n.filter((function(t){return t.id!==e})),l=(0,d.pi)((0,d.pi)({},p),{users:a}),r=(0,ot.qu)(p,l);return new Promise((function(e){(0,Pn.Cp)(p.id,r).then((function(e){if(!e)throw t("server.unexpected-response");f((function(t){return(0,d.pi)((0,d.pi)({},t),e)}))})).catch((function(e){(0,O.Eo)(e,t("server.entity-updating-error",{entity:t("label.team")}))})).finally((function(){e()}))}))},showDeletedTeam:b,updateTeamHandler:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var n,a,l;return(0,d.Jh)(this,(function(r){switch(r.label){case 0:n=(0,ot.qu)(p,e),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(0,Pn.Cp)(p.id,n)];case 2:return a=r.sent(),f(a),[3,4];case 3:return l=r.sent(),(0,O.Eo)(l,t("server.entity-updating-error",{entity:t("label.team")})),[3,4];case 4:return[2]}}))}))},onDescriptionUpdate:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var n,a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:if(p.description===e)return[3,6];n=(0,d.pi)((0,d.pi)({},p),{description:e}),a=(0,ot.qu)(p,n),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,(0,Pn.Cp)(p.id,a)];case 2:if(!(l=i.sent()))throw t("server.unexpected-response");return f((function(e){return(0,d.pi)((0,d.pi)({},e),l)})),[3,5];case 3:return r=i.sent(),(0,O.Eo)(r),[3,5];case 4:return re(!1),[7];case 5:return[3,7];case 6:re(!1),i.label=7;case 7:return[2]}}))}))},onShowDeletedTeamChange:function(){Z((function(e){return!e}))},onTeamExpand:oe}),p.teamType&&l.createElement(Bl,{isLoading:z,parentTeamType:p.teamType,visible:L,onCancel:function(){return P(!1)},onSave:function(e){return function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var n,l,r,i,s,o;return(0,d.Jh)(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,3,4]),G(!0),n=null!==(s=null===(i=null==e?void 0:e.domains)||void 0===i?void 0:i.map((function(e){var t;return null!==(t=e.fullyQualifiedName)&&void 0!==t?t:""})))&&void 0!==s?s:[],l={name:e.name,displayName:e.displayName,description:e.description,teamType:e.teamType,parents:a?[p.id]:void 0,email:e.email||void 0,domains:n,isJoinable:e.isJoinable},[4,(0,Pn.Cm)(l)];case 1:return c.sent()&&(ue(p.name,!0),ie(!1),de()),[3,4];case 2:return r=c.sent(),(null===(o=r.response)||void 0===o?void 0:o.status)===wn.N.CONFLICT?(0,O.Eo)(t("server.entity-already-exist",{entity:t("label.team"),entityPlural:t("label.team-plural-lowercase"),name:e.name})):(0,O.Eo)(r,t("server.create-entity-error",{entity:t("label.team-lowercase")})),[3,4];case 3:return G(!1),[7];case 4:return[2]}}))}))}(e)}})):l.createElement(xe.Z,{type:Re.Wx.PERMISSION})},Fl=n(73213),Hl=n(64738),Vl={};Vl.styleTagTransform=Ce(),Vl.setAttributes=ve(),Vl.insert=Ee().bind(null,"head"),Vl.domAPI=pe(),Vl.insertStyleElement=be(),de()(Hl.Z,Vl),Hl.Z&&Hl.Z.locals&&Hl.Z.locals;var Wl=[s.lx.USERS,s.lx.ADMINS],Jl=function(){var e=(0,C.$)().t,t=(0,r.UO)().tab,n=(0,r.k6)(),a=(0,r.TH)(),o=(0,l.useMemo)((function(){return t===s.lx.ADMINS}),[t]),c=(0,Be.a)().isAdminUser,u=(0,d.CR)((0,l.useState)(!0),2),m=u[0],E=u[1],y=(0,d.CR)((0,l.useState)(!1),2),v=y[0],b=y[1],Z=(0,d.CR)((0,l.useState)([]),2),N=Z[0],S=Z[1],T=(0,d.CR)((0,l.useState)(),2),w=T[0],A=T[1],R=(0,d.CR)((0,l.useState)(!1),2),M=R[0],k=R[1],L=(0,d.CR)((0,l.useState)(!1),2),D=L[0],P=L[1],U=v&&!m,z=(0,d.CR)((0,l.useState)(!1),2),G=z[0],_=z[1],B=(0,d.CR)((0,l.useState)(""),2),F=B[0],H=B[1],V=(0,I.o)().getResourceLimit,q=(0,Le.C)(i.Ou),Y=q.currentPage,K=q.handlePageChange,$=q.handlePageSizeChange,X=q.handlePagingChange,ee=q.pageSize,te=q.paging,ae=q.showPagination,le=(0,l.useMemo)((function(){return(0,oe.Mx)(s.CZ.MEMBERS,(0,g.capitalize)(t))}),[t]),re=function(t){return(0,d.mG)(void 0,void 0,void 0,(function(){var n,a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:E(!0),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,(0,an.Rf)((0,d.pi)({isBot:!1,fields:[Ge.GB.PROFILE,Ge.GB.TEAMS,Ge.GB.ROLES].join(","),limit:ee},t))];case 2:return n=i.sent(),a=n.data,l=n.paging,S(a),X(l),[3,4];case 3:return r=i.sent(),(0,O.Eo)(r,e("server.entity-fetch-error",{entity:e("label.user")})),[3,4];case 4:return E(!1),[2]}}))}))},ie=function(t,n){E(!0),function(t,n,a,l){void 0===t&&(t=Fl.m),void 0===n&&(n=1),void 0===a&&(a=!1),void 0===l&&(l=!1);var r="isBot:false";return a&&(r="isAdmin:true isBot:false"),new Promise((function(a){(0,qt.rg)(t,n,ee,r,"","",Oa.W.USER,l).then((function(e){var t=e.data.hits.hits.map((function(e){return e._source}));X({total:e.data.hits.total.value}),a(t)})).catch((function(t){(0,O.Eo)(t,e("server.entity-fetch-error",{entity:e("label.user")})),a([])}))}))}(t,n,o,v).then((function(e){S(e),E(!1)}))},se=(0,l.useCallback)((function(e){var t,n=e.cursorType,a=e.currentPage;F?(K(a),ie(F,a)):n&&te[n]&&(K(a),re(((t={isAdmin:o})[n]=te[n],t.include=v?Me.y.Deleted:Me.y.NonDeleted,t)))}),[o,te,ee,v,K,re,ie]),ce=function(e){K(i.j2),H(""),b(e),re({isAdmin:o,include:e?Me.y.Deleted:Me.y.NonDeleted,limit:ee})},ue=function(e){H(e),K(i.j2);var t=new URLSearchParams({user:e});n.replace({search:e&&t.toString()}),e?ie(e,i.j2):re({isAdmin:o,include:v?Me.y.Deleted:Me.y.NonDeleted})};(0,l.useEffect)((function(){E(!0),b(!1),H(""),K(i.j2),$(i.Ou)}),[t]),(0,l.useEffect)((function(){if(Wl.includes(t))if(a.search){var e=new URLSearchParams(a.search).get("user")||"";H(e),ie(e,1),E(!1)}else re({isAdmin:o});else E(!1)}),[ee,o]);var de=function(){n.push(i.Z6.CREATE_USER)},me=(0,l.useMemo)((function(){return(0,d.ev)((0,d.ev)([],(0,d.CR)((0,ln.y5)())),[{title:e("label.action-plural"),dataIndex:"actions",key:"actions",width:90,render:function(t,n){return l.createElement(j.Z,{align:"center",className:"w-full justify-center action-icons",size:8},U&&l.createElement(Ue.Z,{placement:c?"bottom":"left",title:c?e("label.restore-entity",{entity:e("label.user")}):dt.Ov},l.createElement(h.Z,{"data-testid":"restore-user-btn-"+n.name,disabled:!c,icon:l.createElement(sl.ReactComponent,{name:e("label.restore"),width:"16px"}),type:"text",onClick:function(){A(n),P(!0)}})),l.createElement(Ue.Z,{placement:c?"bottom":"left",title:c?e("label.delete-entity",{entity:e("label.user")}):dt.Ov},l.createElement(h.Z,{disabled:!c,icon:l.createElement(W.ReactComponent,{"data-testid":"delete-user-btn-"+n.name,name:e("label.delete"),width:"16px"}),size:"small",type:"text",onClick:function(){A(n),k(!0)}})))}}])}),[U]),pe=(0,l.useMemo)((function(){return l.createElement(ne.Z,{pageTitle:e("label.user-plural")},l.createElement(p.Z,{className:"page-container"},l.createElement(f.Z,{className:"w-full d-flex justify-end"},l.createElement("span",null,l.createElement(Te.Z,{checked:v,"data-testid":"show-deleted",onClick:ce}),l.createElement("span",{className:"m-l-xs"},e("label.deleted")))),l.createElement(f.Z,{className:"mt-24",span:24},l.createElement(xe.Z,{heading:e("label.user"),permission:c,type:Re.Wx.CREATE,onClick:de}))))}),[c,v]);return!(0,g.isEmpty)(N)||v||m||F?l.createElement(ne.Z,{pageTitle:e("label.user-plural")},l.createElement(p.Z,{className:"user-listing p-b-md page-container","data-testid":"user-list-v1-component",gutter:[0,16]},l.createElement(f.Z,{span:24},l.createElement(x.Z,{titleLinks:le})),l.createElement(f.Z,{span:12},l.createElement(J.Z,{data:o?Ae.j.ADMIN:Ae.j.USERS})),l.createElement(f.Z,{span:12},l.createElement(j.Z,{align:"center",className:"w-full justify-end",size:16},l.createElement("span",null,l.createElement(Te.Z,{checked:v,"data-testid":"show-deleted",onClick:ce}),l.createElement("span",{className:"m-l-xs"},e("label.deleted"))),c&&l.createElement(ke.Z,{resource:"user"},l.createElement(h.Z,{"data-testid":"add-user",type:"primary",onClick:de},e("label.add-entity",{entity:e("label.user")}))))),l.createElement(f.Z,{span:8},l.createElement(We.Z,{removeMargin:!0,placeholder:e("label.search-for-type",{type:e("label.user")})+"...",searchValue:F,onSearch:ue})),l.createElement(f.Z,{span:24},l.createElement(Je.Z,{bordered:!0,className:"user-list-table",columns:me,"data-testid":"user-list-table",dataSource:N,loading:m,locale:{emptyText:l.createElement(He.Z,null)},pagination:!1,rowKey:"id",size:"small"})),l.createElement(f.Z,{span:24},ae&&l.createElement(we.Z,{currentPage:Y,isNumberBased:Boolean(F),pageSize:ee,paging:te,pagingHandler:se,onShowSizeChange:$})),l.createElement(ft.Z,{cancelButtonProps:{type:"link"},className:"reactive-modal",closable:!1,confirmLoading:G,maskClosable:!1,okText:e("label.restore"),open:D,title:e("label.restore-entity",{entity:e("label.user")}),onCancel:function(){P(!1),A(void 0)},onOk:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var t;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:if(!w)return[2];_(!0),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,an.Go)(w.id)];case 2:if(!n.sent())throw e("server.entity-updating-error",{entity:e("label.user")});return ue(""),(0,O.XA)(e("message.entity-restored-success",{entity:e("label.user")})),P(!1),[3,5];case 3:return t=n.sent(),(0,O.Eo)(t,e("server.entity-updating-error",{entity:e("label.user")})),[3,5];case 4:return _(!1),[7];case 5:return A(void 0),[2]}}))}))}},l.createElement("p",null,e("message.are-you-want-to-restore",{entity:(0,Q.C_)(w)}))),l.createElement(Fe.Z,{afterDeleteAction:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(e){switch(e.label){case 0:return ue(""),[4,V("user",!0,!0)];case 1:return e.sent(),[2]}}))}))},allowSoftDelete:!v,entityId:(null==w?void 0:w.id)||"",entityName:(0,Q.C_)(w),entityType:Ge.py.USER,visible:M,onCancel:function(){k(!1),A(void 0)}}))):pe},ql=n(15360),Ql=n(67724),Yl=n(78338),Kl=n(89366),$l=n(27509),Xl=n(49795),er=n(96071),tr=n(13508),nr=n(53429),ar=n(98736),lr=n(9546),rr=n(107),ir=n(52924),sr=n(35789),or=function(e){switch(e){case ir.q.Failed:return sr.i.Failure;case ir.q.Success:case ir.q.Completed:return sr.i.Success;case ir.q.Active:case ir.q.Running:return sr.i.Warning;case ir.q.Started:return sr.i.Started;default:return sr.i.Stopped}},cr=function(e){return Object.keys(e).map((function(t){return(0,d.pi)({name:(0,g.upperFirst)(t)},e[t])}))},ur=n(42163),dr=n(68391),mr=n(66219),pr=n(84799),fr=n(72901),Er={};Er.styleTagTransform=Ce(),Er.setAttributes=ve(),Er.insert=Ee().bind(null,"head"),Er.domAPI=pe(),Er.insertStyleElement=be(),de()(fr.Z,Er),fr.Z&&fr.Z.locals&&fr.Z.locals;var yr,vr=function(e){var t,n,a,r,s,o,c=e.data,u=(0,C.$)().t,d=c.successContext,m=c.failureContext,y=c.timestamp,v=c.status,b=function(){var e=document.getElementsByClassName("ReactVirtualized__Grid")[0];(0,g.isNil)(e)||(e.scrollTop=e.scrollHeight)},Z=(0,l.useCallback)((function(e){return e&&l.createElement(p.Z,{className:"p-t-sm"},l.createElement(f.Z,{className:"d-flex justify-end",span:24},l.createElement(j.Z,{size:"small"},l.createElement(h.Z,{ghost:!0,"data-testid":"jump-to-end-button",type:"primary",onClick:b},u("label.jump-to-end")),l.createElement(pr.Z,{copyText:e}))),l.createElement(f.Z,{className:"p-t-md h-min-400 lazy-log-container","data-testid":"lazy-log",span:24},l.createElement(dr.LazyLog,{caseInsensitive:!0,enableSearch:!0,selectableLines:!0,extraLines:1,text:e})))}),[b]),N=(0,l.useCallback)((function(e){return l.createElement(B.Z,{"data-testid":"stats-component",size:"small"},l.createElement(p.Z,{gutter:[16,8]},l.createElement(f.Z,{span:24},l.createElement(j.Z,{wrap:!0,direction:"horizontal",size:0},l.createElement("div",{className:"flex"},l.createElement("span",{className:"text-grey-muted"},u("label.status")+":"),l.createElement(j.Z,{align:"center",className:"m-l-xs",size:8},l.createElement(Pe.Z,{component:i.Zo[v],style:i.K$}),l.createElement("span",null,(0,g.capitalize)(v)))),l.createElement(F.Z,{type:"vertical"}),l.createElement("div",{className:"flex"},l.createElement("span",{className:"text-grey-muted"},u("label.index-states")+":"),l.createElement("span",{className:"m-l-xs"},l.createElement(j.Z,{size:8},l.createElement($.Z,{showZero:!0,className:"request-badge running",count:e.totalRecords,overflowCount:99999999,title:u("label.total-index-sent")+": "+e.totalRecords}),l.createElement($.Z,{showZero:!0,className:"request-badge success",count:e.successRecords,overflowCount:99999999,title:u("label.entity-index",{entity:u("label.success")})+": "+e.successRecords}),l.createElement($.Z,{showZero:!0,className:"request-badge failed",count:e.failedRecords,overflowCount:99999999,title:u("label.entity-index",{entity:u("label.failed")})+": "+e.failedRecords})))),l.createElement(F.Z,{type:"vertical"}),l.createElement("div",{className:"flex"},l.createElement("span",{className:"text-grey-muted"},u("label.last-updated")+":"),l.createElement("span",{className:"m-l-xs"},y?(0,nr.DJ)(y):"--"))))))}),[y,nr.DJ]),S=(0,l.useMemo)((function(){var e,t,n=(null===(e=null==d?void 0:d.stats)||void 0===e?void 0:e.jobStats)||(null===(t=null==m?void 0:m.stats)||void 0===t?void 0:t.jobStats);return(0,g.isEmpty)(n)?[]:[{title:u("label.name"),dataIndex:"name",key:"name"},{title:l.createElement("div",{className:"d-flex items-center"},l.createElement(E.Z.Text,null,u("label.entity-record-plural",{entity:u("label.total")})," "),l.createElement(mr.Z,{className:"entity-stats total m-l-sm",label:n.totalRecords})),dataIndex:"totalRecords",key:"totalRecords",render:function(e){return l.createElement(E.Z.Text,{className:"text-primary"},e)}},{title:l.createElement("div",{className:"d-flex items-center"},l.createElement(E.Z.Text,null,u("label.entity-record-plural",{entity:u("label.success")})," "),l.createElement(mr.Z,{className:"entity-stats success m-l-sm",label:n.successRecords})),dataIndex:"successRecords",key:"successRecords",render:function(e){return l.createElement(E.Z.Text,{className:"text-success"},e)}},{title:l.createElement("div",{className:"d-flex items-center"},l.createElement(E.Z.Text,null,u("label.entity-record-plural",{entity:u("label.failed")})," "),l.createElement(mr.Z,{className:"entity-stats failure m-l-sm",label:n.failedRecords})),dataIndex:"failedRecords",key:"failedRecords",render:function(e){return l.createElement(E.Z.Text,{className:"text-failure"},e)}}]}),[d,m]),T=(0,l.useCallback)((function(e){return l.createElement(Ea.Z,{bordered:!0,className:"m-t-md",columns:S,"data-testid":"app-entity-stats-history-table",dataSource:cr(e),pagination:!1,rowKey:"name",scroll:{y:200},size:"small"})}),[S]);return l.createElement(l.Fragment,null,(null===(t=null==d?void 0:d.stats)||void 0===t?void 0:t.jobStats)&&N(null==d?void 0:d.stats.jobStats),(null===(n=null==m?void 0:m.stats)||void 0===n?void 0:n.jobStats)&&N(null==m?void 0:m.stats.jobStats),(null===(a=null==d?void 0:d.stats)||void 0===a?void 0:a.entityStats)&&T(d.stats.entityStats),(null===(r=null==m?void 0:m.stats)||void 0===r?void 0:r.entityStats)&&T(m.stats.entityStats),Z((0,Cn.NV)(JSON.stringify(null!==(o=null!==(s=null==m?void 0:m.stackTrace)&&void 0!==s?s:null==m?void 0:m.failure)&&void 0!==o?o:{}))))},hr=(0,l.forwardRef)((function(e,t){var n=e.appData,a=e.maxRecords,o=e.showPagination,c=void 0===o||o,u=(0,C.$)().t,m=(0,M.f)().fqn,y=(0,d.CR)((0,l.useState)(!0),2),v=y[0],b=y[1],Z=(0,d.CR)((0,l.useState)([]),2),N=Z[0],S=Z[1],T=(0,d.CR)((0,l.useState)([]),2),x=T[0],w=T[1],I=(0,Le.C)(),A=I.currentPage,R=I.paging,k=I.pageSize,L=I.handlePagingChange,P=I.handlePageChange,U=I.handlePageSizeChange,z=I.showPagination,G=(0,r.k6)(),_=(0,l.useMemo)((function(){return(null==n?void 0:n.appType)===tr.pR.External}),[n]),B=(0,l.useCallback)((function(e){var t,a;if(e){if(_&&n)return G.push((0,D.Ht)(s.lx.APPLICATIONS,null!==(t=n.name)&&void 0!==t?t:"",null!==(a=n.name)&&void 0!==a?a:""));x.includes(e)?w((function(t){return t.filter((function(t){return t!==e}))})):w((function(t){return(0,d.ev)((0,d.ev)([],(0,d.CR)(t)),[e])}))}}),[x]),j=(0,l.useCallback)((function(e){return(null==n?void 0:n.appType)!==tr.pR.External&&(!(e.status!==ir.q.Success||!(0,g.isNull)(null==e?void 0:e.successContext))||e.status===ir.q.Running)}),[]),F=(0,l.useCallback)((function(e,t){return(null==n?void 0:n.appType)===tr.pR.Internal||_&&0===t?l.createElement(h.Z,{className:"p-0","data-testid":"logs",disabled:j(e),size:"small",type:"link",onClick:function(){return B(e.id)}},u("label.log-plural")):i.lH}),[j,n,_,B]),H=(0,l.useMemo)((function(){return[{title:u("label.run-at"),dataIndex:"timestamp",key:"timestamp",render:function(e,t){return(0,nr.o0)(t.timestamp)}},{title:u("label.run-type"),dataIndex:"runType",key:"runType",render:function(e){return l.createElement(E.Z.Text,null,null!=e?e:i.lH)}},{title:u("label.status"),dataIndex:"status",key:"status",render:function(e,t){var n,a=or(null!==(n=t.status)&&void 0!==n?n:ir.q.Stopped);return t.status?l.createElement(ur.Z,{dataTestId:"pipeline-status",label:i.e3[t.status],status:a}):i.lH}},{title:u("label.action-plural"),dataIndex:"actions",key:"actions",render:function(e,t,n){return F(t,n)}}]}),[n,nr.o0,B,or,j,F]),V=(0,l.useCallback)((function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var t,n,l,r,i,s,o;return(0,d.Jh)(this,(function(c){switch(c.label){case 0:return c.trys.push([0,5,6,7]),b(!0),_?(t=Date.now(),n=(0,nr.f5)(30),[4,(0,De.ab)(m,{startTs:n,endTs:t})]):[3,2];case 1:return r=c.sent().data,S(r.map((function(e){var t,n,a;return(0,d.pi)((0,d.pi)({},e),{status:(a=null!==(t=e.pipelineState)&&void 0!==t?t:xa.tB.Failed,a===xa.tB.Failed?ir.q.Failed:a===xa.tB.Success?ir.q.Success:a===xa.tB.Running||a===xa.tB.PartialSuccess||a===xa.tB.Queued?ir.q.Running:ir.q.Failed),id:null!==(n=e.runId)&&void 0!==n?n:""})})).slice(0,a)),[3,4];case 2:return[4,(0,De.ab)(m,{offset:null!==(o=null==e?void 0:e.offset)&&void 0!==o?o:0,limit:null!=a?a:k})];case 3:l=c.sent(),r=l.data,i=l.paging,S(r.map((function(e){return(0,d.pi)((0,d.pi)({},e),{id:e.appId+"-"+e.runType+"-"+e.timestamp})}))),L(i),c.label=4;case 4:return[3,7];case 5:return s=c.sent(),(0,O.Eo)(s),[3,7];case 6:return b(!1),[7];case 7:return[2]}}))}))}),[m,k,a,n]);return(0,l.useImperativeHandle)(t,(function(){return{refreshAppHistory:function(){V()}}})),(0,l.useEffect)((function(){V()}),[m,k]),l.createElement(p.Z,{gutter:[16,16]},l.createElement(f.Z,{span:24},l.createElement(Je.Z,{bordered:!0,columns:H,"data-testid":"app-run-history-table",dataSource:N,expandable:{expandedRowRender:function(e){return l.createElement(vr,{data:e})},showExpandColumn:!1,rowExpandable:function(e){return!j(e)},expandedRowKeys:x},loading:v,locale:{emptyText:l.createElement(xe.Z,{className:"m-y-md"})},pagination:!1,rowKey:"id",size:"small"})),l.createElement(f.Z,{span:24},c&&z&&l.createElement(we.Z,{isNumberBased:!0,currentPage:A,pageSize:k,paging:R,pagingHandler:function(e){var t=e.currentPage;P(t),V({offset:(t-1)*k})},onShowSizeChange:U})))})),br=n(92458),gr=n.n(br),Cr=n(85280),Zr=n(48553),Nr=n(8395),Sr=function(e){var t,n,a,r,i,s=e.appData,o=e.loading,c=o.isRunLoading,u=o.isDeployLoading,m=e.onSave,y=e.onDemandTrigger,v=e.onDeployTrigger,b=(0,C.$)().t,Z=(0,d.CR)((0,l.useState)(!1),2),S=Z[0],T=Z[1],x=(0,l.useRef)(null),w=(0,d.CR)((0,l.useState)(!1),2),A=w[0],R=w[1],M=(0,d.CR)((0,l.useState)(!0),2),k=M[0],L=M[1],D=(0,d.CR)((0,l.useState)(!1),2),O=D[0],P=D[1],U=(0,I.o)().config,z=(0,l.useMemo)((function(){return!(!s||s.scheduleType!==tr.Ix.ScheduledOrManual)}),[s]),G=(null!==(n=null===(t=null==U?void 0:U.limits)||void 0===t?void 0:t.config.featureLimits.find((function(e){return"app"===e.name})))&&void 0!==n?n:{}).pipelineSchedules,_=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,t,n,a;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:L(!0),l.label=1;case 1:return l.trys.push([1,5,6,7]),s.appType===tr.pR.External&&s.pipelines&&s.pipelines.length>0?(e=null!==(n=s.pipelines[0].fullyQualifiedName)&&void 0!==n?n:"",[4,(0,Ia.ne)(e)]):[3,3];case 2:return t=l.sent(),R(null!==(a=t.deployed)&&void 0!==a&&a),[3,4];case 3:R(!1),l.label=4;case 4:return[3,7];case 5:return l.sent(),R(!1),[3,7];case 6:return L(!1),[7];case 7:return[2]}}))}))}),[s]),B=(0,l.useMemo)((function(){var e,t=null===(e=s.appSchedule)||void 0===e?void 0:e.cronExpression;return t?gr().toString(t,{throwExceptionOnParseError:!1}):""}),[s]),H=(0,l.useMemo)((function(){return s.deleted||s.appType!==tr.pR.Internal&&!A?s.deleted?l.createElement(E.Z.Text,null,b("message.application-disabled-message")):l.createElement(E.Z.Text,null,b("message.no-ingestion-pipeline-found")):l.createElement(hr,{appData:s,maxRecords:1,ref:x,showPagination:!1})}),[s,A,x]),V=(0,l.useMemo)((function(){return Nr.Z.getScheduleOptionsForApp(s.name,s.appType,G)}),[s.name,s.appType,G]);return(0,l.useEffect)((function(){_()}),[]),k?l.createElement(N.Z,null):l.createElement(l.Fragment,null,l.createElement(p.Z,null,l.createElement(f.Z,{className:"flex-col",flex:"auto"},s.appSchedule&&l.createElement(l.Fragment,null,l.createElement("div",{className:"d-flex items-center gap-2"},l.createElement(E.Z.Text,{className:"right-panel-label"},b("label.schedule-type")),l.createElement(E.Z.Text,{className:"font-medium","data-testid":"schedule-type"},null!==(a=s.appSchedule.scheduleTimeline)&&void 0!==a?a:"")),!(0,g.isEmpty)(B)&&l.createElement("div",{className:"d-flex items-center gap-2"},l.createElement(E.Z.Text,{className:"right-panel-label"},b("label.schedule-interval")),l.createElement(E.Z.Text,{className:"font-medium","data-testid":"cron-string"},B)))),!s.deleted&&l.createElement(f.Z,{className:"d-flex items-center justify-end",flex:"200px"},l.createElement(j.Z,null,s.appType===tr.pR.External&&l.createElement(h.Z,{"data-testid":"deploy-button",disabled:s.deleted,loading:u,type:"primary",onClick:v},b("label.deploy")),!s.system&&l.createElement(h.Z,{"data-testid":"edit-button",disabled:s.deleted,type:"primary",onClick:function(){return T(!0)}},b("label.edit")),z&&l.createElement(h.Z,{"data-testid":"run-now-button",disabled:s.deleted,loading:c,type:"primary",onClick:function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e;return(0,d.Jh)(this,(function(t){switch(t.label){case 0:return[4,y()];case 1:return t.sent(),null===(e=x.current)||void 0===e||e.refreshAppHistory(),[2]}}))}))}},b("label.run-now")))),l.createElement(F.Z,null),l.createElement(f.Z,{span:24},H)),l.createElement(ft.Z,{destroyOnClose:!0,className:"update-schedule-modal",closable:!1,"data-testid":"update-schedule-modal",footer:null,maskClosable:!1,okText:b("label.save"),open:S,title:b("label.update-entity",{entity:b("label.schedule")})},l.createElement(Zr.Z,{buttonProps:{cancelText:b("label.cancel"),okText:b("label.save")},includePeriodOptions:V,initialData:{repeatFrequency:null!==(i=null===(r=s.appSchedule)||void 0===r?void 0:r.cronExpression)&&void 0!==i?i:(0,Cr.T4)({hour:0,min:0,dow:0})},isLoading:O,onCancel:function(){T(!1)},onSubmit:function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){return(0,d.Jh)(this,(function(t){switch(t.label){case 0:return P(!0),[4,m(e.repeatFrequency)];case 1:return t.sent(),P(!1),T(!1),[2]}}))}))}})))};!function(e){e.DESCRIPTION="description",e.FEATURES="features",e.PERMISSIONS="permissions",e.SCHEDULE="schedule",e.RECENT_RUNS="recent-runs",e.CONFIGURATION="configuration"}(yr||(yr={}));var Tr,xr=n(10779),wr={};wr.styleTagTransform=Ce(),wr.setAttributes=ve(),wr.insert=Ee().bind(null,"head"),wr.domAPI=pe(),wr.insertStyleElement=be(),de()(xr.Z,wr),xr.Z&&xr.Z.locals&&xr.Z.locals,function(e){e.ENABLE="enable",e.DISABLE="disable",e.UNINSTALL="uninstall"}(Tr||(Tr={}));var Ir=function(){var e,t=(0,C.$)().t,n=(0,r.k6)(),a=(0,M.f)().fqn,o=(0,d.CR)((0,l.useState)(),2),c=o[0],u=o[1],m=(0,d.CR)((0,l.useState)(!1),2),y=m[0],v=m[1],b=(0,d.CR)((0,l.useState)(!1),2),Z=b[0],S=b[1],T=(0,d.CR)((0,l.useState)(),2),x=T[0],w=T[1],A=(0,d.CR)((0,l.useState)(null),2),R=A[0],k=A[1],L=(0,d.CR)((0,l.useState)({isFetchLoading:!0,isDeployLoading:!1,isRunLoading:!1,isSaveLoading:!1}),2),P=L[0],U=L[1],z=(0,I.o)().getResourceLimit,G=Nr.Z.getJSONUISchema(),_=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,t,n;return(0,d.Jh)(this,(function(l){switch(l.label){case 0:U((function(e){return(0,d.pi)((0,d.pi)({},e),{isFetchLoading:!0})})),l.label=1;case 1:return l.trys.push([1,4,5,6]),[4,(0,De.Cf)(a,{fields:[Ge.GB.OWNERS,Ge.GB.PIPELINES],include:Me.y.All})];case 2:return e=l.sent(),u(e),[4,Nr.Z.importSchema(a)];case 3:return t=l.sent(),w(t.default),[3,6];case 4:return n=l.sent(),(0,O.Eo)(n),[3,6];case 5:return U((function(e){return(0,d.pi)((0,d.pi)({},e),{isFetchLoading:!1})})),[7];case 6:return[2]}}))}))}),[a,U]),B=function(){n.push((0,D.si)(s.lx.APPLICATIONS))},F=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e;return(0,d.Jh)(this,(function(n){switch(n.label){case 0:if(!c)return[3,5];n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,De.WO)(c.id)];case 2:return n.sent(),(0,O.XA)(t("message.entity-enabled-success",{entity:t("label.application")}),2e3),[3,5];case 3:return e=n.sent(),(0,O.Eo)(e),[3,5];case 4:return B(),[7];case 5:return[2]}}))}))}),[c]),H=(0,l.useCallback)((function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,5,6,7]),U((function(e){return(0,d.pi)((0,d.pi)({},e),{isSaveLoading:!0})})),R!==Tr.ENABLE?[3,1]:(F(),[3,4]);case 1:return[4,(0,De.qS)(null!==(n=null==c?void 0:c.fullyQualifiedName)&&void 0!==n?n:"",R===Tr.UNINSTALL)];case 2:return a.sent(),(0,O.XA)(R===Tr.DISABLE?t("message.app-disabled-successfully"):t("message.app-uninstalled-successfully")),[4,z("app",!0,!0)];case 3:a.sent(),B(),a.label=4;case 4:return[3,7];case 5:return e=a.sent(),(0,O.Eo)(e),[3,7];case 6:return U((function(e){return(0,d.pi)((0,d.pi)({},e),{isSaveLoading:!1})})),[7];case 7:return[2]}}))}))}),[c,R,U]),V=(0,d.ev)((0,d.ev)([],(0,d.CR)((null==c?void 0:c.deleted)?[{label:l.createElement(hl.v,{description:t("message.restore-action-description",{entityType:(0,Q.C_)(c)}),icon:sl.ReactComponent,id:"restore-button",name:t("label.restore")}),onClick:function(e){e.domEvent.stopPropagation(),v(!1),k(Tr.ENABLE),S(!0)},key:"restore-button"}]:[{label:l.createElement(hl.v,{description:t("message.disable-app",{app:(0,Q.C_)(c)}),icon:ql.Z,id:"disable-button",name:t("label.disable")}),key:"disable-button",onClick:function(){S(!0),v(!1),k(Tr.DISABLE)}}])),(0,d.CR)((null==c?void 0:c.system)?[]:[{label:l.createElement(hl.v,{description:t("message.uninstall-app",{app:(0,Q.C_)(c)}),icon:W.ReactComponent,id:"uninstall-button",name:t("label.uninstall")}),key:"uninstall-button",onClick:function(){S(!0),v(!1),k(Tr.UNINSTALL)}}])),J=function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var n,a,l,r,i,s;return(0,d.Jh)(this,(function(o){switch(o.label){case 0:if(!c)return[3,6];U((function(e){return(0,d.pi)((0,d.pi)({},e),{isSaveLoading:!0})})),n=(0,ar.Fz)(e.formData),a=(0,d.pi)((0,d.pi)({},c),{appConfiguration:n}),l=(0,ot.qu)(c,a),o.label=1;case 1:return o.trys.push([1,4,5,6]),[4,(0,De.UV)(c.id,l)];case 2:return r=o.sent(),[4,(0,De.pU)(null!==(s=c.fullyQualifiedName)&&void 0!==s?s:"",n)];case 3:return o.sent(),u(r),(0,O.XA)(t("message.entity-saved-successfully",{entity:t("label.configuration")})),[3,6];case 4:return i=o.sent(),(0,O.Eo)(i),[3,6];case 5:return U((function(e){return(0,d.pi)((0,d.pi)({},e),{isSaveLoading:!1})})),[7];case 6:return[2]}}))}))},q=function(e){return(0,d.mG)(void 0,void 0,void 0,(function(){var n,a,l,r;return(0,d.Jh)(this,(function(i){switch(i.label){case 0:if(!c)return[3,4];n=(0,d.pi)((0,d.pi)({},c),{appSchedule:(0,d.pi)({scheduleTimeline:(0,g.isEmpty)(e)?tr.Rh.None:tr.Rh.Custom},e?{cronExpression:e}:{})}),a=(0,ot.qu)(c,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,(0,De.UV)(c.id,a)];case 2:return l=i.sent(),u(l),(0,O.XA)(t("message.entity-saved-successfully",{entity:t("label.schedule")})),[3,4];case 3:return r=i.sent(),(0,O.Eo)(r),[3,4];case 4:return[2]}}))}))},Y=function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),U((function(e){return(0,d.pi)((0,d.pi)({},e),{isRunLoading:!0})})),[4,(0,De.C4)(null!==(n=null==c?void 0:c.fullyQualifiedName)&&void 0!==n?n:"")];case 1:return a.sent(),(0,O.XA)(t("message.application-action-successfully",{action:t("label.triggered-lowercase")})),[3,4];case 2:return e=a.sent(),(0,O.Eo)(e),[3,4];case 3:return U((function(e){return(0,d.pi)((0,d.pi)({},e),{isRunLoading:!1})})),[7];case 4:return[2]}}))}))},K=function(){return(0,d.mG)(void 0,void 0,void 0,(function(){var e,n;return(0,d.Jh)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,3,4]),U((function(e){return(0,d.pi)((0,d.pi)({},e),{isDeployLoading:!0})})),[4,(0,De.tc)(null!==(n=null==c?void 0:c.fullyQualifiedName)&&void 0!==n?n:"")];case 1:return a.sent(),(0,O.XA)(t("message.application-action-successfully",{action:t("label.deploy")})),_(),[3,4];case 2:return e=a.sent(),(0,O.Eo)(e),[3,4];case 3:return U((function(e){return(0,d.pi)((0,d.pi)({},e),{isDeployLoading:!1})})),[7];case 4:return[2]}}))}))},$=(0,l.useMemo)((function(){var e=(null==c?void 0:c.appConfiguration)&&c.allowConfiguration&&x?[{label:l.createElement(ct.Z,{id:yr.CONFIGURATION,name:t("label.configuration")}),key:yr.CONFIGURATION,children:l.createElement("div",{className:"m-auto max-width-md w-9/10 p-lg p-y-0"},l.createElement(lr.Z,{hideCancelButton:!0,useSelectWidget:!0,cancelText:t("label.back"),formData:c.appConfiguration,isLoading:P.isSaveLoading,okText:t("label.submit"),schema:x,serviceCategory:Pa.u.DASHBOARD_SERVICES,uiSchema:G,validator:$l.ZP,onCancel:g.noop,onSubmit:J}))}]:[];return(0,d.ev)((0,d.ev)([{label:l.createElement(ct.Z,{id:yr.SCHEDULE,name:t("label.schedule")}),key:yr.SCHEDULE,children:l.createElement("div",{className:"p-lg"},c&&l.createElement(Sr,{appData:c,loading:{isRunLoading:P.isRunLoading,isDeployLoading:P.isDeployLoading},onDemandTrigger:Y,onDeployTrigger:K,onSave:q}))}],(0,d.CR)(e)),(0,d.CR)((null==c?void 0:c.deleted)?[]:[{label:l.createElement(ct.Z,{id:yr.RECENT_RUNS,name:t("label.recent-run-plural")}),key:yr.RECENT_RUNS,children:l.createElement("div",{className:"p-lg"},l.createElement(hr,{appData:c}))}]))}),[c,x,P]),X=(0,l.useMemo)((function(){switch(R){case Tr.ENABLE:return t("label.enable-lowercase");case Tr.DISABLE:return t("label.disable-lowercase");case Tr.UNINSTALL:return t("label.uninstall-lowercase");default:return""}}),[R]);return(0,l.useEffect)((function(){_()}),[a]),P.isFetchLoading?l.createElement(N.Z,null):l.createElement(ne.Z,{className:"app-details-page-layout",pageTitle:t("label.application-plural")},l.createElement(p.Z,{className:"page-container"},l.createElement(f.Z,{className:"d-flex",flex:"auto"},l.createElement(h.Z,{className:"p-0",icon:l.createElement(Ql.Z,null),size:"small",type:"text",onClick:B},l.createElement(E.Z.Text,{className:"font-medium"},t("label.browse-app-plural")))),l.createElement(f.Z,{flex:"360px"},l.createElement("div",{className:"d-flex gap-2 justify-end"},l.createElement(Dn.Z,{align:{targetOffset:[-12,0]},className:"m-l-xs",menu:{items:V},open:y,overlayClassName:"glossary-manage-dropdown-list-container",overlayStyle:{width:"350px"},placement:"bottomRight",trigger:["click"],onOpenChange:v},l.createElement(Ue.Z,{placement:"topRight",title:t("label.manage-entity",{entity:t("label.application")})},l.createElement(h.Z,{className:"glossary-manage-dropdown-button p-x-xs","data-testid":"manage-button",icon:l.createElement(er.ReactComponent,{className:"vertical-align-inherit manage-dropdown-icon"}),onClick:function(){return v(!0)}})))))),l.createElement(p.Z,null,l.createElement(f.Z,{className:"page-container",span:24},l.createElement(j.Z,{className:"app-details-header w-full m-t-md",size:24},l.createElement(rr.Z,{appName:null!==(e=null==c?void 0:c.fullyQualifiedName)&&void 0!==e?e:""}),l.createElement("div",{className:"w-full"},l.createElement(E.Z.Title,{level:4},(0,Q.C_)(c)),l.createElement("div",{className:"d-flex items-center flex-wrap gap-6"},l.createElement(j.Z,{size:8},l.createElement(Yl.Z,null),l.createElement(E.Z.Text,{className:"text-xs text-grey-muted"},t("label.installed")+" "+(0,nr.ni)(null==c?void 0:c.updatedAt))),l.createElement(j.Z,{size:8},l.createElement(Kl.Z,null),l.createElement(E.Z.Text,{className:"text-xs text-grey-muted"},t("label.developed-by-developer",{developer:null==c?void 0:c.developer}))),(null==c?void 0:c.developerUrl)&&l.createElement("div",{className:"flex-center gap-2"},l.createElement(Pe.Z,{component:Xl.ReactComponent,style:i.K$}),l.createElement(E.Z.Link,{className:"text-xs",href:null==c?void 0:c.developerUrl,target:"_blank"},l.createElement(j.Z,null,t("label.visit-developer-website")))))))),l.createElement(f.Z,{className:"p-0",span:24},l.createElement(st.Z,{destroyInactiveTabPane:!0,className:"app-details-page-tabs entity-details-page-tabs","data-testid":"tabs",items:$}))),l.createElement(pt.Z,{bodyText:t("message.are-you-sure-action-property",{action:X,propertyName:(0,Q.C_)(c)}),cancelText:t("label.cancel"),confirmText:t("label.ok"),header:t("message.are-you-sure"),isLoading:P.isSaveLoading,visible:Z,onCancel:function(){return S(!1)},onConfirm:H}))},Ar=n(21559),Rr=function(){var e=(0,o.BL)().permissions;return l.createElement(r.rs,null,l.createElement(r.AW,{exact:!0,component:Vt,path:i.Z6.SETTINGS}),l.createElement(Ar.Z,{exact:!0,component:ra,hasPermission:(0,bt.P_)(u.OX.Create,c.A.ROLE,e),path:i.Z6.ADD_ROLE}),l.createElement(Ar.Z,{exact:!0,component:xn,hasPermission:(0,bt.P_)(u.OX.Create,c.A.POLICY,e),path:i.Z6.ADD_POLICY}),l.createElement(r.AW,{exact:!0,component:An,path:i.Z6.ADD_POLICY_RULE}),l.createElement(Ar.Z,{exact:!0,component:Rt,hasPermission:!1,path:i.Z6.SETTINGS_EDIT_EMAIL_CONFIG}),l.createElement(Ar.Z,{exact:!0,component:$e,hasPermission:!1,path:i.Z6.SETTINGS_EDIT_CUSTOM_LOGIN_CONFIG}),l.createElement(r.AW,{exact:!0,component:kn,path:i.Z6.EDIT_POLICY_RULE}),l.createElement(Ar.Z,{exact:!0,component:Wt,hasPermission:!1,path:(0,D.si)(s.CZ.NOTIFICATIONS)}),l.createElement(Ar.Z,{exact:!0,component:function(){return l.createElement(_.default,{isNotificationAlert:!0})},path:i.Z6.NOTIFICATION_ALERT_DETAILS}),l.createElement(Ar.Z,{exact:!0,component:G,hasPermission:!1,path:[(0,D.si)(s.CZ.NOTIFICATIONS,s.lx.EDIT_NOTIFICATION,!0),(0,D.si)(s.CZ.NOTIFICATIONS,s.lx.ADD_NOTIFICATION)]}),l.createElement(Ar.Z,{exact:!0,component:Qe,hasPermission:!1,path:(0,D.si)(s.lx.BOTS)}),l.createElement(Ar.Z,{exact:!0,component:Oe,hasPermission:!1,path:(0,D.si)(s.lx.APPLICATIONS)}),l.createElement(Ar.Z,{exact:!0,component:Ir,hasPermission:!1,path:(0,D.si)(s.lx.APPLICATIONS,void 0,!0)}),l.createElement(r.AW,{exact:!0,component:_t,path:i.Z6.SETTINGS_WITH_CATEGORY}),l.createElement(r.AW,{exact:!0,path:(0,D.si)()},l.createElement(r.l_,{to:(0,D.KH)(a.Organization)})),l.createElement(Ar.Z,{exact:!0,component:jl,hasPermission:bt.NE.hasViewPermissions(c.A.TEAM,e),path:(0,D.si)(s.CZ.MEMBERS,s.lx.TEAMS,!0)}),l.createElement(Ar.Z,{exact:!0,component:tl,hasPermission:bt.NE.hasViewPermissions(c.A.TEAM,e),path:(0,D.si)(s.CZ.MEMBERS,s.lx.TEAMS,!0,!0)}),l.createElement(r.AW,{path:(0,D.si)(s.CZ.MEMBERS,s.lx.TEAMS)},l.createElement(r.l_,{to:(0,D.KH)(a.Organization)})),l.createElement(Ar.Z,{exact:!0,component:yn,path:(0,D.si)(s.CZ.MEMBERS,s.lx.PERSONA)}),l.createElement(Ar.Z,{exact:!0,component:sn,path:(0,D.si)(s.CZ.MEMBERS,s.lx.PERSONA,!0)}),l.createElement(Ar.Z,{exact:!0,component:Za,path:(0,D.si)(s.CZ.ACCESS,s.lx.ROLES)}),l.createElement(Ar.Z,{exact:!0,component:ha,path:(0,D.si)(s.CZ.ACCESS,s.lx.ROLES,!0)}),l.createElement(Ar.Z,{exact:!0,component:Yn,path:(0,D.si)(s.CZ.ACCESS,s.lx.POLICIES)}),l.createElement(Ar.Z,{exact:!0,component:jn,path:(0,D.si)(s.CZ.ACCESS,s.lx.POLICIES,!0)}),l.createElement(Ar.Z,{exact:!0,component:Jl,hasPermission:bt.NE.hasViewPermissions(c.A.USER,e),path:(0,D.NI)(s.CZ.MEMBERS)}),l.createElement(Ar.Z,{exact:!0,component:Dt,hasPermission:!1,path:(0,D.si)(s.CZ.PREFERENCES,s.lx.EMAIL)}),l.createElement(Ar.Z,{exact:!0,component:Se,hasPermission:!1,path:(0,D.si)(s.CZ.PREFERENCES,s.lx.APPEARANCE)}),l.createElement(Ar.Z,{exact:!0,component:ta,hasPermission:!1,path:(0,D.si)(s.CZ.PREFERENCES,s.lx.PROFILER_CONFIGURATION)}),l.createElement(Ar.Z,{exact:!0,component:et,hasPermission:!1,path:(0,D.si)(s.CZ.PREFERENCES,s.lx.LOGIN_CONFIGURATION)}),l.createElement(Ar.Z,{exact:!0,component:it,path:(0,D.si)(s.CZ.PREFERENCES,s.lx.CUSTOMIZE_LANDING_PAGE)}),l.createElement(r.AW,{exact:!0,component:Va,path:(0,D.NI)(s.CZ.SERVICES)}),l.createElement(Ar.Z,{exact:!0,component:Y,hasPermission:!1,path:(0,D.si)(s.CZ.NOTIFICATIONS,s.lx.ACTIVITY_FEED)}),l.createElement(Ar.Z,{exact:!0,component:St,hasPermission:!1,path:(0,D.NI)(s.CZ.CUSTOM_PROPERTIES)}),l.createElement(Ar.Z,{exact:!0,component:Qt,hasPermission:!1,path:(0,D.si)(s.CZ.PREFERENCES,s.lx.OM_HEALTH)}))}},48553:function(e,t,n){var a=n(70655),l=n(49409),r=n(71230),i=n(15746),s=n(19650),o=n(71577),c=n(23031),u=n(67294),d=n(17309),m=n(78770),p=n(52940);t.Z=function(e){var t,n,f=e.initialData,E=e.isLoading,y=e.buttonProps,v=e.onCancel,h=e.onSubmit,b=e.includePeriodOptions,g=e.allowEnableDebugLog,C=void 0!==g&&g,Z=[{name:"enableDebugLog",label:(0,c.t)("label.enable-debug-log"),type:d.Uv.SWITCH,required:!1,props:{"data-testid":"enable-debug-log"},id:"root/enableDebugLog",formItemLayout:d.EP.HORIZONTAL}],N=(0,a.CR)((0,u.useState)(null==f?void 0:f.repeatFrequency),2),S=N[0],T=N[1];return(0,u.useEffect)((function(){(null==f?void 0:f.repeatFrequency)&&T(f.repeatFrequency)}),[null==f?void 0:f.repeatFrequency]),u.createElement(l.Z,{"data-testid":"schedule-container",initialValues:{enableDebugLog:null==f?void 0:f.enableDebugLog},layout:"vertical",onFinish:function(e){h({repeatFrequency:null!=S?S:"",enableDebugLog:e.enableDebugLog})}},u.createElement(r.Z,{gutter:[16,32]},u.createElement(i.Z,{span:24},u.createElement(p.Z,{includePeriodOptions:b,value:S,onChange:function(e){return T(e)}}),C&&u.createElement("div",{className:"mt-4"},(0,m.GL)(Z))),u.createElement(i.Z,{span:24},u.createElement(s.Z,{className:"w-full justify-end",size:16},u.createElement(o.Z,{type:"link",onClick:v},null!==(t=null==y?void 0:y.cancelText)&&void 0!==t?t:(0,c.t)("label.back")),u.createElement(o.Z,{"data-testid":"deploy-button",htmlType:"submit",loading:E,type:"primary"},null!==(n=null==y?void 0:y.okText)&&void 0!==n?n:(0,c.t)("label.submit"))))))}},107:function(e,t,n){var a=n(70655),l=n(51890),r=n(67294),i=n(8395);t.Z=function(e){var t=e.logo,n=e.appName,s=(0,a.CR)((0,r.useState)(null),2),o=s[0],c=s[1],u=(0,r.useCallback)((function(){return(0,a.mG)(void 0,void 0,void 0,(function(){var e,l;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:return t?[3,2]:[4,i.Z.importAppLogo(n)];case 1:return e=a.sent(),l=e.ReactComponent,c(r.createElement(l,null)),[3,3];case 2:c(t),a.label=3;case 3:return[2]}}))}))}),[t,n]);return(0,r.useEffect)((function(){u()}),[n]),r.createElement(l.C,{className:"flex-center bg-grey-1",icon:o,size:100})}},54585:function(e,t,n){var a=n(68855),l=n(91894),r=n(19650),i=n(56256),s=n(71577),o=n(94184),c=n.n(o),u=n(96486),d=n(67294),m=n(68432),p=n(38048),f=n(107);t.Z=function(e){var t=e.title,n=e.description,o=e.className,E=e.linkTitle,y=e.onClick,v=e.appName,h=e.deleted,b=void 0!==h&&h,g=e.showDescription,C=void 0===g||g,Z=(0,m.$)().t;return d.createElement(l.Z,{bordered:!1,className:c()(o,"application-card card-body-border-none"),"data-testid":(0,u.kebabCase)(v)+"-card"},d.createElement("div",{className:"d-flex items-center gap-3"},d.createElement("div",{className:"application-logo"},d.createElement(f.Z,{appName:v})),d.createElement(r.Z,{className:"application-info",direction:"vertical",size:0},d.createElement("div",{className:"d-flex gap-2"},d.createElement(i.Z.Title,{className:"m-0",level:5},t),b&&d.createElement("div",{className:"deleted-badge-button text-xss flex-center","data-testid":"deleted-badge"},d.createElement(a.Z,{className:"d-flex m-r-xss font-medium text-xs"}),Z("label.disabled"))),C&&d.createElement(p.Z,{className:"max-two-lines",markdown:n}),d.createElement(s.Z,{className:"p-0","data-testid":"config-btn",type:"link",onClick:y},E))))}},84799:function(e,t,n){n.d(t,{m:function(){return c}});var a=n(94199),l=n(71577),r=n(67294),i=n(68432),s=n(51297),o=n(97010),c=function(e){var t=e.copyText,n=e.copyTimer,c=void 0===n?1500:n,u=e.position,d=void 0===u?"left":u,m=e.onCopy,p=(0,i.$)().t,f=(0,o.V)(t,c,m),E=f.hasCopied,y=f.onCopyToClipBoard;return r.createElement(a.Z,{destroyTooltipOnHide:!0,placement:d,title:E?r.createElement("span",{className:"text-xs font-medium","data-testid":"copy-success"},p("message.copied-to-clipboard")):r.createElement("span",{className:"text-xs font-medium","data-testid":"copy-tooltip"},p("message.copy-to-clipboard"))},r.createElement(l.Z,{className:"h-8 m-l-md relative flex-center","data-testid":"copy-secret",icon:r.createElement(s.ReactComponent,{"data-testid":"copy-icon",width:"16"}),type:"text",onClick:y}))};t.Z=c},57203:function(e,t,n){n.d(t,{D:function(){return a},v:function(){return l}});var a={tokenType:n(31417).i.PersonalAccessToken},l="********@masked.com"},31417:function(e,t,n){var a;n.d(t,{i:function(){return a}}),function(e){e.EmailVerification="EMAIL_VERIFICATION",e.PasswordReset="PASSWORD_RESET",e.PersonalAccessToken="PERSONAL_ACCESS_TOKEN",e.RefreshToken="REFRESH_TOKEN"}(a||(a={}))},88835:function(e,t,n){var a;n.d(t,{l:function(){return a}}),function(e){e.System="system",e.User="user"}(a||(a={}))},84729:function(e,t,n){n.r(t);var a=n(70655),l=n(71230),r=n(15746),i=n(56256),s=n(94199),o=n(60331),c=n(27049),u=n(19650),d=n(71577),m=n(96486),p=n(67294),f=n(68432),E=n(15137),y=n(76),v=n(38780),h=n(8645),b=n(92342),g=n(47485),C=n(35850),Z=n(89011),N=n(38048),S=n(36169),T=n(62761),x=n(96162),w=n(64632),I=n(55538),A=n(66537),R=n(46923),M=n(24671),k=n(96840),L=n(18305);t.default=function(e){var t,n=this,D=e.isNotificationAlert,O=void 0!==D&&D,P=(0,f.$)().t,U=(0,A.f)().fqn,z=(0,E.k6)(),G=(0,a.CR)((0,p.useState)(),2),_=G[0],B=G[1],j=(0,a.CR)((0,p.useState)(!0),2),F=j[0],H=j[1],V=(0,a.CR)((0,p.useState)(!1),2),W=V[0],J=V[1],q=(0,p.useMemo)((function(){var e,t,n;return{resource:null===(e=null==_?void 0:_.filteringRules)||void 0===e?void 0:e.resources[0],filters:null===(t=null==_?void 0:_.input)||void 0===t?void 0:t.filters,actions:null===(n=null==_?void 0:_.input)||void 0===n?void 0:n.actions,destinations:null==_?void 0:_.destinations}}),[_]),Q=q.resource,Y=q.filters,K=q.actions,$=q.destinations,X=(0,p.useMemo)((function(){return O?[{name:P("label.setting-plural"),url:T.Z6.SETTINGS},{name:P("label.notification-plural"),url:(0,k.si)(x.CZ.NOTIFICATIONS)},{name:(0,M.C_)(_),url:""}]:[{name:P("label.observability"),url:""},{name:P("label.alert-plural"),url:T.Z6.OBSERVABILITY_ALERTS},{name:(0,M.C_)(_),url:""}]}),[_]),ee=(0,p.useCallback)((function(){return(0,a.mG)(n,void 0,void 0,(function(){return(0,a.Jh)(this,(function(e){return O?z.push(T.Z6.NOTIFICATION_ALERTS):z.push(T.Z6.OBSERVABILITY_ALERTS),[2]}))}))}),[z]),te=function(e,t){return p.createElement("div",{className:"p-md"},null==t?void 0:t.map((function(n,a){var u;return p.createElement(p.Fragment,{key:n.name},p.createElement(l.Z,{"data-testid":"filter-"+n.name,gutter:[0,8]},p.createElement(r.Z,{className:"font-medium",span:3},P("label.effect")),p.createElement(r.Z,{span:1},":"),p.createElement(r.Z,{"data-testid":"effect-value",span:20},(0,m.startCase)(n.effect)),p.createElement(r.Z,{className:"font-medium",span:3},P("label.entity-name",{entity:P(e?"label.filter":"label.action")})),p.createElement(r.Z,{span:1},":"),p.createElement(r.Z,{"data-testid":"filter-name",span:20},(0,m.startCase)(n.name)),!(0,m.isEmpty)(n.arguments)&&p.createElement(p.Fragment,null,p.createElement(r.Z,{className:"font-medium",span:3},P("label.argument-plural")),p.createElement(r.Z,{span:1},":"),p.createElement(r.Z,{className:"border rounded-4 p-sm","data-testid":"arguments-container",span:20},null===(u=n.arguments)||void 0===u?void 0:u.map((function(e){var t;return p.createElement(l.Z,{"data-testid":"argument-container-"+e.name,gutter:[0,8],key:e.name},p.createElement(r.Z,{className:"font-medium",span:24},p.createElement(i.Z.Text,{"data-testid":"argument-name"},e.name)),p.createElement(r.Z,{span:24},null===(t=e.input)||void 0===t?void 0:t.map((function(e){return p.createElement(s.Z,{key:e,title:e},p.createElement(o.Z,{className:"m-b-xs w-max-full","data-testid":"argument-value"},p.createElement(i.Z.Text,{ellipsis:!0},e)))}))))}))))),av.YD;return(0,o.isUndefined)(n.teams)||(0,o.isEmpty)(n.teams)?c.createElement(c.Fragment,null,(0,s.t)("label.no-entity",{entity:(0,s.t)("label.team")})):c.createElement(l.Z,{wrap:!0,"data-testid":"policy-link",size:4},n.teams.slice(0,v.YD).map((function(e){var t;return c.createElement(u.Link,{className:"cursor-pointer",key:(0,o.uniqueId)(),to:(0,h.KH)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"")},(0,y.C_)(e))})),f&&c.createElement(r.Z,{className:"cursor-pointer",content:c.createElement(l.Z,{wrap:!0,size:4},n.teams.slice(v.YD).map((function(e){var t;return c.createElement(u.Link,{className:"cursor-pointer",key:(0,o.uniqueId)(),to:(0,h.KH)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"")},(0,y.C_)(e))}))),overlayClassName:"w-40",trigger:"click"},c.createElement(i.Z,{className:"m-l-xs","data-testid":"plus-more-count"},"+"+(p-v.YD)+" more")))}},{title:(0,s.t)("label.role-plural"),dataIndex:"roles",key:"roles",render:function(t,n){var d,m,p=null!==(m=null===(d=n.roles)||void 0===d?void 0:d.length)&&void 0!==m?m:0,f=p>v.YD;return e?c.createElement(a.Z,{active:!0,paragraph:!1}):(0,o.isUndefined)(n.roles)||(0,o.isEmpty)(n.roles)?c.createElement(c.Fragment,null,(0,s.t)("label.no-entity",{entity:(0,s.t)("label.role")})):c.createElement(l.Z,{wrap:!0,"data-testid":"policy-link",size:4},n.roles.slice(0,v.YD).map((function(e){var t;return c.createElement(u.Link,{className:"cursor-pointer",key:(0,o.uniqueId)(),to:(0,h.Uy)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"")},(0,y.C_)(e))})),f&&c.createElement(r.Z,{className:"cursor-pointer",content:c.createElement(l.Z,{wrap:!0,size:4},n.roles.slice(v.YD).map((function(e){var t;return c.createElement(u.Link,{className:"cursor-pointer",key:(0,o.uniqueId)(),to:(0,h.Uy)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"")},(0,y.C_)(e))}))),overlayClassName:"w-40",trigger:"click"},c.createElement(i.Z,{className:"m-l-xs","data-testid":"plus-more-count"},"+"+(p-v.YD)+" more")))}}]},g=function(e){return e===f.v},C=function(e){var t,n=e.error,a=e.entity,l=e.entityLowercase,r=e.entityName;if(n){if((0,E.B)(n,p.c9.alreadyExist))return(0,s.t)("server.email-already-exist",{entity:null!=l?l:"",name:null!=r?r:""});if((null===(t=n.response)||void 0===t?void 0:t.status)===m.N.LIMIT_REACHED)return(0,s.t)("server.entity-limit-reached",{entity:a})}return(0,s.t)("server.create-entity-error",{entity:a})}}}]);