import{b as xt,c as yt,j as St,m as Pt,p as Tt}from"./chunk-6MZYNDRO.js";import{N as bt}from"./chunk-AC3PNZI6.js";import{j as gt,q as ut,r as Ct}from"./chunk-WTFGW5AE.js";import{t as rt}from"./chunk-EB5QYMEC.js";import{a as mt,f as ft}from"./chunk-GF7IIRPD.js";import{a as _t,b as dt}from"./chunk-ALOZAETQ.js";import{d as lt,i as st,j as ct}from"./chunk-UGTOLBCY.js";import{b as at,c as pt}from"./chunk-7YAQEZXO.js";import{i as Et,j as ht}from"./chunk-XSAYUACO.js";import{g as Y}from"./chunk-25L7LVSN.js";import{a as Mt}from"./chunk-UPBUW3C5.js";import{Bb as nt,C as Ee,Db as it,Eb as ot,L as ze,Oa as Qe,ab as Ze,bb as Je,cb as he,db as X,eb as Xe,fa as $e,qb as Ye,s as He,tb as et,wa as Ge,xa as _e,yb as tt}from"./chunk-MPPDZ2VB.js";import{a as qe,b as Ke}from"./chunk-DRHHBH5M.js";import{B as se,h as pe,o as le}from"./chunk-DV7HM4SB.js";import{b as ce,d as me}from"./chunk-NJPXBAJ4.js";import{$ as Ie,$c as re,$d as Re,Ac as D,Ca as Oe,Cc as A,E as Pe,Ed as Ne,Fc as F,G as K,Gb as Z,Hc as l,Ib as Fe,Kc as te,Ma as Be,Ob as a,Pb as h,Rc as W,Sc as g,T as Te,Ta as ee,Tc as O,Uc as k,W as ve,Xc as ne,Y as xe,Yc as ie,Zc as oe,ae as J,cb as Ue,cd as w,db as I,dd as We,eb as M,fc as d,ga as Me,gc as Le,ge as je,hc as Ve,kc as p,kd as m,lb as Ae,ld as u,md as T,nb as Q,oc as De,pe as ae,qd as N,rc as ye,wa as ke,wc as s,xa as we,xc as c,y as Ce,yc as P,z as Se,zc as V}from"./chunk-DL5LSFDY.js";import{a as $,b as ge,e as ue,i as It,k as G}from"./chunk-HQBHK7TL.js";var be=It(Mt());var Ut=e=>({workspace:e}),q=e=>({toSpace:e}),de=e=>({targetSpace:e});function At(e,o){if(e&1&&(P(0,"span",19),m(1,"translate")),e&2){let t=l(3);p("innerHTML",T(1,1,"explorer-ng.landingPage.cloneEntity.messageIncompatible",w(4,q,t.toSpace)),Z)}}function Ft(e,o){if(e&1&&(s(0,"h3"),g(1),m(2,"translate"),c(),P(3,"span",19),m(4,"translate")),e&2){let t=l(4);a(),O(T(2,2,"explorer-ng.landingPage.cloneEntity.messageNoCompatible",w(8,de,t.toSpace))),a(2),p("innerHTML",T(4,5,"explorer-ng.landingPage.cloneEntity.messageNoCompatibleCopy",w(10,q,t.toSpace)),Z)}}function Lt(e,o){e&1&&d(0,Ft,5,12,"ng-template",null,2,N)}function Vt(e,o){e&1&&(s(0,"span"),g(1),m(2,"translate"),c()),e&2&&(a(),k(" ",u(2,1,"explorer-ng.landingPage.cloneEntity.changeSettings")," "))}function Dt(e,o){e&1&&(g(0),m(1,"translate")),e&2&&k(" ",u(1,1,"explorer-ng.landingPage.cloneEntity.contactAdmin")," ")}function Wt(e,o){if(e&1&&(V(0),d(1,Vt,3,3,"span",6)(2,Dt,2,3,"ng-template",null,3,N),D()),e&2){let t=W(3),i=l(3);a(),p("ngIf",i.exportParams.editPermission)("ngIfElse",t)}}function Nt(e,o){if(e&1&&(V(0),d(1,At,2,6,"span",18)(2,Lt,2,0,null,7)(3,Wt,4,2,"ng-container",7),D()),e&2){let t=l(2);a(),p("ngIf",t.exportParams.compatibleElementsUri.length)("ngIfElse",t.noCompatible),a(),p("ngIf",!t.exportParams.incompatibleTypes.length),a(),p("ngIf",t.exportParams.incompatibleTypes.length)}}function Rt(e,o){e&1&&P(0,"ui-loader")}function jt(e,o){if(e&1&&(V(0),g(1),m(2,"translate"),s(3,"a",22),g(4),m(5,"translate"),c(),D()),e&2){let t=l(4);a(),k(" ",u(2,3,"explorer-ng.landingPage.cloneEntity.messageEditSettings")," "),a(2),te("href",t.settingsUrl,Fe),a(),k(" ",T(5,5,"explorer-ng.landingPage.cloneEntity.changeSpaceSettings",w(8,q,t.toSpace))," ")}}function Ht(e,o){if(e&1&&(g(0),m(1,"translate")),e&2){let t=l(4);k(" ",T(1,1,"explorer-ng.landingPage.cloneEntity.messageContactAdmin",w(4,q,t.toSpace))," ")}}function zt(e,o){if(e&1&&(s(0,"ui-static-notification",21)(1,"span"),g(2),m(3,"translate"),m(4,"translate"),d(5,jt,6,10,"ng-container",6)(6,Ht,2,6,"ng-template",null,3,N),c()()),e&2){let t=W(7),i=l(3);p("isCloseable",!1),a(2),k(" ",i.exportParams.incompatibleTypes.length===1?u(3,4,"explorer-ng.landingPage.cloneEntity.messageSingleIncompatible"):u(4,6,"explorer-ng.landingPage.cloneEntity.messageBulkIncompatible")," "),a(3),p("ngIf",i.exportParams.editPermission)("ngIfElse",t)}}function $t(e,o){if(e&1&&d(0,Rt,1,0,"ui-loader",7)(1,zt,8,8,"ui-static-notification",20),e&2){let t=l(2);p("ngIf",t.showLoader),a(),p("ngIf",t.exportParams.incompatibleTypes.length&&!t.showLoader)}}function Gt(e,o){if(e&1&&(s(0,"p"),d(1,Nt,4,4,"ng-container",6)(2,$t,2,2,"ng-template",null,1,N),c()),e&2){let t=W(3),i=l();a(),p("ngIf",!i.useWorkspaceLevelEC)("ngIfElse",t)}}function qt(e,o){if(e&1&&(s(0,"li"),P(1,"ui2-tag",24),c()),e&2){let t=o.$implicit;a(),p("icon","f-icon icon-"+t.icon)("label",t.name)}}function Kt(e,o){if(e&1&&(s(0,"ul"),d(1,qt,2,2,"li",23),c()),e&2){let t=l();a(),p("ngForOf",t.exportParams.incompatibleTypes)}}function Qt(e,o){if(e&1&&(s(0,"span"),g(1),m(2,"translate"),c()),e&2){let t=l(2);a(),k(" ",T(2,1,"explorer-ng.landingPage.cloneEntity.permissionMessageSingle",w(4,de,t.toSpace))," ")}}function Zt(e,o){if(e&1&&(s(0,"span"),g(1),m(2,"translate"),c()),e&2){let t=l(2);a(),k(" ",T(2,1,"explorer-ng.landingPage.cloneEntity.permissionMessage",w(4,de,t.toSpace))," ")}}function Jt(e,o){if(e&1&&(s(0,"p")(1,"ui-static-notification",21),d(2,Qt,3,6,"span")(3,Zt,3,6),c()()),e&2){let t=l();a(),p("isCloseable",!1),a(),ye(2,(t.exportParams.notAllowedElementTypes==null?null:t.exportParams.notAllowedElementTypes.length)===1?2:3)}}function Xt(e,o){if(e&1&&(s(0,"li"),P(1,"ui2-tag",24),c()),e&2){let t=o.$implicit;a(),p("icon","f-icon icon-"+t.icon)("label",t.name)}}function Yt(e,o){if(e&1&&(s(0,"ul"),d(1,Xt,2,2,"li",23),c()),e&2){let t=l();a(),p("ngForOf",t.exportParams.notAllowedElementTypes)}}function en(e,o){e&1&&(s(0,"span")(1,"p"),g(2),m(3,"translate"),c()()),e&2&&(a(2),O(u(3,1,"explorer-ng.landingPage.cloneEntity.messageNotAvailableCopy")))}function tn(e,o){e&1&&P(0,"ui-loader")}function nn(e,o){if(e&1&&(P(0,"p",19),m(1,"translate")),e&2){let t=l(3);p("innerHTML",T(1,1,"explorer-ng.landingPage.cloneEntity.message",w(4,q,t.toSpace)),Z)}}function on(e,o){if(e&1&&(P(0,"p",19),m(1,"translate")),e&2){let t=l(3);p("innerHTML",T(1,1,"explorer-ng.landingPage.cloneEntity.messageSingle",w(4,q,t.toSpace)),Z)}}function rn(e,o){if(e&1&&(V(0),d(1,nn,2,6,"p",25)(2,on,2,6,"p",25),D()),e&2){let t=l(2);a(),p("ngIf",!t.singleCopy),a(),p("ngIf",t.singleCopy)}}function an(e,o){if(e&1&&d(0,tn,1,0,"ui-loader",7)(1,rn,3,2,"ng-container",7),e&2){let t=l();p("ngIf",t.showLoader&&t.useWorkspaceLevelEC),a(),p("ngIf",!t.showLoader)}}function pn(e,o){if(e&1&&(s(0,"ui2-static-notification",26),g(1),m(2,"translate"),c()),e&2){let t=l();p("isCloseable",!1),a(),k(" ",T(2,2,"explorer-ng.landingPage.cloneEntity.forceUpdateWarning",w(5,de,t.toSpace)),`
`)}}function ln(e,o){e&1&&(V(0),s(1,"span"),g(2),m(3,"translate"),c(),D()),e&2&&(a(2),O(u(3,1,"explorer-ng.landingPage.cloneEntity.enableAndCopySingle")))}function sn(e,o){e&1&&(s(0,"span"),g(1),m(2,"translate"),c()),e&2&&(a(),O(u(2,1,"explorer-ng.landingPage.cloneEntity.enableAndCopy")))}function cn(e,o){if(e&1){let t=A();s(0,"ui2-button",27),F("click",function(){I(t);let r=l();return M(r.startCopyProgress(!0))}),d(1,ln,4,3,"ng-container",6)(2,sn,3,3,"ng-template",null,4,N),c()}if(e&2){let t=W(3),i=l();De(i.exportParams.compatibleElementsUri.length?"button-clear":""),a(),p("ngIf",i.singleCopy)("ngIfElse",t)}}function mn(e,o){e&1&&(s(0,"span"),g(1),m(2,"translate"),c()),e&2&&(a(),k(" ",u(2,1,"explorer-ng.landingPage.cloneEntity.confirm")," "))}function _n(e,o){e&1&&(g(0),m(1,"translate")),e&2&&k(" ",u(1,1,"explorer-ng.landingPage.cloneEntity.copyCompatible")," ")}function dn(e,o){if(e&1){let t=A();s(0,"ui2-button",28),F("clicked",function(){I(t);let r=l();return M(r.startCopyProgress(!1))}),d(1,mn,3,3,"span",6)(2,_n,2,3,"ng-template",null,5,N),c()}if(e&2){let t=W(3),i=l();p("disabled",i.useWorkspaceLevelEC&&(!i.exportParams.compatibleElementsUri.length||i.isSingleElementTypeSelected)),a(),p("ngIf",!i.exportParams.incompatibleElementsCount)("ngIfElse",t)}}var vt=(()=>{let o=class o{constructor(i,r){this.bulkActionsService=i,this.environmentService=r,this.startCopy=new Q,this.overrideContent=!1,this.toSpace="",this.settingsUrl="",this.urisOfNotAllowdedElementTypes=[],this.urisOfSelectedElementTypes=[],this.isSingleElementTypeSelected=!1}ngOnInit(){this.singleCopy=!!this.bulkActionsService.singleSelected}ngOnChanges(i){i.exportParams&&i.exportParams.currentValue&&(this.toSpace=Y(i.exportParams.currentValue.toSpace.label),this.settingsUrl=`${this.environmentService.getUrl(Je.SETTINGS)}/organization/space-settings/${i.exportParams.currentValue.toSpace.uri}/element-types`,this.urisOfNotAllowdedElementTypes=[...new Set(this.exportParams.notAllowedElementTypes?.map(r=>r.uri))],this.urisOfSelectedElementTypes=[...new Set(this.exportParams.selected?.map(r=>r.elementTypeUri))],this.isSingleElementTypeSelected=this.urisOfSelectedElementTypes.length===1&&this.urisOfNotAllowdedElementTypes.length===1)}startCopyProgress(i){this.startCopy.emit({activateElementTypes:i,forceUpdate:this.overrideContent})}cancelBulkCopy(){this.bulkActionsService.cancelBulkCopy()}};o.\u0275fac=function(r){return new(r||o)(h(Pt),h(ze))},o.\u0275cmp=ee({type:o,selectors:[["explorer-export-content-confirmation"]],inputs:{exportParams:"exportParams",useWorkspaceLevelEC:"useWorkspaceLevelEC",showLoader:"showLoader"},outputs:{startCopy:"startCopy"},standalone:!0,features:[Ue,re],decls:27,vars:31,consts:[["simpleConfirmation",""],["newECNotification",""],["noCompatible",""],["noPermission",""],["bulkCopy",""],["copyCompatible",""],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"force-update"],[3,"ngModelChange","name","ngModel"],[3,"ui2Tooltip"],[1,"icon","icon2-x16-support","tooltip-top"],["class","mb-5",3,"isCloseable",4,"ngIf"],[1,"confirmation-buttons"],[1,"button-semantic","mr-2",3,"click"],["class","button-primary mr-2",3,"class","click",4,"ngIf"],[1,"mr-2",3,"ui2Tooltip"],["class","button-primary",3,"disabled","clicked",4,"ngIf"],[3,"innerHTML",4,"ngIf","ngIfElse"],[3,"innerHTML"],["class","type-warning",3,"isCloseable",4,"ngIf"],[1,"type-warning",3,"isCloseable"],["target","_blank",3,"href"],[4,"ngFor","ngForOf"],[1,"tag-secondary",3,"icon","label"],[3,"innerHTML",4,"ngIf"],[1,"mb-5",3,"isCloseable"],[1,"button-primary","mr-2",3,"click"],[1,"button-primary",3,"clicked","disabled"]],template:function(r,n){if(r&1){let f=A();d(0,Gt,4,2,"p",6)(1,Kt,2,1,"ul",7)(2,Jt,4,2,"p")(3,Yt,2,1,"ul",7)(4,en,4,3,"span",7)(5,an,2,2,"ng-template",null,0,N),s(7,"h3"),g(8),m(9,"translate"),c(),s(10,"div",8)(11,"ui2-checkbox",9),oe("ngModelChange",function(b){return I(f),ie(n.overrideContent,b)||(n.overrideContent=b),M(b)}),g(12),m(13,"translate"),c(),s(14,"span",10),m(15,"translate"),P(16,"span",11),c()(),d(17,pn,3,7,"ui2-static-notification",12),s(18,"div",13)(19,"ui2-button",14),F("click",function(){return I(f),M(n.cancelBulkCopy())}),g(20),m(21,"translate"),c(),d(22,cn,4,5,"ui2-button",15),s(23,"span",16),m(24,"translate"),m(25,"translate"),d(26,dn,4,3,"ui2-button",17),c()()}if(r&2){let f=W(6);p("ngIf",n.exportParams.incompatibleElementsCount||(n.exportParams.notAllowedElementTypes==null?null:n.exportParams.notAllowedElementTypes.length))("ngIfElse",f),a(),p("ngIf",n.exportParams.incompatibleElementsCount&&!n.showLoader),a(),ye(2,n.exportParams.notAllowedElementTypes!=null&&n.exportParams.notAllowedElementTypes.length&&!n.showLoader?2:-1),a(),p("ngIf",(n.exportParams.notAllowedElementTypes==null?null:n.exportParams.notAllowedElementTypes.length)&&!n.showLoader),a(),p("ngIf",n.exportParams.incompatibleTypesInTenant&&n.exportParams.incompatibleTypesInTenant.length),a(4),O(u(9,16,"explorer-ng.landingPage.cloneEntity.copyOptions")),a(3),p("name","checked"),ne("ngModel",n.overrideContent),a(),O(u(13,18,"explorer-ng.landingPage.cloneEntity.forceUpdate")),a(2),p("ui2Tooltip",T(15,20,"explorer-ng.landingPage.cloneEntity.forceUpdateToolTip",w(29,Ut,n.toSpace))),a(3),p("ngIf",n.overrideContent),a(3),O(u(21,23,"explorer-ng.landingPage.cloneEntity.cancel")),a(2),p("ngIf",!n.useWorkspaceLevelEC&&n.exportParams.incompatibleElementsCount&&n.exportParams.editPermission),a(),p("ui2Tooltip",n.exportParams.compatibleElementsUri!=null&&n.exportParams.compatibleElementsUri.length?n.isSingleElementTypeSelected?u(25,27,"explorer-ng.landingPage.cloneEntity.noPermissionToCopy"):"":u(24,25,"explorer-ng.landingPage.cloneEntity.incompatibleTooltip")),a(3),p("ngIf",n.useWorkspaceLevelEC||n.exportParams.compatibleElementsUri.length)}},dependencies:[ae,Re,J,me,ce,ot,Xe,it,nt,Ke,qe,dt,_t,se,pe,le,pt,at,ht,Et],styles:[".normalized-container[_ngcontent-%COMP%]{align-items:stretch;border:0 solid black;box-sizing:border-box;display:flex;flex-basis:auto;flex-direction:column;flex-shrink:0;margin:0;min-height:0px;min-width:0px;padding:0;position:relative;z-index:0}.flex[_ngcontent-%COMP%]{display:flex}.flex-initial[_ngcontent-%COMP%]{flex:0 1 auto}.flex-1[_ngcontent-%COMP%]{flex:1 1 0%}.flex-auto[_ngcontent-%COMP%]{flex:1 1 auto}.flex-none[_ngcontent-%COMP%]{flex:none}.flex-row[_ngcontent-%COMP%]{flex-direction:row}.flex-row-reverse[_ngcontent-%COMP%]{flex-direction:row-reverse}.flex-col[_ngcontent-%COMP%]{flex-direction:column}.flex-col-reverse[_ngcontent-%COMP%]{flex-direction:column-reverse}.flex-no-wrap[_ngcontent-%COMP%]{flex-wrap:nowrap}.flex-wrap[_ngcontent-%COMP%]{flex-wrap:wrap}.flex-wrap-reverse[_ngcontent-%COMP%]{flex-wrap:wrap-reverse}.items-stretch[_ngcontent-%COMP%]{align-items:stretch}.items-start[_ngcontent-%COMP%]{align-items:flex-start}.items-center[_ngcontent-%COMP%]{align-items:center}.items-end[_ngcontent-%COMP%]{align-items:flex-end}.items-baseline[_ngcontent-%COMP%]{align-items:baseline}.content-start[_ngcontent-%COMP%]{align-content:flex-start}.content-center[_ngcontent-%COMP%]{align-content:center}.content-end[_ngcontent-%COMP%]{align-content:flex-end}.content-between[_ngcontent-%COMP%]{align-content:space-between}.content-around[_ngcontent-%COMP%]{align-content:space-around}.self-auto[_ngcontent-%COMP%]{align-self:auto}.self-start[_ngcontent-%COMP%]{align-self:flex-start}.self-center[_ngcontent-%COMP%]{align-self:center}.self-end[_ngcontent-%COMP%]{align-self:flex-end}.self-stretch[_ngcontent-%COMP%]{align-self:stretch}.justify-start[_ngcontent-%COMP%]{justify-content:flex-start}.justify-center[_ngcontent-%COMP%]{justify-content:center}.justify-end[_ngcontent-%COMP%]{justify-content:flex-end}.justify-between[_ngcontent-%COMP%]{justify-content:space-between}.justify-around[_ngcontent-%COMP%]{justify-content:space-around}.flex-grow[_ngcontent-%COMP%]{flex-grow:1}.flex-grow-0[_ngcontent-%COMP%]{flex-grow:0}.flex-shrink[_ngcontent-%COMP%]{flex-shrink:1}.flex-shrink-0[_ngcontent-%COMP%]{flex-shrink:0}.order-first[_ngcontent-%COMP%]{order:-9999}.order-last[_ngcontent-%COMP%]{order:9999}.order-none[_ngcontent-%COMP%]{order:0}.order-1[_ngcontent-%COMP%]{order:1}.order-2[_ngcontent-%COMP%]{order:2}.order-3[_ngcontent-%COMP%]{order:3}.order-4[_ngcontent-%COMP%]{order:4}.order-5[_ngcontent-%COMP%]{order:5}.order-6[_ngcontent-%COMP%]{order:6}.order-7[_ngcontent-%COMP%]{order:7}.order-8[_ngcontent-%COMP%]{order:8}.order-9[_ngcontent-%COMP%]{order:9}.order-10[_ngcontent-%COMP%]{order:10}.order-11[_ngcontent-%COMP%]{order:11}.order-12[_ngcontent-%COMP%]{order:12}.w-full[_ngcontent-%COMP%]{width:100%}.clickable[_ngcontent-%COMP%]{cursor:pointer}.open-in-new-tab[_ngcontent-%COMP%]{text-decoration:none;color:unset}.confirmation-buttons[_ngcontent-%COMP%]{margin-top:20px;display:flex;justify-content:flex-end}.confirmation-buttons[_ngcontent-%COMP%]   ui-button[_ngcontent-%COMP%] + ui-button[_ngcontent-%COMP%]{margin-left:10px}.force-update[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;margin-top:15px;margin-bottom:15px}p[_ngcontent-%COMP%]{padding-top:0;margin-top:0}.icon[_ngcontent-%COMP%]{font-size:22px;margin-top:-5px;color:#bdc8d4}ul[_ngcontent-%COMP%]{padding:0}ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{display:inline;list-style:none}"]});let e=o;return e})();var fn=()=>[J,import("./chunk-TF26YKA2.js").then(e=>e.ImportElementsFormComponent),import("./chunk-HEOYUZKN.js").then(e=>e.ImportContentFormComponent)],gn=(e,o)=>({fromSpace:e,toSpace:o});function un(e,o){e&1&&P(0,"ui-loader")}function Cn(e,o){e&1&&(s(0,"span",7),g(1),m(2,"translate"),c()),e&2&&(a(),O(u(2,1,"explorer-ng.landingPage.cloneEntity.selectSpace")))}function xn(e,o){if(e&1&&P(0,"ui2-dropdown-search-bar",10),e&2){l();let t=W(1);p("select",t)}}function yn(e,o){if(e&1){let t=A();s(0,"ng-select",8,0),m(2,"translate"),oe("ngModelChange",function(r){I(t);let n=l();return ie(n.selectedSpace,r)||(n.selectedSpace=r),M(r)}),F("change",function(){I(t);let r=l();return M(r.selectSpace(r.selectedSpace))}),d(3,xn,1,1,"ng-template",9),c()}if(e&2){let t=l();te("placeholder",u(2,3,"explorer-ng.landingPage.cloneEntity.selectSpace")),p("items",t.spaces),ne("ngModel",t.selectedSpace)}}function En(e,o){if(e&1){let t=A();s(0,"explorer-export-content-confirmation",12),F("startCopy",function(r){I(t);let n=l(2);return M(n.startBulkCopy(n.exportParams,r))}),c()}if(e&2){let t=l(2);p("exportParams",t.exportParams)("useWorkspaceLevelEC",t.useWorkspaceLevelEC)("showLoader",t.checkingCompatibility)}}function hn(e,o){if(e&1&&(V(0),d(1,En,1,3,"explorer-export-content-confirmation",11),D()),e&2){let t=l();a(),p("ngIf",!t.isImporting&&t.confirmingExport&&t.exportParams)}}function bn(e,o){if(e&1&&(P(0,"explorer-bulk-actions-pending",13),m(1,"translate"),m(2,"async")),e&2){let t=l();p("content",T(1,2,"explorer-ng.bulkActions.copy.inProgress",We(7,gn,t.fromSpaceLabel,t.toSpace)))("actionInfo",u(2,5,t.progress$))}}function Sn(e,o){if(e&1){let t=A();s(0,"explorer-import-content-form",16),F("submitted",function(r){I(t);let n=l(3);return M(n.formSubmitted(r))}),c()}}function Pn(e,o){if(e&1){let t=A();s(0,"explorer-import-elements-form",17),F("onSubmit",function(r){I(t);let n=l(3);return M(n.formSubmitted(r))}),c()}}function Tn(e,o){if(e&1&&d(0,Sn,1,0,"explorer-import-content-form",14)(1,Pn,1,0,"explorer-import-elements-form",15),e&2){let t=l(2);p("ngIf",!t.useWorkspaceLevelEC),a(),p("ngIf",t.useWorkspaceLevelEC)}}function vn(e,o){e&1&&(V(0),d(1,Tn,2,2),Le(2,1,fn),Ve(),D())}function In(e,o){if(e&1){let t=A();s(0,"ui2-button",18),F("clicked",function(){I(t);let r=l();return M(r.onBackButtonClicked())}),g(1),m(2,"translate"),c()}e&2&&(a(),O(u(2,1,"explorer-ng.landingPage.cloneEntity.back")))}var Gi=(()=>{let o=class o{constructor(i,r,n,f,E,b,C,_,R,x,y,v){this.entityService=i,this.modalService=r,this.entityConfigService=n,this.permissionService=f,this.elementTypeUsageService=E,this.changeDetectorRef=b,this.statsService=C,this.trackingService=_,this.featureFlagService=R,this.store=x,this.elementTypeService=y,this.router=v,this.destroyRef=Be(Ae),this.onSpaceSelected=new Q,this.isBulkCopy=!1,this.showBackButton=!1,this.backButtonClicked=new Q,this.isImporting=!1,this.fromSpaceLabel="",this.toSpace="",this.selectedSpaceUri="",this.spaces=[],this.confirmingExport=!1,this.entityTypesInTenant=[],this.loading=!1,this.useWorkspaceLevelEC=!1,this.checkingCompatibility=!1,this.checkingFeature=!0,this.queryParams={}}ngOnInit(){this.init(),this.store.select(_e.selectCurrentSpaceUri).pipe(Oe(this.store.select(_e.selectCurrentSpace))).pipe(Qe(),Ee(this.destroyRef)).subscribe(([i,r])=>{this.currentSpaceUri=i,this.fromSpace=r}),this.queryParams=this.router.routerState.snapshot.root.queryParams}formSubmitted({fromSpaceUri:i,fromSpaceLabel:r,toSpaceUri:n,toSpaceLabel:f,filterQuery:E,forceUpdate:b}){this.fromSpaceLabel=Y(r),this.toSpace=Y(f),this.modalService.updateModalOption({closeable:!1,dismissable:!1,escapable:!1,customClass:"no-header"}),this.modalService.setTitle(""),this.isImporting=!0,this.progress$=this.entityService.bulkCopyEntitiesWithProgress({fromSpaceUri:i,fromSpaceLabel:r,toSpaceUri:n,toSpaceLabel:f,filterQuery:E,forceUpdate:b}).pipe(K(R=>{var x=R,{progressStatus:C}=x,_=ue(x,["progressStatus"]);return $({status:`explorer-ng.bulkActions.copy.status.${C}`},_)}),Me(()=>{this.modalService.closeModal()}),ve(C=>Se({status:"explorer-ng.bulkActions.copy.status.ERROR"})),ke({status:"explorer-ng.bulkActions.copy.status.INITIALIZING"}))}selectSpace(i){this.onSpaceSelected.emit(i)}init(){return G(this,null,function*(){this.useWorkspaceLevelEC=yield this.featureFlagService.isFeatureEnabled(rt.WORKSPACE_LEVEL_ELEMENT_CONFIG),this.checkingFeature=!1,this.isBulkCopy&&(this.loading=!0,this.getAvailableSpaces()),this.changeDetectorRef.detectChanges()})}getAvailableSpaces(){this.store.select(Ge.selectCurrentTenant).pipe(we(i=>this.store.select(_e.selectSpacesByTenantUri(i?.tenantUri))),Ee(this.destroyRef)).subscribe(i=>{this.spaces=i.filter(r=>!yt(r)&&r.isMember),this.filterSpacesByEntityConfigUri()})}filterSpacesByEntityConfigUri(){console.assert(!!this.currentSpaceUri,"currentSpaceUri should not be null"),this.spaces=this.spaces.filter(i=>i.uri!==this.currentSpaceUri),this.loading=!1,this.changeDetectorRef.markForCheck()}confirmExport(i){return G(this,null,function*(){i.toSpace&&(this.entityTypesInTenant=yield this.entityConfigService.getAllElementTypesBasedOnViewPermission(),(yield this.prepBulkCopy(i)).subscribe(n=>{this.exportParams=n,this.checkingCompatibility=!1,this.changeDetectorRef.markForCheck()}))})}prepBulkCopy(b){return G(this,null,function*(){var C=b,{toSpace:i,selected:r,entityTypesMap:n,filter:f}=C,E=ue(C,["toSpace","selected","entityTypesMap","filter"]);this.confirmingExport=!0;let _=[...new Set(r?.map(y=>y.elementTypeUri))];if(this.useWorkspaceLevelEC&&f){if(E.selectAll&&f){let S=yield Pe(this.entityService.getEntityTypeStats([this.currentSpaceUri||""])),H=Tt(f);_=H.length?_.filter(L=>H.includes(L)):S[0].elementTypeStats.filter(L=>!!L.published).map(L=>L.elementTypeUri)}this.checkingCompatibility=!0,console.assert(!!this.currentSpaceUri,"currentSpaceUri should not be null");let y=yield this.buildElementTypesWithCopyPermission(i,_,n),v=y.map(S=>S.uri);return this.elementTypeService.checkTypeCompatibility(this.currentSpaceUri,i.uri,_).pipe(K(S=>{let H=_.reduce((j,z)=>(j[z]=S.includes(z),j),{});if(E.selectAll&&f){let j=f.findQuery(U=>U.getIdentifier()==="sidebar"),z=_.filter(U=>S.includes(U)),fe=new be.LeafFilter("elementTypeUri").setValues(z).setIdentifier("elementTypeUri");j.addFilter(fe)}else{let j=f?.findQuery(U=>U.getIdentifier()==="uri");j&&f?.removeFilter(j);let z=r?.filter(U=>S.includes(U?.elementTypeUri)&&!v.includes(U?.elementTypeUri)).map(U=>U?.uri)||[],fe=new be.LeafFilter("uri").setValues(z).setIdentifier("uri");f.addFilter(fe)}let L=this.buildCompatibleAndIncompatibleData(H,_,n,E.selectAll);return $({toSpace:i,incompatibleTypes:L.incompatibleTypes,incompatibleElementsCount:L.incompatibleElementsCount,compatibleElementsUri:L.compatibleElementsUri,selected:r,filter:f,notAllowedElementTypes:y},E)}),xe(S=>this.updateEditPermission(S,i)))}return Ce(this.entityConfigService.getAllElementTypesBasedOnViewPermission(i.uri)).pipe(K(y=>{let v=y.reduce((S,H)=>(S[H.uri]=!0,S),{}),B=this.buildCompatibleAndIncompatibleData(v,_,n,E.selectAll);return $({toSpace:i,incompatibleTypes:B.incompatibleTypes,incompatibleTypesInTenant:B.incompatibleTypesInTenant,incompatibleElementsCount:B.incompatibleElementsCount,compatibleElementsUri:B.compatibleElementsUri,selected:r,filter:f},E)}),xe(y=>this.updateEditPermission(y,i)))})}buildElementTypesWithCopyPermission(i,r,n){return G(this,null,function*(){let E=(yield this.entityConfigService.getElementTypesBasedOnPermission([X.CREATE_ELEMENT],i.uri)).map(C=>C.uri);return[...new Set(r.filter(C=>!E.includes(C)).map(C=>n?.[C]).filter(C=>C!==void 0))]})}buildCompatibleAndIncompatibleData(i,r,n,f){let E=[],b=[],C=0;r.forEach(x=>{i[x]?b.push(x):(E.push(x),C++)});let _=[...new Set(E)].map(x=>n[x]).filter(x=>!!x);if(f){let x=this.statsService.getFilterStatistics().map(v=>v.elementTypeUri),y=[];x.forEach(v=>{let B=_.find(S=>S.uri===v);B&&y.push(B)}),_=y}if(this.useWorkspaceLevelEC)return{incompatibleTypes:_,incompatibleElementsCount:C,compatibleElementsUri:b};let R=[];return _.forEach(x=>{this.entityTypesInTenant.find(v=>v.uri===x.uri)||R.push(x)}),R.forEach(x=>{_=_.filter(y=>y.uri!==x.uri)}),{incompatibleTypes:_,incompatibleTypesInTenant:R,incompatibleElementsCount:C,compatibleElementsUri:b}}updateEditPermission(i,r){return i.incompatibleElementsCount?this.permissionService.userHasAnyPermission([he.SHARE_ACCESS,he.EDIT_SPACE,X.ADD_USER,X.MANAGE_ALL_WORKSPACES,X.EDIT_WORKSPACE],r.uri,r.tenantUri).pipe(K(n=>ge($({},i),{editPermission:n}))):Ce([ge($({},i),{editPermission:!1})])}startBulkCopy(R,x){return G(this,arguments,function*({incompatibleTypes:i,toSpace:r,filter:n,selectAll:f,selected:E,compatibleElementsUri:b,notAllowedElementTypes:C},_){let y;if(_.activateElementTypes){this.trackingService.trackEventById(_.forceUpdate?"explorer.bulkCopy.forceCopyAndEnable":"explorer.bulkCopy.copyAndEnable");let v=i.map(B=>this.elementTypeUsageService.allowElementTypeUsageInSpace(B.uri,r.tenantUri,r.uri));yield Te(...v).pipe(Ie(1)).forEach(()=>null),y=n}else i.length?this.trackingService.trackEventById(_.forceUpdate?"explorer.bulkCopy.forceCopyCompatible":"explorer.bulkCopy.copyCompatible"):this.trackingService.trackEventById(_.forceUpdate?"explorer.bulkCopy.forceCopy":"explorer.bulkCopy.copy"),y=n;this.formSubmitted({filterQuery:y,toSpaceUri:r.uri,toSpaceLabel:r.label,fromSpaceUri:this.fromSpace.uri,fromSpaceLabel:this.fromSpace.label,forceUpdate:_.forceUpdate}),this.changeDetectorRef.markForCheck()})}onBackButtonClicked(){this.backButtonClicked.next()}};o.\u0275fac=function(r){return new(r||o)(h(bt),h(tt),h(Ct),h(Ze),h(ut),h(Ne),h(xt),h(et),h(Ye),h($e),h(gt),h(He))},o.\u0275cmp=ee({type:o,selectors:[["explorer-import-content-modal"]],inputs:{isBulkCopy:"isBulkCopy",showBackButton:"showBackButton"},outputs:{onSpaceSelected:"onSpaceSelected",backButtonClicked:"backButtonClicked"},standalone:!0,features:[re],decls:8,vars:7,consts:[["select",""],[4,"ngIf"],["class","label-sm-semibold-single",4,"ngIf"],["class","ui2-dropdown mb-4 mt-2",3,"items","placeholder","ngModel","ngModelChange","change",4,"ngIf"],[3,"content","actionInfo",4,"ngIf"],[1,"import-content-back-button"],["class","button-text",3,"clicked",4,"ngIf"],[1,"label-sm-semibold-single"],[1,"ui2-dropdown","mb-4","mt-2",3,"ngModelChange","change","items","placeholder","ngModel"],["ng-header-tmp",""],[3,"select"],[3,"exportParams","useWorkspaceLevelEC","showLoader","startCopy",4,"ngIf"],[3,"startCopy","exportParams","useWorkspaceLevelEC","showLoader"],[3,"content","actionInfo"],["class","mb-4",3,"submitted",4,"ngIf"],["class","mb-4",3,"onSubmit",4,"ngIf"],[1,"mb-4",3,"submitted"],[1,"mb-4",3,"onSubmit"],[1,"button-text",3,"clicked"]],template:function(r,n){r&1&&(d(0,un,1,0,"ui-loader",1)(1,Cn,3,3,"span",2)(2,yn,4,5,"ng-select",3)(3,hn,2,1,"ng-container",1)(4,bn,3,10,"explorer-bulk-actions-pending",4)(5,vn,4,0,"ng-container",1),s(6,"span",5),d(7,In,3,3,"ui2-button",6),c()),r&2&&(p("ngIf",n.loading&&n.isBulkCopy),a(),p("ngIf",n.isBulkCopy&&!n.loading),a(),p("ngIf",n.isBulkCopy&&!n.loading),a(),p("ngIf",n.selectedSpace&&n.isBulkCopy),a(),p("ngIf",n.isImporting),a(),p("ngIf",!n.isImporting&&!n.confirmingExport&&!n.isBulkCopy&&!n.checkingFeature),a(2),p("ngIf",n.showBackButton&&!n.isImporting))},dependencies:[ae,J,je,me,ce,ft,mt,ct,st,lt,se,pe,le,vt,St],styles:[".hidden[_ngcontent-%COMP%]{visibility:none!important}[_nghost-%COMP%]{position:relative}[_nghost-%COMP%]   .import-content-back-button[_ngcontent-%COMP%]{position:absolute;bottom:0;left:0}[_nghost-%COMP%]   .import-content-back-button[_ngcontent-%COMP%]     ui2-button>button{min-height:36px}"],changeDetection:0});let e=o;return e})();export{vt as a,Gi as b};
