"use strict"; exports.id = 62093; exports.ids = [62093]; exports.modules = { /***/ 62093: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "$U": () => (/* binding */ increaseTafsirFontScale), /* harmony export */ "Ho": () => (/* binding */ selectQuranFont), /* harmony export */ "Jf": () => (/* binding */ MAXIMUM_TAFSIR_FONT_STEP), /* harmony export */ "KV": () => (/* binding */ selectWordByWordFontScale), /* harmony export */ "P0": () => (/* binding */ MINIMUM_FONT_STEP), /* harmony export */ "Pt": () => (/* binding */ selectQuranReaderStyles), /* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ "fT": () => (/* binding */ decreaseTafsirFontScale), /* harmony export */ "i9": () => (/* binding */ selectIsUsingDefaultFont), /* harmony export */ "z$": () => (/* binding */ selectQuranMushafLines) /* harmony export */ }); /* unused harmony exports MAXIMUM_QURAN_FONT_STEP, MAXIMUM_TRANSLATIONS_FONT_STEP, MAXIMUM_WORD_BY_WORD_FONT_STEP, quranReaderStylesSlice, setQuranFont, increaseQuranTextFontScale, decreaseQuranTextFontScale, increaseTranslationFontScale, decreaseTranslationFontScale, increaseWordByWordFontScale, decreaseWordByWordFontScale, setMushafLines */ /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75184); /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _redux_actions_reset_settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(78733); /* harmony import */ var _redux_actions_sync_user_preferences__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91767); /* harmony import */ var _redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17241); /* harmony import */ var _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(61243); /* harmony import */ var types_auth_PreferenceGroup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(13591); /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(50467); const MAXIMUM_QURAN_FONT_STEP = 10; const MAXIMUM_TRANSLATIONS_FONT_STEP = 10; const MAXIMUM_TAFSIR_FONT_STEP = 10; const MAXIMUM_WORD_BY_WORD_FONT_STEP = 6; const MINIMUM_FONT_STEP = 1; const quranReaderStylesSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({ name: _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_4__/* ["default"].QURAN_READER_STYLES */ .Z.QURAN_READER_STYLES, initialState: (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_3__/* .getQuranReaderStylesInitialState */ .kq)(), reducers: { increaseQuranTextFontScale: (state)=>({ ...state, quranTextFontScale: state.quranTextFontScale + 1 }), decreaseQuranTextFontScale: (state)=>({ ...state, quranTextFontScale: state.quranTextFontScale - 1 }), increaseTranslationFontScale: (state)=>({ ...state, translationFontScale: state.translationFontScale + 1 }), decreaseTranslationFontScale: (state)=>({ ...state, translationFontScale: state.translationFontScale - 1 }), increaseTafsirFontScale: (state)=>({ ...state, tafsirFontScale: state.tafsirFontScale + 1 }), decreaseTafsirFontScale: (state)=>({ ...state, tafsirFontScale: state.tafsirFontScale - 1 }), increaseWordByWordFontScale: (state)=>({ ...state, wordByWordFontScale: state.wordByWordFontScale + 1 }), decreaseWordByWordFontScale: (state)=>({ ...state, wordByWordFontScale: state.wordByWordFontScale - 1 }), setMushafLines: (state, action)=>{ const { mushafLines , locale } = action.payload; const defaultQuranStylesForLocale = (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_3__/* .getQuranReaderStylesInitialState */ .kq)(locale); return { ...state, mushafLines, isUsingDefaultFont: defaultQuranStylesForLocale.mushafLines === mushafLines && state.quranFont === defaultQuranStylesForLocale.quranFont }; }, setQuranFont: (state, action)=>{ const { quranFont , locale } = action.payload; const defaultQuranStylesForLocale = (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_3__/* .getQuranReaderStylesInitialState */ .kq)(locale); const isUsingDefaultFont = defaultQuranStylesForLocale.quranFont === quranFont && state.mushafLines === defaultQuranStylesForLocale.mushafLines; switch(quranFont){ case types_QuranReader__WEBPACK_IMPORTED_MODULE_6__/* .QuranFont.MadaniV1 */ .fr.MadaniV1: return { ...state, quranFont, isUsingDefaultFont }; case types_QuranReader__WEBPACK_IMPORTED_MODULE_6__/* .QuranFont.IndoPak */ .fr.IndoPak: return { ...state, quranFont, isUsingDefaultFont }; default: return { ...state, quranFont, isUsingDefaultFont }; } } }, // reset the state to the initial state // when `reset` action is dispatched extraReducers: (builder)=>{ builder.addCase(_redux_actions_reset_settings__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, (state, action)=>{ return (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_3__/* .getQuranReaderStylesInitialState */ .kq)(action.payload.locale); }); builder.addCase(_redux_actions_sync_user_preferences__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, (state, action)=>{ const { payload: { userPreferences , locale } , } = action; const remotePreferences = userPreferences[types_auth_PreferenceGroup__WEBPACK_IMPORTED_MODULE_5__/* ["default"].QURAN_READER_STYLES */ .Z.QURAN_READER_STYLES]; if (remotePreferences) { const { quranFont: defaultQuranFont , mushafLines: defaultMushafLines } = (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_3__/* .getQuranReaderStylesInitialState */ .kq)(locale); return { ...state, ...remotePreferences, isUsingDefaultFont: defaultQuranFont === remotePreferences.quranFont && defaultMushafLines === remotePreferences.mushafLines }; } return state; }); } }); const { increaseTafsirFontScale , decreaseTafsirFontScale , setQuranFont , increaseQuranTextFontScale , decreaseQuranTextFontScale , increaseTranslationFontScale , decreaseTranslationFontScale , increaseWordByWordFontScale , decreaseWordByWordFontScale , setMushafLines , } = quranReaderStylesSlice.actions; const selectQuranReaderStyles = (state)=>state.quranReaderStyles; const selectQuranFont = (state)=>state.quranReaderStyles.quranFont; const selectQuranMushafLines = (state)=>state.quranReaderStyles.mushafLines; const selectWordByWordFontScale = (state)=>state.quranReaderStyles.wordByWordFontScale; const selectIsUsingDefaultFont = (state)=>!!state.quranReaderStyles.isUsingDefaultFont; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (quranReaderStylesSlice.reducer); /***/ }) }; ; //# sourceMappingURL=62093.js.map