{"version":3,"file":"index.cjs","sources":["../src/components/courier-client-component.tsx","../src/context/render-context.ts","../src/components/courier-inbox-component.tsx","../src/components/courier-inbox-popup-menu-component.tsx","../src/components/courier-toast-component.tsx","../src/components/courier-preferences-component.tsx","../src/hooks/use-courier.tsx"],"sourcesContent":["import React, { useState, useEffect } from 'react';\n\ninterface CourierClientProps {\n  children: React.ReactNode;\n}\n\n// This class prevents issues with server side rendering react components\n// It will force the component to only render client side\n// A future update could support server side rendering if there is enough demand\nexport const CourierClientComponent: React.FC<CourierClientProps> = ({ children }) => {\n  const [isMounted, setIsMounted] = useState(false);\n\n  useEffect(() => {\n    setIsMounted(true);\n  }, []);\n\n  // During SSR, render nothing or fallback\n  if (typeof window === 'undefined') {\n    return null;\n  }\n\n  if (!isMounted) {\n    return null;\n  }\n\n  return <>{children}</>;\n};","import { createContext, ReactNode } from \"react\";\n\ntype RenderFn = (node: ReactNode) => HTMLElement;\n\n/**\n * Context providing a function to render a React component.\n *\n * Courier's React package renders as follows:\n *\n *   - React engine (client application)\n *     - Courier React components\n *       - Courier web components\n *         - [Optional] User-provided React components (ex. a list item)\n *\n * By default, React will not render the user-provided React components within Courier's\n * web components. We instead manually render the user-provided React components and inject\n * them into the Courier web components.\n *\n * Client rendering changed between React 17 and 18, so the SDKs provide React version-specific\n * rendering functions. See\n * https://18.react.dev/blog/2022/03/08/react-18-upgrade-guide#updates-to-client-rendering-apis.\n */\nexport const CourierRenderContext = createContext<RenderFn | null>(null);\n","import { useRef, useEffect, useMemo, forwardRef, ReactNode, useContext, useState } from \"react\";\nimport { CourierInboxListItemActionFactoryProps, CourierInboxListItemFactoryProps, CourierInboxTheme, CourierInbox as CourierInboxElement, CourierInboxHeaderFactoryProps, CourierInboxStateEmptyFactoryProps, CourierInboxStateLoadingFactoryProps, CourierInboxStateErrorFactoryProps, CourierInboxPaginationItemFactoryProps, CourierInboxFeed } from \"@trycourier/courier-ui-inbox\";\nimport { CourierComponentThemeMode } from \"@trycourier/courier-ui-core\";\nimport { InboxMessage } from \"@trycourier/courier-js\";\nimport { CourierClientComponent } from \"./courier-client-component\";\nimport { CourierRenderContext } from \"../context/render-context\";\n\nexport interface CourierInboxProps {\n  /** Height of the inbox container. Defaults to \"auto\" and will resize itself based on it's children. */\n  height?: string;\n\n  /** Theme object for light mode */\n  lightTheme?: CourierInboxTheme;\n\n  /** Theme object for dark mode */\n  darkTheme?: CourierInboxTheme;\n\n  /** Theme mode: \"light\", \"dark\", or \"system\". Defaults to \"system\" */\n  mode?: CourierComponentThemeMode;\n\n  /** Type of feed to display in the inbox. Defaults to \"inbox\" */\n  feedType?: string;\n\n  /** Array of feeds to display in the inbox. Each feed contains tabs with different filters. */\n  feeds?: CourierInboxFeed[];\n\n  /** Callback fired when a message is clicked. */\n  onMessageClick?: (props: CourierInboxListItemFactoryProps) => void;\n\n  /** Callback fired when a message action (e.g., button) is clicked. */\n  onMessageActionClick?: (props: CourierInboxListItemActionFactoryProps) => void;\n\n  /** Callback fired when a message is long-pressed (for mobile/gesture support). Only works on devices that support touch. */\n  onMessageLongPress?: (props: CourierInboxListItemFactoryProps) => void;\n\n  /** Allows you to pass a custom component as the header. */\n  renderHeader?: (props: CourierInboxHeaderFactoryProps | undefined | null) => ReactNode;\n\n  /** Allows you to pass a custom component as the list item. */\n  renderListItem?: (props: CourierInboxListItemFactoryProps | undefined | null) => ReactNode;\n\n  /** Allows you to pass a custom component as the empty state. */\n  renderEmptyState?: (props: CourierInboxStateEmptyFactoryProps | undefined | null) => ReactNode;\n\n  /** Allows you to pass a custom component as the loading state. */\n  renderLoadingState?: (props: CourierInboxStateLoadingFactoryProps | undefined | null) => ReactNode;\n\n  /** Allows you to pass a custom component as the error state. */\n  renderErrorState?: (props: CourierInboxStateErrorFactoryProps | undefined | null) => ReactNode;\n\n  /** Allows you to pass a custom component as the pagination list item. */\n  renderPaginationItem?: (props: CourierInboxPaginationItemFactoryProps | undefined | null) => ReactNode;\n\n  /**\n   * Render injected \"dummy\" inbox messages instead of fetching from the API.\n   * No sign-in / network is required, and the live (shared) inbox is unaffected.\n   */\n  previewMessages?: InboxMessage[];\n\n  /** Optional unread-count override for the preview (defaults to unread messages). */\n  previewUnreadCount?: number;\n}\n\nexport const CourierInboxComponent = forwardRef<CourierInboxElement, CourierInboxProps>((props, ref) => {\n  const render = useContext(CourierRenderContext);\n  if (!render) {\n    throw new Error(\"RenderContext not found. Ensure CourierInbox is wrapped in a CourierRenderContext.\");\n  }\n\n  // Element ref for use in effects, updated by handleRef.\n  const inboxRef = useRef<CourierInboxElement | null>(null);\n  const [elementReady, setElementReady] = useState(false);\n\n  // Callback ref passed to rendered component, used to propagate the DOM element's ref to the parent component.\n  // We use a callback ref (rather than a React.RefObject) since we want the parent ref to be up-to-date with\n  // rendered component. Updating the parent ref via useEffect does not work, since mutating a RefObject\n  // does not trigger useEffect (see https://stackoverflow.com/a/60476525).\n  function handleRef(el: CourierInboxElement | null) {\n    if (ref) {\n\n      // Propagate ref to ref callback functions\n      if (typeof ref === 'function') {\n        ref(el);\n      } else {\n        // Propagate ref to ref objects\n        // @ts-ignore - RefObject.current is readonly in React 17, however it's not frozen and is equivalent the widened type MutableRefObject\n        (ref as React.RefObject<CourierInboxElement | null>).current = el;\n      }\n    }\n\n    // Store the element for use in effects\n    inboxRef.current = el;\n\n    // Update element ready state\n    setElementReady(!!el);\n  }\n\n  // Helper to get the current element\n  function getEl(): CourierInboxElement | null {\n    return inboxRef.current;\n  }\n\n  // Handle message click\n  useEffect(() => {\n    const inbox = getEl();\n    if (!inbox) return;\n    inbox.onMessageClick(props.onMessageClick);\n  }, [props.onMessageClick, elementReady]);\n\n  // Handle message action click\n  useEffect(() => {\n    const inbox = getEl();\n    if (!inbox) return;\n    inbox.onMessageActionClick(props.onMessageActionClick);\n  }, [props.onMessageActionClick, elementReady]);\n\n  // Handle message long press\n  useEffect(() => {\n    const inbox = getEl();\n    if (!inbox) return;\n    inbox.onMessageLongPress(props.onMessageLongPress);\n  }, [props.onMessageLongPress, elementReady]);\n\n  // Inject preview/dummy data (skips fetch + the shared datastore)\n  useEffect(() => {\n    const inbox = getEl();\n    if (!inbox) return;\n    inbox.setPreviewData(props.previewMessages ?? null, {\n      unreadCount: props.previewUnreadCount,\n    });\n  }, [props.previewMessages, props.previewUnreadCount, elementReady]);\n\n  // Render header\n  useEffect(() => {\n    const inbox = getEl();\n    if (!inbox || !props.renderHeader) return;\n    queueMicrotask(() => {\n      inbox.setHeader((headerProps?: CourierInboxHeaderFactoryProps | undefined | null): HTMLElement => {\n        const reactNode = props.renderHeader!(headerProps);\n        return render(reactNode);\n      });\n    });\n  }, [props.renderHeader, elementReady]);\n\n  // Render list item\n  useEffect(() => {\n    const inbox = getEl();\n    if (!inbox || !props.renderListItem) return;\n    queueMicrotask(() => {\n      inbox.setListItem((itemProps?: CourierInboxListItemFactoryProps | undefined | null): HTMLElement => {\n        const reactNode = props.renderListItem!(itemProps);\n        return render(reactNode);\n      });\n    });\n  }, [props.renderListItem, elementReady]);\n\n  // Render empty state\n  useEffect(() => {\n    const inbox = getEl();\n    if (!inbox || !props.renderEmptyState) return;\n    queueMicrotask(() => {\n      inbox.setEmptyState((emptyStateProps?: CourierInboxStateEmptyFactoryProps | undefined | null): HTMLElement => {\n        const reactNode = props.renderEmptyState!(emptyStateProps);\n        return render(reactNode);\n      });\n    });\n  }, [props.renderEmptyState, elementReady]);\n\n  // Render loading state\n  useEffect(() => {\n    const inbox = getEl();\n    if (!inbox || !props.renderLoadingState) return;\n    queueMicrotask(() => {\n      inbox.setLoadingState((loadingStateProps?: CourierInboxStateLoadingFactoryProps | undefined | null): HTMLElement => {\n        const reactNode = props.renderLoadingState!(loadingStateProps);\n        return render(reactNode);\n      });\n    });\n  }, [props.renderLoadingState, elementReady]);\n\n  // Render error state\n  useEffect(() => {\n    const inbox = getEl();\n    if (!inbox || !props.renderErrorState) return;\n    queueMicrotask(() => {\n      inbox.setErrorState((errorStateProps?: CourierInboxStateErrorFactoryProps | undefined | null): HTMLElement => {\n        const reactNode = props.renderErrorState!(errorStateProps);\n        return render(reactNode);\n      });\n    });\n  }, [props.renderErrorState, elementReady]);\n\n  // Render pagination item\n  useEffect(() => {\n    const inbox = getEl();\n    if (!inbox || !props.renderPaginationItem) return;\n    queueMicrotask(() => {\n      inbox.setPaginationItem((paginationProps?: CourierInboxPaginationItemFactoryProps | undefined | null): HTMLElement => {\n        const reactNode = props.renderPaginationItem!(paginationProps);\n        return render(reactNode);\n      });\n    });\n  }, [props.renderPaginationItem, elementReady]);\n\n  const feedsAttr = useMemo(\n    () => props.feeds ? JSON.stringify(props.feeds) : undefined,\n    [props.feeds]\n  );\n\n  const children = (\n    /* @ts-ignore */\n    <courier-inbox\n      ref={handleRef}\n      height={props.height}\n      light-theme={props.lightTheme ? JSON.stringify(props.lightTheme) : undefined}\n      dark-theme={props.darkTheme ? JSON.stringify(props.darkTheme) : undefined}\n      mode={props.mode}\n      feeds={feedsAttr as any}\n      {...({ preview: props.previewMessages ? \"true\" : undefined } as any)}\n    />\n  );\n\n  return (\n    <CourierClientComponent children={children} />\n  );\n});\n","import { useEffect, useMemo, useRef, forwardRef, ReactNode, useContext, useState } from 'react';\nimport {\n  CourierInboxHeaderFactoryProps,\n  CourierInboxListItemActionFactoryProps,\n  CourierInboxListItemFactoryProps,\n  CourierInboxMenuButtonFactoryProps,\n  CourierInboxPopupMenu as CourierInboxPopupMenuElement,\n  CourierInboxPaginationItemFactoryProps,\n  CourierInboxPopupAlignment,\n  CourierInboxStateEmptyFactoryProps,\n  CourierInboxStateErrorFactoryProps,\n  CourierInboxStateLoadingFactoryProps,\n  CourierInboxTheme,\n  CourierInboxFeed,\n} from '@trycourier/courier-ui-inbox';\nimport { CourierComponentThemeMode } from '@trycourier/courier-ui-core';\nimport { InboxMessage } from '@trycourier/courier-js';\nimport { CourierClientComponent } from './courier-client-component';\nimport { CourierRenderContext } from '../context/render-context';\n\nexport interface CourierInboxPopupMenuProps {\n  /** Alignment of the popup menu: 'top-right', 'top-left', 'top-center', 'bottom-right', 'bottom-left', 'bottom-center', 'center-right', 'center-left', 'center-center'. */\n  popupAlignment?: CourierInboxPopupAlignment;\n\n  /** Width of the popup menu container. */\n  popupWidth?: string;\n\n  /** Height of the popup menu container. */\n  popupHeight?: string;\n\n  /** CSS left position for the popup menu. */\n  left?: string;\n\n  /** CSS top position for the popup menu. */\n  top?: string;\n\n  /** CSS right position for the popup menu. */\n  right?: string;\n\n  /** CSS bottom position for the popup menu. */\n  bottom?: string;\n\n  /** Theme object for light mode. */\n  lightTheme?: CourierInboxTheme;\n\n  /** Theme object for dark mode. */\n  darkTheme?: CourierInboxTheme;\n\n  /** Theme mode: 'light', 'dark', or 'system'. */\n  mode?: CourierComponentThemeMode;\n\n  /** Array of feeds to display in the inbox. Each feed contains tabs with different filters. */\n  feeds?: CourierInboxFeed[];\n\n  /** Callback fired when a message is clicked. */\n  onMessageClick?: (props: CourierInboxListItemFactoryProps) => void;\n\n  /** Callback fired when a message action (e.g., button) is clicked. */\n  onMessageActionClick?: (props: CourierInboxListItemActionFactoryProps) => void;\n\n  /** Callback fired when a message is long-pressed (for mobile/gesture support). */\n  onMessageLongPress?: (props: CourierInboxListItemFactoryProps) => void;\n\n  /** Allows you to pass a custom component as the header. */\n  renderHeader?: (props: CourierInboxHeaderFactoryProps | undefined | null) => ReactNode;\n\n  /** Allows you to pass a custom component as the list item. */\n  renderListItem?: (props: CourierInboxListItemFactoryProps | undefined | null) => ReactNode;\n\n  /** Allows you to pass a custom component as the empty state. */\n  renderEmptyState?: (props: CourierInboxStateEmptyFactoryProps | undefined | null) => ReactNode;\n\n  /** Allows you to pass a custom component as the loading state. */\n  renderLoadingState?: (props: CourierInboxStateLoadingFactoryProps | undefined | null) => ReactNode;\n\n  /** Allows you to pass a custom component as the error state. */\n  renderErrorState?: (props: CourierInboxStateErrorFactoryProps | undefined | null) => ReactNode;\n\n  /** Allows you to pass a custom component as the pagination list item. */\n  renderPaginationItem?: (props: CourierInboxPaginationItemFactoryProps | undefined | null) => ReactNode;\n\n  /** Allows you to pass a custom component as the menu button. */\n  renderMenuButton?: (props: CourierInboxMenuButtonFactoryProps | undefined | null) => ReactNode;\n\n  /**\n   * Render injected \"dummy\" inbox messages instead of fetching from the API.\n   * No sign-in / network is required, and the live (shared) inbox is unaffected.\n   */\n  previewMessages?: InboxMessage[];\n\n  /** Optional unread-count override for the preview (defaults to unread messages). */\n  previewUnreadCount?: number;\n}\n\nexport const CourierInboxPopupMenuComponent = forwardRef<CourierInboxPopupMenuElement, CourierInboxPopupMenuProps>(\n  (props, ref) => {\n    const render = useContext(CourierRenderContext);\n    if (!render) {\n      throw new Error(\"RenderContext not found. Ensure CourierInboxPopupMenu is wrapped in a CourierRenderContext.\");\n    }\n\n    // Element ref for use in effects, updated by handleRef.\n    const inboxRef = useRef<CourierInboxPopupMenuElement | null>(null);\n    const [elementReady, setElementReady] = useState(false);\n\n    // Callback ref passed to rendered component, used to propagate the DOM element's ref to the parent component.\n    // We use a callback ref (rather than a React.RefObject) since we want the parent ref to be up-to-date with\n    // rendered component. Updating the parent ref via useEffect does not work, since mutating a RefObject\n    // does not trigger useEffect (see https://stackoverflow.com/a/60476525).\n    function handleRef(el: CourierInboxPopupMenuElement | null) {\n      if (ref) {\n        if (typeof ref === 'function') {\n          ref(el);\n        } else {\n          // @ts-ignore - RefObject.current is readonly in React 17, however it's not frozen and is equivalent the widened type MutableRefObject\n          (ref as React.RefObject<CourierInboxPopupMenuElement | null>).current = el;\n        }\n      }\n\n      // Store the element for use in effects\n      inboxRef.current = el;\n\n      // Update element ready state\n      setElementReady(!!el);\n    }\n\n    // Helper to get the current element\n    function getEl(): CourierInboxPopupMenuElement | null {\n      return inboxRef.current;\n    }\n\n    // Handle message click\n    useEffect(() => {\n      const menu = getEl();\n      if (!menu) return;\n      menu.onMessageClick(props.onMessageClick);\n    }, [props.onMessageClick, elementReady]);\n\n    // Handle message action click\n    useEffect(() => {\n      const menu = getEl();\n      if (!menu) return;\n      menu.onMessageActionClick(props.onMessageActionClick);\n    }, [props.onMessageActionClick, elementReady]);\n\n    // Handle message long press\n    useEffect(() => {\n      const menu = getEl();\n      if (!menu) return;\n      menu.onMessageLongPress(props.onMessageLongPress);\n    }, [props.onMessageLongPress, elementReady]);\n\n    // Inject preview/dummy data (skips fetch + the shared datastore)\n    useEffect(() => {\n      const menu = getEl();\n      if (!menu) return;\n      menu.setPreviewData(props.previewMessages ?? null, {\n        unreadCount: props.previewUnreadCount,\n      });\n    }, [props.previewMessages, props.previewUnreadCount, elementReady]);\n\n    // Render header\n    useEffect(() => {\n      const menu = getEl();\n      if (!menu || !props.renderHeader) return;\n      queueMicrotask(() => {\n        menu.setHeader((headerProps?: CourierInboxHeaderFactoryProps | undefined | null): HTMLElement => {\n          const reactNode = props.renderHeader!(headerProps);\n          return render(reactNode);\n        });\n      });\n    }, [props.renderHeader, elementReady]);\n\n    // Render list item\n    useEffect(() => {\n      const menu = getEl();\n      if (!menu || !props.renderListItem) return;\n      queueMicrotask(() => {\n        menu.setListItem((itemProps?: CourierInboxListItemFactoryProps | undefined | null): HTMLElement => {\n          const reactNode = props.renderListItem!(itemProps);\n          return render(reactNode);\n        });\n      });\n    }, [props.renderListItem, elementReady]);\n\n    // Render empty state\n    useEffect(() => {\n      const menu = getEl();\n      if (!menu || !props.renderEmptyState) return;\n      queueMicrotask(() => {\n        menu.setEmptyState((emptyStateProps?: CourierInboxStateEmptyFactoryProps | undefined | null): HTMLElement => {\n          const reactNode = props.renderEmptyState!(emptyStateProps);\n          return render(reactNode);\n        });\n      });\n    }, [props.renderEmptyState, elementReady]);\n\n    // Render loading state\n    useEffect(() => {\n      const menu = getEl();\n      if (!menu || !props.renderLoadingState) return;\n      queueMicrotask(() => {\n        menu.setLoadingState((loadingStateProps?: CourierInboxStateLoadingFactoryProps | undefined | null): HTMLElement => {\n          const reactNode = props.renderLoadingState!(loadingStateProps);\n          return render(reactNode);\n        });\n      });\n    }, [props.renderLoadingState, elementReady]);\n\n    // Render error state\n    useEffect(() => {\n      const menu = getEl();\n      if (!menu || !props.renderErrorState) return;\n      queueMicrotask(() => {\n        menu.setErrorState((errorStateProps?: CourierInboxStateErrorFactoryProps | undefined | null): HTMLElement => {\n          const reactNode = props.renderErrorState!(errorStateProps);\n          return render(reactNode);\n        });\n      });\n    }, [props.renderErrorState, elementReady]);\n\n    // Render pagination item\n    useEffect(() => {\n      const menu = getEl();\n      if (!menu || !props.renderPaginationItem) return;\n      queueMicrotask(() => {\n        menu.setPaginationItem((paginationProps?: CourierInboxPaginationItemFactoryProps | undefined | null): HTMLElement => {\n          const reactNode = props.renderPaginationItem!(paginationProps);\n          return render(reactNode);\n        });\n      });\n    }, [props.renderPaginationItem, elementReady]);\n\n    // Render menu button\n    useEffect(() => {\n      const menu = getEl();\n      if (!menu || !props.renderMenuButton) return;\n      queueMicrotask(() => {\n        menu.setMenuButton((buttonProps?: CourierInboxMenuButtonFactoryProps | undefined | null): HTMLElement => {\n          const reactNode = props.renderMenuButton!(buttonProps);\n          return render(reactNode);\n        });\n      });\n    }, [props.renderMenuButton, elementReady]);\n\n    const feedsAttr = useMemo(\n      () => props.feeds ? JSON.stringify(props.feeds) : undefined,\n      [props.feeds]\n    );\n\n    const children = (\n      /* @ts-ignore */\n      <courier-inbox-popup-menu\n        ref={handleRef}\n        popup-alignment={props.popupAlignment}\n        popup-width={props.popupWidth}\n        popup-height={props.popupHeight}\n        left={props.left}\n        top={props.top}\n        right={props.right}\n        bottom={props.bottom}\n        light-theme={props.lightTheme ? JSON.stringify(props.lightTheme) : undefined}\n        dark-theme={props.darkTheme ? JSON.stringify(props.darkTheme) : undefined}\n        mode={props.mode}\n        feeds={feedsAttr as any}\n        {...({ preview: props.previewMessages ? \"true\" : undefined } as any)}\n      />\n    );\n\n    return (\n      <CourierClientComponent children={children} />\n    );\n  }\n);\n","import { useRef, useEffect, forwardRef, ReactNode, useContext, CSSProperties, useState, useCallback } from \"react\";\nimport { CourierToastTheme, CourierToast as CourierToastElement, CourierToastItemFactoryProps } from \"@trycourier/courier-ui-toast\";\nimport { CourierComponentThemeMode } from \"@trycourier/courier-ui-core\";\nimport { CourierClientComponent } from \"./courier-client-component\";\nimport { CourierRenderContext } from \"../context/render-context\";\nimport { CourierToastDismissButtonOption, CourierToastItemClickEvent, CourierToastItemActionClickEvent } from \"@trycourier/courier-ui-toast\";\n\n/** Props that may be passed to the CourierToast component. */\nexport interface CourierToastProps {\n  /**\n   * Styles applied to the CourierToast component.\n   *\n   * By default, the component has the following styles:\n   *\n   * ```css\n   * position: \"fixed\";\n   * width: \"380px\";\n   * top: \"30px\";\n   * right: \"30px\";\n   * z-index: 999;\n   * ```\n   *\n   * Setting styles directly on the component is useful to customize the component's\n   * position and layout. Setting `height` is effectively a no-op, as `height`\n   * will be dynamically set by the component as toast items are added and removed.\n   */\n  style?: CSSProperties;\n\n  /** Theme object used to render the component when light mode is used. */\n  lightTheme?: CourierToastTheme;\n\n  /** Theme object used to render the component when dark mode is used. */\n  darkTheme?: CourierToastTheme;\n\n  /** Manually set the theme mode to one of \"light\", \"dark\", or \"system\". Defaults to \"system\". */\n  mode?: CourierComponentThemeMode;\n\n  /** Enable toasts to auto-dismiss, including a timer bar at the top of the toast. Defaults to false. */\n  autoDismiss?: boolean;\n\n  /**\n   * The timeout before a toast auto-dismisses, if {@link CourierToastProps.autoDismiss} is enabled.\n   * Defaults to 5000ms.\n   */\n  autoDismissTimeoutMs?: number;\n\n  /**\n   * Set the dismiss button's visibility.\n   *\n   * Defaults to \"auto\", which makes the button always visible if `autoDismiss` is false\n   * and visible on hover if `autoDismiss` is true.\n   */\n  dismissButton?: CourierToastDismissButtonOption;\n\n  /** Callback function invoked when a toast item is clicked. */\n  onToastItemClick?: (props: CourierToastItemClickEvent) => void;\n\n  /** Callback function invoked when a toast item action button is clicked. */\n  onToastItemActionClick?: (props: CourierToastItemActionClickEvent) => void;\n\n  /**\n   * Callback function invoked when the component is ready to receive messages.\n   *\n   * Use onReady to ensure CourierToast has applied event listeners and\n   * render props passed to the component before toasts are presented.\n   *\n   * @example\n   * ```tsx\n   * const [toastReady, setToastReady] = useState(false);\n   * const courier = useCourier();\n   *\n   * useEffect(() => {\n   *   if (toastReady) {\n   *     courier.shared.signIn({ userId, jwt });\n   *   }\n   * }, [toastReady]);\n   *\n   * return <CourierToast onReady={setToastReady} renderToastItem={myCustomItem} />\n   * ```\n   */\n  onReady?: (ready: boolean) => void;\n\n  /** Render prop specifying how to render an entire toast item. */\n  renderToastItem?: (props: CourierToastItemFactoryProps) => ReactNode;\n\n  /**\n   * Render prop specifying how to render a toast item's content.\n   *\n   * The toast item's container, including the stack, auto-dismiss timer, and dismiss button\n   * are still present when this prop is set.\n   *\n   * This callback is stabilized internally, so wrapping it in `useCallback` is optional.\n   * Memoizing in parent components can still reduce parent re-renders.\n   *\n   * See {@link CourierToastProps.dismissButton} to customize the dismiss button's visibility and\n   * {@link CourierToastProps.renderToastItem} to customize the entire toast item, including\n   * its container.\n   */\n  renderToastItemContent?: (props: CourierToastItemFactoryProps) => ReactNode;\n}\n\ntype SetupSteps = {\n  elementMounted: boolean;\n  onItemClickSet: boolean;\n  onItemActionClickSet: boolean;\n  renderToastItemSet: boolean;\n  renderToastItemContentSet: boolean;\n};\n\nexport const CourierToastComponent = forwardRef<CourierToastElement, CourierToastProps>((props, ref) => {\n  const render = useContext(CourierRenderContext);\n  if (!render) {\n    throw new Error(\"RenderContext not found. Ensure CourierToast is wrapped in a CourierRenderContext.\");\n  }\n\n  // Track ready state for each of the useEffects that is called for a prop set on CourierToastComponent\n  // which must be translated into an imperative call on <courier-toast>.\n  // When all the steps are complete, props.onReady is called to indicate the component is ready to receive toasts.\n  const [setupSteps, setSetupSteps] = useState<SetupSteps>({\n    elementMounted: false,\n    onItemClickSet: false,\n    onItemActionClickSet: false,\n    renderToastItemSet: false,\n    renderToastItemContentSet: false\n  });\n  const [elementReady, setElementReady] = useState(false);\n\n  // Element ref for use in effects, updated by handleRef.\n  const toastRef = useRef<CourierToastElement | null>(null);\n  const isMountedRef = useRef(false);\n  const onReadyCalledRef = useRef(false);\n  const renderToastItemRef = useRef<CourierToastProps[\"renderToastItem\"]>(props.renderToastItem);\n  const renderToastItemContentRef = useRef<CourierToastProps[\"renderToastItemContent\"]>(props.renderToastItemContent);\n\n  if (props.renderToastItem) {\n    renderToastItemRef.current = props.renderToastItem;\n  }\n\n  if (props.renderToastItemContent) {\n    renderToastItemContentRef.current = props.renderToastItemContent;\n  }\n\n  const hasRenderToastItem = !!props.renderToastItem;\n  const hasRenderToastItemContent = !!props.renderToastItemContent;\n\n  const markSetupStepComplete = useCallback((step: keyof SetupSteps) => {\n    setSetupSteps(prev => {\n      if (prev[step]) {\n        return prev;\n      }\n\n      return {\n        ...prev,\n        [step]: true,\n      } as SetupSteps;\n    });\n  }, []);\n\n  useEffect(() => {\n    isMountedRef.current = true;\n\n    return () => {\n      isMountedRef.current = false;\n    };\n  }, []);\n\n  // Callback ref passed to rendered component, used to propagate the DOM element's ref to the parent component.\n  // We use a callback ref (rather than a React.RefObject) since we want the parent ref to be up-to-date with\n  // rendered component. Updating the parent ref via useEffect does not work, since mutating a RefObject\n  // does not trigger useEffect (see https://stackoverflow.com/a/60476525).\n  function handleRef(el: CourierToastElement | null) {\n    if (ref) {\n\n      // Propagate ref to ref callback functions\n      if (typeof ref === 'function') {\n        ref(el);\n      } else {\n        // Propagate ref to ref objects\n        // @ts-ignore - RefObject.current is readonly in React 17, however it's not frozen and is equivalent the widened type MutableRefObject\n        (ref as React.RefObject<CourierToastElement | null>).current = el;\n      }\n    }\n\n    // Store the element for use in effects\n    toastRef.current = el;\n\n    // Update element ready state\n    setElementReady(!!el);\n  }\n\n  // Helper to get the current element\n  function getEl(): CourierToastElement | null {\n    return toastRef.current;\n  }\n\n  // Check if all setup steps are complete and fire onReady\n  useEffect(() => {\n    const allStepsComplete = Object.values(setupSteps).every(step => step);\n    if (allStepsComplete && props.onReady && !onReadyCalledRef.current) {\n      onReadyCalledRef.current = true;\n      props.onReady(true);\n    }\n  }, [setupSteps, props.onReady]);\n\n  // Track when element is mounted\n  useEffect(() => {\n    if (elementReady) {\n      markSetupStepComplete(\"elementMounted\");\n    }\n  }, [elementReady, markSetupStepComplete]);\n\n  // Handle toast item click\n  useEffect(() => {\n    if (!elementReady) return;\n    const toast = getEl();\n    if (!toast) return;\n    toast.onToastItemClick(props.onToastItemClick);\n    markSetupStepComplete(\"onItemClickSet\");\n  }, [props.onToastItemClick, elementReady, markSetupStepComplete]);\n\n  // Handle toast item action click\n  useEffect(() => {\n    if (!elementReady) return;\n    const toast = getEl();\n    if (!toast) return;\n    toast.onToastItemActionClick(props.onToastItemActionClick);\n    markSetupStepComplete(\"onItemActionClickSet\");\n  }, [props.onToastItemActionClick, elementReady, markSetupStepComplete]);\n\n  // Render toast item\n  useEffect(() => {\n    if (!elementReady) return;\n    const toast = getEl();\n    if (!toast) return;\n\n    if (!hasRenderToastItem) {\n      toast.setToastItem();\n      markSetupStepComplete(\"renderToastItemSet\");\n      return;\n    }\n\n    let cancelled = false;\n    queueMicrotask(() => {\n      if (cancelled || !isMountedRef.current) {\n        return;\n      }\n\n      const currentToast = getEl();\n      if (!currentToast || !currentToast.isConnected) {\n        return;\n      }\n\n      currentToast.setToastItem((itemProps: CourierToastItemFactoryProps): HTMLElement => {\n        const renderToastItem = renderToastItemRef.current;\n        if (!renderToastItem) {\n          return document.createElement(\"div\");\n        }\n\n        const reactNode = renderToastItem(itemProps);\n        return render(reactNode);\n      });\n      markSetupStepComplete(\"renderToastItemSet\");\n    });\n\n    return () => {\n      cancelled = true;\n    };\n  }, [elementReady, hasRenderToastItem, markSetupStepComplete, render]);\n\n  // Render toast item content\n  useEffect(() => {\n    if (!elementReady) return;\n    const toast = getEl();\n    if (!toast) return;\n\n    if (!hasRenderToastItemContent) {\n      toast.setToastItemContent();\n      markSetupStepComplete(\"renderToastItemContentSet\");\n      return;\n    }\n\n    let cancelled = false;\n    queueMicrotask(() => {\n      if (cancelled || !isMountedRef.current) {\n        return;\n      }\n\n      const currentToast = getEl();\n      if (!currentToast || !currentToast.isConnected) {\n        return;\n      }\n\n      currentToast.setToastItemContent((itemProps: CourierToastItemFactoryProps): HTMLElement => {\n        const renderToastItemContent = renderToastItemContentRef.current;\n        if (!renderToastItemContent) {\n          return document.createElement(\"div\");\n        }\n\n        const reactNode = renderToastItemContent(itemProps);\n        return render(reactNode);\n      });\n      markSetupStepComplete(\"renderToastItemContentSet\");\n    });\n\n    return () => {\n      cancelled = true;\n    };\n  }, [elementReady, hasRenderToastItemContent, markSetupStepComplete, render]);\n\n  const children = (\n    /* @ts-ignore */\n    <courier-toast\n      ref={handleRef}\n      style={props.style}\n      light-theme={props.lightTheme ? JSON.stringify(props.lightTheme) : undefined}\n      dark-theme={props.darkTheme ? JSON.stringify(props.darkTheme) : undefined}\n      mode={props.mode}\n      auto-dismiss={props.autoDismiss}\n      auto-dismiss-timeout-ms={props.autoDismissTimeoutMs}\n      dismiss-button={props.dismissButton}\n    />\n  );\n\n  return (\n    <CourierClientComponent children={children} />\n  );\n});\n","import { useRef, useEffect, useState, forwardRef, CSSProperties } from \"react\";\nimport {\n  CourierPreferencesTheme,\n  CourierPreferences as CourierPreferencesElement,\n} from \"@trycourier/courier-ui-preferences\";\nimport { CourierComponentThemeMode } from \"@trycourier/courier-ui-core\";\nimport { CourierPreferencePage } from \"@trycourier/courier-js\";\nimport { CourierClientComponent } from \"./courier-client-component\";\n\n/** Props for the CourierPreferences React component. */\nexport interface CourierPreferencesProps {\n  style?: CSSProperties;\n  lightTheme?: CourierPreferencesTheme;\n  darkTheme?: CourierPreferencesTheme;\n  mode?: CourierComponentThemeMode;\n  title?: string;\n  subtitle?: string;\n  brandId?: string;\n  channelLabels?: Record<string, string>;\n  /**\n   * Render injected \"dummy\" preference data instead of fetching from the API.\n   * Pass a full `CourierPreferencePage`; no sign-in / network is required.\n   */\n  previewData?: CourierPreferencePage;\n  /**\n   * Force the component's loading skeleton on/off. Useful while the host fetches\n   * data it will inject via `previewData` (e.g. a brand) and wants the\n   * component's own loading state shown in the meantime.\n   */\n  isLoading?: boolean;\n  /**\n   * Render the unpublished working draft instead of the published page (fetches\n   * `draftPreferencePage`). Used by the hosted draft preview.\n   */\n  draft?: boolean;\n  onError?: (error: Error) => void;\n}\n\nexport const CourierPreferencesComponent = forwardRef<CourierPreferencesElement, CourierPreferencesProps>((props, ref) => {\n  const elRef = useRef<CourierPreferencesElement | null>(null);\n  // The element renders behind CourierClientComponent (client-only), so it can\n  // mount AFTER these effects first run. Track readiness and include it in the\n  // deps so imperative setters fire once the element exists.\n  const [elementReady, setElementReady] = useState(false);\n\n  function handleRef(el: CourierPreferencesElement | null) {\n    if (ref) {\n      if (typeof ref === 'function') {\n        ref(el);\n      } else {\n        // @ts-ignore\n        (ref as React.RefObject<CourierPreferencesElement | null>).current = el;\n      }\n    }\n    elRef.current = el;\n    setElementReady(!!el);\n  }\n\n  useEffect(() => {\n    const el = elRef.current;\n    if (!el) return;\n    if (props.channelLabels) {\n      el.setChannelLabels(props.channelLabels);\n    }\n  }, [props.channelLabels, elementReady]);\n\n  useEffect(() => {\n    const el = elRef.current;\n    if (!el) return;\n    el.setPreviewData(props.previewData ?? null);\n  }, [props.previewData, elementReady]);\n\n  useEffect(() => {\n    const el = elRef.current;\n    if (!el) return;\n    el.setLoading(Boolean(props.isLoading));\n  }, [props.isLoading, elementReady]);\n\n  // When themes change, the web component's setDarkTheme/setLightTheme only calls\n  // updateTheme() when _systemMode matches — it ignores an explicit _userMode override.\n  // Re-calling setMode() always triggers updateTheme(), picking up the new theme values.\n  useEffect(() => {\n    const el = elRef.current;\n    if (!el || !props.mode) return;\n    el.setMode(props.mode);\n  }, [props.lightTheme, props.darkTheme, props.mode, elementReady]);\n\n  const children = (\n    /* @ts-ignore */\n    <courier-preferences\n      ref={handleRef}\n      style={props.style}\n      light-theme={props.lightTheme ? JSON.stringify(props.lightTheme) : undefined}\n      dark-theme={props.darkTheme ? JSON.stringify(props.darkTheme) : undefined}\n      mode={props.mode}\n      title={props.title}\n      subtitle={props.subtitle}\n      brand-id={props.brandId}\n      preview={props.previewData ? \"true\" : undefined}\n      draft={props.draft ? \"true\" : undefined}\n    />\n  );\n\n  return (\n    <CourierClientComponent children={children} />\n  );\n});\n\nCourierPreferencesComponent.displayName = 'CourierPreferencesComponent';\n","import React from 'react';\nimport { Courier, CourierProps, InboxMessage, CourierUserPreferences, CourierUserPreferencesStatus, CourierUserPreferencesChannel, CourierUserPreferencesTopic, CourierDigestScheduleOption } from '@trycourier/courier-js';\nimport { CourierInboxDatastore, CourierInboxDataStoreListener, InboxDataSet, CourierInboxFeed } from '@trycourier/courier-ui-inbox';\nimport { CourierToastDatastore, CourierToastDatastoreListener } from '@trycourier/courier-ui-toast';\n\ntype AuthenticationHooks = {\n  userId?: string,\n  signIn: (props: CourierProps) => void,\n  signOut: () => void\n}\n\ntype InboxHooks = {\n  load: (props?: { canUseCache: boolean }) => Promise<void>,\n  fetchNextPageOfMessages: (props: { datasetId: string }) => Promise<InboxDataSet | null>,\n  setPaginationLimit: (limit: number) => void,\n  readMessage: (message: InboxMessage) => Promise<void>,\n  unreadMessage: (message: InboxMessage) => Promise<void>,\n  clickMessage: (message: InboxMessage) => Promise<void>,\n  archiveMessage: (message: InboxMessage) => Promise<void>,\n  openMessage: (message: InboxMessage) => void,\n  unarchiveMessage: (message: InboxMessage) => Promise<void>,\n  readAllMessages: () => Promise<void>,\n  registerFeeds: (feeds: CourierInboxFeed[]) => void,\n  listenForUpdates: () => Promise<void>,\n  feeds: Record<string, InboxDataSet>,\n  totalUnreadCount?: number,\n  error?: Error\n}\n\ntype ToastHooks = {\n  addMessage: (message: InboxMessage) => void;\n  removeMessage: (message: InboxMessage) => void;\n  error?: Error,\n}\n\ntype PreferencesHooks = {\n  getUserPreferences: (props?: { paginationCursor?: string }) => Promise<CourierUserPreferences>;\n  getUserPreferenceTopic: (props: { topicId: string }) => Promise<CourierUserPreferencesTopic>;\n  putUserPreferenceTopic: (props: {\n    topicId: string;\n    status: CourierUserPreferencesStatus;\n    hasCustomRouting: boolean;\n    customRouting: CourierUserPreferencesChannel[];\n    digestSchedule?: string;\n  }) => Promise<CourierUserPreferencesTopic>;\n  getDigestSchedules: (props: { topicId: string }) => Promise<CourierDigestScheduleOption[]>;\n  getNotificationCenterUrl: (props: { clientKey: string }) => string;\n}\n\n// A hook for managing the shared state of Courier\n// If you want to use more functions, checkout the Courier JS SDK which\n// can be used directly by importing from '@trycourier/courier-js'\nexport const useCourier = () => {\n\n  // Authentication Functions\n  const signIn = (props: CourierProps) => Courier.shared.signIn(props);\n  const signOut = () => Courier.shared.signOut();\n\n  // Inbox Functions\n  const loadInbox = (props?: { canUseCache: boolean }) => CourierInboxDatastore.shared.load(props);\n  const fetchNextPageOfMessages = (props: { datasetId: string }) => CourierInboxDatastore.shared.fetchNextPageOfMessages(props);\n  const setPaginationLimit = (limit: number) => Courier.shared.paginationLimit = limit;\n  const readMessage = (message: InboxMessage) => CourierInboxDatastore.shared.readMessage({ message });\n  const unreadMessage = (message: InboxMessage) => CourierInboxDatastore.shared.unreadMessage({ message });\n  const clickMessage = (message: InboxMessage) => CourierInboxDatastore.shared.clickMessage({ message });\n  const archiveMessage = (message: InboxMessage) => CourierInboxDatastore.shared.archiveMessage({ message });\n  const openMessage = (message: InboxMessage) => CourierInboxDatastore.shared.openMessage({ message });\n  const unarchiveMessage = (message: InboxMessage) => CourierInboxDatastore.shared.unarchiveMessage({ message });\n  const readAllMessages = () => CourierInboxDatastore.shared.readAllMessages();\n  const registerFeeds = (feeds: CourierInboxFeed[]) => CourierInboxDatastore.shared.registerFeeds(feeds);\n  const listenForUpdates = () => CourierInboxDatastore.shared.listenForUpdates();\n\n  // State\n  const [auth, setAuth] = React.useState<AuthenticationHooks>({\n    userId: undefined,\n    signIn,\n    signOut\n  });\n\n  const [inbox, setInbox] = React.useState<InboxHooks>({\n    load: loadInbox,\n    fetchNextPageOfMessages,\n    setPaginationLimit,\n    readMessage,\n    unreadMessage,\n    clickMessage,\n    archiveMessage,\n    openMessage,\n    unarchiveMessage,\n    readAllMessages,\n    registerFeeds,\n    listenForUpdates,\n    feeds: {}\n  });\n\n  const addToastMessage = (message: InboxMessage) => CourierToastDatastore.shared.addMessage(message);\n  const removeToastMessage = (message: InboxMessage) => CourierToastDatastore.shared.removeMessage(message);\n\n  const [toast, setToast] = React.useState<ToastHooks>({\n    addMessage: addToastMessage,\n    removeMessage: removeToastMessage,\n  });\n\n  const getUserPreferences = (props?: { paginationCursor?: string }) => Courier.shared.client!.preferences.getUserPreferences(props);\n  const getUserPreferenceTopic = (props: { topicId: string }) => Courier.shared.client!.preferences.getUserPreferenceTopic(props);\n  const putUserPreferenceTopic = (props: { topicId: string; status: CourierUserPreferencesStatus; hasCustomRouting: boolean; customRouting: CourierUserPreferencesChannel[]; digestSchedule?: string }) => Courier.shared.client!.preferences.putUserPreferenceTopic(props);\n  const getDigestSchedules = (props: { topicId: string }) => Courier.shared.client!.preferences.getDigestSchedules(props);\n  const getNotificationCenterUrl = (props: { clientKey: string }) => Courier.shared.client!.preferences.getNotificationCenterUrl(props);\n\n  const preferences: PreferencesHooks = {\n    getUserPreferences,\n    getUserPreferenceTopic,\n    putUserPreferenceTopic,\n    getDigestSchedules,\n    getNotificationCenterUrl,\n  };\n\n  React.useEffect(() => {\n\n    // Add a listener to the Courier instance\n    const listener = Courier.shared.addAuthenticationListener(() => refreshAuth());\n\n    // Add inbox data store listener\n    const inboxListener = new CourierInboxDataStoreListener({\n      onError: (error: Error) => refreshInbox(error),\n      onDataSetChange: () => refreshInbox(),\n      onPageAdded: () => refreshInbox(),\n      onMessageAdd: () => refreshInbox(),\n      onMessageRemove: () => refreshInbox(),\n      onMessageUpdate: () => refreshInbox(),\n      onUnreadCountChange: () => refreshInbox(),\n      onTotalUnreadCountChange: () => refreshInbox()\n    });\n    CourierInboxDatastore.shared.addDataStoreListener(inboxListener);\n\n    const toastListener = new CourierToastDatastoreListener({\n      onMessageAdd: () => refreshToast(),\n      onMessageRemove: () => refreshToast(),\n      onError: (error: Error) => refreshToast(error),\n    });\n    CourierToastDatastore.shared.addDatastoreListener(toastListener);\n\n    // Set initial values\n    refreshAuth();\n    refreshInbox();\n    refreshToast();\n\n    // Remove listeners when the component unmounts\n    return () => {\n      listener.remove();\n      inboxListener.remove();\n      toastListener.remove();\n    };\n  }, []);\n\n  const refreshAuth = () => {\n    const options = Courier.shared.client?.options;\n    setAuth({\n      userId: options?.userId,\n      signIn,\n      signOut\n    });\n  }\n\n  const refreshInbox = (error?: Error) => {\n    const datastore = CourierInboxDatastore.shared;\n    const allDatasets = datastore.getDatasets();\n    setInbox({\n      load: loadInbox,\n      fetchNextPageOfMessages,\n      setPaginationLimit,\n      readMessage,\n      unreadMessage,\n      clickMessage,\n      archiveMessage,\n      openMessage,\n      unarchiveMessage,\n      readAllMessages,\n      registerFeeds,\n      listenForUpdates,\n      feeds: allDatasets,\n      totalUnreadCount: datastore.totalUnreadCount,\n      error: error,\n    });\n  }\n\n  const refreshToast = (error?: Error) => {\n    setToast({\n      addMessage: addToastMessage,\n      removeMessage: removeToastMessage,\n      error,\n    });\n  };\n\n  return {\n    shared: Courier.shared,\n    auth: auth,\n    inbox: inbox,\n    toast: toast,\n    preferences: preferences,\n  };\n};\n"],"names":["CourierClientComponent","children","isMounted","setIsMounted","useState","useEffect","window","CourierRenderContext","createContext","CourierInboxComponent","forwardRef","props","ref","render","useContext","Error","inboxRef","useRef","elementReady","setElementReady","getEl","current","inbox","onMessageClick","onMessageActionClick","onMessageLongPress","setPreviewData","previewMessages","unreadCount","previewUnreadCount","renderHeader","queueMicrotask","setHeader","headerProps","reactNode","renderListItem","setListItem","itemProps","renderEmptyState","setEmptyState","emptyStateProps","renderLoadingState","setLoadingState","loadingStateProps","renderErrorState","setErrorState","errorStateProps","renderPaginationItem","setPaginationItem","paginationProps","feedsAttr","useMemo","feeds","JSON","stringify","jsx","el","height","lightTheme","darkTheme","mode","preview","CourierInboxPopupMenuComponent","menu","renderMenuButton","setMenuButton","buttonProps","popupAlignment","popupWidth","popupHeight","left","top","right","bottom","CourierToastComponent","setupSteps","setSetupSteps","elementMounted","onItemClickSet","onItemActionClickSet","renderToastItemSet","renderToastItemContentSet","toastRef","isMountedRef","onReadyCalledRef","renderToastItemRef","renderToastItem","renderToastItemContentRef","renderToastItemContent","hasRenderToastItem","hasRenderToastItemContent","markSetupStepComplete","useCallback","step","prev","Object","values","every","onReady","toast","onToastItemClick","onToastItemActionClick","setToastItem","cancelled","currentToast","isConnected","document","createElement","setToastItemContent","style","autoDismiss","autoDismissTimeoutMs","dismissButton","CourierPreferencesComponent","elRef","channelLabels","setChannelLabels","previewData","setLoading","Boolean","isLoading","setMode","title","subtitle","brandId","draft","displayName","signIn","Courier","shared","signOut","loadInbox","CourierInboxDatastore","load","fetchNextPageOfMessages","setPaginationLimit","limit","paginationLimit","readMessage","message","unreadMessage","clickMessage","archiveMessage","openMessage","unarchiveMessage","readAllMessages","registerFeeds","listenForUpdates","auth","setAuth","React","userId","setInbox","addToastMessage","CourierToastDatastore","addMessage","removeToastMessage","removeMessage","setToast","preferences","getUserPreferences","client","getUserPreferenceTopic","putUserPreferenceTopic","getDigestSchedules","getNotificationCenterUrl","listener","addAuthenticationListener","refreshAuth","inboxListener","CourierInboxDataStoreListener","onError","error","refreshInbox","onDataSetChange","onPageAdded","onMessageAdd","onMessageRemove","onMessageUpdate","onUnreadCountChange","onTotalUnreadCountChange","addDataStoreListener","toastListener","CourierToastDatastoreListener","refreshToast","addDatastoreListener","remove","options","datastore","allDatasets","getDatasets","totalUnreadCount"],"mappings":"oTASaA,EAAuD,EAAGC,eACrE,MAAOC,EAAWC,GAAgBC,EAAAA,UAAS,GAO3C,OALAC,EAAAA,WAAU,KACRF,GAAa,EAAI,GAChB,IAGmB,oBAAXG,OACF,KAGJJ,oBAIKD,aAHD,IAGU,ECHRM,EAAuBC,EAAAA,cAA+B,MCyCtDC,EAAwBC,EAAAA,YAAmD,CAACC,EAAOC,KAC9F,MAAMC,EAASC,E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