1import{f as T}from"./chunk-RZWUF2WE.js";import"./chunk-KCEJCXJZ.js";import"./chunk-D2N3WVHQ.js";import"./chunk-OP5LXOJA.js";import"./chunk-ARD6OICO.js";import"./chunk-BBHJ2D5U.js";import"./chunk-RH7YKMCI.js";import"./chunk-2P2IIG2U.js";import"./chunk-J3TYBNDU.js";import"./chunk-4QCSDQDN.js";import"./chunk-W3MH5BOT.js";import{A as N,D as p,w as I}from"./chunk-GUQT3FOM.js";import{Aa as E,Ac as e,Ba as V,Bc as o,Cc as A,Dd as f,Eb as d,Ed as S,Fd as y,La as r,Nd as L,Oa as v,Ub as M,bb as k,de as D,e as x,fa as C,fd as i,hd as h,ra as m}from"./chunk-H5RMQNTW.js";import"./chunk-EU2KAMEK.js";import"./chunk-YNC7RVHT.js";var F=["user_count","stockCount","etfCount","halalStockCount","halalEtfCount","assets_linked"],G=(()=>{class u{constructor(){this.typesenseService=m(T),this.cdr=m(D),this.destroy$=new x,this.el=m(k),this.platformId=m(v),this.userCountValue=r(650414),this.totalScreenedCountValue=r(11e4),this.halalCountValue=r(31121),this.ratingValue=r(4.8),this.assetsLinkedValue=r(199e6),this.assetsLinked=L(()=>this.formatAssets(this.assetsLinkedValue())),this.isLoading=r(!1),this.finalUserCount=650414,this.finalTotalScreened=11e4,this.finalHalalCount=31121,this.finalRatingValue=4.8,this.finalAssetsLinkedValue=199e6,this.hasFetchedData=!1,this.isVisible=!1,this.animationStarted=!1}ngOnInit(){this.fetchStats(),p(this.platformId)?this.initIntersectionObserver():(this.isVisible=!0,this.checkAndStartAnimation())}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.observer&&this.observer.disconnect()}fetchStats(){this.isLoading.set(!0),this.typesenseService.getWebsiteCollectionData(F).pipe(C(this.destroy$)).subscribe({next:t=>{let a=t.user_count?Number(t.user_count):650414,n=Number(t.stockCount)||0,w=Number(t.etfCount)||0,g=Number(t.halalStockCount)||0,c=Number(t.halalEtfCount)||0;if(this.finalUserCount=a,this.finalTotalScreened=n+w||11e4,this.finalHalalCount=g+c||31121,t.assets_linked){let l=t.assets_linked.replace(/[$,+]/g,"").trim(),s=parseFloat(l);l.toUpperCase().endsWith("B")?s=s*1e9:l.toUpperCase().endsWith("M")?s=s*1e6:l.toUpperCase().endsWith("K")&&(s=s*1e3),isNaN(s)||(this.finalAssetsLinkedValue=s)}this.hasFetchedData=!0,this.checkAndStartAnimation(),this.isLoading.set(!1)},error:t=>{console.error("Error fetching Musaffa stats:",t),this.hasFetchedData=!0,this.checkAndStartAnimation(),this.isLoading.set(!1)}})}formatAssets(t){return t>=1e9?Math.floor(t/1e9)+"B+":t>=1e6?Math.floor(t/1e6)+"M+":t>=1e3?Math.floor(t/1e3)+"K+":t.toString()}initIntersectionObserver(){if(!p(this.platformId)){this.isVisible=!0,this.checkAndStartAnimation();return}this.observer=new IntersectionObserver(t=>{t.forEach(a=>{a.isIntersecting&&(this.isVisible=!0,this.checkAndStartAnimation(),this.observer&&this.observer.unobserve(this.el.nativeElement))})},{threshold:.1}),this.observer.observe(this.el.nativeElement)}checkAndStartAnimation(){this.hasFetchedData&&this.isVisible&&!this.animationStarted&&(this.animationStarted=!0,p(this.platformId)?(this.animateSignal(this.userCountValue,0,this.finalUserCount),this.animateSignal(this.totalScreenedCountValue,0,this.finalTotalScreened),this.animateSignal(this.halalCountValue,0,this.finalHalalCount),this.animateSignal(this.ratingValue,0,this.finalRatingValue),this.animateSignal(this.assetsLinkedValue,0,this.finalAssetsLinkedValue)):(this.userCountValue.set(this.finalUserCount),this.totalScreenedCountValue.set(this.finalTotalScreened),this.halalCountValue.set(this.finalHalalCount),this.ratingValue.set(this.finalRatingValue),this.assetsLinkedValue.set(this.finalAssetsLinkedValue)))}animateSignal(t,a,n,w=1500){let g=performance.now(),c=l=>{let s=Math.min((l-g)/w,1),B=s*(2-s),b=a+(n-a)*B;Number.isInteger(n)?t.set(Math.floor(b)):t.set(Math.round(b*10)/10),s<1&&requestAnimationFrame(c)};requestAnimationFrame(c)}static{this.\u0275fac=function(a){return new(a||u)}}static{this.\u0275cmp=M({type:u,selectors:[["app-musaffa-stats-board"]],decls:36,vars:11,consts:[[1,"tw-bg-white","tw-backdrop-blur-3xl","tw-py-10","tw-border-b","tw-border-solid","tw-border-b-gray-200","tw-border-x-0","tw-border-t-0"],[1,"tw-content-wrapper"],[1,"tw-gri
1d","tw-grid-cols-2","xl:tw-grid-cols-4","tw-gap-6","lg:tw-gap-4","xl:tw-gap-8"],[1,"tw-text-center","tw-flex","tw-flex-col","tw-items-center"],[1,"tw-text-gray-900","tw-text-4xl/tight","2xl:tw-text-5xl/snug","tw-font-medium","tw-m-0","tw-tabular-nums"],[1,"tw-text-gray-800","tw-text-sm","tw-mt-2","2xl:tw-mt-0","tw-text-pretty","tw-mb-0"],[1,"tw-ms-1","tw-text-gray-600"],[1,"tw-text-gray-900","tw-text-4xl/tight","2xl:tw-text-5xl/snug","tw-font-medium","tw-m-0","tw-inline-flex","tw-items-center","tw-justify-center","tw-gap-0.5","tw-tabular-nums"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"tw-h-5","tw-w-5","sm:tw-h-6","sm:tw-w-6","md:tw-h-7","md:tw-w-7","tw-text-[#c7a56b]","tw-fill-[#c7a56b]","tw-shrink-0"],["d","M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"],[1,"tw-text-gray-800","tw-text-sm","tw-mt-2","2xl:tw-mt-0","tw-text-pretty","tw-max-w-72","tw-mb-0"]],template:function(a,n){a&1&&(e(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h4",4),i(5),f(6,"number"),o(),e(7,"p",5),i(8," Users across 200+ countries"),e(9,"sup",6),i(10,"1"),o()()(),e(11,"div",3)(12,"h4",7),i(13),f(14,"number"),E(),e(15,"svg",8),A(16,"path",9),o()(),V(),e(17,"p",5),i(18," 8,700+ reviews \xB7 Apple App Store and Google Play"),e(19,"sup",6),i(20,"2"),o()()(),e(21,"div",3)(22,"h4",4),i(23),f(24,"number"),o(),e(25,"p",5),i(26," Halal stocks & ETFs"),e(27,"sup",6),i(28,"3"),o()()(),e(29,"div",3)(30,"h4",4),i(31),o(),e(32,"p",10),i(33," Assets linked on Musaffa"),e(34,"sup",6),i(35,"4"),o()()()()()()),a&2&&(d(5),h(" ",S(6,4,n.userCountValue())," "),d(8),h(" ",y(14,6,n.ratingValue(),"1.1-1")," "),d(10),h(" ",S(24,9,n.halalCountValue())," "),d(8),h(" ",n.assetsLinked()," "))},dependencies:[N,I],encapsulation:2})}}return u})();export{G as MusaffaStatsBoardComponent};
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.