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,EAAQE,SAASK,UAAQO,OAAG3G,EAAE,IAAA2G,OAAO3G,GAAO,IACnE,CACA,MAAO,CAAEtH,OAAMiP,YACnB,CACJ,C","sources":["client/game_checkIn/redux/modules/gameState.js","client/game_comment/redux/modules/gameState.js","client/game_orderReward/redux/modules/gameState.js","client/game_photoContest/redux/modules/gameState.js","client/utils/windowOnViewPromise.js","client/hooks/useInitAbortHelper.js","client/hooks/useInitPromo/getGameResultRecordsAndWinnerList.js","client/hooks/useInitPromo/getPromoInfoData.js","client/hooks/useInitPromo/getPeriodPlayMatchedInfo.js","client/hooks/useInitPromo/getPromoState.js","client/hooks/useInitPromo/handleQueryStringTest.js","client/hooks/useInitPromo/getLoginUserNonQualifyTypeAfterEntry.js","client/hooks/useInitPromo/useInitPromo.js","client/hooks/useInitPromo/userLoginState/getUserLoginStateAfterEntry.js","client/hooks/useInitPromo/userEntryState/getUserEntryState.js","client/hooks/useInitPromo/userLoginState/getLoginUserNonQualifyType.js","client/hooks/useInitPromo/userLoginState/getUserLoginState.js","client/hooks/useInitPromo/userLoginState/loginUser.js","client/hooks/useIsInitSuccessInfo.js","client/hooks/useUpdateWinnerData.js","client/redux/modules/appState.js","client/redux/modules/flags.js","client/redux/modules/lotteryParticipant.js","client/redux/modules/lotteryPrizes.js","client/redux/modules/lotteryTasks.js","client/redux/modules/mgmReferral.js","client/redux/modules/settingStyle.js","client/redux/modules/ugcMediaOfMember.js","client/redux/modules/userGameResultRecords.js","client/redux/modules/userWinnerPrize.js","client/redux/modules/promo.js","client/redux/modules/promoTasks.js","client/redux/modules/gameFormBased.js","client/redux/modules/settingPromo.js","client/redux/modules/settingPointSystems.js","client/redux/modules/settingGame.js","client/redux/modules/settingTheme.js","client/redux/modules/settingGameStyle.js","client/redux/modules/settingEntryValue.js","client/redux/modules/settingMGMReferral.js","client/redux/modules/settingPlan.js","client/redux/modules/signUpForm.js","client/redux/modules/zines.js","client/redux/modules/lotteryAdmin.js","client/redux/modules/lotteryInstant.js","client/redux/modules/partner.js","client/redux/modules/sponsor.js","client/redux/modules/pointSystem.js","client/redux/modules/mgmRelation.js","client/redux/staticReducer.js","client/game_checkIn/redux/reducer.js","client/game_photoContest/redux/reducer.js","client/game_comment/redux/reducer.js","client/game_orderReward/redux/reducer.js","client/redux/modules/relatedTwinsPromo.js","client/redux/gameReducer.js","client/redux/store.js","hooks/useRemoveAndRetrieveQs.js"],"sourcesContent":["const UPDATE_GAME_STATE = 'gameState/UPDATE_GAME_STATE';\n\nexport const defaultState = {\n hasNewUnlockTaskPrize: false,\n gameResultRecordsCount: 0,\n hasLotteryTaskMappingEntryInited: false,\n lotteryTaskMappingEntry: {}\n};\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_GAME_STATE:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function setHasNewUnlockTaskPrize(status) {\n return {\n type: UPDATE_GAME_STATE,\n payload: {\n hasNewUnlockTaskPrize: status\n }\n };\n}\n\nexport function updateGameResultRecordsCount() {\n return (dispatch, getState) => {\n const { userGameResultRecords } = getState();\n dispatch({\n type: UPDATE_GAME_STATE,\n payload: {\n gameResultRecordsCount: userGameResultRecords.length\n }\n });\n };\n}\n\nexport function setLotteryTaskMappingEntryInited() {\n return {\n type: UPDATE_GAME_STATE,\n payload: {\n hasLotteryTaskMappingEntryInited: true\n }\n };\n}\n\nexport function setLotteryTaskMappingEntry(lotteryTaskMappingEntry) {\n return {\n type: UPDATE_GAME_STATE,\n payload: {\n lotteryTaskMappingEntry\n }\n };\n}\n","const UPDATE_SETTING_OPTIONS = 'gameState/UPDATE_SETTING_OPTIONS';\n\nexport const defaultState = {\n settingOptions: {}\n};\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_SETTING_OPTIONS:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function updateSettingOptions(data) {\n return {\n type: UPDATE_SETTING_OPTIONS,\n payload: {\n settingOptions: data\n }\n };\n}\n","const UPDATE_VALIDATE_FAILED_ORDERS = 'gameState/UPDATE_VALIDATE_FAILED_ORDERS';\n\nexport const defaultState = {\n validateFailedOrders: []\n};\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_VALIDATE_FAILED_ORDERS:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function updateValidateFailedOrders(data) {\n return {\n type: UPDATE_VALIDATE_FAILED_ORDERS,\n payload: {\n validateFailedOrders: data\n }\n };\n}\n","import { getContestUgcMediaAndVoteCount } from 'api/ugc';\n\nconst UPDATE_GAME_STATE = 'gameState/UPDATE_GAME_STATE';\n\nexport const defaultState = {\n campaignVoteCount: 0,\n campaignPortfolioCount: 0\n};\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_GAME_STATE:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function updateCampaignVoteCount() {\n return async (dispatch, getState) => {\n const {\n promo: { id: promoId }\n } = getState();\n const {\n payload: { counts, votes }\n } = await getContestUgcMediaAndVoteCount(promoId);\n\n dispatch({\n type: UPDATE_GAME_STATE,\n payload: {\n campaignVoteCount: votes,\n campaignPortfolioCount: counts\n }\n });\n };\n}\n","export default function windowOnViewPromise() {\n return new Promise(res => {\n if (isDocVisible()) {\n res(true);\n } else {\n document.addEventListener('visibilitychange', handler);\n }\n function handler() {\n if (isDocVisible()) {\n res(true);\n document.removeEventListener('visibilitychange', handler);\n }\n }\n });\n}\n\nfunction isDocVisible() {\n return document.visibilityState === 'visible';\n}\n","import { useEffect, useRef } from 'react';\n\nimport windowOnViewPromise from 'client/utils/windowOnViewPromise';\n\nexport default function useInitAbortHelper() {\n const helperRef = useRef({\n isAborted: false,\n checkIsDocOnViewing: () => windowOnViewPromise(),\n async canContinue() {\n return !this.isAborted && this.checkIsDocOnViewing();\n }\n });\n\n useEffect(() => {\n function handleUnload() {\n helperRef.current.isAborted = true;\n return null;\n }\n window.addEventListener('beforeunload', handleUnload);\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n helperRef.current.isAborted = true;\n window.removeEventListener('beforeunload', handleUnload);\n };\n }, []);\n\n return helperRef;\n}\n","import { getUserWinnerList } from '../useUpdateWinnerData';\nimport { getEntriesListApi } from 'api/client';\n\nexport async function setGameResultRecordsAndWinnerList(\n state,\n mergeAndDispatchState = () => {},\n isMgm = false\n) {\n let userWinnerPrize = null;\n const {\n mgmRelation: { mgmReferral: { uuid: mgmPromoUUID } = {} } = {},\n promo: { uuid: promoUUID }\n } = state;\n\n const { payload: { items: entries = [] } = {} } = await getEntriesListApi(\n isMgm ? mgmPromoUUID : promoUUID\n );\n\n if (entries.length > 0) {\n userWinnerPrize = await getUserWinnerList(isMgm ? mgmPromoUUID : promoUUID);\n }\n\n mergeAndDispatchState(\n isMgm\n ? {\n mgmReferral: {\n userGameResultRecords: entries,\n ...(Boolean(userWinnerPrize) ? { userWinnerPrize } : {})\n }\n }\n : {\n userGameResultRecords: entries,\n ...(Boolean(userWinnerPrize) ? { userWinnerPrize } : {})\n }\n );\n}\n","import { getPromoInfoApi, getPromoTaskListApi, getFormInfo } from 'api/client';\nimport { normalizePromoTasksList, normalizePromoLotteryList } from 'api/utils';\nimport { isJSONParsable, objFirstLevelJSONParse } from 'utils/objectManipulate';\nimport {\n gameTypes,\n checkIsGameHasPromoTask,\n contestGetUgcLinkKey,\n isContestGamesForUserPlayableUgc,\n isPurePrizeGames\n} from 'config/promoGameTypes';\nimport { IS_UGC_FLOW } from 'config/envVariable';\nimport { fromEntries } from 'utils/core';\n\nexport default async function getPromoInfoData(promoUUID, exclude = []) {\n const primaryPromoData = await getPromoInfoApi({\n promoUUID\n });\n const result = await mappingPromoInfoApi2State(primaryPromoData, exclude);\n return result;\n}\n\nconst mappingPromoInfoApi2State = async (apiData, exclude = []) => {\n let data = {};\n const filterNotNecessaryApiResponse = fromEntries(\n Object.entries(apiData).filter(([apiKey]) => !exclude.includes(apiKey))\n );\n\n data = getPromoState(filterNotNecessaryApiResponse);\n data = await getFormState(data);\n data = await getPromoTasksState(data);\n data = getLotteriesState(data);\n data = getPrizeState(data);\n\n if (!exclude.includes('pointPool')) {\n data = getPromoPointPoolInfoState(data);\n }\n\n if (!exclude.includes('mgmRelation')) {\n data = await getPromoMgmRelationState(data);\n }\n data = await getRelatedTwinsPromoState(data);\n\n return data;\n};\n\nfunction getPromoState({ promotion, ...rest }) {\n return {\n partner: { ...promotion.partner, ...promotion.partnerSetting },\n sponsor: { ...promotion.sponsor, ...promotion.sponsorSetting },\n promo: promotion.promo,\n promoState: {\n isPurePrizeGame: isPurePrizeGames(promotion.promo.type)\n },\n settingPromo: promotion.promoSetting.Promotions,\n settingPointSystems: promotion.promoSetting.PointSystems,\n settingStyle: objFirstLevelJSONParse(promotion.promoSetting.Styles),\n settingGame: objFirstLevelJSONParse(promotion.promoSetting.Games),\n settingGameStyle: objFirstLevelJSONParse(promotion.promoSetting.GameStyles),\n settingMGMReferral: objFirstLevelJSONParse(promotion.promoSetting.MGMReferral),\n settingEntryValue: objFirstLevelJSONParse(promotion.promoSetting.EntryValues),\n settingTheme: promotion.promoSetting.Themes,\n settingPlan: promotion.planSetting,\n signUpForm: promotion.promoSetting.SignUpForm,\n zines: promotion.promoSetting.SignUpForm,\n lotteryAdmin: promotion?.promoSetting?.LotteryAdmin ?? {},\n lotteryInstant: promotion?.promoSetting?.LotteryInstant ?? {},\n lotteryParticipant: promotion?.promoSetting?.LotteryParticipant ?? {},\n lotteryTasks: promotion?.promoSetting?.LotteryTasks ?? {},\n ...rest\n };\n}\n\nfunction getPromoPointPoolInfoState(data) {\n const { pointPool, ...rest } = data;\n\n if (!Array.isArray(pointPool) && Object.keys(pointPool).length > 0) {\n for (let pointPoolUuid in pointPool) {\n pointPool[pointPoolUuid].settings = objFirstLevelJSONParse(\n pointPool[pointPoolUuid].settings.Styles\n );\n }\n }\n\n return {\n ...rest,\n pointSystem: {\n pointPoolInfos: pointPool\n }\n };\n}\n\nasync function getPromoMgmRelationState(data) {\n const { mgmRelation } = data;\n if (!Array.isArray(mgmRelation) && Object.keys(mgmRelation).length > 0) {\n const { mgmReferral, mgmRole } = mgmRelation;\n const isMGMGame = mgmRole === 'mgmShare' || mgmRole === 'mgmSelf';\n if (Boolean(mgmReferral) && isMGMGame) {\n const { uuid: mgmReferralPromoUUID } = mgmReferral;\n const mgmReferralPromoInfoData = await getPromoInfoApi({\n promoUUID: mgmReferralPromoUUID\n });\n const formattedMgmReferralPromoInfoData = await mappingPromoInfoApi2State(\n mgmReferralPromoInfoData\n );\n return {\n ...data,\n mgmReferral: formattedMgmReferralPromoInfoData\n };\n }\n }\n\n return {\n ...data,\n mgmReferral: {}\n };\n}\n\nasync function getPromoTasksState(data) {\n const promo = data.promo;\n if (!checkIsGameHasPromoTask(promo.type)) return data;\n\n const { payload } = await getPromoTaskListApi({ promoUUID: promo.uuid });\n return {\n ...data,\n promoTasks: await normalizePromoTasksList(payload)\n };\n}\n\nfunction getLotteriesState(data) {\n const {\n lotteryAdmin,\n lotteryInstant,\n lotteryParticipant,\n lotteryTasks: lotteryTasksData,\n lotteries,\n ...rest\n } = data;\n\n const lotteryState = normalizePromoLotteryList(lotteries);\n const lotteryTasks = isJSONParsable(lotteryTasksData?.uuid)\n ? JSON.parse(lotteryTasksData?.uuid)\n : lotteryTasksData;\n return {\n ...rest,\n lotteryAdmin: Boolean(lotteryAdmin?.uuid),\n lotteryInstant: {\n uuid: lotteryInstant?.uuid,\n ...(lotteryState[lotteryInstant?.uuid] ?? {})\n },\n lotteryParticipant: {\n uuid: lotteryParticipant?.uuid,\n ...(lotteryState[lotteryParticipant?.uuid] ?? {})\n },\n lotteryTasks: Object.entries(lotteryTasks).reduce((obj, [lotteryUuid, taskCondition]) => {\n obj[lotteryUuid] = {\n taskCondition,\n ...(lotteryState[lotteryUuid] ?? {})\n };\n return obj;\n }, {})\n };\n}\n\nfunction getPrizeState(data) {\n const { lotteryPrizes, lotteryParticipant } = data;\n if (lotteryParticipant?.uuid) {\n return {\n ...data,\n lotteryPrizes\n };\n }\n\n return {\n ...data,\n lotteryPrizes: {}\n };\n}\n\nasync function getFormState(data) {\n const formId = data?.settingGame?.formId;\n const promoType = data.promo.type;\n // [#86entxjdp] 空 formbased 模組強制不 create form\n if (!formId || isPurePrizeGames(promoType) || promoType === gameTypes.SIGN_FORM) return data;\n\n const {\n payload: { pages = [], sections = [], fields = [], options = [], settings = {} } = {}\n } = await getFormInfo({ formId });\n\n return {\n ...data,\n gameFormBased: {\n pages,\n sections,\n fields,\n options,\n settings\n }\n };\n}\n\nasync function getRelatedTwinsPromoState(primaryPromoData) {\n const {\n promo: { type: primaryGameType } = {},\n settingPromo: primarySettingPromo = {}\n } = primaryPromoData;\n\n const {\n [contestGetUgcLinkKey(primaryGameType, primarySettingPromo)]: relatedPromoUuid\n } = primarySettingPromo;\n\n const hasSecondaryPromo = Boolean(relatedPromoUuid);\n\n if (!hasSecondaryPromo) {\n return primaryPromoData;\n }\n\n let secondaryPromoData = await getPromoInfoApi({\n promoUUID: relatedPromoUuid\n });\n\n secondaryPromoData = await mappingPromoInfoApi2State(secondaryPromoData);\n\n // 有 hasUgcFlow + 有 ugcLinkKeys\n if (isContestGamesForUserPlayableUgc(primaryGameType)) {\n // style setting is saved in ugc module\n primaryPromoData.settingStyle = secondaryPromoData.settingStyle;\n // theme setting is saved in contest module\n secondaryPromoData.settingTheme = primaryPromoData.settingTheme;\n secondaryPromoData.settingPromo = {\n language: primaryPromoData.settingPromo.language,\n ...secondaryPromoData.settingPromo\n };\n\n if (IS_UGC_FLOW) {\n const secondaryPromoWithoutPartnerAndSponsor = (() => {\n const { partner, sponsor, ...rest } = secondaryPromoData;\n return rest;\n })();\n return {\n ...primaryPromoData,\n relatedTwinsPromo: secondaryPromoWithoutPartnerAndSponsor\n };\n } else {\n const primaryPromoWithoutPartnerAndSponsor = (() => {\n const { partner, sponsor, ...rest } = primaryPromoData;\n return rest;\n })();\n return {\n ...secondaryPromoData,\n relatedTwinsPromo: primaryPromoWithoutPartnerAndSponsor\n };\n }\n }\n\n // 無hasUgcFlow + 有 ugcLinkKeys\n if (primaryGameType === gameTypes.CONTEST_ADMIN_UPLOAD) {\n primaryPromoData.settingStyle = secondaryPromoData.settingStyle;\n const secondaryPromoWithoutPartnerAndSponsor = (() => {\n const { partner, sponsor, ...rest } = secondaryPromoData;\n return rest;\n })();\n return {\n ...primaryPromoData,\n relatedTwinsPromo: secondaryPromoWithoutPartnerAndSponsor\n };\n }\n\n return primaryPromoData;\n}\n","import { generatePeriodTimeMatchInfo } from 'editor/components/SideBar/Qualify/limitPlayTimes/periodPlay/utils';\n\nexport default function getPeriodPlayMatchedInfo({ periodPlayMode, periodTime, timezone }) {\n const isPeriodPlayMode = Boolean(periodPlayMode) && Boolean(periodTime);\n\n return {\n isPeriodPlayMode,\n matchedInfo: generatePeriodTimeMatchInfo(isPeriodPlayMode, {\n timezone,\n periodTimes: periodTime,\n mode: periodPlayMode\n })\n };\n}\n","import { IS_IFRAME_MODE } from 'config/envVariable';\nimport { IS_OFFLINE, IS_END, IS_SUSPEND } from 'config/promoOnlineStatus';\nimport { loginTypes } from 'config/loginTypes';\nimport { gameRunningStatuses } from 'config/gameRunningStatuses';\nimport { reducePointModes } from 'config/enterpriseReducePointMode';\nimport { hasUtcDTStartInLocal, hasUtcDTEndInLocal } from 'utils/dateTime';\nimport getPeriodPlayMatchedInfo from 'client/hooks/useInitPromo/getPeriodPlayMatchedInfo';\nimport { getQsOfParentUrl } from 'client/utils/queryString';\n\nexport default function getPromoState(state, qs) {\n const {\n settingPromo: { periodPlayMode, periodTime, timezone }\n } = state;\n const { test_code, test_expired, parentUrl = '', scenes, mode } = qs;\n const { utm_source, utm_medium, utm_campaign, utm_term, utm_content } = getUtmFromParentUrl(\n parentUrl\n );\n const { status: gameRunningStatus, isTestMode = false } = getGameRunningStatus(state, {\n hasTestQs: Boolean(test_code) && Boolean(test_expired),\n hasPreviewQs: mode === 'preview'\n });\n return {\n periodPlayMatchedInfo: getPeriodPlayMatchedInfo({\n periodPlayMode,\n periodTime,\n timezone\n }),\n isTestMode,\n enablePasscodeVerify: checkEnablePasscodeVerify(state),\n gameRunningStatus,\n reducePointMode: getReducePointMode(state),\n parentUrl,\n scenes,\n utmFromParent: {\n utm_source,\n utm_medium,\n utm_campaign,\n utm_term,\n utm_content\n }\n };\n}\n\nfunction getUtmFromParentUrl(parentUrl) {\n const { utm_source, utm_medium, utm_campaign, utm_term, utm_content } = getQsOfParentUrl(\n parentUrl\n );\n return { utm_source, utm_medium, utm_campaign, utm_term, utm_content };\n}\nfunction getGameRunningStatus(state, { hasTestQs, hasPreviewQs }) {\n const {\n promo: { status: promoStatus },\n settingPromo: { startDate, endDate },\n zines: { pageId } = {}\n } = state;\n\n if (IS_IFRAME_MODE && pageId !== undefined && hasPreviewQs) {\n return { status: gameRunningStatuses.NOT_PUBLISH };\n }\n if (promoStatus === IS_OFFLINE) {\n if (hasTestQs) {\n return { status: gameRunningStatuses.RUNNING, isTestMode: true };\n } else {\n return { status: gameRunningStatuses.NOT_PUBLISH };\n }\n } else if (promoStatus === IS_SUSPEND) {\n return { status: gameRunningStatuses.SUSPEND };\n } else if (promoStatus === IS_END || hasUtcDTEndInLocal(endDate)) {\n return { status: gameRunningStatuses.END };\n } else {\n if (!hasUtcDTStartInLocal(startDate)) {\n return { status: gameRunningStatuses.BEFORE };\n } else {\n return { status: gameRunningStatuses.RUNNING };\n }\n }\n}\nfunction getReducePointMode(state) {\n const {\n settingPromo: {\n loginMethod,\n enableKkpoint,\n kkpointAmount,\n transactionWithdraw,\n transactionWithdrawQuantity\n },\n settingPointSystems = {}\n } = state;\n\n // 企業(會員點數)\n if (loginMethod === loginTypes.ENTERPRISELOGIN) {\n if (Boolean(enableKkpoint) && kkpointAmount !== undefined) {\n return reducePointModes.KK_BOX;\n } else if (Boolean(transactionWithdraw) && transactionWithdrawQuantity !== undefined) {\n return reducePointModes.GENERAL;\n }\n }\n // FEVER(活動點數)\n if (\n loginMethod === loginTypes.FACEBOOKLOGIN ||\n loginMethod === loginTypes.LINELOGIN ||\n loginMethod === loginTypes.ENTERPRISELOGIN\n ) {\n const shouldReducePromoPointForJoinPromo =\n Boolean(settingPointSystems?.qualifyWithdrawUuid) &&\n transactionWithdrawQuantity !== undefined;\n\n if (shouldReducePromoPointForJoinPromo) {\n return reducePointModes.POINT_SYSTEMS;\n }\n }\n return '';\n}\nfunction checkEnablePasscodeVerify(state) {\n const {\n settingPromo: { enableQualificationPasscode }\n } = state;\n return Boolean(enableQualificationPasscode);\n}\n","import { validateTestCodeAPI } from 'api/client';\nimport { CLIENT_API_FEVER_HOST } from 'config/envVariable';\nimport { IS_OFFLINE } from 'config/promoOnlineStatus';\nimport * as clientErrTypes from 'config/clientErrorTypes';\nimport { generateApiErrObj } from 'client/hooks/useClientErrorHandler';\n\nimport useRemoveAndRetrieveQs from 'hooks/useRemoveAndRetrieveQs';\n\nexport function useRemoveUnnecessaryQueryStr() {\n const qsHandler = useRemoveAndRetrieveQs();\n return state => {\n const {\n promo: { status: promoStatus }\n } = state;\n let shouldRemoveQsKey = ['tryliff'];\n if (promoStatus !== IS_OFFLINE) {\n shouldRemoveQsKey.push('test_code', 'test_expired');\n }\n return qsHandler(shouldRemoveQsKey);\n };\n}\nexport async function validateTestCode(state, { test_code, test_expired } = {}) {\n const {\n sponsor: { id: sponsorId }\n } = state;\n\n if (Boolean(sponsorId) && Boolean(test_code) && Boolean(test_expired)) {\n const validateResp = await validateTestCodeAPI({\n host: CLIENT_API_FEVER_HOST,\n sponsorId,\n testCode: test_code,\n testExpired: test_expired\n });\n const { httpStatus, payload } = validateResp;\n if (httpStatus !== 200) {\n throw generateApiErrObj(validateResp);\n } else if ((payload ?? [])[0] !== true) {\n throw generateApiErrObj(validateResp, clientErrTypes.INVALID_TEST_CODE);\n }\n }\n}\n","import { notQualifiedTypes } from 'config/notQualifiedTypes';\nimport { submitReferralCodeApi } from 'api/client';\nimport Cookies from 'js-cookie';\n\nexport default async function getLoginUserNonQualifyTypeAfterEntry(state) {\n const {\n promo: { uuid: promoUuid } = {},\n promoState: { referralCode },\n userEntryState: {\n currentEntryUUID: entryUuid,\n isNeedEnterReferralCode,\n hasReferralCodeInput\n } = {},\n userGameResultRecords = [],\n settingMGMReferral: { enableReferralCodeRequired } = {}\n } = state;\n\n const submitReferralCode = async () => {\n const emptyState = {\n promoState: {\n referralCode: ''\n }\n };\n\n if (referralCode && promoUuid && entryUuid) {\n Cookies.remove('ref_code');\n try {\n const submitResp = await submitReferralCodeApi({\n promoUuid,\n entryUuid,\n referralCode\n });\n if (submitResp.httpStatus === 200) {\n return {\n userEntryState: {\n hasReferralCodeInput: true,\n isNeedEnterReferralCode: false,\n isCanEnterReferralCode: false\n },\n ...emptyState\n };\n } else {\n return {\n ...emptyState,\n ...(enableReferralCodeRequired\n ? {\n userLoginState: {\n notQualifiedType:\n notQualifiedTypes.QUALIFICATION.SUBMIT_REFERRAL_CODE\n }\n }\n : {})\n };\n }\n } catch (err) {\n return {\n ...emptyState,\n ...(enableReferralCodeRequired\n ? {\n userLoginState: {\n notQualifiedType:\n notQualifiedTypes.QUALIFICATION.SUBMIT_REFERRAL_CODE\n }\n }\n : {})\n };\n }\n } else {\n return {\n ...(enableReferralCodeRequired\n ? {\n userLoginState: {\n notQualifiedType: notQualifiedTypes.QUALIFICATION.SUBMIT_REFERRAL_CODE\n }\n }\n : {})\n };\n }\n };\n\n if (referralCode && userGameResultRecords.length === 0) {\n if (hasReferralCodeInput) {\n return {\n promoState: {\n referralCode: ''\n }\n };\n }\n const res = await submitReferralCode();\n if (Boolean(res)) return res;\n } else if (isNeedEnterReferralCode) {\n return {\n promoState: {\n referralCode: ''\n },\n userLoginState: {\n notQualifiedType: notQualifiedTypes.QUALIFICATION.SUBMIT_REFERRAL_CODE\n }\n };\n }\n\n return {};\n}\n","import { useEffect } from 'react';\nimport { useDispatch } from 'react-redux';\nimport _merge from 'lodash/merge';\nimport querystring from 'query-string';\nimport { IS_IFRAME_MODE } from 'config/envVariable';\nimport { setI18nLanguage } from 'locale/i18n';\nimport * as clientErrTypes from 'config/clientErrorTypes';\nimport { initTagManager } from 'client/utils/tracking';\nimport store from 'client/redux/store';\nimport { initAppState } from 'client/redux/store';\nimport { setInited, setErrorOnInit, setUserStateInited } from 'client/redux/modules/flags';\nimport { setLoginId } from 'client/redux/modules/userLoginState';\nimport {\n useRemoveUnnecessaryQueryStr,\n validateTestCode\n} from 'client/hooks/useInitPromo/handleQueryStringTest';\nimport getPromoInfoData from 'client/hooks/useInitPromo/getPromoInfoData';\nimport getPromoState from 'client/hooks/useInitPromo/getPromoState';\nimport getUserLoginState from 'client/hooks/useInitPromo/userLoginState/getUserLoginState';\nimport getUserLoginStateAfterEntry from 'client/hooks/useInitPromo/userLoginState/getUserLoginStateAfterEntry';\nimport getUserEntryState from 'client/hooks/useInitPromo/userEntryState/getUserEntryState';\nimport { errorActionHandler } from 'client/hooks/useClientErrorHandler';\nimport useHistoryPathPush from 'client/hooks/useHistoryPathPush';\nimport useInitAbortHelper from 'client/hooks/useInitAbortHelper';\nimport { getLoginUserInfo } from 'client/utils/login';\nimport { getLocalStorage, deleteLocalStorage } from 'utils/localStorage';\nimport { checkReferralCodeApi, trackCampaignClick } from 'api/client';\nimport Cookies from 'js-cookie';\nimport getMgmFlags from 'utils/getMgmFlags';\nimport { setGameResultRecordsAndWinnerList } from './getGameResultRecordsAndWinnerList';\nimport { useLocation } from 'react-router-dom/cjs/react-router-dom.min';\n\nfunction useInitPromo(paramsPromoUUID, paramsPromoId) {\n const dispatch = useDispatch();\n const history = useHistoryPathPush();\n const location = useLocation();\n const removeUnnecessaryQueryStr = useRemoveUnnecessaryQueryStr();\n const abortHelper = useInitAbortHelper();\n function toFirstPage() {\n history.push({ pathname: `/${paramsPromoUUID}/${paramsPromoId}/join` });\n }\n function toNotFound() {\n history.push({ pathname: `/notfound` });\n }\n async function initPromo(recaptchaToken) {\n if (isNotValidPromoUUID(paramsPromoUUID)) return toNotFound();\n\n if (!Boolean(location?.pathname?.match(joinRegex))) toFirstPage();\n\n let state = {};\n\n function mergeAndDispatchState(source) {\n state = _merge({}, state, source);\n dispatch(initAppState(source));\n }\n\n try {\n const promoInfo = await getPromoInfoData(paramsPromoUUID);\n const hasRelatedTwinsPromo = promoInfo.relatedTwinsPromo !== undefined;\n const gameType = promoInfo.promo.type;\n\n const { isMgmShare, isMgmMission, isMgmSelf } = getMgmFlags(promoInfo?.mgmRelation);\n mergeAndDispatchState({\n flags: { isMgmShare, isMgmMission, isMgmSelf }\n });\n\n store.injectGameReducer(gameType, hasRelatedTwinsPromo, isMgmSelf);\n await setupPromoApp(promoInfo);\n mergeAndDispatchState(promoInfo);\n\n const { rest: qs, retrieved } = removeUnnecessaryQueryStr(state);\n mergeAndDispatchState({\n appState: { hasTryLiff: Boolean(retrieved.tryliff) }\n });\n\n retrieveStateFromLocalStorage(mergeAndDispatchState);\n\n const promoState = getPromoState(state, qs);\n\n mergeAndDispatchState({ promoState });\n dispatch(setInited());\n\n const { pcode = '' } = querystring.parse(window.location.search);\n // story-mention 機器人 在 IG 聊天室 發帶有 pcode 的 promo link 給 user,User 點擊 link 的次數需要被追蹤\n if (\n promoState?.enablePasscodeVerify &&\n promoInfo?.settingPromo?.enableCampaignToolPasscode &&\n pcode\n ) {\n await trackCampaignClick({ pcode });\n }\n\n await iframeModeBodyLazyInViewResolver();\n\n await validateTestCode(state, qs);\n // 取得邀請碼\n await setReferralCode(state, mergeAndDispatchState);\n\n const userLoginState = await getUserLoginState(state, gameType);\n mergeAndDispatchState({ userLoginState });\n if (userLoginState.isLogin) {\n await setGameResultRecordsAndWinnerList(state, mergeAndDispatchState);\n if (!userLoginState?.currentLoginID) {\n const loginUserInfo = await getLoginUserInfo(state?.settingPromo?.loginMethod);\n dispatch(setLoginId(loginUserInfo?.id));\n } else {\n dispatch(setLoginId(userLoginState?.currentLoginID));\n }\n if (\n state?.mgmRelation?.mgmRole === 'mgmShare' ||\n state?.mgmRelation?.mgmRole === 'mgmSelf'\n ) {\n await setGameResultRecordsAndWinnerList(state, mergeAndDispatchState, true);\n }\n\n const userEntryState = await getUserEntryState({\n state,\n dispatch,\n abortHelper,\n recaptchaToken,\n enableQualificationPasscode:\n promoInfo?.settingPromo?.enableQualificationPasscode,\n enableReCaptcha: promoInfo?.settingPromo?.enableReCaptcha\n });\n mergeAndDispatchState({ userEntryState });\n // 登入後且跑過 Entry 流程後的檢查\n await getUserLoginStateAfterEntry(state, mergeAndDispatchState);\n } else {\n mergeAndDispatchState({ userEntryState: { shouldHideUserStateLoading: true } });\n }\n\n await store.initGameReducer(gameType);\n await store.initMgmSelfReducer(isMgmSelf);\n\n dispatch(setUserStateInited());\n } catch (error) {\n if (await abortHelper.current.canContinue()) {\n handleInitError({\n error,\n dispatch,\n toNotFound,\n isTestMode: state?.promoState?.isTestMode\n });\n }\n }\n }\n useEffect(() => {\n initPromo();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n return recaptchaToken => initPromo(recaptchaToken);\n}\n\nexport default useInitPromo;\n\nexport const joinRegex = /\\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\/[0-9]+\\/join/gm;\n\nexport function handleInitError({ dispatch, error, toNotFound = () => {}, isTestMode }) {\n dispatch(setErrorOnInit());\n if (error.extraInfo?.errType === clientErrTypes.NOT_FOUND) {\n toNotFound();\n } else {\n errorActionHandler(error, { dispatch, isTestMode });\n }\n}\nexport async function setupPromoApp(state) {\n const {\n settingPromo: { language }\n } = state;\n\n setSiteTitle(state);\n setSiteFavicon(state);\n document.documentElement.setAttribute('lang', language);\n await setI18nLanguage({ lang: language });\n initTagManager(state);\n}\nexport function setSiteTitle(state) {\n const {\n settingPromo: { metaTitle },\n promo: { name }\n } = state;\n document.title = metaTitle || name;\n}\nexport function setSiteFavicon(state) {\n const {\n sponsor: { favIconUrl }\n } = state;\n const selectorFavicon = document.querySelector(\"link[rel='shortcut icon']\");\n if (selectorFavicon !== null && Boolean(favIconUrl)) {\n selectorFavicon.href = favIconUrl;\n }\n}\nfunction iframeModeBodyLazyInViewResolver() {\n return new Promise(res => {\n if (IS_IFRAME_MODE && window.IntersectionObserver) {\n const observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.target === document.body && entry.isIntersecting) {\n observer.unobserve(document.body);\n res(true);\n }\n });\n });\n\n observer.observe(document.body);\n } else {\n res(true);\n }\n });\n}\nfunction isNotValidPromoUUID(promoUUID) {\n return /^\\d+$/.test(promoUUID);\n}\nexport function retrieveStateFromLocalStorage(mergeAndDispatchState) {\n //確認是不是第一次通過loginsever\n const isFirstPassLoginSever = getLocalStorage({ key: 'isfirstPassLoginSever' });\n deleteLocalStorage({ key: 'isfirstPassLoginSever' });\n\n mergeAndDispatchState({\n promoState: { isfirstPassLoginSever: Boolean(isFirstPassLoginSever) }\n });\n}\n\nexport async function setReferralCode(state, mergeAndDispatchState) {\n // 檢查邀請碼並存入 promoState\n const {\n promo: { uuid: promoUuid },\n flags: { isMgmMission, isMgmSelf },\n promoState: { utmFromParent: { utm_content: parentReferralCodeByUrl = '' } = {} } = {}\n } = state;\n\n if (!isMgmMission && !isMgmSelf) return;\n\n const { utm_content: promoReferralCodeByUrl = '' } = querystring.parse(window.location.search);\n const referralCodeByUrl = parentReferralCodeByUrl || promoReferralCodeByUrl;\n const referralCodeByCookie = Cookies.get('ref_code');\n\n let isUrlCodeValid = false;\n if (Boolean(referralCodeByUrl)) {\n try {\n const resp = await checkReferralCodeApi({\n promoUuid,\n referralCode: referralCodeByUrl\n });\n if (resp.httpStatus === 200) {\n isUrlCodeValid = true;\n Cookies.set('ref_code', referralCodeByUrl);\n mergeAndDispatchState({\n promoState: {\n referralCode: referralCodeByUrl\n }\n });\n } else {\n mergeAndDispatchState({\n promoState: {\n referralCode: ''\n }\n });\n }\n } catch (err) {\n mergeAndDispatchState({\n promoState: {\n referralCode: ''\n }\n });\n }\n }\n\n if (!isUrlCodeValid && Boolean(referralCodeByCookie)) {\n // URL 檢查不通過且 Cookie 有設定過\n try {\n const resp = await checkReferralCodeApi({\n promoUuid,\n referralCode: referralCodeByCookie\n });\n if (resp.httpStatus === 200) {\n Cookies.set('ref_code', referralCodeByCookie);\n mergeAndDispatchState({\n promoState: {\n referralCode: referralCodeByCookie\n }\n });\n } else {\n Cookies.remove('ref_code');\n mergeAndDispatchState({\n promoState: {\n referralCode: ''\n }\n });\n }\n } catch (err) {\n Cookies.remove('ref_code');\n mergeAndDispatchState({\n promoState: {\n referralCode: ''\n }\n });\n }\n }\n}\n","import { gameRunningStatuses } from 'config/gameRunningStatuses';\nimport getLoginUserNonQualifyTypeAfterEntry from '../getLoginUserNonQualifyTypeAfterEntry';\nimport { size } from 'lodash';\n\nexport default async function getUserLoginStateAfterEntry(state, mergeAndDispatchState) {\n const {\n userLoginState: { isLogin, notQualifiedType, notQualifiedErrInfo },\n promoState: {\n gameRunningStatus,\n periodPlayMatchedInfo: { matchedInfo: { match: isInPlayTimePeriod } = {} } = {}\n }\n } = state;\n\n const isPromoPlayableOnTime =\n gameRunningStatus === gameRunningStatuses.RUNNING && isInPlayTimePeriod;\n const resp =\n isLogin && isPromoPlayableOnTime ? await getLoginUserNonQualifyTypeAfterEntry(state) : {};\n\n mergeAndDispatchState(!notQualifiedType && !Boolean(size(notQualifiedErrInfo)) ? resp : {});\n}\n","import { gameRunningStatuses } from 'config/gameRunningStatuses';\nimport {\n getUserGameEntry,\n getUserLatestEntry,\n checkShouldGetNextEntry,\n overwriteEntryAction,\n getEntryQualificationInfo\n} from 'client/hooks/useInitPromo/userEntryState/getUserEntry';\n\nexport default async function getUserEntryState({\n state,\n dispatch,\n abortHelper,\n recaptchaToken,\n enableQualificationPasscode,\n enableReCaptcha\n}) {\n const {\n promoState: {\n periodPlayMatchedInfo: { matchedInfo: { match: isInPlayTimePeriod } = {} } = {},\n gameRunningStatus\n }\n } = state;\n const isPromoPlayableOnTime =\n gameRunningStatus === gameRunningStatuses.RUNNING && isInPlayTimePeriod;\n async function canContinueFlow() {\n return isPromoPlayableOnTime && (await abortHelper.current.canContinue());\n }\n\n let latestEntry = await getUserLatestEntry({ state });\n if (await canContinueFlow()) {\n const shouldGetNextEntry = checkShouldGetNextEntry({\n state,\n latestEntry\n });\n\n // 啟用 reCaptcha 時,若有啟用通關序號,reCaptcha 會在通關序號時驗證,反之,會在 create entry 驗證\n const isReCaptchaPass =\n (Boolean(enableReCaptcha) && !enableQualificationPasscode && Boolean(recaptchaToken)) ||\n (Boolean(enableReCaptcha) && Boolean(enableQualificationPasscode)) ||\n !enableReCaptcha;\n\n // 需要產生新的 entry\n if (shouldGetNextEntry) {\n if (isReCaptchaPass) {\n const {\n entry: gameEntry,\n createEntryNotQualifiedType = '',\n hasPromoSuspended: hasPromoSuspendedWhenGetEntries\n } = await getUserGameEntry({\n dispatch,\n state,\n latestEntry,\n recaptchaToken\n });\n const { entryId, entryUuid = '', ...restEntryProps } = gameEntry;\n return {\n ...restEntryProps,\n ...(hasPromoSuspendedWhenGetEntries\n ? {}\n : await getEntryQualificationInfo({\n state,\n entry: gameEntry\n })),\n createEntryNotQualifiedType,\n currentEntryId: entryId,\n currentEntryUUID: entryUuid,\n shouldGetNextEntry: false\n };\n } else return { shouldGetNextEntry: true };\n } else {\n // 新的 entry 已建立,但還沒結束這ㄧ回合\n const { entryId, entryUuid = '', ...restEntryProps } = latestEntry;\n return {\n ...restEntryProps,\n ...(await getEntryQualificationInfo({\n state,\n entry: latestEntry\n })),\n currentEntryId: entryId,\n currentEntryUUID: entryUuid\n };\n }\n } else {\n // 當有 game result 且略過填表時,活動不可玩時,略過填表和配獎\n const { entryId, entryUuid = '', ...restEntryProps } = overwriteEntryAction(latestEntry);\n return {\n ...restEntryProps,\n currentEntryId: entryId,\n currentEntryUUID: entryUuid\n };\n }\n}\n","import { loginTypes } from 'config/loginTypes';\nimport { notQualifiedTypes } from 'config/notQualifiedTypes';\nimport { verifyKKboxMemberQualify, verifyLineFriend, verityMemberQualification } from 'api/client';\nimport {\n isErrOfCyberbizEcLimit,\n isErrOfApiNameListLimit,\n isErrOfEnterpriseBindLine,\n isErrOfNewRegisterMemberLimit,\n isErrOfMemberTier\n} from 'client/utils/errorObjectChecker';\n\n// 透過 promo setting 判斷是否需要進行登入者資格檢查\nexport default async function getLoginUserNonQualifyType(state) {\n const {\n promo: { uuid: promoUUID },\n settingPromo: {\n loginMethod,\n // ageLimitMax,\n // ageLimitMin,\n // birthdayLimit,\n friendLimit,\n enableQualificationMemberCyberbiz,\n enableQualificationRestrictedList,\n enableQualificationRegistrationDate,\n enableQualificationMemberTier,\n qualificationMemberAccountLinkPlatform\n },\n partner: { thirdPartyQualificationMemberLevelPlatform = '' }\n // userGameResultRecords = []\n } = state;\n\n // const facebookVerify =\n // loginMethod === loginTypes.FACEBOOKLOGIN && (ageLimitMax || ageLimitMin || birthdayLimit);\n const shouldCheckLineFriend = loginMethod === loginTypes.LINELOGIN && friendLimit === 1;\n if (shouldCheckLineFriend) {\n const { payload: isFriendShip } = await verifyLineFriend(promoUUID);\n if (!isFriendShip) {\n return { notQualifiedType: notQualifiedTypes.LINE.FRIEND };\n }\n }\n\n const shouldCheckIsCyberbizECMember =\n loginMethod === loginTypes.ENTERPRISELOGIN && Boolean(enableQualificationMemberCyberbiz);\n const shouldCheckApiNameListLimit =\n loginMethod === loginTypes.ENTERPRISELOGIN && Boolean(enableQualificationRestrictedList);\n const shouldCheckEnterpriseBindLine =\n loginMethod === loginTypes.LINELOGIN && Boolean(qualificationMemberAccountLinkPlatform);\n const shouldCheckApiNewRegisterMemberLimit = Boolean(enableQualificationRegistrationDate);\n const shouldCheckIsNeedVerifyMemberQualification =\n (loginMethod === loginTypes.ENTERPRISELOGIN || loginMethod === loginTypes.LINELOGIN) &&\n Boolean(enableQualificationMemberTier) &&\n thirdPartyQualificationMemberLevelPlatform !== 'kkbox';\n\n if (\n [\n shouldCheckIsCyberbizECMember,\n shouldCheckApiNameListLimit,\n shouldCheckEnterpriseBindLine,\n shouldCheckApiNewRegisterMemberLimit,\n shouldCheckIsNeedVerifyMemberQualification\n ].some(e => e)\n ) {\n const resp = await verityMemberQualification(promoUUID);\n\n const { notQualifiedType, notQualifiedErrInfo } = getNotQualifiedType(resp);\n if (notQualifiedType) {\n return { notQualifiedType, notQualifiedErrInfo };\n }\n }\n\n const shouldCheckKKBoxMember =\n loginMethod === loginTypes.ENTERPRISELOGIN &&\n Boolean(thirdPartyQualificationMemberLevelPlatform) &&\n thirdPartyQualificationMemberLevelPlatform === 'kkbox';\n\n if (shouldCheckKKBoxMember) {\n const { httpStatus } = await verifyKKboxMemberQualify(promoUUID);\n if (httpStatus === 402 || httpStatus === 400 || httpStatus === 404) {\n return {\n notQualifiedType: notQualifiedTypes.ENTERPRISE.MEMBER_KKBOX\n };\n }\n }\n\n return { notQualifiedType: '' };\n}\n\nconst checkMemberQualifyList = [\n { checker: isErrOfCyberbizEcLimit, type: notQualifiedTypes.ENTERPRISE.CYBERBIZ_EC_MEMBER },\n { checker: isErrOfApiNameListLimit, type: notQualifiedTypes.QUALIFICATION.NAME_LIST_API },\n {\n checker: isErrOfEnterpriseBindLine,\n errInfoRetrieve: resp => ({\n redirectUrl: resp.payload?.data?.redirectUrl || null\n }),\n type: notQualifiedTypes.LINE.ENTERPRISE_MEMBER_BIND\n },\n {\n checker: isErrOfNewRegisterMemberLimit,\n type: notQualifiedTypes.QUALIFICATION.NEW_REGISTER_MEMBER\n },\n {\n checker: isErrOfMemberTier,\n type: notQualifiedTypes.QUALIFICATION.MEMBER_TIER\n }\n];\n\n// 拿 verifyMemberQualification 的 response 判斷不符合資格的類型\nfunction getNotQualifiedType(resp) {\n let notQualifiedType = '';\n let notQualifiedErrInfo = {};\n for (const { checker, type, errInfoRetrieve } of checkMemberQualifyList) {\n if (checker(resp)) {\n notQualifiedType = type;\n if (typeof errInfoRetrieve === 'function') {\n notQualifiedErrInfo = errInfoRetrieve(resp);\n }\n break;\n }\n }\n return { notQualifiedType, notQualifiedErrInfo };\n}\n","import loginUser from 'client/hooks/useInitPromo/userLoginState/loginUser';\nimport getLoginUserNonQualifyType from 'client/hooks/useInitPromo/userLoginState/getLoginUserNonQualifyType';\nimport { gameTypes } from 'config/promoGameTypes';\nimport { gameRunningStatuses } from 'config/gameRunningStatuses';\n\n// 未發佈、未開始都不做登入\nconst omitLoginGameStatuses = new Set([\n gameRunningStatuses.NOT_PUBLISH,\n gameRunningStatuses.BEFORE\n]);\n\nexport default async function getUserLoginState(state, gameType) {\n const {\n settingPromo: { loginMethod },\n sponsor,\n partner,\n promoState: {\n gameRunningStatus,\n periodPlayMatchedInfo: { matchedInfo: { match: isInPlayTimePeriod } = {} } = {}\n }\n } = state;\n const noNeedLogin =\n omitLoginGameStatuses.has(gameRunningStatus) || gameType === gameTypes.CONTEST_ADMIN_UPLOAD;\n\n const isLogin = noNeedLogin\n ? false\n : await loginUser(loginMethod, {\n partner,\n sponsor\n });\n\n const isPromoPlayableOnTime =\n gameRunningStatus === gameRunningStatuses.RUNNING && isInPlayTimePeriod;\n const { notQualifiedType = '', notQualifiedErrInfo = {} } =\n isLogin && isPromoPlayableOnTime ? await getLoginUserNonQualifyType(state) : {};\n\n return { isLogin, notQualifiedType, notQualifiedErrInfo };\n}\n","import { loginTypes, loginTypesForApi } from 'config/loginTypes';\nimport tokenManager from 'client/utils/tokenManager';\nimport { retrieveLineConfig } from 'utils/manipulatePartnerSponsor';\nimport { generateApiErrObj } from 'client/hooks/useClientErrorHandler';\n\nexport default async function loginUser(loginMethod, { partner, sponsor }) {\n // 需要先 init login type 以使用對應的方法 get token\n initTokenLoginType(loginMethod, { partner, sponsor });\n\n let { token: accessToken, errorResp } = await tokenManager.getAccessToken();\n\n // 如果沒有 access_token 並且是不登入活動,嘗試 init login token 後再重新取得 access token\n if (loginMethod === loginTypes.ANONYMOUSLOGIN) {\n if (errorResp) {\n await tokenManager.generateLoginToken();\n ({ token: accessToken, errorResp } = await tokenManager.getAccessToken());\n if (errorResp) {\n throw generateApiErrObj(errorResp);\n }\n }\n }\n\n const isLogin = Boolean(accessToken);\n return isLogin;\n}\n\nfunction initTokenLoginType(loginMethod, { partner, sponsor }) {\n const loginCredential = retrieveCredentialByLoginType({\n loginType: loginMethod,\n partner,\n sponsor\n });\n tokenManager.init(loginCredential);\n}\n\nfunction retrieveCredentialByLoginType({ loginType, partner, sponsor }) {\n switch (loginType) {\n case loginTypes.ANONYMOUSLOGIN:\n return { login_type: loginTypesForApi.ANONYMOUS };\n case loginTypes.FACEBOOKLOGIN:\n return {\n login_type: loginTypesForApi.FACEBOOK,\n app_id: sponsor.facebookLoginAppId || partner.facebookLoginAppId\n };\n case loginTypes.LINELOGIN:\n return {\n login_type: loginTypesForApi.LINE,\n app_id: retrieveLineConfig({ partner, sponsor }).lineLoginAppId\n };\n case loginTypes.ENTERPRISELOGIN:\n case loginTypes.DEPRECATED_CODE_VALIDATION_LOGIN:\n const app_id =\n partner['91appLoginAppId'] ||\n sponsor.enterpriseLoginAppId ||\n sponsor.enterpriseLiteLoginAppId ||\n sponsor.enterpriseCodeValidationLoginAppId ||\n partner.enterpriseLoginAppId ||\n partner.enterpriseLiteLoginAppId ||\n partner.enterpriseCodeValidationLoginAppId;\n return { login_type: loginTypesForApi.ENTERPRISE, app_id };\n case loginTypes.INSTAGRAM:\n return { login_type: loginTypesForApi.INSTAGRAM };\n default:\n return {};\n }\n}\n","import { useSelector } from 'react-redux';\n\nexport default function useIsInitSuccessInfo() {\n const { hasInited, hasUserStateInited, hasErrorOnInit } = useSelector(s => s.flags);\n const success = hasInited && hasUserStateInited && !hasErrorOnInit;\n return success;\n}\n","import { useState, useEffect } from 'react';\nimport { useSelector, useDispatch } from 'react-redux';\nimport _orderBy from 'lodash/orderBy';\n\nimport { getPrizeListApi } from 'api/client';\nimport { prizeTypes } from 'config/promoPrizeTypes';\nimport { setUserWinnerPrize } from 'client/redux/modules/userWinnerPrize';\nimport { setMGMReferral } from 'client/redux/modules/mgmReferral';\n\nimport useIsInitSuccessInfo from 'client/hooks/useIsInitSuccessInfo';\nimport useClientErrorHandler from 'client/hooks/useClientErrorHandler';\n\nexport default function useUpdateWinnerData() {\n const dispatch = useDispatch();\n const errHandler = useClientErrorHandler();\n const isInitSuccess = useIsInitSuccessInfo();\n const { uuid: promoUUID } = useSelector(s => s.promo);\n const { isLogin } = useSelector(s => s.userLoginState);\n const { hasUserWinnerPrizeListReady, isMgmShare, isMgmSelf } = useSelector(s => s.flags);\n const { mgmReferral: { uuid: mgmPromoUUID } = {} } = useSelector(s => s.mgmRelation);\n const [isFetching, setIsFetching] = useState(true);\n\n useEffect(() => {\n async function get() {\n try {\n if (!hasUserWinnerPrizeListReady) {\n await getPrizeList();\n }\n } catch (err) {\n errHandler({ err });\n } finally {\n setIsFetching(false);\n }\n }\n if (isInitSuccess && isLogin) {\n get();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isInitSuccess, isLogin, hasUserWinnerPrizeListReady]);\n\n async function getPrizeList() {\n const winnerLists = await getUserWinnerList(promoUUID);\n dispatch(setUserWinnerPrize(winnerLists));\n if (isMgmShare || isMgmSelf) {\n const winnerLists = await getUserWinnerList(mgmPromoUUID);\n dispatch(setMGMReferral({ userWinnerPrize: winnerLists }));\n }\n }\n\n return { isFetching };\n}\n\nexport async function getUserWinnerList(promoUUID) {\n const {\n payload: { winners = [], winnerQualify = [] }\n } = await getPrizeListApi(promoUUID);\n const { winnerPrizes, thankPrizes } = splitThanksPrize(sortPrize(winners));\n return {\n winnerPrizes,\n thankPrizes,\n unOpenWinnerPrize: winnerQualify\n };\n}\nfunction sortPrize(prizes = []) {\n return _orderBy(prizes, ['entryId'], ['desc']);\n}\nfunction splitThanksPrize(winners = []) {\n return winners.reduce(\n (obj, winner) => {\n if (winner.prize.type === prizeTypes.THANKYOU) {\n obj.thankPrizes.push(winner);\n } else {\n obj.winnerPrizes.push(winner);\n }\n return obj;\n },\n { winnerPrizes: [], thankPrizes: [] }\n );\n}\n","const defaultState = {\n isSmallScreenApp: false,\n hasTryLiff: false,\n isZinesEmbedded: false,\n isWidgetEmbedded: false\n};\n\nconst UPDATE_APP_STATE = 'appState/UPDATE_APP_STATE';\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_APP_STATE:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function setIsSmallScreenApp(status) {\n return {\n type: UPDATE_APP_STATE,\n payload: { isSmallScreenApp: status }\n };\n}\n\nexport function setIsZinesEmbedded() {\n return {\n type: UPDATE_APP_STATE,\n payload: { isZinesEmbedded: true }\n };\n}\n\n// 偵測 promo 是否被放在 onsite message 的 widget iframe 中\nexport function setIsWidgetEmbedded() {\n return {\n type: UPDATE_APP_STATE,\n payload: { isWidgetEmbedded: true }\n };\n}\n","import { UPDATE_USER_WINNER_PRIZE } from 'client/redux/modules/userWinnerPrize';\n\nconst UPDATE_FLAGS = 'flags/UPDATE_FLAGS';\nconst UPDATE_PARTICIPANT_PRIZE_POPUP = 'flags/UPDATE_PARTICIPANT_PRIZE_POPUP';\n\nexport const PICK_PRIZE_CUSTOM_PRIZE_UUID = 'PICK_PRIZE_CUSTOM_PRIZE_UUID';\n\nconst defaultState = {\n hasInited: false,\n hasErrorOnInit: false,\n hasUserStateInited: false,\n // true: 已經拿到最新的 winner 資料,不用打API更新已配獎獎項名單\n hasUserWinnerPrizeListReady: true,\n isPrizeListOpen: false,\n // 領獎 Popup 資料,prizeUUID 用來打 API 拿到 prize info,entryUUID 用來當作跳轉到 Prize 頁的網址參數\n participantPrizePopup: {\n isNoGetPrize: false,\n entryUUID: '',\n prizeUUID: ''\n },\n // 若當純獎模組被當成獎項,配獎時前往 Lottery 頁面時,animatingLotteries會被賦予值去記錄現在正在執行什麼動畫\n animatingLotteries: {\n type: '',\n uuid: '',\n animationSettings: {}\n },\n // 是否為再次參加\n isReJoin: false,\n isMgmShare: false,\n isMgmMission: false,\n isMgmSelf: false\n};\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_USER_WINNER_PRIZE: {\n return { ...state, hasUserWinnerPrizeListReady: true };\n }\n case UPDATE_PARTICIPANT_PRIZE_POPUP: {\n return {\n ...state,\n participantPrizePopup: { ...state.participantPrizePopup, ...action.payload }\n };\n }\n case UPDATE_FLAGS:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n\n// 需要更新 Winner 名單,整理哪些 Prize 已經開獎 (userWinnerPrize.winnerPrize),哪些尚未開獎 (userWinnerPrize.unOpenWinnerPrize)\nexport function setShouldUpdateUserWinnerList() {\n return {\n type: UPDATE_FLAGS,\n payload: {\n hasUserWinnerPrizeListReady: false\n }\n };\n}\n\n// 跳出恭喜領獎成功的 Popup 會用到 (Ex: 簽到成功)\nexport function setParticipantWinnerPopup({\n prizeUUID = '',\n entryUUID = '',\n isNoGetPrize = false\n} = {}) {\n return {\n type: UPDATE_PARTICIPANT_PRIZE_POPUP,\n payload: {\n prizeUUID,\n entryUUID,\n isNoGetPrize: isNoGetPrize\n }\n };\n}\n\nexport function clearParticipantWinnerPopup() {\n return {\n type: UPDATE_PARTICIPANT_PRIZE_POPUP,\n payload: {\n prizeUUID: '',\n entryUUID: '',\n isNoGetPrize: false\n }\n };\n}\n\nexport function setAnimatingLotteries(animatingLotteries) {\n return {\n type: UPDATE_FLAGS,\n payload: {\n animatingLotteries\n }\n };\n}\n\nexport function setInited() {\n return {\n type: UPDATE_FLAGS,\n payload: { hasInited: true }\n };\n}\n\nexport function setUserStateInited() {\n return {\n type: UPDATE_FLAGS,\n payload: { hasUserStateInited: true }\n };\n}\n\nexport function setErrorOnInit() {\n return {\n type: UPDATE_FLAGS,\n payload: { hasErrorOnInit: true }\n };\n}\n\nexport function togglePrizeList(status) {\n return {\n type: UPDATE_FLAGS,\n payload: { isPrizeListOpen: status }\n };\n}\n\nexport function setReJoin(status) {\n return {\n type: UPDATE_FLAGS,\n payload: { isReJoin: status }\n };\n}\n","import _cloneDeep from 'lodash/cloneDeep';\n\nimport { getPromoLotteries, getRemainPrizeAPI } from 'api/client';\nimport { UPDATE_TASK_PRIZE } from 'client/redux/modules/lotteryTasks';\nimport { lotteryRestShowTypes } from 'config/promoLotteryTypes';\nimport { setMGMReferral } from 'client/redux/modules/mgmReferral';\nconst UPDATE_PARTICIPANT = 'UPDATE_PARTICIPANT';\n\nconst reducer = (state = {}, action) => {\n switch (action.type) {\n case UPDATE_PARTICIPANT:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function updateParticipantRemainderFromApi() {\n return async (dispatch, getState) => {\n const {\n promo: { uuid: promoUUID },\n lotteryParticipant: { uuid: lotteryUUID, showRest, prizeLimited },\n flags: { isMgmShare, isMgmSelf },\n mgmReferral: {\n lotteryParticipant: { uuid: mgmLotteryUUID, mgmShowRest, mgmPrizeLimited } = {}\n },\n mgmRelation: { mgmMission: { uuid: mgmPromoUUID } = {} }\n } = getState();\n const currentLotteryUUID = Boolean(isMgmShare || isMgmSelf) ? mgmLotteryUUID : lotteryUUID;\n const currentShowRest = Boolean(isMgmShare || isMgmSelf) ? mgmShowRest : showRest;\n const currentPrizeLimited = Boolean(isMgmShare || isMgmSelf)\n ? mgmPrizeLimited\n : prizeLimited;\n const currentPromoUUID = Boolean(isMgmShare || isMgmSelf) ? mgmPromoUUID : promoUUID;\n if (\n Boolean(currentLotteryUUID) &&\n currentShowRest === lotteryRestShowTypes.SHOW_REMAIN_AMOUNT &&\n currentPrizeLimited\n ) {\n const {\n payload: { quantity: remainder }\n } = await getRemainPrizeAPI(currentPromoUUID, currentLotteryUUID);\n dispatch(updateParticipantRemainder(remainder));\n }\n };\n}\n\nexport function updateParticipantRemainder(remainder = 0) {\n return {\n type: UPDATE_PARTICIPANT,\n payload: {\n remainder\n }\n };\n}\n\n// 更新所有獎品剩餘數量 (只有用在好禮自由選 結束領取 或 一鍵全領 時)\nexport function updateAllLotteryRemainder(isUseNormalEntry = true) {\n return async (dispatch, getState) => {\n try {\n const {\n lotteryParticipant: { uuid: lotteryParticipantUUID },\n lotteryTasks,\n promo: { uuid: promoUUID },\n flags: { isMgmShare, isMgmSelf },\n mgmRelation: { mgmReferral: { uuid: mgmPromoUUID } = {} },\n mgmReferral: {\n lotteryParticipant: { uuid: mgmLotteryUUID } = {},\n lotteryTasks: mgmLotteryTasks = {}\n }\n } = getState();\n const currentLotteryUUID =\n Boolean(isMgmShare) || (Boolean(isMgmSelf) && !isUseNormalEntry)\n ? mgmLotteryUUID\n : lotteryParticipantUUID;\n const currentLotteryTasks =\n Boolean(isMgmShare) || (Boolean(isMgmSelf) && !isUseNormalEntry)\n ? mgmLotteryTasks\n : lotteryTasks;\n const currentPromoUUID =\n Boolean(isMgmShare) || (Boolean(isMgmSelf) && !isUseNormalEntry)\n ? mgmPromoUUID\n : promoUUID;\n const { payload } = await getPromoLotteries(currentPromoUUID);\n const lotteryParticipant = payload.find(\n ({ lottery: { uuid } }) => uuid === currentLotteryUUID\n );\n\n if (lotteryParticipant) {\n const { prizeRemainder: remainder } = lotteryParticipant;\n dispatch({\n type: UPDATE_PARTICIPANT,\n payload: {\n remainder\n }\n });\n }\n\n const lotteryTasksRespond = payload.filter(({ lotterySetting: { Tasks } }) =>\n Boolean(Tasks)\n );\n const lotteryTasksCloned = _cloneDeep(currentLotteryTasks);\n lotteryTasksRespond.forEach(({ lottery: { uuid }, prizeRemainder }) => {\n if (lotteryTasksCloned[uuid]) {\n lotteryTasksCloned[uuid].remainder = prizeRemainder;\n }\n });\n\n if (isUseNormalEntry) {\n dispatch({\n type: UPDATE_TASK_PRIZE,\n payload: lotteryTasksCloned\n });\n } else {\n dispatch(\n setMGMReferral({\n lotteryTasks: lotteryTasksCloned\n })\n );\n }\n } catch (err) {\n console.log(err);\n return;\n }\n };\n}\n","import { getLotteryPrizes } from 'api/client';\n\nconst UPDATE_LOTTERY_PRIZE = 'lotteryPrizes/UPDATE_LOTTERY_PRIZE';\n\nconst reducer = (state = {}, action) => {\n switch (action.type) {\n case UPDATE_LOTTERY_PRIZE:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function setLotteryPrize(payload) {\n return {\n type: UPDATE_LOTTERY_PRIZE,\n payload\n };\n}\n\nexport function lazyGetLotteryPrizeList({ lotteryUUID }) {\n return async (dispatch, getState) => {\n const {\n promo: { uuid: promoUUID },\n lotteryPrizes\n } = getState();\n\n if (Array.isArray(lotteryPrizes[lotteryUUID])) {\n return lotteryPrizes[lotteryUUID];\n } else {\n const { payload: prizes } = await getLotteryPrizes(promoUUID, lotteryUUID);\n dispatch(setLotteryPrize({ [lotteryUUID]: prizes }));\n\n return prizes;\n }\n };\n}\n","export const UPDATE_TASK_PRIZE = 'UPDATE_TASK_PRIZE';\n\nconst reducer = (state = {}, action) => {\n switch (action.type) {\n case UPDATE_TASK_PRIZE:\n return { ...state, ...action.payload };\n\n default:\n return state;\n }\n};\n\nexport default reducer;\n","import { getLotteryPrizes } from 'api/client';\nimport { getCurrentUtcDTStr } from 'utils/dateTime';\nimport { getEntriesListApi } from 'api/client';\nimport _orderBy from 'lodash/orderBy';\nexport const UPDATE_MGM_REFERRAL = 'UPDATE_MGM_REFERRAL';\nexport const UPDATE_MGM_REFERRAL_LOTTERY_PRIZES = 'UPDATE_MGM_REFERRAL_LOTTERY_PRIZES';\n\nconst initialState = {\n userWinnerPrize: {\n winnerPrizes: [],\n thankPrizes: [],\n unOpenWinnerPrize: []\n },\n userGameResultRecords: [],\n lotteryAdmin: false,\n lotteryInstant: {},\n lotteryParticipant: {},\n lotteryTasks: {},\n lotteryPrizes: {}\n};\n\nconst reducer = (state = initialState, action = {}) => {\n switch (action.type) {\n case UPDATE_MGM_REFERRAL:\n return { ...state, ...action.payload };\n case UPDATE_MGM_REFERRAL_LOTTERY_PRIZES:\n return {\n ...state,\n ...{ lotteryPrizes: { ...state.lotteryPrizes, ...action.payload } }\n };\n default:\n return state;\n }\n};\n\nexport function setMGMReferral(payload) {\n return {\n type: UPDATE_MGM_REFERRAL,\n payload\n };\n}\nexport function setMGMReferralLotteryPrizes(payload) {\n return {\n type: UPDATE_MGM_REFERRAL_LOTTERY_PRIZES,\n payload\n };\n}\n\nexport default reducer;\n\nexport function lazyGetMGMtLotteryPrizeList({ lotteryUUID }) {\n return async (dispatch, getState) => {\n const {\n mgmReferral: { lotteryPrizes } = {},\n mgmRelation: { mgmReferral: { uuid: mgmPromoUUID } } = {}\n } = getState();\n\n if (Array.isArray(lotteryPrizes[lotteryUUID])) {\n return lotteryPrizes[lotteryUUID];\n } else {\n const { payload: prizes } = await getLotteryPrizes(mgmPromoUUID, lotteryUUID);\n dispatch(\n setMGMReferralLotteryPrizes({\n [lotteryUUID]: prizes\n })\n );\n\n return prizes;\n }\n };\n}\n\nexport const entryFlowKeys = {\n SIGN_UP_FORM: 'formSignUp',\n LOTTERY_PARTICIPANT: 'lotteryParticipant'\n};\nexport function updateFlowOfMGMEntryRecord({ entryUUID, key }) {\n return (dispatch, getState) => {\n const {\n mgmReferral: { userGameResultRecords = [] }\n } = getState();\n dispatch(\n setMGMReferral({\n userGameResultRecords: userGameResultRecords.map(r =>\n r.uuid === entryUUID\n ? { ...r, flow: { ...r.flow, [key]: getCurrentUtcDTStr() } }\n : r\n )\n })\n );\n };\n}\n\nexport function updateMGMGameResultRecords() {\n return async (dispatch, getState) => {\n const { mgmRelation: { mgmReferral: { uuid: mgmPromoUUID } } = {} } = getState();\n const {\n payload: { items: entries = [] }\n } = await getEntriesListApi(mgmPromoUUID);\n\n dispatch(\n setMGMReferral({\n userGameResultRecords: _orderBy(entries, ['id'])\n })\n );\n return entries;\n };\n}\n","import { updateReduxObjKeyHandleDelete } from 'utils/objectManipulate';\n\nexport const UPDATE_SETTING_STYLE = 'UPDATE_SETTING_STYLE';\nexport const REPLACE_SETTING_STYLE = 'REPLACE_SETTING_STYLE';\n\nconst reducer = (state = {}, action) => {\n switch (action.type) {\n case REPLACE_SETTING_STYLE:\n return action.payload;\n case UPDATE_SETTING_STYLE: {\n return updateReduxObjKeyHandleDelete(state, action.payload, action.updateAction);\n }\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function updateSettingStyle(payload) {\n return {\n type: UPDATE_SETTING_STYLE,\n payload\n };\n}\n","import shortid from 'shortid';\n\nconst SET_MEDIA_MAPPING = `@ugcMediaOfMember/SET_MEDIA_MAPPING`;\n\nconst defaultState = {\n entryIdsMapMediaList: {},\n mediaListByMapId: {}\n};\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case SET_MEDIA_MAPPING: {\n const medias = action.payload ?? [];\n const memberHash = shortid.generate();\n const entryIdsMapMediaList = medias.reduce((obj, { serialNo }) => {\n obj[serialNo] = memberHash;\n return obj;\n }, {});\n return {\n ...state,\n entryIdsMapMediaList: { ...state.entryIdsMapMediaList, ...entryIdsMapMediaList },\n mediaListByMapId: { ...state.mediaListByMapId, [memberHash]: medias }\n };\n }\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function setMediaMapping(medias) {\n return {\n type: SET_MEDIA_MAPPING,\n payload: medias\n };\n}\n","import _orderBy from 'lodash/orderBy';\nimport { getEntriesListApi } from 'api/client';\nimport { getCurrentUtcDTStr } from 'utils/dateTime';\n\nconst defaultState = [];\n\nconst UPDATE_RECORD_STATE = 'userGameResultRecords/UPDATE_RECORD_STATE';\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_RECORD_STATE:\n return action.payload;\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function updateGameResultRecords() {\n return async (dispatch, getState) => {\n const {\n promo: { uuid: promoUUID }\n } = getState();\n const {\n payload: { items: entries = [] }\n } = await getEntriesListApi(promoUUID);\n\n dispatch({\n type: UPDATE_RECORD_STATE,\n payload: _orderBy(entries, ['id'])\n });\n return entries;\n };\n}\n\nexport const entryFlowKeys = {\n SIGN_UP_FORM: 'formSignUp',\n LOTTERY_PARTICIPANT: 'lotteryParticipant',\n LOTTERY_INSTANT: 'lotteryInstant'\n};\nexport function updateFlowOfEntryRecord({ entryUUID, key }) {\n return (dispatch, getState) => {\n const { userGameResultRecords = [] } = getState();\n dispatch({\n type: UPDATE_RECORD_STATE,\n payload: userGameResultRecords.map(r =>\n r.uuid === entryUUID\n ? { ...r, flow: { ...r.flow, [key]: getCurrentUtcDTStr() } }\n : r\n )\n });\n };\n}\n","const defaultState = {\n winnerPrizes: [],\n thankPrizes: [],\n unOpenWinnerPrize: []\n};\n\nexport const UPDATE_USER_WINNER_PRIZE = 'userWinnerPrize/UPDATE_USER_WINNER_PRIZE';\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_USER_WINNER_PRIZE:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function setUserWinnerPrize({ winnerPrizes, thankPrizes, unOpenWinnerPrize }) {\n return {\n type: UPDATE_USER_WINNER_PRIZE,\n payload: {\n winnerPrizes,\n thankPrizes,\n unOpenWinnerPrize\n }\n };\n}\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const defaultState = {\n allUUIDs: [],\n byUUIDs: {},\n settingsByUUIDS: {},\n optionsByUUIDS: {}\n};\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const defaultState = {\n pages: [],\n sections: [],\n fields: [],\n options: [],\n settings: {}\n};\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","import { updateReduxObjKeyHandleDelete } from 'utils/objectManipulate';\nexport const UPDATE_SETTING_MGM_REFERRAL = 'UPDATE_SETTING_MGM_REFERRAL';\n\nconst reducer = (state = {}, action) => {\n switch (action.type) {\n case UPDATE_SETTING_MGM_REFERRAL: {\n return updateReduxObjKeyHandleDelete(state, action.payload, action.updateAction);\n }\n default:\n return state;\n }\n};\n\nexport function updateSettingMGMReferral(payload) {\n return {\n type: UPDATE_SETTING_MGM_REFERRAL,\n payload\n };\n}\n\nexport default reducer;\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const reducer = (state = false, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const UPDATE_INSTANT = 'UPDATE_INSTANT';\n\nconst reducer = (state = {}, action) => {\n switch (action.type) {\n case UPDATE_INSTANT:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","const defaultState = {\n pointPoolInfos: {}\n};\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","export const UPDATE_MGM_RELATION = 'UPDATE_MGM_RELATION';\n\nconst initialState = {};\n\nconst reducer = (state = initialState, action = {}) => {\n switch (action.type) {\n case UPDATE_MGM_RELATION:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n","import { IS_UGC_FLOW } from 'config/envVariable';\n\nimport promo from './modules/promo';\nimport promoTasks from './modules/promoTasks';\nimport gameFormBased from './modules/gameFormBased';\nimport settingPromo from './modules/settingPromo';\nimport settingPointSystems from './modules/settingPointSystems';\nimport settingStyle from './modules/settingStyle';\nimport settingGame from './modules/settingGame';\nimport settingTheme from './modules/settingTheme';\nimport settingGameStyle from './modules/settingGameStyle';\nimport settingEntryValue from './modules/settingEntryValue';\nimport settingMGMReferral from './modules/settingMGMReferral';\nimport settingPlan from './modules/settingPlan';\nimport signUpForm from './modules/signUpForm';\nimport zines from './modules/zines';\nimport lotteryAdmin from './modules/lotteryAdmin';\nimport lotteryInstant from './modules/lotteryInstant';\nimport lotteryParticipant from './modules/lotteryParticipant';\nimport lotteryTasks from './modules/lotteryTasks';\nimport lotteryPrizes from './modules/lotteryPrizes';\nimport flags from './modules/flags';\nimport flagsUgc from './modules/flagsUgc';\nimport ugcCollections from './modules/ugcCollections';\nimport ugcMediaOfMember from './modules/ugcMediaOfMember';\nimport appState from './modules/appState';\nimport promoState from './modules/promoState';\nimport userEntryState from './modules/userEntryState';\nimport userGameResultRecords from './modules/userGameResultRecords';\nimport userLoginState from './modules/userLoginState';\nimport userWinnerPrize from './modules/userWinnerPrize';\nimport purePrizeState from './modules/purePrizeState';\nimport systemErrorDialog from './modules/systemErrorDialog';\nimport partner from './modules/partner';\nimport sponsor from './modules/sponsor';\nimport pointSystem from './modules/pointSystem';\nimport mgmRelation from './modules/mgmRelation';\nimport mgmReferral from './modules/mgmReferral';\n\nexport const staticReducers = {\n partner,\n sponsor,\n promo,\n promoTasks,\n gameFormBased,\n settingPromo,\n settingPointSystems,\n settingStyle,\n settingGame,\n settingGameStyle,\n settingMGMReferral,\n settingEntryValue,\n settingTheme,\n settingPlan,\n signUpForm,\n zines,\n lotteryAdmin,\n lotteryInstant,\n lotteryParticipant,\n lotteryTasks,\n lotteryPrizes,\n appState,\n promoState,\n userLoginState,\n userEntryState,\n userGameResultRecords,\n userWinnerPrize,\n purePrizeState,\n systemErrorDialog,\n flags,\n pointSystem,\n mgmRelation,\n mgmReferral,\n ...(IS_UGC_FLOW ? { flagsUgc, ugcCollections, ugcMediaOfMember } : {})\n};\n","import gameState, {\n updateGameResultRecordsCount\n} from 'client/game_checkIn/redux/modules/gameState';\n\nexport default {\n gameState\n};\n\nexport function init(dispatch) {\n return dispatch(updateGameResultRecordsCount());\n}\n","import gameState, {\n updateCampaignVoteCount\n} from 'client/game_photoContest/redux/modules/gameState';\n\nexport default {\n gameState\n};\n\nexport function init(dispatch) {\n return dispatch(updateCampaignVoteCount());\n}\n","import gameState from 'client/game_comment/redux/modules/gameState';\n\nexport default {\n gameState\n};\n","import gameState from 'client/game_orderReward/redux/modules/gameState';\n\nexport default {\n gameState\n};\n","const reducer = (state = {}, action) => {\n switch (action.type) {\n default:\n return state;\n }\n};\n\nexport default reducer;\n","import { gameTypes, isContestGamesWithSecondaryUgc } from 'config/promoGameTypes';\nimport checkInReducer, { init as initCheckIn } from 'client/game_checkIn/redux/reducer';\nimport contestReducer, { init as initContest } from 'client/game_photoContest/redux/reducer';\nimport commentReducer from 'client/game_comment/redux/reducer';\nimport orderRewardReducer from 'client/game_orderReward/redux/reducer';\nimport relatedTwinsPromo from 'client/redux/modules/relatedTwinsPromo';\nimport { defaultState as checkInDefaultState } from 'client/game_checkIn/redux/modules/gameState';\nimport { defaultState as contestDefaultState } from 'client/game_photoContest/redux/modules/gameState';\nimport { defaultState as commentDefaultState } from 'client/game_comment/redux/modules/gameState';\nimport { defaultState as orderRewardDefaultState } from 'client/game_orderReward/redux/modules/gameState';\n\nexport function getGameReducer(gameType, hasRelatedTwinsPromo, isMgmSelf) {\n let reducer = {};\n if (hasRelatedTwinsPromo) {\n reducer = { ...reducer, relatedTwinsPromo };\n }\n const game = getCustomGameReducerByGameType(gameType);\n const mgm = getCustomGameReducerByMgmSelf(isMgmSelf);\n const gameReducer = game.reducer;\n const mgmReducer = mgm.reducer;\n const gameDefaultState = game.defaultState;\n const mgmDefaultState = mgm.defaultState;\n\n if (gameReducer && mgmReducer) {\n reducer = {\n ...reducer,\n ...{\n gameState: combineReducers([gameReducer, mgmReducer], {\n ...gameDefaultState,\n ...mgmDefaultState\n })\n }\n };\n } else if (gameReducer) {\n reducer = { ...reducer, ...gameReducer };\n } else if (mgmReducer) {\n reducer = { ...reducer, ...mgmReducer };\n }\n\n return reducer;\n}\n\nfunction combineReducers(props = [], defaultState = {}) {\n return function (state = { ...defaultState }, action) {\n let nextState = { ...state };\n\n props.forEach(reducer => {\n nextState = {\n ...nextState,\n ...reducer.gameState(nextState, action)\n };\n });\n\n return nextState;\n };\n}\n\nexport async function initGameReducer(gameType, dispatch) {\n const init = getCustomGameReducerByGameType(gameType).init;\n if (typeof init === 'function') {\n return init(dispatch);\n }\n}\n\nexport async function initMgmSelfReducer(dispatch, isMgmSelf) {\n const initMgmSelf = getCustomGameReducerByMgmSelf(isMgmSelf).init;\n if (typeof initMgmSelf === 'function') {\n return initMgmSelf(dispatch);\n }\n}\n\nfunction getCustomGameReducerByGameType(gameType) {\n switch (true) {\n case gameType === gameTypes.COMMENT:\n return { reducer: commentReducer, defaultState: commentDefaultState };\n case gameType === gameTypes.ORDER_REWARD:\n return { reducer: orderRewardReducer, defaultState: orderRewardDefaultState };\n case gameType === gameTypes.CHECK_IN:\n case gameType === gameTypes.CHALLENGE_PHOTO_FRAME_COMPOSITE:\n case gameType === gameTypes.MGM_SHARE:\n case gameType === gameTypes.MULTI_CHALLENGE:\n return {\n reducer: checkInReducer,\n init: initCheckIn,\n defaultState: checkInDefaultState\n };\n case isContestGamesWithSecondaryUgc(gameType):\n return {\n reducer: contestReducer,\n init: initContest,\n defaultState: contestDefaultState\n };\n default:\n return {};\n }\n}\n\nfunction getCustomGameReducerByMgmSelf(isMgmSelf) {\n if (isMgmSelf) {\n return { reducer: checkInReducer, init: initCheckIn, defaultState: checkInDefaultState };\n }\n return {};\n}\n","import { compose, createStore, applyMiddleware, combineReducers } from 'redux';\nimport thunk from 'redux-thunk';\nimport _merge from 'lodash/merge';\n\nimport { staticReducers } from 'client/redux/staticReducer';\nimport { getGameReducer, initGameReducer, initMgmSelfReducer } from 'client/redux/gameReducer';\n\nconst INIT_PROMO = 'store/init_promo';\nexport function initAppState(initData) {\n return {\n type: INIT_PROMO,\n payload: {\n initData\n }\n };\n}\n\nfunction createReducer(asyncReducers = {}) {\n const reducers = combineReducers({ ...staticReducers, ...asyncReducers });\n return (state, action) => {\n if (action.type === INIT_PROMO) {\n state = _merge({}, state, action.payload.initData);\n }\n return reducers(state, action);\n };\n}\n\nfunction configureStore() {\n const composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\n const store = createStore(createReducer(), composeEnhancer(applyMiddleware(thunk)));\n\n store.injectGameReducer = (...args) => {\n return store.replaceReducer(createReducer(getGameReducer(...args)));\n };\n store.initGameReducer = gameType =>\n initGameReducer(gameType, (...args) => store.dispatch(...args));\n\n store.initMgmSelfReducer = isMgmSelf =>\n initMgmSelfReducer((...args) => store.dispatch(...args), isMgmSelf);\n\n return store;\n}\n\nexport default configureStore();\n","import { useHistory } from 'react-router-dom';\nimport queryString from 'query-string';\n\nimport { qsParseNoArray } from 'client/utils/queryString';\n\nexport default function useRemoveAndRetrieveQs() {\n const history = useHistory();\n\n return (qsArray = []) => {\n const qsObj = qsParseNoArray(window.location.search);\n const { rest, retrieved } = Object.entries(qsObj).reduce(\n (obj, [key, val]) => {\n if (qsArray.includes(key)) {\n obj.retrieved[key] = val;\n } else {\n obj.rest[key] = val;\n }\n return obj;\n },\n { retrieved: {}, rest: {} }\n );\n if (Object.keys(retrieved).length > 0) {\n const qs = queryString.stringify(rest);\n history.replace(`${history.location.pathname}${qs ? `?${qs}` : ''}`);\n }\n return { rest, retrieved };\n };\n}\n"],"names":["UPDATE_GAME_STATE","defaultState","hasNewUnlockTaskPrize","gameResultRecordsCount","hasLotteryTaskMappingEntryInited","lotteryTaskMappingEntry","state","arguments","length","undefined","action","type","payload","setHasNewUnlockTaskPrize","status","updateGameResultRecordsCount","dispatch","getState","userGameResultRecords","setLotteryTaskMappingEntryInited","setLotteryTaskMappingEntry","UPDATE_SETTING_OPTIONS","settingOptions","updateSettingOptions","data","UPDATE_VALIDATE_FAILED_ORDERS","validateFailedOrders","updateValidateFailedOrders","campaignVoteCount","campaignPortfolioCount","updateCampaignVoteCount","async","promo","id","promoId","counts","votes","getContestUgcMediaAndVoteCount","isDocVisible","document","visibilityState","useInitAbortHelper","helperRef","useRef","isAborted","checkIsDocOnViewing","Promise","res","addEventListener","handler","removeEventListener","canContinue","this","useEffect","handleUnload","current","window","setGameResultRecordsAndWinnerList","mergeAndDispatchState","isMgm","userWinnerPrize","mgmRelation","mgmReferral","uuid","mgmPromoUUID","promoUUID","items","entries","getEntriesListApi","getUserWinnerList","Boolean","getPromoInfoData","exclude","primaryPromoData","getPromoInfoApi","mappingPromoInfoApi2State","apiData","_ref2","_promotion$promoSetti","_promotion$promoSetti2","_promotion$promoSetti3","_promotion$promoSetti4","_promotion$promoSetti5","_promotion$promoSetti6","_promotion$promoSetti7","_promotion$promoSetti8","promotion","rest","partner","partnerSetting","sponsor","sponsorSetting","promoState","isPurePrizeGame","isPurePrizeGames","settingPromo","promoSetting","Promotions","settingPointSystems","PointSystems","settingStyle","objFirstLevelJSONParse","Styles","settingGame","Games","settingGameStyle","GameStyles","settingMGMReferral","MGMReferral","settingEntryValue","EntryValues","settingTheme","Themes","settingPlan","planSetting","signUpForm","SignUpForm","zines","lotteryAdmin","LotteryAdmin","lotteryInstant","LotteryInstant","lotteryParticipant","LotteryParticipant","lotteryTasks","LotteryTasks","getPromoState","fromEntries","Object","filter","_ref","apiKey","includes","_data$settingGame","formId","promoType","gameTypes","SIGN_FORM","pages","sections","fields","options","settings","getFormInfo","gameFormBased","getFormState","checkIsGameHasPromoTask","getPromoTaskListApi","promoTasks","normalizePromoTasksList","getPromoTasksState","_lotteryState$lottery","_lotteryState$lottery2","lotteryTasksData","lotteries","lotteryState","normalizePromoLotteryList","isJSONParsable","JSON","parse","reduce","obj","_ref3","_lotteryState$lottery3","lotteryUuid","taskCondition","getLotteriesState","lotteryPrizes","getPrizeState","pointPool","Array","isArray","keys","pointPoolUuid","pointSystem","pointPoolInfos","getPromoPointPoolInfoState","mgmRole","isMGMGame","mgmReferralPromoUUID","mgmReferralPromoInfoData","formattedMgmReferralPromoInfoData","getPromoMgmRelationState","primaryGameType","primarySettingPromo","contestGetUgcLinkKey","relatedPromoUuid","secondaryPromoData","isContestGamesForUserPlayableUgc","language","IS_UGC_FLOW","secondaryPromoWithoutPartnerAndSponsor","relatedTwinsPromo","primaryPromoWithoutPartnerAndSponsor","CONTEST_ADMIN_UPLOAD","getRelatedTwinsPromoState","getPeriodPlayMatchedInfo","periodPlayMode","periodTime","timezone","isPeriodPlayMode","matchedInfo","generatePeriodTimeMatchInfo","periodTimes","mode","qs","test_code","test_expired","parentUrl","scenes","utm_source","utm_medium","utm_campaign","utm_term","utm_content","getQsOfParentUrl","getUtmFromParentUrl","gameRunningStatus","isTestMode","hasTestQs","hasPreviewQs","promoStatus","startDate","endDate","pageId","IS_IFRAME_MODE","gameRunningStatuses","NOT_PUBLISH","IS_OFFLINE","RUNNING","IS_SUSPEND","SUSPEND","IS_END","hasUtcDTEndInLocal","END","hasUtcDTStartInLocal","BEFORE","getGameRunningStatus","periodPlayMatchedInfo","enablePasscodeVerify","checkEnablePasscodeVerify","reducePointMode","getReducePointMode","utmFromParent","loginMethod","enableKkpoint","kkpointAmount","transactionWithdraw","transactionWithdrawQuantity","loginTypes","ENTERPRISELOGIN","reducePointModes","KK_BOX","GENERAL","FACEBOOKLOGIN","LINELOGIN","qualifyWithdrawUuid","POINT_SYSTEMS","enableQualificationPasscode","useRemoveUnnecessaryQueryStr","qsHandler","useRemoveAndRetrieveQs","shouldRemoveQsKey","push","validateTestCode","sponsorId","validateResp","validateTestCodeAPI","host","CLIENT_API_FEVER_HOST","testCode","testExpired","httpStatus","generateApiErrObj","clientErrTypes","getLoginUserNonQualifyTypeAfterEntry","promoUuid","referralCode","userEntryState","currentEntryUUID","entryUuid","isNeedEnterReferralCode","hasReferralCodeInput","enableReferralCodeRequired","emptyState","userLoginState","notQualifiedType","notQualifiedTypes","QUALIFICATION","SUBMIT_REFERRAL_CODE","Cookies","submitReferralCodeApi","isCanEnterReferralCode","err","submitReferralCode","paramsPromoUUID","paramsPromoId","useDispatch","history","useHistoryPathPush","location","useLocation","removeUnnecessaryQueryStr","abortHelper","toNotFound","pathname","initPromo","recaptchaToken","_location$pathname","test","match","joinRegex","concat","source","_merge","initAppState","_promoInfo$settingPro","promoInfo","hasRelatedTwinsPromo","gameType","isMgmShare","isMgmMission","isMgmSelf","getMgmFlags","flags","store","injectGameReducer","setupPromoApp","retrieved","appState","hasTryLiff","tryliff","retrieveStateFromLocalStorage","setInited","pcode","querystring","search","enableCampaignToolPasscode","trackCampaignClick","IntersectionObserver","observer","forEach","entry","target","body","isIntersecting","unobserve","observe","parentReferralCodeByUrl","promoReferralCodeByUrl","referralCodeByUrl","referralCodeByCookie","isUrlCodeValid","checkReferralCodeApi","setReferralCode","getUserLoginState","isLogin","_state2","_state3","_promoInfo$settingPro2","_promoInfo$settingPro3","currentLoginID","setLoginId","_state","loginUserInfo","getLoginUserInfo","getUserEntryState","enableReCaptcha","notQualifiedErrInfo","isInPlayTimePeriod","isPromoPlayableOnTime","resp","size","getUserLoginStateAfterEntry","shouldHideUserStateLoading","initGameReducer","initMgmSelfReducer","setUserStateInited","error","_state4","handleInitError","_error$extraInfo","setErrorOnInit","extraInfo","errType","errorActionHandler","metaTitle","name","title","setSiteTitle","setSiteFavicon","documentElement","setAttribute","setI18nLanguage","lang","initTagManager","favIconUrl","selectorFavicon","querySelector","href","isFirstPassLoginSever","getLocalStorage","key","deleteLocalStorage","isfirstPassLoginSever","latestEntry","getUserLatestEntry","canContinueFlow","shouldGetNextEntry","checkShouldGetNextEntry","isReCaptchaPass","gameEntry","createEntryNotQualifiedType","hasPromoSuspended","hasPromoSuspendedWhenGetEntries","getUserGameEntry","entryId","restEntryProps","getEntryQualificationInfo","currentEntryId","overwriteEntryAction","getLoginUserNonQualifyType","friendLimit","enableQualificationMemberCyberbiz","enableQualificationRestrictedList","enableQualificationRegistrationDate","enableQualificationMemberTier","qualificationMemberAccountLinkPlatform","thirdPartyQualificationMemberLevelPlatform","isFriendShip","verifyLineFriend","LINE","FRIEND","some","e","verityMemberQualification","checker","errInfoRetrieve","checkMemberQualifyList","getNotQualifiedType","verifyKKboxMemberQualify","ENTERPRISE","MEMBER_KKBOX","isErrOfCyberbizEcLimit","CYBERBIZ_EC_MEMBER","isErrOfApiNameListLimit","NAME_LIST_API","isErrOfEnterpriseBindLine","_resp$payload","redirectUrl","ENTERPRISE_MEMBER_BIND","isErrOfNewRegisterMemberLimit","NEW_REGISTER_MEMBER","isErrOfMemberTier","MEMBER_TIER","omitLoginGameStatuses","Set","has","loginUser","loginCredential","loginType","ANONYMOUSLOGIN","login_type","loginTypesForApi","ANONYMOUS","FACEBOOK","app_id","facebookLoginAppId","retrieveLineConfig","lineLoginAppId","DEPRECATED_CODE_VALIDATION_LOGIN","enterpriseLoginAppId","enterpriseLiteLoginAppId","enterpriseCodeValidationLoginAppId","INSTAGRAM","retrieveCredentialByLoginType","tokenManager","init","initTokenLoginType","token","accessToken","errorResp","getAccessToken","generateLoginToken","useIsInitSuccessInfo","hasInited","hasUserStateInited","hasErrorOnInit","useSelector","s","useUpdateWinnerData","errHandler","useClientErrorHandler","isInitSuccess","hasUserWinnerPrizeListReady","isFetching","setIsFetching","useState","winnerLists","setUserWinnerPrize","setMGMReferral","getPrizeList","get","winners","winnerQualify","getPrizeListApi","winnerPrizes","thankPrizes","winner","prize","prizeTypes","THANKYOU","splitThanksPrize","prizes","_orderBy","sortPrize","unOpenWinnerPrize","isSmallScreenApp","isZinesEmbedded","isWidgetEmbedded","UPDATE_APP_STATE","setIsSmallScreenApp","setIsZinesEmbedded","setIsWidgetEmbedded","UPDATE_FLAGS","UPDATE_PARTICIPANT_PRIZE_POPUP","PICK_PRIZE_CUSTOM_PRIZE_UUID","isPrizeListOpen","participantPrizePopup","isNoGetPrize","entryUUID","prizeUUID","animatingLotteries","animationSettings","isReJoin","UPDATE_USER_WINNER_PRIZE","setShouldUpdateUserWinnerList","setParticipantWinnerPopup","clearParticipantWinnerPopup","setAnimatingLotteries","togglePrizeList","setReJoin","UPDATE_PARTICIPANT","updateParticipantRemainderFromApi","lotteryUUID","showRest","prizeLimited","mgmLotteryUUID","mgmShowRest","mgmPrizeLimited","mgmMission","currentLotteryUUID","currentShowRest","currentPrizeLimited","currentPromoUUID","lotteryRestShowTypes","SHOW_REMAIN_AMOUNT","quantity","remainder","getRemainPrizeAPI","updateParticipantRemainder","updateAllLotteryRemainder","isUseNormalEntry","lotteryParticipantUUID","mgmLotteryTasks","currentLotteryTasks","getPromoLotteries","find","lottery","prizeRemainder","lotteryTasksRespond","lotterySetting","Tasks","lotteryTasksCloned","_cloneDeep","UPDATE_TASK_PRIZE","console","log","UPDATE_LOTTERY_PRIZE","setLotteryPrize","lazyGetLotteryPrizeList","getLotteryPrizes","UPDATE_MGM_REFERRAL","UPDATE_MGM_REFERRAL_LOTTERY_PRIZES","initialState","lazyGetMGMtLotteryPrizeList","updateFlowOfMGMEntryRecord","map","r","flow","getCurrentUtcDTStr","updateMGMGameResultRecords","UPDATE_SETTING_STYLE","updateReduxObjKeyHandleDelete","updateAction","updateSettingStyle","SET_MEDIA_MAPPING","entryIdsMapMediaList","mediaListByMapId","_action$payload","medias","memberHash","shortid","serialNo","setMediaMapping","UPDATE_RECORD_STATE","updateGameResultRecords","entryFlowKeys","SIGN_UP_FORM","LOTTERY_PARTICIPANT","LOTTERY_INSTANT","updateFlowOfEntryRecord","allUUIDs","byUUIDs","settingsByUUIDS","optionsByUUIDS","UPDATE_SETTING_MGM_REFERRAL","staticReducers","purePrizeState","systemErrorDialog","flagsUgc","ugcCollections","ugcMediaOfMember","gameState","combineReducers","props","nextState","reducer","getCustomGameReducerByGameType","COMMENT","commentReducer","commentDefaultState","ORDER_REWARD","orderRewardReducer","orderRewardDefaultState","CHECK_IN","CHALLENGE_PHOTO_FRAME_COMPOSITE","MGM_SHARE","MULTI_CHALLENGE","checkInReducer","initCheckIn","checkInDefaultState","isContestGamesWithSecondaryUgc","contestReducer","initContest","contestDefaultState","getCustomGameReducerByMgmSelf","INIT_PROMO","initData","createReducer","asyncReducers","reducers","composeEnhancer","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","createStore","applyMiddleware","thunk","replaceReducer","game","mgm","gameReducer","mgmReducer","gameDefaultState","mgmDefaultState","getGameReducer","initMgmSelf","useHistory","qsArray","qsObj","qsParseNoArray","val","queryString","stringify","replace"],"sourceRoot":""}