1import Ae from"./DNRLf_cX.js";import{_ as Q,o as r,c as u,a as d,J as h,t as P,I as ue,ao as de,r as g,$ as Te,f as De,ca as Ee,D as $e,j as je,ag as Pe,C as We,ay as Fe,Z as Oe,ak as ze,h as He,a5 as Re,l as Ge,c1 as Ue,b as m,m as t,aB as Ze,Y as $,M as V,N as G,p as M,y as A,w as B,n as Qe,ar as Xe,aq as Je,G as U,bt as Ke,q as Ye,d as et,bF as tt,T as ot,O as nt,R as j,e as st}from"./CJ16ZOQM.js";import{y as rt,G as at,j as it,_ as lt}from"./Bj7C3jx3.js";import{_ as ct}from"./6Uy6Dj8c.js";import{_ as ut}from"./BstYU0hN.js";import dt from"./BGapx9fF.js";import{S as ft}from"./C4ReDgix.js";import{S as pt}from"./BXQE9HJK.js";import{N as mt,a as ht}from"./BZk5e4Xr.js";import{u as _t}from"./BY5GEQbQ.js";import"./CRjGpzSD.js";import"./Dr46FGTu.js";const gt={name:"GiftIcon",props:{color:{type:String,default:"#fff"},width:{type:Number,default:22},height:{type:Number,default:22}}},vt=["width","height"],bt=["stroke"],xt=["stroke"],yt=["stroke"],kt=["stroke"],wt=["stroke"];function Ct(y,b,a,k,q,l){return r(),u("svg",{width:a.width,height:a.height,viewBox:"0 0 23 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("path",{d:"M19.0625 6.875H3.9375C3.5578 6.875 3.25 7.1828 3.25 7.5625V10.3125C3.25 10.6922 3.5578 11 3.9375 11H19.0625C19.4422 11 19.75 10.6922 19.75 10.3125V7.5625C19.75 7.1828 19.4422 6.875 19.0625 6.875Z",stroke:a.color,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,bt),d("path",{d:"M18.375 11V17.1875C18.375 17.3698 18.3026 17.5447 18.1736 17.6736C18.0447 17.8026 17.8698 17.875 17.6875 17.875H5.3125C5.13016 17.875 4.9553 17.8026 4.82636 17.6736C4.69743 17.5447 4.625 17.3698 4.625 17.1875V11",stroke:a.color,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,xt),d("path",{d:"M11.5 6.875V17.875",stroke:a.color,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,yt),d("path",{d:"M15.3891 5.90265C14.4168 6.87492 11.5 6.87492 11.5 6.87492C11.5 6.87492 11.5 3.9581 12.4723 2.98583C12.8591 2.5994 13.3836 2.38241 13.9304 2.38257C14.4772 2.38272 15.0016 2.60001 15.3883 2.98666C15.7749 3.37331 15.9922 3.89768 15.9923 4.44448C15.9925 4.99129 15.7755 5.51578 15.3891 5.90265V5.90265Z",stroke:a.color,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,kt),d("path",{d:"M7.61083 5.90265C8.5831 6.87492 11.4999 6.87492 11.4999 6.87492C11.4999 6.87492 11.4999 3.9581 10.5276 2.98583C10.1408 2.5994 9.61629 2.38241 9.06948 2.38257C8.52268 2.38272 7.99831 2.60001 7.61166 2.98666C7.22501 3.37331 7.00772 3.89768 7.00757 4.44448C7.00741 4.99129 7.2244 5.51578 7.61083 5.90265V5.90265Z",stroke:a.color,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,wt)],8,vt)}const St=Q(gt,[["render",Ct]]),Nt={name:"NotificationIcon",props:{color:{type:String,default:"#fff"},width:{type:Number,default:24},height:{type:Number,default:24},unreadCount:{type:Number,default:0}}},Mt=["width","height"],Bt=["stroke"],Lt=["stroke"],qt={key:0,cx:"18",cy:"6",r:"6",fill:"red"},It=["y"];function Vt(y,b,a,k,q,l){return r(),u("svg",{width:a.width,height:a.height,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("path",{d:"M4.82999 8.93745C4.82886 8.12208 4.98911 7.31455 5.30152 6.56141C5.61393 5.80826 6.07231 5.1244 6.65025 4.54923C7.22819 3.97407 7.91425 3.51898 8.66889 3.2102C9.42353 2.90142 10.2318 2.74506 11.0472 2.75012C14.4494 2.77541 17.1708 5.60336 17.1708 9.01512V9.62495C17.1708 12.7029 17.8147 14.4889 18.3819 15.4651C18.443 15.5694 18.4755 15.688 18.4762 15.8089C18.4768 15.9297 18.4456 16.0487 18.3856 16.1536C18.3256 16.2586 18.239 16.3458 18.1345 16.4067C18.0301 16.4675 17.9114 16.4996 17.7905 16.4999H4.20958C4.08868 16.4996 3.97001 16.4674 3.86552 16.4066C3.76104 16.3458 3.67444 16.2585 3.61447 16.1535C3.5545 16.0486 3.52327 15.9296 3.52394 15.8087C3.5246 15.6878 3.55714 15.5693 3.61827 15.465C4.18574 14.4887 4.82999 12.7027 4.82999 9.62495L4.82999 8.93745Z",stroke:a.color,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Bt),d("path",{d:"M8.25 16.5V17.1875C8.25 17.9168 8.53973 18.6163 9.05546 19.132C9.57118 19.6478 10.2707 19.9375 11 19.9375C11.7293 19.9375 12.4288 19.6478 12.9445 19.132C13.4603 18.6163 13.75 17.9168 13.75 17.1875V16.5",stroke:a.color,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Lt),a.unreadCount?(r(),u("circle",qt)):h("",!0),a.unreadCount?(r(),u("text",{key:1,x:"15",y:a.unreadCount>=10?"11":"9",fill:"white","font-size":"10","font-weight":"bold"},P(a.unreadCount>=10?"*":a.unreadCount),9,It)):h("",!0)],8,Mt)}const At=Q(Nt,[["render",Vt]]),Z={sm:640,md:768,xmd:870,lg:1024,xl
1:1280},Tt=()=>{const y=Te({width:0,height:0}),b=g("sm"),a=l=>{l===void 0&&(l=y.width);const{sm:C,md:f,lg:v,xl:p,xmd:i}=Z;return l<Number(C)?"sm":l<Number(f)||l<Number(i)?"md":l<Number(v)?"lg":(l<Number(p),"xl")},k=()=>{const{innerWidth:l,innerHeight:C}=window;y.width=l,y.height=C,b.value=a()},q=(l,C)=>{const{sm:f,md:v,lg:p,xl:i,xmd:W}=Z,L=Z[C||b.value];return l==="sm"?L>=Number(f):l==="md"?L>=Number(v):l==="xmd"?L>=Number(W):l==="lg"?L>=Number(p):l==="xl"?L>=Number(i):!1};return ue(()=>{typeof window>"u"||(window.addEventListener("resize",k),b.value=a(window.innerWidth))}),de(()=>{typeof window>"u"||window.removeEventListener("resize",k)}),{getSize:a,screenSize:y,current:b,higherThan:q}},Dt={class:"flex-1 flex items-center justify-between"},Et={class:"flex row justify-between"},$t={key:0,class:"relative flex flex-col items-center"},jt={class:"flex items-center"},Pt={key:0,class:"flex space-x-4 mr-5 items-center"},Wt={key:0,class:"font-semibold -mb-1 text-white text-xs md:text-sm"},Ft={class:"flex space-x-5 items-center text-xl"},Ot={key:1,class:"flex flex-row items-center gap-2"},zt={class:"grid grid-cols-1"},Ht={key:1,class:"row flex space-x-5"},Rt={class:"pl-4 flex space-x-3 text-xl"},Gt=De({__name:"Navbar",props:{topOffset:{default:"0px"}},setup(y){const b=y,a=nt(),{awesome:k}=Ee(),{isMobile:q}=$e();Tt();const l=je();Pe();const C=_t(),f=We(),v=Fe(),{user:p,loggedIn:i,hasActiveSubscription:W,subscribed:L}=Oe(f),T=j(()=>{var e,s,c;return(((c=(s=(e=k==null?void 0:k.layout)==null?void 0:e.page)==null?void 0:s.navbar)==null?void 0:c.menus)||[]).filter(S=>!!S)}),X=g([]),fe=()=>{const o=T.value.filter(e=>{const s=!e.requiresAuth||e.requiresAuth&&i.value,c=!e.showWhenLoggedOut||e.showWhenLoggedOut&&!i.value;return s&&c});X.value=o.map(e=>{if(e.title==="Profile"&&e.type==="dropdown"){const s={...e};return s.children=[...e.children],O.value&&s.children.splice(2,0,{type:"link",title:"Shared",to:{name:"profile-me",query:{tab:"share"}},action:()=>_()}),s}return e})},{isDark:F}=ze(),pe=g(!1),J=g(!1),O=g(!1),K=g(!0),Y=g(!1),ee=g([]),me=He(),he=j(()=>F.value?mt:ht),D=g(!1),_=()=>{D.value=!1},_e=j(()=>{var e,s;const o=((e=f.user)==null?void 0:e.settings)||{};return((s=o==null?void 0:o.access)==null?void 0:s.shared_subscription_limit)??4}),ge=()=>{K.value=!0,Y.value=!1,setTimeout(()=>{K.value=!1,setTimeout(()=>{Y.value=!0},100)},2e3+Math.floor(Math.random()*500))},ve=()=>{const o=[{type:"link",title:"Profile",to:{name:"profile-me",query:{tab:"profile"}},action:()=>_()},{type:"link",title:"Subscriptions",to:{name:"profile-me",query:{tab:"subscriptions"}},action:()=>_()},{type:"link",title:"Gifts",to:{name:"profile-me",query:{tab:"gifts"}},action:()=>_()}];J.value&&o.push({type:"link",title:"Shared",to:{name:"profile-me",query:{tab:"shared"}},action:()=>_()}),O.value&&o.push({type:"link",title:"Shared",to:{name:"profile-me",query:{tab:"share"}},action:()=>_()}),o.push({type:"link",title:"Affiliate",to:{name:"profile-me",query:{tab:"affiliate"}},action:()=>_()}),o.push({type:"link",title:"Pathways",to:{name:"profile-me",query:{tab:"learning"}},action:()=>_()}),o.push({type:"link",title:"Settings",to:{name:"profile-me",query:{tab:"settings"}},action:()=>_()}),o.push({type:"link",title:"Help",to:{name:"profile-me",query:{tab:"help"}},action:()=>_()}),i.value&&o.push({type:"link",title:"Logout",to:{name:"",query:{tab:""}},action:()=>f.logout()}),ee.value=o},z=o=>C(o)?F.value?"#fff":"#4b5563":F.value?"#9ca3af":"#4b5563",te=(o,e)=>{if(typeof o!="object"||o===null)return!1;const s=o;return"name"in s&&typeof s.name=="string"&&e.includes(s.name)},oe=g(0),H=()=>{oe.value=window.innerWidth},x=j(()=>oe.value>1185);let R=null;Re(()=>{var o,e,s,c,S,E;pe.value=!((e=(o=p==null?void 0:p.value)==null?void 0:o.subscription)!=null&&e.active),J.value=((c=(s=f.user)==null?void 0:s.subscription)==null?void 0:c.subscription_type)!=="shared"&&f.hasActiveSubscription,O.value=((E=(S=f.user)==null?void 0:S.subscription)==null?void 0:E.subscription_type)==="shared"&&f.hasActiveSubscription,ve(),fe()}),Ge(()=>{var o;return(o=p.value)==null?void 0:o.id},(o,e)=>{o&&o!==e&&(v.getNotifications(1,!1,!0),f.getSharedSubscriptions(),ge())},{immediate:!0}),ue(()=>{if(H(),window.addEventListener("resize",H),i.value){try{const{listenForMessages:o}=Ue();R=o(e=>{var s;console.log("Firebase message received (foreground):",e),(s=e==null?void 0:e.data)!=null&&s.notification_id?v.prepe
1ndNotification({id:e.data.notification_id,type:e.data.type,title:e.data.title||e.data.push_title,body:e.data.body||e.data.push_body,read_at:null,created_at:new Date().toISOString(),...e.data}):v.incrementUnreadCount()}),console.log("Firebase messaging listener setup successfully")}catch(o){console.error("Failed to setup Firebase messaging listener:",o)}"serviceWorker"in navigator&&(navigator.serviceWorker.addEventListener("message",o=>{var e,s;if(((e=o.data)==null?void 0:e.type)==="FIREBASE_PUSH_RECEIVED"){console.log("Firebase message received (from service worker):",o.data.payload);const c=o.data.payload;(s=c==null?void 0:c.data)!=null&&s.notification_id?v.prependNotification({id:c.data.notification_id,type:c.data.type,title:c.data.title||c.data.push_title,body:c.data.body||c.data.push_body,read_at:null,created_at:new Date().toISOString(),...c.data}):v.incrementUnreadCount()}}),console.log("Service worker message listener setup successfully"))}}),de(()=>{window.removeEventListener("resize",H),R&&R()});const be=o=>{if(_(),q)return U("/gift/start");me.toggleGiveGiftModal(!0)},xe=o=>{U("/search")},ye=()=>{l.push({name:"profile-me",query:{tab:"shared"}})},ke=()=>{l.push({name:"profile-me",query:{tab:"share"}})},we=o=>{l.push("/notifications")},Ce=o=>{U("/profile/me")},I=g(!1);return(o,e)=>{var se,re,ae,ie,le,ce;const s=Ae,c=st,S=lt,E=Ke,Se=Ye,ne=tt,Ne=at,Me=ct,Be=it,Le=rt,qe=ut,Ie=dt;return r(),u("header",{class:"flex fixed flex-col h-auto top-0 z-40 max-w-[2100px] w-full flex-none transition-colors duration-300 lg:z-50 dark:bg-[#1E1519]",style:Je(b.topOffset!=="0px"?{top:b.topOffset}:{})},[m(s,{icon:"https://play-lh.googleusercontent.com/btSC5ZfnakEq32QmknsBXOWq1cZ0NFsHXwo9x5vD12-Q04iA50QNKBOR7Se9zoalNg=w480-h960-rw",name:"Bayyinah BTV.",category:"Education",link:t(a).public.androidAppUrl},null,8,["link"]),d("div",{class:$(["px-6 sm:px-6 md:px-8 lg:px-10 xxl:px-24 py-6 md:py-8",{"xxl:px-4":t(i)}])},[d("div",Dt,[d("div",Et,[Ze(o.$slots,"title",{},()=>[m(c,{to:t(f).token?"/tv":"/",class:"font-bold text-lg text-primary-500"},{default:B(()=>[(r(),M(A(t(he))))]),_:1},8,["to"])],!0),!t(i)&&t(x)||t(i)&&t(x)?(r(),u("div",{key:0,class:$(["flex space-x-2 md:space-x-2 lg:space-x-8 xl:space-x-10 2xl:space-x-12 text-sm items-center",{"md:space-x-12 space-x-4":!t(i)}])},[(r(!0),u(V,null,G(t(T),(n,w)=>(r(),u(V,{key:w},[(!n.requiresAuth||t(i))&&(!n.showWhenLoggedOut||!t(i))&&(n==null?void 0:n.title)!=="Profile"&&(n==null?void 0:n.title)!=="Search"&&(n==null?void 0:n.title)!=="Notifications"&&(n==null?void 0:n.title)!=="Gifts"&&!((n==null?void 0:n.type)==="button"&&te(n==null?void 0:n.to,["auth-login","auth-register"]))?(r(),u("div",$t,[m(S,{menu:n},null,8,["menu"])])):h("",!0)],64))),128))],2)):h("",!0)]),d("div",jt,[!t(i)&&t(x)||t(i)&&t(x)?(r(),u("div",Pt,[t(W)?(r(),u("div",{key:0,class:"bg-[#65575B] rounded-xl flex-shrink-0 cursor-pointer justify-center px-3 flex items-center gap-2",onClick:e[0]||(e[0]=n=>{var w,N;return((N=(w=t(p))==null?void 0:w.subscription)==null?void 0:N.subscription_type)==="shared"?ke():ye()})},[(r(),M(A(ft),{class:"md:w-5 w-3 h-3 text-white md:h-5"})),((re=(se=t(p))==null?void 0:se.subscription)==null?void 0:re.subscription_type)!=="shared"?(r(),u("span",Wt,P(((ae=t(f).sharedSubscriptions)==null?void 0:ae.length)||0)+" / "+P(t(_e)),1)):h("",!0)])):h("",!0),d("div",Ft,[(r(),M(A(St),{color:z([{name:"profile-me",query:{tab:"gifts"}},{name:"gift"}]),height:24,width:24,class:"cursor-pointer",onClick:be},null,8,["color"])),(r(),M(A(pt),{color:z({name:"search"}),height:24,width:24,class:"cursor-pointer",onClick:xe},null,8,["color"])),t(i)?(r(),M(A(At),{key:0,color:z({name:"notifications"}),height:24,width:24,"unread-count":t(v).items.unread_count,class:"cursor-pointer",onClick:we},null,8,["color","unread-count"])):h("",!0)]),t(i)?(r(),u("div",Ot,[d("div",{class:"flex items-center",onClick:Ce},[m(E,{src:(ie=t(p))==null?void 0:ie.avatar,alt:((le=t(p))==null?void 0:le.full_name)||((ce=t(p))==null?void 0:ce.email),size:"sm",class:"cursor-pointer object-cover z-100"},null,8,["src","alt"])]),m(Le,{modelValue:t(D),"onUpdate:modelValue":e[1]||(e[1]=n=>Qe(D)?D.value=n:null)},{default:B(({open:n,close:w})=>[m(Ne,{class:"flex items-center transition-all duration-300 text-gray-900 dark:text-gray-100"},{default:B(()=>[m(Se,{tag:"h1","custom-class":"text-base truncate max-w-[150px] min-w-[100px] text-center font-bold"},{default:B(()=>{var N;return[et(P(((N=t(p))==null?void 0:N.full_name)??"User"),1)]}),_:1}),m(ne,{name:"carbon:chevron-down",class:$(["ml-1",[n?"transform rotate-180":""]])},null,8,["class"])]),_:2},1024),m(ot,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"translate-y-1 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"transition duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"translate-y-1 opacity-0"},{default:B(()=>[m(Be,{class:"absolute z-10 px-2 py-2 rounded-lg min-w-[150px] bg-light-mode dark:bg-dark-mode border border-gray-300 dark:border-gray-600"},{default:B(()=>[d("div",zt,[(r(!0),u(V,null,G(t(ee),(N,Ve)=>(r(),M(Me,{key:Ve,menu:N,"is-dropdown":"",onItemClicked:w},null,8,["menu","onItemClicked"]))),128))])]),_:2},1024)]),_:2},1024)]),_:1},8,["modelValue"])])):h("",!0)])):h("",!0),!t(i)&&t(x)?(r(),u("div",Ht,[(r(!0),u(V,null,G(t(T),(n,w)=>(r(),u(V,{key:w},[(n==null?void 0:n.type)==="button"&&te(n==null?void 0:n.to,["auth-login","auth-register"])?(r(),M(S,{key:0,menu:n},null,8,["menu"])):h("",!0)],64))),128))])):h("",!0)]),!t(i)&&!t(x)||t(i)&&!t(x)?(r(),u("div",{key:0,class:$(["flex space-x-4 items-center",{"divide-x divide-gray-500":t(T).length>0}])},[d("div",Rt,[m(qe,{class:"text-gray-400 hover:text-gray-100",onClick:e[2]||(e[2]=Xe(()=>I.value=!t(I),["prevent"]))},{default:B(()=>[m(ne,{name:"heroicons:bars-3-bottom-right-20-solid"})]),_:1})])],2)):h("",!0)]),m(Ie,{menus:t(X),"is-drawer-open":t(I)&&(!t(i)&&
1!t(x)||t(i)&&!t(x)),onToggleDrawer:e[3]||(e[3]=()=>I.value=!t(I))},null,8,["menus","is-drawer-open"])],2)],4)}}}),ro=Q(Gt,[["__scopeId","data-v-6ad54028"]]);export{ro as default};
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.