1import{S as K,Ta as X,U as J,b as L,ha as W,p as j}from"./chunk-JQO2TWQ6.js";import{I as Q}from"./chunk-FJGCPGIF.js";import"./chunk-4RNQWIV6.js";import{p as F}from"./chunk-CJHUNIC5.js";import"./chunk-7ZMQM2WN.js";import"./chunk-UOFOCZLC.js";import{b as V}from"./chunk-7EJNEQFC.js";import"./chunk-6BME2YS5.js";import{Ad as G,N as y,Na as u,Oc as R,Ra as r,Sb as O,Ub as c,Vb as g,Wb as k,_a as A,bd as q,db as h,lc as x,mb as b,mc as D,nc as w,ob as I,pa as U,qc as S,qd as H,t as d,ta as p,tb as m,ub as a,ud as $,vb as o,wb as T,wd as z,x as E,xd as B,y as P}from"./chunk-BUIIXSYE.js";var C=(function(t){return t.DOCUMENT="user_management.downloads.export_type.document",t.DOCUMENTACCESSSTATISTICS="user_management.downloads.export_type.document_access_statistics",t.LICENSEDDOCUMENTS="user_management.downloads.export_type.document_licenses",t.LICENSESETTINGS="user_management.downloads.export_type.license_settings",t.SEARCH="user_management.downloads.export_type.search",t.ORDER_MANAGEMENT="user_management.downloads.export_type.order_management",t.HOSTED_FILE="user_management.downloads.export_type.hosted_file",t.REQIF_CONVERSION="user_management.downloads.export_type.reqif_conversion",t.LOGINSTATISTICS="user_management.downloads.export_type.login_statistics",t.ORDERSTATISTICS="user_management.downloads.export_type.order_statistics",t})(C||{});var Y=(()=>{class t{constructor(){this._configService=p(H),this._httpClient=p(q)}getDocumentExports(){let e=this.getUrl("export/csv");return this._httpClient.get(e).pipe(E(i=>i.map(n=>this.exportDtoToExportModel(n))))}getOrderManagementExports(){let e=this.getUrl("order/csv");return this._httpClient.get(e).pipe(E(i=>i.map(n=>this.legacyExportDtoToExportModel(n,C.ORDER_MANAGEMENT))))}getHostedFileExports(){let e=this.getUrl("files/hostedfile/listexports");return this._httpClient.get(e).pipe(E(i=>i.map(n=>this.legacyExportDtoToExportModel(n,C.HOSTED_FILE))))}getReqIfConversions(){let e=this.getUrl("documentaccess/reqif/downloads");return this._httpClient.get(e).pipe(E(i=>i.map(n=>this.mapReqIfDownloadDtoToExportModel(n,C.REQIF_CONVERSION))))}getUrl(e){return`${this._configService.baseConfig.baseUrl}${this._configService.baseConfig.extension}/${e}`}exportDtoToExportModel(e){return{type:C[e.exportType.toUpperCase()],fileName:e.fileName,createDate:e.creationTime,deleteDate:e.deleteTime,filePath:e.s3PreSignedUrl}}legacyExportDtoToExportModel(e,i){return{type:i,fileName:e.fileName,createDate:e.creationTime,deleteDate:e.deleteTime,filePath:e.s3PreSignedUrl}}mapReqIfDownloadDtoToExportModel(e,i){return{type:i,fileName:e.fileName,createDate:e.created.toString(),deleteDate:e.validUntil.toString(),filePath:e.preSignedUrl}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=U({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function te(t,l){t&1&&T(0,"app-spinner")}function ie(t,l){if(t&1&&(a(0,"button",12)(1,"a",13),T(2,"app-icon",14),o()()),t&2){let e=l.item;r(),m("href",e.filePath,u)}}function ne(t,l){if(t&1&&(a(0,"a",15),c(1),x(2,"transloco"),o()),t&2){let e=l.item;m("href",e.filePath,u),r(),k("",D(2,2,e.type)," ")}}function oe(t,l){if(t&1&&(a(0,"a",16),c(1),o()),t&2){let e=l.item;m("href",e.filePath,u),r(),g(e.fileName)}}function ae(t,l){if(t&1&&(a(0,"a",17),c(1),x(2,"date"),o()),t&2){let e=l.item;m("href",e.filePath,u),r(),g(w(2,2,e.createDate,"dd.MM.yyyy"))}}function re(t,l){if(t&1&&(a(0,"a",18),c(1),x(2,"date"),o()),t&2){let e=l.item;m("href",e.filePath,u),r(),g(w(2,2,e.deleteDate,"dd.MM.yyyy"))}}function le(t,l){t&1&&(a(0,"div",11),T(1,"app-icon",19),a(2,"p",20),c(3),x(4,"transloco"),o()()),t&2&&(r(3),g(D(4,1,"exports.no_exports")))}var Oe=(()=>{class t{constructor(){this._authService=p(F),this._exportsService=p(Y),this._feedbackService=p(V),this._tenantStateService=p(j),this._translocoService=p($),this.isPending=!0,this.metadataExports=[],this.totalCount=0,this._hasHostingModule=!1}ngOnInit(){this._hasHostingModule=this._authService.currentTokenDecoded.hasHostingModule;let e=this._exportsService.getDocumentExports().pipe(y(()=>d(null))),i=this._authService.userHasOnePermission(["admin",L.STATISTICTS_PANEL]),n=d([]),M=d([]);i&&(n=this._exportsService.getOrderManagementExports().pipe(y(()=>d(null))),this._hasHostingModule&&(M=this._exportsService.getHostedFileExports().pipe(y(()=>d(null))))),this._tenantStateService.hasReqIFModuleAndAdminAccess(this._authService.userInfo.tenantId).subscribe(f=>{f&&this._exportsService.getReqIfConversions().pipe(y(()=>d(null))).subscribe(s=>{if(s==null){let _=this._translocoService.translate("exports.reqif_downloads_request_failed")+" ";this._feedbackService.showErrorModal(_),s=[]}this.metadataExports.push(...s),this.totalCount+=s.length})}),P([e,n,M]).subscribe({next:([f,s,_])=>{let v=[];
1if(f==null&&(v.push("exports.document_exports_request_failed"),f=[]),s==null&&(v.push("exports.order_management_exports_request_failed"),s=[]),_==null&&(v.push("exports.hosted_file_exports_request_failed"),_=[]),v.length>0){let N="";v.forEach(Z=>{N+=this._translocoService.translate(Z)+" "}),this._feedbackService.showErrorModal(N)}this.metadataExports=[...f,...s,..._],this.totalCount=f.length+s.length+_.length,this.isPending=!1},error:()=>{this.isPending=!1}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["app-exports"]],decls:26,vars:10,consts:[["tableCell",""],[1,"overview-container"],[1,"header"],[3,"count"],[1,"container-table"],["data-cy","table",3,"items","hasCheckboxColumn"],["tableColumn","","itemProperty","downloadUrl","styleClasses","button-column"],["tableColumn","","columnText","user_management.downloads.export_type.header","itemProperty","deleteDate"],["tableColumn","","columnText","common.file_name","itemProperty","fileName"],["tableColumn","","columnText","user_management.downloads.date_of_creation","itemProperty","createDate"],["tableColumn","","columnText","user_management.downloads.date_of_deletion","itemProperty","deleteDate"],[1,"no-content"],["type","button","data-cy","exportDownload",1,"btn-icon"],["target","_blank","download","",3,"href"],["name","cloud-download"],["download","","target","_blank","data-cy","exportArea",1,"link",3,"href"],["download","","target","_blank","data-cy","exportFileName",1,"link-bold",3,"href"],["download","","target","_blank","data-cy","exportCreateDate",1,"link",3,"href"],["download","","target","_blank","data-cy","exportDeleteDate",1,"link",3,"href"],["sprite","icons-large","name","cloud-download-empty-large","data-cy","iconNoCompanyData",1,"icon-inactive"],["data-cy","textNoCompanyData"]],template:function(i,n){i&1&&(b(0,te,1,0,"app-spinner"),a(1,"div",1)(2,"div",2)(3,"div")(4,"h1"),c(5),x(6,"transloco"),o(),T(7,"app-record-count",3),o()(),a(8,"div",4)(9,"app-table",5)(10,"div",6),h(11,ie,3,1,"ng-template",null,0,S),o(),a(13,"div",7),h(14,ne,3,4,"ng-template",null,0,S),o(),a(16,"div",8),h(17,oe,2,2,"ng-template",null,0,S),o(),a(19,"div",9),h(20,ae,3,5,"ng-template",null,0,S),o(),a(22,"div",10),h(23,re,3,5,"ng-template",null,0,S),o()(),b(25,le,5,3,"div",11),o()()),i&2&&(I(n.isPending?0:-1),r(),O("hide",n.isPending),r(4),g(D(6,8,"user_management.downloads.title")),r(2),m("count",n.totalCount),r(2),m("items",n.metadataExports)("hasCheckboxColumn",!1),r(16),I(n.totalCount===0?25:-1))},dependencies:[G,K,W,Q,J,B,X,R,z],encapsulation:2})}}return t})();export{Oe as ExportsComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.