@bikdotai/bik-component-library 0.0.725-beta.8 → 0.0.725

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  6. package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
  7. package/dist/cjs/index.d.ts +0 -2
  8. package/dist/cjs/index.js +1 -1
  9. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  10. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  11. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  12. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  13. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  14. package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
  15. package/dist/esm/index.d.ts +0 -2
  16. package/dist/esm/index.js +1 -1
  17. package/package.json +1 -2
  18. package/dist/cjs/assets/icons/searchIconWhatsNew.svg.js +0 -1
  19. package/dist/cjs/assets/icons/whatsNew.svg.js +0 -1
  20. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.d.ts +0 -4
  21. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +0 -1
  22. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.d.ts +0 -4
  23. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +0 -1
  24. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.d.ts +0 -4
  25. package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +0 -1
  26. package/dist/cjs/components/feature-announcements/VideoModal.d.ts +0 -3
  27. package/dist/cjs/components/feature-announcements/VideoModal.js +0 -1
  28. package/dist/cjs/components/feature-announcements/constants/animations.d.ts +0 -27
  29. package/dist/cjs/components/feature-announcements/constants/animations.js +0 -1
  30. package/dist/cjs/components/feature-announcements/constants/dimensions.d.ts +0 -56
  31. package/dist/cjs/components/feature-announcements/constants/dimensions.js +0 -1
  32. package/dist/cjs/components/feature-announcements/constants/index.d.ts +0 -19
  33. package/dist/cjs/components/feature-announcements/constants/index.js +0 -1
  34. package/dist/cjs/components/feature-announcements/constants/localStorageKeys.d.ts +0 -18
  35. package/dist/cjs/components/feature-announcements/constants/localStorageKeys.js +0 -1
  36. package/dist/cjs/components/feature-announcements/constants/selectors.d.ts +0 -21
  37. package/dist/cjs/components/feature-announcements/constants/selectors.js +0 -1
  38. package/dist/cjs/components/feature-announcements/constants/zIndex.d.ts +0 -10
  39. package/dist/cjs/components/feature-announcements/constants/zIndex.js +0 -1
  40. package/dist/cjs/components/feature-announcements/hooks/index.d.ts +0 -1
  41. package/dist/cjs/components/feature-announcements/hooks/useFeatureAnnouncements.d.ts +0 -13
  42. package/dist/cjs/components/feature-announcements/hooks/useFeatureAnnouncements.js +0 -1
  43. package/dist/cjs/components/feature-announcements/index.d.ts +0 -7
  44. package/dist/cjs/components/feature-announcements/styles/index.d.ts +0 -4
  45. package/dist/cjs/components/feature-announcements/styles/joyride.styles.d.ts +0 -125
  46. package/dist/cjs/components/feature-announcements/styles/majorPopup.styles.d.ts +0 -23
  47. package/dist/cjs/components/feature-announcements/styles/majorPopup.styles.js +0 -1
  48. package/dist/cjs/components/feature-announcements/styles/minorPopup.styles.d.ts +0 -16
  49. package/dist/cjs/components/feature-announcements/styles/minorPopup.styles.js +0 -1
  50. package/dist/cjs/components/feature-announcements/styles/videoModal.styles.d.ts +0 -13
  51. package/dist/cjs/components/feature-announcements/styles/videoModal.styles.js +0 -1
  52. package/dist/cjs/components/feature-announcements/types/feature.types.d.ts +0 -41
  53. package/dist/cjs/components/feature-announcements/types/index.d.ts +0 -4
  54. package/dist/cjs/components/feature-announcements/types/props.types.d.ts +0 -43
  55. package/dist/cjs/components/feature-announcements/types/repository.types.d.ts +0 -11
  56. package/dist/cjs/components/feature-announcements/types/router.types.d.ts +0 -7
  57. package/dist/cjs/components/feature-announcements/useFeatureAnnouncements.d.ts +0 -13
  58. package/dist/cjs/components/feature-announcements/utils/animationHelpers.d.ts +0 -18
  59. package/dist/cjs/components/feature-announcements/utils/animationHelpers.js +0 -1
  60. package/dist/cjs/components/feature-announcements/utils/elementHelpers.d.ts +0 -30
  61. package/dist/cjs/components/feature-announcements/utils/elementHelpers.js +0 -1
  62. package/dist/cjs/components/feature-announcements/utils/htmlHelpers.d.ts +0 -18
  63. package/dist/cjs/components/feature-announcements/utils/htmlHelpers.js +0 -1
  64. package/dist/cjs/components/feature-announcements/utils/index.d.ts +0 -3
  65. package/dist/cjs/components/whats-new/WhatsNew.d.ts +0 -23
  66. package/dist/cjs/components/whats-new/WhatsNew.js +0 -1
  67. package/dist/cjs/components/whats-new/WhatsNew.styles.d.ts +0 -11
  68. package/dist/cjs/components/whats-new/WhatsNew.styles.js +0 -185
  69. package/dist/cjs/components/whats-new/WhatsNew.types.d.ts +0 -58
  70. package/dist/cjs/components/whats-new/WhatsNewButton.d.ts +0 -3
  71. package/dist/cjs/components/whats-new/WhatsNewButton.js +0 -1
  72. package/dist/cjs/components/whats-new/WhatsNewPanel.d.ts +0 -3
  73. package/dist/cjs/components/whats-new/WhatsNewPanel.js +0 -1
  74. package/dist/cjs/components/whats-new/WhatsNewProvider.d.ts +0 -4
  75. package/dist/cjs/components/whats-new/WhatsNewProvider.js +0 -1
  76. package/dist/cjs/components/whats-new/index.d.ts +0 -7
  77. package/dist/cjs/components/whats-new/useWhatsNew.d.ts +0 -9
  78. package/dist/cjs/components/whats-new/useWhatsNew.js +0 -1
  79. package/dist/esm/assets/icons/searchIconWhatsNew.svg.js +0 -1
  80. package/dist/esm/assets/icons/whatsNew.svg.js +0 -1
  81. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.d.ts +0 -4
  82. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +0 -1
  83. package/dist/esm/components/feature-announcements/MajorUpdatePopup.d.ts +0 -4
  84. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +0 -1
  85. package/dist/esm/components/feature-announcements/MinorUpdatePopup.d.ts +0 -4
  86. package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +0 -1
  87. package/dist/esm/components/feature-announcements/VideoModal.d.ts +0 -3
  88. package/dist/esm/components/feature-announcements/VideoModal.js +0 -1
  89. package/dist/esm/components/feature-announcements/constants/animations.d.ts +0 -27
  90. package/dist/esm/components/feature-announcements/constants/animations.js +0 -1
  91. package/dist/esm/components/feature-announcements/constants/dimensions.d.ts +0 -56
  92. package/dist/esm/components/feature-announcements/constants/dimensions.js +0 -1
  93. package/dist/esm/components/feature-announcements/constants/index.d.ts +0 -19
  94. package/dist/esm/components/feature-announcements/constants/index.js +0 -1
  95. package/dist/esm/components/feature-announcements/constants/localStorageKeys.d.ts +0 -18
  96. package/dist/esm/components/feature-announcements/constants/localStorageKeys.js +0 -1
  97. package/dist/esm/components/feature-announcements/constants/selectors.d.ts +0 -21
  98. package/dist/esm/components/feature-announcements/constants/selectors.js +0 -1
  99. package/dist/esm/components/feature-announcements/constants/zIndex.d.ts +0 -10
  100. package/dist/esm/components/feature-announcements/constants/zIndex.js +0 -1
  101. package/dist/esm/components/feature-announcements/hooks/index.d.ts +0 -1
  102. package/dist/esm/components/feature-announcements/hooks/useFeatureAnnouncements.d.ts +0 -13
  103. package/dist/esm/components/feature-announcements/hooks/useFeatureAnnouncements.js +0 -1
  104. package/dist/esm/components/feature-announcements/index.d.ts +0 -7
  105. package/dist/esm/components/feature-announcements/styles/index.d.ts +0 -4
  106. package/dist/esm/components/feature-announcements/styles/joyride.styles.d.ts +0 -125
  107. package/dist/esm/components/feature-announcements/styles/majorPopup.styles.d.ts +0 -23
  108. package/dist/esm/components/feature-announcements/styles/majorPopup.styles.js +0 -1
  109. package/dist/esm/components/feature-announcements/styles/minorPopup.styles.d.ts +0 -16
  110. package/dist/esm/components/feature-announcements/styles/minorPopup.styles.js +0 -1
  111. package/dist/esm/components/feature-announcements/styles/videoModal.styles.d.ts +0 -13
  112. package/dist/esm/components/feature-announcements/styles/videoModal.styles.js +0 -1
  113. package/dist/esm/components/feature-announcements/types/feature.types.d.ts +0 -41
  114. package/dist/esm/components/feature-announcements/types/index.d.ts +0 -4
  115. package/dist/esm/components/feature-announcements/types/props.types.d.ts +0 -43
  116. package/dist/esm/components/feature-announcements/types/repository.types.d.ts +0 -11
  117. package/dist/esm/components/feature-announcements/types/router.types.d.ts +0 -7
  118. package/dist/esm/components/feature-announcements/useFeatureAnnouncements.d.ts +0 -13
  119. package/dist/esm/components/feature-announcements/utils/animationHelpers.d.ts +0 -18
  120. package/dist/esm/components/feature-announcements/utils/animationHelpers.js +0 -1
  121. package/dist/esm/components/feature-announcements/utils/elementHelpers.d.ts +0 -30
  122. package/dist/esm/components/feature-announcements/utils/elementHelpers.js +0 -1
  123. package/dist/esm/components/feature-announcements/utils/htmlHelpers.d.ts +0 -18
  124. package/dist/esm/components/feature-announcements/utils/htmlHelpers.js +0 -1
  125. package/dist/esm/components/feature-announcements/utils/index.d.ts +0 -3
  126. package/dist/esm/components/whats-new/WhatsNew.d.ts +0 -23
  127. package/dist/esm/components/whats-new/WhatsNew.js +0 -1
  128. package/dist/esm/components/whats-new/WhatsNew.styles.d.ts +0 -11
  129. package/dist/esm/components/whats-new/WhatsNew.styles.js +0 -185
  130. package/dist/esm/components/whats-new/WhatsNew.types.d.ts +0 -58
  131. package/dist/esm/components/whats-new/WhatsNewButton.d.ts +0 -3
  132. package/dist/esm/components/whats-new/WhatsNewButton.js +0 -1
  133. package/dist/esm/components/whats-new/WhatsNewPanel.d.ts +0 -3
  134. package/dist/esm/components/whats-new/WhatsNewPanel.js +0 -1
  135. package/dist/esm/components/whats-new/WhatsNewProvider.d.ts +0 -4
  136. package/dist/esm/components/whats-new/WhatsNewProvider.js +0 -1
  137. package/dist/esm/components/whats-new/index.d.ts +0 -7
  138. package/dist/esm/components/whats-new/useWhatsNew.d.ts +0 -9
  139. package/dist/esm/components/whats-new/useWhatsNew.js +0 -1
@@ -1,58 +0,0 @@
1
- /// <reference types="react" />
2
- export interface WhatsNewContent {
3
- id: string;
4
- title: string;
5
- body: string;
6
- content: string;
7
- image: string;
8
- buttonText: string;
9
- redirectUrl: string;
10
- productVideo?: string;
11
- docId?: string;
12
- createdAt: any;
13
- module: string[];
14
- visibility: boolean;
15
- }
16
- export interface WhatsNewProviderProps {
17
- children: React.ReactNode;
18
- fetchWhatsNewContent: () => Promise<[Error | null, WhatsNewContent[] | null]>;
19
- markContentAsViewed?: (contentId: string) => Promise<void>;
20
- module?: string;
21
- isLoading?: boolean;
22
- }
23
- export interface WhatsNewButtonProps {
24
- onClick?: () => void;
25
- newContentCount?: number;
26
- isOpen?: boolean;
27
- isLoading?: boolean;
28
- tooltip?: string;
29
- testId?: string;
30
- iconWidth?: number;
31
- iconHeight?: number;
32
- customIcon?: React.ComponentType<{
33
- width?: number;
34
- height?: number;
35
- color?: string;
36
- }>;
37
- }
38
- export interface WhatsNewPanelProps {
39
- isOpen: boolean;
40
- onClose: () => void;
41
- content: WhatsNewContent[];
42
- isLoading?: boolean;
43
- title?: string;
44
- searchPlaceholder?: string;
45
- emptyStateTitle?: string;
46
- emptyStateDescription?: string;
47
- noResultsText?: string;
48
- width?: string;
49
- onContentClick?: (content: WhatsNewContent) => void;
50
- renderCustomContent?: (content: WhatsNewContent) => React.ReactNode;
51
- }
52
- export interface WhatsNewHookReturn {
53
- whatsNewContent: WhatsNewContent[];
54
- isLoading: boolean;
55
- newContentCount: number;
56
- markAsViewed: (contentId: string) => Promise<void>;
57
- refreshContent: () => Promise<void>;
58
- }
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { WhatsNewButtonProps } from './WhatsNew.types';
3
- export declare const WhatsNewButton: React.FC<WhatsNewButtonProps>;
@@ -1 +0,0 @@
1
- import{j as t}from"../../node_modules/react/jsx-runtime.js";import s from"../../assets/icons/whatsNew.svg.js";import{COLORS as n}from"../../constants/Theme.js";import{Tooltip as i}from"../tooltips/Tooltip.js";import{WhatsNewIconContainer as e}from"./WhatsNew.styles.js";const o=o=>{let{onClick:r,newContentCount:a=0,isOpen:c=!1,isLoading:d=!1,tooltip:l="What's new",testId:m="whats-new-button",iconWidth:h=32,iconHeight:j=32,customIcon:p}=o;return d?t.jsxs("div",Object.assign({style:{margin:"0px 8px"}},{children:[t.jsx("div",{style:{width:16,height:16,border:"2px solid #f3f3f3",borderTop:"2px solid #731DCF",borderRadius:"50%",animation:"spin 1s linear infinite"}}),t.jsx("style",{children:"\n\t\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t\t\t}\n\t\t\t\t\t"})]})):t.jsx(e,Object.assign({count:a},{children:t.jsxs("div",Object.assign({className:"main-icon-class "+(c?"icon-active":""),style:{color:c?n.content.brand:n.content.primary},onClick:r,"data-testid":m},{children:[t.jsx(i,Object.assign({body:l},{children:t.jsx("div",{children:p?t.jsx(p,{width:h,height:j,color:c?n.content.brand:n.content.primary}):t.jsx(s,{width:h,height:j})})})),a>0&&t.jsx("div",Object.assign({className:"notification--count"},{children:t.jsx("div",Object.assign({className:"count--text"},{children:a}))}))]}))}))};export{o as WhatsNewButton};
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { WhatsNewPanelProps } from './WhatsNew.types';
3
- export declare const WhatsNewPanel: React.FC<WhatsNewPanelProps>;
@@ -1 +0,0 @@
1
- import{j as e}from"../../node_modules/react/jsx-runtime.js";import{format as t,differenceInBusinessDays as s}from"date-fns";import{useState as n,useMemo as r}from"react";import a from"../../assets/icons/searchIconWhatsNew.svg.js";import o from"../../assets/icons/whatsNew.svg.js";import{COLORS as i}from"../../constants/Theme.js";import{Button as c}from"../button/Button.js";import{VideoModal as d}from"../feature-announcements/VideoModal.js";import{SearchBar as l}from"../searchBar/searchBar.js";import{SideModal as h}from"../side-modal/SideModal.js";import{TitleMedium as m,TitleRegular as j,BodyPrimary as x,Caption as g,TitleSmall as u}from"../TypographyStyle.js";import{MainContainer as p,WhatsNewWrapper as w,MainCardContainer as b,BackgroundImageContainer as f}from"./WhatsNew.styles.js";const y=y=>{let{isOpen:C,onClose:N,content:O,isLoading:v=!1,title:k="What's new on BIK",searchPlaceholder:A="Search posts",emptyStateTitle:D="Nothing new!",emptyStateDescription:S="There are no new updates or features at the moment. Check back soon!",noResultsText:T="Sorry, no results found.",width:L="480px",onContentClick:M,renderCustomContent:W}=y;const[B,F]=n(""),[U,V]=n(!1),[_,E]=n(""),I=e=>{if(!e.createdAt)return!1;const t=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return s(new Date,t)<7},P=r((()=>{if(!B.trim())return O;const e=B.toLowerCase();return O.filter((t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||t.content&&t.content.toLowerCase().includes(e)))}),[O,B]),R=0===O.length,z=0===P.length;return C?e.jsxs(h,Object.assign({width:L,onClose:N,header:"",headerCustomComponent:e.jsx(m,Object.assign({color:i.background.inverse},{children:k})),headerStyle:{background:i.background.brandLight},hideFooter:!0},{children:[e.jsxs(p,{children:[e.jsx("div",Object.assign({className:"mt-8"},{children:e.jsx(l,{width:"100%",isEnabled:!R,onChange:e=>{F(e)},onEnter:e=>{F(e)},placeholder:A,variant:"default",searchValue:B,onClickCross:()=>{F("")}})})),e.jsx(w,{children:R||z?e.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsx("div",Object.assign({className:"icon--wrapper"},{children:R?e.jsx(o,{width:32,height:32}):e.jsx(a,{width:32,height:32})})),R?e.jsxs(e.Fragment,{children:[e.jsx(j,{children:D}),e.jsx(x,Object.assign({color:i.content.secondary,className:"text--align",style:{maxWidth:300}},{children:S}))]}):z?e.jsx(x,Object.assign({color:i.content.secondary,className:"text--align",style:{maxWidth:300}},{children:T})):null]})):e.jsx("div",Object.assign({className:"scroller"},{children:P.map(((s,n)=>W?W(s):e.jsxs(b,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsx(f,{imageUrl:s.image,height:"209px",width:"100%",style:{borderRadius:"4px"}}),e.jsx("div",Object.assign({className:"mt-20 full--width"},{children:e.jsxs("div",Object.assign({className:"created--at flex flex--row"},{children:[I(s)?e.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsx(g,{children:"New"})})):e.jsx(e.Fragment,{}),e.jsx(g,Object.assign({style:{color:i.content.placeholder}},{children:s.createdAt?t(s.createdAt.toDate?s.createdAt.toDate():new Date(s.createdAt),"dd MMMM yyyy"):""}))]}))})),e.jsx("div",Object.assign({className:"mt--8"},{children:e.jsx(u,{children:s.title})})),e.jsx("div",{dangerouslySetInnerHTML:{__html:s.body},className:"card--desc mt--12"}),e.jsx("div",Object.assign({className:"flex flex--row mt-20 full--width"},{children:e.jsx(c,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{e.productVideo?(E(e.productVideo),V(!0)):e.redirectUrl&&window.open(e.redirectUrl,"_blank"),M&&M(e)})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${n}`)))}))})]}),e.jsx(d,{isOpen:U,videoUrl:_,onClose:()=>{V(!1)}})]})):e.jsx(e.Fragment,{})};export{y as WhatsNewPanel};
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { WhatsNewProviderProps } from './WhatsNew.types';
3
- export declare const WhatsNewProvider: React.FC<WhatsNewProviderProps>;
4
- export declare const useWhatsNewContext: () => import("./WhatsNew.types").WhatsNewHookReturn;
@@ -1 +0,0 @@
1
- import{j as e}from"../../node_modules/react/jsx-runtime.js";import{useContext as t,createContext as r}from"react";import{useWhatsNew as o}from"./useWhatsNew.js";const n=r(null),s=t=>{let{children:r,fetchWhatsNewContent:s,markContentAsViewed:i,module:a}=t;const m=o({fetchWhatsNewContent:s,markContentAsViewed:i,module:a});return e.jsx(n.Provider,Object.assign({value:m},{children:r}))},i=()=>{const e=t(n);if(!e)throw new Error("useWhatsNewContext must be used within a WhatsNewProvider");return e};export{s as WhatsNewProvider,i as useWhatsNewContext};
@@ -1,7 +0,0 @@
1
- export * from './WhatsNew.types';
2
- export * from './WhatsNew.styles';
3
- export * from './WhatsNewButton';
4
- export * from './WhatsNewPanel';
5
- export * from './WhatsNewProvider';
6
- export * from './WhatsNew';
7
- export * from './useWhatsNew';
@@ -1,9 +0,0 @@
1
- import { WhatsNewContent, WhatsNewHookReturn } from './WhatsNew.types';
2
- interface UseWhatsNewProps {
3
- fetchWhatsNewContent: () => Promise<[Error | null, WhatsNewContent[] | null]>;
4
- markContentAsViewed?: (contentId: string) => Promise<void>;
5
- module?: string;
6
- newContentThresholdDays?: number;
7
- }
8
- export declare const useWhatsNew: ({ fetchWhatsNewContent, markContentAsViewed, module, newContentThresholdDays, }: UseWhatsNewProps) => WhatsNewHookReturn;
9
- export {};
@@ -1 +0,0 @@
1
- import{__awaiter as e}from"../../_virtual/_tslib.js";import{differenceInBusinessDays as t}from"date-fns";import{useState as o,useRef as r,useEffect as n,useCallback as a}from"react";const i=i=>{let{fetchWhatsNewContent:c,markContentAsViewed:d,module:s,newContentThresholdDays:l=7}=i;const[u,f]=o([]),[w,v]=o(!0),m=r(c),A=r(d);n((()=>{m.current=c}),[c]),n((()=>{A.current=d}),[d]);const h=a((()=>e(void 0,void 0,void 0,(function*(){v(!0);try{const[e,t]=yield m.current();if(e)console.error("Failed to fetch what's new content:",e),f([]);else if(t){let e=t;s&&(e=t.filter((e=>Array.isArray(e.module)?e.module.includes(s):e.module===s))),e.sort(((e,t)=>{var o,r;const n=(null===(o=e.createdAt)||void 0===o?void 0:o.toDate)?e.createdAt.toDate():new Date(e.createdAt);return((null===(r=t.createdAt)||void 0===r?void 0:r.toDate)?t.createdAt.toDate():new Date(t.createdAt)).getTime()-n.getTime()})),f(e)}else f([])}catch(e){console.error("Failed to fetch what's new content:",e),f([])}finally{v(!1)}}))),[s]);n((()=>{h()}),[h]);const D=a((e=>{if(!e.createdAt)return!1;const o=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return t(new Date,o)<l}),[l]),y=u.reduce(((e,t)=>D(t)?e+1:e),0);return{whatsNewContent:u,isLoading:w,newContentCount:y,markAsViewed:a((t=>e(void 0,void 0,void 0,(function*(){if(A.current)try{yield A.current(t)}catch(e){console.warn("Failed to mark content as viewed:",e)}}))),[]),refreshContent:a((()=>e(void 0,void 0,void 0,(function*(){yield h()}))),[h])}};export{i as useWhatsNew};