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kBH,GAC9B,MAAO,CACH1Q,KAAM4Q,EACNjS,QAAS,CACL+R,kBAGZ,CAEO,SAASI,EAAWH,GACvB,MAAO,CACH3Q,KAAM4Q,EACNjS,QAAS,CACLgS,WAGZ,CAEO,SAASI,EAAoBC,GAChC,MAAO,CACHhR,KAAM4Q,EACNjS,QAAS,CACL4I,iBAAkByJ,GAG9B,CAEA,QApCgB,WAAmC,IAAlC3M,EAAK3G,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAGoM,EAAcS,EAAM7M,UAAAC,OAAA,EAAAD,UAAA,QAAAE,EACzC,OAAQ2M,EAAOvK,OACN4Q,EACM,IAAKvM,KAAUkG,EAAO5L,SAEtB0F,CAEnB,C,kFCde5B,eAAeoG,IAIrB,IAJ4C,UACjD3J,EAAS,UACT4J,EAAS,qBACTT,GACH3K,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAC,EACD,IAAK2K,EACD,OAAO,EAEX,MAAMlF,QAAa8N,EAAAA,EAAAA,IAAsB,CACrC/R,YACA4J,cAEJ,GAAwB,MAApB3F,EAAK3E,WACL,OAAO,EACJ,IAAI0S,EAAAA,EAAAA,IAAqB/N,KAAUgO,EAAAA,GAAWC,oBACjD,OAAO,EAEP,MAAM3N,EAAAA,EAAAA,IAAkBN,EAAM7E,EAAAA,GAEtC,C,mCCxBO,MAAMmH,EAAoB,CAC7B4L,SAAU,CAAC,EACXC,KAAM,CACFC,OAAQ,cACRC,uBAAwB,0BAE5BC,WAAY,CACRC,mBAAoB,qBACpBC,aAAc,0BACdC,OAAQ,UAEZ9K,cAAe,CACX+K,cAAe,8BACf9K,aAAc,6BACd+K,oBAAqB,sBACrBC,qBAAsB,uBACtBC,YAAa,4BACb/K,UAAW,aAEfvB,QAAS,CACLC,YAAa,uB","sources":["api/ugc.js","client/hooks/useHasReachPlayTimesLimit.js","client/hooks/useHistoryPathPush.js","client/hooks/useInitPromo/userEntryState/checkEntryNeedPoint.js","client/hooks/useInitPromo/userEntryState/entriesChecker.js","client/hooks/useInitPromo/userEntryState/getUserEntry.js","client/redux/modules/flagsUgc.js","client/redux/modules/purePrizeState.js","client/redux/modules/ugcCollections.js","client/redux/modules/userEntryState.js","client/redux/modules/userLoginState.js","client/utils/passcode/checkEntryNeedPasscode.js","config/notQualifiedTypes.js"],"sourcesContent":["import querystring from 'query-string';\n\nimport * as clientErrTypes from 'config/clientErrorTypes';\nimport { fetches, generateFetchOpts } from 'api/client';\n\nexport function getPromoEntriesList(promoId, query = {}) {\n const qs = querystring.stringify(query);\n return fetches(\n `/promotions/${promoId}/entries/list${Boolean(qs) ? `?${qs}` : ''}`,\n generateFetchOpts(),\n {\n dataKeys: 'data',\n throwErrConfigs: { [clientErrTypes.GET_API_ERROR]: r => r.httpStatus !== 200 }\n }\n );\n}\n\nexport function getPromoEntryResult(promoId, entryId) {\n return fetches(`/promotions/${promoId}/entries/${entryId}/result`, generateFetchOpts(), {\n dataKeys: 'data',\n throwErrConfigs: {\n [clientErrTypes.NOT_FOUND]: r => r.httpStatus === 400 && r.payload.message === '404',\n [clientErrTypes.GET_API_ERROR]: r => r.httpStatus !== 200\n }\n });\n}\n\nexport function getUgcMediaVoteAndRankingInfo(promoId, mediaUUID) {\n return fetches(`/promotions/${promoId}/media/${mediaUUID}/votes`, generateFetchOpts(), {\n dataKeys: 'data',\n throwErrConfigs: {\n [clientErrTypes.GET_API_ERROR]: r => r.httpStatus !== 200\n }\n });\n}\n\nexport function getContestUgcMediaAndVoteCount(promoId) {\n return fetches(`/promotions/${promoId}/media/votes`, generateFetchOpts(), {\n dataKeys: 'data',\n throwErrConfigs: {\n [clientErrTypes.GET_API_ERROR]: r => r.httpStatus !== 200\n }\n });\n}\n\nexport function getMediaCacheTotalCounts({ promoUUID }) {\n return fetches(`/promotions/${promoUUID}/media/counts`, generateFetchOpts(), {\n dataKeys: 'data'\n });\n}\n\nexport function getMediaCacheData({ promoUUID, firstNum, defaultNum }) {\n return fetches(\n `/promotions/${promoUUID}/media?first=${firstNum}&default=${defaultNum}`,\n generateFetchOpts(),\n { dataKeys: 'data' }\n );\n}\n\nexport function getAllMediaOfEntry({ promoUUID, entryId }) {\n return fetches(`/promotions/${promoUUID}/entries/${entryId}/user-result`, generateFetchOpts(), {\n dataKeys: 'data'\n });\n}\n","import { isCheckGameResultRecordsHasLotteryParticipant } from 'config/promoGameTypes';\nimport { useMemo } from 'react';\nimport { useSelector } from 'react-redux';\n\nimport { isLocalSameDateInPromoTimezone, utcDTStr2TimezoneDTStr } from 'utils/dateTime';\n\nexport default function useHasReachPlayTimesLimit() {\n const { totalPlayTimes, dailyPlayTimes, timezone } = useSelector(s => s.settingPromo);\n const { type: promoType } = useSelector(s => s.promo);\n const { periodPlayMatchedInfo: { isPeriodPlayMode, matchedInfo } = {} } = useSelector(\n s => s.promoState\n );\n\n const userGameResultRecords = useSelector(s => s.userGameResultRecords);\n const hasReachPlayLimit = useMemo(() => {\n const gameResultRecords = userGameResultRecords || [];\n const filteredRecords = gameResultRecords.filter(\n record => record.flow?.lotteryParticipant !== undefined\n );\n const filterGameResultRecords = isCheckGameResultRecordsHasLotteryParticipant(promoType)\n ? filteredRecords\n : gameResultRecords;\n return isPeriodPlayMode\n ? checkHasReachPeriodPlayLimit({\n gameResultRecords: filterGameResultRecords,\n timezone,\n totalPlayTimes,\n matchedInfo\n })\n : checkHasReachPlayLimit({\n gameResultRecords: filterGameResultRecords,\n timezone,\n totalPlayTimes,\n dailyPlayTimes\n });\n }, [\n userGameResultRecords,\n promoType,\n isPeriodPlayMode,\n timezone,\n totalPlayTimes,\n matchedInfo,\n dailyPlayTimes\n ]);\n return hasReachPlayLimit;\n}\n\nexport function checkHasReachPeriodPlayLimit({\n totalPlayTimes,\n timezone,\n matchedInfo = {},\n gameResultRecords\n}) {\n if (Number.isInteger(totalPlayTimes) && gameResultRecords.length >= totalPlayTimes) {\n return true;\n }\n if (!matchedInfo.match) {\n return true;\n }\n const played = gameResultRecords.filter(e => {\n const { flow: { gameResult: createdAt } = {} } = e;\n const timezoneDateStr = utcDTStr2TimezoneDTStr(createdAt, timezone);\n return (\n matchedInfo.periodStartInTZ <= timezoneDateStr &&\n timezoneDateStr <= matchedInfo.periodEndInTZ\n );\n });\n return played.length >= 1;\n}\n\nexport function checkHasReachPlayLimit({\n gameResultRecords,\n timezone,\n totalPlayTimes,\n dailyPlayTimes\n}) {\n if (Number.isInteger(totalPlayTimes) && gameResultRecords.length >= totalPlayTimes) {\n return true;\n }\n if (Number.isInteger(dailyPlayTimes)) {\n const todayPlayedEntries = gameResultRecords.filter(e => {\n const { flow: { gameResult: createdAt } = {} } = e;\n return isLocalSameDateInPromoTimezone(createdAt, timezone);\n }).length;\n if (todayPlayedEntries >= dailyPlayTimes) {\n return true;\n }\n }\n return false;\n}\n","import { useHistory, useLocation } from 'react-router-dom';\n\nexport default function useHistoryPathPush() {\n const history = useHistory();\n const location = useLocation();\n const { search, hash } = location;\n\n return {\n ...history,\n push: obj => history.push({ search, hash, ...obj }),\n replace: obj => history.push({ search, hash, ...obj })\n };\n}\n","import * as clientErrTypes from 'config/clientErrorTypes';\nimport { reducePointModes } from 'config/enterpriseReducePointMode';\nimport { checkKKUserExchangePointsStatus } from 'api/client';\nimport { toLowerCase } from 'utils/manipulateString';\nimport { generateApiErrObj } from 'client/hooks/useClientErrorHandler';\n\nexport default async function checkEntryNeedPoint({ promoUUID, entry, reducePointMode }) {\n if (!reducePointMode) {\n return false;\n }\n const isNeedReducePoint =\n reducePointMode === reducePointModes.POINT_SYSTEMS\n ? !entry.hasPointReduced\n : reducePointMode === reducePointModes.KK_BOX\n ? await checkKKBoxPointStatus({\n promoUUID,\n entryUuid: entry.entryUuid\n })\n : !entry.hasPointReduced;\n return isNeedReducePoint;\n}\n\nasync function checkKKBoxPointStatus({ promoUUID, entryUuid }) {\n const resp = await checkKKUserExchangePointsStatus(promoUUID, entryUuid);\n const { httpStatus, payload } = resp;\n\n if (httpStatus === 200) {\n const { data: { status } = {} } = payload;\n return Number(status) !== 2;\n } else if (\n httpStatus === 400 &&\n toLowerCase(payload.code) === 'po-r1-fnf1' &&\n payload.message === 'order not found'\n ) {\n return true;\n } else {\n throw generateApiErrObj(resp, clientErrTypes.CHECK_REDUCE_POINT_STATUS);\n }\n}\n","import { isPurePrizeGames } from 'config/promoGameTypes';\n\nexport function isFulFilledEntries(\n gameType,\n {\n hasGameResult = false,\n hasFilledSignupForm = false,\n hasInstantPrize = false,\n hasParticipantPrize = false\n } = {}\n) {\n if (isPurePrizeGames(gameType)) {\n // 純獎模組讓 user 配完再拿 entries 比較合理\n return [hasGameResult, hasFilledSignupForm, hasInstantPrize, hasParticipantPrize].every(\n e => e\n );\n } else {\n return [hasGameResult, hasFilledSignupForm].every(e => e);\n }\n}\n","import * as clientErrTypes from 'config/clientErrorTypes';\nimport { notQualifiedTypes } from 'config/notQualifiedTypes';\nimport { PromiseAll } from 'api/common';\nimport { createUserEntries, getUserLatestEntries } from 'api/client';\nimport { isFulFilledEntries } from 'client/hooks/useInitPromo/userEntryState/entriesChecker';\nimport checkEntryNeedPoint from 'client/hooks/useInitPromo/userEntryState/checkEntryNeedPoint';\nimport {\n checkHasReachPlayLimit,\n checkHasReachPeriodPlayLimit\n} from 'client/hooks/useHasReachPlayTimesLimit';\nimport {\n isGetEntriesLimitError,\n isGetEntriesPlayTimeLimitErr,\n isRequestAtInvalidPromoTime,\n isErrOfGetEntryWhenPromoInvalid,\n isErrOfMemberOrderLimit,\n isCreateEntryTotalMonthlyEntryLimitError,\n isErrOfTagLimit\n} from 'client/utils/errorObjectChecker';\nimport { suspendPromo } from 'client/redux/modules/promoState';\nimport { gameTypes } from 'config/promoGameTypes';\nimport { generateApiErrObj } from 'client/hooks/useClientErrorHandler';\nimport checkEntryNeedPasscode from 'client/utils/passcode/checkEntryNeedPasscode';\n\nexport async function getUserGameEntry({ dispatch, state, latestEntry, recaptchaToken }) {\n const {\n promo: { uuid: promoUUID },\n lotteryInstant: { uuid: lotteryInstantUUID },\n lotteryParticipant: { uuid: lotteryParticipantUUID },\n signUpForm: { id: signUpFormId, enableFilledByEntry } = {},\n promoState: { isTestMode },\n userGameResultRecords\n } = state;\n const {\n entry,\n isPlayTimeLimitError,\n isNotValidPromoJoinTime,\n isNotValidPromoStatusToJoin,\n createEntryNotQualifiedType\n } = await createNewEntry(promoUUID, recaptchaToken);\n if (isNotValidPromoJoinTime || isPlayTimeLimitError) {\n return { entry: latestEntry };\n } else if (isNotValidPromoStatusToJoin) {\n dispatch(suspendPromo());\n return { entry: overwriteEntryAction(latestEntry), hasPromoSuspended: true };\n } else if (createEntryNotQualifiedType) {\n if (createEntryNotQualifiedType === notQualifiedTypes.ENTRIES.REACH_LIMIT && !isTestMode) {\n dispatch(suspendPromo());\n return {\n entry: overwriteEntryAction(latestEntry),\n createEntryNotQualifiedType,\n hasPromoSuspended: true\n };\n }\n return {\n entry: latestEntry,\n createEntryNotQualifiedType\n };\n } else {\n const hasEnableSignUpForm = signUpFormId !== undefined;\n const hasEnableLotteryInstant = lotteryInstantUUID !== undefined;\n const hasEnableLotteryParticipant = lotteryParticipantUUID !== undefined;\n const gameEntry = normalizeEntryPayload(entry, {\n hasEnableSignUpForm,\n hasEnableLotteryInstant,\n hasEnableLotteryParticipant\n });\n if (!enableFilledByEntry) {\n // if once fill signup form before, and does not set \"enableFilledByEntry\" then \"hasFilledSignupForm\" status should be true forever\n // 這行是指當開放多次參加,上一筆 entry 的填表狀態要傳承給下一筆新建立的 entry,前提是表單要開 \"同一登入者只能填寫一次\",而非 \"每次參加都需要填寫報名表單\"\n const previousEntry = userGameResultRecords.find(r => r?.id === latestEntry.entryId);\n // 此entry是剛新建立的entry,且如果上一筆entry被刪除(Ex: 審核未通過、取消資格),且上一筆entry沒填表,就不繼承上一筆的 entry 填表紀錄,直接判定下一筆沒填過表,需要送去填表頁補填表\n if (previousEntry?.deletedAt && !previousEntry.flow?.formSignUp) {\n gameEntry.hasFilledSignupForm = false;\n } else {\n gameEntry.hasFilledSignupForm = latestEntry.hasFilledSignupForm;\n }\n }\n\n return { entry: gameEntry };\n }\n}\nexport async function createNewEntry(promoUUID, recaptchaToken) {\n let resp = await createUserEntries(promoUUID, recaptchaToken);\n if (resp.httpStatus !== 200) {\n if (isCreateEntryTotalMonthlyEntryLimitError(resp)) {\n return { entry: null, isTotalMonthlyEntryLimitError: true };\n } else if (isGetEntriesPlayTimeLimitErr(resp)) {\n return { entry: null, isPlayTimeLimitError: true };\n } else if (isRequestAtInvalidPromoTime(resp)) {\n return { entry: null, isNotValidPromoJoinTime: true };\n } else if (isErrOfGetEntryWhenPromoInvalid(resp)) {\n return { entry: null, isNotValidPromoStatusToJoin: true };\n } else {\n const createEntryNotQualifiedType = getCreateEntryNotQualifedType(resp);\n if (createEntryNotQualifiedType) {\n return { entry: null, createEntryNotQualifiedType };\n } else {\n throw generateApiErrObj(resp, clientErrTypes.CREATE_ENTRIES);\n }\n }\n }\n return { entry: resp.payload };\n}\nfunction getCreateEntryNotQualifedType(resp) {\n if (isGetEntriesLimitError(resp)) {\n return notQualifiedTypes.ENTRIES.REACH_LIMIT;\n } else if (isErrOfMemberOrderLimit(resp)) {\n return notQualifiedTypes.QUALIFICATION.MEMBER_ORDER;\n } else if (isErrOfTagLimit(resp)) {\n return notQualifiedTypes.QUALIFICATION.TAG_LIMIT;\n }\n return '';\n}\nexport async function getUserLatestEntry({ state }) {\n const {\n promo: { uuid: promoUUID },\n lotteryInstant: { uuid: lotteryInstantUUID },\n lotteryParticipant: { uuid: lotteryParticipantUUID },\n signUpForm: { id: signUpFormId } = {}\n } = state;\n const hasEnableSignUpForm = signUpFormId !== undefined;\n const hasEnableLotteryInstant = lotteryInstantUUID !== undefined;\n const hasEnableLotteryParticipant = lotteryParticipantUUID !== undefined;\n const { payload } = await getUserLatestEntries(promoUUID);\n const entry = normalizeEntryPayload(payload, {\n hasEnableSignUpForm,\n hasEnableLotteryInstant,\n hasEnableLotteryParticipant\n });\n\n return entry;\n}\nexport function checkShouldGetNextEntry({ state, latestEntry }) {\n const {\n promo: { type: gameType },\n settingPromo: { totalPlayTimes, dailyPlayTimes, timezone },\n promoState: { periodPlayMatchedInfo: { isPeriodPlayMode, matchedInfo = {} } = {} },\n userGameResultRecords: gameResultRecords,\n userLoginState: { notQualifiedType }\n } = state;\n\n if (gameType === gameTypes.INSTAGRAM) {\n return false;\n }\n\n const isQualifiedPlayer = !Boolean(notQualifiedType);\n if (isQualifiedPlayer) {\n const hasGotLatestEntry = Boolean(latestEntry.entryUuid);\n if (!hasGotLatestEntry) {\n return true;\n } else if (isFulFilledEntries(gameType, latestEntry)) {\n const hasReachPlayLimit = isPeriodPlayMode\n ? checkHasReachPeriodPlayLimit({\n gameResultRecords,\n timezone,\n totalPlayTimes,\n matchedInfo\n })\n : checkHasReachPlayLimit({\n gameResultRecords,\n timezone,\n totalPlayTimes,\n dailyPlayTimes\n });\n return !hasReachPlayLimit;\n }\n }\n return false;\n}\n\nexport function normalizeEntryPayload(\n payload = {},\n {\n hasEnableSignUpForm = false,\n hasEnableLotteryInstant = false,\n hasEnableLotteryParticipant = false\n } = {}\n) {\n const {\n id,\n serialNo,\n entryUuid,\n entryFlow: {\n // 已填過表單\n formSignUp = '',\n gameResult = '',\n lotteryInstant = '',\n lotteryParticipant = '',\n partnerOrder,\n qualifyWithdraw,\n // 已填過邀請碼\n mgmReferralCode = ''\n } = {},\n deletedAt\n } = payload;\n const isEntryDeleted = Boolean(deletedAt);\n return {\n entryId: id || serialNo,\n entryUuid,\n gameResultCreatedAt: gameResult,\n hasGameResult: Boolean(gameResult),\n hasSubmitTracking: Boolean(gameResult),\n hasPointReduced: Boolean(partnerOrder || qualifyWithdraw),\n hasReferralCodeInput: Boolean(mgmReferralCode),\n // 所有被刪除的 entry 會被當作可以 略過填表 和 已經配獎,所以會把 hasFilledSignupForm、hasParticipantPrize 直接設定為 true\n // 沒被刪除的 entry 或是新建立的 entry 會根據 entry flow 檢查此 entry 有無填表紀錄(formSignUp) 來設定 hasFilledSignupForm\n hasFilledSignupForm: !isEntryDeleted && hasEnableSignUpForm ? Boolean(formSignUp) : true,\n hasInstantPrize:\n !isEntryDeleted && hasEnableLotteryInstant ? Boolean(lotteryInstant) : true,\n hasParticipantPrize:\n !isEntryDeleted && hasEnableLotteryParticipant ? Boolean(lotteryParticipant) : true\n };\n}\nexport function overwriteEntryAction(entry) {\n // 活動不可玩時,略過填表和配獎\n return { ...entry, hasFilledSignupForm: true, hasParticipantPrize: true };\n}\nexport async function getEntryQualificationInfo({ state, entry = {} }) {\n const {\n promo: { uuid: promoUUID },\n promoState: { reducePointMode, enablePasscodeVerify },\n flags: { isMgmMission, isMgmSelf } = {},\n userGameResultRecords = [],\n settingMGMReferral: { enableReferralCodeRequired } = {}\n } = state;\n const { hasReferralCodeInput } = entry;\n const [isNeedReducePoint, isNeedEnterPasscode] = await PromiseAll([\n checkEntryNeedPoint({\n promoUUID,\n entry: entry,\n reducePointMode\n }),\n checkEntryNeedPasscode({\n promoUUID,\n entryUUID: entry.entryUuid,\n enablePasscodeVerify\n })\n ]);\n\n // 是任務模組 且 當前未有 GameResult 且 當前 Entry 未填邀請 且 啟用邀請碼必填時,一定要填邀請碼\n const isNeedEnterReferralCode = Boolean(\n (isMgmMission || isMgmSelf) &&\n userGameResultRecords.length === 0 &&\n Boolean(enableReferralCodeRequired) &&\n !hasReferralCodeInput\n );\n // 是任務模組 且 當前未有 GameResult 且 當前 Entry 未填邀請碼時,可填邀請碼\n const isCanEnterReferralCode = Boolean(\n (isMgmMission || isMgmSelf) && userGameResultRecords.length === 0 && !hasReferralCodeInput\n );\n\n return {\n isNeedReducePoint,\n isNeedEnterPasscode,\n isNeedEnterReferralCode,\n isCanEnterReferralCode\n };\n}\n","import {\n searchTypes,\n SortTypeMapping\n} from 'ugc/components/workPage/SettingPreviews/defaultGameSetting';\nconst UPDATE_FLAGS = 'flagsUgc/UPDATE_FLAGS';\n\nexport const searchTabType = -1;\nexport const ALL_TASK_UUID = '_all';\n\nexport const apiSortingTypes = {\n [SortTypeMapping.RANDOM]: 'random',\n [SortTypeMapping.RANK]: 'votes',\n [SortTypeMapping.TIME]: 'createdAt'\n};\n\nexport const apiOrderTypes = {\n [SortTypeMapping.RANK]: 'desc',\n [SortTypeMapping.TIME]: 'desc'\n};\n\nexport const apiSearchTypes = {\n [searchTypes.AUTHOR_NAME]: 'author',\n [searchTypes.PORTFOLIO_NAME]: 'title'\n};\n\nconst defaultState = {\n searchTypeOptions: [],\n searchType: searchTypes.NO_SEARCH,\n searchKeyword: '',\n sortingType: SortTypeMapping.TIME,\n noSearchItems: false,\n taskUUID: ALL_TASK_UUID,\n selectedSectionId: ''\n};\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_FLAGS:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function setSearchType(searchType) {\n return {\n type: UPDATE_FLAGS,\n payload: {\n searchType\n }\n };\n}\n\nexport function setSearchKeyword(searchKeyword) {\n return {\n type: UPDATE_FLAGS,\n payload: {\n searchKeyword\n }\n };\n}\n\nexport function setSortingType(sortingType) {\n return {\n type: UPDATE_FLAGS,\n payload: {\n sortingType\n }\n };\n}\n\nexport function setNoSearchItems(status) {\n return {\n type: UPDATE_FLAGS,\n payload: {\n noSearchItems: status\n }\n };\n}\n\nexport function setTaskUUID(taskUUID) {\n return {\n type: UPDATE_FLAGS,\n payload: {\n taskUUID\n }\n };\n}\n","const defaultState = {\n // 紀錄 user 現在配到哪個獎品\n currentPrizeUUID: '',\n currentUnanimationEntriesUUID: '',\n // 代表純獎流程的前置作業都跑好且條件也都滿足了,遊戲隨時可以開始的意思,可以把它作為遊戲動畫觸發的依賴\n isGameReadyToPlay: false\n};\n\nconst UPDATE_PURE_PRIZE_STATE = 'purePrizeState/UPDATE_PURE_PRIZE_STATE';\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_PURE_PRIZE_STATE:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport function setCurrentPrizeUUID(currentPrizeUUID) {\n return {\n type: UPDATE_PURE_PRIZE_STATE,\n payload: {\n currentPrizeUUID\n }\n };\n}\n\nexport function clearCurrentPrizeUUID() {\n return {\n type: UPDATE_PURE_PRIZE_STATE,\n payload: {\n currentPrizeUUID: ''\n }\n };\n}\n\nexport function setCurrentUnanimationEntriesUUID(currentUnanimationEntriesUUID) {\n return {\n type: UPDATE_PURE_PRIZE_STATE,\n payload: {\n currentUnanimationEntriesUUID\n }\n };\n}\n\nexport function clearCurrentUnanimationEntriesUUID() {\n return {\n type: UPDATE_PURE_PRIZE_STATE,\n payload: {\n currentUnanimationEntriesUUID: ''\n }\n };\n}\n\nexport function setGameAlreadyToPlay() {\n return {\n type: UPDATE_PURE_PRIZE_STATE,\n payload: {\n isGameReadyToPlay: true\n }\n };\n}\n\nexport function setGameNotReadyToPlay() {\n return {\n type: UPDATE_PURE_PRIZE_STATE,\n payload: {\n isGameReadyToPlay: false\n }\n };\n}\n\nexport default reducer;\n","import _orderBy from 'lodash/orderBy';\n\nimport { getPromoEntriesList } from 'api/ugc';\nimport {\n searchTabType,\n apiSearchTypes,\n apiSortingTypes,\n apiOrderTypes,\n setNoSearchItems,\n ALL_TASK_UUID\n} from 'client/redux/modules/flagsUgc';\nimport { SortTypeMapping } from 'ugc/components/workPage/SettingPreviews/defaultGameSetting';\n\nconst UPDATE_COLLECTIONS = 'ugcCollections/UPDATE_COLLECTIONS';\nconst CLEAR_COLLECTIONS = 'ugcCollections/CLEAR_COLLECTIONS';\nconst UPDATE_COLLECTIONS_LOCAL_VOTE = 'ugcCollections/UPDATE_COLLECTIONS_LOCAL_VOTE';\n\nconst defaultState = {\n isFetching: false,\n collections: [],\n page: 1,\n perItems: 20,\n totalPage: 1\n};\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_COLLECTIONS:\n return { ...state, ...action.payload };\n case CLEAR_COLLECTIONS: {\n return { ...state, collections: [], totalPage: 0 };\n }\n case UPDATE_COLLECTIONS_LOCAL_VOTE: {\n const { mediaEntryId } = action.payload;\n return {\n ...state,\n collections: state.collections.map(c =>\n c.id === mediaEntryId ? { ...c, mediaLibraryVote: c.mediaLibraryVote + 1 } : c\n )\n };\n }\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nfunction setIsFetchingUgc(status) {\n return {\n type: UPDATE_COLLECTIONS,\n payload: {\n isFetching: status\n }\n };\n}\n\nexport function getUgcCollection({ page, perItems, setIsFetching = true } = {}) {\n return async (dispatch, getState) => {\n try {\n if (setIsFetching) {\n dispatch(setIsFetchingUgc(true));\n }\n const {\n promo: { id: promoId },\n flagsUgc: { searchKeyword, sortingType, searchType, taskUUID },\n ugcCollections: { page: currentPage, perItems: currentPerItems }\n } = getState();\n const p = page ?? currentPage;\n const i = perItems ?? currentPerItems;\n const query = (() => {\n let q = {\n page: p,\n perPage: i\n };\n if (sortingType === searchTabType) {\n q.search = searchKeyword;\n q.searchColumn = apiSearchTypes[searchType];\n } else {\n q.orderColumn = apiSortingTypes[sortingType];\n q.order = apiOrderTypes[sortingType];\n }\n q.taskUuid = taskUUID === ALL_TASK_UUID ? undefined : taskUUID;\n return q;\n })();\n const {\n payload: { items = [], itemSum }\n } = await getPromoEntriesList(promoId, query);\n\n if (items.length === 0 && Boolean(searchKeyword)) {\n dispatch(setNoSearchItems(true));\n } else {\n dispatch(setNoSearchItems(false));\n dispatch({\n type: UPDATE_COLLECTIONS,\n payload: {\n collections: sortUgcMedia(sortingType, convertMediaDatas(items)),\n page: p,\n perItems: i,\n totalPage: Math.ceil(itemSum / i),\n count: itemSum\n }\n });\n }\n } finally {\n if (setIsFetching) {\n dispatch(setIsFetchingUgc(false));\n }\n }\n };\n}\n\nfunction convertMediaDatas(items = []) {\n return items.map(i => {\n let newI = { ...i };\n if (typeof newI.mediaLibraryRank === 'string') {\n newI.mediaLibraryRank = Number(newI.mediaLibraryRank);\n }\n if (typeof newI.mediaLibraryVote === 'string') {\n newI.mediaLibraryVote = Number(newI.mediaLibraryVote);\n }\n return newI;\n });\n}\nfunction sortUgcMedia(sortingType, items = []) {\n const isBackEndRecalculatingRank = items.every(\n i => i.mediaLibraryVote === null && i.mediaLibraryRank === null\n );\n return !isBackEndRecalculatingRank && sortingType === SortTypeMapping.RANKING\n ? _orderBy(items, ['mediaLibraryVote', 'mediaLibraryRank'], ['desc', 'asc'])\n : items;\n}\n\nexport function clearCollection() {\n return {\n type: CLEAR_COLLECTIONS\n };\n}\n\nexport function updateLocationLocalVote(mediaEntryId) {\n return {\n type: UPDATE_COLLECTIONS_LOCAL_VOTE,\n payload: {\n mediaEntryId\n }\n };\n}\n","import i18n from 'i18next';\n\nimport { PromiseAll } from 'api/common';\nimport { getCurrentUtcDTStr } from 'utils/dateTime';\nimport { notQualifiedTypes } from 'config/notQualifiedTypes';\nimport {\n createNewEntry,\n normalizeEntryPayload\n} from 'client/hooks/useInitPromo/userEntryState/getUserEntry';\nimport { suspendPromo } from 'client/redux/modules/promoState';\nimport {\n showPromoNotAvailableErrDialog,\n showCustomErrDialog,\n showPromoUnavailableCloseDialog\n} from 'client/redux/modules/systemErrorDialog';\nimport checkEntryNeedPoint from 'client/hooks/useInitPromo/userEntryState/checkEntryNeedPoint';\nimport checkEntryNeedPasscode from 'client/utils/passcode/checkEntryNeedPasscode';\nimport {\n setGameNotReadyToPlay,\n clearCurrentPrizeUUID,\n clearCurrentUnanimationEntriesUUID\n} from 'client/redux/modules/purePrizeState';\nimport {\n getLotteryConfig,\n lotteryCategories\n} from 'editor/components/SideBar/Prize/configs/prizeTypeConfig';\nimport { lotteryInstantTypes } from 'config/promoLotteryTypes';\n\nconst defaultState = {\n currentEntryId: 0,\n currentEntryUUID: '',\n hasGameResult: false,\n hasSubmitTracking: false,\n hasFilledSignupForm: false,\n // 該 Entry 是否已經配即時獎\n hasInstantPrize: false,\n // 該 Entry 是否已經配參加獎\n hasParticipantPrize: false,\n // 該 Entry 是否已填入邀請碼\n hasReferralCodeInput: false,\n hasPointReduced: false,\n isNeedReducePoint: false,\n // 是否一定要填入邀請碼\n isNeedEnterReferralCode: false,\n isNeedEnterPasscode: false,\n isEntryOverdue: false,\n // 是否可以填入邀請碼\n isCanEnterReferralCode: false,\n createEntryNotQualifiedType: '',\n gameResultCreatedAt: ''\n};\n\nconst UPDATE_USER_ENTRY_STATE = 'userEntryState/UPDATE_USER_ENTRY_STATE';\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_USER_ENTRY_STATE:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport default reducer;\n\nexport function setCurrentEntriesUUID(currentEntryUUID) {\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: {\n currentEntryUUID\n }\n };\n}\n\nexport function successPlayGame() {\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: {\n hasGameResult: true,\n hasSubmitTracking: true,\n gameResultCreatedAt: getCurrentUtcDTStr()\n }\n };\n}\n\nexport function replayGame() {\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: {\n hasGameResult: false\n }\n };\n}\n\nexport function successFillSignUpForm() {\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: {\n hasFilledSignupForm: true\n }\n };\n}\n\n// 通知 user entry,此次 entry 已成功配獎\nexport function successGetWinner(type, participantType) {\n const lotteryCategory = getLotteryConfig(type).category;\n const payloadMapping = {\n [lotteryCategories.IS_INSTANT_LOTTERY]: { hasInstantPrize: true },\n [lotteryCategories.IS_PARTICIPANT_LOTTERY]: { hasParticipantPrize: true }\n };\n if (type === participantType && type === lotteryInstantTypes.JOIN_AND_GET) {\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: { hasParticipantPrize: true }\n };\n }\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: payloadMapping[lotteryCategory]\n };\n}\n\nexport function setNewEntry({\n entryId: currentEntryId,\n entryUuid: currentEntryUUID,\n ...rest\n} = {}) {\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: { ...defaultState, currentEntryId, currentEntryUUID, ...rest }\n };\n}\n\nexport function setNeedReducePoint(status) {\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: {\n isNeedReducePoint: status\n }\n };\n}\n\nexport function setNeedEnterPasscode(status) {\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: {\n isNeedEnterPasscode: status\n }\n };\n}\n\nexport function setCreateEntryNotQualifiedType(type) {\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: {\n createEntryNotQualifiedType: type\n }\n };\n}\n\nexport function setReferralCodeInput(hasReferralCodeInput) {\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: {\n hasReferralCodeInput,\n isNeedEnterReferralCode: !hasReferralCodeInput,\n isCanEnterReferralCode: !hasReferralCodeInput\n }\n };\n}\n\nexport function setEntryOverdueStatus(status = false) {\n return {\n type: UPDATE_USER_ENTRY_STATE,\n payload: {\n isEntryOverdue: status\n }\n };\n}\n\nexport function setUserNewEntry(recaptchaToken) {\n return async (dispatch, getState) => {\n const {\n promo: { uuid },\n signUpForm: { id: formId, enableFilledByEntry },\n lotteryInstant: { uuid: lotteryInstantUUID },\n lotteryParticipant: { uuid: lotteryParticipantUUID },\n promoState: { isPurePrizeGame, isTestMode, reducePointMode, enablePasscodeVerify },\n userEntryState: { hasFilledSignupForm },\n mgmReferral: {\n lotteryParticipant: { uuid: mgmLotteryParticipantUUID } = {},\n lotteryInstant: { uuid: mgmLotteryInstantUUID } = {}\n }\n } = getState();\n const hasEnableSignUpForm = Boolean(formId);\n const hasEnableFilledByEntry = Boolean(enableFilledByEntry);\n const hasEnableLotteryParticipant =\n Boolean(lotteryParticipantUUID) || Boolean(mgmLotteryParticipantUUID);\n const hasEnableLotteryInstant =\n Boolean(lotteryInstantUUID) || Boolean(mgmLotteryInstantUUID);\n\n const {\n entry,\n isPlayTimeLimitError,\n isTotalMonthlyEntryLimitError,\n isNotValidPromoJoinTime,\n isNotValidPromoStatusToJoin,\n createEntryNotQualifiedType\n } = await createNewEntry(uuid, recaptchaToken);\n\n if (createEntryNotQualifiedType) {\n if (\n createEntryNotQualifiedType === notQualifiedTypes.ENTRIES.REACH_LIMIT &&\n isTestMode\n ) {\n dispatch(\n showCustomErrDialog({\n title: i18n.t('label.test_mode'),\n desc: i18n.t('desc.testmode_credit_full')\n })\n );\n } else if (\n createEntryNotQualifiedType === notQualifiedTypes.QUALIFICATION.MEMBER_ORDER\n ) {\n dispatch(\n showCustomErrDialog({\n title: i18n.t('label.no_qualify_join'),\n desc: i18n.t('desc.sorry_no_qualify.name_list')\n })\n );\n } else {\n dispatch(\n showCustomErrDialog({\n title: i18n.t('label.no_qualify_join'),\n desc: i18n.t('desc.sorry_no_qualify')\n })\n );\n }\n return false;\n } else if (isTotalMonthlyEntryLimitError || isPlayTimeLimitError) {\n dispatch(showPromoUnavailableCloseDialog());\n return false;\n } else if (isNotValidPromoJoinTime || isNotValidPromoStatusToJoin) {\n dispatch(suspendPromo());\n dispatch(showPromoNotAvailableErrDialog());\n return false;\n } else {\n const newGameEntry = normalizeEntryPayload(entry, {\n hasEnableSignUpForm,\n hasEnableLotteryInstant,\n hasEnableLotteryParticipant\n });\n dispatch(\n setNewEntry({\n ...newGameEntry,\n hasFilledSignupForm: hasEnableFilledByEntry ? false : hasFilledSignupForm\n })\n );\n\n const [isNeedReducePoint, isNeedEnterPasscode] = await PromiseAll([\n checkEntryNeedPoint({\n promoUUID: uuid,\n entry,\n reducePointMode\n }),\n checkEntryNeedPasscode({\n promoUUID: uuid,\n entryUUID: entry.entryUuid,\n enablePasscodeVerify\n })\n ]);\n dispatch(setNeedReducePoint(isNeedReducePoint));\n dispatch(setNeedEnterPasscode(isNeedEnterPasscode));\n if (isPurePrizeGame) {\n dispatch(setGameNotReadyToPlay());\n dispatch(clearCurrentPrizeUUID());\n dispatch(clearCurrentUnanimationEntriesUUID());\n }\n\n return true;\n }\n };\n}\n","const defaultState = {\n isLogin: false,\n notQualifiedType: '',\n notQualifiedErrInfo: {},\n // 登入當下會拿到 currentLoginID\n currentLoginID: '',\n // 每次 promo init 載入都會拿 登入過的 user 資料\n loginId: ''\n};\n\nconst UPDATE_USER_LOGIN_STATE = 'userLoginState/UPDATE_USER_LOGIN_STATE';\n\nconst reducer = (state = defaultState, action) => {\n switch (action.type) {\n case UPDATE_USER_LOGIN_STATE:\n return { ...state, ...action.payload };\n default:\n return state;\n }\n};\n\nexport function setCurrentLoginID(currentLoginID) {\n return {\n type: UPDATE_USER_LOGIN_STATE,\n payload: {\n currentLoginID\n }\n };\n}\n\nexport function setLoginId(loginId) {\n return {\n type: UPDATE_USER_LOGIN_STATE,\n payload: {\n loginId\n }\n };\n}\n\nexport function setNotQualifiedType(value) {\n return {\n type: UPDATE_USER_LOGIN_STATE,\n payload: {\n notQualifiedType: value\n }\n };\n}\n\nexport default reducer;\n","import * as clientErrTypes from 'config/clientErrorTypes';\nimport { generateApiErrObj } from 'client/hooks/useClientErrorHandler';\nimport { getUserPasscodeStatus } from 'api/client';\nimport { getPasscodeErrorType, errorTypes } from 'config/passcode';\n\nexport default async function checkEntryNeedPasscode({\n promoUUID,\n entryUUID,\n enablePasscodeVerify\n} = {}) {\n if (!enablePasscodeVerify) {\n return false;\n }\n const resp = await getUserPasscodeStatus({\n promoUUID,\n entryUUID\n });\n if (resp.httpStatus === 200) {\n return false;\n } else if (getPasscodeErrorType(resp) === errorTypes.ENTRY_NEED_PASSCODE) {\n return true;\n } else {\n throw generateApiErrObj(resp, clientErrTypes.CHECK_PASSCODE_STATUS);\n }\n}\n","export const notQualifiedTypes = {\n FACEBOOK: {},\n LINE: {\n FRIEND: 'LINE_FRIEND',\n ENTERPRISE_MEMBER_BIND: 'ENTERPRISE_MEMBER_BIND'\n },\n ENTERPRISE: {\n CYBERBIZ_EC_MEMBER: 'CYBERBIZ_EC_MEMBER',\n MEMBER_KKBOX: 'ENTERPRISE_MEMBER_KKBOX',\n MEMBER: 'MEMBER'\n },\n QUALIFICATION: {\n NAME_LIST_API: 'QUALIFICATION_NAME_LIST_API',\n MEMBER_ORDER: 'QUALIFICATION_MEMBER_ORDER',\n NEW_REGISTER_MEMBER: 'NEW_REGISTER_MEMBER',\n SUBMIT_REFERRAL_CODE: 'SUBMIT_REFERRAL_CODE',\n MEMBER_TIER: 'QUALIFICATION_MEMBER_TIER',\n TAG_LIMIT: 'TAG_LIMIT'\n },\n ENTRIES: {\n REACH_LIMIT: 'ENTRIES_REACH_LIMIT'\n }\n};\n"],"names":["getPromoEntriesList","promoId","query","arguments","length","undefined","qs","querystring","stringify","fetches","concat","Boolean","generateFetchOpts","dataKeys","throwErrConfigs","clientErrTypes","r","httpStatus","getPromoEntryResult","entryId","payload","message","getUgcMediaVoteAndRankingInfo","mediaUUID","getContestUgcMediaAndVoteCount","getMediaCacheTotalCounts","_ref","promoUUID","getMediaCacheData","_ref2","firstNum","defaultNum","getAllMediaOfEntry","_ref3","useHasReachPlayTimesLimit","totalPlayTimes","dailyPlayTimes","timezone","useSelector","s","settingPromo","type","promoType","promo","periodPlayMatchedInfo","isPeriodPlayMode","matchedInfo","promoState","userGameResultRecords","useMemo","gameResultRecords","filteredRecords","filter","record","_record$flow","flow","lotteryParticipant","filterGameResultRecords","isCheckGameResultRecordsHasLotteryParticipant","checkHasReachPeriodPlayLimit","checkHasReachPlayLimit","Number","isInteger","match","e","gameResult","createdAt","timezoneDateStr","utcDTStr2TimezoneDTStr","periodStartInTZ","periodEndInTZ","isLocalSameDateInPromoTimezone","useHistoryPathPush","history","useHistory","location","useLocation","search","hash","push","obj","replace","async","checkEntryNeedPoint","entry","reducePointMode","isNeedReducePoint","reducePointModes","POINT_SYSTEMS","hasPointReduced","KK_BOX","entryUuid","resp","checkKKUserExchangePointsStatus","data","status","toLowerCase","code","generateApiErrObj","checkKKBoxPointStatus","isFulFilledEntries","gameType","hasGameResult","hasFilledSignupForm","hasInstantPrize","hasParticipantPrize","isPurePrizeGames","every","getUserGameEntry","dispatch","state","latestEntry","recaptchaToken","uuid","lotteryInstant","lotteryInstantUUID","lotteryParticipantUUID","signUpForm","id","signUpFormId","enableFilledByEntry","isTestMode","isPlayTimeLimitError","isNotValidPromoJoinTime","isNotValidPromoStatusToJoin","createEntryNotQualifiedType","createNewEntry","suspendPromo","overwriteEntryAction","hasPromoSuspended","notQualifiedTypes","ENTRIES","REACH_LIMIT","gameEntry","normalizeEntryPayload","hasEnableSignUpForm","hasEnableLotteryInstant","hasEnableLotteryParticipant","_previousEntry$flow","previousEntry","find","deletedAt","formSignUp","createUserEntries","isCreateEntryTotalMonthlyEntryLimitError","isTotalMonthlyEntryLimitError","isGetEntriesPlayTimeLimitErr","isRequestAtInvalidPromoTime","isErrOfGetEntryWhenPromoInvalid","isGetEntriesLimitError","isErrOfMemberOrderLimit","QUALIFICATION","MEMBER_ORDER","isErrOfTagLimit","TAG_LIMIT","getCreateEntryNotQualifedType","getUserLatestEntry","getUserLatestEntries","checkShouldGetNextEntry","userLoginState","notQualifiedType","gameTypes","INSTAGRAM","serialNo","entryFlow","partnerOrder","qualifyWithdraw","mgmReferralCode","isEntryDeleted","gameResultCreatedAt","hasSubmitTracking","hasReferralCodeInput","getEntryQualificationInfo","_ref4","enablePasscodeVerify","flags","isMgmMission","isMgmSelf","settingMGMReferral","enableReferralCodeRequired","isNeedEnterPasscode","PromiseAll","checkEntryNeedPasscode","entryUUID","isNeedEnterReferralCode","isCanEnterReferralCode","UPDATE_FLAGS","searchTabType","ALL_TASK_UUID","apiSortingTypes","SortTypeMapping","RANDOM","RANK","TIME","apiOrderTypes","apiSearchTypes","searchTypes","AUTHOR_NAME","PORTFOLIO_NAME","defaultState","searchTypeOptions","searchType","NO_SEARCH","searchKeyword","sortingType","noSearchItems","taskUUID","selectedSectionId","action","setSearchType","setSearchKeyword","setSortingType","setNoSearchItems","setTaskUUID","currentPrizeUUID","currentUnanimationEntriesUUID","isGameReadyToPlay","UPDATE_PURE_PRIZE_STATE","setCurrentPrizeUUID","clearCurrentPrizeUUID","setCurrentUnanimationEntriesUUID","clearCurrentUnanimationEntriesUUID","setGameAlreadyToPlay","setGameNotReadyToPlay","UPDATE_COLLECTIONS","CLEAR_COLLECTIONS","UPDATE_COLLECTIONS_LOCAL_VOTE","isFetching","collections","page","perItems","totalPage","mediaEntryId","map","c","mediaLibraryVote","setIsFetchingUgc","getUgcCollection","setIsFetching","getState","flagsUgc","ugcCollections","currentPage","currentPerItems","p","i","q","perPage","searchColumn","orderColumn","order","taskUuid","items","itemSum","sortUgcMedia","convertMediaDatas","Math","ceil","count","newI","mediaLibraryRank","RANKING","_orderBy","clearCollection","updateLocationLocalVote","currentEntryId","currentEntryUUID","isEntryOverdue","UPDATE_USER_ENTRY_STATE","successPlayGame","getCurrentUtcDTStr","replayGame","successFillSignUpForm","successGetWinner","participantType","lotteryCategory","getLotteryConfig","category","payloadMapping","lotteryCategories","IS_INSTANT_LOTTERY","IS_PARTICIPANT_LOTTERY","lotteryInstantTypes","JOIN_AND_GET","setNeedReducePoint","setNeedEnterPasscode","setReferralCodeInput","setEntryOverdueStatus","setUserNewEntry","formId","isPurePrizeGame","userEntryState","mgmReferral","mgmLotteryParticipantUUID","mgmLotteryInstantUUID","hasEnableFilledByEntry","showCustomErrDialog","title","i18n","t","desc","showPromoUnavailableCloseDialog","showPromoNotAvailableErrDialog","rest","setNewEntry","isLogin","notQualifiedErrInfo","currentLoginID","loginId","UPDATE_USER_LOGIN_STATE","setCurrentLoginID","setLoginId","setNotQualifiedType","value","getUserPasscodeStatus","getPasscodeErrorType","errorTypes","ENTRY_NEED_PASSCODE","FACEBOOK","LINE","FRIEND","ENTERPRISE_MEMBER_BIND","ENTERPRISE","CYBERBIZ_EC_MEMBER","MEMBER_KKBOX","MEMBER","NAME_LIST_API","NEW_REGISTER_MEMBER","SUBMIT_REFERRAL_CODE","MEMBER_TIER"],"sourceRoot":""}