1import{a as Y}from"./chunk-AYJLAGJ6.js";import{a as Z}from"./chunk-2SY64CSI.js";import{a as X}from"./chunk-IN2YPIEE.js";import{a as K}from"./chunk-Q4G2ZMXX.js";import{a as J}from"./chunk-HOKYIHUH.js";import{g as W}from"./chunk-GMTRYUGD.js";import{a as H}from"./chunk-HMIWADSM.js";import{m as B}from"./chunk-ZR7OCWLC.js";import{E as q,F as A,G as N,H as V,I as M,J as z,X as R,Y as Q}from"./chunk-33YVPBLL.js";import"./chunk-G6H4JEE3.js";import{e as G,f as L}from"./chunk-S2HTAEPT.js";import{Cb as w,Eb as p,Hb as k,Hc as $,Ib as S,Na as m,Pb as a,Q as g,Qb as s,Rb as d,Sa as l,Sb as P,Xb as U,Yb as F,ca as E,eb as f,jb as j,l as T,nb as c,oa as v,pa as O,pb as y,qb as b,rb as I,sb as r,tb as i,ub as _,ya as h,yb as C,za as D}from"./chunk-H5GA4PJO.js";var ie=()=>["/workbench","team-overview"];function ne(n,o){if(n&1&&(r(0,"p",10),a(1,"Template Generator Direct Link: "),r(2,"span")(3,"a",12),a(4),i()()(),r(5,"p",10),a(6,"Team Direct Link:"),r(7,"span")(8,"a",12),a(9),i()()()),n&2){let e=p();l(3),k("href",e.templateUrl,m),l(),s(e.templateUrl),l(4),k("href",e.teamUrl,m),l(),s(e.teamUrl)}}function oe(n,o){n&1&&(r(0,"p",10),a(1," This is a public project"),i())}function re(n,o){n&1&&(r(0,"p",10),a(1," This is a private project and is not discoverable"),i())}function le(n,o){n&1&&(r(0,"p",10),a(1," This is a private project but is discoverable"),i())}function ae(n,o){if(n&1&&(r(0,"span"),a(1),i()),n&2){let e=p(2);l(),d(", ",e.projectDetails==null?null:e.projectDetails.principalInvestigatorAffiliation,"")}}function pe(n,o){if(n&1&&(r(0,"div",2)(1,"div",7)(2,"p",8),a(3,"Prin. Investigator"),i()(),r(4,"div",9)(5,"p",10),a(6),f(7,ae,2,1,"span"),i()()()),n&2){let e=p();l(6),d(" ",e.projectDetails==null?null:e.projectDetails.principalInvestigator," "),l(),c(e.projectDetails!=null&&e.projectDetails.principalInvestigatorAffiliation?7:-1)}}function ce(n,o){if(n&1&&(r(0,"a",11),a(1),i()),n&2){let e=p(2);S("href","mailto:",e.projectDetails==null?null:e.projectDetails.projectContactEmail,"",m),l(),s(e.projectDetails==null?null:e.projectDetails.projectContactEmail)}}function se(n,o){if(n&1&&(r(0,"div",2)(1,"div",7)(2,"p",8),a(3,"Contact"),i()(),r(4,"div",9)(5,"p",10),a(6),f(7,ce,2,3,"a",11),i()()()),n&2){let e=p();l(6),d(" ",e.projectDetails==null?null:e.projectDetails.projectContact," "),l(),c(e.projectDetails!=null&&e.projectDetails.projectContactEmail?7:-1)}}function de(n,o){if(n&1&&(r(0,"div",2)(1,"div",7)(2,"p",8),a(3,"Publication DOI"),i()(),r(4,"div",9)(5,"p",10)(6,"a",13),a(7),i()()()()),n&2){let e=p();l(6),j("href",e.publicationGuidLink,m),l(),s(e.projectDetails==null?null:e.projectDetails.publicationGuid)}}function me(n,o){if(n&1&&(r(0,"div",2)(1,"div",7)(2,"p",8),a(3,"Project Data GUID"),i()(),r(4,"div",9)(5,"p",10),a(6),i()()()),n&2){let e=p();l(6),d(" ",e.projectDetails==null?null:e.projectDetails.projectDataGuid,"")}}function ue(n,o){if(n&1&&(r(0,"a",13),a(1),i()),n&2){let e=p(2);j("href",e.permitGuidLink,m),l(),s(e.projectDetails==null?null:e.projectDetails.permitGuid)}}function ve(n,o){if(n&1&&a(0),n&2){let e=p(2);d(" ",e.projectDetails==null?null:e.projectDetails.permitGuid," ")}}function je(n,o){if(n&1&&(r(0,"div",2)(1,"div",7)(2,"p",8),a(3,"Permit GUID"),i()(),r(4,"div",9)(5,"p",10),f(6,ue,2,2,"a",13)(7,ve,1,1),i()()()),n&2){let e=p();l(6),c(e.permitGuidLink?6:7)}}function fe(n,o){if(n&1&&(r(0,"div",2)(1,"div",7)(2,"p",8),a(3,"Citation"),i()(),r(4,"div",9)(5,"p",10),a(6),i()()()),n&2){let e=p();l(6),d(" ",e.projectDetails==null?null:e.projectDetails.recommendedCitation,"")}}function xe(n,o){if(n&1&&(r(0,"div",2)(1,"div",7)(2,"p",8),a(3,"Local Contexts Page"),i()(),r(4,"div",9)(5,"p",10)(6,"span")(7,"a",11),a(8),i()()()()()),n&2){let e=p();l(7),S("href","https://localcontextshub.org/projects/",e.projectDetails==null?null:e.projectDetails.localcontextsId,"",m),l(),d("https://localcontextshub.org/projects/",e.projectDetails==null?null:e.projectDetails.localcontextsId,"")}}function _e(n,o){if(n&1&&(r(0,"div",2)(1,"div",7)(2,"p",8),a(3,"License"),i()(),r(4,"div",9)(5,"p",10),a(6),i()()()),n&2){let e=p();l(6),d(" ",e.projectDetails==null?null:e.projectDetails.license,"")}}function he(n,o){if(n&1&&(r(0,"div",2)(1,"div",7)(2,"p",8),a(3,"Team workspace"),i()(),r(4,"div",9)(5,"p",10)(6,"span",14),a(7),i(),r(8,"span",15)(9,"a",11),a(10),i()(),r(11,"button",16),_(12,"i",17),i()()()()),n&2){let e=p();l(6),j("routerLink",F(4,ie)),l(),d("",e.projectDetails==null?null:e.projectDetails.projectConfiguration.name," team"),l(2),j("href","mailto:"+(e.projectDetails==null?null:e.projectDetails.projectConfiguration.user.email),m),l(),s(e.projectDetails==null?null:e.projectDetails.projectConfiguration.user.email)}}function De(n,o){n&1&&(r(0,"div",2)(1,"div",3)(2,"p",5),a(3,"There are no expeditions associated with this project."),i()()())}function Ce(n,o){if(n&1){let e=C();r(0,"button",32),w("click",function(){let u=h(e).$implicit;return D(u.fn())}),a(1),i()}if(n&2){let e=o.$implicit;l(),s(e.name)}}function we(n,o){if(n&1&&(r(0,"div",27)(1,"span",28),_(2,"i",29),i(),r(3,"div",30),b(4,Ce,2,1,"button",31,y),i()()),n&2){let e=p().$implicit,t=p(2);l(4),I(t.menuOptions(e))}}function Se(n,o){if(n&1){let e=C();r(0,"tr")(1,"td")(2,"div",24)(3,"span"),a(4),i(),r(5,"span",25)(6,"b"),a(7,"Owner:"),i(),r(8,"a",11),a(9),i(),a(10),i()()(),r(11,"td"),a(12),i(),r(13,"td"),a(14),i(),r(15,"td"),a(16),i(),r(17,"td"),a(18),i(),r(19,"td"),a(20),i(),r(21,"td")(22,"a",12),a(23),i()(),r(24,"td")(25,"i",26),w("click",function(){let u=h(e).$implicit,x=p(2);return D(x.viewData(u.expeditionCode))}),i()(),r(26,"td"),f(27,we,6,0,"div",27),i()()}if(n&2){let e,t=o.$implicit,u=p(2);l(4),s(t.expeditionTitle),l(4),j("href","mailto:"+(t==null?null:t.ownerEmail),m),l(),P(" ",t.ownerFirstName," ",t.ownerLastName,""),l(),d(" ",t.ownerUsername?"["+t.ownerUsername+"]":"",""),l(2),s(t.EventCount),l(2),s(t.SampleC
1ount),l(2),s(t.TissueCount),l(2),s(t.fastaSequenceCount),l(2),s(t.fastqMetadataCount),l(2),j("href",u.expeditionRecordUrl(t.expeditionIdentifier),m),l(),d(" https://n2t.net/",t.expeditionIdentifier," "),l(4),c(u.menuOptions(t)&&((e=u.menuOptions(t))!=null&&e.length)?27:-1)}}function ge(n,o){if(n&1){let e=C();r(0,"div",18)(1,"div",19)(2,"button",20),w("click",function(){h(e);let u=p();return D(u.downloadProjectCsv())}),a(3,"PROJECT CSV ARCHIVE "),_(4,"i",21),i()()(),r(5,"table",22)(6,"thead")(7,"tr")(8,"th",23),a(9,"Expedition Title"),i(),r(10,"th",23),a(11,"Events"),i(),r(12,"th",23),a(13,"Samples"),i(),r(14,"th",23),a(15,"Tissues"),i(),r(16,"th",23),a(17,"Fasta Sequences"),i(),r(18,"th",23),a(19,"Fastq Metadata"),i(),r(20,"th",23),a(21,"Expedition GUID"),i(),_(22,"th",23)(23,"th",23),i()(),r(24,"tbody"),b(25,Se,28,13,"tr",null,y),i()()}if(n&2){let e=p();l(2),j("disabled",e.projectDetails==null?null:e.projectDetails.limitedAccess),l(23),I(e.displayExpedition)}}var ee=class n{router=v(G);toastr=v(B);fileService=v(K);dataService=v(Z);queryService=v(X);projectService=v(W);dummyDataService=v(H);expeditionService=v(J);destroy$=new T;projectDetails;templateUrl="";teamUrl="";allExpedition=[];displayExpedition=[];downloadingFile=!1;headers=[];menuCache={};constructor(){this.dummyDataService.loadingState.next(!0);let o=window.location.href.split("?").slice(0,1).join("");this.projectService.currentProject$().pipe(E(this.destroy$)).subscribe(e=>{this.projectDetails=e,e&&(this.getExpeditionStats(),this.templateUrl=o.replace("project-overview","template")+`?projectId=${e.projectId}`,this.teamUrl=o.replace("project-overview","team-overview")+`?projectId=${e.projectId}`)})}getExpeditionStats(){this.expeditionService.stats(this.projectDetails.projectId).pipe(g(1),E(this.destroy$)).subscribe({next:o=>{o&&(this.allExpedition=this.displayExpedition=o,this.displayExpedition[0]&&(this.headers=Object.keys(this.displayExpedition[0]).filter(e=>e.endsWith("Count")))),this.dummyDataService.loadingState.next(!1)}})}downloadProjectCsv(){if(this.downloadingFile)return;this.downloadingFile=!0;let o=this.worksheetEntities(),e=o.shift(),t=this.getQuery(void 0,o);this.queryService.downloadCsv(t,e),setTimeout(()=>this.downloadingFile=!1,1e3)}menuOptions(o){if(!this.projectDetails.limitedAccess){if(!this.menuCache[o.expeditionCode]){let e=!1;this.menuCache[o.expeditionCode]=this.headers.map(t=>{let u=t.replace("Count",""),x=this.projectDetails.config.entities.find(te=>te.conceptAlias===u);if(x&&Number(o[t]))return x.worksheet?e?void 0:(e=!0,{fn:()=>this.downloadExpCsv(o.expeditionCode),name:"CSV Archive"}):x.type==="Fastq"?{fn:()=>this.downloadFastq(o.expeditionCode),name:"Fastq - SRA Metadata"}:void 0}).filter(t=>!!t),e&&this.menuCache[o.expeditionCode].splice(1,0,{fn:()=>this.downloadExcel(o.expeditionCode),name:"Excel Workbook"})}return this.menuCache[o.expeditionCode]}}downloadExpCsv(o){this.downloadingFile||(this.downloadingFile=!0,this.dataService.exportData(this.projectDetails.projectId,o).pipe(g(1)).subscribe(e=>{!e||e.status===204?this.toastr.warning("No resources found"):e.url&&(this.fileService.download(e.url),this.toastr.success("Downloading Data!")),this.downloadingFile=!1}))}downloadFastq(o){if(this.downloadingFile)return;this.downloadingFile=!0;let e=this.dataService.generateSraData(this.projectDetails.projectId,o);e&&(this.fileService.download(e),this.toastr.success("Downloading Data!")),this.downloadingFile=!1}downloadExcel(o){if(this.downloadingFile)return;this.downloadingFile=!0;let e=this.worksheetEntities(),t=e.shift();this.queryService.downloadExcel(this.getQuery(o,e),t),setTimeout(()=>this.downloadingFile=!1,1e3)}worksheetEntities(){return this.projectDetails.config.entities.filter(o=>!!o.worksheet).sort((o,e)=>o.parentEntity?e.parentEntity?0:1:e.parentEntity?-1:0).map(o=>o.conceptAlias)}getQuery(o,e){let t=new Y;return o&&t.expeditions.push({expeditionCode:o}),t.projects.push(this.projectDetails),t.buildQuery(e)}viewData(o){this.router.navigateByUrl(`/query?q=_projects_:${this.projectDetails.projectId} and _expeditions_:[${o}]`)}resolveGuidLink(o){let e=`${o||""}`.trim();return e?/^https?:\/\//i.test(e)?e:/^doi:\s*/i.test(e)?`https://doi.org/${e.replace(/^doi:\s*/i,"")}`:/^doi\.org\//i.test(e)?`https://${e}`:/^10\.\S+/i.test(e)?`https://doi.org/${e}`:/^ark:\//i.test(e)?`https://n2t.net/${e}`:"":""}get publicationGuidLink(){return this.resolveGuidLink(this.projectDetails?.publicationGuid)}get permitGuidLink(){return this.resolveGuidLink(this.projectDetails?.permitGuid)}expeditionRecordUrl(o){let e=`${o||""}`.trim();return e?`${window.location.origin}/record/${e}`:""}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-project-overview"]],standalone:!0,features:[U],decls:48,vars:21,consts:[["id","project-container",1,"p-3","pt-4","mb-3","container-bg","shadow"],[1,"container"],[1,"row"],[1,"col-lg-12"],[1,"m-0","text-center"],[1,"mt-2","mb-4","text-center"],[1,"project-details","custom-table-container"],[1,"col-lg-2"],[1,"proj-1"],[1,"col-lg-10"],[1,"proj-2"],["target","_blank",3,"href"],[3,"href"],["target","_blank","rel","noopener noreferrer",1,"doi-link",3,"href"],[1,"biocode-btn","cursor-pointer",3,"routerLink"],[1,"px-2"],["placement","top","ngbPopover","This team workspace specifies all validation rules and terms for this project. If you have any questions or suggestions, please contact the team owner.",1,"btn"],[1,"fas","fa-circle-question"],[1,"row","mb-3"],[1,"d-flex","justify-content-center"],["type","button",1,"btn","btn-primary","custom",3,"click","disabled"],[1,"fas","fa-download","ms-2"],[1,"table","table-striped"],["scope","col"],[1,"d-flex","flex-column","gap-1"],[1,"f-12","text-secondary"],[1,"fas","fa-search","text-secondary","f-16","cursor-pointer",3,"click"],["ngbDropdown","",1,"d-inline-block"],["id","download-options","ngbDropdownToggle","",1,"curs
1or-pointer"],[1,"fas","fa-download","text-primary","f-16"],["ngbDropdownMenu","","aria-labelledby","download-options"],["ngbDropdownItem",""],["ngbDropdownItem","",3,"click"]],template:function(e,t){e&1&&(r(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h4",4),a(5),i(),r(6,"p",5),a(7),i()()(),r(8,"div",6)(9,"div",2)(10,"div",7)(11,"p",8),a(12,"Project owner"),i()(),r(13,"div",9)(14,"p",10)(15,"a",11),a(16),i(),a(17),i()()(),r(18,"div",2)(19,"div",7)(20,"p",8),a(21,"Shareable URLs"),i()(),r(22,"div",9)(23,"p",10),a(24," Project URL: "),r(25,"span")(26,"a",12),a(27),i()()(),f(28,ne,10,4),i()(),r(29,"div",2)(30,"div",7)(31,"p",8),a(32,"Visibility"),i()(),r(33,"div",9),f(34,oe,2,0,"p",10)(35,re,2,0,"p",10)(36,le,2,0,"p",10),i()(),f(37,pe,8,2,"div",2)(38,se,8,2,"div",2)(39,de,8,2,"div",2)(40,me,7,1,"div",2)(41,je,8,1,"div",2)(42,fe,7,1,"div",2)(43,xe,9,3,"div",2)(44,_e,7,1,"div",2)(45,he,13,5,"div",2)(46,De,4,0,"div",2)(47,ge,27,1),i()()()),e&2&&(l(5),d("",t.projectDetails==null?null:t.projectDetails.projectTitle," Overview"),l(2),s(t.projectDetails==null?null:t.projectDetails.description),l(8),j("href","mailto:"+(t.projectDetails==null?null:t.projectDetails.user.email),m),l(),P("",t.projectDetails==null?null:t.projectDetails.user.firstName," ",t.projectDetails==null?null:t.projectDetails.user.lastName,""),l(),d(" ",t.projectDetails!=null&&t.projectDetails.user.username?"["+(t.projectDetails==null?null:t.projectDetails.user.username)+"]":"",""),l(9),S("href","https://n2t.net/ark:/21547/R2",t.projectDetails==null?null:t.projectDetails.projectId,"",m),l(),d("https://n2t.net/ark:/21547/R2",t.projectDetails==null?null:t.projectDetails.projectId,""),l(),c(t.projectDetails!=null&&t.projectDetails.limitedAccess?-1:28),l(6),c(t.projectDetails!=null&&t.projectDetails.public?34:!(t.projectDetails!=null&&t.projectDetails.public)&&!(t.projectDetails!=null&&t.projectDetails.discoverable)?35:!(t.projectDetails!=null&&t.projectDetails.public)&&(t.projectDetails!=null&&t.projectDetails.discoverable)?36:-1),l(3),c(t.projectDetails!=null&&t.projectDetails.principalInvestigator?37:-1),l(),c(t.projectDetails!=null&&t.projectDetails.projectContact?38:-1),l(),c(t.projectDetails!=null&&t.projectDetails.publicationGuid?39:-1),l(),c(t.projectDetails!=null&&t.projectDetails.projectDataGuid?40:-1),l(),c(t.projectDetails!=null&&t.projectDetails.permitGuid?41:-1),l(),c(t.projectDetails!=null&&t.projectDetails.recommendedCitation?42:-1),l(),c(t.projectDetails!=null&&t.projectDetails.localcontextsId?43:-1),l(),c(t.projectDetails!=null&&t.projectDetails.license?44:-1),l(),c(t.projectDetails!=null&&t.projectDetails.projectConfiguration.networkApproved?45:-1),l(),c(t.displayExpedition.length==0?46:t.displayExpedition.length>0?47:-1))},dependencies:[$,Q,R,z,M,V,N,q,A,L],styles:["span.dropdown-toggle[_ngcontent-%COMP%]:after{display:none}.doi-link[_ngcontent-%COMP%]{color:var(--fg-primary);text-decoration:underline}"]})};export{ee as ProjectOverviewComponent};
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.