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C,kBAAmB,CAAC,SAGXC,EAAmB,CAC5BC,EACApB,EACAqB,KAEA,MAAMC,EAAOZ,EAASV,GACtB,IAAIuB,EAAe,IAAIC,IAAIJ,EAAcK,OAAOC,SAASC,QAEzD,IAAK,MAAMtC,KAAOiC,EAAM,CACpB,MAAMM,EAAQP,EAAgBhC,GAC9B,IAAKuC,EACD,MAEAL,EAAaM,aAAaC,OAAOzC,EAAKuC,EAAMG,WAEpD,CACA,MAAO,GAAGR,EAAaS,WAAWT,EAAaU,QAAQ,EAG9CC,EAAoB,oBAEpBC,EAAqB,IACNC,aAAaC,QAAQH,GAKtCI,KAAKC,MAAMH,aAAaC,QAAQH,IAH5B,KAMF3B,EAAwBN,IACjCmC,aAAaI,QAAQN,EAAmBI,KAAKG,UAAUxC,GAAQ,C","sources":["webpack://core-webapp/./src/components/video_list_nav/video_list_nav.ts","webpack://core-webapp/./src/components/video_list_nav/index.ts","webpack://core-webapp/./src/modules/photos/pages/list.ts","webpack://core-webapp/./src/modules/photos/list.ts","webpack://core-webapp/./src/modules/photos/utils.ts"],"sourcesContent":["export class VideoListNav {\n open: boolean;\n activeList: string | null;\n\n constructor() {\n this.open = false;\n this.activeList = null;\n }\n\n openList(key: string): void {\n this.activeList = key;\n this.open = true;\n }\n\n closeList(): void {\n this.activeList = null;\n this.open = false;\n }\n}\n","import { VideoListNav } from './video_list_nav';\n\nAlpine.data('videoListNav', () => new VideoListNav());\n","import { isValidPageId, storeNextPhotoValues } from '../utils';\n\nexport class PhotosList {\n pageId: PageId;\n tag?: string;\n pageNumber: number;\n\n constructor(pageId: PageId, pageNumber: number = 1, tag?: string) {\n this.pageId = pageId;\n this.pageNumber = pageNumber;\n if (tag) {\n this.tag = tag;\n }\n }\n\n setNextPhotoValues(id: string) {\n const pageId = this.pageId;\n const page = isValidPageId(pageId) ? pageId : null;\n\n const values: PageData = {\n page,\n id,\n page_number: this.pageNumber,\n ...(this.tag ? { tag: this.tag } : {}),\n };\n\n storeNextPhotoValues(values);\n }\n}\n","import Alpine from 'alpinejs';\nimport { PhotosList } from './pages/list';\n\nAlpine.data(\n 'photosList',\n (pageId: PageId, pageNumber: number, tag?: string) => new PhotosList(pageId, pageNumber, tag)\n);\n","export const isValidPageId = (pageId: string) =>\n new Set([\n 'photos_trending_page',\n 'photos_newest_page',\n 'photos_trending_landing_page',\n 'photos_newest_landing_page',\n 'photos_search_page',\n 'creator_profile_page',\n 'photo_related_page',\n 'photo_random_page',\n ]).has(pageId as PageId);\n\nconst pageKeys: Record = {\n photos_search_page: ['page', 'page_number', 'tag'],\n creator_profile_page: ['page', 'page_number', 'id'],\n photos_trending_page: ['page', 'page_number'],\n photos_newest_page: ['page', 'page_number'],\n photos_newest_landing_page: ['page', 'page_number'],\n photos_trending_landing_page: ['page', 'page_number'],\n photo_related_page: ['page'],\n photo_random_page: ['page'],\n};\n\nexport const assemblePhotoUrl = (\n photoBaseUrl: string,\n pageId: keyof typeof pageKeys,\n nextPhotoValues: PageData\n): string => {\n const keys = pageKeys[pageId];\n let assembledURL = new URL(photoBaseUrl, window.location.origin);\n\n for (const key of keys) {\n const value = nextPhotoValues[key];\n if (!value) {\n break;\n } else {\n assembledURL.searchParams.append(key, value.toString());\n }\n }\n return `${assembledURL.pathname}${assembledURL.search}`;\n};\n\nexport const NEXT_PHOTO_VALUES = 'next_photo_values';\n\nexport const getNextPhotoValues = (): PageData | null => {\n const nextPhotoValues = localStorage.getItem(NEXT_PHOTO_VALUES);\n if (!nextPhotoValues) {\n return null;\n }\n\n return JSON.parse(localStorage.getItem(NEXT_PHOTO_VALUES));\n};\n\nexport const storeNextPhotoValues = (values: PageData) => {\n localStorage.setItem(NEXT_PHOTO_VALUES, JSON.stringify(values));\n};\n"],"names":["VideoListNav","openList","key","this","activeList","open","closeList","constructor","Alpine","data","PhotosList","setNextPhotoValues","id","pageId","values","page","isValidPageId","page_number","pageNumber","tag","storeNextPhotoValues","Set","has","pageKeys","photos_search_page","creator_profile_page","photos_trending_page","photos_newest_page","photos_newest_landing_page","photos_trending_landing_page","photo_related_page","photo_random_page","assemblePhotoUrl","photoBaseUrl","nextPhotoValues","keys","assembledURL","URL","window","location","origin","value","searchParams","append","toString","pathname","search","NEXT_PHOTO_VALUES","getNextPhotoValues","localStorage","getItem","JSON","parse","setItem","stringify"],"sourceRoot":""}