1266.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. exports.id = 1266;
  2. exports.ids = [1266];
  3. exports.modules = {
  4. /***/ 85970:
  5. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  6. "use strict";
  7. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  8. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  9. /* harmony export */ });
  10. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
  11. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  12. var _path;
  13. function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
  14. var SvgCaretDown = function SvgCaretDown(props) {
  15. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  16. viewBox: "0 0 24 24",
  17. width: 18,
  18. height: 18,
  19. stroke: "currentColor",
  20. strokeWidth: 1.5,
  21. strokeLinecap: "round",
  22. strokeLinejoin: "round",
  23. fill: "none",
  24. shapeRendering: "geometricPrecision",
  25. style: {
  26. color: "currentcolor"
  27. }
  28. }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  29. d: "m6 9 6 6 6-6"
  30. })));
  31. };
  32. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgCaretDown);
  33. /***/ }),
  34. /***/ 29267:
  35. /***/ ((module) => {
  36. // Exports
  37. module.exports = {
  38. "container": "Popover_container__GOha0",
  39. "trigger": "Popover_trigger__qKXNN",
  40. "content": "Popover_content__gu5L4",
  41. "tooltipContent": "Popover_tooltipContent__AMPpT"
  42. };
  43. /***/ }),
  44. /***/ 74306:
  45. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  46. "use strict";
  47. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  48. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  49. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  50. /* harmony export */ });
  51. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
  52. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
  53. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16689);
  54. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  55. /* harmony import */ var _dls_Popover__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25914);
  56. /* harmony import */ var _dls_Tooltip__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8884);
  57. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_dls_Popover__WEBPACK_IMPORTED_MODULE_2__, _dls_Tooltip__WEBPACK_IMPORTED_MODULE_3__]);
  58. ([_dls_Popover__WEBPACK_IMPORTED_MODULE_2__, _dls_Tooltip__WEBPACK_IMPORTED_MODULE_3__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  59. /**
  60. * A component that combines the functionality of a Popover and a Tooltip together.
  61. * This is needed to handle the case when we want to show a Tooltip on mobile but
  62. * since Tooltip is only hoverable and there is no hovering on mobile devices,
  63. * we provide the same functionality by using a Popover which handles clicking.
  64. *
  65. * @param {Props} props
  66. * @returns {JSX.Element}
  67. */ const HoverablePopover = ({ content , children , onOpenChange , contentSide =_dls_Popover__WEBPACK_IMPORTED_MODULE_2__/* .ContentSide.TOP */ .iw.TOP , tip =true , tooltipDelay =0 , defaultStyling =true , isOpen , triggerStyles , isContainerSpan =false })=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_dls_Popover__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .ZP, {
  68. open: isOpen,
  69. triggerStyles: triggerStyles,
  70. contentSide: contentSide,
  71. useTooltipStyles: true,
  72. ...onOpenChange && {
  73. onOpenChange
  74. },
  75. defaultStyling: defaultStyling,
  76. isContainerSpan: isContainerSpan,
  77. trigger: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_dls_Tooltip__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .ZP, {
  78. open: isOpen,
  79. tip: tip,
  80. text: content,
  81. contentSide: contentSide,
  82. delay: tooltipDelay,
  83. ...onOpenChange && {
  84. onOpenChange
  85. },
  86. children: children
  87. }),
  88. tip: tip,
  89. children: content
  90. });
  91. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HoverablePopover);
  92. __webpack_async_result__();
  93. } catch(e) { __webpack_async_result__(e); } });
  94. /***/ }),
  95. /***/ 25914:
  96. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  97. "use strict";
  98. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  99. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  100. /* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__),
  101. /* harmony export */ "iw": () => (/* binding */ ContentSide)
  102. /* harmony export */ });
  103. /* unused harmony export ContentAlign */
  104. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
  105. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
  106. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16689);
  107. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  108. /* harmony import */ var _radix_ui_react_popover__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(98680);
  109. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(59003);
  110. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
  111. /* harmony import */ var _Popover_module_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29267);
  112. /* harmony import */ var _Popover_module_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_Popover_module_scss__WEBPACK_IMPORTED_MODULE_4__);
  113. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_radix_ui_react_popover__WEBPACK_IMPORTED_MODULE_2__]);
  114. _radix_ui_react_popover__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  115. var ContentSide;
  116. (function(ContentSide) {
  117. ContentSide["TOP"] = "top";
  118. ContentSide["RIGHT"] = "right";
  119. ContentSide["BOTTOM"] = "bottom";
  120. ContentSide["LEFT"] = "left";
  121. })(ContentSide || (ContentSide = {}));
  122. var ContentAlign;
  123. (function(ContentAlign) {
  124. ContentAlign["START"] = "start";
  125. ContentAlign["CENTER"] = "center";
  126. ContentAlign["END"] = "end";
  127. })(ContentAlign || (ContentAlign = {}));
  128. const Popover = ({ children , trigger , onOpenChange , open , isModal =false , contentSide =ContentSide.BOTTOM , contentAlign =ContentAlign.CENTER , avoidCollisions =true , tip =false , useTooltipStyles =false , defaultStyling =true , isPortalled =true , contentSideOffset =2 , triggerStyles , contentStyles , isContainerSpan =false , })=>{
  129. const content = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_radix_ui_react_popover__WEBPACK_IMPORTED_MODULE_2__.Content, {
  130. sideOffset: contentSideOffset,
  131. side: contentSide,
  132. align: contentAlign,
  133. avoidCollisions: avoidCollisions,
  134. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()((_Popover_module_scss__WEBPACK_IMPORTED_MODULE_4___default().content), {
  135. [(_Popover_module_scss__WEBPACK_IMPORTED_MODULE_4___default().tooltipContent)]: useTooltipStyles,
  136. [contentStyles]: contentStyles
  137. }),
  138. children: [
  139. children,
  140. tip && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_radix_ui_react_popover__WEBPACK_IMPORTED_MODULE_2__.Arrow, {})
  141. ]
  142. });
  143. const containerChild = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_radix_ui_react_popover__WEBPACK_IMPORTED_MODULE_2__.Root, {
  144. modal: isModal,
  145. ...typeof open !== "undefined" && {
  146. open
  147. },
  148. ...onOpenChange && {
  149. onOpenChange
  150. },
  151. children: [
  152. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_radix_ui_react_popover__WEBPACK_IMPORTED_MODULE_2__.Trigger, {
  153. "aria-label": "Open popover",
  154. asChild: true,
  155. children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
  156. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()((_Popover_module_scss__WEBPACK_IMPORTED_MODULE_4___default().trigger), {
  157. [triggerStyles]: triggerStyles
  158. }),
  159. children: trigger
  160. })
  161. }),
  162. isPortalled ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_radix_ui_react_popover__WEBPACK_IMPORTED_MODULE_2__.Portal, {
  163. children: content
  164. }) : content
  165. ]
  166. });
  167. if (isContainerSpan) {
  168. return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
  169. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()({
  170. [(_Popover_module_scss__WEBPACK_IMPORTED_MODULE_4___default().container)]: defaultStyling
  171. }),
  172. children: containerChild
  173. });
  174. }
  175. return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
  176. className: classnames__WEBPACK_IMPORTED_MODULE_3___default()({
  177. [(_Popover_module_scss__WEBPACK_IMPORTED_MODULE_4___default().container)]: defaultStyling
  178. }),
  179. children: containerChild
  180. });
  181. };
  182. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Popover);
  183. __webpack_async_result__();
  184. } catch(e) { __webpack_async_result__(e); } });
  185. /***/ }),
  186. /***/ 10191:
  187. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  188. "use strict";
  189. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  190. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  191. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  192. /* harmony export */ });
  193. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
  194. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  195. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60866);
  196. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_1__);
  197. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6022);
  198. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_2__);
  199. /* harmony import */ var swr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15941);
  200. /* harmony import */ var _redux_slices_QuranReader_styles__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(62093);
  201. /* harmony import */ var _types_auth_Streak__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(10839);
  202. /* harmony import */ var _utils_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4917);
  203. /* harmony import */ var _utils_auth_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(37883);
  204. /* harmony import */ var _utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(13830);
  205. /* harmony import */ var _utils_auth_login__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(22197);
  206. /* harmony import */ var _utils_datetime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(76410);
  207. /* harmony import */ var _utils_locale__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24709);
  208. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([swr__WEBPACK_IMPORTED_MODULE_3__, _utils_auth_login__WEBPACK_IMPORTED_MODULE_9__]);
  209. ([swr__WEBPACK_IMPORTED_MODULE_3__, _utils_auth_login__WEBPACK_IMPORTED_MODULE_9__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  210. /* eslint-disable max-lines */ /* eslint-disable react-func/max-lines-per-function */
  211. const useGetWeekDays = ()=>{
  212. return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(()=>{
  213. const days = [];
  214. const today = new Date();
  215. // we want to timeline to start from Sunday
  216. const sunday = new Date(today);
  217. if (today.getDay() !== 0) {
  218. sunday.setDate(today.getDate() - today.getDay());
  219. }
  220. for(let i = 0; i < 7; i += 1){
  221. const day = new Date(sunday);
  222. day.setDate(sunday.getDate() + i);
  223. days.push({
  224. current: day.getDate() === today.getDate(),
  225. date: day,
  226. dateString: (0,_utils_datetime__WEBPACK_IMPORTED_MODULE_10__/* .dateToDateString */ .Bz)(day)
  227. });
  228. }
  229. return days;
  230. }, []);
  231. };
  232. const useGetWeekDayNames = (week, streak, showWeekdayName = false)=>{
  233. const { t , lang } = next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_1___default()("reading-goal");
  234. return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(()=>{
  235. const names = [];
  236. let showIncrement = streak > 1;
  237. let currentDayIndex = 0;
  238. if (!showWeekdayName && showIncrement) {
  239. week.forEach((day, index)=>{
  240. /**
  241. * we need to make sure that the streak is bigger than
  242. * the current day's number.
  243. *
  244. * Example:
  245. * Streak: 3
  246. * Timeline:
  247. * 1 2 3 4 (5 <- current day) 6 7
  248. *
  249. * In this case, we don't want to show the increment and start counting days from 1
  250. */ if (day.current) {
  251. showIncrement = streak > index + 1;
  252. currentDayIndex = index;
  253. }
  254. });
  255. }
  256. for(let i = 0; i < 7; i += 1){
  257. let dayName;
  258. if (showWeekdayName) {
  259. dayName = {
  260. localizedNumber: (0,_utils_locale__WEBPACK_IMPORTED_MODULE_11__/* .toLocalizedNumber */ .rQ)(i + 1, lang),
  261. title: (0,_utils_datetime__WEBPACK_IMPORTED_MODULE_10__/* .getFullDayName */ .Zu)(week[i].date, lang)
  262. };
  263. } else {
  264. /**
  265. * If we're showing the increment, we need to subtract all days from the beginning of the week till the current day, and after that increment it based on the day's index.
  266. *
  267. * Example:
  268. * Streak: 10
  269. * Timeline:
  270. * 1 (2 <- current day) 3 4 5 6 7
  271. *
  272. * We need to render "1" as Day 9, and "2" as Day 10.
  273. * "1" -> i = 0; currentDayIndex = 1; streak = 10; 10 - 1 + 0 = 9
  274. * "2" -> i = 1; currentDayIndex = 1; streak = 10; 10 - 1 + 1 = 10
  275. *
  276. */ const localizedNumber = (0,_utils_locale__WEBPACK_IMPORTED_MODULE_11__/* .toLocalizedNumber */ .rQ)(showIncrement ? streak - currentDayIndex + i : i + 1, lang);
  277. dayName = {
  278. localizedNumber,
  279. title: t("day-x", {
  280. day: localizedNumber
  281. })
  282. };
  283. }
  284. names.push(dayName);
  285. }
  286. return names;
  287. }, [
  288. lang,
  289. showWeekdayName,
  290. streak,
  291. t,
  292. week
  293. ]);
  294. };
  295. const useGetStreakWithMetadata = ({ showDayName , disableIfNoGoalExists } = {})=>{
  296. const week = useGetWeekDays();
  297. const quranFont = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.useSelector)(_redux_slices_QuranReader_styles__WEBPACK_IMPORTED_MODULE_4__/* .selectQuranFont */ .Ho, react_redux__WEBPACK_IMPORTED_MODULE_2__.shallowEqual);
  298. const mushafLines = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.useSelector)(_redux_slices_QuranReader_styles__WEBPACK_IMPORTED_MODULE_4__/* .selectQuranMushafLines */ .z$, react_redux__WEBPACK_IMPORTED_MODULE_2__.shallowEqual);
  299. const { mushaf } = (0,_utils_api__WEBPACK_IMPORTED_MODULE_6__/* .getMushafId */ .$P)(quranFont, mushafLines);
  300. const { 0: disabled , 1: setDisabled } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  301. const params = {
  302. mushafId: mushaf,
  303. from: week[0].dateString,
  304. to: week[week.length - 1].dateString,
  305. type: _types_auth_Streak__WEBPACK_IMPORTED_MODULE_5__/* .StreakType.QURAN */ .p.QURAN
  306. };
  307. // we don't pass the params to `makeStreakUrl` in the key so that we can invalidate the cache without getting the other params
  308. const { data , isValidating , error } = (0,swr__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_utils_auth_login__WEBPACK_IMPORTED_MODULE_9__/* .isLoggedIn */ .jl)() && disabled !== true ? (0,_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_8__/* .makeStreakUrl */ .G_)() : null, ()=>(0,_utils_auth_api__WEBPACK_IMPORTED_MODULE_7__/* .getStreakWithUserMetadata */ .DG)(params), {
  309. revalidateOnFocus: false
  310. });
  311. (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(()=>{
  312. if (disabled !== null || !disableIfNoGoalExists || !data) {
  313. return;
  314. }
  315. /**
  316. * We don't want to re-fetch the data if the user has no goal.
  317. * This is useful for the quran reader widget when we invalidate the cache after the user has read something.
  318. */ setDisabled(!data.data.goal);
  319. }, [
  320. disableIfNoGoalExists,
  321. disabled,
  322. data
  323. ]);
  324. const isLoading = isValidating && !data;
  325. const { activityDays , goal , streak } = data?.data || {
  326. activityDays: [],
  327. goal: undefined,
  328. streak: 0
  329. };
  330. const readingDaysMap = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(()=>{
  331. if (!activityDays) return {};
  332. const result = {};
  333. activityDays.forEach((day)=>{
  334. result[day.date] = {
  335. ...day,
  336. hasRead: day.pagesRead > 0 || day.secondsRead > 0 || day.ranges.length > 0 || day.manuallyAddedSeconds > 0
  337. };
  338. });
  339. return result;
  340. }, [
  341. activityDays
  342. ]);
  343. const currentActivityDay = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(()=>{
  344. return readingDaysMap[week.find((d)=>d.current)?.dateString];
  345. }, [
  346. readingDaysMap,
  347. week
  348. ]);
  349. const weekDayNames = useGetWeekDayNames(week, streak, showDayName);
  350. const weekData = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(()=>{
  351. return {
  352. days: week.map((day, idx)=>({
  353. ...day,
  354. info: weekDayNames[idx]
  355. })),
  356. readingDaysMap
  357. };
  358. }, [
  359. week,
  360. weekDayNames,
  361. readingDaysMap
  362. ]);
  363. return {
  364. isLoading,
  365. error,
  366. weekData,
  367. streak,
  368. goal,
  369. activityDays,
  370. currentActivityDay
  371. };
  372. };
  373. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useGetStreakWithMetadata);
  374. __webpack_async_result__();
  375. } catch(e) { __webpack_async_result__(e); } });
  376. /***/ }),
  377. /***/ 70725:
  378. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  379. "use strict";
  380. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  381. /* harmony export */ "EQ": () => (/* binding */ RangeItemPosition),
  382. /* harmony export */ "JF": () => (/* binding */ RangeItem),
  383. /* harmony export */ "Nk": () => (/* binding */ RangeItemDirection)
  384. /* harmony export */ });
  385. var RangeItemDirection;
  386. (function(RangeItemDirection) {
  387. RangeItemDirection["From"] = "from";
  388. RangeItemDirection["To"] = "to";
  389. })(RangeItemDirection || (RangeItemDirection = {}));
  390. var RangeItemPosition;
  391. (function(RangeItemPosition) {
  392. RangeItemPosition["Start"] = "start";
  393. RangeItemPosition["End"] = "end";
  394. })(RangeItemPosition || (RangeItemPosition = {}));
  395. var RangeItem;
  396. (function(RangeItem) {
  397. RangeItem["StartingChapter"] = "starting-chapter";
  398. RangeItem["StartingVerse"] = "starting-verse";
  399. RangeItem["EndingChapter"] = "ending-chapter";
  400. RangeItem["EndingVerse"] = "ending-verse";
  401. })(RangeItem || (RangeItem = {}));
  402. /***/ }),
  403. /***/ 63196:
  404. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  405. "use strict";
  406. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  407. /* harmony export */ "c9": () => (/* binding */ GoalCategory),
  408. /* harmony export */ "lC": () => (/* binding */ GoalType),
  409. /* harmony export */ "r_": () => (/* binding */ QuranGoalPeriod)
  410. /* harmony export */ });
  411. var GoalCategory;
  412. (function(GoalCategory) {
  413. GoalCategory["QURAN"] = "QURAN";
  414. })(GoalCategory || (GoalCategory = {}));
  415. var GoalType;
  416. (function(GoalType) {
  417. GoalType["TIME"] = "QURAN_TIME";
  418. GoalType["PAGES"] = "QURAN_PAGES";
  419. GoalType["RANGE"] = "QURAN_RANGE";
  420. })(GoalType || (GoalType = {}));
  421. var QuranGoalPeriod;
  422. (function(QuranGoalPeriod) {
  423. QuranGoalPeriod["Daily"] = "DAILY";
  424. QuranGoalPeriod["Continuous"] = "CONTINUOUS";
  425. })(QuranGoalPeriod || (QuranGoalPeriod = {}));
  426. /***/ }),
  427. /***/ 10839:
  428. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  429. "use strict";
  430. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  431. /* harmony export */ "p": () => (/* binding */ StreakType)
  432. /* harmony export */ });
  433. var StreakType;
  434. (function(StreakType) {
  435. StreakType["QURAN"] = "QURAN";
  436. })(StreakType || (StreakType = {}));
  437. /***/ })
  438. };
  439. ;
  440. //# sourceMappingURL=1266.js.map