{"version":3,"sources":["webpack://@lemon8/web-seo/./client/components/view-tracker/view-observer.ts","webpack://@lemon8/web-seo/./client/models/enable-pintrk.ts","webpack://@lemon8/web-seo/./client/utils/active/schema.ts","webpack://@lemon8/web-seo/./client/utils/active/index.ts","webpack://@lemon8/web-seo/./client/utils/active/use-page-active.ts","webpack://@lemon8/web-seo/./client/utils/click-position.ts","webpack://@lemon8/web-seo/./client/utils/is-mobile-user.ts","webpack://@lemon8/web-seo/./client/utils/libra/use-basic-condition.ts","webpack://@lemon8/web-seo/./client/utils/libra/seo-reflow-v4.ts","webpack://@lemon8/web-seo/./client/utils/libra/inp.ts","webpack://@lemon8/web-seo/./client/utils/libra/kep-hashtag-pos-opt.ts","webpack://@lemon8/web-seo/./client/utils/libra/kep-post-lazy.ts","webpack://@lemon8/web-seo/./client/utils/module-type.ts","webpack://@lemon8/web-seo/./client/utils/use-reflow-click.ts","webpack://@lemon8/web-seo/./client/utils/use-view-tracking.ts","webpack://@lemon8/web-seo/../libs/lemon8-web-app-shared/dist/esm/ssr/data-injector/common.js","webpack://@lemon8/web-seo/../libs/lemon8-web-app-shared/dist/esm/ssr/data-injector/csr.js","webpack://@lemon8/web-seo/../libs/lemon8-web-app-shared/dist/esm/ssr/data-injector/index.js","webpack://@lemon8/web-seo/../libs/lemon8-web-app-shared/dist/esm/ssr/data-injector/ssr.js","webpack://@lemon8/web-seo/../libs/lemon8-web-app-shared/dist/esm/ssr/i18n-provider/index.js","webpack://@lemon8/web-seo/../libs/lemon8-web-app-shared/dist/esm/ssr/index.js","webpack://@lemon8/web-seo/../libs/lemon8-web-app-shared/dist/esm/ssr/remix-page/index.js","webpack://@lemon8/web-seo/../libs/lemon8-web-app-shared/dist/esm/ssr/scoped-provider/hooks.js","webpack://@lemon8/web-seo/../libs/lemon8-web-app-shared/dist/esm/ssr/scoped-provider/index.js","webpack://@lemon8/web-seo/../libs/lemon8-web-app-shared/dist/esm/ssr/use-route-loader.js"],"names":["buildThreshold","steps","arguments","length","undefined","Array","from","_x","i","DEFAULT_ERROR_MARGIN","DEFAULT_MARGIN","DEFAULT_OPTIONS","errorMargin","defaultMargin","percentCompensation","minTimeVisible","useExistedInstance","config","root","rootMargin","threshold","Math","min","instance","_ViewObserver","constructor","_this","options","_watchElements","entries","containerHeight","window","innerHeight","document","documentElement","clientHeight","filter","entry","isIntersecting","forEach","node","target","element","elements","get","elementHeight","boundingClientRect","getBoundingClientRect","height","_isElementHeightSimilarToContainer","maxIntersectionRatio","isVisible","intersectionRatio","timeoutSet","timeouts","set","setTimeout","_onVisibilityChange","timeout","clearTimeout","delete","observe","callback","visible","observer","unobserve","_reportVisibilityStates","_ref","Object","assign","isNaN","Map","IntersectionObserver","_addEventListeners","destroy","clear","disconnect","_removeEventListeners","addEventListener","removeEventListener","ViewObserver","Factory","$EnablePintrk","atom","region","ipRegion","$Locale","enterHref","href","$RootTraffic","includes","EURO_COUNTRY_SET","isArticleSchemaBuildingProps","input","pageType","isVideoSchemaBuildingProps","isUserSchemaBuildingProps","isCategorySchemaBuildingProps","isHashtagSchemaBuildingProps","isPOISchemaBuildingProps","isSearchSchemaBuildingProps","buildSearchSchema","props","query","baseUrl","data","tab","inputClickType","logExtra","search_page_from","search_from","previous_page_name","concat","encodeURIComponent","JSON","stringify","buildSchema","protocol","host","params","URLSearchParams","group_id","groupId","authorId","user_id","userId","channel_id","String","categoryId","hashtag_id","hashtagId","poi_id","poiId","Error","append","pid","campaign","toString","modifyURLForSEM","onelink","URL","location","searchParams","parameter","value","modifyURLForPinterest","generateOneLink","schemaOption","ampExtra","overridePid","store","seoPageId","$PageLevelTraffic","trafficPid","versions","$ABTest","isiOS","isMacOS","$UserAgent","enablePintrk","schema","_objectSpread","seo_page_id","traffic_type","source_group_id","active","optimizeOnelinkActive","$LibraOptimizeOnelinkActive","requestAnimationFrame","pintrk","event_id","lead_type","open","usePageActive","isBanner","useAtomValue","traffic","pageId","PageLevelTrafficUtil","EPageType","contentByTranslate","useCallback","oneLinkAmpExtra","enter_page_type","enter_page_id","ClickPositionPrefix","ClickPosition","$IsMobileUser","isBot","isMobile","useBasicCondition","isInApp","$SEOReflowV42","parameters","_get","$SEOReflowV42ArticleCarousel","isMobileUser","V42Config","$SEOReflowV42InterceptOpt","$SEOReflowV4","$HitSEOReflowV4","V4Config","$SEOReflowV4AllowExpand","$SEOReflowV4ManualPlay","$SEOReflowV4AllowExpandFoldWithAnchor","$SEOReflowV4NeverExpandFoldWithAnchor","$SEOReflowV4AllowExpandFoldWithoutAnchor","$LibraPreconnectOnelinkHost","Boolean","$SEOKepHashtagPosExp","$HitKepHashtagPosForwardExp","$LibraDiscoverPostLazyLoad","ModuleType","useReflowClick","deps","trafficType","isRealUser","shouldReflow","notReflow","useRef","event","defaultBehavior","modalBehavior","reflowBehavior","finallyBehavior","clickEvent","isCTA","forceReflow","eventParams","current_position","click_result","current","Tea","is_cta","preventDefault","stopPropagation","useViewTracking","onView","ref","inputRef","tracked","setTracked","useState","useEffect","exports","getAtom","key","res","atomKey","args","split","decodeArgs","map","a","decodeURIComponent","atomFamily","atomFamilies","console","error","atoms","jotai_1","require","react_1","react_2","common_1","CSRDataInjector","useStore","matches","useMatches","ids","Set","isHydrating","pendingAtoms","m","dataLoaderId","__id__","has","add","startsWith","atomData","push","jsx_runtime_1","csr_1","ssr_1","DataInjector","jsxs","Fragment","children","jsx","SSRDataInjector","utils_1","hydrateAtoms","useMemo","useHydrateAtoms","__importDefault","mod","__esModule","atom_1","i18next_icu_1","i18next_1","react_i18next_1","I18nProvider","language","resources","$I18nText","i18n","_i18n","createInstance","lng","returnNull","use","initReactI18next","default","init","catch","i18next","I18nextProvider","__createBinding","create","o","k","k2","desc","getOwnPropertyDescriptor","writable","configurable","enumerable","defineProperty","__exportStar","p","prototype","hasOwnProperty","call","HeadOutlet","Outlet","context","BodyOutlet","AbsRemixPage","Component","HeadContent","state","useNavigation","Head","HeadSkeleton","useRouteLoading","routeLoading","BodyContent","Body","BodySkeleton","Content","useOutletContext","render","index_1","ScopedStoreNotFoundError","scopedStore","useContext","ScopedProviderContext","useAtom","useScopedAtomValue","useSetScopedAtom","useSetAtom","createContext","ScopedProvider","atomsWithHydration","createStore","parentScopedContext","scopedContextValue","_ref2","Provider","useRouteLoader","method","stateRef","setState","load","_a","url","at","id","fetch","then","rsp","json","atomToSet","e","log","finally"],"mappings":"0GAyBO,MAAMA,EAAiB,UAAe,KAAdC,EAAAC,UAAAC,OAAA,GAAAD,UAAA,KAAAE,OAAAF,UAAA,GAAQ,EAIrC,MAAO,CAAC,GAHUG,MAAMC,KAAK,CAAEH,OAAQF,CAAM,EAAG,CAACM,EAAIC,IAAMA,EAAIP,CAAK,EAG9C,CAAC,CACzB,EAEMQ,EAAuB,IACvBC,EAAiB,GAEVC,EAAuC,CAMlDC,YAAaH,EAIbI,cAAeH,EAIfI,oBAAqB,GAGrBC,eAAgB,IAGhBC,mBAAoB,GAGpBC,OAAQ,CACNC,KAAM,KACNC,WAAY,MACZC,UAAWpB,EAAe,EAAIqB,KAAKC,IAAIb,EAAsBC,CAAc,EAAI,CAAC,CAClF,CACF,EAEA,IAAIa,EAAgC,KAEpC,MAAqBC,EAArB,KAA2D,CAoBzDC,aAA0B,KAAAC,EAAA,SAAdC,EAAAzB,UAAAC,OAAA,GAAAD,UAAA,KAAAE,OAAAF,UAAA,GAAU,CAAC,EA6DvB,KAAQ0B,eAAiB,UAAqD,KAApDC,EAAA3B,UAAAC,OAAA,GAAAD,UAAA,KAAAE,OAAAF,UAAA,GAAuC,CAAC,EAGhE,MAAM4B,EAAkBC,OAAOC,aAAeC,SAASC,gBAAgBC,aAEvEN,EACGO,OAAQC,GAAUA,EAAMC,cAAc,EACtCC,QAASF,GAAU,CAClB,MAAMG,EAAOH,EAAMI,OACbC,EAAUhB,EAAKiB,SAASC,IAAIJ,CAAI,EAMhCK,GAFSR,EAAMS,oBAAsBN,EAAKO,sBAAsB,GAEzCC,OAMvBpC,EAAcc,EAAKuB,mCAAmCJ,EAAef,CAAe,EACtFJ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H,C","file":"527-48686a4d28ead246795d.js","sourcesContent":["export interface ObserverOptionsType {\n errorMargin: number;\n defaultMargin: number;\n percentCompensation: number;\n minTimeVisible: number;\n useExistedInstance?: boolean;\n config: {\n root: Element | null;\n rootMargin: string;\n threshold: number[];\n };\n}\n\ninterface IViewObserver {\n destroy: () => void;\n\n observe: (element: Element, callback: (visible: boolean) => void) => void;\n unobserve: (element: Element) => void;\n}\n\n/**\n * Build an array of threshold values ranging from 0 to 1\n * @param {Number} steps - number of steps between 0 and 1.0\n * @returns {Number[]} returns array of floats\n */\nexport const buildThreshold = (steps = 1) => {\n const threshold = Array.from({ length: steps }, (_x, i) => i / steps);\n\n // Returns an array like [0, ...n, 1]\n return [...threshold, 1];\n};\n\nconst DEFAULT_ERROR_MARGIN = 0.25;\nconst DEFAULT_MARGIN = 0.2;\n\nexport const DEFAULT_OPTIONS: ObserverOptionsType = {\n // If an element height is similar to the container height,\n // it's very difficult to catch an impression in 250ms.\n // By default, the intersectionRatio of an element should be\n // 1 to be considered seen and so for tall elements we reduce the\n // max intersectionRatio by this value\n errorMargin: DEFAULT_ERROR_MARGIN, // 25%\n\n // default to 0.2. The max intersectionRatio for a regular element\n // should be 0.8 as being _too_ strict can result in missed events.\n defaultMargin: DEFAULT_MARGIN, // 20%\n\n // The container height range at which to compensate with\n // an error margin\n percentCompensation: 0.2, // 20%\n\n // Element must be visible for >= 250ms\n minTimeVisible: 250,\n\n // Use the instance of the observer already exists, stay singleton\n useExistedInstance: true,\n\n // The ViewObserver config\n config: {\n root: null,\n rootMargin: '0px',\n threshold: buildThreshold(1 / Math.min(DEFAULT_ERROR_MARGIN, DEFAULT_MARGIN) + 5),\n },\n};\n\nlet instance: ViewObserver | null = null;\n\nexport default class ViewObserver implements IViewObserver {\n options: ObserverOptionsType;\n elements: Map<\n Element,\n {\n callback: (visible: boolean) => void;\n visible: boolean;\n entry: Element;\n timeoutSet?: boolean;\n }\n >;\n timeouts: Map>;\n observer: IntersectionObserver;\n\n static Factory = {\n get(options: ObserverOptionsType): ViewObserver {\n return new ViewObserver(options);\n },\n };\n\n constructor(options = {}) {\n this.options = Object.assign({}, DEFAULT_OPTIONS, options);\n\n if (isNaN(this.options.minTimeVisible) || this.options.minTimeVisible < 0) {\n this.options.minTimeVisible = DEFAULT_OPTIONS.minTimeVisible;\n }\n\n this.elements = new Map();\n this.timeouts = new Map();\n\n this.observer = new IntersectionObserver(this._watchElements, this.options.config);\n\n this._addEventListeners();\n }\n\n /**\n * Return the single instance of the IntersectionObserver if one exists already,\n * otherwise create an instance\n * @param {Object} options - ViewObserver instantiation options\n * @return {ViewObserver} return instance of the class\n */\n static get(options: ObserverOptionsType): ViewObserver {\n // If an instance of the observer already exists, return the singleton\n // otherwise instantiate a new one\n if (instance && instance instanceof ViewObserver && options.useExistedInstance) {\n return instance;\n }\n\n instance = new ViewObserver(options);\n return instance;\n }\n\n /**\n * Detroy all Maps and event listeners.\n * @returns {void} returns instance\n */\n public destroy(): void {\n // Clear all elements\n this.elements.clear();\n\n // Clear all lingering timeouts\n this.timeouts.clear();\n\n // Disconnect the observer, if available\n if (this.observer && typeof this.observer.disconnect === 'function') {\n this.observer.disconnect();\n }\n\n // Remove all event listeners\n this._removeEventListeners();\n\n instance = null;\n }\n\n /**\n * callback for Intersection Observer\n *\n * Loop through all the observed elements and check if visible\n *\n * @param {Array} [entries] array of [IntersectionObserverEntry],\n */\n private _watchElements = (entries: IntersectionObserverEntry[] = []): void => {\n // If rootBounds does not exist, it will default to the height and width\n // of the viewport\n const containerHeight = window.innerHeight || document.documentElement.clientHeight;\n\n entries\n .filter((entry) => entry.isIntersecting)\n .forEach((entry) => {\n const node = entry.target;\n const element = this.elements.get(node);\n\n // We wrap the child in a container, so we need to ensure we're looking at\n // the bounds of the child and not the wrapper\n const bounds = entry.boundingClientRect || node.getBoundingClientRect();\n\n const elementHeight = bounds.height;\n\n // If the element height is within x% (this.options.percentCompensation)\n // of the container height, use the errorMargin option (this.options.errorMargin).\n // Otherwise default to 0.25. The max intersectionRatio for a regular element\n // should be 0.75 as being _too_ strict can result in missed events.\n const errorMargin = this._isElementHeightSimilarToContainer(elementHeight, containerHeight)\n ? this.options.errorMargin\n : this.options.defaultMargin;\n\n const maxIntersectionRatio =\n containerHeight / elementHeight > 1 ? 1 - errorMargin : containerHeight / elementHeight - errorMargin;\n\n const isVisible = entry.intersectionRatio >= maxIntersectionRatio;\n // Element is still visible since last check\n if (isVisible && element && element.timeoutSet) {\n return;\n }\n\n // If the element is visible\n if (isVisible && element) {\n // Set the visibility state to true but wait until the timeout finishes\n // to fire the event\n element.timeoutSet = true;\n\n // Start timer\n this.timeouts.set(\n node,\n setTimeout(() => {\n // Fire the event\n this._onVisibilityChange(node, true);\n }, this.options.minTimeVisible),\n );\n } else {\n const timeout = this.timeouts.get(node);\n // Fire event\n this._onVisibilityChange(node, false);\n // Element is no longer visible, delete timeout\n clearTimeout(timeout);\n this.timeouts.delete(node);\n if (element) {\n element.timeoutSet = false;\n }\n }\n });\n };\n\n /**\n * Observe an IntersectionObserver entry\n * @param {Element} element the element to watch\n * @param {Function} callback the element callback event\n */\n observe = (element: Element, callback: (visible: boolean) => void): void => {\n this.elements.set(element, {\n callback,\n visible: false,\n entry: element,\n });\n\n this.observer.observe(element);\n };\n\n /**\n * Unobserve an IntersectionObserver entry\n * @param {Element} element the element to unobserve\n */\n unobserve = (element: Element): void => {\n if (!this.elements.get(element)) {\n return;\n }\n\n this.observer.unobserve(element);\n\n this.elements.delete(element);\n };\n\n /**\n * callback for orientationchange or other event which may cause element visible change\n *\n * Fire onChange event listeners for all visible elements\n */\n private _reportVisibilityStates = (): void => {\n this.elements.forEach(({ visible }, element) => {\n if (visible) {\n this._onVisibilityChange(element, visible);\n }\n });\n };\n\n /**\n * Handle DOM element visibility state change\n * @param {Element} element - the DOM node\n * @param {Boolean} visible - the visibility state of the entry\n */\n private _onVisibilityChange(element: Element, visible: boolean): void {\n const entry = this.elements.get(element);\n\n if (!entry) {\n return;\n }\n\n // Set the new visibility state\n entry.visible = visible;\n\n const { callback } = entry;\n callback(visible);\n }\n\n private _isElementHeightSimilarToContainer(elementHeight: number, containerHeight: number): boolean {\n return (\n elementHeight >= containerHeight - containerHeight * this.options.percentCompensation &&\n elementHeight <= containerHeight + containerHeight * this.options.percentCompensation\n );\n }\n\n private _addEventListeners(): void {\n window.addEventListener('focus', this._reportVisibilityStates);\n window.addEventListener('orientationchange', this._reportVisibilityStates);\n }\n\n private _removeEventListeners(): void {\n window.removeEventListener('focus', this._reportVisibilityStates);\n window.removeEventListener('orientationchange', this._reportVisibilityStates);\n }\n}\n","import { $Locale, $RootTraffic } from '@lemon8/web-app-shared/atom';\nimport { EURO_COUNTRY_SET } from '@lemon8/web-app-shared/i18n';\nimport { atom } from 'jotai';\n\nexport const $EnablePintrk = atom((get) => {\n const { region, ipRegion } = get($Locale);\n const { enterHref: href } = get($RootTraffic);\n\n return (\n (href.includes('pid=pinterest_int') || href.includes('pid=US_pinterest')) &&\n region === 'us' &&\n !EURO_COUNTRY_SET.has(ipRegion)\n );\n});\n","interface CommonSchemaBuildingProps {\n pageType: string;\n\n // 拉活渠道细分 TODO type\n campaign?: string;\n}\n\ninterface DetailSchemaBuildingProps extends CommonSchemaBuildingProps {\n groupId: string;\n authorId?: string;\n}\n\ninterface ArticleSchemaBuildingProps extends DetailSchemaBuildingProps {\n pageType: 'article';\n}\n\nconst isArticleSchemaBuildingProps = (input: CommonSchemaBuildingProps): input is ArticleSchemaBuildingProps =>\n input.pageType === 'article';\n\ninterface VideoSchemaBuildingProps extends DetailSchemaBuildingProps {\n pageType: 'video';\n}\n\nconst isVideoSchemaBuildingProps = (input: CommonSchemaBuildingProps): input is VideoSchemaBuildingProps =>\n input.pageType === 'video';\n\nexport interface UserSchemaBuildingProps extends CommonSchemaBuildingProps {\n pageType: 'user';\n userId: string;\n}\n\nconst isUserSchemaBuildingProps = (input: CommonSchemaBuildingProps): input is UserSchemaBuildingProps =>\n input.pageType === 'user';\n\ninterface CategorySchemaBuildingProps extends CommonSchemaBuildingProps {\n pageType: 'feed';\n categoryId: number;\n}\n\nconst isCategorySchemaBuildingProps = (input: CommonSchemaBuildingProps): input is CategorySchemaBuildingProps =>\n input.pageType === 'feed';\n\nexport interface HashtagSchemaBuildingProps extends CommonSchemaBuildingProps {\n pageType: 'hashtag';\n hashtagId: string;\n}\n\nconst isHashtagSchemaBuildingProps = (input: CommonSchemaBuildingProps): input is HashtagSchemaBuildingProps =>\n input.pageType === 'hashtag';\n\nexport interface POISchemaBuildingProps extends CommonSchemaBuildingProps {\n pageType: 'poi';\n poiId: string;\n}\n\nconst isPOISchemaBuildingProps = (input: CommonSchemaBuildingProps): input is POISchemaBuildingProps =>\n input.pageType === 'poi';\n\nexport interface SearchSchemaBuildingProps extends CommonSchemaBuildingProps {\n pageType: 'search';\n query: string;\n}\n\nconst isSearchSchemaBuildingProps = (input: CommonSchemaBuildingProps): input is SearchSchemaBuildingProps =>\n input.pageType === 'search';\n\nconst buildSearchSchema = (props: SearchSchemaBuildingProps): string => {\n const { query } = props;\n\n const baseUrl =\n 'snssdk2657://lynxview?channel=search_v2&trans_status_bar=1&enter_anim=search_alpha&exit_anim=search_alpha&business_type=search&bundle=result_page%2Ftemplate.js';\n\n const data = {\n query,\n tab: 0,\n inputClickType: 'open',\n logExtra: {\n query,\n search_page_from: 'search_page_general',\n search_from: 'seo_click',\n previous_page_name: 'seo',\n },\n };\n\n return `${baseUrl}&business_data=${encodeURIComponent(JSON.stringify(data))}`;\n};\n\nexport type DeepLinkBuildingProps =\n | ArticleSchemaBuildingProps\n | VideoSchemaBuildingProps\n | UserSchemaBuildingProps\n | CategorySchemaBuildingProps\n | HashtagSchemaBuildingProps\n | POISchemaBuildingProps\n | SearchSchemaBuildingProps;\n\nexport const buildSchema = (props: DeepLinkBuildingProps & { pid: string }): string => {\n // 唤活到搜索\n if (isSearchSchemaBuildingProps(props)) {\n return buildSearchSchema(props);\n }\n\n let protocol = 'snssdk2657:';\n let host = 'unknown';\n let params: URLSearchParams;\n\n // TODO is local test;\n\n if (isArticleSchemaBuildingProps(props)) {\n host = 'article_detail_page';\n params = new URLSearchParams({\n group_id: props.groupId,\n });\n if (props.authorId) {\n params.set('media_id', props.authorId);\n }\n } else if (isVideoSchemaBuildingProps(props)) {\n host = 'video_detail';\n params = new URLSearchParams({\n group_id: props.groupId,\n });\n if (props.authorId) {\n params.set('media_id', props.authorId);\n }\n } else if (isUserSchemaBuildingProps(props)) {\n host = 'user_profile';\n params = new URLSearchParams({\n user_id: props.userId,\n });\n } else if (isCategorySchemaBuildingProps(props)) {\n host = 'main';\n params = new URLSearchParams({\n tab: 'home',\n channel_id: String(props.categoryId),\n });\n } else if (isHashtagSchemaBuildingProps(props)) {\n host = 'hashtag';\n params = new URLSearchParams({\n hashtag_id: props.hashtagId,\n });\n } else if (isPOISchemaBuildingProps(props)) {\n host = 'poi_landing_page';\n params = new URLSearchParams({\n poi_id: props.poiId,\n });\n } else {\n throw new Error('unexcepted schema target');\n }\n\n // append common params\n params.append('pid', props.pid);\n if (props.campaign) {\n params.append('campaign', props.campaign);\n }\n\n return `${protocol}//${host}?${params.toString()}`;\n};\n","import { $PageLevelTraffic } from 'shared/atoms';\nimport { buildSchema, DeepLinkBuildingProps } from './schema';\nimport { $ABTest, $UserAgent, $RootTraffic } from '@lemon8/web-app-shared/atom';\nimport { $EnablePintrk } from '~/models/enable-pintrk';\nimport { $LibraOptimizeOnelinkActive } from '~/utils/libra';\n\nexport interface ActiveProps {\n pid?: string;\n schemaOption: DeepLinkBuildingProps;\n ampExtra: Record;\n}\n\nconst modifyURLForSEM = (onelink: URL): void => {\n const href = new URL(location.href);\n\n if (href.searchParams.get('ad_platform_id') !== 'googleadwords_int_lead') {\n return;\n }\n\n onelink.searchParams.set('pid', 'google_sem');\n onelink.searchParams.set('af_prt', 'wezonet');\n\n const afParameters = ['af_c_id', 'af_adset_id', 'af_ad_id', 'af_keywords', 'af_channel', 'placement', 'target'];\n\n afParameters.forEach((parameter) => {\n const value = href.searchParams.get(parameter);\n if (value) {\n onelink.searchParams.set(parameter, value);\n }\n });\n};\n\nconst modifyURLForPinterest = (onelink: URL): void => {\n const href = new URL(location.href);\n\n const afParameters = [\n 'pid',\n 'af_siteid',\n 'c',\n 'af_adset',\n 'af_adset_id',\n 'af_ad',\n 'af_ad_id',\n 'af_c_id',\n 'af_click_lookback',\n 'clickid',\n 'sha1_idfa',\n 'tracking',\n 'appid',\n 'timestamp',\n 'af_prt',\n ];\n\n afParameters.forEach((parameter) => {\n const value = href.searchParams.get(parameter);\n if (value) {\n onelink.searchParams.set(parameter, value);\n }\n });\n};\n\nexport const generateOneLink = (props: ActiveProps): string => {\n const { schemaOption, ampExtra, pid: overridePid } = props;\n const store = window.store;\n const { seoPageId } = store.get($PageLevelTraffic);\n const { trafficPid } = store.get($RootTraffic);\n const { versions } = store.get($ABTest);\n const { isiOS, isMacOS } = store.get($UserAgent);\n const enablePintrk = store.get($EnablePintrk);\n\n const pid = overridePid || trafficPid;\n\n const schema = buildSchema({\n ...schemaOption,\n pid,\n });\n\n const onelink = new URL('https://lemon8.onelink.me/FMQw');\n onelink.searchParams.set('pid', pid);\n onelink.searchParams.set('af_force_dp', 'false');\n onelink.searchParams.set('af_dp', schema);\n onelink.searchParams.set('retargeting', 'true');\n onelink.searchParams.set('ab_version', versions);\n onelink.searchParams.set(\n 'af_web_dp',\n isiOS || isMacOS\n ? 'https://itunes.apple.com/app/apple-store/id1498607143?pt=1613620&ct=interstitialdownload&mt=8'\n : 'https://play.google.com/store/apps/details?id=com.bd.nproject',\n );\n onelink.searchParams.set(\n 'amp_extra',\n JSON.stringify({\n seo_page_id: seoPageId,\n traffic_type: pid,\n ...ampExtra,\n }),\n );\n\n if (props.ampExtra.source_group_id) {\n onelink.searchParams.set('af_ad', `?${props.ampExtra.source_group_id}`);\n }\n\n modifyURLForSEM(onelink);\n if (enablePintrk) {\n modifyURLForPinterest(onelink);\n }\n\n return onelink.toString();\n};\n\nexport const active = (props: ActiveProps): void => {\n const onelink = generateOneLink(props);\n\n const optimizeOnelinkActive = window.store.get($LibraOptimizeOnelinkActive);\n const enablePintrk = window.store.get($EnablePintrk);\n\n if (optimizeOnelinkActive) {\n requestAnimationFrame(() => {\n setTimeout(() => {\n if (enablePintrk && 'pintrk' in window) {\n window.pintrk('track', 'lead', {\n event_id: 'eventId0001',\n lead_type: 'Newsletter',\n });\n }\n\n window.open(onelink);\n }, 0);\n });\n } else {\n if (enablePintrk && 'pintrk' in window) {\n window.pintrk('track', 'lead', {\n event_id: 'eventId0001',\n lead_type: 'Newsletter',\n });\n }\n\n window.open(onelink);\n }\n};\n","import { useCallback } from 'react';\nimport { active, ActiveProps } from './index';\nimport { $Locale, $RootTraffic } from '@lemon8/web-app-shared/atom';\nimport { useAtomValue } from 'jotai';\nimport { $PageLevelTraffic } from 'shared/atoms';\nimport { EPageType, PageLevelTrafficUtil } from 'shared/models';\n\ninterface UsePageActiveProps {\n /** 是否是banner,用于区分discover页不同的pid */\n isBanner?: boolean;\n}\n\nexport type UsePageActiveCallbackProps = Omit;\n\nexport const usePageActive = (props: UsePageActiveProps = {}) => {\n const { isBanner = false } = props;\n const { region } = useAtomValue($Locale);\n\n const { trafficPid } = useAtomValue($RootTraffic);\n const traffic = useAtomValue($PageLevelTraffic);\n const { pageType } = traffic;\n const pageId = PageLevelTrafficUtil.getPageIdFromTraffic(traffic);\n\n let pid = trafficPid;\n if (pageType === EPageType.discover) {\n pid = isBanner ? 'website_seo_discover_banner' : 'website_seo_discover';\n }\n\n if (traffic.pageType === EPageType.article || traffic.pageType === EPageType.video) {\n pid = traffic.contentByTranslate === 1 ? `website_seo_translate_${region}` : pid;\n }\n\n return useCallback(\n (props: UsePageActiveCallbackProps) => {\n const { schemaOption, ampExtra } = props;\n\n const oneLinkAmpExtra: Record = {\n traffic_type: pid,\n // current page info, not enter page\n enter_page_type: pageType,\n // current page info, not enter page\n enter_page_id: pageId,\n // related-to campaign.gid, for new user acceptance\n ...ampExtra,\n };\n\n // append source_group_id\n // 1. activating target page is article or video\n // 2. activating source page is article or video\n if (schemaOption.pageType === 'article' || schemaOption.pageType === 'video') {\n oneLinkAmpExtra.source_group_id = schemaOption.groupId;\n } else if (traffic.pageType === 'article' || traffic.pageType === 'video') {\n oneLinkAmpExtra.source_group_id = traffic.groupId;\n }\n\n active({\n pid,\n schemaOption,\n ampExtra: oneLinkAmpExtra,\n });\n },\n [pid, pageType, pageId],\n );\n};\n","export const enum ClickPositionPrefix {\n category = 'category_',\n none = '',\n}\n\nexport const enum ClickPosition {\n pwa_notification_banner = 'pwa_notification_banner',\n intercept_banner = 'intercept_banner',\n first_landing_dialog = 'first_landing_dialog',\n side_bar_homepage = 'side_bar_homepage',\n side_bar_pp = 'side_bar_pp',\n side_bar_tos = 'side_bar_tos',\n side_bar_cookie = 'side_bar_cookie',\n side_bar_avmsd = 'side_bar_avmsd',\n side_bar_download = 'side_bar_download',\n side_bar_category = 'side_bar_category',\n side_bar_email = 'side_bar_email',\n top_bar_logo = 'top_bar_logo',\n top_bar_side = 'top_bar_side',\n top_bar_share = 'top_bar_share',\n top_bar_search = 'top_bar_search',\n top_bar_download = 'top_bar_download',\n top_search_bar = 'top_search_bar',\n main_category = 'main_category',\n main_author = 'main_author',\n main_author_follow_btn = 'main_author_follow_btn',\n main_hashtag = 'main_hashtag',\n main_poi = 'main_poi',\n main_content_poi = 'main_content_poi',\n main_content_mentioned_user = 'main_content_mentioned_user',\n main_sar = 'main_sar',\n main_inner_link = 'main_inner_link',\n main_content_read_more = 'main_content_read_more',\n main_content_read_more_modal = 'main_content_read_more_modal',\n main_content_unfold_cta_btn = 'main_content_unfold_cta_btn',\n main_comment_send = 'main_comment_send',\n main_comment_icon = 'main_comment_icon',\n main_share_icon = 'main_share_icon',\n main_like_icon = 'main_like_icon',\n main_favorite_icon = 'main_favorite_icon',\n main_see_more_btn = 'main_see_more_btn',\n main_read_more = 'main_read_more',\n comment_author = 'comment_author',\n comment_image = 'comment_image',\n comment_like = 'comment_like',\n comment_reply = 'comment_reply',\n comment = 'comment',\n comment_mentioned_user = 'comment_mentioned_user',\n comment_see_more = 'comment_see_more',\n comment_reply_see_more = 'comment_reply_see_more',\n activity_banner = 'activity_banner',\n related_post = 'related_post',\n related_post_carousel = 'related_post_carousel',\n related_dialog = 'related_dialog',\n related_hashtag = 'related_hashtag',\n related_hashtag_with_article_card = 'related_hashtag_with_article_card',\n related_hashtag_article_card = 'related_hashtag_article_card',\n related_phone = 'related_phone',\n related_address = 'related_address',\n related_user = 'related_user',\n user_fans = 'user_fans',\n user_following = 'user_following',\n user_likes = 'user_likes',\n share_panel_icon = 'share_panel_icon',\n unknown = 'unknown',\n bottom_button = 'bottom_button',\n original_post_banner = 'original_post_banner',\n main_gallery_slide = 'main_gallery_slide',\n main_gallery_slide_modal = 'main_gallery_slide_modal',\n main_video_see_more = 'main_video_see_more',\n main_video_see_more_modal = 'main_video_see_more_modal',\n main_video_pause_auto = 'main_video_pause_auto',\n main_video_replay = 'main_video_replay',\n main_video_replay_modal = 'main_video_replay_modal',\n main_video_pause_manual = 'main_video_pause_manual',\n main_video_pause_manual_modal = 'main_video_pause_manual_modal',\n main_video_download_banner = 'main_video_download_banner',\n main_video_play = 'main_video_play',\n main_video_play_modal = 'main_video_play_modal',\n see_more_button = 'see_more_button',\n view_more_button = 'view_more_button',\n kep_breadcrumbs = 'kep_breadcrumbs',\n main_related_post = 'main_related_post',\n gallery_img = 'gallery_img',\n gallery_img_open = 'gallery_img_open',\n gallery_img_open_modal = 'gallery_img_open_modal',\n gallery_img_mask_open_btn = 'gallery_img_mask_open_btn',\n gallery_img_mask_close_btn = 'gallery_img_mask_close_btn',\n co_creator = 'co_creator',\n kep_classify_hot_keyword = 'kep_classify_hot_keyword',\n // pc reflow qrcode\n scan_code = 'scan_code',\n\n // the following string is concat by ClickPositionPrefix + ClickPosition\n // Please ensure the correctness of the value yourself\n\n category_related_post = 'category_related_post',\n category_view_more = 'category_view_more_button',\n category_see_more = 'category_see_more_button',\n related_search = 'related_search',\n bottom_sar_search = 'bottom_sar_search',\n}\n","import { $UserAgent } from '@lemon8/web-app-shared/atom';\nimport { atom } from 'jotai';\n\nexport const $IsMobileUser = atom((get) => {\n const { isBot, isMobile } = get($UserAgent);\n\n return !isBot && isMobile;\n});\n","import { useAtomValue } from 'jotai';\nimport { $UserAgent } from '@lemon8/web-app-shared/atom';\n\n/**\n * @deprecated use $IsMobileUser\n */\nexport function useBasicCondition(): boolean {\n const { isBot, isMobile, isInApp } = useAtomValue($UserAgent);\n\n return !isBot && isMobile && !isInApp;\n}\n","import { $ABTest } from '@lemon8/web-app-shared/atom';\nimport { $IsMobileUser } from '~/utils/is-mobile-user';\nimport { Atom, atom } from 'jotai';\nimport _get from 'lodash/get';\n\n/**\n * 0: control group\n * 1: use article carousel\n * 2: opt article interception\n */\nexport const $SEOReflowV42: Atom = atom((get) => {\n const { parameters } = get($ABTest);\n if (__BUILD_TYPE__ === 'local_dev') {\n return 0;\n }\n return _get(parameters, ['seo_web', 'lemon8.seo_cta_v42'], 0);\n});\n\nexport const $SEOReflowV42ArticleCarousel: Atom = atom((get) => {\n const isMobileUser = get($IsMobileUser);\n const V42Config = get($SEOReflowV42);\n return isMobileUser && V42Config === 1;\n});\n\nexport const $SEOReflowV42InterceptOpt: Atom = atom((get) => {\n const isMobileUser = get($IsMobileUser);\n const V42Config = get($SEOReflowV42);\n return isMobileUser && V42Config === 2;\n});\n\n/**\n * 0: control group\n * Article:\n * 1 means allow content unfolded and display anchors while being folded\n * 2 means disallow content unfolded and display anchors while being folded\n * 3 means allow content unfolded and hide anchors while being folded\n * Video:\n * 1 means display with fixed download banner\n * 2 means play video manually\n * 3 means 1 + 2\n */\nexport const $SEOReflowV4: Atom = atom((get) => {\n const { parameters } = get($ABTest);\n if (__BUILD_TYPE__ === 'local_dev') {\n return 2;\n }\n return _get(parameters, ['seo_web', 'lemon8.seo_reflow_v4'], 2);\n});\n\nexport const $HitSEOReflowV4: Atom = atom((get) => {\n const isMobileUser = get($IsMobileUser);\n const V4Config = get($SEOReflowV4);\n return isMobileUser && V4Config !== 0;\n});\n\n/**\n * Article: 1 or 3 means folded content can be expanded after click\n * Video: 1 or 3 means display with fixed download banner\n */\nexport const $SEOReflowV4AllowExpand: Atom = atom((get) => {\n const isMobileUser = get($IsMobileUser);\n const V4Config = get($SEOReflowV4);\n return isMobileUser && (V4Config === 1 || V4Config === 3);\n});\n\n/**\n * Article: 2 or 3 has no common features, thus this combination means nothing\n * Video: 2 or 3 means video should be played manually\n */\nexport const $SEOReflowV4ManualPlay: Atom = atom((get) => {\n const isMobileUser = get($IsMobileUser);\n const V4Config = get($SEOReflowV4);\n return isMobileUser && (V4Config === 2 || V4Config === 3);\n});\n\n// hit 1st test group\nexport const $SEOReflowV4AllowExpandFoldWithAnchor: Atom = atom((get) => {\n const isMobileUser = get($IsMobileUser);\n const V4Config = get($SEOReflowV4);\n return isMobileUser && V4Config === 1;\n});\n\n// hit 2nd test group\nexport const $SEOReflowV4NeverExpandFoldWithAnchor: Atom = atom((get) => {\n const isMobileUser = get($IsMobileUser);\n const V4Config = get($SEOReflowV4);\n return isMobileUser && V4Config === 2;\n});\n\n// hit 3rd test group\nexport const $SEOReflowV4AllowExpandFoldWithoutAnchor: Atom = atom((get) => {\n const isMobileUser = get($IsMobileUser);\n const V4Config = get($SEOReflowV4);\n return isMobileUser && V4Config === 3;\n});\n","import { $ABTest } from '@lemon8/web-app-shared/atom';\nimport { atom } from 'jotai';\nimport _get from 'lodash/get';\n\nexport const $LibraPreconnectOnelinkHost = atom((get) => {\n const { parameters } = get($ABTest);\n\n if (__BUILD_TYPE__ === 'local_dev') {\n return true;\n }\n\n return Boolean(_get(parameters, 'seo_web.preconnect_onelink_host', false));\n});\n\nexport const $LibraOptimizeOnelinkActive = atom((get) => {\n const { parameters } = get($ABTest);\n\n if (__BUILD_TYPE__ === 'local_dev') {\n return true;\n }\n\n return Boolean(_get(parameters, 'seo_web.optimize_onelink_active', false));\n});\n","import { $ABTest } from '@lemon8/web-app-shared/atom';\nimport { Atom, atom } from 'jotai';\nimport _get from 'lodash/get';\nimport { $PageLevelTraffic } from 'shared/atoms';\nimport { EPageType } from 'shared/models';\n\n/**\n * 0: control group\n * 1: forward the positions of hashtag big card\n */\nexport const $SEOKepHashtagPosExp: Atom = atom((get) => {\n const { parameters } = get($ABTest);\n if (__BUILD_TYPE__ === 'local_dev') {\n return 1;\n }\n return _get(parameters, ['seo_web', 'lemon8.kep_hashtag_pos_opt'], 0);\n});\n\nexport const $HitKepHashtagPosForwardExp: Atom = atom((get) => {\n const { pageType } = get($PageLevelTraffic);\n\n const kepExpConfig = get($SEOKepHashtagPosExp);\n return kepExpConfig === 1 && pageType === EPageType.discover;\n});\n","import { $ABTest } from '@lemon8/web-app-shared/atom';\nimport { atom, Atom } from 'jotai';\nimport _get from 'lodash/get';\n\nexport const $LibraDiscoverPostLazyLoad: Atom = atom((get) => {\n const { parameters } = get($ABTest);\n\n if (__BUILD_TYPE__ === 'local_dev') {\n return true;\n }\n return Boolean(_get(parameters, ['seo_web', 'lemon8.discover_post_lazy'], false));\n});\n","export enum ModuleType {\n related_article = 'related_article',\n category_related_post = 'category_related_post',\n related_hashtag = 'related_hashtag',\n related_topic = 'related_topic',\n related_user = 'related_user',\n kep_breadcrumbs = 'kep_breadcrumbs',\n author_related_article = 'author_related_article',\n hashtag_related_article = 'hashtag_related_article',\n activity_banner = 'activity_banner',\n comment = 'comment',\n main_sar = 'main_sar',\n main_content = 'main_content',\n main_related_post = 'main_related_post',\n gallery_img_mask = 'gallery_img_mask',\n user_homepage_info = 'user_homepage_info',\n co_creator = 'co_creator',\n // pc reflow qrcode\n scan_code = 'scan_code',\n related_search = 'related_search',\n bottom_sar_search = 'bottom_sar_search',\n}\n","import { DependencyList, SyntheticEvent, useCallback, useRef } from 'react';\nimport { ClickPosition } from './click-position';\nimport { $RootTraffic, $UserAgent } from '@lemon8/web-app-shared/atom';\nimport { useAtomValue } from 'jotai';\nimport { $PageLevelTraffic } from 'shared/atoms';\nimport { EPageType, PageLevelTrafficUtil } from 'shared/models';\n\ninterface ReflowClickConfig {\n /**\n * 默认行为\n */\n defaultBehavior?: (event?: SyntheticEvent) => void;\n /**\n * 触发弹窗行为\n */\n modalBehavior?: (event?: SyntheticEvent) => void;\n /**\n * 强制导流时的行为\n */\n reflowBehavior?: (event?: SyntheticEvent) => void;\n /**\n * 最终都会走到的一个方法\n */\n finallyBehavior?: (event?: SyntheticEvent) => void;\n /**\n * 点击事件上报埋点\n */\n clickEvent?: (event?: SyntheticEvent, bundle?: Record) => Record;\n}\n\n/**\n * 封装强制导流功能的点击事件\n */\nexport default function useReflowClick(config: ReflowClickConfig, deps: DependencyList) {\n const { isMobile, isBot, isInApp } = useAtomValue($UserAgent);\n const { trafficPid: trafficType } = useAtomValue($RootTraffic); // ssr traffic data\n const traffic = useAtomValue($PageLevelTraffic); // csr traffic data\n const { pageType } = traffic;\n const pageId = PageLevelTrafficUtil.getPageIdFromTraffic(traffic);\n\n const isRealUser = !isBot && isMobile && !isInApp;\n\n // TODO 这个逻辑discover有没有必要?\n const shouldReflow = isRealUser || (isMobile && pageType === EPageType.discover);\n\n const notReflow = useRef(false);\n\n return useCallback(\n (event?: SyntheticEvent) => {\n const { defaultBehavior, modalBehavior, reflowBehavior, finallyBehavior, clickEvent } = config;\n\n let isCTA = 1;\n let forceReflow = false;\n if (clickEvent) {\n const eventParams = clickEvent(event);\n\n const { current_position = '', click_result = '' } = eventParams;\n // 避免discover页弹窗not now也reflow\n if (current_position === ClickPosition.first_landing_dialog && click_result === 'cancel') {\n notReflow.current = true;\n isCTA = 0;\n }\n\n if (current_position === ClickPosition.comment_image) {\n forceReflow = true;\n }\n\n window.Tea('wap_click', {\n ...eventParams,\n is_cta: isCTA,\n });\n }\n\n if (isRealUser && modalBehavior) {\n event?.preventDefault();\n event?.stopPropagation();\n modalBehavior(event);\n } else if ((shouldReflow || forceReflow) && !notReflow.current && reflowBehavior) {\n event?.preventDefault();\n event?.stopPropagation();\n reflowBehavior(event);\n } else {\n defaultBehavior?.(event);\n }\n\n finallyBehavior?.(event);\n },\n [config, isMobile, shouldReflow, pageType, trafficType, pageId, notReflow, ...deps],\n );\n}\n","import { RefObject, useRef, useEffect, useState } from 'react';\nimport ViewObserver, { DEFAULT_OPTIONS } from '~/components/view-tracker/view-observer';\n\ninterface UseViewTrackingProps {\n ref?: RefObject;\n onView: () => void;\n}\n\nexport const useViewTracking = (\n props: UseViewTrackingProps,\n deps: unknown[] = [],\n): RefObject => {\n const { onView, ref: inputRef } = props;\n const ref = inputRef || useRef(null);\n const [tracked, setTracked] = useState(false);\n\n useEffect(() => {\n const element = ref.current;\n if (!element || tracked) {\n return;\n }\n\n const observer = ViewObserver.get(DEFAULT_OPTIONS);\n observer.observe(element, (visible: boolean) => {\n if (visible) {\n onView();\n setTracked(true);\n observer.unobserve(element);\n }\n });\n\n return () => {\n observer.unobserve(element);\n };\n }, [ref, tracked, onView, ...deps]);\n\n return ref;\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getAtom = void 0;\nconst getAtom = (props, key) => {\n let res;\n if (key.includes('+')) {\n // for atom family\n const [atomKey, ...args] = key.split('+');\n const decodeArgs = args.map((a) => decodeURIComponent(a));\n const atomFamily = props.atomFamilies[atomKey];\n if (!atomFamily) {\n console.error('atomFamily not found for key: %s', key);\n }\n res = atomFamily(...decodeArgs);\n }\n else {\n // for plain atom\n res = props.atoms[key];\n }\n if (process.env.NODE_ENV === 'development' && !res) {\n throw new Error(`no such atom for key: ${key}`);\n }\n return res;\n};\nexports.getAtom = getAtom;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CSRDataInjector = void 0;\nconst jotai_1 = require(\"jotai\");\nconst react_1 = require(\"react\");\nconst react_2 = require(\"@remix-run/react\");\nconst common_1 = require(\"./common\");\nconst CSRDataInjector = (props) => {\n const store = (0, jotai_1.useStore)();\n const matches = (0, react_2.useMatches)();\n const ids = (0, react_1.useRef)(new Set());\n const isHydrating = (0, react_1.useRef)(true);\n (0, react_1.useEffect)(() => {\n if (isHydrating.current) {\n isHydrating.current = false;\n return;\n }\n const pendingAtoms = [];\n matches.forEach((m) => {\n const data = m.data;\n const dataLoaderId = data?.__id__ || null;\n // 根据 root loader 去重\n if (dataLoaderId && ids.current.has(dataLoaderId)) {\n return;\n }\n if (dataLoaderId) {\n ids.current.add(dataLoaderId);\n }\n for (const key in data) {\n if (!key.startsWith('$')) {\n continue;\n }\n const atom = (0, common_1.getAtom)(props, key);\n const atomData = data[key];\n pendingAtoms.push([atom, atomData]);\n }\n });\n if (pendingAtoms.length) {\n pendingAtoms.forEach(([atom, atomData]) => store.set(atom, atomData));\n }\n }, [matches]);\n return null;\n};\nexports.CSRDataInjector = CSRDataInjector;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DataInjector = void 0;\nconst jsx_runtime_1 = require(\"react/jsx-runtime\");\nconst csr_1 = require(\"./csr\");\nconst ssr_1 = require(\"./ssr\");\nconst DataInjector = (props) => {\n return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(csr_1.CSRDataInjector, { ...props }), (0, jsx_runtime_1.jsx)(ssr_1.SSRDataInjector, { ...props })] }));\n};\nexports.DataInjector = DataInjector;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SSRDataInjector = void 0;\nconst jotai_1 = require(\"jotai\");\nconst utils_1 = require(\"jotai/utils\");\nconst react_1 = require(\"react\");\nconst react_2 = require(\"@remix-run/react\");\nconst common_1 = require(\"./common\");\n/**\n * SSR + Hydration\n */\nconst SSRDataInjector = (props) => {\n const store = (0, jotai_1.useStore)();\n const matches = (0, react_2.useMatches)();\n const hydrateAtoms = (0, react_1.useMemo)(() => {\n const res = [];\n matches.forEach((m) => {\n const data = m.data;\n for (const key in data) {\n if (!key.startsWith('$')) {\n continue;\n }\n const atom = (0, common_1.getAtom)(props, key);\n const atomData = data[key];\n res.push([atom, atomData]);\n }\n });\n return res;\n }, []);\n (0, utils_1.useHydrateAtoms)(hydrateAtoms, { store });\n return null;\n};\nexports.SSRDataInjector = SSRDataInjector;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.I18nProvider = void 0;\nconst jsx_runtime_1 = require(\"react/jsx-runtime\");\nconst react_1 = require(\"react\");\nconst jotai_1 = require(\"jotai\");\nconst atom_1 = require(\"../../atom\");\nconst i18next_icu_1 = __importDefault(require(\"i18next-icu\"));\nconst i18next_1 = require(\"i18next\");\nconst react_i18next_1 = require(\"react-i18next\");\nconst I18nProvider = ({ children }) => {\n const { language } = (0, jotai_1.useAtomValue)(atom_1.$Locale);\n const resources = (0, jotai_1.useAtomValue)(atom_1.$I18nText);\n const i18n = (0, react_1.useMemo)(() => {\n const _i18n = (0, i18next_1.createInstance)({\n lng: language,\n resources,\n returnNull: false,\n });\n _i18n.use(react_i18next_1.initReactI18next);\n _i18n.use(i18next_icu_1.default);\n _i18n.init().catch(() => void 0);\n if (__BUILD_TARGET__ === 'client') {\n window.i18next = _i18n;\n }\n return _i18n;\n }, []);\n return (0, jsx_runtime_1.jsx)(react_i18next_1.I18nextProvider, { i18n: i18n, children: children });\n};\nexports.I18nProvider = I18nProvider;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./scoped-provider\"), exports);\n__exportStar(require(\"./data-injector\"), exports);\n__exportStar(require(\"./i18n-provider\"), exports);\n__exportStar(require(\"./remix-page\"), exports);\n__exportStar(require(\"./use-route-loader\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AbsRemixPage = exports.BodyOutlet = exports.HeadOutlet = void 0;\nconst jsx_runtime_1 = require(\"react/jsx-runtime\");\nconst react_1 = require(\"react\");\nconst react_2 = require(\"@remix-run/react\");\nconst HeadOutlet = () => (0, jsx_runtime_1.jsx)(react_2.Outlet, { context: { target: 'head' } });\nexports.HeadOutlet = HeadOutlet;\nconst BodyOutlet = () => (0, jsx_runtime_1.jsx)(react_2.Outlet, { context: { target: 'body' } });\nexports.BodyOutlet = BodyOutlet;\nclass AbsRemixPage extends react_1.Component {\n constructor() {\n super(...arguments);\n this.HeadContent = () => {\n const { state } = (0, react_2.useNavigation)();\n const { Head, HeadSkeleton, useRouteLoading } = this;\n const routeLoading = useRouteLoading();\n if (state === 'loading' || routeLoading) {\n return (0, jsx_runtime_1.jsx)(HeadSkeleton, {});\n }\n return (0, jsx_runtime_1.jsx)(Head, {});\n };\n this.BodyContent = () => {\n const { state } = (0, react_2.useNavigation)();\n const { Body, BodySkeleton, useRouteLoading } = this;\n const routeLoading = useRouteLoading();\n if (state === 'loading' || routeLoading) {\n return (0, jsx_runtime_1.jsx)(BodySkeleton, {});\n }\n return (0, jsx_runtime_1.jsx)(Body, {});\n };\n this.Content = () => {\n const { HeadContent, BodyContent } = this;\n const context = (0, react_2.useOutletContext)();\n if (context.target === 'head') {\n return (0, jsx_runtime_1.jsx)(HeadContent, {});\n }\n else {\n return (0, jsx_runtime_1.jsx)(BodyContent, {});\n }\n };\n }\n render() {\n const { Content } = this;\n return (0, jsx_runtime_1.jsx)(Content, {});\n }\n}\nexports.AbsRemixPage = AbsRemixPage;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useSetScopedAtom = exports.useScopedAtomValue = exports.useScopedAtom = void 0;\nconst jotai_1 = require(\"jotai\");\nconst react_1 = require(\"react\");\nconst index_1 = require(\"./index\");\nclass ScopedStoreNotFoundError extends Error {\n constructor() {\n super('No scoped store found');\n }\n}\nexports.useScopedAtom = ((atom, options) => {\n const scopedProviderContext = (0, react_1.useContext)(index_1.ScopedProviderContext);\n const scopedStore = scopedProviderContext.get(atom);\n if (!scopedStore) {\n throw new ScopedStoreNotFoundError();\n }\n return (0, jotai_1.useAtom)(atom, { store: scopedStore, ...options });\n});\nconst useScopedAtomValue = (atom, options) => {\n const scopedProviderContext = (0, react_1.useContext)(index_1.ScopedProviderContext);\n const scopedStore = scopedProviderContext.get(atom);\n if (!scopedStore) {\n throw new ScopedStoreNotFoundError();\n }\n return (0, jotai_1.useAtomValue)(atom, { store: scopedStore, ...options });\n};\nexports.useScopedAtomValue = useScopedAtomValue;\nconst useSetScopedAtom = (atom, options) => {\n const scopedProviderContext = (0, react_1.useContext)(index_1.ScopedProviderContext);\n const scopedStore = scopedProviderContext.get(atom);\n if (!scopedStore) {\n throw new ScopedStoreNotFoundError();\n }\n return (0, jotai_1.useSetAtom)(atom, { store: scopedStore, ...options });\n};\nexports.useSetScopedAtom = useSetScopedAtom;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ScopedProvider = exports.ScopedProviderContext = void 0;\nconst jsx_runtime_1 = require(\"react/jsx-runtime\");\nconst jotai_1 = require(\"jotai\");\nconst react_1 = require(\"react\");\n__exportStar(require(\"./hooks\"), exports);\nexports.ScopedProviderContext = (0, react_1.createContext)(new Map());\n/**\n * a simple provider for reading atoms from children inside React DOM tree\n * support inheritance and SAME_LEVEL atom computing.\n */\nconst ScopedProvider = (props) => {\n const { atomsWithHydration = [], atoms = [], children } = props;\n const scopedStore = (0, react_1.useMemo)(jotai_1.createStore, []);\n const parentScopedContext = (0, react_1.useContext)(exports.ScopedProviderContext);\n const scopedContextValue = (0, react_1.useMemo)(() => {\n const map = new Map(parentScopedContext);\n atomsWithHydration.forEach(([atom, data]) => {\n map.set(atom, scopedStore);\n scopedStore.set(atom, data);\n });\n atoms.forEach((atom) => {\n map.set(atom, scopedStore);\n });\n return map;\n }, [scopedStore, parentScopedContext]);\n atomsWithHydration.forEach(([atom, data]) => {\n (0, react_1.useEffect)(() => {\n scopedStore.set(atom, data);\n }, [data]);\n });\n return (0, jsx_runtime_1.jsx)(exports.ScopedProviderContext.Provider, { value: scopedContextValue, children: children });\n};\nexports.ScopedProvider = ScopedProvider;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useRouteLoader = void 0;\nconst react_1 = require(\"@remix-run/react\");\nconst jotai_1 = require(\"jotai\");\nconst react_2 = require(\"react\");\nconst getAtom = (atom, key) => {\n let res;\n if (key.includes('+')) {\n // for atom family\n const [atomKey, ...args] = key.split('+');\n const decodeArgs = args.map((a) => decodeURIComponent(a));\n const atomFamily = (atom.atomFamilies || {})[atomKey];\n if (!atomFamily) {\n console.error('atomFamily not found for key: %s', key);\n }\n res = atomFamily(...decodeArgs);\n }\n else {\n // for plain atom\n res = (atom.atoms || {})[key];\n }\n if (process.env.NODE_ENV === 'development' && !res) {\n throw new Error(`no such atom for key: ${key}`);\n }\n return res;\n};\nconst useRouteLoader = (method, params, atom) => {\n const store = (0, jotai_1.useStore)();\n const matches = (0, react_1.useMatches)();\n const stateRef = (0, react_2.useRef)('idle');\n const [state, setState] = (0, react_2.useState)('idle');\n const load = (0, react_2.useCallback)(() => {\n if (stateRef.current === 'loading') {\n return;\n }\n stateRef.current = 'loading';\n setState('loading');\n const url = new URL('', location.href);\n url.searchParams.set('method', method);\n url.searchParams.set('_data', matches.at(-1)?.id || '');\n Object.entries(params).forEach(([key, value]) => {\n url.searchParams.set(key, String(value));\n });\n window\n .fetch(url)\n .then((rsp) => rsp.json())\n .then((data) => {\n if (!data) {\n return;\n }\n try {\n Object.entries(data).forEach(([key, value]) => {\n if (!key.startsWith('$')) {\n return;\n }\n const atomToSet = getAtom(atom, key);\n store.set(atomToSet, value);\n });\n }\n catch (e) {\n console.error(e);\n }\n })\n .catch(console.log)\n .finally(() => {\n stateRef.current = 'idle';\n setState('idle');\n });\n }, [method, params]);\n return {\n state,\n load,\n };\n};\nexports.useRouteLoader = useRouteLoader;\n"],"sourceRoot":""}