calendar.js 70 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445
  1. (() => {
  2. var exports = {};
  3. exports.id = 54844;
  4. exports.ids = [54844,64820];
  5. exports.modules = {
  6. /***/ 14356:
  7. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  8. "use strict";
  9. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  10. __webpack_require__.r(__webpack_exports__);
  11. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  12. /* harmony export */ "default": () => (/* binding */ pageWrapperTemplate),
  13. /* harmony export */ "getServerSideProps": () => (/* binding */ getServerSideProps),
  14. /* harmony export */ "getStaticProps": () => (/* binding */ getStaticProps)
  15. /* harmony export */ });
  16. /* harmony import */ var _sentry_server_config_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96270);
  17. /* harmony import */ var _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58097);
  18. /* harmony import */ var _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__);
  19. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20997);
  20. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
  21. /* harmony import */ var _umalqura_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89942);
  22. /* harmony import */ var _umalqura_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_umalqura_core__WEBPACK_IMPORTED_MODULE_3__);
  23. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(60866);
  24. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_4__);
  25. /* harmony import */ var react_virtuoso__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(78404);
  26. /* harmony import */ var react_virtuoso__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_virtuoso__WEBPACK_IMPORTED_MODULE_5__);
  27. /* harmony import */ var _calendar_module_scss__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(52982);
  28. /* harmony import */ var _calendar_module_scss__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_calendar_module_scss__WEBPACK_IMPORTED_MODULE_15__);
  29. /* harmony import */ var _components_NextSeoWrapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(25869);
  30. /* harmony import */ var _components_PageContainer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9234);
  31. /* harmony import */ var _components_QuranicCalendar_JoinQuranicCalendarButton__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(41357);
  32. /* harmony import */ var _components_QuranicCalendar_QuranicCalendarHero__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(31122);
  33. /* harmony import */ var _components_QuranicCalendar_QuranicCalendarMonth__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(17843);
  34. /* harmony import */ var _utils_hijri_date__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(12690);
  35. /* harmony import */ var _utils_locale__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(24709);
  36. /* harmony import */ var _utils_navigation__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(57933);
  37. /* harmony import */ var quranic_calendar_json__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(55269);
  38. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_QuranicCalendar_JoinQuranicCalendarButton__WEBPACK_IMPORTED_MODULE_8__, _components_QuranicCalendar_QuranicCalendarMonth__WEBPACK_IMPORTED_MODULE_10__, _utils_navigation__WEBPACK_IMPORTED_MODULE_13__]);
  39. ([_components_QuranicCalendar_JoinQuranicCalendarButton__WEBPACK_IMPORTED_MODULE_8__, _components_QuranicCalendar_QuranicCalendarMonth__WEBPACK_IMPORTED_MODULE_10__, _utils_navigation__WEBPACK_IMPORTED_MODULE_13__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  40. const MONTHS_WEEKS = Object.values(quranic_calendar_json__WEBPACK_IMPORTED_MODULE_14__);
  41. const PATH = (0,_utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .getQuranicCalendarNavigationUrl */ .ly)();
  42. const QuranicCalendarPage = ()=>{
  43. const { t , lang } = next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_4___default()("quranic-calendar");
  44. const currentHijriDate = _umalqura_core__WEBPACK_IMPORTED_MODULE_3___default()();
  45. /**
  46. * Get the index of the current month in the MONTHS_WEEKS array
  47. * by comparing the current month and year with the month and year of each month in the array.
  48. *
  49. * @returns {number} The index of the current month in the MONTHS_WEEKS array
  50. */ const getInitialTopMostItemIndex = ()=>{
  51. for(let index = 0; index < MONTHS_WEEKS.length; index += 1){
  52. const monthWeeks = MONTHS_WEEKS[index];
  53. const calendarMonth = _umalqura_core__WEBPACK_IMPORTED_MODULE_3___default()(Number(monthWeeks[0].hijriYear), Number(monthWeeks[0].hijriMonth), 1);
  54. const isCurrentMonthAndYear = calendarMonth.hm === currentHijriDate.hm && currentHijriDate.hy === calendarMonth.hy;
  55. if (isCurrentMonthAndYear) {
  56. return index;
  57. }
  58. }
  59. return 0;
  60. };
  61. const currentQuranicCalendarWeek = (0,_utils_hijri_date__WEBPACK_IMPORTED_MODULE_11__/* .getCurrentQuranicCalendarWeek */ .a)(currentHijriDate);
  62. return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
  63. children: [
  64. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_components_NextSeoWrapper__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
  65. title: t("quranic-calendar"),
  66. url: (0,_utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .getCanonicalUrl */ .Z2)(lang, PATH),
  67. languageAlternates: (0,_utils_locale__WEBPACK_IMPORTED_MODULE_12__/* .getLanguageAlternates */ .qc)(PATH)
  68. }),
  69. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_components_QuranicCalendar_QuranicCalendarHero__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z, {}),
  70. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(_components_PageContainer__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
  71. children: [
  72. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_components_QuranicCalendar_JoinQuranicCalendarButton__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {
  73. currentQuranicCalendarWeek: currentQuranicCalendarWeek,
  74. currentHijriDate: currentHijriDate
  75. }),
  76. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
  77. className: (_calendar_module_scss__WEBPACK_IMPORTED_MODULE_15___default().container),
  78. children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(react_virtuoso__WEBPACK_IMPORTED_MODULE_5__.Virtuoso, {
  79. data: MONTHS_WEEKS,
  80. initialItemCount: 1,
  81. initialTopMostItemIndex: getInitialTopMostItemIndex(),
  82. totalCount: MONTHS_WEEKS.length,
  83. itemContent: (index, monthWeeks)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_components_QuranicCalendar_QuranicCalendarMonth__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Z, {
  84. currentQuranicCalendarWeek: currentQuranicCalendarWeek,
  85. monthWeeks: monthWeeks
  86. }, index)
  87. })
  88. })
  89. ]
  90. })
  91. ]
  92. });
  93. };
  94. var serverComponentModule = /*#__PURE__*/Object.freeze({
  95. __proto__: null,
  96. 'default': QuranicCalendarPage
  97. });
  98. /*
  99. * This file is a template for the code which will be substituted when our webpack loader handles non-API files in the
  100. * `pages/` directory.
  101. *
  102. * We use `__SENTRY_WRAPPING_TARGET_FILE__.cjs` as a placeholder for the path to the file being wrapped. Because it's not a real package,
  103. * this causes both TS and ESLint to complain, hence the pragma comments below.
  104. */
  105. const userPageModule = serverComponentModule ;
  106. const pageComponent = userPageModule ? userPageModule.default : undefined;
  107. const origGetInitialProps = pageComponent ? pageComponent.getInitialProps : undefined;
  108. const origGetStaticProps = userPageModule ? userPageModule.getStaticProps : undefined;
  109. const origGetServerSideProps = userPageModule ? userPageModule.getServerSideProps : undefined;
  110. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  111. const getInitialPropsWrappers = {
  112. '/_app': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapAppGetInitialPropsWithSentry,
  113. '/_document': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapDocumentGetInitialPropsWithSentry,
  114. '/_error': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapErrorGetInitialPropsWithSentry,
  115. };
  116. const getInitialPropsWrapper = getInitialPropsWrappers['/calendar'] || _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetInitialPropsWithSentry;
  117. if (pageComponent && typeof origGetInitialProps === 'function') {
  118. pageComponent.getInitialProps = getInitialPropsWrapper(origGetInitialProps) ;
  119. }
  120. const getStaticProps =
  121. typeof origGetStaticProps === 'function'
  122. ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetStaticPropsWithSentry(origGetStaticProps, '/calendar')
  123. : undefined;
  124. const getServerSideProps =
  125. typeof origGetServerSideProps === 'function'
  126. ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetServerSidePropsWithSentry(origGetServerSideProps, '/calendar')
  127. : undefined;
  128. const pageWrapperTemplate = pageComponent ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapPageComponentWithSentry(pageComponent ) : pageComponent;
  129. __webpack_async_result__();
  130. } catch(e) { __webpack_async_result__(e); } });
  131. /***/ }),
  132. /***/ 19022:
  133. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  134. "use strict";
  135. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  136. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  137. /* harmony export */ });
  138. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16689);
  139. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  140. var _path;
  141. 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); }
  142. var SvgNotificationBell = function SvgNotificationBell(props) {
  143. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  144. xmlns: "http://www.w3.org/2000/svg",
  145. viewBox: "0 0 24 24",
  146. fill: "currentColor"
  147. }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  148. fillRule: "evenodd",
  149. d: "M5.25 9a6.75 6.75 0 0 1 13.5 0v.75c0 2.123.8 4.057 2.118 5.52a.75.75 0 0 1-.297 1.206c-1.544.57-3.16.99-4.831 1.243a3.75 3.75 0 1 1-7.48 0 24.585 24.585 0 0 1-4.831-1.244.75.75 0 0 1-.298-1.205A8.217 8.217 0 0 0 5.25 9.75V9zm4.502 8.9a2.25 2.25 0 1 0 4.496 0 25.057 25.057 0 0 1-4.496 0z",
  150. clipRule: "evenodd"
  151. })));
  152. };
  153. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNotificationBell);
  154. /***/ }),
  155. /***/ 93020:
  156. /***/ ((module) => {
  157. // Exports
  158. module.exports = {
  159. "container": "PageContainer_container__1TUET",
  160. "fullWidth": "PageContainer_fullWidth__RU5GM"
  161. };
  162. /***/ }),
  163. /***/ 99468:
  164. /***/ ((module) => {
  165. // Exports
  166. module.exports = {
  167. "hashtag": "ReflectionText_hashtag__uFX_O",
  168. "body": "ReflectionText_body__0Igdy"
  169. };
  170. /***/ }),
  171. /***/ 18320:
  172. /***/ ((module) => {
  173. // Exports
  174. module.exports = {
  175. "text": "JoinQuranicCalendarButton_text__LVgQ6",
  176. "cta": "JoinQuranicCalendarButton_cta__A1sPD",
  177. "highlight": "JoinQuranicCalendarButton_highlight__TunkA",
  178. "normal": "JoinQuranicCalendarButton_normal__aSk2p",
  179. "bordered": "JoinQuranicCalendarButton_bordered__fH_X5",
  180. "subTextContainer": "JoinQuranicCalendarButton_subTextContainer__vMx_r"
  181. };
  182. /***/ }),
  183. /***/ 42443:
  184. /***/ ((module) => {
  185. // Exports
  186. module.exports = {
  187. "monthHeader": "QuranicCalendarMonth_monthHeader__yK_65",
  188. "container": "QuranicCalendarMonth_container__Nxg83"
  189. };
  190. /***/ }),
  191. /***/ 6498:
  192. /***/ ((module) => {
  193. // Exports
  194. module.exports = {
  195. "weekContainer": "QuranicCalendarWeek_weekContainer__x1skz",
  196. "currentWeek": "QuranicCalendarWeek_currentWeek__cJvlZ",
  197. "collapsibleTitle": "QuranicCalendarWeek_collapsibleTitle__sEy8B",
  198. "collapsibleBody": "QuranicCalendarWeek_collapsibleBody__VGUAZ",
  199. "link": "QuranicCalendarWeek_link__58BsZ"
  200. };
  201. /***/ }),
  202. /***/ 52982:
  203. /***/ ((module) => {
  204. // Exports
  205. module.exports = {
  206. "container": "calendar_container__HzLHf"
  207. };
  208. /***/ }),
  209. /***/ 9234:
  210. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  211. "use strict";
  212. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  213. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  214. /* harmony export */ });
  215. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
  216. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
  217. /* harmony import */ var _PageContainer_module_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(93020);
  218. /* harmony import */ var _PageContainer_module_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_PageContainer_module_scss__WEBPACK_IMPORTED_MODULE_1__);
  219. const PageContainer = ({ children })=>{
  220. return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
  221. className: (_PageContainer_module_scss__WEBPACK_IMPORTED_MODULE_1___default().container),
  222. children: children
  223. });
  224. };
  225. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PageContainer);
  226. /***/ }),
  227. /***/ 76057:
  228. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  229. "use strict";
  230. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  231. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  232. /* harmony export */ });
  233. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
  234. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
  235. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16689);
  236. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  237. /* harmony import */ var _hooks_useReflectionBodyParser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3204);
  238. /* harmony import */ var _ReflectionText_module_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99468);
  239. /* harmony import */ var _ReflectionText_module_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_ReflectionText_module_scss__WEBPACK_IMPORTED_MODULE_3__);
  240. const ReflectionText = ({ reflectionText })=>{
  241. const formattedText = (0,_hooks_useReflectionBodyParser__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)(reflectionText, (_ReflectionText_module_scss__WEBPACK_IMPORTED_MODULE_3___default().hashtag));
  242. return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
  243. className: (_ReflectionText_module_scss__WEBPACK_IMPORTED_MODULE_3___default().body),
  244. // eslint-disable-next-line react/no-danger
  245. dangerouslySetInnerHTML: {
  246. __html: formattedText
  247. }
  248. });
  249. };
  250. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ReflectionText);
  251. /***/ }),
  252. /***/ 3204:
  253. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  254. "use strict";
  255. // EXPORTS
  256. __webpack_require__.d(__webpack_exports__, {
  257. "Z": () => (/* binding */ hooks_useReflectionBodyParser)
  258. });
  259. // EXTERNAL MODULE: external "react"
  260. var external_react_ = __webpack_require__(16689);
  261. // EXTERNAL MODULE: ./src/utils/quranReflect/navigation.ts
  262. var navigation = __webpack_require__(70713);
  263. ;// CONCATENATED MODULE: ./src/utils/quranReflect/bodyParser.ts
  264. /* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable import/prefer-default-export */
  265. /**
  266. * Wraps hashtags in links: It finds all hashtags starting with # followed
  267. * by one or more word characters (\w+). The captured hashtag is then
  268. * used to create a link.
  269. *
  270. * @param {string} tag
  271. * @param {string} hashtagStyle
  272. * @returns {string}
  273. */ const tagToLink = (tag, hashtagStyle)=>{
  274. const tagWithHashTag = `#${tag}`;
  275. return `<a target="_blank" href="${(0,navigation/* getQuranReflectTagUrl */.dx)(tagWithHashTag)}" class="${hashtagStyle}">${tagWithHashTag}</a>`;
  276. };
  277. /**
  278. * Replaces URLs in a given text with HTML anchor tags.
  279. *
  280. * @param {string} text - The input text containing URLs.
  281. * @returns {string} The text with URLs replaced by anchor tags.
  282. */ const replaceUrlsWithLinks = (text)=>{
  283. const regex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/gi;
  284. return text.replace(regex, (url)=>{
  285. // Check if URL is already linked
  286. const surroundingLength = 100; // Number of characters around the URL to check for <a> tag
  287. const index = text.indexOf(url);
  288. const beforeText = text.slice(Math.max(0, index - surroundingLength), index);
  289. const afterText = text.slice(index + url.length, index + url.length + surroundingLength);
  290. if (beforeText.includes("<a href=") && afterText.includes("</a>")) {
  291. // URL is already inside an anchor tag, return as is
  292. return url;
  293. }
  294. // Convert URL to a link
  295. return `<a href='${url}' target='_blank'>${url}</a>`;
  296. });
  297. };
  298. const parseReflectionBody = (reflectionBody, hashtagStyle)=>{
  299. return(// 1. Wraps URLs in links: Find all URLs starting with http or https. The captured URL is then used to create a link.
  300. replaceUrlsWithLinks(reflectionBody)// 2. Replaces new lines: match all occurrences of new lines (\n) and carriage returns (\r) and replaces them with the <br> tag.
  301. .replace(/\r?\n/g, "<br>")// 3. Wraps hashtags in links: Find all hashtags starting with # followed by one or more word characters (\w+). The captured hashtag is then used to create a link.
  302. .replace(/#(\w+)/g, (_, tag)=>tagToLink(tag, hashtagStyle)));
  303. };
  304. ;// CONCATENATED MODULE: ./src/components/QuranReflect/hooks/useReflectionBodyParser.ts
  305. /**
  306. * A hook to parse the reflection body and replace the hashtags with links.
  307. *
  308. * TODO: make all usages of this hook DRY.
  309. *
  310. * @param {string} reflectionText
  311. * @param {string} hashtagStyle
  312. * @returns {string}
  313. */ const useReflectionBodyParser = (reflectionText, hashtagStyle)=>{
  314. const parsedBody = (0,external_react_.useMemo)(()=>parseReflectionBody(reflectionText, hashtagStyle), [
  315. hashtagStyle,
  316. reflectionText
  317. ]);
  318. return parsedBody;
  319. };
  320. /* harmony default export */ const hooks_useReflectionBodyParser = (useReflectionBodyParser);
  321. /***/ }),
  322. /***/ 41357:
  323. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  324. "use strict";
  325. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  326. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  327. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  328. /* harmony export */ });
  329. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
  330. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
  331. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16689);
  332. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  333. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59003);
  334. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  335. /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71853);
  336. /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_3__);
  337. /* harmony import */ var next_translate_Trans__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74137);
  338. /* harmony import */ var next_translate_Trans__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_translate_Trans__WEBPACK_IMPORTED_MODULE_4__);
  339. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(60866);
  340. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_5__);
  341. /* harmony import */ var _JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(18320);
  342. /* harmony import */ var _JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14__);
  343. /* harmony import */ var _dls_Button_Button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(50497);
  344. /* harmony import */ var _dls_Toast_Toast__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(79717);
  345. /* harmony import */ var _icons_notification_bell_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(19022);
  346. /* harmony import */ var _utils_auth_login__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(22197);
  347. /* harmony import */ var _utils_auth_qf_api__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(91450);
  348. /* harmony import */ var _utils_eventLogger__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(55943);
  349. /* harmony import */ var _utils_locale__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(24709);
  350. /* harmony import */ var _utils_navigation__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(57933);
  351. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_dls_Button_Button__WEBPACK_IMPORTED_MODULE_6__, _dls_Toast_Toast__WEBPACK_IMPORTED_MODULE_7__, _utils_auth_login__WEBPACK_IMPORTED_MODULE_9__, _utils_eventLogger__WEBPACK_IMPORTED_MODULE_11__, _utils_navigation__WEBPACK_IMPORTED_MODULE_13__]);
  352. ([_dls_Button_Button__WEBPACK_IMPORTED_MODULE_6__, _dls_Toast_Toast__WEBPACK_IMPORTED_MODULE_7__, _utils_auth_login__WEBPACK_IMPORTED_MODULE_9__, _utils_eventLogger__WEBPACK_IMPORTED_MODULE_11__, _utils_navigation__WEBPACK_IMPORTED_MODULE_13__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  353. const QC_USERNAME = "calendar";
  354. const JoinQuranicCalendarButton = ({ currentQuranicCalendarWeek , currentHijriDate , })=>{
  355. const { t , lang } = next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_5___default()("quranic-calendar");
  356. const toast = (0,_dls_Toast_Toast__WEBPACK_IMPORTED_MODULE_7__/* .useToast */ .pm)();
  357. const { 0: isLoading , 1: setIsLoading } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  358. const { 0: hasJoined , 1: setHasJoined } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  359. const { 0: hasError , 1: setHasError } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  360. (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
  361. if ((0,_utils_auth_login__WEBPACK_IMPORTED_MODULE_9__/* .isLoggedIn */ .jl)()) {
  362. setIsLoading(true);
  363. (0,_utils_auth_qf_api__WEBPACK_IMPORTED_MODULE_10__/* .isUserFollowed */ .ST)(QC_USERNAME).then((response)=>{
  364. setHasJoined(response.followed);
  365. }).catch(()=>{
  366. setHasError(true);
  367. }).finally(()=>{
  368. setIsLoading(false);
  369. });
  370. }
  371. }, []);
  372. const router = (0,next_router__WEBPACK_IMPORTED_MODULE_3__.useRouter)();
  373. const onClick = ()=>{
  374. (0,_utils_eventLogger__WEBPACK_IMPORTED_MODULE_11__/* .logButtonClick */ .MY)("join_quranic_calendar");
  375. if ((0,_utils_auth_login__WEBPACK_IMPORTED_MODULE_9__/* .isLoggedIn */ .jl)()) {
  376. setIsLoading(true);
  377. (0,_utils_auth_qf_api__WEBPACK_IMPORTED_MODULE_10__/* .followUser */ .P_)(QC_USERNAME).then(()=>{
  378. toast(t("join-quranic-calendar-success"), {
  379. status: _dls_Toast_Toast__WEBPACK_IMPORTED_MODULE_7__/* .ToastStatus.Success */ .YZ.Success
  380. });
  381. setHasJoined(true);
  382. }).catch(()=>{
  383. toast(t("common:error.general"), {
  384. status: _dls_Toast_Toast__WEBPACK_IMPORTED_MODULE_7__/* .ToastStatus.Error */ .YZ.Error
  385. });
  386. }).finally(()=>{
  387. setIsLoading(false);
  388. });
  389. } else {
  390. router.replace((0,_utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .getLoginNavigationUrl */ .gk)((0,_utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .getQuranicCalendarNavigationUrl */ .ly)()));
  391. }
  392. };
  393. return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
  394. className: (_JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14___default().text),
  395. children: [
  396. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
  397. className: (_JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14___default().bordered),
  398. children: [
  399. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_translate_Trans__WEBPACK_IMPORTED_MODULE_4___default()), {
  400. i18nKey: "quranic-calendar:today",
  401. components: {
  402. br: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("br", {}, 0),
  403. highlight: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
  404. className: (_JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14___default().highlight)
  405. }, 1)
  406. },
  407. values: {
  408. day: (0,_utils_locale__WEBPACK_IMPORTED_MODULE_12__/* .toLocalizedNumber */ .rQ)(currentHijriDate.hd, lang),
  409. month: t(`islamic-months.${currentHijriDate.hm}`),
  410. year: (0,_utils_locale__WEBPACK_IMPORTED_MODULE_12__/* .toLocalizedNumber */ .rQ)(currentHijriDate.hy, lang, false, {
  411. useGrouping: false
  412. }),
  413. gregorianDate: (0,_utils_locale__WEBPACK_IMPORTED_MODULE_12__/* .toLocalizedDate */ .K8)(currentHijriDate.date, lang, {
  414. dateStyle: "long"
  415. })
  416. }
  417. }),
  418. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("br", {}),
  419. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_translate_Trans__WEBPACK_IMPORTED_MODULE_4___default()), {
  420. i18nKey: "quranic-calendar:join-qc.line-1",
  421. components: {
  422. br: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("br", {}, 0),
  423. highlight: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
  424. className: (_JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14___default().highlight)
  425. }, 1)
  426. },
  427. values: {
  428. weekNumber: (0,_utils_locale__WEBPACK_IMPORTED_MODULE_12__/* .toLocalizedNumber */ .rQ)(currentQuranicCalendarWeek, lang)
  429. }
  430. }),
  431. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("br", {})
  432. ]
  433. }),
  434. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
  435. className: (_JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14___default().subTextContainer),
  436. children: [
  437. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_translate_Trans__WEBPACK_IMPORTED_MODULE_4___default()), {
  438. i18nKey: "quranic-calendar:join-qc.line-2",
  439. components: {
  440. br: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("br", {}, 0),
  441. normal: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
  442. className: (_JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14___default().normal)
  443. }, 1),
  444. highlight: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
  445. className: (_JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14___default().highlight)
  446. }, 1)
  447. },
  448. values: {
  449. weekNumber: (0,_utils_locale__WEBPACK_IMPORTED_MODULE_12__/* .toLocalizedNumber */ .rQ)(currentQuranicCalendarWeek, lang)
  450. }
  451. }),
  452. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
  453. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()((_JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14___default().cta), (_JoinQuranicCalendarButton_module_scss__WEBPACK_IMPORTED_MODULE_14___default().text)),
  454. children: hasJoined ? "" : t("join-quranic-calendar")
  455. }),
  456. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_dls_Button_Button__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .ZP, {
  457. isLoading: isLoading,
  458. isDisabled: hasJoined || hasError,
  459. onClick: onClick,
  460. type: _dls_Button_Button__WEBPACK_IMPORTED_MODULE_6__/* .ButtonType.Success */ .L$.Success,
  461. shape: _dls_Button_Button__WEBPACK_IMPORTED_MODULE_6__/* .ButtonShape.Pill */ .jL.Pill,
  462. size: _dls_Button_Button__WEBPACK_IMPORTED_MODULE_6__/* .ButtonSize.Small */ .qE.Small,
  463. prefix: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_icons_notification_bell_svg__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {}),
  464. children: hasJoined ? t("common:subscribed") : t("common:subscribe")
  465. })
  466. ]
  467. })
  468. ]
  469. });
  470. };
  471. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JoinQuranicCalendarButton);
  472. __webpack_async_result__();
  473. } catch(e) { __webpack_async_result__(e); } });
  474. /***/ }),
  475. /***/ 31122:
  476. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  477. "use strict";
  478. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  479. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  480. /* harmony export */ });
  481. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
  482. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
  483. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16689);
  484. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  485. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60866);
  486. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_2__);
  487. /* harmony import */ var _components_RamadanActivity_RamadanActivityHero_Hero_module_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51470);
  488. /* harmony import */ var _components_RamadanActivity_RamadanActivityHero_Hero_module_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_components_RamadanActivity_RamadanActivityHero_Hero_module_scss__WEBPACK_IMPORTED_MODULE_3__);
  489. /* eslint-disable i18next/no-literal-string */
  490. const QuranicCalendarHero = ()=>{
  491. const { t } = next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_2___default()("quranic-calendar");
  492. return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
  493. className: (_components_RamadanActivity_RamadanActivityHero_Hero_module_scss__WEBPACK_IMPORTED_MODULE_3___default().container),
  494. dir: "ltr",
  495. children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
  496. className: (_components_RamadanActivity_RamadanActivityHero_Hero_module_scss__WEBPACK_IMPORTED_MODULE_3___default().rowContainer),
  497. children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
  498. className: (_components_RamadanActivity_RamadanActivityHero_Hero_module_scss__WEBPACK_IMPORTED_MODULE_3___default().row),
  499. children: [
  500. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
  501. className: (_components_RamadanActivity_RamadanActivityHero_Hero_module_scss__WEBPACK_IMPORTED_MODULE_3___default().header),
  502. children: t("quranic-calendar")
  503. }),
  504. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
  505. className: (_components_RamadanActivity_RamadanActivityHero_Hero_module_scss__WEBPACK_IMPORTED_MODULE_3___default().desc),
  506. children: t("hero.line-1")
  507. })
  508. ]
  509. })
  510. })
  511. });
  512. };
  513. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuranicCalendarHero);
  514. /***/ }),
  515. /***/ 17843:
  516. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  517. "use strict";
  518. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  519. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  520. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  521. /* harmony export */ });
  522. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
  523. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
  524. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16689);
  525. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  526. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60866);
  527. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_2__);
  528. /* harmony import */ var _QuranicCalendarMonth_module_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(42443);
  529. /* harmony import */ var _QuranicCalendarMonth_module_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_QuranicCalendarMonth_module_scss__WEBPACK_IMPORTED_MODULE_4__);
  530. /* harmony import */ var src_components_QuranicCalendar_QuranicCalendarWeek__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1367);
  531. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_components_QuranicCalendar_QuranicCalendarWeek__WEBPACK_IMPORTED_MODULE_3__]);
  532. src_components_QuranicCalendar_QuranicCalendarWeek__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  533. const QuranicCalendarMonth = ({ monthWeeks , currentQuranicCalendarWeek })=>{
  534. const { t } = next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_2___default()("quranic-calendar");
  535. const localizedMonth = `${t(`islamic-months.${monthWeeks[0].hijriMonth}`)}`;
  536. return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
  537. className: (_QuranicCalendarMonth_module_scss__WEBPACK_IMPORTED_MODULE_4___default().container),
  538. children: [
  539. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
  540. className: (_QuranicCalendarMonth_module_scss__WEBPACK_IMPORTED_MODULE_4___default().monthHeader),
  541. children: localizedMonth
  542. }),
  543. monthWeeks.map((week)=>{
  544. const { ranges , weekNumber } = week;
  545. return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(src_components_QuranicCalendar_QuranicCalendarWeek__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
  546. isCurrentWeek: currentQuranicCalendarWeek === Number(weekNumber),
  547. weekNumber: Number(weekNumber),
  548. localizedMonth: localizedMonth,
  549. ranges: ranges
  550. }, ranges);
  551. })
  552. ]
  553. });
  554. };
  555. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuranicCalendarMonth);
  556. __webpack_async_result__();
  557. } catch(e) { __webpack_async_result__(e); } });
  558. /***/ }),
  559. /***/ 1367:
  560. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  561. "use strict";
  562. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  563. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  564. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  565. /* harmony export */ });
  566. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20997);
  567. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
  568. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16689);
  569. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  570. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59003);
  571. /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
  572. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(60866);
  573. /* harmony import */ var next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_3__);
  574. /* harmony import */ var swr_immutable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79847);
  575. /* harmony import */ var _QuranicCalendarWeek_module_scss__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(6498);
  576. /* harmony import */ var _QuranicCalendarWeek_module_scss__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_QuranicCalendarWeek_module_scss__WEBPACK_IMPORTED_MODULE_15__);
  577. /* harmony import */ var _components_QuranReflect_ReflectionText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(76057);
  578. /* harmony import */ var _dls_Collapsible_Collapsible__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(92775);
  579. /* harmony import */ var _dls_Link_Link__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(61239);
  580. /* harmony import */ var _icons_chevron_down_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(24868);
  581. /* harmony import */ var _utils_auth_qf_api__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(91450);
  582. /* harmony import */ var _utils_auth_qf_apiPaths__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65899);
  583. /* harmony import */ var _utils_eventLogger__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(55943);
  584. /* harmony import */ var _utils_locale__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(24709);
  585. /* harmony import */ var _utils_navigation__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(57933);
  586. /* harmony import */ var _utils_quranReflect_navigation__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(70713);
  587. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([swr_immutable__WEBPACK_IMPORTED_MODULE_4__, _dls_Collapsible_Collapsible__WEBPACK_IMPORTED_MODULE_6__, _utils_eventLogger__WEBPACK_IMPORTED_MODULE_11__, _utils_navigation__WEBPACK_IMPORTED_MODULE_13__]);
  588. ([swr_immutable__WEBPACK_IMPORTED_MODULE_4__, _dls_Collapsible_Collapsible__WEBPACK_IMPORTED_MODULE_6__, _utils_eventLogger__WEBPACK_IMPORTED_MODULE_11__, _utils_navigation__WEBPACK_IMPORTED_MODULE_13__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  589. /* eslint-disable max-lines */
  590. const QuranicCalendarWeek = ({ weekNumber , localizedMonth , isCurrentWeek , ranges , })=>{
  591. const { t , lang } = next_translate_useTranslation__WEBPACK_IMPORTED_MODULE_3___default()("quranic-calendar");
  592. const onRangesClicked = (settings)=>{
  593. (0,_utils_eventLogger__WEBPACK_IMPORTED_MODULE_11__/* .logButtonClick */ .MY)("quranic_calendar_week", {
  594. ranges,
  595. weekNumber,
  596. settings
  597. });
  598. };
  599. const onInteractClicked = ()=>{
  600. (0,_utils_eventLogger__WEBPACK_IMPORTED_MODULE_11__/* .logButtonClick */ .MY)("quranic_calendar_interact", {
  601. ranges,
  602. weekNumber
  603. });
  604. };
  605. const { data , isValidating , error } = (0,swr_immutable__WEBPACK_IMPORTED_MODULE_4__["default"])((0,_utils_auth_qf_apiPaths__WEBPACK_IMPORTED_MODULE_10__/* .makeQuranicCalendarPostOfWeekUrl */ .Sv)(weekNumber), async ()=>{
  606. const response = await (0,_utils_auth_qf_api__WEBPACK_IMPORTED_MODULE_9__/* .getQuranicCalendarPostOfWeek */ .Fp)(weekNumber);
  607. return response;
  608. });
  609. const hasPost = !isValidating && !error && !!data?.post?.body;
  610. return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
  611. className: classnames__WEBPACK_IMPORTED_MODULE_2___default()((_QuranicCalendarWeek_module_scss__WEBPACK_IMPORTED_MODULE_15___default().weekContainer), {
  612. [(_QuranicCalendarWeek_module_scss__WEBPACK_IMPORTED_MODULE_15___default().currentWeek)]: isCurrentWeek
  613. }),
  614. children: [
  615. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
  616. children: t("week-title", {
  617. weekNumber: (0,_utils_locale__WEBPACK_IMPORTED_MODULE_12__/* .toLocalizedNumber */ .rQ)(weekNumber, lang),
  618. month: localizedMonth,
  619. rangeStart: (0,_utils_locale__WEBPACK_IMPORTED_MODULE_12__/* .toLocalizedVerseKey */ .Tj)(ranges.split("-")[0], lang),
  620. rangeEnd: (0,_utils_locale__WEBPACK_IMPORTED_MODULE_12__/* .toLocalizedVerseKey */ .Tj)(ranges.split("-")[1], lang)
  621. })
  622. }),
  623. /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
  624. children: [
  625. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_dls_Link_Link__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
  626. className: (_QuranicCalendarWeek_module_scss__WEBPACK_IMPORTED_MODULE_15___default().link),
  627. isNewTab: true,
  628. onClick: ()=>{
  629. onRangesClicked(_utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .QuranicCalendarRangesNavigationSettings.EnglishAndArabic */ .uv.EnglishAndArabic);
  630. },
  631. variant: _dls_Link_Link__WEBPACK_IMPORTED_MODULE_7__/* .LinkVariant.Blend */ .r.Blend,
  632. href: (0,_utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .getQuranicCalendarRangesNavigationUrl */ .nT)(ranges, _utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .QuranicCalendarRangesNavigationSettings.EnglishAndArabic */ .uv.EnglishAndArabic),
  633. children: t("reading-options.en-and-ar")
  634. }),
  635. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_dls_Link_Link__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
  636. isNewTab: true,
  637. className: (_QuranicCalendarWeek_module_scss__WEBPACK_IMPORTED_MODULE_15___default().link),
  638. onClick: ()=>{
  639. onRangesClicked(_utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .QuranicCalendarRangesNavigationSettings.EnglishOnly */ .uv.EnglishOnly);
  640. },
  641. variant: _dls_Link_Link__WEBPACK_IMPORTED_MODULE_7__/* .LinkVariant.Blend */ .r.Blend,
  642. href: (0,_utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .getQuranicCalendarRangesNavigationUrl */ .nT)(ranges, _utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .QuranicCalendarRangesNavigationSettings.EnglishOnly */ .uv.EnglishOnly),
  643. children: t("reading-options.en-only")
  644. }),
  645. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_dls_Link_Link__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
  646. isNewTab: true,
  647. className: (_QuranicCalendarWeek_module_scss__WEBPACK_IMPORTED_MODULE_15___default().link),
  648. onClick: ()=>{
  649. onRangesClicked(_utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .QuranicCalendarRangesNavigationSettings.DefaultSettings */ .uv.DefaultSettings);
  650. },
  651. variant: _dls_Link_Link__WEBPACK_IMPORTED_MODULE_7__/* .LinkVariant.Blend */ .r.Blend,
  652. href: (0,_utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .getQuranicCalendarRangesNavigationUrl */ .nT)(ranges, _utils_navigation__WEBPACK_IMPORTED_MODULE_13__/* .QuranicCalendarRangesNavigationSettings.DefaultSettings */ .uv.DefaultSettings),
  653. children: t("reading-options.default-settings")
  654. })
  655. ]
  656. }),
  657. !!hasPost && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_dls_Collapsible_Collapsible__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z, {
  658. direction: _dls_Collapsible_Collapsible__WEBPACK_IMPORTED_MODULE_6__/* .CollapsibleDirection.Right */ .a.Right,
  659. title: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
  660. className: (_QuranicCalendarWeek_module_scss__WEBPACK_IMPORTED_MODULE_15___default().collapsibleTitle),
  661. children: t("supplemental-resources")
  662. }),
  663. prefix: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_icons_chevron_down_svg__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .Z, {}),
  664. shouldRotatePrefixOnToggle: true,
  665. shouldOpen: isCurrentWeek,
  666. children: ({ isOpen: isCollapsibleOpen })=>{
  667. if (!isCollapsibleOpen) return null;
  668. return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  669. children: [
  670. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
  671. className: (_QuranicCalendarWeek_module_scss__WEBPACK_IMPORTED_MODULE_15___default().collapsibleBody),
  672. children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_QuranReflect_ReflectionText__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
  673. reflectionText: data?.post?.body
  674. })
  675. }),
  676. /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_dls_Link_Link__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, {
  677. isNewTab: true,
  678. onClick: onInteractClicked,
  679. variant: _dls_Link_Link__WEBPACK_IMPORTED_MODULE_7__/* .LinkVariant.Blend */ .r.Blend,
  680. href: (0,_utils_quranReflect_navigation__WEBPACK_IMPORTED_MODULE_14__/* .getQuranReflectPostUrl */ .rW)(data.post.id),
  681. children: t("interact-with-post")
  682. })
  683. ]
  684. });
  685. }
  686. })
  687. ]
  688. });
  689. };
  690. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QuranicCalendarWeek);
  691. __webpack_async_result__();
  692. } catch(e) { __webpack_async_result__(e); } });
  693. /***/ }),
  694. /***/ 91450:
  695. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  696. "use strict";
  697. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  698. /* harmony export */ "Fp": () => (/* binding */ getQuranicCalendarPostOfWeek),
  699. /* harmony export */ "GG": () => (/* binding */ postReflectionViews),
  700. /* harmony export */ "P_": () => (/* binding */ followUser),
  701. /* harmony export */ "ST": () => (/* binding */ isUserFollowed)
  702. /* harmony export */ });
  703. /* unused harmony export getAllUserReflections */
  704. /* harmony import */ var _apiPaths__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(65899);
  705. /* harmony import */ var _utils_auth_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37883);
  706. const postReflectionViews = async (postId)=>(0,_utils_auth_api__WEBPACK_IMPORTED_MODULE_1__/* .postRequest */ .j0)((0,_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makePostReflectionViewsUrl */ .PI)(postId), {});
  707. const followUser = async (usernameOrId)=>(0,_utils_auth_api__WEBPACK_IMPORTED_MODULE_1__/* .postRequest */ .j0)((0,_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeFollowUserUrl */ .bE)(usernameOrId), {});
  708. const isUserFollowed = async (usernameOrId)=>{
  709. return (0,_utils_auth_api__WEBPACK_IMPORTED_MODULE_1__/* .privateFetcher */ .UK)((0,_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeIsUserFollowedUrl */ .BC)(usernameOrId));
  710. };
  711. const getAllUserReflections = async (params)=>{
  712. return privateFetcher(makeGetUserReflectionsUrl(params));
  713. };
  714. const getQuranicCalendarPostOfWeek = async (weekNumber)=>{
  715. return (0,_utils_auth_api__WEBPACK_IMPORTED_MODULE_1__/* .privateFetcher */ .UK)((0,_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeQuranicCalendarPostOfWeekUrl */ .Sv)(weekNumber));
  716. };
  717. /***/ }),
  718. /***/ 65899:
  719. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  720. "use strict";
  721. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  722. /* harmony export */ "BC": () => (/* binding */ makeIsUserFollowedUrl),
  723. /* harmony export */ "PI": () => (/* binding */ makePostReflectionViewsUrl),
  724. /* harmony export */ "Sv": () => (/* binding */ makeQuranicCalendarPostOfWeekUrl),
  725. /* harmony export */ "YV": () => (/* binding */ makeGetUserReflectionsUrl),
  726. /* harmony export */ "bE": () => (/* binding */ makeFollowUserUrl)
  727. /* harmony export */ });
  728. /* harmony import */ var _utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13830);
  729. const getPrefixedUrl = (url)=>`qf/${url}`;
  730. const makePostReflectionViewsUrl = (postId)=>(0,_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeUrl */ .bf)(getPrefixedUrl(`posts/${postId}/views`));
  731. const makeFollowUserUrl = (userNameOrId)=>(0,_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeUrl */ .bf)(getPrefixedUrl(`users/${userNameOrId}/follow`));
  732. const makeIsUserFollowedUrl = (userNameOrId)=>(0,_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeUrl */ .bf)(getPrefixedUrl(`users/${userNameOrId}/is-followed`));
  733. const makeGetUserReflectionsUrl = (params)=>(0,_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeUrl */ .bf)(getPrefixedUrl("posts"), params);
  734. const makeQuranicCalendarPostOfWeekUrl = (weekNumber)=>(0,_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_0__/* .makeUrl */ .bf)(getPrefixedUrl(`quranic-calendar/${weekNumber}`));
  735. /***/ }),
  736. /***/ 12690:
  737. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  738. "use strict";
  739. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  740. /* harmony export */ "a": () => (/* binding */ getCurrentQuranicCalendarWeek)
  741. /* harmony export */ });
  742. /* unused harmony export generateWeeksOfMonths */
  743. /* harmony import */ var _umalqura_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(89942);
  744. /* harmony import */ var _umalqura_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_umalqura_core__WEBPACK_IMPORTED_MODULE_0__);
  745. /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(98492);
  746. /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_1__);
  747. /* harmony import */ var quranic_calendar_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55269);
  748. /* eslint-disable guard-for-in */ /* eslint-disable no-restricted-syntax */ /* eslint-disable react-func/max-lines-per-function */
  749. /**
  750. * The idea is to sum the number of weeks from the start of the Quranic
  751. * calendar to the current week. This is done by summing the number of weeks
  752. * in each month before the current month and then adding the current week
  753. * in the current month.
  754. *
  755. * @param {umalqura.UmAlQura} currentHijriDate
  756. * @returns {number}
  757. */ const getCurrentQuranicCalendarWeek = (currentHijriDate)=>{
  758. // Today's date
  759. const today = currentHijriDate.date;
  760. // Convert today's date to the start of the day
  761. today.setHours(0, 0, 0, 0);
  762. // Iterate through the weeks to find the current week
  763. for(const key in quranic_calendar_json__WEBPACK_IMPORTED_MODULE_2__){
  764. const weeks = quranic_calendar_json__WEBPACK_IMPORTED_MODULE_2__[key];
  765. for (const week of weeks){
  766. const startDate = new Date(week.year, week.month - 1, week.day);
  767. const endDate = new Date(startDate);
  768. endDate.setDate(startDate.getDate() + 7);
  769. if (today >= startDate && today < endDate) {
  770. return Number(week.weekNumber);
  771. }
  772. }
  773. }
  774. return 0;
  775. };
  776. // TODO: add unit tests
  777. const generateWeeksOfMonths = (months)=>{
  778. const today = umalqura();
  779. const monthsDataMap = {};
  780. let currentMonthIndex;
  781. // 1. loop through each first day of each month
  782. for(let i = 0; i < months.length; i += 1){
  783. const firstDayOfHijriMonth = umalqura(months[i].year, months[i].month, months[i].day);
  784. const monthYearKey = `${firstDayOfHijriMonth.hy}-${firstDayOfHijriMonth.hm}`;
  785. // 2. initialize current month details
  786. // @ts-ignore
  787. monthsDataMap[monthYearKey] = {};
  788. // @ts-ignore
  789. monthsDataMap[monthYearKey].weeks = {};
  790. // @ts-ignore
  791. monthsDataMap[monthYearKey].firstDateOfMonth = firstDayOfHijriMonth.date;
  792. // filter null days (days before or after start of month) and also filter days before the first day of the month if we are not starting from the first day of the month exactly
  793. const daysInMonth = firstDayOfHijriMonth.monthArray.flat().filter((day)=>day !== null && day.isSameOrAfter(firstDayOfHijriMonth));
  794. /**
  795. * 3. group days by week of the month. Since 0 dayOfWeek starts is
  796. * Monday, we are modifying weekOfYear to start on Friday
  797. */ const weeksOfMonthDaysMap = groupBy(daysInMonth, (day)=>{
  798. const shiftedDayOfWeek = (day.dayOfWeek + 2) % 7;
  799. const shiftedWeekOfYear = day.weekOfYear + (shiftedDayOfWeek < day.dayOfWeek ? 1 : 0);
  800. return `${day.hy}-${shiftedWeekOfYear}`;
  801. });
  802. // 4. if the month is the current month, set the current month flag
  803. const isCurrentMonth = today.hy === months[i].year && today.hm === months[i].month;
  804. // @ts-ignore
  805. monthsDataMap[monthYearKey].isCurrentMonth = isCurrentMonth;
  806. // 5. save the index of the current month so we can automatically scroll to later
  807. if (isCurrentMonth) {
  808. currentMonthIndex = i;
  809. }
  810. Object.keys(weeksOfMonthDaysMap).forEach((weekKey)=>{
  811. const weekDays = weeksOfMonthDaysMap[weekKey];
  812. // @ts-ignore
  813. monthsDataMap[monthYearKey].weeks[weekKey] = {
  814. weekDays,
  815. isCurrentWeek: isCurrentMonth && weekDays[0].weekOfYear === today.weekOfYear
  816. };
  817. });
  818. }
  819. return {
  820. monthsDataMap,
  821. currentMonthIndex
  822. };
  823. };
  824. /***/ }),
  825. /***/ 70713:
  826. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  827. "use strict";
  828. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  829. /* harmony export */ "dx": () => (/* binding */ getQuranReflectTagUrl),
  830. /* harmony export */ "rW": () => (/* binding */ getQuranReflectPostUrl)
  831. /* harmony export */ });
  832. /* unused harmony exports API_HOST, getQuranReflectVerseUrl, getQuranReflectEditUrl, getQuranReflectAuthorUrl */
  833. /* harmony import */ var _utils_qs_stringify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99921);
  834. const STAGING_API_HOST = "https://quranreflect.org";
  835. const PRODUCTION_API_HOST = "https://quranreflect.com";
  836. // env variables in Vercel can't be dynamic, we have to hardcode the urls here. https://stackoverflow.com/questions/44342226/next-js-error-only-absolute-urls-are-supported
  837. const API_HOST = process.env.NEXT_PUBLIC_VERCEL_ENV === "production" ? PRODUCTION_API_HOST : STAGING_API_HOST;
  838. const getQuranReflectFilteredVerseUrl = (chapterId, verseNumber, params)=>{
  839. return `${API_HOST}?filters=${chapterId}:${verseNumber}&${stringify(params)}`;
  840. };
  841. const getQuranReflectVerseUrl = (chapterId, verseNumber)=>{
  842. return getQuranReflectFilteredVerseUrl(chapterId, verseNumber, {
  843. feed: true
  844. });
  845. };
  846. const getQuranReflectEditUrl = (chapterId, verseNumber)=>{
  847. return getQuranReflectFilteredVerseUrl(chapterId, verseNumber, {
  848. edit: true
  849. });
  850. };
  851. const getQuranReflectAuthorUrl = (username)=>{
  852. return `${API_HOST}/${username}`;
  853. };
  854. const getQuranReflectPostUrl = (postId, viewComments = false)=>`${API_HOST}/posts/${postId}${viewComments ? "#comments" : ""}`;
  855. const getQuranReflectTagUrl = (tag)=>`${API_HOST}/?tags=${encodeURIComponent(tag)}`;
  856. /***/ }),
  857. /***/ 75184:
  858. /***/ ((module) => {
  859. "use strict";
  860. module.exports = require("@reduxjs/toolkit");
  861. /***/ }),
  862. /***/ 58097:
  863. /***/ ((module) => {
  864. "use strict";
  865. module.exports = require("@sentry/nextjs");
  866. /***/ }),
  867. /***/ 89942:
  868. /***/ ((module) => {
  869. "use strict";
  870. module.exports = require("@umalqura/core");
  871. /***/ }),
  872. /***/ 59003:
  873. /***/ ((module) => {
  874. "use strict";
  875. module.exports = require("classnames");
  876. /***/ }),
  877. /***/ 59606:
  878. /***/ ((module) => {
  879. "use strict";
  880. module.exports = require("humps");
  881. /***/ }),
  882. /***/ 12372:
  883. /***/ ((module) => {
  884. "use strict";
  885. module.exports = require("lodash/findKey");
  886. /***/ }),
  887. /***/ 98492:
  888. /***/ ((module) => {
  889. "use strict";
  890. module.exports = require("lodash/groupBy");
  891. /***/ }),
  892. /***/ 35526:
  893. /***/ ((module) => {
  894. "use strict";
  895. module.exports = require("lodash/random");
  896. /***/ }),
  897. /***/ 64042:
  898. /***/ ((module) => {
  899. "use strict";
  900. module.exports = require("lodash/range");
  901. /***/ }),
  902. /***/ 16641:
  903. /***/ ((module) => {
  904. "use strict";
  905. module.exports = require("next-seo");
  906. /***/ }),
  907. /***/ 74137:
  908. /***/ ((module) => {
  909. "use strict";
  910. module.exports = require("next-translate/Trans");
  911. /***/ }),
  912. /***/ 60866:
  913. /***/ ((module) => {
  914. "use strict";
  915. module.exports = require("next-translate/useTranslation");
  916. /***/ }),
  917. /***/ 3280:
  918. /***/ ((module) => {
  919. "use strict";
  920. module.exports = require("next/dist/shared/lib/app-router-context.js");
  921. /***/ }),
  922. /***/ 92796:
  923. /***/ ((module) => {
  924. "use strict";
  925. module.exports = require("next/dist/shared/lib/head-manager-context.js");
  926. /***/ }),
  927. /***/ 3539:
  928. /***/ ((module) => {
  929. "use strict";
  930. module.exports = require("next/dist/shared/lib/i18n/detect-domain-locale.js");
  931. /***/ }),
  932. /***/ 34014:
  933. /***/ ((module) => {
  934. "use strict";
  935. module.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");
  936. /***/ }),
  937. /***/ 78524:
  938. /***/ ((module) => {
  939. "use strict";
  940. module.exports = require("next/dist/shared/lib/is-plain-object.js");
  941. /***/ }),
  942. /***/ 78020:
  943. /***/ ((module) => {
  944. "use strict";
  945. module.exports = require("next/dist/shared/lib/mitt.js");
  946. /***/ }),
  947. /***/ 64406:
  948. /***/ ((module) => {
  949. "use strict";
  950. module.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");
  951. /***/ }),
  952. /***/ 24964:
  953. /***/ ((module) => {
  954. "use strict";
  955. module.exports = require("next/dist/shared/lib/router-context.js");
  956. /***/ }),
  957. /***/ 93431:
  958. /***/ ((module) => {
  959. "use strict";
  960. module.exports = require("next/dist/shared/lib/router/utils/add-locale.js");
  961. /***/ }),
  962. /***/ 11751:
  963. /***/ ((module) => {
  964. "use strict";
  965. module.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");
  966. /***/ }),
  967. /***/ 46220:
  968. /***/ ((module) => {
  969. "use strict";
  970. module.exports = require("next/dist/shared/lib/router/utils/compare-states.js");
  971. /***/ }),
  972. /***/ 10299:
  973. /***/ ((module) => {
  974. "use strict";
  975. module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");
  976. /***/ }),
  977. /***/ 23938:
  978. /***/ ((module) => {
  979. "use strict";
  980. module.exports = require("next/dist/shared/lib/router/utils/format-url.js");
  981. /***/ }),
  982. /***/ 29565:
  983. /***/ ((module) => {
  984. "use strict";
  985. module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");
  986. /***/ }),
  987. /***/ 35789:
  988. /***/ ((module) => {
  989. "use strict";
  990. module.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");
  991. /***/ }),
  992. /***/ 1897:
  993. /***/ ((module) => {
  994. "use strict";
  995. module.exports = require("next/dist/shared/lib/router/utils/is-bot.js");
  996. /***/ }),
  997. /***/ 1428:
  998. /***/ ((module) => {
  999. "use strict";
  1000. module.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");
  1001. /***/ }),
  1002. /***/ 28854:
  1003. /***/ ((module) => {
  1004. "use strict";
  1005. module.exports = require("next/dist/shared/lib/router/utils/parse-path.js");
  1006. /***/ }),
  1007. /***/ 91292:
  1008. /***/ ((module) => {
  1009. "use strict";
  1010. module.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");
  1011. /***/ }),
  1012. /***/ 34567:
  1013. /***/ ((module) => {
  1014. "use strict";
  1015. module.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");
  1016. /***/ }),
  1017. /***/ 80979:
  1018. /***/ ((module) => {
  1019. "use strict";
  1020. module.exports = require("next/dist/shared/lib/router/utils/querystring.js");
  1021. /***/ }),
  1022. /***/ 93297:
  1023. /***/ ((module) => {
  1024. "use strict";
  1025. module.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");
  1026. /***/ }),
  1027. /***/ 36052:
  1028. /***/ ((module) => {
  1029. "use strict";
  1030. module.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");
  1031. /***/ }),
  1032. /***/ 84226:
  1033. /***/ ((module) => {
  1034. "use strict";
  1035. module.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");
  1036. /***/ }),
  1037. /***/ 95052:
  1038. /***/ ((module) => {
  1039. "use strict";
  1040. module.exports = require("next/dist/shared/lib/router/utils/route-regex.js");
  1041. /***/ }),
  1042. /***/ 59232:
  1043. /***/ ((module) => {
  1044. "use strict";
  1045. module.exports = require("next/dist/shared/lib/utils.js");
  1046. /***/ }),
  1047. /***/ 71853:
  1048. /***/ ((module) => {
  1049. "use strict";
  1050. module.exports = require("next/router");
  1051. /***/ }),
  1052. /***/ 16689:
  1053. /***/ ((module) => {
  1054. "use strict";
  1055. module.exports = require("react");
  1056. /***/ }),
  1057. /***/ 78404:
  1058. /***/ ((module) => {
  1059. "use strict";
  1060. module.exports = require("react-virtuoso");
  1061. /***/ }),
  1062. /***/ 20997:
  1063. /***/ ((module) => {
  1064. "use strict";
  1065. module.exports = require("react/jsx-runtime");
  1066. /***/ }),
  1067. /***/ 52648:
  1068. /***/ ((module) => {
  1069. "use strict";
  1070. module.exports = require("refresh-fetch");
  1071. /***/ }),
  1072. /***/ 74973:
  1073. /***/ ((module) => {
  1074. "use strict";
  1075. module.exports = import("@radix-ui/react-collapsible");;
  1076. /***/ }),
  1077. /***/ 66704:
  1078. /***/ ((module) => {
  1079. "use strict";
  1080. module.exports = import("@radix-ui/react-tooltip");;
  1081. /***/ }),
  1082. /***/ 88813:
  1083. /***/ ((module) => {
  1084. "use strict";
  1085. module.exports = import("firebase/compat/analytics");;
  1086. /***/ }),
  1087. /***/ 33773:
  1088. /***/ ((module) => {
  1089. "use strict";
  1090. module.exports = import("firebase/compat/app");;
  1091. /***/ }),
  1092. /***/ 69915:
  1093. /***/ ((module) => {
  1094. "use strict";
  1095. module.exports = import("js-cookie");;
  1096. /***/ }),
  1097. /***/ 3590:
  1098. /***/ ((module) => {
  1099. "use strict";
  1100. module.exports = import("react-toastify");;
  1101. /***/ }),
  1102. /***/ 79847:
  1103. /***/ ((module) => {
  1104. "use strict";
  1105. module.exports = import("swr/immutable");;
  1106. /***/ }),
  1107. /***/ 63477:
  1108. /***/ ((module) => {
  1109. "use strict";
  1110. module.exports = require("querystring");
  1111. /***/ }),
  1112. /***/ 55269:
  1113. /***/ ((module) => {
  1114. "use strict";
  1115. module.exports = JSON.parse('{"1445-10":[{"weekNumber":"1","hijriYear":"1445","hijriMonth":"10","year":"2024","month":"4","day":"12","ranges":"1:1-2:74"},{"weekNumber":"2","hijriYear":"1445","hijriMonth":"10","year":"2024","month":"4","day":"19","ranges":"2:75-2:157"},{"weekNumber":"3","hijriYear":"1445","hijriMonth":"10","year":"2024","month":"4","day":"26","ranges":"2:158-2:230"},{"weekNumber":"4","hijriYear":"1445","hijriMonth":"10","year":"2024","month":"5","day":"3","ranges":"2:231-2:286"}],"1445-11":[{"weekNumber":"5","hijriYear":"1445","hijriMonth":"11","year":"2024","month":"5","day":"10","ranges":"3:1-3:109"},{"weekNumber":"6","hijriYear":"1445","hijriMonth":"11","year":"2024","month":"5","day":"17","ranges":"3:110-3:200"},{"weekNumber":"7","hijriYear":"1445","hijriMonth":"11","year":"2024","month":"5","day":"24","ranges":"4:1-4:57"},{"weekNumber":"8","hijriYear":"1445","hijriMonth":"11","year":"2024","month":"5","day":"31","ranges":"4:58-4:115"}],"1445-12":[{"weekNumber":"9","hijriYear":"1445","hijriMonth":"12","year":"2024","month":"6","day":"7","ranges":"4:116-4:176"},{"weekNumber":"10","hijriYear":"1445","hijriMonth":"12","year":"2024","month":"6","day":"14","ranges":"5:1-5:50"},{"weekNumber":"11","hijriYear":"1445","hijriMonth":"12","year":"2024","month":"6","day":"21","ranges":"5:51-5:120"},{"weekNumber":"12","hijriYear":"1445","hijriMonth":"12","year":"2024","month":"6","day":"28","ranges":"6:1-6:94"},{"weekNumber":"13","hijriYear":"1445","hijriMonth":"12","year":"2024","month":"7","day":"5","ranges":"6:95-6:165"}],"1446-1":[{"weekNumber":"14","hijriYear":"1446","hijriMonth":"1","year":"2024","month":"7","day":"12","ranges":"7:1-7:102"},{"weekNumber":"15","hijriYear":"1446","hijriMonth":"1","year":"2024","month":"7","day":"19","ranges":"7:103-7:206"},{"weekNumber":"16","hijriYear":"1446","hijriMonth":"1","year":"2024","month":"7","day":"26","ranges":"8:1-8:75"},{"weekNumber":"17","hijriYear":"1446","hijriMonth":"1","year":"2024","month":"8","day":"2","ranges":"9:1-9:59"}],"1446-2":[{"weekNumber":"18","hijriYear":"1446","hijriMonth":"2","year":"2024","month":"8","day":"9","ranges":"9:60-9:129"},{"weekNumber":"19","hijriYear":"1446","hijriMonth":"2","year":"2024","month":"8","day":"16","ranges":"10:1-10:109"},{"weekNumber":"20","hijriYear":"1446","hijriMonth":"2","year":"2024","month":"8","day":"23","ranges":"11:1-11:123"},{"weekNumber":"21","hijriYear":"1446","hijriMonth":"2","year":"2024","month":"8","day":"30","ranges":"12:1-12:111"}],"1446-3":[{"weekNumber":"22","hijriYear":"1446","hijriMonth":"3","year":"2024","month":"9","day":"6","ranges":"13:1-14:52"},{"weekNumber":"23","hijriYear":"1446","hijriMonth":"3","year":"2024","month":"9","day":"13","ranges":"15:1-16:89"},{"weekNumber":"24","hijriYear":"1446","hijriMonth":"3","year":"2024","month":"9","day":"20","ranges":"16:90-17:111"},{"weekNumber":"25","hijriYear":"1446","hijriMonth":"3","year":"2024","month":"9","day":"27","ranges":"18:1-18:110"}],"1446-4":[{"weekNumber":"26","hijriYear":"1446","hijriMonth":"4","year":"2024","month":"10","day":"4","ranges":"19:1-20:135"},{"weekNumber":"27","hijriYear":"1446","hijriMonth":"4","year":"2024","month":"10","day":"11","ranges":"21:1-21:112"},{"weekNumber":"28","hijriYear":"1446","hijriMonth":"4","year":"2024","month":"10","day":"18","ranges":"22:1-23:118"},{"weekNumber":"29","hijriYear":"1446","hijriMonth":"4","year":"2024","month":"10","day":"25","ranges":"24:1-24:64"},{"weekNumber":"30","hijriYear":"1446","hijriMonth":"4","year":"2024","month":"11","day":"1","ranges":"25:1-26:227"}],"1446-5":[{"weekNumber":"31","hijriYear":"1446","hijriMonth":"5","year":"2024","month":"11","day":"8","ranges":"27:1-28:50"},{"weekNumber":"32","hijriYear":"1446","hijriMonth":"5","year":"2024","month":"11","day":"15","ranges":"28:51-29:69"},{"weekNumber":"33","hijriYear":"1446","hijriMonth":"5","year":"2024","month":"11","day":"22","ranges":"30:1-32:30"},{"weekNumber":"34","hijriYear":"1446","hijriMonth":"5","year":"2024","month":"11","day":"29","ranges":"33:1-34:30"}],"1446-6":[{"weekNumber":"35","hijriYear":"1446","hijriMonth":"6","year":"2024","month":"12","day":"6","ranges":"34:31-36:83"},{"weekNumber":"36","hijriYear":"1446","hijriMonth":"6","year":"2024","month":"12","day":"13","ranges":"37:1-38:88"},{"weekNumber":"37","hijriYear":"1446","hijriMonth":"6","year":"2024","month":"12","day":"20","ranges":"39:1-40:85"},{"weekNumber":"38","hijriYear":"1446","hijriMonth":"6","year":"2024","month":"12","day":"27","ranges":"41:1-42:53"}],"1446-7":[{"weekNumber":"39","hijriYear":"1446","hijriMonth":"7","year":"2025","month":"1","day":"3","ranges":"43:1-45:37"},{"weekNumber":"40","hijriYear":"1446","hijriMonth":"7","year":"2025","month":"1","day":"10","ranges":"46:1-49:18"},{"weekNumber":"41","hijriYear":"1446","hijriMonth":"7","year":"2025","month":"1","day":"17","ranges":"50:1-54:55"},{"weekNumber":"42","hijriYear":"1446","hijriMonth":"7","year":"2025","month":"1","day":"24","ranges":"55:1-58:22"}],"1446-8":[{"weekNumber":"43","hijriYear":"1446","hijriMonth":"8","year":"2025","month":"1","day":"31","ranges":"59:1-66:12"},{"weekNumber":"44","hijriYear":"1446","hijriMonth":"8","year":"2025","month":"2","day":"7","ranges":"67:1-74:56"},{"weekNumber":"45","hijriYear":"1446","hijriMonth":"8","year":"2025","month":"2","day":"14","ranges":"75:1-83:36"},{"weekNumber":"46","hijriYear":"1446","hijriMonth":"8","year":"2025","month":"2","day":"21","ranges":"84:1-114:6"}]}');
  1116. /***/ })
  1117. };
  1118. ;
  1119. // load runtime
  1120. var __webpack_require__ = require("../webpack-runtime.js");
  1121. __webpack_require__.C(exports);
  1122. var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
  1123. var __webpack_exports__ = __webpack_require__.X(0, [11497,79165,96270,24709,57933,61239,25869,50497,76410,79717,13830,37883,22197,80695], () => (__webpack_exec__(14356)));
  1124. module.exports = __webpack_exports__;
  1125. })();
  1126. //# sourceMappingURL=calendar.js.map