UNPKG

@preprio/prepr-nextjs

Version:

Next.js package for Prepr CMS preview functionality with advanced debugging and visual editing capabilities

1 lines 878 kB
{"version":3,"sources":["../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs","../../node_modules/.pnpm/next@15.3.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/src/shared/lib/head-manager-context.shared-runtime.ts","../../node_modules/.pnpm/next@15.3.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/src/client/set-attributes-from-props.ts","../../node_modules/.pnpm/next@15.3.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/src/client/request-idle-callback.ts","../../node_modules/.pnpm/next@15.3.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/src/client/script.tsx","../../node_modules/.pnpm/next@15.3.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next/script.js","../../node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js","../../node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js","../../node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.0/node_modules/use-sync-external-store/with-selector.js","../../src/react/components/toolbar/toolbar-provider.tsx","../../src/react/contexts/segment-context.tsx","../../src/utils/errors.ts","../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/class-group-utils.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/lru-cache.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/parse-class-name.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/sort-modifiers.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/config-utils.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/merge-classlist.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/tw-join.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/create-tailwind-merge.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/from-theme.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/validators.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/default-config.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/merge-configs.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/extend-tailwind-merge.ts","../../node_modules/.pnpm/tailwind-merge@3.3.1/node_modules/tailwind-merge/src/lib/tw-merge.ts","../../src/utils/dom.ts","../../src/utils/debug.ts","../../src/utils/performance.ts","../../src/utils/index.ts","../../src/react/contexts/variant-context.tsx","../../src/react/contexts/edit-mode-context.tsx","../../src/react/components/error-boundary.tsx","../../src/react/hooks/use-scroll-position.tsx","../../src/react/components/toolbar/prepr-toolbar.tsx","../../src/react/hooks/use-stega-scan.tsx","../../src/react/hooks/use-stega-overlay.tsx","../../node_modules/.pnpm/@vercel+stega@0.1.2/node_modules/@vercel/stega/dist/index.mjs","../../src/react/hooks/use-stega-proximity.tsx","../../src/react/hooks/use-stega-elements.tsx","../../src/react/components/toolbar/toolbar-wrapper.tsx","../../src/react/components/toolbar/toolbar.tsx","../../src/react/hooks/use-modal.ts","../../src/react/components/toolbar/toolbar-content.tsx","../../src/react/components/ui/status-indicator-pill.tsx","../../src/react/components/icons/xmark.tsx","../../src/react/components/ui/close-edit-mode-pill.tsx","../../src/react/components/ui/reset-button.tsx","../../src/react/components/icons/rotate.tsx","../../src/react/components/ui/icon.tsx","../../src/react/components/ui/logo.tsx","../../src/react/components/ui/prepr-tracking-pixel.tsx","../../src/react/components/selectors/segment-selector.tsx","../../node_modules/.pnpm/@react-aria+utils@3.29.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/utils/dist/packages/@react-aria/utils/src/useLayoutEffect.ts","../../node_modules/.pnpm/@react-aria+utils@3.29.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/utils/dist/packages/@react-aria/utils/src/useEffectEvent.ts","../../node_modules/.pnpm/@react-aria+utils@3.29.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/utils/dist/packages/@react-aria/utils/src/domHelpers.ts","../../node_modules/.pnpm/@react-stately+flags@3.1.2/node_modules/@react-stately/flags/dist/packages/@react-stately/flags/src/index.ts","../../node_modules/.pnpm/@react-aria+utils@3.29.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/utils/dist/packages/@react-aria/utils/src/shadowdom/DOMFunctions.ts","../../node_modules/.pnpm/@react-aria+utils@3.29.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/utils/dist/packages/@react-aria/utils/src/platform.ts","../../node_modules/.pnpm/@react-aria+utils@3.29.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/utils/dist/packages/@react-aria/utils/src/useGlobalListeners.ts","../../node_modules/.pnpm/@react-aria+utils@3.29.1_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/utils/dist/packages/@react-aria/utils/src/isVirtualEvent.ts","../../node_modules/.pnpm/@react-aria+interactions@3.25.3_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/interactions/dist/packages/@react-aria/interactions/src/utils.ts","../../node_modules/.pnpm/@react-aria+interactions@3.25.3_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/interactions/dist/packages/@react-aria/interactions/src/useFocusVisible.ts","../../node_modules/.pnpm/@react-aria+interactions@3.25.3_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/interactions/dist/packages/@react-aria/interactions/src/useFocus.ts","../../node_modules/.pnpm/@react-aria+interactions@3.25.3_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/interactions/dist/packages/@react-aria/interactions/src/useFocusWithin.ts","../../node_modules/.pnpm/@react-aria+interactions@3.25.3_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/interactions/dist/packages/@react-aria/interactions/src/useHover.ts","../../node_modules/.pnpm/@react-aria+focus@3.20.5_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@react-aria/focus/dist/packages/@react-aria/focus/src/useFocusRing.ts","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-active-press.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/env.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/owner.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-disposables.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/micro-task.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/disposables.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-event.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-latest-value.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/internal/disabled.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/render.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/class-names.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/match.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-controllable.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-default-value.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-id.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/internal/form-fields.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/form.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/internal/hidden.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/internal/id.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/dom.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/bugs.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/components/description/description.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/components/keyboard.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/components/label/label.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-by-comparator.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-element-size.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-is-top-layer.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/default-map.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/machine.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/machines/stack-machine.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/react-glue.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-inert-others.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-on-disappear.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-outside-click.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/focus-management.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/platform.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-document-event.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-window-event.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-owner.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-quick-release.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-store.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/store.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/document-overflow/adjust-scrollbar-padding.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/document-overflow/handle-ios-locking.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/document-overflow/prevent-scroll.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/document-overflow/overflow-store.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/document-overflow/use-document-overflow.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-scroll-lock.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-tracked-pointer.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-transition.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-flags.js","../../node_modules/.pnpm/@floating-ui+react@0.26.28_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@floating-ui/react/dist/floating-ui.react.mjs","../../node_modules/.pnpm/@floating-ui+utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../node_modules/.pnpm/@floating-ui+react@0.26.28_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs","../../node_modules/.pnpm/@floating-ui+utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../node_modules/.pnpm/@floating-ui+core@1.7.1/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../node_modules/.pnpm/@floating-ui+dom@1.7.1/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../node_modules/.pnpm/@floating-ui+react-dom@2.1.3_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/internal/floating.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/internal/frozen.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/internal/open-closed.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/calculate-active-index.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/components/portal/portal.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-on-unmount.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/internal/portal-force-root.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/components/listbox/listbox.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-did-element-move.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/hooks/use-text-value.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/utils/get-text-value.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/components/listbox/listbox-machine.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/components/listbox/listbox-machine-glue.js","../../node_modules/.pnpm/@headlessui+react@2.2.4_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@headlessui/react/dist/components/radio-group/radio-group.js","../../src/react/components/icons/sort-down.tsx","../../src/react/components/selectors/variant-selector.tsx","../../src/react/components/selectors/radio-selector.tsx","../../src/react/components/selectors/edit-mode-selector.tsx","../../src/react/components/toolbar/toolbar-button.tsx","../../src/react/components/toolbar/toolbar-indicator-wrapper.tsx"],"sourcesContent":["\"use strict\";\n\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\nexports._ = _interop_require_default;\n","\"use strict\";\n\nfunction _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) return obj;\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") return { default: obj };\n\n var cache = _getRequireWildcardCache(nodeInterop);\n\n if (cache && cache.has(obj)) return cache.get(obj);\n\n var newObj = { __proto__: null };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);\n else newObj[key] = obj[key];\n }\n }\n\n newObj.default = obj;\n\n if (cache) cache.set(obj, newObj);\n\n return newObj;\n}\nexports._ = _interop_require_wildcard;\n","import React from 'react'\n\nexport const HeadManagerContext: React.Context<{\n updateHead?: (state: any) => void\n mountedInstances?: any\n updateScripts?: (state: any) => void\n scripts?: any\n getIsSsr?: () => boolean\n\n // Used in app directory, to render script tags as server components.\n appDir?: boolean\n nonce?: string\n}> = React.createContext({})\n\nif (process.env.NODE_ENV !== 'production') {\n HeadManagerContext.displayName = 'HeadManagerContext'\n}\n","const DOMAttributeNames: Record<string, string> = {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv',\n noModule: 'noModule',\n}\n\nconst ignoreProps = [\n 'onLoad',\n 'onReady',\n 'dangerouslySetInnerHTML',\n 'children',\n 'onError',\n 'strategy',\n 'stylesheets',\n]\n\nfunction isBooleanScriptAttribute(\n attr: string\n): attr is 'async' | 'defer' | 'noModule' {\n return ['async', 'defer', 'noModule'].includes(attr)\n}\n\nexport function setAttributesFromProps(el: HTMLElement, props: object) {\n for (const [p, value] of Object.entries(props)) {\n if (!props.hasOwnProperty(p)) continue\n if (ignoreProps.includes(p)) continue\n\n // we don't render undefined props to the DOM\n if (value === undefined) {\n continue\n }\n\n const attr = DOMAttributeNames[p] || p.toLowerCase()\n\n if (el.tagName === 'SCRIPT' && isBooleanScriptAttribute(attr)) {\n // Correctly assign boolean script attributes\n // https://github.com/vercel/next.js/pull/20748\n ;(el as HTMLScriptElement)[attr] = !!value\n } else {\n el.setAttribute(attr, String(value))\n }\n\n // Remove falsy non-zero boolean attributes so they are correctly interpreted\n // (e.g. if we set them to false, this coerces to the string \"false\", which the browser interprets as true)\n if (\n value === false ||\n (el.tagName === 'SCRIPT' &&\n isBooleanScriptAttribute(attr) &&\n (!value || value === 'false'))\n ) {\n // Call setAttribute before, as we need to set and unset the attribute to override force async:\n // https://html.spec.whatwg.org/multipage/scripting.html#script-force-async\n el.setAttribute(attr, '')\n el.removeAttribute(attr)\n }\n }\n}\n","export const requestIdleCallback =\n (typeof self !== 'undefined' &&\n self.requestIdleCallback &&\n self.requestIdleCallback.bind(window)) ||\n function (cb: IdleRequestCallback): number {\n let start = Date.now()\n return self.setTimeout(function () {\n cb({\n didTimeout: false,\n timeRemaining: function () {\n return Math.max(0, 50 - (Date.now() - start))\n },\n })\n }, 1)\n }\n\nexport const cancelIdleCallback =\n (typeof self !== 'undefined' &&\n self.cancelIdleCallback &&\n self.cancelIdleCallback.bind(window)) ||\n function (id: number) {\n return clearTimeout(id)\n }\n","'use client'\n\nimport ReactDOM from 'react-dom'\nimport React, { useEffect, useContext, useRef, type JSX } from 'react'\nimport type { ScriptHTMLAttributes } from 'react'\nimport { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime'\nimport { setAttributesFromProps } from './set-attributes-from-props'\nimport { requestIdleCallback } from './request-idle-callback'\n\nconst ScriptCache = new Map()\nconst LoadCache = new Set()\n\nexport interface ScriptProps extends ScriptHTMLAttributes<HTMLScriptElement> {\n strategy?: 'afterInteractive' | 'lazyOnload' | 'beforeInteractive' | 'worker'\n id?: string\n onLoad?: (e: any) => void\n onReady?: () => void | null\n onError?: (e: any) => void\n children?: React.ReactNode\n stylesheets?: string[]\n}\n\n/**\n * @deprecated Use `ScriptProps` instead.\n */\nexport type Props = ScriptProps\n\nconst insertStylesheets = (stylesheets: string[]) => {\n // Case 1: Styles for afterInteractive/lazyOnload with appDir injected via handleClientScriptLoad\n //\n // Using ReactDOM.preinit to feature detect appDir and inject styles\n // Stylesheets might have already been loaded if initialized with Script component\n // Re-inject styles here to handle scripts loaded via handleClientScriptLoad\n // ReactDOM.preinit handles dedup and ensures the styles are loaded only once\n if (ReactDOM.preinit) {\n stylesheets.forEach((stylesheet: string) => {\n ReactDOM.preinit(stylesheet, { as: 'style' })\n })\n\n return\n }\n\n // Case 2: Styles for afterInteractive/lazyOnload with pages injected via handleClientScriptLoad\n //\n // We use this function to load styles when appdir is not detected\n // TODO: Use React float APIs to load styles once available for pages dir\n if (typeof window !== 'undefined') {\n let head = document.head\n stylesheets.forEach((stylesheet: string) => {\n let link = document.createElement('link')\n\n link.type = 'text/css'\n link.rel = 'stylesheet'\n link.href = stylesheet\n\n head.appendChild(link)\n })\n }\n}\n\nconst loadScript = (props: ScriptProps): void => {\n const {\n src,\n id,\n onLoad = () => {},\n onReady = null,\n dangerouslySetInnerHTML,\n children = '',\n strategy = 'afterInteractive',\n onError,\n stylesheets,\n } = props\n\n const cacheKey = id || src\n\n // Script has already loaded\n if (cacheKey && LoadCache.has(cacheKey)) {\n return\n }\n\n // Contents of this script are already loading/loaded\n if (ScriptCache.has(src)) {\n LoadCache.add(cacheKey)\n // It is possible that multiple `next/script` components all have same \"src\", but has different \"onLoad\"\n // This is to make sure the same remote script will only load once, but \"onLoad\" are executed in order\n ScriptCache.get(src).then(onLoad, onError)\n return\n }\n\n /** Execute after the script first loaded */\n const afterLoad = () => {\n // Run onReady for the first time after load event\n if (onReady) {\n onReady()\n }\n // add cacheKey to LoadCache when load successfully\n LoadCache.add(cacheKey)\n }\n\n const el = document.createElement('script')\n\n const loadPromise = new Promise<void>((resolve, reject) => {\n el.addEventListener('load', function (e) {\n resolve()\n if (onLoad) {\n onLoad.call(this, e)\n }\n afterLoad()\n })\n el.addEventListener('error', function (e) {\n reject(e)\n })\n }).catch(function (e) {\n if (onError) {\n onError(e)\n }\n })\n\n if (dangerouslySetInnerHTML) {\n // Casting since lib.dom.d.ts doesn't have TrustedHTML yet.\n el.innerHTML = (dangerouslySetInnerHTML.__html as string) || ''\n\n afterLoad()\n } else if (children) {\n el.textContent =\n typeof children === 'string'\n ? children\n : Array.isArray(children)\n ? children.join('')\n : ''\n\n afterLoad()\n } else if (src) {\n el.src = src\n // do not add cacheKey into LoadCache for remote script here\n // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)\n\n ScriptCache.set(src, loadPromise)\n }\n\n setAttributesFromProps(el, props)\n\n if (strategy === 'worker') {\n el.setAttribute('type', 'text/partytown')\n }\n\n el.setAttribute('data-nscript', strategy)\n\n // Load styles associated with this script\n if (stylesheets) {\n insertStylesheets(stylesheets)\n }\n\n document.body.appendChild(el)\n}\n\nexport function handleClientScriptLoad(props: ScriptProps) {\n const { strategy = 'afterInteractive' } = props\n if (strategy === 'lazyOnload') {\n window.addEventListener('load', () => {\n requestIdleCallback(() => loadScript(props))\n })\n } else {\n loadScript(props)\n }\n}\n\nfunction loadLazyScript(props: ScriptProps) {\n if (document.readyState === 'complete') {\n requestIdleCallback(() => loadScript(props))\n } else {\n window.addEventListener('load', () => {\n requestIdleCallback(() => loadScript(props))\n })\n }\n}\n\nfunction addBeforeInteractiveToCache() {\n const scripts = [\n ...document.querySelectorAll('[data-nscript=\"beforeInteractive\"]'),\n ...document.querySelectorAll('[data-nscript=\"beforePageRender\"]'),\n ]\n scripts.forEach((script) => {\n const cacheKey = script.id || script.getAttribute('src')\n LoadCache.add(cacheKey)\n })\n}\n\nexport function initScriptLoader(scriptLoaderItems: ScriptProps[]) {\n scriptLoaderItems.forEach(handleClientScriptLoad)\n addBeforeInteractiveToCache()\n}\n\n/**\n * Load a third-party scripts in an optimized way.\n *\n * Read more: [Next.js Docs: `next/script`](https://nextjs.org/docs/app/api-reference/components/script)\n */\nfunction Script(props: ScriptProps): JSX.Element | null {\n const {\n id,\n src = '',\n onLoad = () => {},\n onReady = null,\n strategy = 'afterInteractive',\n onError,\n stylesheets,\n ...restProps\n } = props\n\n // Context is available only during SSR\n const { updateScripts, scripts, getIsSsr, appDir, nonce } =\n useContext(HeadManagerContext)\n\n /**\n * - First mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)\n * onReady is skipped, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. hasLoadScriptEffectCalled.current is false, loadScript executes\n * Once the script is loaded, the onLoad and onReady will be called by then\n * [If strict mode is enabled / is wrapped in <OffScreen /> component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n *\n * - Second mount:\n * 1. The useEffect for onReady executes\n * 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)\n * onReady is called, set hasOnReadyEffectCalled.current to true\n * 3. The useEffect for loadScript executes\n * 4. The script is already loaded, loadScript bails out\n * [If strict mode is enabled / is wrapped in <OffScreen /> component]\n * 5. The useEffect for onReady executes again\n * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped\n * 7. The useEffect for loadScript executes again\n * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped\n */\n const hasOnReadyEffectCalled = useRef(false)\n\n useEffect(() => {\n const cacheKey = id || src\n if (!hasOnReadyEffectCalled.current) {\n // Run onReady if script has loaded before but component is re-mounted\n if (onReady && cacheKey && LoadCache.has(cacheKey)) {\n onReady()\n }\n\n hasOnReadyEffectCalled.current = true\n }\n }, [onReady, id, src])\n\n const hasLoadScriptEffectCalled = useRef(false)\n\n useEffect(() => {\n if (!hasLoadScriptEffectCalled.current) {\n if (strategy === 'afterInteractive') {\n loadScript(props)\n } else if (strategy === 'lazyOnload') {\n loadLazyScript(props)\n }\n\n hasLoadScriptEffectCalled.current = true\n }\n }, [props, strategy])\n\n if (strategy === 'beforeInteractive' || strategy === 'worker') {\n if (updateScripts) {\n scripts[strategy] = (scripts[strategy] || []).concat([\n {\n id,\n src,\n onLoad,\n onReady,\n onError,\n ...restProps,\n },\n ])\n updateScripts(scripts)\n } else if (getIsSsr && getIsSsr()) {\n // Script has already loaded during SSR\n LoadCache.add(id || src)\n } else if (getIsSsr && !getIsSsr()) {\n loadScript(props)\n }\n }\n\n // For the app directory, we need React Float to preload these scripts.\n if (appDir) {\n // Injecting stylesheets here handles beforeInteractive and worker scripts correctly\n // For other strategies injecting here ensures correct stylesheet order\n // ReactDOM.preinit handles loading the styles in the correct order,\n // also ensures the stylesheet is loaded only once and in a consistent manner\n //\n // Case 1: Styles for beforeInteractive/worker with appDir - handled here\n // Case 2: Styles for beforeInteractive/worker with pages dir - Not handled yet\n // Case 3: Styles for afterInteractive/lazyOnload with appDir - handled here\n // Case 4: Styles for afterInteractive/lazyOnload with pages dir - handled in insertStylesheets function\n if (stylesheets) {\n stylesheets.forEach((styleSrc) => {\n ReactDOM.preinit(styleSrc, { as: 'style' })\n })\n }\n\n // Before interactive scripts need to be loaded by Next.js' runtime instead\n // of native <script> tags, because they no longer have `defer`.\n if (strategy === 'beforeInteractive') {\n if (!src) {\n // For inlined scripts, we put the content in `children`.\n if (restProps.dangerouslySetInnerHTML) {\n // Casting since lib.dom.d.ts doesn't have TrustedHTML yet.\n restProps.children = restProps.dangerouslySetInnerHTML\n .__html as string\n delete restProps.dangerouslySetInnerHTML\n }\n\n return (\n <script\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([\n 0,\n { ...restProps, id },\n ])})`,\n }}\n />\n )\n } else {\n // @ts-ignore\n ReactDOM.preload(\n src,\n restProps.integrity\n ? {\n as: 'script',\n integrity: restProps.integrity,\n nonce,\n crossOrigin: restProps.crossOrigin,\n }\n : { as: 'script', nonce, crossOrigin: restProps.crossOrigin }\n )\n return (\n <script\n nonce={nonce}\n dangerouslySetInnerHTML={{\n __html: `(self.__next_s=self.__next_s||[]).push(${JSON.stringify([\n src,\n { ...restProps, id },\n ])})`,\n }}\n />\n )\n }\n } else if (strategy === 'afterInteractive') {\n if (src) {\n // @ts-ignore\n ReactDOM.preload(\n src,\n restProps.integrity\n ? {\n as: 'script',\n integrity: restProps.integrity,\n nonce,\n crossOrigin: restProps.crossOrigin,\n }\n : { as: 'script', nonce, crossOrigin: restProps.crossOrigin }\n )\n }\n }\n }\n\n return null\n}\n\nObject.defineProperty(Script, '__nextScript', { value: true })\n\nexport default Script\n","module.exports = require('./dist/client/script')\n","/**\n * @license React\n * use-sync-external-store-with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = React.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","/**\n * @license React\n * use-sync-external-store-with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = React.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/use-sync-external-store-with-selector.production.js');\n} else {\n module.exports = require('./cjs/use-sync-external-store-with-selector.development.js');\n}\n","'use client';\n\nimport React, { ReactNode, useEffect, useCallback, useMemo } from 'react';\nimport { PreprToolbarOptions, PreprToolbarProps } from '../../../types';\nimport {\n SegmentProvider,\n VariantProvider,\n EditModeProvider,\n useSegmentContext,\n useVariantContext,\n useEditModeContext,\n} from '../../contexts';\nimport { StegaErrorBoundary } from '../error-boundary';\nimport { initDebugLogger } from '../../../utils/debug';\nimport useScrollPosition from '../../hooks/use-scroll-position';\n\ninterface PreprToolbarProviderProps {\n children: ReactNode;\n props: PreprToolbarProps;\n options?: PreprToolbarOptions;\n}\n\nexport const PreprToolbarProvider: React.FC<PreprToolbarProviderProps> = ({\n children,\n props,\n options,\n}) => {\n const { activeSegment, activeVariant, data } = props;\n\n // Initialize debug logger with options\n useEffect(() => {\n const debugEnabled = options?.debug ?? false;\n initDebugLogger(debugEnabled);\n }, [options?.debug]);\n\n // Initialize scroll position handling for iframe communication\n useScrollPosition();\n\n return (\n <StegaErrorBoundary>\n <SegmentProvider initialSegments={data} activeSegment={activeSegment}>\n <VariantProvider activeVariant={activeVariant}>\n <EditModeProvider>{children}</EditModeProvider>\n </VariantProvider>\n </SegmentProvider>\n </StegaErrorBoundary>\n );\n};\n\n// Legacy hook for backward compatibility\nexport const usePreprToolbar = () => {\n // This will be deprecated in favor of specific context hooks\n // but kept for backward compatibility\n const segmentContext = useSegmentContext();\n const variantContext = useVariantContext();\n const editModeContext = useEditModeContext();\n\n const resetPersonalization = useCallback(() => {\n segmentContext.setSelectedSegment(segmentContext.emptySegment);\n variantContext.setSelectedVariant(variantContext.emptyVariant);\n }, [segmentContext, variantContext]);\n\n const resetAll = useCallback(() => {\n segmentContext.setSelectedSegment(segmentContext.emptySegment);\n variantContext.setSelectedVariant(variantContext.emptyVariant);\n editModeContext.setEditMode(false);\n }, [segmentContext, variantContext, editModeContext]);\n\n return useMemo(\n () => ({\n isPreviewMode: false,\n activeSegment: segmentContext.selectedSegment._id,\n activeVariant: variantContext.selectedVariant,\n data: segmentContext.segments,\n emptySegment: segmentContext.emptySegment,\n segmentList: segmentContext.segments,\n selectedSegment: segmentContext.selectedSegment,\n setSelectedSegment: segmentContext.setSelectedSegment,\n emptyVariant: variantContext.emptyVariant,\n selectedVariant: variantContext.selectedVariant,\n setSelectedVariant: variantContext.setSelectedVariant,\n editMode: editModeContext.editMode,\n setEditMode: editModeContext.setEditMode,\n isIframe: editModeContext.isIframe,\n resetPersonalization,\n resetAll,\n }),\n [\n segmentContext.selectedSegment,\n segmentContext.segments,\n segmentContext.emptySegment,\n segmentContext.setSelectedSegment,\n variantContext.selectedVariant,\n variantContext.emptyVariant,\n variantContext.setSelectedVariant,\n editModeContext.editMode,\n editModeContext.setEditMode,\n editModeContext.isIframe,\n resetPersonalization,\n resetAll,\n ]\n );\n};\n","'use client';\n\nimport React, { createContext, useContext, useState, ReactNode } from 'react';\nimport { PreprSegment } from '../../types';\nimport { handleContextError } from '../../utils/errors';\nimport { sendPreprEvent } from '../../utils';\n\ninterface SegmentContextValue {\n segments: PreprSegment[];\n selectedSegment: PreprSegment;\n setSelectedSegment: (segment: PreprSegment) => void;\n emptySegment: PreprSegment;\n}\n\nconst SegmentContext = createContext<SegmentContextValue | undefined>(\n undefined\n);\n\ninterface SegmentProviderProps {\n children: ReactNode;\n initialSegments: readonly PreprSegment[];\n activeSegment?: string | null;\n}\n\nexport function SegmentProvider({\n children,\n initialSegments,\n activeSegment,\n}: SegmentProviderProps) {\n const segmentList: PreprSegment[] = [\n {\n _id: 'all_other_users',\n name: 'All other users',\n },\n ...initialSegments,\n ];\n\n const emptySegment: PreprSegment = {\n name: 'Choose segment',\n _id: 'null',\n };\n\n const [selectedSegment, setSelectedSegment] = useState<PreprSegment>(\n (segmentList &&\n segmentList.filter(\n (segmentData: PreprSegment) => segmentData._id === activeSegment\n )[0]) ||\n emptySegment\n );\n\n const handleSetSelectedSegment = (segment: PreprSegment) => {\n setSelectedSegment(segment);\n sendPreprEvent('segment_changed', { segment: segment._id });\n };\n\n const value: SegmentContextValue = {\n segments: segmentList,\n selectedSegment,\n setSelectedSegment: handleSetSelectedSegment,\n emptySegment,\n };\n\n return (\n <SegmentContext.Provider value={value}>{children}</SegmentContext.Provider>\n );\n}\n\nexport function useSegmentContext(): SegmentContextValue {\n const context = useContext(SegmentContext);\n if (!context) {\n handleContextError('useSegmentContext');\n }\n return context!;\n}\n","export const StegaError = {\n DECODE_FAILED: 'STEGA_DECODE_FAILED',\n INVALID_FORMAT: 'STEGA_INVALID_FORMAT',\n DOM_MANIPULATION_FAILED: 'DOM_MANIPULATION_FAILED',\n CONTEXT_NOT_FOUND: 'CONTEXT_NOT_FOUND',\n} as const;\n\nexport type StegaErrorType = (typeof StegaError)[keyof typeof StegaError];\n\n// Define specific types for error additional data\nexport interface ErrorAdditionalData {\n input?: string;\n element?: HTMLElement;\n context?: string;\n [key: string]: string | HTMLElement | undefined;\n}\n\nexport interface ErrorInfo {\n type: StegaErrorType;\n context: string;\n message: string;\n timestamp: string;\n stack?: string;\n additionalData?: ErrorAdditionalData;\n}\n\nexport function createErrorInfo(\n type: StegaErrorType,\n context: string,\n error: Error,\n additionalData?: ErrorAdditionalData\n): ErrorInfo {\n return {\n type,\n context,\n message: error.message,\n timestamp: new Date().toISOString(),\n stack: error.stack,\n additionalData,\n };\n}\n\nexport function handleStegaError(\n error: Error,\n context: string,\n additionalData?: ErrorAdditionalData\n) {\n const errorInfo = createErrorInfo(\n StegaError.DECODE_FAILED,\n context,\n error,\n additionalData\n );\n\n console.error('Stega Error:', errorInfo);\n\n // In production, you might want to send this to an error tracking service\n if (process.env.NODE_ENV === 'production') {\n // sendToErrorTrackingService(errorInfo);\n }\n\n return errorInfo;\n}\n\nexport function handleDOMError(error: Error, context: string) {\n const errorInfo = createErrorInfo(\n StegaError.DOM_MANIPULATION_FAILED,\n context,\n error\n );\n\n console.error('DOM Error:', errorInfo);\n return errorInfo;\n}\n\nexport function handleContextError(contextName: string) {\n const error = new Error(`${contextName} must be used within its provider`);\n const errorInfo = createErrorInfo(\n StegaError.CONTEXT_NOT_FOUND,\n contextName,\n error\n );\n\n console.error('Context Error:', errorInfo);\n throw error;\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","import {\n AnyClassGroupIds,\n An