UNPKG

39.7 kBSource Map (JSON)View Raw
1{"version":3,"names":["PrivateValueStore","isValidKey","key","undefined","getRouteConfigsFromChildren","children","groupKey","groupOptions","configs","React","Children","toArray","reduce","acc","child","isValidElement","type","Screen","props","navigationKey","Error","JSON","stringify","name","push","keys","options","Fragment","Group","screenOptions","String","process","env","NODE_ENV","forEach","config","component","getComponent","isValidElementType","console","warn","test","useNavigationBuilder","createRouter","navigatorKey","useRegisterNavigator","route","useContext","NavigationRouteContext","screenListeners","rest","current","router","useRef","params","state","initial","screen","initialRouteName","routeConfigs","screens","routeNames","map","routeKeyList","curr","join","routeParamList","initialParams","routeGetIdList","Object","assign","getId","length","isStateValid","useCallback","isStateInitialized","stale","currentState","getState","getCurrentState","setState","setCurrentState","setKey","getKey","getIsInitial","NavigationStateContext","stateCleanedUp","cleanUpState","initializedState","isFirstStateInitialization","useMemo","initialRouteParamList","initialParamsFromParams","getInitialState","getRehydratedState","previousRouteKeyListRef","useEffect","previousRouteKeyList","nextState","isArrayEqual","isRecordEqual","getStateForRouteNamesChange","routeKeyChanges","filter","hasOwnProperty","previousNestedParamsRef","previousParams","action","CommonActions","reset","navigate","path","updatedState","getStateForAction","shouldUpdate","useScheduleUpdate","setTimeout","initializedStateRef","emitter","useEventEmitter","e","target","routes","find","index","navigation","descriptors","listeners","concat","cb","i","self","lastIndexOf","listener","useFocusEvents","emit","data","childListeners","addListener","useChildListeners","keyedListeners","addKeyedListener","useKeyedChildListeners","onAction","useOnAction","actionListeners","beforeRemoveListeners","beforeRemove","routerConfigOptions","onRouteFocus","useOnRouteFocus","useNavigationHelpers","id","useFocusedListenersChildrenAdapter","focusedListeners","focus","useOnGetState","getStateListeners","useDescriptors","defaultScreenOptions","useCurrentRender","NavigationContent","useComponent"],"sources":["useNavigationBuilder.tsx"],"sourcesContent":["import {\n CommonActions,\n DefaultRouterOptions,\n NavigationAction,\n NavigationState,\n ParamListBase,\n PartialState,\n Route,\n Router,\n RouterConfigOptions,\n RouterFactory,\n} from '@react-navigation/routers';\nimport * as React from 'react';\nimport { isValidElementType } from 'react-is';\n\nimport Group from './Group';\nimport isArrayEqual from './isArrayEqual';\nimport isRecordEqual from './isRecordEqual';\nimport NavigationHelpersContext from './NavigationHelpersContext';\nimport NavigationRouteContext from './NavigationRouteContext';\nimport NavigationStateContext from './NavigationStateContext';\nimport PreventRemoveProvider from './PreventRemoveProvider';\nimport Screen from './Screen';\nimport {\n DefaultNavigatorOptions,\n EventMapBase,\n EventMapCore,\n NavigatorScreenParams,\n PrivateValueStore,\n RouteConfig,\n} from './types';\nimport useChildListeners from './useChildListeners';\nimport useComponent from './useComponent';\nimport useCurrentRender from './useCurrentRender';\nimport useDescriptors, { ScreenConfigWithParent } from './useDescriptors';\nimport useEventEmitter from './useEventEmitter';\nimport useFocusedListenersChildrenAdapter from './useFocusedListenersChildrenAdapter';\nimport useFocusEvents from './useFocusEvents';\nimport useKeyedChildListeners from './useKeyedChildListeners';\nimport useNavigationHelpers from './useNavigationHelpers';\nimport useOnAction from './useOnAction';\nimport useOnGetState from './useOnGetState';\nimport useOnRouteFocus from './useOnRouteFocus';\nimport useRegisterNavigator from './useRegisterNavigator';\nimport useScheduleUpdate from './useScheduleUpdate';\n\n// This is to make TypeScript compiler happy\n// eslint-disable-next-line babel/no-unused-expressions\nPrivateValueStore;\n\ntype NavigatorRoute<State extends NavigationState> = {\n key: string;\n params?: NavigatorScreenParams<ParamListBase, State>;\n};\n\nconst isValidKey = (key: unknown) =>\n key === undefined || (typeof key === 'string' && key !== '');\n\n/**\n * Extract route config object from React children elements.\n *\n * @param children React Elements to extract the config from.\n */\nconst getRouteConfigsFromChildren = <\n State extends NavigationState,\n ScreenOptions extends {},\n EventMap extends EventMapBase\n>(\n children: React.ReactNode,\n groupKey?: string,\n groupOptions?: ScreenConfigWithParent<\n State,\n ScreenOptions,\n EventMap\n >['options']\n) => {\n const configs = React.Children.toArray(children).reduce<\n ScreenConfigWithParent<State, ScreenOptions, EventMap>[]\n >((acc, child) => {\n if (React.isValidElement(child)) {\n if (child.type === Screen) {\n // We can only extract the config from `Screen` elements\n // If something else was rendered, it's probably a bug\n\n if (!isValidKey(child.props.navigationKey)) {\n throw new Error(\n `Got an invalid 'navigationKey' prop (${JSON.stringify(\n child.props.navigationKey\n )}) for the screen '${\n child.props.name\n }'. It must be a non-empty string or 'undefined'.`\n );\n }\n\n acc.push({\n keys: [groupKey, child.props.navigationKey],\n options: groupOptions,\n props: child.props as RouteConfig<\n ParamListBase,\n string,\n State,\n ScreenOptions,\n EventMap\n >,\n });\n return acc;\n }\n\n if (child.type === React.Fragment || child.type === Group) {\n if (!isValidKey(child.props.navigationKey)) {\n throw new Error(\n `Got an invalid 'navigationKey' prop (${JSON.stringify(\n child.props.navigationKey\n )}) for the group. It must be a non-empty string or 'undefined'.`\n );\n }\n\n // When we encounter a fragment or group, we need to dive into its children to extract the configs\n // This is handy to conditionally define a group of screens\n acc.push(\n ...getRouteConfigsFromChildren<State, ScreenOptions, EventMap>(\n child.props.children,\n child.props.navigationKey,\n child.type !== Group\n ? groupOptions\n : groupOptions != null\n ? [...groupOptions, child.props.screenOptions]\n : [child.props.screenOptions]\n )\n );\n return acc;\n }\n }\n\n throw new Error(\n `A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found ${\n React.isValidElement(child)\n ? `'${\n typeof child.type === 'string' ? child.type : child.type?.name\n }'${\n child.props?.name ? ` for the screen '${child.props.name}'` : ''\n }`\n : typeof child === 'object'\n ? JSON.stringify(child)\n : `'${String(child)}'`\n }). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.`\n );\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n configs.forEach((config) => {\n const { name, children, component, getComponent } = config.props;\n\n if (typeof name !== 'string' || !name) {\n throw new Error(\n `Got an invalid name (${JSON.stringify(\n name\n )}) for the screen. It must be a non-empty string.`\n );\n }\n\n if (\n children != null ||\n component !== undefined ||\n getComponent !== undefined\n ) {\n if (children != null && component !== undefined) {\n throw new Error(\n `Got both 'component' and 'children' props for the screen '${name}'. You must pass only one of them.`\n );\n }\n\n if (children != null && getComponent !== undefined) {\n throw new Error(\n `Got both 'getComponent' and 'children' props for the screen '${name}'. You must pass only one of them.`\n );\n }\n\n if (component !== undefined && getComponent !== undefined) {\n throw new Error(\n `Got both 'component' and 'getComponent' props for the screen '${name}'. You must pass only one of them.`\n );\n }\n\n if (children != null && typeof children !== 'function') {\n throw new Error(\n `Got an invalid value for 'children' prop for the screen '${name}'. It must be a function returning a React Element.`\n );\n }\n\n if (component !== undefined && !isValidElementType(component)) {\n throw new Error(\n `Got an invalid value for 'component' prop for the screen '${name}'. It must be a valid React Component.`\n );\n }\n\n if (getComponent !== undefined && typeof getComponent !== 'function') {\n throw new Error(\n `Got an invalid value for 'getComponent' prop for the screen '${name}'. It must be a function returning a React Component.`\n );\n }\n\n if (typeof component === 'function') {\n if (component.name === 'component') {\n // Inline anonymous functions passed in the `component` prop will have the name of the prop\n // It's relatively safe to assume that it's not a component since it should also have PascalCase name\n // We won't catch all scenarios here, but this should catch a good chunk of incorrect use.\n console.warn(\n `Looks like you're passing an inline function for 'component' prop for the screen '${name}' (e.g. component={() => <SomeComponent />}). Passing an inline function will cause the component state to be lost on re-render and cause perf issues since it's re-created every render. You can pass the function as children to 'Screen' instead to achieve the desired behaviour.`\n );\n } else if (/^[a-z]/.test(component.name)) {\n console.warn(\n `Got a component with the name '${component.name}' for the screen '${name}'. React Components must start with an uppercase letter. If you're passing a regular function and not a component, pass it as children to 'Screen' instead. Otherwise capitalize your component's name.`\n );\n }\n }\n } else {\n throw new Error(\n `Couldn't find a 'component', 'getComponent' or 'children' prop for the screen '${name}'. This can happen if you passed 'undefined'. You likely forgot to export your component from the file it's defined in, or mixed up default import and named import when importing.`\n );\n }\n });\n }\n\n return configs;\n};\n\n/**\n * Hook for building navigators.\n *\n * @param createRouter Factory method which returns router object.\n * @param options Options object containing `children` and additional options for the router.\n * @returns An object containing `state`, `navigation`, `descriptors` objects.\n */\nexport default function useNavigationBuilder<\n State extends NavigationState,\n RouterOptions extends DefaultRouterOptions,\n ActionHelpers extends Record<string, () => void>,\n ScreenOptions extends {},\n EventMap extends Record<string, any>\n>(\n createRouter: RouterFactory<State, any, RouterOptions>,\n options: DefaultNavigatorOptions<\n ParamListBase,\n State,\n ScreenOptions,\n EventMap\n > &\n RouterOptions\n) {\n const navigatorKey = useRegisterNavigator();\n\n const route = React.useContext(NavigationRouteContext) as\n | NavigatorRoute<State>\n | undefined;\n\n const { children, screenListeners, ...rest } = options;\n const { current: router } = React.useRef<Router<State, any>>(\n createRouter({\n ...(rest as unknown as RouterOptions),\n ...(route?.params &&\n route.params.state == null &&\n route.params.initial !== false &&\n typeof route.params.screen === 'string'\n ? { initialRouteName: route.params.screen }\n : null),\n })\n );\n\n const routeConfigs = getRouteConfigsFromChildren<\n State,\n ScreenOptions,\n EventMap\n >(children);\n\n const screens = routeConfigs.reduce<\n Record<string, ScreenConfigWithParent<State, ScreenOptions, EventMap>>\n >((acc, config) => {\n if (config.props.name in acc) {\n throw new Error(\n `A navigator cannot contain multiple 'Screen' components with the same name (found duplicate screen named '${config.props.name}')`\n );\n }\n\n acc[config.props.name] = config;\n return acc;\n }, {});\n\n const routeNames = routeConfigs.map((config) => config.props.name);\n const routeKeyList = routeNames.reduce<Record<string, React.Key | undefined>>(\n (acc, curr) => {\n acc[curr] = screens[curr].keys.map((key) => key ?? '').join(':');\n return acc;\n },\n {}\n );\n const routeParamList = routeNames.reduce<Record<string, object | undefined>>(\n (acc, curr) => {\n const { initialParams } = screens[curr].props;\n acc[curr] = initialParams;\n return acc;\n },\n {}\n );\n const routeGetIdList = routeNames.reduce<\n RouterConfigOptions['routeGetIdList']\n >(\n (acc, curr) =>\n Object.assign(acc, {\n [curr]: screens[curr].props.getId,\n }),\n {}\n );\n\n if (!routeNames.length) {\n throw new Error(\n \"Couldn't find any screens for the navigator. Have you defined any screens as its children?\"\n );\n }\n\n const isStateValid = React.useCallback(\n (state: NavigationState | PartialState<NavigationState>) =>\n state.type === undefined || state.type === router.type,\n [router.type]\n );\n\n const isStateInitialized = React.useCallback(\n (state: NavigationState | PartialState<NavigationState> | undefined) =>\n state !== undefined && state.stale === false && isStateValid(state),\n [isStateValid]\n );\n\n const {\n state: currentState,\n getState: getCurrentState,\n setState: setCurrentState,\n setKey,\n getKey,\n getIsInitial,\n } = React.useContext(NavigationStateContext);\n\n const stateCleanedUp = React.useRef(false);\n\n const cleanUpState = React.useCallback(() => {\n setCurrentState(undefined);\n stateCleanedUp.current = true;\n }, [setCurrentState]);\n\n const setState = React.useCallback(\n (state: NavigationState | PartialState<NavigationState> | undefined) => {\n if (stateCleanedUp.current) {\n // State might have been already cleaned up due to unmount\n // We do not want to expose API allowing to override this\n // This would lead to old data preservation on main navigator unmount\n return;\n }\n setCurrentState(state);\n },\n [setCurrentState]\n );\n\n const [initializedState, isFirstStateInitialization] = React.useMemo(() => {\n const initialRouteParamList = routeNames.reduce<\n Record<string, object | undefined>\n >((acc, curr) => {\n const { initialParams } = screens[curr].props;\n const initialParamsFromParams =\n route?.params?.state == null &&\n route?.params?.initial !== false &&\n route?.params?.screen === curr\n ? route.params.params\n : undefined;\n\n acc[curr] =\n initialParams !== undefined || initialParamsFromParams !== undefined\n ? {\n ...initialParams,\n ...initialParamsFromParams,\n }\n : undefined;\n\n return acc;\n }, {});\n\n // If the current state isn't initialized on first render, we initialize it\n // We also need to re-initialize it if the state passed from parent was changed (maybe due to reset)\n // Otherwise assume that the state was provided as initial state\n // So we need to rehydrate it to make it usable\n if (\n (currentState === undefined || !isStateValid(currentState)) &&\n route?.params?.state == null\n ) {\n return [\n router.getInitialState({\n routeNames,\n routeParamList: initialRouteParamList,\n routeGetIdList,\n }),\n true,\n ];\n } else {\n return [\n router.getRehydratedState(\n route?.params?.state ?? (currentState as PartialState<State>),\n {\n routeNames,\n routeParamList: initialRouteParamList,\n routeGetIdList,\n }\n ),\n false,\n ];\n }\n // We explicitly don't include routeNames, route.params etc. in the dep list\n // below. We want to avoid forcing a new state to be calculated in those cases\n // Instead, we handle changes to these in the nextState code below. Note\n // that some changes to routeConfigs are explicitly ignored, such as changes\n // to initialParams\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [currentState, router, isStateValid]);\n\n const previousRouteKeyListRef = React.useRef(routeKeyList);\n\n React.useEffect(() => {\n previousRouteKeyListRef.current = routeKeyList;\n });\n\n const previousRouteKeyList = previousRouteKeyListRef.current;\n\n let state =\n // If the state isn't initialized, or stale, use the state we initialized instead\n // The state won't update until there's a change needed in the state we have initalized locally\n // So it'll be `undefined` or stale until the first navigation event happens\n isStateInitialized(currentState)\n ? (currentState as State)\n : (initializedState as State);\n\n let nextState: State = state;\n\n if (\n !isArrayEqual(state.routeNames, routeNames) ||\n !isRecordEqual(routeKeyList, previousRouteKeyList)\n ) {\n // When the list of route names change, the router should handle it to remove invalid routes\n nextState = router.getStateForRouteNamesChange(state, {\n routeNames,\n routeParamList,\n routeGetIdList,\n routeKeyChanges: Object.keys(routeKeyList).filter(\n (name) =>\n previousRouteKeyList.hasOwnProperty(name) &&\n routeKeyList[name] !== previousRouteKeyList[name]\n ),\n });\n }\n\n const previousNestedParamsRef = React.useRef(route?.params);\n\n React.useEffect(() => {\n previousNestedParamsRef.current = route?.params;\n }, [route?.params]);\n\n if (route?.params) {\n const previousParams = previousNestedParamsRef.current;\n\n let action: CommonActions.Action | undefined;\n\n if (\n typeof route.params.state === 'object' &&\n route.params.state != null &&\n route.params !== previousParams\n ) {\n // If the route was updated with new state, we should reset to it\n action = CommonActions.reset(route.params.state);\n } else if (\n typeof route.params.screen === 'string' &&\n ((route.params.initial === false && isFirstStateInitialization) ||\n route.params !== previousParams)\n ) {\n // If the route was updated with new screen name and/or params, we should navigate there\n action = CommonActions.navigate({\n name: route.params.screen,\n params: route.params.params,\n path: route.params.path,\n });\n }\n\n // The update should be limited to current navigator only, so we call the router manually\n const updatedState = action\n ? router.getStateForAction(nextState, action, {\n routeNames,\n routeParamList,\n routeGetIdList,\n })\n : null;\n\n nextState =\n updatedState !== null\n ? router.getRehydratedState(updatedState, {\n routeNames,\n routeParamList,\n routeGetIdList,\n })\n : nextState;\n }\n\n const shouldUpdate = state !== nextState;\n\n useScheduleUpdate(() => {\n if (shouldUpdate) {\n // If the state needs to be updated, we'll schedule an update\n setState(nextState);\n }\n });\n\n // The up-to-date state will come in next render, but we don't need to wait for it\n // We can't use the outdated state since the screens have changed, which will cause error due to mismatched config\n // So we override the state object we return to use the latest state as soon as possible\n state = nextState;\n\n React.useEffect(() => {\n setKey(navigatorKey);\n\n if (!getIsInitial()) {\n // If it's not initial render, we need to update the state\n // This will make sure that our container gets notifier of state changes due to new mounts\n // This is necessary for proper screen tracking, URL updates etc.\n setState(nextState);\n }\n\n return () => {\n // We need to clean up state for this navigator on unmount\n // We do it in a timeout because we need to detect if another navigator mounted in the meantime\n // For example, if another navigator has started rendering, we should skip cleanup\n // Otherwise, our cleanup step will cleanup state for the other navigator and re-initialize it\n setTimeout(() => {\n if (getCurrentState() !== undefined && getKey() === navigatorKey) {\n cleanUpState();\n }\n }, 0);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // We initialize this ref here to avoid a new getState getting initialized\n // whenever initializedState changes. We want getState to have access to the\n // latest initializedState, but don't need it to change when that happens\n const initializedStateRef = React.useRef<State>();\n initializedStateRef.current = initializedState;\n\n const getState = React.useCallback((): State => {\n const currentState = getCurrentState();\n\n return isStateInitialized(currentState)\n ? (currentState as State)\n : (initializedStateRef.current as State);\n }, [getCurrentState, isStateInitialized]);\n\n const emitter = useEventEmitter<EventMapCore<State>>((e) => {\n let routeNames = [];\n\n let route: Route<string> | undefined;\n\n if (e.target) {\n route = state.routes.find((route) => route.key === e.target);\n\n if (route?.name) {\n routeNames.push(route.name);\n }\n } else {\n route = state.routes[state.index];\n routeNames.push(\n ...Object.keys(screens).filter((name) => route?.name === name)\n );\n }\n\n if (route == null) {\n return;\n }\n\n const navigation = descriptors[route.key].navigation;\n\n const listeners = ([] as (((e: any) => void) | undefined)[])\n .concat(\n // Get an array of listeners for all screens + common listeners on navigator\n ...[\n screenListeners,\n ...routeNames.map((name) => {\n const { listeners } = screens[name].props;\n return listeners;\n }),\n ].map((listeners) => {\n const map =\n typeof listeners === 'function'\n ? listeners({ route: route as any, navigation })\n : listeners;\n\n return map\n ? Object.keys(map)\n .filter((type) => type === e.type)\n .map((type) => map?.[type])\n : undefined;\n })\n )\n // We don't want same listener to be called multiple times for same event\n // So we remove any duplicate functions from the array\n .filter((cb, i, self) => cb && self.lastIndexOf(cb) === i);\n\n listeners.forEach((listener) => listener?.(e));\n });\n\n useFocusEvents({ state, emitter });\n\n React.useEffect(() => {\n emitter.emit({ type: 'state', data: { state } });\n }, [emitter, state]);\n\n const { listeners: childListeners, addListener } = useChildListeners();\n\n const { keyedListeners, addKeyedListener } = useKeyedChildListeners();\n\n const onAction = useOnAction({\n router,\n getState,\n setState,\n key: route?.key,\n actionListeners: childListeners.action,\n beforeRemoveListeners: keyedListeners.beforeRemove,\n routerConfigOptions: {\n routeNames,\n routeParamList,\n routeGetIdList,\n },\n emitter,\n });\n\n const onRouteFocus = useOnRouteFocus({\n router,\n key: route?.key,\n getState,\n setState,\n });\n\n const navigation = useNavigationHelpers<\n State,\n ActionHelpers,\n NavigationAction,\n EventMap\n >({\n id: options.id,\n onAction,\n getState,\n emitter,\n router,\n });\n\n useFocusedListenersChildrenAdapter({\n navigation,\n focusedListeners: childListeners.focus,\n });\n\n useOnGetState({\n getState,\n getStateListeners: keyedListeners.getState,\n });\n\n const descriptors = useDescriptors<\n State,\n ActionHelpers,\n ScreenOptions,\n EventMap\n >({\n state,\n screens,\n navigation,\n screenOptions: options.screenOptions,\n defaultScreenOptions: options.defaultScreenOptions,\n onAction,\n getState,\n setState,\n onRouteFocus,\n addListener,\n addKeyedListener,\n router,\n // @ts-expect-error: this should have both core and custom events, but too much work right now\n emitter,\n });\n\n useCurrentRender({\n state,\n navigation,\n descriptors,\n });\n\n const NavigationContent = useComponent((children: React.ReactNode) => (\n <NavigationHelpersContext.Provider value={navigation}>\n <PreventRemoveProvider>{children}</PreventRemoveProvider>\n </NavigationHelpersContext.Provider>\n ));\n\n return {\n state,\n navigation,\n descriptors,\n NavigationContent,\n };\n}\n"],"mappings":";;;;;;;AAAA;;AAYA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA;AACA;AACAA,wBAAA;;AAOA,MAAMC,UAAU,GAAIC,GAAD,IACjBA,GAAG,KAAKC,SAAR,IAAsB,OAAOD,GAAP,KAAe,QAAf,IAA2BA,GAAG,KAAK,EAD3D;AAGA;AACA;AACA;AACA;AACA;;;AACA,MAAME,2BAA2B,GAAG,CAKlCC,QALkC,EAMlCC,QANkC,EAOlCC,YAPkC,KAY/B;EACH,MAAMC,OAAO,GAAGC,KAAK,CAACC,QAAN,CAAeC,OAAf,CAAuBN,QAAvB,EAAiCO,MAAjC,CAEd,CAACC,GAAD,EAAMC,KAAN,KAAgB;IAAA;;IAChB,kBAAIL,KAAK,CAACM,cAAN,CAAqBD,KAArB,CAAJ,EAAiC;MAC/B,IAAIA,KAAK,CAACE,IAAN,KAAeC,eAAnB,EAA2B;QACzB;QACA;QAEA,IAAI,CAAChB,UAAU,CAACa,KAAK,CAACI,KAAN,CAAYC,aAAb,CAAf,EAA4C;UAC1C,MAAM,IAAIC,KAAJ,CACH,wCAAuCC,IAAI,CAACC,SAAL,CACtCR,KAAK,CAACI,KAAN,CAAYC,aAD0B,CAEtC,qBACAL,KAAK,CAACI,KAAN,CAAYK,IACb,kDALG,CAAN;QAOD;;QAEDV,GAAG,CAACW,IAAJ,CAAS;UACPC,IAAI,EAAE,CAACnB,QAAD,EAAWQ,KAAK,CAACI,KAAN,CAAYC,aAAvB,CADC;UAEPO,OAAO,EAAEnB,YAFF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