Rocky_Mountain_Vending/.pnpm-store/v10/files/13/1bb9efd4c0a98a85e05d33d9a3bc23896eb23f34c3e6475ddd823b5320d95ae96a4a66abc310c98e3219195d1a11240d723c456754867179386dc6593ff121
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

1 line
No EOL
6.3 KiB
Text

{"version":3,"sources":["../../../../src/next-devtools/userspace/app/segment-explorer-node.tsx"],"sourcesContent":["'use client'\n\nimport type { ReactNode } from 'react'\nimport {\n useState,\n createContext,\n useContext,\n use,\n useMemo,\n useCallback,\n} from 'react'\nimport { useLayoutEffect } from 'react'\nimport { dispatcher } from 'next/dist/compiled/next-devtools'\nimport { notFound } from '../../../client/components/not-found'\n\nexport type SegmentBoundaryType =\n | 'not-found'\n | 'error'\n | 'loading'\n | 'global-error'\n\nexport const SEGMENT_EXPLORER_SIMULATED_ERROR_MESSAGE =\n 'NEXT_DEVTOOLS_SIMULATED_ERROR'\n\nexport type SegmentNodeState = {\n type: string\n pagePath: string\n boundaryType: string | null\n setBoundaryType: (type: SegmentBoundaryType | null) => void\n}\n\nfunction SegmentTrieNode({\n type,\n pagePath,\n}: {\n type: string\n pagePath: string\n}): React.ReactNode {\n const { boundaryType, setBoundaryType } = useSegmentState()\n const nodeState: SegmentNodeState = useMemo(() => {\n return {\n type,\n pagePath,\n boundaryType,\n setBoundaryType,\n }\n }, [type, pagePath, boundaryType, setBoundaryType])\n\n // Use `useLayoutEffect` to ensure the state is updated during suspense.\n // `useEffect` won't work as the state is preserved during suspense.\n useLayoutEffect(() => {\n dispatcher.segmentExplorerNodeAdd(nodeState)\n return () => {\n dispatcher.segmentExplorerNodeRemove(nodeState)\n }\n }, [nodeState])\n\n return null\n}\n\nfunction NotFoundSegmentNode(): React.ReactNode {\n notFound()\n}\n\nfunction ErrorSegmentNode(): React.ReactNode {\n throw new Error(SEGMENT_EXPLORER_SIMULATED_ERROR_MESSAGE)\n}\n\nconst forever = new Promise(() => {})\nfunction LoadingSegmentNode(): React.ReactNode {\n use(forever)\n return null\n}\n\nexport function SegmentViewStateNode({ page }: { page: string }) {\n useLayoutEffect(() => {\n dispatcher.segmentExplorerUpdateRouteState(page)\n return () => {\n dispatcher.segmentExplorerUpdateRouteState('')\n }\n }, [page])\n return null\n}\n\nexport function SegmentBoundaryTriggerNode() {\n const { boundaryType } = useSegmentState()\n let segmentNode: React.ReactNode = null\n if (boundaryType === 'loading') {\n segmentNode = <LoadingSegmentNode />\n } else if (boundaryType === 'not-found') {\n segmentNode = <NotFoundSegmentNode />\n } else if (boundaryType === 'error') {\n segmentNode = <ErrorSegmentNode />\n }\n return segmentNode\n}\n\nexport function SegmentViewNode({\n type,\n pagePath,\n children,\n}: {\n type: string\n pagePath: string\n children?: ReactNode\n}): React.ReactNode {\n const segmentNode = (\n <SegmentTrieNode key={type} type={type} pagePath={pagePath} />\n )\n\n return (\n <>\n {segmentNode}\n {children}\n </>\n )\n}\n\nconst SegmentStateContext = createContext<{\n boundaryType: SegmentBoundaryType | null\n setBoundaryType: (type: SegmentBoundaryType | null) => void\n}>({\n boundaryType: null,\n setBoundaryType: () => {},\n})\n\nexport function SegmentStateProvider({ children }: { children: ReactNode }) {\n const [boundaryType, setBoundaryType] = useState<SegmentBoundaryType | null>(\n null\n )\n\n const [errorBoundaryKey, setErrorBoundaryKey] = useState(0)\n const reloadBoundary = useCallback(\n () => setErrorBoundaryKey((prev) => prev + 1),\n []\n )\n\n const setBoundaryTypeAndReload = useCallback(\n (type: SegmentBoundaryType | null) => {\n if (type === null) {\n reloadBoundary()\n }\n setBoundaryType(type)\n },\n [reloadBoundary]\n )\n\n return (\n <SegmentStateContext.Provider\n key={errorBoundaryKey}\n value={{\n boundaryType,\n setBoundaryType: setBoundaryTypeAndReload,\n }}\n >\n {children}\n </SegmentStateContext.Provider>\n )\n}\n\nexport function useSegmentState() {\n return useContext(SegmentStateContext)\n}\n"],"names":["useState","createContext","useContext","use","useMemo","useCallback","useLayoutEffect","dispatcher","notFound","SEGMENT_EXPLORER_SIMULATED_ERROR_MESSAGE","SegmentTrieNode","type","pagePath","boundaryType","setBoundaryType","useSegmentState","nodeState","segmentExplorerNodeAdd","segmentExplorerNodeRemove","NotFoundSegmentNode","ErrorSegmentNode","Error","forever","Promise","LoadingSegmentNode","SegmentViewStateNode","page","segmentExplorerUpdateRouteState","SegmentBoundaryTriggerNode","segmentNode","SegmentViewNode","children","SegmentStateContext","SegmentStateProvider","errorBoundaryKey","setErrorBoundaryKey","reloadBoundary","prev","setBoundaryTypeAndReload","Provider","value"],"mappings":"AAAA;;AAGA,SACEA,QAAQ,EACRC,aAAa,EACbC,UAAU,EACVC,GAAG,EACHC,OAAO,EACPC,WAAW,QACN,QAAO;AACd,SAASC,eAAe,QAAQ,QAAO;AACvC,SAASC,UAAU,QAAQ,mCAAkC;AAC7D,SAASC,QAAQ,QAAQ,uCAAsC;AAQ/D,OAAO,MAAMC,2CACX,gCAA+B;AASjC,SAASC,gBAAgB,EACvBC,IAAI,EACJC,QAAQ,EAIT;IACC,MAAM,EAAEC,YAAY,EAAEC,eAAe,EAAE,GAAGC;IAC1C,MAAMC,YAA8BZ,QAAQ;QAC1C,OAAO;YACLO;YACAC;YACAC;YACAC;QACF;IACF,GAAG;QAACH;QAAMC;QAAUC;QAAcC;KAAgB;IAElD,wEAAwE;IACxE,oEAAoE;IACpER,gBAAgB;QACdC,WAAWU,sBAAsB,CAACD;QAClC,OAAO;YACLT,WAAWW,yBAAyB,CAACF;QACvC;IACF,GAAG;QAACA;KAAU;IAEd,OAAO;AACT;AAEA,SAASG;IACPX;AACF;AAEA,SAASY;IACP,MAAM,qBAAmD,CAAnD,IAAIC,MAAMZ,2CAAV,qBAAA;eAAA;oBAAA;sBAAA;IAAkD;AAC1D;AAEA,MAAMa,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