@preprio/prepr-nextjs 2.0.0-alpha.4 → 2.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,76 +1,165 @@
1
- # @preprio/prepr-nextjs
1
+ # The Prepr Next.js package
2
2
 
3
- Next.js package for Prepr CMS preview functionality with advanced debugging and visual editing capabilities.
3
+ ## Getting Started
4
+ <hr>
5
+ The Prepr Next.js package offers some helper functions and the Adaptive Preview Bar component for an
6
+ easier personalization & A/B testing implementation in your Next.js project.
4
7
 
5
- ## Development
8
+ ## Installation
9
+ <hr>
10
+ To install the Prepr Next.js package, run the following command:
6
11
 
7
- ### Setup
8
12
  ```bash
9
- pnpm install
13
+ npm install @preprio/prepr-nextjs
10
14
  ```
11
15
 
12
- ### Available Commands
16
+ Next, add the `PREPR_ENV` variable to the `.env` file. You can enable the *Adaptive Preview Bar* for a staging environment by setting the value to `preview`.
13
17
 
14
- - `npm run dev` - Start development mode with watch
15
- - `npm run build` - Build the package for production
16
- - `npm run clean` - Clean the dist directory
17
- - `npm run check` - Run all quality checks (type-check, lint, format)
18
- - `npm run type-check` - Check TypeScript types
19
- - `npm run lint` - Fix linting issues
20
- - `npm run lint:check` - Check for linting issues
21
- - `npm run format` - Format code with Prettier
22
- - `npm run format:check` - Check code formatting
18
+ ```bash
19
+ PREPR_ENV=preview
20
+ ```
23
21
 
24
- ## Release Process
22
+ When you're launching your project to production, then set the `PREPR_ENV` environment variable to `production`. This way, the *Adaptive Preview Bar* doesn't get displayed on a live web app.
25
23
 
26
- The release process is streamlined and automated:
24
+ Next, implement the `PreprMiddleware` function. Go to your `middleware.js` or the `middleware.ts`
25
+ file. If you don't have this file, you can create it in the root of your project.
27
26
 
28
- 1. **Check code quality**: `npm run check`
29
- 2. **Release**: `npm run release <type> [prerelease-type]`
27
+ Then add the following code to the `middleware.ts` file:
28
+ ```javascript
29
+ import type { NextRequest } from 'next/server'
30
+ import { PreprMiddleware } from '@preprio/prepr-nextjs'
30
31
 
31
- ### Release Types
32
- - `patch` - Bug fixes (1.0.0 → 1.0.1)
33
- - `minor` - New features (1.0.0 → 1.1.0)
34
- - `major` - Breaking changes (1.0.0 → 2.0.0)
35
- - `prerelease` - Pre-release versions
32
+ export function middleware(request: NextRequest) {
33
+ return PreprMiddleware(request)
34
+ }
35
+ ```
36
36
 
37
- ### Examples
38
- ```bash
39
- # Release a patch version
40
- npm run release patch
37
+ Or add the following code to the `middleware.js` file:
38
+ ```javascript
39
+ import { PreprMiddleware } from '@preprio/prepr-nextjs'
41
40
 
42
- # Release a prerelease alpha version
43
- npm run release prerelease alpha
41
+ export function middleware(request) {
42
+ return PreprMiddleware(request)
43
+ }
44
+ ```
44
45
 
45
- # Release a prerelease beta version
46
- npm run release prerelease beta
46
+ ### Middleware functionality
47
+ The `PreprMiddleware` accepts a request and optional response property and returns a `NextRequest` object.
48
+ This is done so you are able to chain your own middleware to it.
49
+
50
+ The `PreprMiddleware` function checks every request if the `__prepr_uid` cookie is set. If it isn't, the function generates a new UUID and sets it as a cookie. Then it returns a `Prepr-Customer-Id` header with the value of the `__prepr_uid` cookie to simplify your personalization and A/B testing implementation.
51
+
52
+ If the `PREPR_ENV` environment variable is set to `preview`, the `PreprMiddleware` function also checks for searchParams `segments` and `a-b-testing` in the URL.
53
+ If these searchParams are set, the PreprMiddleware sets the `Prepr-Segments` and `Prepr-AB-Testing` headers with the values of the searchParams, and stores its value in a cookie.
54
+
55
+ ## Usage
56
+ To set your API request headers to query adaptive content or A/B testing content, you can call the `getPreprHeaders()` helper function. It returns an array of headers that you can spread in your fetch call.
57
+ See the example code below in the `page.tsx` file.
58
+
59
+ ```javascript
60
+ import { getClient } from '@/lib/client'
61
+ import { GetPageBySlugDocument, GetPageBySlugQuery } from '@/gql/graphql'
62
+ import { getPreprHeaders } from '@preprio/prepr-nextjs'
63
+
64
+ const getData = async () => {
65
+ // Fetching the data using Apollo Client
66
+ const {data} = await getClient().query < GetPageBySlugQuery > ({
67
+ query: GetPageBySlugDocument,
68
+ variables: {
69
+ slug: '/',
70
+ },
71
+ context: {
72
+ // Call the getPreprHeaders function to get the appropriate headers
73
+ headers: getPreprHeaders(),
74
+ },
75
+ fetchPolicy: 'no-cache',
76
+ })
77
+ }
78
+ ```
79
+ See the JavaScript example code below in the `page.js`file.
80
+
81
+ ```javascript
82
+ import { getClient } from '@/lib/client'
83
+ import { GetPageBySlug } from '@/queries/get-page-by-slug';
84
+ import { getPreprHeaders } from '@preprio/prepr-nextjs'
85
+
86
+ const getData = async () => {
87
+ // Fetching the data using Apollo Client
88
+ const { data } = await client.query({
89
+ query: GetPageBySlug,
90
+ variables: {
91
+ slug: '/',
92
+ },
93
+ context: {
94
+ // Call the getPreprHeaders function to get the appropriate headers
95
+ headers: getPreprHeaders(),
96
+ },
97
+ fetchPolicy: 'no-cache',
98
+ })
99
+ return data;
100
+ }
47
101
  ```
48
102
 
49
- The release script will:
50
- 1. Check if working directory is clean
51
- 2. Run all quality checks
52
- 3. Build the package
53
- 4. Update version in package.json
54
- 5. Commit changes and create git tag
55
- 6. Push changes and tag to remote
103
+ ### Installing the Adaptive Preview Bar component
56
104
 
57
- ## Package Structure
105
+ The preview bar component fetches all segments from the Prepr API. So, you need to give it access to do this as follows:
58
106
 
107
+ 1. In your Prepr environment, go to the **Settings → Access tokens** page to view all the access tokens.
108
+ 2. Click the *GraphQL Preview* access token to open it and tick the **Enable edit mode** checkbox and click the **Save** button.
109
+
110
+ ![Preview access token](https://assets-site.prepr.io/229kaekn7m96//preview-access-token-enable-edit-mode.png)
111
+
112
+ To implement the *Adaptive Preview Bar* component, navigate to your root layout file, this is usually `layout.tsx`.
113
+
114
+ Then add the following code to the `layout.tsx` file:
115
+
116
+ ```javascript
117
+ // Helper function to get all the props for the PreviewBar component (this needs a server component)
118
+ import { getPreviewBarProps } from '@preprio/prepr-nextjs'
119
+ // Import the PreviewBar component
120
+ import { PreprPreviewBar } from '@preprio/prepr-nextjs/components'
121
+ // Import the PreviewBar CSS
122
+ import '@preprio/prepr-nextjs/dist/components.css'
123
+
124
+
125
+ export default async function RootLayout({children}: {children: React.ReactNode}) {
126
+ // Get the props for the PreviewBar component, pass the access token as an argument
127
+ const previewBarProps = await getPreviewBarProps(process.env.PREPR_GRAPHQL_URL!)
128
+
129
+ return (
130
+ <html>
131
+ <head>
132
+ {/*...*/}
133
+ </head>
134
+ <body>
135
+ {/* Render the PreviewBar component and spread the previewBarProps */}
136
+ <PreprPreviewBar {...previewBarProps} />
137
+ {children}
138
+ </body>
139
+ </html>
140
+ )
141
+ }
59
142
  ```
60
- dist/
61
- ├── react/ # React components and hooks
62
- ├── middleware/ # Next.js middleware
63
- ├── server/ # Server-side utilities
64
- ├── types/ # TypeScript type definitions
65
- ├── utils/ # Utility functions
66
- └── index.css # Compiled CSS
67
- ```
68
143
 
69
- ## Exports
144
+ Now the *Adaptive Preview Bar* is rendered on every page of your website. This component shows the segments in a dropdown list and a switch for A and B variants for an A/B test. If you have added the `getPreprHeaders()` function
145
+ to your API calls it automatically updates the segments and A/B testing variants when you select a new segment or variant.
146
+
147
+ ### Helper functions
148
+
149
+ #### getPreprUUID()
150
+ The `getPreprUUID()` function will return the value of the `__prepr_uid` cookie. This can be useful if you want to store the `__prepr_uid` in a cookie or local storage.
151
+
152
+ #### getActiveSegment()
153
+ Returns the active segment from the `Prepr-Segments` header.
154
+
155
+ #### getActiveVariant()
156
+ Returns the active variant from the `Prepr-ABTesting` header.
157
+
158
+ #### getPreviewHeaders()
159
+ Helper function to only get the preview headers.
160
+
161
+ #### getPreprHeaders()
162
+ Helper function that will either return the customer id header or the preview headers depending on the `PREPR_ENV` environment variable.
70
163
 
71
- - `./react` - React components and hooks
72
- - `./middleware` - Next.js middleware
73
- - `./server` - Server-side utilities
74
- - `./utils` - Utility functions
75
- - `./types` - TypeScript types
76
- - `./index.css` - Compiled CSS styles
164
+ #### getPreviewBarProps()
165
+ Helper function to get the props for the PreviewBar component. Will return the segments and A/B testing variants aswell as an aray of all the segments.
@@ -1 +1 @@
1
- {"inputs":{"src/utils/errors.ts":{"bytes":1985,"imports":[],"format":"esm"},"src/react/contexts/segment-context.tsx":{"bytes":1576,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../../types","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/variant-context.tsx":{"bytes":1109,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/edit-mode-context.tsx":{"bytes":1113,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/index.ts":{"bytes":267,"imports":[{"path":"src/react/contexts/segment-context.tsx","kind":"import-statement","original":"./segment-context"},{"path":"src/react/contexts/variant-context.tsx","kind":"import-statement","original":"./variant-context"},{"path":"src/react/contexts/edit-mode-context.tsx","kind":"import-statement","original":"./edit-mode-context"}],"format":"esm"},"src/react/components/error-boundary.tsx":{"bytes":1342,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/utils/debug.ts":{"bytes":2587,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/prepr-previewbar-provider.tsx":{"bytes":2424,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../types","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"./contexts"},{"path":"src/react/components/error-boundary.tsx","kind":"import-statement","original":"./components/error-boundary"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../utils/debug"}],"format":"esm"},"src/utils/dom.ts":{"bytes":4121,"imports":[{"path":"src/utils/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"src/utils/performance.ts":{"bytes":1143,"imports":[],"format":"esm"},"src/react/hooks/useStegaOverlay.tsx":{"bytes":5294,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/dom.ts","kind":"import-statement","original":"../../utils/dom"},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"@vercel/stega","kind":"import-statement","external":true}],"format":"esm"},"src/react/hooks/useStegaProximity.tsx":{"bytes":3242,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"../../utils/performance"}],"format":"esm"},"src/react/hooks/useStegaElements.tsx":{"bytes":4787,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"}],"format":"esm"},"src/react/hooks/useStegaScan.tsx":{"bytes":3954,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/dom.ts","kind":"import-statement","original":"../../utils/dom"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"../../utils/performance"},{"path":"src/react/hooks/useStegaOverlay.tsx","kind":"import-statement","original":"./useStegaOverlay"},{"path":"src/react/hooks/useStegaProximity.tsx","kind":"import-statement","original":"./useStegaProximity"},{"path":"src/react/hooks/useStegaElements.tsx","kind":"import-statement","original":"./useStegaElements"}],"format":"esm"},"src/utils/index.ts":{"bytes":750,"imports":[{"path":"clsx","kind":"import-statement","external":true},{"path":"tailwind-merge","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"./errors"},{"path":"src/utils/dom.ts","kind":"import-statement","original":"./dom"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"./debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"./performance"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/hooks/useModal.ts":{"bytes":1586,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/logo.tsx":{"bytes":4307,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/icons/sort-down.tsx":{"bytes":649,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/segment-dropdown.tsx":{"bytes":3041,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../../types","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"src/react/components/icons/sort-down.tsx","kind":"import-statement","original":"./icons/sort-down"},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"}],"format":"esm"},"src/react/components/radio-selector.tsx":{"bytes":1431,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"}],"format":"esm"},"src/react/components/variant-selector.tsx":{"bytes":1052,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"src/react/components/radio-selector.tsx","kind":"import-statement","original":"./radio-selector"}],"format":"esm"},"src/react/components/edit-mode-selector.tsx":{"bytes":577,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"src/react/components/radio-selector.tsx","kind":"import-statement","original":"./radio-selector"}],"format":"esm"},"src/react/components/icons/rotate.tsx":{"bytes":1662,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/reset-button.tsx":{"bytes":1747,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"},{"path":"src/react/components/icons/rotate.tsx","kind":"import-statement","original":"./icons/rotate"}],"format":"esm"},"src/react/components/preview-bar/preview-bar-content.tsx":{"bytes":3072,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/logo.tsx","kind":"import-statement","original":"../logo"},{"path":"src/react/components/segment-dropdown.tsx","kind":"import-statement","original":"../segment-dropdown"},{"path":"src/react/components/variant-selector.tsx","kind":"import-statement","original":"../variant-selector"},{"path":"src/react/components/edit-mode-selector.tsx","kind":"import-statement","original":"../edit-mode-selector"},{"path":"src/react/components/reset-button.tsx","kind":"import-statement","original":"../reset-button"}],"format":"esm"},"src/react/components/icon.tsx":{"bytes":815,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/preview-bar/preview-bar-button.tsx":{"bytes":537,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../../utils"},{"path":"src/react/components/icon.tsx","kind":"import-statement","original":"../icon"}],"format":"esm"},"src/react/components/preview-bar/preview-bar.tsx":{"bytes":3193,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../../utils"},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../../contexts"},{"path":"src/react/hooks/useModal.ts","kind":"import-statement","original":"../../hooks/useModal"},{"path":"src/react/components/preview-bar/preview-bar-content.tsx","kind":"import-statement","original":"./preview-bar-content"},{"path":"src/react/components/preview-bar/preview-bar-button.tsx","kind":"import-statement","original":"./preview-bar-button"}],"format":"esm"},"src/react/components/preview-bar/index.ts":{"bytes":171,"imports":[{"path":"src/react/components/preview-bar/preview-bar.tsx","kind":"import-statement","original":"./preview-bar"},{"path":"src/react/components/preview-bar/preview-bar-content.tsx","kind":"import-statement","original":"./preview-bar-content"},{"path":"src/react/components/preview-bar/preview-bar-button.tsx","kind":"import-statement","original":"./preview-bar-button"}],"format":"esm"},"src/react/components/preview-bar-wrapper.tsx":{"bytes":1446,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/preview-bar/index.ts","kind":"import-statement","original":"./preview-bar"},{"path":"next/navigation","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/status-indicator-pill.tsx":{"bytes":1396,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"}],"format":"esm"},"src/react/components/icons/xmark.tsx":{"bytes":530,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/close-edit-mode-pill.tsx":{"bytes":868,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"},{"path":"src/react/components/icons/xmark.tsx","kind":"import-statement","original":"./icons/xmark"}],"format":"esm"},"src/react/components/preview-bar-indicator-wrapper.tsx":{"bytes":361,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/status-indicator-pill.tsx","kind":"import-statement","original":"./status-indicator-pill"},{"path":"src/react/components/close-edit-mode-pill.tsx","kind":"import-statement","original":"./close-edit-mode-pill"}],"format":"esm"},"src/react/components/prepr-preview-bar.tsx":{"bytes":487,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"src/react/hooks/useStegaScan.tsx","kind":"import-statement","original":"../hooks/useStegaScan"},{"path":"src/react/components/preview-bar-wrapper.tsx","kind":"import-statement","original":"./preview-bar-wrapper"},{"path":"src/react/components/preview-bar-indicator-wrapper.tsx","kind":"import-statement","original":"./preview-bar-indicator-wrapper"}],"format":"esm"},"src/react/hooks/useScrollPosition.tsx":{"bytes":1767,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"}],"format":"esm"},"src/react/index.tsx":{"bytes":1450,"imports":[{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"./prepr-previewbar-provider"},{"path":"src/react/components/prepr-preview-bar.tsx","kind":"import-statement","original":"./components/prepr-preview-bar"},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"./contexts"},{"path":"src/react/hooks/useStegaScan.tsx","kind":"import-statement","original":"./hooks/useStegaScan"},{"path":"src/react/hooks/useStegaOverlay.tsx","kind":"import-statement","original":"./hooks/useStegaOverlay"},{"path":"src/react/hooks/useStegaProximity.tsx","kind":"import-statement","original":"./hooks/useStegaProximity"},{"path":"src/react/hooks/useStegaElements.tsx","kind":"import-statement","original":"./hooks/useStegaElements"},{"path":"src/react/hooks/useModal.ts","kind":"import-statement","original":"./hooks/useModal"},{"path":"src/react/hooks/useScrollPosition.tsx","kind":"import-statement","original":"./hooks/useScrollPosition"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../utils/debug"},{"path":"src/react/components/error-boundary.tsx","kind":"import-statement","original":"./components/error-boundary"},{"path":"src/react/components/preview-bar/preview-bar.tsx","kind":"import-statement","original":"./components/preview-bar/preview-bar"},{"path":"src/react/components/preview-bar-wrapper.tsx","kind":"import-statement","original":"./components/preview-bar-wrapper"},{"path":"src/react/components/preview-bar-indicator-wrapper.tsx","kind":"import-statement","original":"./components/preview-bar-indicator-wrapper"},{"path":"src/react/components/segment-dropdown.tsx","kind":"import-statement","original":"./components/segment-dropdown"},{"path":"src/react/components/variant-selector.tsx","kind":"import-statement","original":"./components/variant-selector"},{"path":"src/react/components/edit-mode-selector.tsx","kind":"import-statement","original":"./components/edit-mode-selector"},{"path":"src/react/components/reset-button.tsx","kind":"import-statement","original":"./components/reset-button"},{"path":"src/react/components/logo.tsx","kind":"import-statement","original":"./components/logo"}],"format":"esm"}},"outputs":{"dist/react/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":105145},"dist/react/index.cjs":{"imports":[{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"@vercel/stega","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react-dom","kind":"require-call","external":true},{"path":"clsx","kind":"require-call","external":true},{"path":"tailwind-merge","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"next/navigation","kind":"require-call","external":true},{"path":"@headlessui/react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"next/navigation","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"@headlessui/react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"next/navigation","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"next/navigation","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/react/index.tsx","inputs":{"src/react/index.tsx":{"bytesInOutput":672},"src/react/prepr-previewbar-provider.tsx":{"bytesInOutput":948},"src/react/contexts/segment-context.tsx":{"bytesInOutput":474},"src/utils/errors.ts":{"bytesInOutput":655},"src/react/contexts/index.ts":{"bytesInOutput":0},"src/react/contexts/variant-context.tsx":{"bytesInOutput":339},"src/react/contexts/edit-mode-context.tsx":{"bytesInOutput":372},"src/react/components/error-boundary.tsx":{"bytesInOutput":746},"src/utils/debug.ts":{"bytesInOutput":713},"src/react/components/prepr-preview-bar.tsx":{"bytesInOutput":194},"src/react/hooks/useStegaScan.tsx":{"bytesInOutput":1517},"src/utils/dom.ts":{"bytesInOutput":1397},"src/utils/performance.ts":{"bytesInOutput":278},"src/react/hooks/useStegaOverlay.tsx":{"bytesInOutput":2375},"src/react/hooks/useStegaProximity.tsx":{"bytesInOutput":1038},"src/react/hooks/useStegaElements.tsx":{"bytesInOutput":2328},"src/react/components/preview-bar-wrapper.tsx":{"bytesInOutput":671},"src/react/components/preview-bar/preview-bar.tsx":{"bytesInOutput":1335},"src/utils/index.ts":{"bytesInOutput":190},"src/react/hooks/useModal.ts":{"bytesInOutput":673},"src/react/components/preview-bar/preview-bar-content.tsx":{"bytesInOutput":2567},"src/react/components/logo.tsx":{"bytesInOutput":4173},"src/react/components/segment-dropdown.tsx":{"bytesInOutput":1847},"src/react/components/icons/sort-down.tsx":{"bytesInOutput":545},"src/react/components/variant-selector.tsx":{"bytesInOutput":539},"src/react/components/radio-selector.tsx":{"bytesInOutput":786},"src/react/components/edit-mode-selector.tsx":{"bytesInOutput":238},"src/react/components/reset-button.tsx":{"bytesInOutput":971},"src/react/components/icons/rotate.tsx":{"bytesInOutput":1607},"src/react/components/preview-bar/preview-bar-button.tsx":{"bytesInOutput":295},"src/react/components/icon.tsx":{"bytesInOutput":696},"src/react/components/preview-bar/index.ts":{"bytesInOutput":0},"src/react/components/preview-bar-indicator-wrapper.tsx":{"bytesInOutput":218},"src/react/components/status-indicator-pill.tsx":{"bytesInOutput":856},"src/react/components/close-edit-mode-pill.tsx":{"bytesInOutput":642},"src/react/components/icons/xmark.tsx":{"bytesInOutput":429},"src/react/hooks/useScrollPosition.tsx":{"bytesInOutput":951}},"bytes":35711}}}
1
+ {"inputs":{"src/utils/errors.ts":{"bytes":1985,"imports":[],"format":"esm"},"src/react/contexts/segment-context.tsx":{"bytes":1576,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../../types","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/variant-context.tsx":{"bytes":1109,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/edit-mode-context.tsx":{"bytes":1113,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/index.ts":{"bytes":267,"imports":[{"path":"src/react/contexts/segment-context.tsx","kind":"import-statement","original":"./segment-context"},{"path":"src/react/contexts/variant-context.tsx","kind":"import-statement","original":"./variant-context"},{"path":"src/react/contexts/edit-mode-context.tsx","kind":"import-statement","original":"./edit-mode-context"}],"format":"esm"},"src/react/components/error-boundary.tsx":{"bytes":1342,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/utils/debug.ts":{"bytes":2587,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/prepr-previewbar-provider.tsx":{"bytes":2424,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../types","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"./contexts"},{"path":"src/react/components/error-boundary.tsx","kind":"import-statement","original":"./components/error-boundary"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../utils/debug"}],"format":"esm"},"src/utils/dom.ts":{"bytes":4121,"imports":[{"path":"src/utils/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"src/utils/performance.ts":{"bytes":1143,"imports":[],"format":"esm"},"src/react/hooks/use-stega-overlay.tsx":{"bytes":5294,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/dom.ts","kind":"import-statement","original":"../../utils/dom"},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"@vercel/stega","kind":"import-statement","external":true}],"format":"esm"},"src/react/hooks/use-stega-proximity.tsx":{"bytes":3242,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"../../utils/performance"}],"format":"esm"},"src/react/hooks/use-stega-elements.tsx":{"bytes":4787,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"}],"format":"esm"},"src/react/hooks/use-stega-scan.tsx":{"bytes":3960,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/dom.ts","kind":"import-statement","original":"../../utils/dom"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"../../utils/performance"},{"path":"src/react/hooks/use-stega-overlay.tsx","kind":"import-statement","original":"./use-stega-overlay"},{"path":"src/react/hooks/use-stega-proximity.tsx","kind":"import-statement","original":"./use-stega-proximity"},{"path":"src/react/hooks/use-stega-elements.tsx","kind":"import-statement","original":"./use-stega-elements"}],"format":"esm"},"src/utils/index.ts":{"bytes":750,"imports":[{"path":"clsx","kind":"import-statement","external":true},{"path":"tailwind-merge","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"./errors"},{"path":"src/utils/dom.ts","kind":"import-statement","original":"./dom"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"./debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"./performance"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/hooks/use-modal.ts":{"bytes":1586,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/logo.tsx":{"bytes":4307,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/icons/sort-down.tsx":{"bytes":649,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/segment-dropdown.tsx":{"bytes":3041,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../../types","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"src/react/components/icons/sort-down.tsx","kind":"import-statement","original":"./icons/sort-down"},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"}],"format":"esm"},"src/react/components/radio-selector.tsx":{"bytes":1431,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"}],"format":"esm"},"src/react/components/variant-selector.tsx":{"bytes":1052,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"src/react/components/radio-selector.tsx","kind":"import-statement","original":"./radio-selector"}],"format":"esm"},"src/react/components/edit-mode-selector.tsx":{"bytes":577,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"src/react/components/radio-selector.tsx","kind":"import-statement","original":"./radio-selector"}],"format":"esm"},"src/react/components/icons/rotate.tsx":{"bytes":1662,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/reset-button.tsx":{"bytes":1747,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"},{"path":"src/react/components/icons/rotate.tsx","kind":"import-statement","original":"./icons/rotate"}],"format":"esm"},"src/react/components/preview-bar/preview-bar-content.tsx":{"bytes":3072,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/logo.tsx","kind":"import-statement","original":"../logo"},{"path":"src/react/components/segment-dropdown.tsx","kind":"import-statement","original":"../segment-dropdown"},{"path":"src/react/components/variant-selector.tsx","kind":"import-statement","original":"../variant-selector"},{"path":"src/react/components/edit-mode-selector.tsx","kind":"import-statement","original":"../edit-mode-selector"},{"path":"src/react/components/reset-button.tsx","kind":"import-statement","original":"../reset-button"}],"format":"esm"},"src/react/components/icon.tsx":{"bytes":815,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/preview-bar/preview-bar-button.tsx":{"bytes":537,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../../utils"},{"path":"src/react/components/icon.tsx","kind":"import-statement","original":"../icon"}],"format":"esm"},"src/react/components/preview-bar/preview-bar.tsx":{"bytes":3194,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../../utils"},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../../contexts"},{"path":"src/react/hooks/use-modal.ts","kind":"import-statement","original":"../../hooks/use-modal"},{"path":"src/react/components/preview-bar/preview-bar-content.tsx","kind":"import-statement","original":"./preview-bar-content"},{"path":"src/react/components/preview-bar/preview-bar-button.tsx","kind":"import-statement","original":"./preview-bar-button"}],"format":"esm"},"src/react/components/preview-bar/index.ts":{"bytes":171,"imports":[{"path":"src/react/components/preview-bar/preview-bar.tsx","kind":"import-statement","original":"./preview-bar"},{"path":"src/react/components/preview-bar/preview-bar-content.tsx","kind":"import-statement","original":"./preview-bar-content"},{"path":"src/react/components/preview-bar/preview-bar-button.tsx","kind":"import-statement","original":"./preview-bar-button"}],"format":"esm"},"src/react/components/preview-bar-wrapper.tsx":{"bytes":1446,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/preview-bar/index.ts","kind":"import-statement","original":"./preview-bar"},{"path":"next/navigation","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/status-indicator-pill.tsx":{"bytes":1396,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"}],"format":"esm"},"src/react/components/icons/xmark.tsx":{"bytes":530,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/close-edit-mode-pill.tsx":{"bytes":868,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"},{"path":"src/react/components/icons/xmark.tsx","kind":"import-statement","original":"./icons/xmark"}],"format":"esm"},"src/react/components/preview-bar-indicator-wrapper.tsx":{"bytes":361,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/status-indicator-pill.tsx","kind":"import-statement","original":"./status-indicator-pill"},{"path":"src/react/components/close-edit-mode-pill.tsx","kind":"import-statement","original":"./close-edit-mode-pill"}],"format":"esm"},"src/react/components/prepr-preview-bar.tsx":{"bytes":489,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"src/react/hooks/use-stega-scan.tsx","kind":"import-statement","original":"../hooks/use-stega-scan"},{"path":"src/react/components/preview-bar-wrapper.tsx","kind":"import-statement","original":"./preview-bar-wrapper"},{"path":"src/react/components/preview-bar-indicator-wrapper.tsx","kind":"import-statement","original":"./preview-bar-indicator-wrapper"}],"format":"esm"},"src/react/index.tsx":{"bytes":189,"imports":[{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"./prepr-previewbar-provider"},{"path":"src/react/components/prepr-preview-bar.tsx","kind":"import-statement","original":"./components/prepr-preview-bar"}],"format":"esm"}},"outputs":{"dist/react/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":99775},"dist/react/index.cjs":{"imports":[{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"@vercel/stega","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react-dom","kind":"require-call","external":true},{"path":"clsx","kind":"require-call","external":true},{"path":"tailwind-merge","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"next/navigation","kind":"require-call","external":true},{"path":"@headlessui/react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"next/navigation","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"@headlessui/react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"next/navigation","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"next/navigation","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/react/index.tsx","inputs":{"src/react/index.tsx":{"bytesInOutput":120},"src/react/prepr-previewbar-provider.tsx":{"bytesInOutput":949},"src/react/contexts/segment-context.tsx":{"bytesInOutput":474},"src/utils/errors.ts":{"bytesInOutput":655},"src/react/contexts/index.ts":{"bytesInOutput":0},"src/react/contexts/variant-context.tsx":{"bytesInOutput":339},"src/react/contexts/edit-mode-context.tsx":{"bytesInOutput":372},"src/react/components/error-boundary.tsx":{"bytesInOutput":747},"src/utils/debug.ts":{"bytesInOutput":599},"src/react/components/prepr-preview-bar.tsx":{"bytesInOutput":190},"src/react/hooks/use-stega-scan.tsx":{"bytesInOutput":1518},"src/utils/dom.ts":{"bytesInOutput":1397},"src/utils/performance.ts":{"bytesInOutput":278},"src/react/hooks/use-stega-overlay.tsx":{"bytesInOutput":2375},"src/react/hooks/use-stega-proximity.tsx":{"bytesInOutput":1038},"src/react/hooks/use-stega-elements.tsx":{"bytesInOutput":2328},"src/react/components/preview-bar-wrapper.tsx":{"bytesInOutput":671},"src/react/components/preview-bar/preview-bar.tsx":{"bytesInOutput":1335},"src/utils/index.ts":{"bytesInOutput":106},"src/react/hooks/use-modal.ts":{"bytesInOutput":673},"src/react/components/preview-bar/preview-bar-content.tsx":{"bytesInOutput":2568},"src/react/components/logo.tsx":{"bytesInOutput":4173},"src/react/components/segment-dropdown.tsx":{"bytesInOutput":1848},"src/react/components/icons/sort-down.tsx":{"bytesInOutput":545},"src/react/components/variant-selector.tsx":{"bytesInOutput":538},"src/react/components/radio-selector.tsx":{"bytesInOutput":785},"src/react/components/edit-mode-selector.tsx":{"bytesInOutput":237},"src/react/components/reset-button.tsx":{"bytesInOutput":971},"src/react/components/icons/rotate.tsx":{"bytesInOutput":1607},"src/react/components/preview-bar/preview-bar-button.tsx":{"bytesInOutput":295},"src/react/components/icon.tsx":{"bytesInOutput":696},"src/react/components/preview-bar/index.ts":{"bytesInOutput":0},"src/react/components/preview-bar-indicator-wrapper.tsx":{"bytesInOutput":218},"src/react/components/status-indicator-pill.tsx":{"bytesInOutput":856},"src/react/components/close-edit-mode-pill.tsx":{"bytesInOutput":637},"src/react/components/icons/xmark.tsx":{"bytesInOutput":429}},"bytes":33618}}}
@@ -1 +1 @@
1
- {"inputs":{"src/utils/errors.ts":{"bytes":1985,"imports":[],"format":"esm"},"src/react/contexts/segment-context.tsx":{"bytes":1576,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../../types","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/variant-context.tsx":{"bytes":1109,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/edit-mode-context.tsx":{"bytes":1113,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/index.ts":{"bytes":267,"imports":[{"path":"src/react/contexts/segment-context.tsx","kind":"import-statement","original":"./segment-context"},{"path":"src/react/contexts/variant-context.tsx","kind":"import-statement","original":"./variant-context"},{"path":"src/react/contexts/edit-mode-context.tsx","kind":"import-statement","original":"./edit-mode-context"}],"format":"esm"},"src/react/components/error-boundary.tsx":{"bytes":1342,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/utils/debug.ts":{"bytes":2587,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/prepr-previewbar-provider.tsx":{"bytes":2424,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../types","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"./contexts"},{"path":"src/react/components/error-boundary.tsx","kind":"import-statement","original":"./components/error-boundary"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../utils/debug"}],"format":"esm"},"src/utils/dom.ts":{"bytes":4121,"imports":[{"path":"src/utils/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"src/utils/performance.ts":{"bytes":1143,"imports":[],"format":"esm"},"src/react/hooks/useStegaOverlay.tsx":{"bytes":5294,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/dom.ts","kind":"import-statement","original":"../../utils/dom"},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"@vercel/stega","kind":"import-statement","external":true}],"format":"esm"},"src/react/hooks/useStegaProximity.tsx":{"bytes":3242,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"../../utils/performance"}],"format":"esm"},"src/react/hooks/useStegaElements.tsx":{"bytes":4787,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"}],"format":"esm"},"src/react/hooks/useStegaScan.tsx":{"bytes":3954,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/dom.ts","kind":"import-statement","original":"../../utils/dom"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"../../utils/performance"},{"path":"src/react/hooks/useStegaOverlay.tsx","kind":"import-statement","original":"./useStegaOverlay"},{"path":"src/react/hooks/useStegaProximity.tsx","kind":"import-statement","original":"./useStegaProximity"},{"path":"src/react/hooks/useStegaElements.tsx","kind":"import-statement","original":"./useStegaElements"}],"format":"esm"},"src/utils/index.ts":{"bytes":750,"imports":[{"path":"clsx","kind":"import-statement","external":true},{"path":"tailwind-merge","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"./errors"},{"path":"src/utils/dom.ts","kind":"import-statement","original":"./dom"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"./debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"./performance"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/hooks/useModal.ts":{"bytes":1586,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/logo.tsx":{"bytes":4307,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/icons/sort-down.tsx":{"bytes":649,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/segment-dropdown.tsx":{"bytes":3041,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../../types","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"src/react/components/icons/sort-down.tsx","kind":"import-statement","original":"./icons/sort-down"},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"}],"format":"esm"},"src/react/components/radio-selector.tsx":{"bytes":1431,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"}],"format":"esm"},"src/react/components/variant-selector.tsx":{"bytes":1052,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"src/react/components/radio-selector.tsx","kind":"import-statement","original":"./radio-selector"}],"format":"esm"},"src/react/components/edit-mode-selector.tsx":{"bytes":577,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"src/react/components/radio-selector.tsx","kind":"import-statement","original":"./radio-selector"}],"format":"esm"},"src/react/components/icons/rotate.tsx":{"bytes":1662,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/reset-button.tsx":{"bytes":1747,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"},{"path":"src/react/components/icons/rotate.tsx","kind":"import-statement","original":"./icons/rotate"}],"format":"esm"},"src/react/components/preview-bar/preview-bar-content.tsx":{"bytes":3072,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/logo.tsx","kind":"import-statement","original":"../logo"},{"path":"src/react/components/segment-dropdown.tsx","kind":"import-statement","original":"../segment-dropdown"},{"path":"src/react/components/variant-selector.tsx","kind":"import-statement","original":"../variant-selector"},{"path":"src/react/components/edit-mode-selector.tsx","kind":"import-statement","original":"../edit-mode-selector"},{"path":"src/react/components/reset-button.tsx","kind":"import-statement","original":"../reset-button"}],"format":"esm"},"src/react/components/icon.tsx":{"bytes":815,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/preview-bar/preview-bar-button.tsx":{"bytes":537,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../../utils"},{"path":"src/react/components/icon.tsx","kind":"import-statement","original":"../icon"}],"format":"esm"},"src/react/components/preview-bar/preview-bar.tsx":{"bytes":3193,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../../utils"},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../../contexts"},{"path":"src/react/hooks/useModal.ts","kind":"import-statement","original":"../../hooks/useModal"},{"path":"src/react/components/preview-bar/preview-bar-content.tsx","kind":"import-statement","original":"./preview-bar-content"},{"path":"src/react/components/preview-bar/preview-bar-button.tsx","kind":"import-statement","original":"./preview-bar-button"}],"format":"esm"},"src/react/components/preview-bar/index.ts":{"bytes":171,"imports":[{"path":"src/react/components/preview-bar/preview-bar.tsx","kind":"import-statement","original":"./preview-bar"},{"path":"src/react/components/preview-bar/preview-bar-content.tsx","kind":"import-statement","original":"./preview-bar-content"},{"path":"src/react/components/preview-bar/preview-bar-button.tsx","kind":"import-statement","original":"./preview-bar-button"}],"format":"esm"},"src/react/components/preview-bar-wrapper.tsx":{"bytes":1446,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/preview-bar/index.ts","kind":"import-statement","original":"./preview-bar"},{"path":"next/navigation","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/status-indicator-pill.tsx":{"bytes":1396,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"}],"format":"esm"},"src/react/components/icons/xmark.tsx":{"bytes":530,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/close-edit-mode-pill.tsx":{"bytes":868,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"},{"path":"src/react/components/icons/xmark.tsx","kind":"import-statement","original":"./icons/xmark"}],"format":"esm"},"src/react/components/preview-bar-indicator-wrapper.tsx":{"bytes":361,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/status-indicator-pill.tsx","kind":"import-statement","original":"./status-indicator-pill"},{"path":"src/react/components/close-edit-mode-pill.tsx","kind":"import-statement","original":"./close-edit-mode-pill"}],"format":"esm"},"src/react/components/prepr-preview-bar.tsx":{"bytes":487,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"src/react/hooks/useStegaScan.tsx","kind":"import-statement","original":"../hooks/useStegaScan"},{"path":"src/react/components/preview-bar-wrapper.tsx","kind":"import-statement","original":"./preview-bar-wrapper"},{"path":"src/react/components/preview-bar-indicator-wrapper.tsx","kind":"import-statement","original":"./preview-bar-indicator-wrapper"}],"format":"esm"},"src/react/hooks/useScrollPosition.tsx":{"bytes":1767,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"}],"format":"esm"},"src/react/index.tsx":{"bytes":1450,"imports":[{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"./prepr-previewbar-provider"},{"path":"src/react/components/prepr-preview-bar.tsx","kind":"import-statement","original":"./components/prepr-preview-bar"},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"./contexts"},{"path":"src/react/hooks/useStegaScan.tsx","kind":"import-statement","original":"./hooks/useStegaScan"},{"path":"src/react/hooks/useStegaOverlay.tsx","kind":"import-statement","original":"./hooks/useStegaOverlay"},{"path":"src/react/hooks/useStegaProximity.tsx","kind":"import-statement","original":"./hooks/useStegaProximity"},{"path":"src/react/hooks/useStegaElements.tsx","kind":"import-statement","original":"./hooks/useStegaElements"},{"path":"src/react/hooks/useModal.ts","kind":"import-statement","original":"./hooks/useModal"},{"path":"src/react/hooks/useScrollPosition.tsx","kind":"import-statement","original":"./hooks/useScrollPosition"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../utils/debug"},{"path":"src/react/components/error-boundary.tsx","kind":"import-statement","original":"./components/error-boundary"},{"path":"src/react/components/preview-bar/preview-bar.tsx","kind":"import-statement","original":"./components/preview-bar/preview-bar"},{"path":"src/react/components/preview-bar-wrapper.tsx","kind":"import-statement","original":"./components/preview-bar-wrapper"},{"path":"src/react/components/preview-bar-indicator-wrapper.tsx","kind":"import-statement","original":"./components/preview-bar-indicator-wrapper"},{"path":"src/react/components/segment-dropdown.tsx","kind":"import-statement","original":"./components/segment-dropdown"},{"path":"src/react/components/variant-selector.tsx","kind":"import-statement","original":"./components/variant-selector"},{"path":"src/react/components/edit-mode-selector.tsx","kind":"import-statement","original":"./components/edit-mode-selector"},{"path":"src/react/components/reset-button.tsx","kind":"import-statement","original":"./components/reset-button"},{"path":"src/react/components/logo.tsx","kind":"import-statement","original":"./components/logo"}],"format":"esm"}},"outputs":{"dist/react/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":103438},"dist/react/index.js":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@vercel/stega","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"clsx","kind":"import-statement","external":true},{"path":"tailwind-merge","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["EditModeProvider","EditModeSelector","Logo","PreprPreviewBar","PreprPreviewBarProvider","PreviewBar","PreviewBarIndicatorWrapper","PreviewBarWrapper","ResetButton","SegmentDropdown","SegmentProvider","StegaErrorBoundary","VariantProvider","VariantSelector","createScopedLogger","debugError","debugLog","debugWarn","useEditModeContext","useModal","usePreprPreviewBar","useScrollPosition","useSegmentContext","useStegaElements","useStegaOverlay","useStegaProximity","useStegaScan","useVariantContext"],"entryPoint":"src/react/index.tsx","inputs":{"src/react/prepr-previewbar-provider.tsx":{"bytesInOutput":914},"src/react/contexts/segment-context.tsx":{"bytesInOutput":471},"src/utils/errors.ts":{"bytesInOutput":655},"src/react/contexts/index.ts":{"bytesInOutput":0},"src/react/contexts/variant-context.tsx":{"bytesInOutput":336},"src/react/contexts/edit-mode-context.tsx":{"bytesInOutput":360},"src/react/components/error-boundary.tsx":{"bytesInOutput":731},"src/utils/debug.ts":{"bytesInOutput":699},"src/react/index.tsx":{"bytesInOutput":0},"src/react/components/prepr-preview-bar.tsx":{"bytesInOutput":155},"src/react/hooks/useStegaScan.tsx":{"bytesInOutput":1504},"src/utils/dom.ts":{"bytesInOutput":1397},"src/utils/performance.ts":{"bytesInOutput":278},"src/react/hooks/useStegaOverlay.tsx":{"bytesInOutput":2267},"src/react/hooks/useStegaProximity.tsx":{"bytesInOutput":1021},"src/react/hooks/useStegaElements.tsx":{"bytesInOutput":2254},"src/react/components/preview-bar-wrapper.tsx":{"bytesInOutput":663},"src/react/components/preview-bar/preview-bar.tsx":{"bytesInOutput":1214},"src/utils/index.ts":{"bytesInOutput":188},"src/react/hooks/useModal.ts":{"bytesInOutput":653},"src/react/components/preview-bar/preview-bar-content.tsx":{"bytesInOutput":2382},"src/react/components/logo.tsx":{"bytesInOutput":4117},"src/react/components/segment-dropdown.tsx":{"bytesInOutput":1803},"src/react/components/icons/sort-down.tsx":{"bytesInOutput":522},"src/react/components/variant-selector.tsx":{"bytesInOutput":521},"src/react/components/radio-selector.tsx":{"bytesInOutput":773},"src/react/components/edit-mode-selector.tsx":{"bytesInOutput":221},"src/react/components/reset-button.tsx":{"bytesInOutput":943},"src/react/components/icons/rotate.tsx":{"bytesInOutput":1584},"src/react/components/preview-bar/preview-bar-button.tsx":{"bytesInOutput":272},"src/react/components/icon.tsx":{"bytesInOutput":673},"src/react/components/preview-bar/index.ts":{"bytesInOutput":0},"src/react/components/preview-bar-indicator-wrapper.tsx":{"bytesInOutput":187},"src/react/components/status-indicator-pill.tsx":{"bytesInOutput":809},"src/react/components/close-edit-mode-pill.tsx":{"bytesInOutput":603},"src/react/components/icons/xmark.tsx":{"bytesInOutput":406},"src/react/hooks/useScrollPosition.tsx":{"bytesInOutput":945}},"bytes":33603}}}
1
+ {"inputs":{"src/utils/errors.ts":{"bytes":1985,"imports":[],"format":"esm"},"src/react/contexts/segment-context.tsx":{"bytes":1576,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../../types","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/variant-context.tsx":{"bytes":1109,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/edit-mode-context.tsx":{"bytes":1113,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"}],"format":"esm"},"src/react/contexts/index.ts":{"bytes":267,"imports":[{"path":"src/react/contexts/segment-context.tsx","kind":"import-statement","original":"./segment-context"},{"path":"src/react/contexts/variant-context.tsx","kind":"import-statement","original":"./variant-context"},{"path":"src/react/contexts/edit-mode-context.tsx","kind":"import-statement","original":"./edit-mode-context"}],"format":"esm"},"src/react/components/error-boundary.tsx":{"bytes":1342,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/utils/debug.ts":{"bytes":2587,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/prepr-previewbar-provider.tsx":{"bytes":2424,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../types","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"./contexts"},{"path":"src/react/components/error-boundary.tsx","kind":"import-statement","original":"./components/error-boundary"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../utils/debug"}],"format":"esm"},"src/utils/dom.ts":{"bytes":4121,"imports":[{"path":"src/utils/errors.ts","kind":"import-statement","original":"./errors"}],"format":"esm"},"src/utils/performance.ts":{"bytes":1143,"imports":[],"format":"esm"},"src/react/hooks/use-stega-overlay.tsx":{"bytes":5294,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/dom.ts","kind":"import-statement","original":"../../utils/dom"},{"path":"src/utils/errors.ts","kind":"import-statement","original":"../../utils/errors"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"@vercel/stega","kind":"import-statement","external":true}],"format":"esm"},"src/react/hooks/use-stega-proximity.tsx":{"bytes":3242,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"../../utils/performance"}],"format":"esm"},"src/react/hooks/use-stega-elements.tsx":{"bytes":4787,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"}],"format":"esm"},"src/react/hooks/use-stega-scan.tsx":{"bytes":3960,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/dom.ts","kind":"import-statement","original":"../../utils/dom"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"../../utils/debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"../../utils/performance"},{"path":"src/react/hooks/use-stega-overlay.tsx","kind":"import-statement","original":"./use-stega-overlay"},{"path":"src/react/hooks/use-stega-proximity.tsx","kind":"import-statement","original":"./use-stega-proximity"},{"path":"src/react/hooks/use-stega-elements.tsx","kind":"import-statement","original":"./use-stega-elements"}],"format":"esm"},"src/utils/index.ts":{"bytes":750,"imports":[{"path":"clsx","kind":"import-statement","external":true},{"path":"tailwind-merge","kind":"import-statement","external":true},{"path":"src/utils/errors.ts","kind":"import-statement","original":"./errors"},{"path":"src/utils/dom.ts","kind":"import-statement","original":"./dom"},{"path":"src/utils/debug.ts","kind":"import-statement","original":"./debug"},{"path":"src/utils/performance.ts","kind":"import-statement","original":"./performance"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/hooks/use-modal.ts":{"bytes":1586,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/logo.tsx":{"bytes":4307,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/icons/sort-down.tsx":{"bytes":649,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/segment-dropdown.tsx":{"bytes":3041,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"../../types","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"src/react/components/icons/sort-down.tsx","kind":"import-statement","original":"./icons/sort-down"},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"}],"format":"esm"},"src/react/components/radio-selector.tsx":{"bytes":1431,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"}],"format":"esm"},"src/react/components/variant-selector.tsx":{"bytes":1052,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"src/react/components/radio-selector.tsx","kind":"import-statement","original":"./radio-selector"}],"format":"esm"},"src/react/components/edit-mode-selector.tsx":{"bytes":577,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"src/react/components/radio-selector.tsx","kind":"import-statement","original":"./radio-selector"}],"format":"esm"},"src/react/components/icons/rotate.tsx":{"bytes":1662,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/reset-button.tsx":{"bytes":1747,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../utils"},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"},{"path":"src/react/components/icons/rotate.tsx","kind":"import-statement","original":"./icons/rotate"}],"format":"esm"},"src/react/components/preview-bar/preview-bar-content.tsx":{"bytes":3072,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/logo.tsx","kind":"import-statement","original":"../logo"},{"path":"src/react/components/segment-dropdown.tsx","kind":"import-statement","original":"../segment-dropdown"},{"path":"src/react/components/variant-selector.tsx","kind":"import-statement","original":"../variant-selector"},{"path":"src/react/components/edit-mode-selector.tsx","kind":"import-statement","original":"../edit-mode-selector"},{"path":"src/react/components/reset-button.tsx","kind":"import-statement","original":"../reset-button"}],"format":"esm"},"src/react/components/icon.tsx":{"bytes":815,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/preview-bar/preview-bar-button.tsx":{"bytes":537,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../../utils"},{"path":"src/react/components/icon.tsx","kind":"import-statement","original":"../icon"}],"format":"esm"},"src/react/components/preview-bar/preview-bar.tsx":{"bytes":3194,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"src/utils/index.ts","kind":"import-statement","original":"../../../utils"},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../../contexts"},{"path":"src/react/hooks/use-modal.ts","kind":"import-statement","original":"../../hooks/use-modal"},{"path":"src/react/components/preview-bar/preview-bar-content.tsx","kind":"import-statement","original":"./preview-bar-content"},{"path":"src/react/components/preview-bar/preview-bar-button.tsx","kind":"import-statement","original":"./preview-bar-button"}],"format":"esm"},"src/react/components/preview-bar/index.ts":{"bytes":171,"imports":[{"path":"src/react/components/preview-bar/preview-bar.tsx","kind":"import-statement","original":"./preview-bar"},{"path":"src/react/components/preview-bar/preview-bar-content.tsx","kind":"import-statement","original":"./preview-bar-content"},{"path":"src/react/components/preview-bar/preview-bar-button.tsx","kind":"import-statement","original":"./preview-bar-button"}],"format":"esm"},"src/react/components/preview-bar-wrapper.tsx":{"bytes":1446,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/preview-bar/index.ts","kind":"import-statement","original":"./preview-bar"},{"path":"next/navigation","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/status-indicator-pill.tsx":{"bytes":1396,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"}],"format":"esm"},"src/react/components/icons/xmark.tsx":{"bytes":530,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/react/components/close-edit-mode-pill.tsx":{"bytes":868,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"../prepr-previewbar-provider"},{"path":"src/react/components/icons/xmark.tsx","kind":"import-statement","original":"./icons/xmark"}],"format":"esm"},"src/react/components/preview-bar-indicator-wrapper.tsx":{"bytes":361,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/components/status-indicator-pill.tsx","kind":"import-statement","original":"./status-indicator-pill"},{"path":"src/react/components/close-edit-mode-pill.tsx","kind":"import-statement","original":"./close-edit-mode-pill"}],"format":"esm"},"src/react/components/prepr-preview-bar.tsx":{"bytes":489,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/react/contexts/index.ts","kind":"import-statement","original":"../contexts"},{"path":"src/react/hooks/use-stega-scan.tsx","kind":"import-statement","original":"../hooks/use-stega-scan"},{"path":"src/react/components/preview-bar-wrapper.tsx","kind":"import-statement","original":"./preview-bar-wrapper"},{"path":"src/react/components/preview-bar-indicator-wrapper.tsx","kind":"import-statement","original":"./preview-bar-indicator-wrapper"}],"format":"esm"},"src/react/index.tsx":{"bytes":189,"imports":[{"path":"src/react/prepr-previewbar-provider.tsx","kind":"import-statement","original":"./prepr-previewbar-provider"},{"path":"src/react/components/prepr-preview-bar.tsx","kind":"import-statement","original":"./components/prepr-preview-bar"}],"format":"esm"}},"outputs":{"dist/react/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":100109},"dist/react/index.js":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@vercel/stega","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-dom","kind":"import-statement","external":true},{"path":"clsx","kind":"import-statement","external":true},{"path":"tailwind-merge","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@headlessui/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"next/navigation","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["PreprPreviewBar","PreprPreviewBarProvider","usePreprPreviewBar"],"entryPoint":"src/react/index.tsx","inputs":{"src/react/prepr-previewbar-provider.tsx":{"bytesInOutput":914},"src/react/contexts/segment-context.tsx":{"bytesInOutput":471},"src/utils/errors.ts":{"bytesInOutput":647},"src/react/contexts/index.ts":{"bytesInOutput":0},"src/react/contexts/variant-context.tsx":{"bytesInOutput":336},"src/react/contexts/edit-mode-context.tsx":{"bytesInOutput":360},"src/react/components/error-boundary.tsx":{"bytesInOutput":731},"src/utils/debug.ts":{"bytesInOutput":590},"src/react/index.tsx":{"bytesInOutput":0},"src/react/components/prepr-preview-bar.tsx":{"bytesInOutput":151},"src/react/hooks/use-stega-scan.tsx":{"bytesInOutput":1505},"src/utils/dom.ts":{"bytesInOutput":1397},"src/utils/performance.ts":{"bytesInOutput":278},"src/react/hooks/use-stega-overlay.tsx":{"bytesInOutput":2267},"src/react/hooks/use-stega-proximity.tsx":{"bytesInOutput":1021},"src/react/hooks/use-stega-elements.tsx":{"bytesInOutput":2254},"src/react/components/preview-bar-wrapper.tsx":{"bytesInOutput":663},"src/react/components/preview-bar/preview-bar.tsx":{"bytesInOutput":1210},"src/utils/index.ts":{"bytesInOutput":105},"src/react/hooks/use-modal.ts":{"bytesInOutput":653},"src/react/components/preview-bar/preview-bar-content.tsx":{"bytesInOutput":2384},"src/react/components/logo.tsx":{"bytesInOutput":4117},"src/react/components/segment-dropdown.tsx":{"bytesInOutput":1804},"src/react/components/icons/sort-down.tsx":{"bytesInOutput":522},"src/react/components/variant-selector.tsx":{"bytesInOutput":522},"src/react/components/radio-selector.tsx":{"bytesInOutput":773},"src/react/components/edit-mode-selector.tsx":{"bytesInOutput":222},"src/react/components/reset-button.tsx":{"bytesInOutput":943},"src/react/components/icons/rotate.tsx":{"bytesInOutput":1584},"src/react/components/preview-bar/preview-bar-button.tsx":{"bytesInOutput":271},"src/react/components/icon.tsx":{"bytesInOutput":673},"src/react/components/preview-bar/index.ts":{"bytesInOutput":0},"src/react/components/preview-bar-indicator-wrapper.tsx":{"bytesInOutput":187},"src/react/components/status-indicator-pill.tsx":{"bytesInOutput":809},"src/react/components/close-edit-mode-pill.tsx":{"bytesInOutput":598},"src/react/components/icons/xmark.tsx":{"bytesInOutput":406}},"bytes":31925}}}
@@ -1,2 +1,2 @@
1
- 'use strict';var functions=require('@vercel/functions'),server=require('next/server');function f(r){var c,m,P,d;process.env.PREPR_GRAPHQL_URL||console.error("PREPR_GRAPHQL_URL is not set");let e=server.NextResponse.next();r.nextUrl.searchParams.forEach((t,o)=>{switch(o){case "utm_source":e.headers.set("Prepr-Context-utm_source",t);break;case "utm_medium":e.headers.set("Prepr-Context-utm_medium",t);break;case "utm_term":e.headers.set("Prepr-Context-utm_term",t);break;case "utm_content":e.headers.set("Prepr-Context-utm_content",t);break;case "utm_campaign":e.headers.set("Prepr-Context-utm_campaign",t);break}});let a=r.headers.get("referer");a&&e.headers.set("Prepr-Context-initial_referral",a);let p=functions.ipAddress(r);p&&e.headers.set("Prepr-Visitor-IP",p);let n=(c=r.cookies.get("hubspotutk"))==null?void 0:c.value;n&&e.headers.set("Prepr-Hubspot-Id",n);let s=(m=r.cookies.get("__prepr_uid"))==null?void 0:m.value;if(s||(s=crypto.randomUUID(),e.cookies.set("__prepr_uid",s,{maxAge:1*365*24*60}),e.headers.set("Prepr-Customer-Id-Created","true")),e.headers.set("Prepr-Customer-Id",s),process.env.PREPR_ENV==="preview"){e.headers.set("Prepr-Preview-Bar","true");let t=(P=r.cookies.get("Prepr-Segments"))==null?void 0:P.value;t&&e.headers.set("Prepr-Segments",t);let o=(d=r.cookies.get("Prepr-ABtesting"))==null?void 0:d.value;o&&e.headers.set("Prepr-ABtesting",o),r.nextUrl.searchParams.forEach((i,_)=>{_==="prepr_preview_ab"&&(e.headers.set("Prepr-ABtesting",i),e.cookies.set("Prepr-ABtesting",i)),_==="prepr_preview_segment"&&(e.headers.set("Prepr-Segments",i),e.cookies.set("Prepr-Segments",i));}),console.log(e.headers.getSetCookie());}return e}module.exports=f;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var functions=require('@vercel/functions'),server=require('next/server');function u(r){var c,m,P,d;process.env.PREPR_GRAPHQL_URL||console.error("PREPR_GRAPHQL_URL is not set");let e=server.NextResponse.next();r.nextUrl.searchParams.forEach((t,o)=>{switch(o){case "utm_source":e.headers.set("Prepr-Context-utm_source",t);break;case "utm_medium":e.headers.set("Prepr-Context-utm_medium",t);break;case "utm_term":e.headers.set("Prepr-Context-utm_term",t);break;case "utm_content":e.headers.set("Prepr-Context-utm_content",t);break;case "utm_campaign":e.headers.set("Prepr-Context-utm_campaign",t);break}});let a=r.headers.get("referer");a&&e.headers.set("Prepr-Context-initial_referral",a);let p=functions.ipAddress(r);p&&e.headers.set("Prepr-Visitor-IP",p);let n=(c=r.cookies.get("hubspotutk"))==null?void 0:c.value;n&&e.headers.set("Prepr-Hubspot-Id",n);let s=(m=r.cookies.get("__prepr_uid"))==null?void 0:m.value;if(s||(s=crypto.randomUUID(),e.cookies.set("__prepr_uid",s,{maxAge:1*365*24*60}),e.headers.set("Prepr-Customer-Id-Created","true")),e.headers.set("Prepr-Customer-Id",s),process.env.PREPR_ENV==="preview"){e.headers.set("Prepr-Preview-Bar","true");let t=(P=r.cookies.get("Prepr-Segments"))==null?void 0:P.value;t&&e.headers.set("Prepr-Segments",t);let o=(d=r.cookies.get("Prepr-ABtesting"))==null?void 0:d.value;o&&e.headers.set("Prepr-ABtesting",o),r.nextUrl.searchParams.forEach((i,_)=>{_==="prepr_preview_ab"&&(e.headers.set("Prepr-ABtesting",i),e.cookies.set("Prepr-ABtesting",i)),_==="prepr_preview_segment"&&(e.headers.set("Prepr-Segments",i),e.cookies.set("Prepr-Segments",i));});}return e}module.exports=u;//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/middleware/index.ts"],"names":["createPreprMiddleware","request","_a","_b","_c","_d","response","NextResponse","value","key","referrer","ip","ipAddress","hutkCookie","cookie","segmentCookie","abCookie"],"mappings":"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","file":"index.cjs","sourcesContent":["import { ipAddress } from '@vercel/functions';\nimport { NextRequest, NextResponse } from 'next/server';\n\n/**\n * Middleware to set Prepr headers for personalization.\n * @param request - NextRequest object.\n * @param preview - Boolean indicating if preview mode is enabled.\n */\nexport default function createPreprMiddleware(request: NextRequest) {\n if (!process.env.PREPR_GRAPHQL_URL) {\n console.error('PREPR_GRAPHQL_URL is not set');\n }\n\n const response = NextResponse.next();\n\n // Map over search params and set headers\n request.nextUrl.searchParams.forEach((value, key) => {\n switch (key) {\n case 'utm_source':\n response.headers.set('Prepr-Context-utm_source', value);\n break;\n case 'utm_medium':\n response.headers.set('Prepr-Context-utm_medium', value);\n break;\n case 'utm_term':\n response.headers.set('Prepr-Context-utm_term', value);\n break;\n case 'utm_content':\n response.headers.set('Prepr-Context-utm_content', value);\n break;\n case 'utm_campaign':\n response.headers.set('Prepr-Context-utm_campaign', value);\n break;\n }\n });\n\n // Set initial referral header\n const referrer = request.headers.get('referer');\n if (referrer) {\n response.headers.set('Prepr-Context-initial_referral', referrer);\n }\n\n // Set IP address header\n const ip = ipAddress(request);\n if (ip) {\n response.headers.set('Prepr-Visitor-IP', ip);\n }\n\n // Set HubSpot cookie header\n const hutkCookie = request.cookies.get('hubspotutk')?.value;\n if (hutkCookie) {\n response.headers.set('Prepr-Hubspot-Id', hutkCookie);\n }\n\n // Check for existing Prepr UID cookie or create a new one\n let cookie = request.cookies.get('__prepr_uid')?.value;\n if (!cookie) {\n cookie = crypto.randomUUID();\n response.cookies.set('__prepr_uid', cookie, {\n maxAge: 1 * 365 * 24 * 60, // Set for one year\n });\n response.headers.set('Prepr-Customer-Id-Created', 'true');\n }\n\n // Set the Prepr Customer ID header\n response.headers.set('Prepr-Customer-Id', cookie);\n\n // If preview mode is enabled, set additional headers\n if (process.env.PREPR_ENV === 'preview') {\n response.headers.set('Prepr-Preview-Bar', 'true');\n\n // Set Prepr Preview Segment and AB test cookies\n const segmentCookie = request.cookies.get('Prepr-Segments')?.value;\n if (segmentCookie) {\n response.headers.set('Prepr-Segments', segmentCookie);\n }\n\n const abCookie = request.cookies.get('Prepr-ABtesting')?.value;\n if (abCookie) {\n response.headers.set('Prepr-ABtesting', abCookie);\n }\n\n // Set Prepr Preview Segment and AB test headers from query params\n request.nextUrl.searchParams.forEach((value, key) => {\n if (key === 'prepr_preview_ab') {\n response.headers.set('Prepr-ABtesting', value);\n response.cookies.set('Prepr-ABtesting', value);\n }\n\n if (key === 'prepr_preview_segment') {\n response.headers.set('Prepr-Segments', value);\n response.cookies.set('Prepr-Segments', value);\n }\n });\n console.log(response.headers.getSetCookie());\n }\n\n return response;\n}\n"]}
1
+ {"version":3,"sources":["../../src/middleware/index.ts"],"names":["createPreprMiddleware","request","_a","_b","_c","_d","response","NextResponse","value","key","referrer","ip","ipAddress","hutkCookie","cookie","segmentCookie","abCookie"],"mappings":"sFAQe,SAARA,CAAAA,CAAuCC,CAAAA,CAAsB,CARpE,IAAAC,CAAAA,CAAAC,CAAAA,CAAAC,CAAAA,CAAAC,CAAAA,CASO,OAAA,CAAQ,GAAA,CAAI,iBAAA,EACf,OAAA,CAAQ,KAAA,CAAM,8BAA8B,CAAA,CAG9C,IAAMC,CAAAA,CAAWC,mBAAAA,CAAa,IAAA,EAAK,CAGnCN,EAAQ,OAAA,CAAQ,YAAA,CAAa,OAAA,CAAQ,CAACO,CAAAA,CAAOC,CAAAA,GAAQ,CACnD,OAAQA,CAAAA,EACN,KAAK,YAAA,CACHH,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,0BAAA,CAA4BE,CAAK,CAAA,CACtD,MACF,KAAK,YAAA,CACHF,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,0BAAA,CAA4BE,CAAK,CAAA,CACtD,MACF,KAAK,UAAA,CACHF,CAAAA,CAAS,OAAA,CAAQ,IAAI,wBAAA,CAA0BE,CAAK,CAAA,CACpD,MACF,KAAK,aAAA,CACHF,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,2BAAA,CAA6BE,CAAK,CAAA,CACvD,MACF,KAAK,cAAA,CACHF,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,4BAAA,CAA8BE,CAAK,CAAA,CACxD,KACJ,CACF,CAAC,CAAA,CAGD,IAAME,CAAAA,CAAWT,CAAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,SAAS,CAAA,CAC1CS,GACFJ,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,gCAAA,CAAkCI,CAAQ,CAAA,CAIjE,IAAMC,CAAAA,CAAKC,mBAAAA,CAAUX,CAAO,CAAA,CACxBU,CAAAA,EACFL,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,kBAAA,CAAoBK,CAAE,CAAA,CAI7C,IAAME,CAAAA,CAAAA,CAAaX,CAAAA,CAAAD,CAAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,YAAY,CAAA,GAAhC,IAAA,CAAA,MAAA,CAAAC,CAAAA,CAAmC,KAAA,CAClDW,CAAAA,EACFP,CAAAA,CAAS,OAAA,CAAQ,IAAI,kBAAA,CAAoBO,CAAU,CAAA,CAIrD,IAAIC,CAAAA,CAAAA,CAASX,CAAAA,CAAAF,CAAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,aAAa,CAAA,GAAjC,IAAA,CAAA,MAAA,CAAAE,CAAAA,CAAoC,KAAA,CAajD,GAZKW,CAAAA,GACHA,CAAAA,CAAS,MAAA,CAAO,UAAA,EAAW,CAC3BR,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,aAAA,CAAeQ,CAAAA,CAAQ,CAC1C,MAAA,CAAQ,CAAA,CAAI,GAAA,CAAM,EAAA,CAAK,EACzB,CAAC,EACDR,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,2BAAA,CAA6B,MAAM,CAAA,CAAA,CAI1DA,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,mBAAA,CAAqBQ,CAAM,CAAA,CAG5C,OAAA,CAAQ,GAAA,CAAI,SAAA,GAAc,SAAA,CAAW,CACvCR,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,mBAAA,CAAqB,MAAM,CAAA,CAGhD,IAAMS,CAAAA,CAAAA,CAAgBX,CAAAA,CAAAH,CAAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,gBAAgB,CAAA,GAApC,IAAA,CAAA,MAAA,CAAAG,EAAuC,KAAA,CACzDW,CAAAA,EACFT,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,gBAAA,CAAkBS,CAAa,CAAA,CAGtD,IAAMC,CAAAA,CAAAA,CAAWX,CAAAA,CAAAJ,CAAAA,CAAQ,OAAA,CAAQ,GAAA,CAAI,iBAAiB,CAAA,GAArC,IAAA,CAAA,MAAA,CAAAI,CAAAA,CAAwC,KAAA,CACrDW,CAAAA,EACFV,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,iBAAA,CAAmBU,CAAQ,CAAA,CAIlDf,CAAAA,CAAQ,OAAA,CAAQ,YAAA,CAAa,OAAA,CAAQ,CAACO,CAAAA,CAAOC,IAAQ,CAC/CA,CAAAA,GAAQ,kBAAA,GACVH,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,iBAAA,CAAmBE,CAAK,CAAA,CAC7CF,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,iBAAA,CAAmBE,CAAK,CAAA,CAAA,CAG3CC,CAAAA,GAAQ,uBAAA,GACVH,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,gBAAA,CAAkBE,CAAK,CAAA,CAC5CF,CAAAA,CAAS,OAAA,CAAQ,GAAA,CAAI,gBAAA,CAAkBE,CAAK,CAAA,EAEhD,CAAC,EACH,CAEA,OAAOF,CACT","file":"index.cjs","sourcesContent":["import { ipAddress } from '@vercel/functions';\nimport { NextRequest, NextResponse } from 'next/server';\n\n/**\n * Middleware to set Prepr headers for personalization.\n * @param request - NextRequest object.\n * @param preview - Boolean indicating if preview mode is enabled.\n */\nexport default function createPreprMiddleware(request: NextRequest) {\n if (!process.env.PREPR_GRAPHQL_URL) {\n console.error('PREPR_GRAPHQL_URL is not set');\n }\n\n const response = NextResponse.next();\n\n // Map over search params and set headers\n request.nextUrl.searchParams.forEach((value, key) => {\n switch (key) {\n case 'utm_source':\n response.headers.set('Prepr-Context-utm_source', value);\n break;\n case 'utm_medium':\n response.headers.set('Prepr-Context-utm_medium', value);\n break;\n case 'utm_term':\n response.headers.set('Prepr-Context-utm_term', value);\n break;\n case 'utm_content':\n response.headers.set('Prepr-Context-utm_content', value);\n break;\n case 'utm_campaign':\n response.headers.set('Prepr-Context-utm_campaign', value);\n break;\n }\n });\n\n // Set initial referral header\n const referrer = request.headers.get('referer');\n if (referrer) {\n response.headers.set('Prepr-Context-initial_referral', referrer);\n }\n\n // Set IP address header\n const ip = ipAddress(request);\n if (ip) {\n response.headers.set('Prepr-Visitor-IP', ip);\n }\n\n // Set HubSpot cookie header\n const hutkCookie = request.cookies.get('hubspotutk')?.value;\n if (hutkCookie) {\n response.headers.set('Prepr-Hubspot-Id', hutkCookie);\n }\n\n // Check for existing Prepr UID cookie or create a new one\n let cookie = request.cookies.get('__prepr_uid')?.value;\n if (!cookie) {\n cookie = crypto.randomUUID();\n response.cookies.set('__prepr_uid', cookie, {\n maxAge: 1 * 365 * 24 * 60, // Set for one year\n });\n response.headers.set('Prepr-Customer-Id-Created', 'true');\n }\n\n // Set the Prepr Customer ID header\n response.headers.set('Prepr-Customer-Id', cookie);\n\n // If preview mode is enabled, set additional headers\n if (process.env.PREPR_ENV === 'preview') {\n response.headers.set('Prepr-Preview-Bar', 'true');\n\n // Set Prepr Preview Segment and AB test cookies\n const segmentCookie = request.cookies.get('Prepr-Segments')?.value;\n if (segmentCookie) {\n response.headers.set('Prepr-Segments', segmentCookie);\n }\n\n const abCookie = request.cookies.get('Prepr-ABtesting')?.value;\n if (abCookie) {\n response.headers.set('Prepr-ABtesting', abCookie);\n }\n\n // Set Prepr Preview Segment and AB test headers from query params\n request.nextUrl.searchParams.forEach((value, key) => {\n if (key === 'prepr_preview_ab') {\n response.headers.set('Prepr-ABtesting', value);\n response.cookies.set('Prepr-ABtesting', value);\n }\n\n if (key === 'prepr_preview_segment') {\n response.headers.set('Prepr-Segments', value);\n response.cookies.set('Prepr-Segments', value);\n }\n });\n }\n\n return response;\n}\n"]}
@@ -1,2 +1,2 @@
1
- import'../chunk-E7ATRJ2F.js';import {ipAddress}from'@vercel/functions';import {NextResponse}from'next/server';function f(r){var c,m,P,d;process.env.PREPR_GRAPHQL_URL||console.error("PREPR_GRAPHQL_URL is not set");let e=NextResponse.next();r.nextUrl.searchParams.forEach((t,o)=>{switch(o){case "utm_source":e.headers.set("Prepr-Context-utm_source",t);break;case "utm_medium":e.headers.set("Prepr-Context-utm_medium",t);break;case "utm_term":e.headers.set("Prepr-Context-utm_term",t);break;case "utm_content":e.headers.set("Prepr-Context-utm_content",t);break;case "utm_campaign":e.headers.set("Prepr-Context-utm_campaign",t);break}});let a=r.headers.get("referer");a&&e.headers.set("Prepr-Context-initial_referral",a);let p=ipAddress(r);p&&e.headers.set("Prepr-Visitor-IP",p);let n=(c=r.cookies.get("hubspotutk"))==null?void 0:c.value;n&&e.headers.set("Prepr-Hubspot-Id",n);let s=(m=r.cookies.get("__prepr_uid"))==null?void 0:m.value;if(s||(s=crypto.randomUUID(),e.cookies.set("__prepr_uid",s,{maxAge:1*365*24*60}),e.headers.set("Prepr-Customer-Id-Created","true")),e.headers.set("Prepr-Customer-Id",s),process.env.PREPR_ENV==="preview"){e.headers.set("Prepr-Preview-Bar","true");let t=(P=r.cookies.get("Prepr-Segments"))==null?void 0:P.value;t&&e.headers.set("Prepr-Segments",t);let o=(d=r.cookies.get("Prepr-ABtesting"))==null?void 0:d.value;o&&e.headers.set("Prepr-ABtesting",o),r.nextUrl.searchParams.forEach((i,_)=>{_==="prepr_preview_ab"&&(e.headers.set("Prepr-ABtesting",i),e.cookies.set("Prepr-ABtesting",i)),_==="prepr_preview_segment"&&(e.headers.set("Prepr-Segments",i),e.cookies.set("Prepr-Segments",i));}),console.log(e.headers.getSetCookie());}return e}export{f as default};//# sourceMappingURL=index.js.map
1
+ import'../chunk-E7ATRJ2F.js';import {ipAddress}from'@vercel/functions';import {NextResponse}from'next/server';function u(r){var c,m,P,d;process.env.PREPR_GRAPHQL_URL||console.error("PREPR_GRAPHQL_URL is not set");let e=NextResponse.next();r.nextUrl.searchParams.forEach((t,o)=>{switch(o){case "utm_source":e.headers.set("Prepr-Context-utm_source",t);break;case "utm_medium":e.headers.set("Prepr-Context-utm_medium",t);break;case "utm_term":e.headers.set("Prepr-Context-utm_term",t);break;case "utm_content":e.headers.set("Prepr-Context-utm_content",t);break;case "utm_campaign":e.headers.set("Prepr-Context-utm_campaign",t);break}});let a=r.headers.get("referer");a&&e.headers.set("Prepr-Context-initial_referral",a);let p=ipAddress(r);p&&e.headers.set("Prepr-Visitor-IP",p);let n=(c=r.cookies.get("hubspotutk"))==null?void 0:c.value;n&&e.headers.set("Prepr-Hubspot-Id",n);let s=(m=r.cookies.get("__prepr_uid"))==null?void 0:m.value;if(s||(s=crypto.randomUUID(),e.cookies.set("__prepr_uid",s,{maxAge:1*365*24*60}),e.headers.set("Prepr-Customer-Id-Created","true")),e.headers.set("Prepr-Customer-Id",s),process.env.PREPR_ENV==="preview"){e.headers.set("Prepr-Preview-Bar","true");let t=(P=r.cookies.get("Prepr-Segments"))==null?void 0:P.value;t&&e.headers.set("Prepr-Segments",t);let o=(d=r.cookies.get("Prepr-ABtesting"))==null?void 0:d.value;o&&e.headers.set("Prepr-ABtesting",o),r.nextUrl.searchParams.forEach((i,_)=>{_==="prepr_preview_ab"&&(e.headers.set("Prepr-ABtesting",i),e.cookies.set("Prepr-ABtesting",i)),_==="prepr_preview_segment"&&(e.headers.set("Prepr-Segments",i),e.cookies.set("Prepr-Segments",i));});}return e}export{u as default};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map