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KiC,EAAS,CAAE0H,OATpB,WACID,GAAU,EACd,KAQQrL,EAAAA,EAAAA,KAACuD,EAAAA,EAAY,CACT6H,OAAQA,EACRG,MAAOC,EACPhI,MAAOV,EAAAA,EAAKC,EAAE,0BACdU,MAAMzD,EAAAA,EAAAA,KAACyL,EAAW,CAAClB,KAAMH,EAAME,KAAMlK,IAAKA,IAC1CsD,WAZZ,WACI2H,GAAU,EACd,IAcJ,EAIMG,EAAW,CAAAhJ,KAAA,UAAAmB,OAAA,uG,kDC/BF,SAAS+H,EAAmBtL,GACvC,MAAM,UAAEuL,EAAS,aAAEC,GAAiBC,EAAAA,EAAYC,MAAMtC,OAAOE,SAASqC,QAChEC,GAAwC,IAAtB5L,EAAI6L,QAAQ,KAAc,IAAM,IAElDC,EACFxK,QAAQiK,IAAcjK,QAAQkK,GAAa,GAAA3K,OAClC+K,EAAe,cAAA/K,OAAa0K,EAAS,kBAAA1K,OAAiB2K,GACzD,GACV,MAAM,GAAN3K,OAAUb,GAAGa,OAAGiL,EACpB,C","sources":["client/components/ResponsiveUgcProxyPicture.js","client/components/Result/Share/NativeShare.js","client/components/Result/Share/NativeShareWrapper.js","client/game_photoContest/hooks/useIsContestUgcModule.js","client/game_photoContest/hooks/useReduxSelector.js","config/promoGameTypesClientConfig.js","config/ugcTypes.js","client/components/Result/Share/SocialShare.js","ugc/components/ShareDialogWrapper.js","ugc/utils/getUrlWrapTestCode.js"],"sourcesContent":["import React, { useRef } from 'react';\nimport { convertProxyImgUrl } from 'client/utils/getProxyImgUrl';\nimport LazyLoadImg from 'client/components/LazyLoadImg';\n\nexport default function ResponsiveUgcProxyPicture({\n src = '',\n alt,\n onLoad = () => {},\n breakPointConfigs = {},\n enableLazyLoad = false,\n ...restProps\n}) {\n const { normal = {}, ...rest } = breakPointConfigs;\n const mediaConfigs = Object.entries(rest);\n const isError = useRef(false);\n const img = (\n {\n if (!isError.current) {\n e.target.src = src;\n isError.current = true;\n }\n }}\n alt={alt}\n onLoad={onLoad}\n {...restProps}\n />\n );\n if (mediaConfigs.length > 0) {\n const sources = mediaConfigs.map(([breakpoint, config = {}]) => (\n \n ));\n return (\n \n {sources}\n {img}\n \n );\n } else {\n return img;\n }\n}\n","import React, { useState } from 'react';\nimport { css } from '@emotion/core';\nimport PropTypes from 'prop-types';\nimport i18n from 'i18next';\n\nimport Button from 'Mui/Button';\nimport ShareIcon from '@material-ui/icons/Share';\nimport Popover from '@material-ui/core/Popover';\nimport Typography from '@material-ui/core/Typography';\n\nimport DialogSystem from 'client/components/DialogSystem';\n\nfunction NativeShare({ shareData }) {\n const [showError, setShowError] = useState(false);\n const [anchorEl, setAnchorEl] = useState(null);\n const open = Boolean(anchorEl);\n\n function showErrorHint() {\n setShowError(true);\n }\n function closeErrorHint() {\n setShowError(false);\n }\n\n function handleClick(event) {\n setAnchorEl(event.currentTarget);\n }\n\n function handleClose() {\n setAnchorEl(null);\n }\n\n async function shareUrl(event) {\n try {\n await navigator.share(shareData).catch(err => {\n const { name } = err;\n if (name === 'NotAllowedError') {\n showErrorHint();\n }\n });\n } catch (error) {\n handleClick(event);\n }\n }\n return (\n <>\n \n \n \n {i18n.t('label.share_failed')}\n \n \n {showError && (\n \n )}\n \n );\n}\n\nNativeShare.propTypes = {\n shareData: PropTypes.shape({\n title: PropTypes.string,\n url: PropTypes.string\n })\n};\n\nexport default NativeShare;\n\nconst buttonStyle = css`\n border-radius: 28px;\n padding: 8px 16px;\n min-width: 120px;\n`;\n\nconst iconStyle = css`\n padding-right: 2px;\n`;\n","import React from 'react';\n\nimport NativeShare from 'client/components/Result/Share/NativeShare';\n\nfunction NativeShareWrapper({ title, url, children }) {\n const shareData = {\n title,\n url: url\n };\n const canUseShare =\n navigator.canShare && navigator.canShare(shareData) && /Mobi/i.test(navigator.userAgent);\n\n return <>{canUseShare ? : children};\n}\n\nexport default NativeShareWrapper;\n","import { useSelector } from 'react-redux';\n\nimport { isUgcGames, isContestGamesWithSecondaryUgc } from 'config/promoGameTypes';\nimport { IS_PROMO_FLOW } from 'config/envVariable';\n\nexport default function useIsContestUgcModule() {\n const { type: gameType } = useSelector(s => s.promo);\n const secondaryGameType = useSelector(s => s.relatedTwinsPromo?.promo?.type);\n const isContestUgcModule = IS_PROMO_FLOW\n ? isUgcGames(gameType) && isContestGamesWithSecondaryUgc(secondaryGameType)\n : isUgcGames(secondaryGameType) && isContestGamesWithSecondaryUgc(gameType);\n return isContestUgcModule;\n}\n","import { useSelector } from 'react-redux';\n\nimport { IS_PROMO_FLOW } from 'config/envVariable';\n\nimport useIsContestUgcModule from 'client/game_photoContest/hooks/useIsContestUgcModule';\n\nexport function useSecondaryPromoSelector(selector = () => {}) {\n const isContestUgcModule = useIsContestUgcModule();\n const rootSelector = (() => {\n if (IS_PROMO_FLOW) {\n return s => s;\n } else {\n return isContestUgcModule ? s => s.relatedTwinsPromo : s => s;\n }\n })();\n\n return useSelector(s => selector(rootSelector(s) ?? {}));\n}\n\nexport function usePrimaryPromoSelector(selector = () => {}) {\n const isContestUgcModule = useIsContestUgcModule();\n const rootSelector = (() => {\n if (IS_PROMO_FLOW) {\n return isContestUgcModule ? s => s.relatedTwinsPromo : s => s;\n } else {\n return s => s;\n }\n })();\n\n return useSelector(s => selector(rootSelector(s) ?? {}));\n}\n","import {\n gameTypes,\n isContestGamesWithSecondaryUgc,\n isUgcGames,\n isPurePrizeGames\n} from 'config/promoGameTypes';\nimport { lotteryInstantTypes } from './promoLotteryTypes';\n\nconst lotteryShouldOpenWinnerAfterGet = new Set([lotteryInstantTypes.JOIN_AND_GET]);\n// 配獎後,要馬上開獎,不需要看動畫\nexport function isLotteryShouldOpenWinnerAfterGet(lotteryType) {\n return lotteryShouldOpenWinnerAfterGet.has(lotteryType);\n}\n\nconst gameShouldOpenWinnerAfterGet = new Set([\n gameTypes.SIGN_FORM,\n gameTypes.INVOICE,\n gameTypes.PURCHASE_REWARD,\n gameTypes.SIGN_UP,\n gameTypes.ORDER_REWARD,\n gameTypes.CART_REWARD\n]);\nexport function isGameShouldOpenWinnerAfterGet(gameType) {\n return gameShouldOpenWinnerAfterGet.has(gameType);\n}\n\n// 不顯示再次參加的按鈕 (單純返回參加頁)\nconst doNotShowBackToJoinPageBtnGames = new Set([\n gameTypes.CHECK_IN,\n gameTypes.PSYCHO_QUIZ,\n gameTypes.QUIZ,\n gameTypes.CHALLENGE_PHOTO_FRAME_COMPOSITE,\n gameTypes.POINTS_REDEEM,\n gameTypes.MGM_SHARE,\n gameTypes.MULTI_CHALLENGE\n]);\nexport function isDoNotShowBackToJoinPageBtnGames(gameType) {\n return doNotShowBackToJoinPageBtnGames.has(gameType);\n}\n\n// 不顯示再次參加的按鈕 (會建立新 Entry)\nconst doNotShowPlayNewEntryBtnGames = new Set([\n gameTypes.CHALLENGE_PHOTO_FRAME_COMPOSITE,\n gameTypes.INSTAGRAM,\n gameTypes.POINTS_REDEEM,\n gameTypes.MULTI_CHALLENGE\n]);\nexport function isDoNotShowPlayNewEntryBtnGames(gameType) {\n return doNotShowPlayNewEntryBtnGames.has(gameType);\n}\n\n// 參加即結果頁的參加紀錄按鈕會額外寫在其他位置\nconst doNotShowCheckRecordsBtnGames = new Set([\n gameTypes.CHECK_IN,\n gameTypes.CHALLENGE_PHOTO_FRAME_COMPOSITE,\n gameTypes.POINTS_REDEEM,\n gameTypes.MGM_SHARE,\n gameTypes.MULTI_CHALLENGE\n]);\nexport function isDoNotShowCheckRecordsBtnGames(gameType) {\n return doNotShowCheckRecordsBtnGames.has(gameType);\n}\n\n// 隱藏結果頁面 Share 區塊\nconst hideEntryResultShareGames = new Set([\n gameTypes.PHOTO_UPLOAD,\n gameTypes.PHOTO_FRAME_COMPOSITE,\n gameTypes.VIDEO_UPLOAD,\n gameTypes.SIGN_UP\n]);\nexport function isShowEntryResultShareButton(gameType) {\n return !isContestGamesWithSecondaryUgc(gameType) && !hideEntryResultShareGames.has(gameType);\n}\n\n// 隱藏結果頁面 Entry 清單\nconst hideEntryResultEntryListGames = new Set([gameTypes.SIGN_UP, gameTypes.MEMORY_MATCH]);\nexport function isShowEntryResultEntryLists(gameType) {\n return !hideEntryResultEntryListGames.has(gameType);\n}\n\nconst showResultDownloadBtn = new Set([\n gameTypes.PHOTO_FRAME_COMPOSITE,\n gameTypes.CHALLENGE_PHOTO_FRAME_COMPOSITE,\n gameTypes.PSYCHO_QUIZ,\n gameTypes.QUIZ\n]);\nexport function isShowResultDownloadBtnGame(gameType) {\n return showResultDownloadBtn.has(gameType);\n}\n\nconst showUgcResultReuploadBtnGame = new Set([gameTypes.CHALLENGE_PHOTO_FRAME_COMPOSITE]);\nexport function isShowUgcResultReuploadBtnGame(gameType) {\n return showUgcResultReuploadBtnGame.has(gameType);\n}\n\n// 參加即結果頁\nconst noResultPageGames = new Set([\n gameTypes.CHECK_IN,\n gameTypes.CHALLENGE_PHOTO_FRAME_COMPOSITE,\n gameTypes.POINTS_REDEEM,\n gameTypes.MGM_SHARE,\n gameTypes.MULTI_CHALLENGE\n]);\nexport function isNoResultPageGames(gameType) {\n return noResultPageGames.has(gameType);\n}\n\n//不需要參加者紀錄\nconst noNeedJoinGameRecord = new Set([gameTypes.MGM_SHARE]);\nexport function isNoNeedJoinGameRecord(gameType) {\n return noNeedJoinGameRecord.has(gameType);\n}\n\n// 遊戲可多次遊玩會有多筆結果\nconst multiResultEntriesGames = new Set([\n gameTypes.SIGN_FORM,\n gameTypes.INVOICE,\n gameTypes.PURCHASE_REWARD,\n gameTypes.SURVEY,\n gameTypes.ORDER_REWARD,\n gameTypes.CART_REWARD\n]);\nexport function isMultiResultEntriesGames(gameType) {\n return (\n isUgcGames(gameType) ||\n isPurePrizeGames(gameType) ||\n isContestGamesWithSecondaryUgc(gameType) ||\n multiResultEntriesGames.has(gameType)\n );\n}\n\nconst canReplayCurrentEntryGames = new Set([gameTypes.MEMORY_MATCH]);\nexport function isCanReplayCurrentEntryGame(gameType) {\n return canReplayCurrentEntryGames.has(gameType);\n}\n\nconst ugcShowOriginalImgRatio = new Set([\n gameTypes.PHOTO_FRAME_COMPOSITE,\n gameTypes.CHALLENGE_PHOTO_FRAME_COMPOSITE\n]);\nexport function isUgcGamesShowOriginalImgRatio(gameType) {\n return ugcShowOriginalImgRatio.has(gameType);\n}\n\n// 兌點模組的開獎、配獎不會做在 result header component\nconst doNotShowOpenWinnerBtnGame = new Set([gameTypes.POINTS_REDEEM]);\nexport function isCanShowOpenWinnerBtnGame(gameType) {\n return !doNotShowOpenWinnerBtnGame.has(gameType);\n}\n\n// 兌點模組的填表按鈕不會做在 result header component\nconst doNotShowSignUpFormBtnGame = new Set([gameTypes.POINTS_REDEEM, gameTypes.MULTI_CHALLENGE]);\nexport function isCanShowSignUpFormBtnGame(gameType) {\n return !doNotShowSignUpFormBtnGame.has(gameType);\n}\n\n// 跳過 Mask Flow 檢查機制\nconst hasPassMaskFlowGames = new Set([gameTypes.SIGN_UP, gameTypes.CONTEST_ADMIN_UPLOAD]);\nexport function isPassMaskFlowGames(gameType) {\n return hasPassMaskFlowGames.has(gameType);\n}\n\nconst shouldNotEnterPasscodeEachTimeGames = new Set([\n gameTypes.PURCHASE_REWARD,\n gameTypes.ORDER_REWARD,\n gameTypes.CART_REWARD\n]);\nexport function hasShouldNotEnterPasscodeEachTimeGames(gameType) {\n return shouldNotEnterPasscodeEachTimeGames.has(gameType);\n}\n","// Youtube, Fb...\nconst VIDEO = 'video';\n// Photo, Frame...\nconst IMAGE = 'image';\n\nexport default { VIDEO, IMAGE };\n","import React, { useState, useRef } from 'react';\nimport { isMobile } from 'react-device-detect';\nimport PropTypes from 'prop-types';\nimport i18n from 'i18next';\nimport { css } from '@emotion/core';\nimport Typography from '@material-ui/core/Typography';\nimport IconButton from '@material-ui/core/IconButton';\nimport Popover from '@material-ui/core/Popover';\nimport { IS_IFRAME_MODE } from 'config/envVariable';\n\nconst facebookShare = url => () => {\n const fbShareUrl = 'https://www.facebook.com/sharer/sharer.php?u=' + url;\n if (isMobile) {\n if (IS_IFRAME_MODE) window.top.location = fbShareUrl;\n else window.location.href = fbShareUrl;\n } else window.open(fbShareUrl, '', 'toolbar=0,status=0,width=580,height=325');\n};\n\nconst socialShare = (type, url) => () => {\n const shareUrl = {\n line: `https://line.me/R/msg/text/?${encodeURIComponent(url)}`,\n pcLine: `https://lineit.line.me/share/ui?url=${encodeURIComponent(url)}`,\n twitter: `https://twitter.com/intent/tweet?text=${encodeURIComponent(url)}`,\n whatsapp: `whatsapp://send?text=${encodeURIComponent(url)}`\n };\n\n const targetUrl = !isMobile && type === 'line' ? shareUrl.pcLine : shareUrl[type];\n window.open(targetUrl, '__blank');\n};\n\nexport const modes = {\n COMPACT: 'compact',\n FULL: 'full'\n};\n\nfunction SocialShare({ mode = modes.COMPACT, url }) {\n const urlRef = useRef('');\n const [anchorEl, setAnchorEl] = useState(null);\n\n const open = Boolean(anchorEl);\n\n function handleClick(event) {\n setAnchorEl(event.currentTarget);\n }\n function handleClose() {\n setAnchorEl(null);\n }\n function copyUrl(event) {\n const input = urlRef.current;\n input.type = 'text';\n input.select();\n document.execCommand('copy');\n input.type = 'hidden';\n handleClick(event);\n }\n\n return (\n
\n \n {mode === modes.COMPACT && (\n \n {i18n.t('label.share')}\n \n )}\n
\n \n \n \n {mode === modes.FULL && Facebook}\n
\n
\n \n \n \n {mode === modes.FULL && Line}\n
\n
\n \n \n \n {mode === modes.FULL && Twitter}\n
\n
\n \n \n \n {mode === modes.FULL && Whatsapp}\n
\n
\n \n \n \n {mode === modes.FULL && Link}\n
\n \n {i18n.t('label.share_url')}\n \n
\n );\n}\n\nSocialShare.propTypes = {\n url: PropTypes.string\n};\n\nexport default SocialShare;\n\nconst textStyle = css`\n margin-left: 8px;\n`;\n\nconst btnStyle = css`\n margin: 0 5px;\n`;\n\nconst iconStyle = css`\n width: 36px;\n height: 36px;\n`;\n\nconst containerStyle = css`\n padding: 2px;\n display: flex;\n align-items: center;\n border-radius: 22px;\n backdrop-filter: blur(8px);\n background-color: rgb(255 255 255 / 32%);\n & button:last-child {\n margin-right: 0;\n }\n & > div {\n padding: 0 4px;\n }\n`;\n","import React, { useState } from 'react';\nimport { css } from '@emotion/core';\nimport i18n from 'i18next';\n\nimport DialogSystem from 'client/components/DialogSystem';\nimport SocialShare, { modes } from 'client/components/Result/Share/SocialShare';\n\nfunction ShareDialogWrapper({ url, children = () => {} }) {\n const [isOpen, setIsOpen] = useState(false);\n\n function handleOpen() {\n setIsOpen(true);\n }\n function handleClose() {\n setIsOpen(false);\n }\n\n return (\n <>\n {children({ onOpen: handleOpen })}\n }\n closePopup={handleClose}\n />\n \n );\n}\n\nexport default ShareDialogWrapper;\n\nconst dialogStyle = css`\n min-width: 355px;\n & .MuiDialogContent-root > div {\n padding: 16px;\n }\n & .MuiDialogActions-root {\n display: none;\n }\n`;\n","import querystring from 'query-string';\n\nexport default function getUrlWrapTestCode(url) {\n const { test_code, test_expired } = querystring.parse(window.location.search);\n const queryConnectStr = url.indexOf('?') === -1 ? '?' : '&';\n\n const testQueryStrings =\n Boolean(test_code) && Boolean(test_expired)\n ? `${queryConnectStr}test_code=${test_code}&test_expired=${test_expired}`\n : '';\n return `${url}${testQueryStrings}`;\n}\n"],"names":["ResponsiveUgcProxyPicture","_ref","src","alt","onLoad","breakPointConfigs","enableLazyLoad","restProps","normal","rest","mediaConfigs","Object","entries","isError","useRef","img","___EmotionJSX","LazyLoadImg","_extends","convertProxyImgUrl","url","onError","e","current","target","length","sources","map","_ref2","breakpoint","config","key","media","concat","srcSet","shareData","showError","setShowError","useState","anchorEl","setAnchorEl","open","Boolean","React","Button","variant","color","css","buttonStyle","onClick","async","event","navigator","share","catch","err","name","error","currentTarget","handleClick","ShareIcon","iconStyle","i18n","t","Popover","onClose","anchorOrigin","vertical","horizontal","transformOrigin","Typography","DialogSystem","title","body","closePopup","styles","children","canUseShare","canShare","test","userAgent","NativeShare","useIsContestUgcModule","type","gameType","useSelector","s","promo","secondaryGameType","_s$relatedTwinsPromo","relatedTwinsPromo","IS_PROMO_FLOW","isUgcGames","isContestGamesWithSecondaryUgc","useSecondaryPromoSelector","selector","arguments","undefined","isContestUgcModule","rootSelector","_rootSelector","usePrimaryPromoSelector","_rootSelector2","lotteryShouldOpenWinnerAfterGet","Set","lotteryInstantTypes","JOIN_AND_GET","isLotteryShouldOpenWinnerAfterGet","lotteryType","has","gameShouldOpenWinnerAfterGet","gameTypes","SIGN_FORM","INVOICE","PURCHASE_REWARD","SIGN_UP","ORDER_REWARD","CART_REWARD","isGameShouldOpenWinnerAfterGet","doNotShowBackToJoinPageBtnGames","CHECK_IN","PSYCHO_QUIZ","QUIZ","CHALLENGE_PHOTO_FRAME_COMPOSITE","POINTS_REDEEM","MGM_SHARE","MULTI_CHALLENGE","isDoNotShowBackToJoinPageBtnGames","doNotShowPlayNewEntryBtnGames","INSTAGRAM","isDoNotShowPlayNewEntryBtnGames","doNotShowCheckRecordsBtnGames","isDoNotShowCheckRecordsBtnGames","PHOTO_UPLOAD","PHOTO_FRAME_COMPOSITE","VIDEO_UPLOAD","hideEntryResultEntryListGames","MEMORY_MATCH","isShowEntryResultEntryLists","showResultDownloadBtn","isShowResultDownloadBtnGame","showUgcResultReuploadBtnGame","isShowUgcResultReuploadBtnGame","noResultPageGames","isNoResultPageGames","noNeedJoinGameRecord","isNoNeedJoinGameRecord","multiResultEntriesGames","SURVEY","isMultiResultEntriesGames","isPurePrizeGames","ugcShowOriginalImgRatio","isUgcGamesShowOriginalImgRatio","doNotShowOpenWinnerBtnGame","isCanShowOpenWinnerBtnGame","doNotShowSignUpFormBtnGame","isCanShowSignUpFormBtnGame","hasPassMaskFlowGames","CONTEST_ADMIN_UPLOAD","isPassMaskFlowGames","shouldNotEnterPasscodeEachTimeGames","hasShouldNotEnterPasscodeEachTimeGames","VIDEO","IMAGE","facebookShare","fbShareUrl","isMobile","IS_IFRAME_MODE","window","top","location","href","socialShare","shareUrl","line","encodeURIComponent","pcLine","twitter","whatsapp","targetUrl","modes","COMPACT","FULL","mode","urlRef","containerStyle","value","ref","textStyle","IconButton","btnStyle","size","input","select","document","execCommand","isOpen","setIsOpen","onOpen","style","dialogStyle","SocialShare","getUrlWrapTestCode","test_code","test_expired","querystring","parse","search","queryConnectStr","indexOf","testQueryStrings"],"sourceRoot":""}