1import{a as F}from"./chunk-RALG3BUB.js";import{a as I}from"./chunk-IJSNU4AM.js";import{a as L}from"./chunk-YNTODPTC.js";import{d as $}from"./chunk-QZQ6GJZI.js";import"./chunk-ZCJIZZPF.js";import"./chunk-7FXRQDA4.js";import"./chunk-IU2YFOO5.js";import"./chunk-G7FIFQSG.js";import"./chunk-CPMAEHR5.js";import"./chunk-AUXNA25H.js";import"./chunk-N4LFC3HW.js";import"./chunk-ZKYWO3KD.js";import"./chunk-CHFTZZRN.js";import"./chunk-XKHIYQSG.js";import"./chunk-KANONT34.js";import"./chunk-MSBDNGY3.js";import{a as E}from"./chunk-GTG2W6WR.js";import"./chunk-CBVIKJD5.js";import{a as A}from"./chunk-2WVVXE7W.js";import{b as k}from"./chunk-SS6EDYNT.js";import{a as N}from"./chunk-FJAWZRDK.js";import"./chunk-4O3FVBGX.js";import"./chunk-WTA5H22Q.js";import"./chunk-GUB5ONAI.js";import{a as M}from"./chunk-QHXU5YQ4.js";import"./chunk-SZOSCSSS.js";import{b as w,d as S,e as x,h as D}from"./chunk-EWOJ2KNJ.js";import{b as P,c as T}from"./chunk-LGIQ7H2A.js";import"./chunk-TNHZFGVU.js";import{Ab as s,Bb as r,Bc as v,Cc as b,Oa as a,Ob as u,U as p,Za as f,ac as g,ia as l,kc as _,sb as c,tb as d,wb as C,xb as y,yb as m,zb as o}from"./chunk-ORXSFXE4.js";import"./chunk-VB56BUGO.js";var O=()=>["/saved"],U=(t,e)=>e.id;function W(t,e){t&1&&r(0,"app-client-profile-card")}function Y(t,e){t&1&&r(0,"app-crew-profile-card")}function G(t,e){t&1&&r(0,"app-skeleton-loader",17)}function j(t,e){if(t&1&&(o(0,"div",3),r(1,"app-general-card",20),s()),t&2){let i=u();a(),m("post",i.post())("showFullContent",!0)("showComments",!0)}}function q(t,e){t&1&&r(0,"app-skeleton-loader",19),t&2&&m("count",5)}function Q(t,e){if(t&1&&(o(0,"div",21),r(1,"app-post-card",22),s()),t&2){let i=e.$implicit;a(),m("data",i)}}function z(t,e){if(t&1&&C(0,Q,2,1,"div",21,U),t&2){let i=u();y(i.news())}}var R=class t{isLoading=l(!0);isCrew=!1;isClient=!1;user;postId=0;post=l(null);news=l([]);canonical="";isAuthor=l(!1);isNewExperience=v(()=>this.post()?.type==="new_experience");isWorkAnniversary=v(()=>this.post()?.type==="work_anniversary");route=p(w);router=p(S);apiService=p(N);utilService=p(T);userService=p(k);constructor(){this.route.params.subscribe(e=>{this.postId=+e.id,this.getPostInfo()}),b(()=>{this.user=this.userService.user(),this.isCrew=this.userService.isCrew,this.isClient=this.userService.isClient})}ngOnInit(){}getPostInfo(){this.isLoading.set(!0),this.apiService.get(`posts/${this.postId}`,{},"v3").subscribe({next:e=>{this.post.set(e),this.getNews(),this.setCanonical();let i=this.getTitle();this.utilService.setTitle(i),this.isLoading.set(!1)},error:e=>{this.isLoading.set(!1),this.utilService.toast("error",null,"Post not found"),this.router.navigate(["/"])}})}getNews(){this.apiService.get("news",{paginate:!0,page:1,limit:5},"v3").subscribe({next:e=>{this.news.set(e.data)},error:e=>{}})}setCanonical(){this.canonical="/post/"+this.post()?.id+"/"+this.post()?.slug,this.utilService.setCanonicalUrl(this.canonical),this.setMetaTags()}setMetaTags(){let e=this.getTitle(),i=M.DEFAULT_SOCIAL_IMAGE;this.post()?.medias&&this.post().medias.length>0&&(i=this.post().medias[0].url),e+=" | NVOII";let n=this.isWorkAnniversary()||this.isNewExperience()?this.getTitle():this.post().content.replace(/<br>/g," ").replace(/<\/?[^>]+(>|$)/g,"").substring(0,160);this.utilService.setMeta({property:"og:title",content:e}),this.utilService.setMeta({property:"og:description",content:n}),this.utilService.setMeta({property:"og:url",content:`${P.appUrl}${this.canonical}`}),this.utilService.setMeta({property:"og:image",content:i}),this.utilService.setMeta({property:"og:type",content:"article"}),this.utilService.setMeta({property:"twitter:title",content:e}),this.utilService.setMeta({property:"twitter:description",content:n}),this.utilService.setMeta({property:"twitter:image",content:i})}calculateWorkAnniversaryYears(e){if(!e||!e.start_year||!e.start_month)return 0;let i=new Date(e.start_year,e.start_month-1,e.start_day||1),n=new Date,h=n.getFullYear()-i.getFullYear();return(n.getMonth()<i.getMonth()||n.getMonth()===i.getMonth()&&n.getDate()<i.getDate())&&h--,h}getTitle(){if(this.post()?.type==="new_experience")return`${this.post()?.user?.firstname} ${this.post()?.user?.lastname} started a new position at ${this.post()?.crew_experience?.company}`;if(this.post()?.type==="work_anniversary"){let e=this.calculateWorkAnniversaryYears(this.post()?.experience);return`${this.post()?.user?.firstname} ${this.post()?.user?.lastname} is celebrating a work anniversary - ${e} Year${e>1?"s":""}`}return this.post().content.substring(0,50).replace(/<\/?[^>]+(>|$)/g,"")+"..."}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=f({type:t,selectors:[["app-post-detail"]],decls:34,vars:6,consts:[[1,"flex","gap-6"],[1,"basis-44","lg:basis-56","xl:basis-64","2xl:basis-72","hidden","md:block"],[1,"sticky","top-20"],[1,"mb-5"],[3,"routerLink"],[1,"flex","gap-3","items-center","p-2","cursor-pointer","hover:bg-gray-100","rounded-md"],[1,"pi","pi-bookmark"],[1,"text-primary","text-xs","md:text-sm"],[1,"flex","items-center","gap-4","px-4","py-3"],[1,"basis-full","md:basis-1/2"],["href","https://apps.apple.com/us/app/nvoii/id1641102150","target","_blank","rel","noopener noreferrer",1,"flex","flex-col","justify-center","gap-4","w-full"],["src","/assets/imgs/qr_ios.svg","alt","App Store QR code"],["src","/assets/imgs/appstore-badge.svg","alt","App Store",1,"h-10","md:h-12"],["href","https://play.google.com/store/apps/details?id=com.nvoii.app","target","_blank","rel","noopener noreferrer",1,"flex","flex-col","justify-center","gap-4","w-full"],["src","/assets/imgs/qr_android.svg","alt","Google Play QR code"],["src","/assets/imgs/playstore-badge.svg","alt","Google Play",1,"h-10","md:h-12"],[1,"flex-1"],["type","post_detail"],[1,"font-bold","text-lg","mb-3"],["type","post_author",3,"count"],[3,"post","showFullContent","showComments"],[1,""],["type","news3",3,"data"]],template:function(i,n){i&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),c(4,W,1,0,"app-client-profile-card"),c(5,Y,1,0,"app-crew-profile-card"),s(),o(6,"div",3)(7,"app-card")(8,"a",4)(9,"div",5),r(10,"i",6),o(11,"span",7),g(12,"Saved Items"),s()()()()(),o(13,"div",3)(14,"app-card")(15,"div",8)(16,"div",9)(17,"a",10),r(18,"img",11)(19,"img",12),s()(),o(20,"div",9)(21,"a",13),r(22,"img",14)(23,"img",15),s()()()()()()(),o(24,"div",16),c(25,G,1,0,"app-skeleton-loader",17)(26,j,2,3,"div",3),s(),o(27,"div",1)(28,"div",3)(29,"app-card")(30,"h3",18),g(31,"BizAv News"),s(),c(32,q,1,1,"app-skeleton-loader",19)(33,z,2,0),s()()()()),i&2&&(a(4),d(n.isClient?4:-1),a(),d(n.isCrew?5:-1),a(3),m("routerLink",_
1(5,O)),a(17),d(n.isLoading()?25:26),a(7),d(n.news().length==0?32:33))},dependencies:[A,I,F,D,x,$,E,L],encapsulation:2})};export{R as PostDetailComponent};
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.