@prismicio/react 2.0.5 → 2.0.6-debug.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -0
- package/package.json +3 -5
- package/src/SliceZone.tsx +1 -2
- package/src/lib/pascalCase.ts +68 -1
- package/dist/index.mjs +0 -429
- package/dist/index.mjs.map +0 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/PrismicProvider.tsx","../src/usePrismicContext.ts","../src/lib/__PRODUCTION__.ts","../src/lib/invariant.ts","../src/usePrismicClient.ts","../src/lib/isInternalURL.ts","../src/PrismicLink.tsx","../src/PrismicText.tsx","../src/PrismicRichText.tsx","../src/lib/pascalCase.ts","../src/SliceZone.tsx","../src/PrismicToolbar.tsx","../src/useStatefulPrismicClientMethod.ts","../src/usePrismicPreviewResolver.ts","../src/clientHooks.ts","../src/index.ts"],"sourcesContent":["import type * as prismic from \"@prismicio/client\";\n\nimport * as React from \"react\";\nimport * as prismicH from \"@prismicio/helpers\";\n\nimport { LinkProps } from \"./PrismicLink\";\nimport { JSXFunctionSerializer, JSXMapSerializer } from \"./types\";\n\n/**\n * React context value containing shared configuration for `@prismicio/react`\n * components and hooks.\n */\nexport type PrismicContextValue = {\n\t/**\n\t * A `@prismicio/client` instance used to fetch content from a Prismic\n\t * repository. This is used by `@prismicio/react` hooks, such as\n\t * `usePrismicDocuments()`.\n\t */\n\tclient?: prismic.Client;\n\n\t/**\n\t * A Link Resolver used to resolve links for `<PrismicLink>` and `<PrismicRichText>`.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: prismicH.LinkResolverFunction;\n\n\t/**\n\t * A map or function that maps a Rich Text block to a React component.\n\t *\n\t * @remarks\n\t * Prefer using a map serializer over the function serializer when possible.\n\t * The map serializer is simpler to maintain.\n\t * @example A map serializer.\n\t *\n\t * ```jsx\n\t * {\n\t * heading1: ({children}) => <Heading>{children}</Heading>\n\t * }\n\t * ```\n\t *\n\t * @example A function serializer.\n\t *\n\t * ```jsx\n\t * (type, node, content, children) => {\n\t * \tswitch (type) {\n\t * \t\tcase \"heading1\": {\n\t * \t\t\treturn <Heading>{chidlren}</Heading>;\n\t * \t\t}\n\t * \t}\n\t * };\n\t * ```\n\t */\n\trichTextComponents?: JSXMapSerializer | JSXFunctionSerializer;\n\n\t/**\n\t * The component rendered by `<PrismicLink>` for internal URLs. Defaults to `<a>`.\n\t */\n\tinternalLinkComponent?: React.ElementType<LinkProps>;\n\n\t/**\n\t * The component rendered by `<PrismicLink>` for external URLs. Defaults to `<a>`.\n\t */\n\texternalLinkComponent?: React.ElementType<LinkProps>;\n\n\t/**\n\t * Children for the component.\n\t */\n\tchildren?: React.ReactNode;\n};\n\n/**\n * React context containing shared configuration for `@prismicio/react`\n * components and hooks.\n */\nexport const PrismicContext = React.createContext<PrismicContextValue>({});\n\n/**\n * Props for `<PrismicProvider>`.\n */\nexport type PrismicProviderProps = PrismicContextValue;\n\n/**\n * React context provider to share configuration for `@prismicio/react`\n * components and hooks.\n *\n * @returns A React context provider with shared configuration.\n */\nexport const PrismicProvider = ({\n\tclient,\n\tlinkResolver,\n\trichTextComponents,\n\tinternalLinkComponent,\n\texternalLinkComponent,\n\tchildren,\n}: PrismicProviderProps): JSX.Element => {\n\tconst value = React.useMemo<PrismicContextValue>(\n\t\t() => ({\n\t\t\tclient,\n\t\t\tlinkResolver,\n\t\t\trichTextComponents,\n\t\t\tinternalLinkComponent,\n\t\t\texternalLinkComponent,\n\t\t}),\n\t\t[\n\t\t\tclient,\n\t\t\tlinkResolver,\n\t\t\trichTextComponents,\n\t\t\tinternalLinkComponent,\n\t\t\texternalLinkComponent,\n\t\t],\n\t);\n\n\treturn (\n\t\t<PrismicContext.Provider value={value}>{children}</PrismicContext.Provider>\n\t);\n};\n","import * as React from \"react\";\n\nimport { PrismicContext, PrismicContextValue } from \"./PrismicProvider\";\n\n/**\n * React hook used to read shared configuration for `@prismicio/react`\n * components and hooks.\n *\n * @returns The closest `<PrismicProvider>` context value.\n */\nexport const usePrismicContext = (): PrismicContextValue => {\n\treturn React.useContext(PrismicContext) || {};\n};\n","// We need to polyfill process if it doesn't exist, such as in the browser.\nif (typeof process === \"undefined\") {\n\tglobalThis.process = { env: {} } as typeof process;\n}\n\n/**\n * `true` if in the production environment, `false` otherwise.\n *\n * This boolean can be used to perform actions only in development environments,\n * such as logging.\n */\nexport const __PRODUCTION__ = process.env.NODE_ENV === \"production\";\n","/**\n * MIT License\n *\n * Copyright (c) 2019 Alexander Reardon\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { __PRODUCTION__ } from \"./__PRODUCTION__\";\n\nconst prefix = \"Invariant failed\";\n\n// Throw an error if the condition fails\n// Strip out error messages for production\n// > Not providing an inline default argument for message as the result is smaller\nexport function invariant(\n\tcondition: unknown,\n\tmessage?: string,\n): asserts condition {\n\tif (condition) {\n\t\treturn;\n\t}\n\t// Condition not passed\n\n\t// In production we strip the message but still throw\n\tif (__PRODUCTION__) {\n\t\tthrow new Error(prefix);\n\t}\n\n\t// When not in production we allow the message to pass through\n\t// *This block will be removed in production builds*\n\tthrow new Error(`${prefix}: ${message || \"\"}`);\n}\n","import type * as prismic from \"@prismicio/client\";\n\nimport { invariant } from \"./lib/invariant\";\n\nimport { usePrismicContext } from \"./usePrismicContext\";\n\n/**\n * Retrieve the `@prismicio/client` instance provided to `<PrismicProvider>`\n * higher in the React tree.\n *\n * @param explicitClient - An optional `@prismicio/client` instance to override\n * the Client provided to `<PrismicProvider>`.\n *\n * @returns The `@prismicio/client` instance provided to `<PrismicProvider>`.\n */\nexport const usePrismicClient = (\n\texplicitClient?: prismic.Client,\n): prismic.Client => {\n\tconst context = usePrismicContext();\n\n\tconst client = explicitClient || context?.client;\n\tinvariant(\n\t\tclient,\n\t\t\"A @prismicio/client is required to query documents. Provide a client to the hook or to a <PrismicProvider> higher in your component tree.\",\n\t);\n\n\treturn client;\n};\n","/**\n * Determines if a URL is internal or external.\n *\n * @param url - The URL to check if internal or external.\n *\n * @returns `true` if `url` is internal, `false` otherwise.\n */\n// TODO: This does not detect all relative URLs as internal such as `about` or `./about`. This function assumes relative URLs start with a \"/\" or \"#\"`.\nexport const isInternalURL = (url: string): boolean => {\n\tconst isInternal = /^(\\/(?!\\/)|#)/.test(url);\n\tconst isSpecialLink = !isInternal && !/^https?:\\/\\//.test(url);\n\n\treturn isInternal && !isSpecialLink;\n};\n","import * as React from \"react\";\nimport * as prismicH from \"@prismicio/helpers\";\nimport * as prismicT from \"@prismicio/types\";\n\nimport { isInternalURL } from \"./lib/isInternalURL\";\n\nimport { usePrismicContext } from \"./usePrismicContext\";\n\n/**\n * Props provided to a component when rendered with `<PrismicLink>`.\n */\nexport interface LinkProps {\n\t/**\n\t * The URL to link.\n\t */\n\thref: string;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: string;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Props for `<PrismicLink>`.\n */\nexport type PrismicLinkProps<\n\tInternalComponent extends React.ElementType<LinkProps> = React.ElementType<LinkProps>,\n\tExternalComponent extends React.ElementType<LinkProps> = React.ElementType<LinkProps>,\n\tLinkResolverFunction extends prismicH.LinkResolverFunction = prismicH.LinkResolverFunction,\n> = Omit<\n\tReact.ComponentProps<InternalComponent> &\n\t\tReact.ComponentProps<ExternalComponent>,\n\tkeyof LinkProps\n> & {\n\t/**\n\t * The Link Resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * The component rendered for internal URLs. Defaults to `<a>`.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t */\n\tinternalComponent?: InternalComponent;\n\n\t/**\n\t * The component rendered for external URLs. Defaults to `<a>`.\n\t */\n\texternalComponent?: ExternalComponent;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: string | null;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string | null;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n} & (\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The Prismic Link field containing the URL or document to link.\n\t\t\t\t *\n\t\t\t\t * @see Learn about Prismic Link fields {@link https://prismic.io/docs/core-concepts/link-content-relationship}\n\t\t\t\t */\n\t\t\t\tfield: prismicT.LinkField | null | undefined;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The Prismic document to link.\n\t\t\t\t */\n\t\t\t\tdocument: prismicT.PrismicDocument | null | undefined;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The URL to link.\n\t\t\t\t */\n\t\t\t\thref: string | null | undefined;\n\t\t }\n\t);\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"a\";\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\";\n\n/**\n * React component that renders a link from a Prismic Link field.\n *\n * Different components can be rendered depending on whether the link is\n * internal or external. This is helpful when integrating with client-side\n * routers, such as a router-specific Link component.\n *\n * If a link is configured to open in a new window using `target=\"_blank\"`,\n * `rel=\"noopener noreferrer\"` is set by default.\n *\n * @param props - Props for the component.\n *\n * @returns The internal or external link component depending on whether the\n * link is internal or external.\n */\nexport const PrismicLink = <\n\tInternalComponent extends React.ElementType<LinkProps> = typeof defaultInternalComponent,\n\tExternalComponent extends React.ElementType<LinkProps> = typeof defaultExternalComponent,\n\tLinkResolverFunction extends prismicH.LinkResolverFunction = prismicH.LinkResolverFunction,\n>(\n\tprops: PrismicLinkProps<\n\t\tInternalComponent,\n\t\tExternalComponent,\n\t\tLinkResolverFunction\n\t>,\n): JSX.Element | null => {\n\tconst context = usePrismicContext();\n\n\tconst linkResolver = props.linkResolver || context.linkResolver;\n\n\tlet href: string | null | undefined;\n\tif (\"href\" in props) {\n\t\thref = props.href;\n\t} else if (\"document\" in props && props.document) {\n\t\thref = prismicH.asLink(props.document, linkResolver);\n\t} else if (\"field\" in props && props.field) {\n\t\thref = prismicH.asLink(props.field, linkResolver);\n\t}\n\n\tconst target =\n\t\tprops.target ||\n\t\t(\"field\" in props &&\n\t\t\tprops.field &&\n\t\t\t\"target\" in props.field &&\n\t\t\tprops.field.target) ||\n\t\tundefined;\n\n\tconst rel =\n\t\tprops.rel || (target === \"_blank\" ? \"noopener noreferrer\" : undefined);\n\n\tconst InternalComponent: React.ElementType<LinkProps> =\n\t\tprops.internalComponent ||\n\t\tcontext.internalLinkComponent ||\n\t\tdefaultInternalComponent;\n\n\tconst ExternalComponent: React.ElementType<LinkProps> =\n\t\tprops.externalComponent ||\n\t\tcontext.externalLinkComponent ||\n\t\tdefaultExternalComponent;\n\n\tconst isInternal = href && isInternalURL(href);\n\n\tconst Component = isInternal ? InternalComponent : ExternalComponent;\n\n\tconst passthroughProps: typeof props = Object.assign({}, props);\n\tdelete passthroughProps.linkResolver;\n\tdelete passthroughProps.internalComponent;\n\tdelete passthroughProps.externalComponent;\n\tdelete passthroughProps.rel;\n\tdelete passthroughProps.target;\n\tif (\"field\" in passthroughProps) {\n\t\tdelete passthroughProps.field;\n\t} else if (\"document\" in passthroughProps) {\n\t\tdelete passthroughProps.document;\n\t} else if (\"href\" in passthroughProps) {\n\t\tdelete passthroughProps.href;\n\t}\n\n\treturn href ? (\n\t\t<Component {...passthroughProps} href={href} target={target} rel={rel} />\n\t) : null;\n};\n","import * as React from \"react\";\nimport * as prismicT from \"@prismicio/types\";\nimport * as prismicH from \"@prismicio/helpers\";\n\n/**\n * Props for `<PrismicText>`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic Rich Text field to render.\n\t */\n\tfield: prismicT.RichTextField | null | undefined;\n\n\t/**\n\t * The separator used between blocks. Defaults to `\\n`.\n\t */\n\tseparator?: string;\n};\n\n/**\n * React component that renders content from a Prismic Rich Text field as plain text.\n *\n * @remarks\n * This component returns a React fragment with no wrapping element around the\n * content. If you need a wrapper, add a component around `<PrismicText>`.\n * @example Rendering a Rich Text field as plain text.\n *\n * ```jsx\n * <PrismicText field={document.data.content} />;\n * ```\n *\n * @param props - Props for the component.\n *\n * @returns The Rich Text field's content as plain text.\n *\n * @see Learn about Rich Text fields {@link https://prismic.io/docs/core-concepts/rich-text-title}\n */\nexport const PrismicText = (props: PrismicTextProps): JSX.Element | null => {\n\treturn React.useMemo(() => {\n\t\tif (props.field) {\n\t\t\tconst text = prismicH.asText(props.field, props.separator);\n\n\t\t\treturn <>{text}</>;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}, [props.field, props.separator]);\n};\n","/* eslint-disable react/display-name */\n/* eslint-disable react/prop-types */\n\nimport * as React from \"react\";\nimport * as prismicT from \"@prismicio/types\";\nimport * as prismicH from \"@prismicio/helpers\";\nimport * as prismicR from \"@prismicio/richtext\";\n\nimport { JSXFunctionSerializer, JSXMapSerializer } from \"./types\";\nimport { PrismicLink, PrismicLinkProps } from \"./PrismicLink\";\nimport { usePrismicContext } from \"./usePrismicContext\";\n\n/**\n * Props for `<PrismicRichText>`.\n */\nexport type PrismicRichTextProps = {\n\t/**\n\t * The Prismic Rich Text field to render.\n\t */\n\tfield: prismicT.RichTextField | null | undefined;\n\n\t/**\n\t * The Link Resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: PrismicLinkProps[\"linkResolver\"];\n\n\t/**\n\t * A function that maps a Rich Text block to a React component.\n\t *\n\t * @deprecated Use the `components` prop instead. Prefer using a map\n\t * serializer when possible.\n\t * @see Learn about Rich Text serializers {@link https://prismic.io/docs/core-concepts/html-serializer}\n\t */\n\thtmlSerializer?: JSXFunctionSerializer;\n\n\t/**\n\t * A map or function that maps a Rich Text block to a React component.\n\t *\n\t * @remarks\n\t * Prefer using a map serializer over the function serializer when possible.\n\t * The map serializer is simpler to maintain.\n\t * @example A map serializer.\n\t *\n\t * ```jsx\n\t * {\n\t * heading1: ({children}) => <Heading>{children}</Heading>\n\t * }\n\t * ```\n\t *\n\t * @example A function serializer.\n\t *\n\t * ```jsx\n\t * (type, node, content, children) => {\n\t * \tswitch (type) {\n\t * \t\tcase \"heading1\": {\n\t * \t\t\treturn <Heading>{chidlren}</Heading>;\n\t * \t\t}\n\t * \t}\n\t * };\n\t * ```\n\t */\n\tcomponents?: JSXMapSerializer | JSXFunctionSerializer;\n\n\t/**\n\t * The React component rendered for links when the URL is internal.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\tinternalLinkComponent?: PrismicLinkProps[\"internalComponent\"];\n\n\t/**\n\t * The React component rendered for links when the URL is external.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalLinkComponent?: PrismicLinkProps[\"externalComponent\"];\n};\n\ntype CreateDefaultSerializerArgs = {\n\tlinkResolver: prismicH.LinkResolverFunction<string> | undefined;\n\tinternalLinkComponent: PrismicRichTextProps[\"internalLinkComponent\"];\n\texternalLinkComponent: PrismicRichTextProps[\"externalLinkComponent\"];\n};\n\nconst createDefaultSerializer = (\n\targs: CreateDefaultSerializerArgs,\n): JSXFunctionSerializer =>\n\tprismicR.wrapMapSerializer({\n\t\theading1: ({ children, key }) => <h1 key={key}>{children}</h1>,\n\t\theading2: ({ children, key }) => <h2 key={key}>{children}</h2>,\n\t\theading3: ({ children, key }) => <h3 key={key}>{children}</h3>,\n\t\theading4: ({ children, key }) => <h4 key={key}>{children}</h4>,\n\t\theading5: ({ children, key }) => <h5 key={key}>{children}</h5>,\n\t\theading6: ({ children, key }) => <h6 key={key}>{children}</h6>,\n\t\tparagraph: ({ children, key }) => <p key={key}>{children}</p>,\n\t\tpreformatted: ({ node, key }) => <pre key={key}>{node.text}</pre>,\n\t\tstrong: ({ children, key }) => <strong key={key}>{children}</strong>,\n\t\tem: ({ children, key }) => <em key={key}>{children}</em>,\n\t\tlistItem: ({ children, key }) => <li key={key}>{children}</li>,\n\t\toListItem: ({ children, key }) => <li key={key}>{children}</li>,\n\t\tlist: ({ children, key }) => <ul key={key}>{children}</ul>,\n\t\toList: ({ children, key }) => <ol key={key}>{children}</ol>,\n\t\timage: ({ node, key }) => {\n\t\t\tconst img = (\n\t\t\t\t<img\n\t\t\t\t\tsrc={node.url}\n\t\t\t\t\talt={node.alt ?? undefined}\n\t\t\t\t\tdata-copyright={node.copyright ? node.copyright : undefined}\n\t\t\t\t/>\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\t<p key={key} className=\"block-img\">\n\t\t\t\t\t{node.linkTo ? (\n\t\t\t\t\t\t<PrismicLink\n\t\t\t\t\t\t\tlinkResolver={args.linkResolver}\n\t\t\t\t\t\t\tinternalComponent={args.internalLinkComponent}\n\t\t\t\t\t\t\texternalComponent={args.externalLinkComponent}\n\t\t\t\t\t\t\tfield={node.linkTo}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{img}\n\t\t\t\t\t\t</PrismicLink>\n\t\t\t\t\t) : (\n\t\t\t\t\t\timg\n\t\t\t\t\t)}\n\t\t\t\t</p>\n\t\t\t);\n\t\t},\n\t\tembed: ({ node, key }) => (\n\t\t\t<div\n\t\t\t\tkey={key}\n\t\t\t\tdata-oembed={node.oembed.embed_url}\n\t\t\t\tdata-oembed-type={node.oembed.type}\n\t\t\t\tdata-oembed-provider={node.oembed.provider_name}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: node.oembed.html ?? \"\" }}\n\t\t\t/>\n\t\t),\n\t\thyperlink: ({ node, children, key }) => (\n\t\t\t<PrismicLink\n\t\t\t\tkey={key}\n\t\t\t\tfield={node.data}\n\t\t\t\tlinkResolver={args.linkResolver}\n\t\t\t\tinternalComponent={args.internalLinkComponent}\n\t\t\t\texternalComponent={args.externalLinkComponent}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</PrismicLink>\n\t\t),\n\t\tlabel: ({ node, children, key }) => (\n\t\t\t<span key={key} className={node.data.label}>\n\t\t\t\t{children}\n\t\t\t</span>\n\t\t),\n\t\tspan: ({ text, key }) => {\n\t\t\tconst result: React.ReactNode[] = [];\n\n\t\t\tlet i = 0;\n\t\t\tfor (const line of text.split(\"\\n\")) {\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tresult.push(<br key={`${i}__break`} />);\n\t\t\t\t}\n\n\t\t\t\tresult.push(<React.Fragment key={`${i}__line`}>{line}</React.Fragment>);\n\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\treturn <React.Fragment key={key}>{result}</React.Fragment>;\n\t\t},\n\t});\n\n/**\n * React component that renders content from a Prismic Rich Text field. By\n * default, HTML elements are rendered for each piece of content. A `heading1`\n * block will render an `<h1>` HTML element, for example. Links will use\n * `<PrismicLink>` by default which can be customized using the\n * `internalLinkComponent` and `externalLinkComponent` props.\n *\n * To customize the components that are rendered, provide a map or function\n * serializer to the `components` prop.\n *\n * Components can also be provided in a centralized location using the\n * `<PrismicProvider>` React context provider.\n *\n * @remarks\n * This component returns a React fragment with no wrapping element around the\n * content. If you need a wrapper, add a component around `<PrismicRichText>`.\n * @example Rendering a Rich Text field using the default HTMl elements.\n *\n * ```jsx\n * <PrismicRichText field={document.data.content} />;\n * ```\n *\n * @example Rendering a Rich Text field using a custom set of React components.\n *\n * ```jsx\n * <PrismicRichText\n * \tfield={document.data.content}\n * \tcomponents={{\n * \t\theading1: ({ children }) => <Heading>{children}</Heading>,\n * \t}}\n * />;\n * ```\n *\n * @param props - Props for the component.\n *\n * @returns The Rich Text field's content as React components.\n *\n * @see Learn about Rich Text fields {@link https://prismic.io/docs/core-concepts/rich-text-title}\n * @see Learn about Rich Text serializers {@link https://prismic.io/docs/core-concepts/html-serializer}\n */\nexport const PrismicRichText = (\n\tprops: PrismicRichTextProps,\n): JSX.Element | null => {\n\tconst context = usePrismicContext();\n\n\treturn React.useMemo(() => {\n\t\tif (!props.field) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tconst linkResolver = props.linkResolver || context.linkResolver;\n\n\t\t\tconst serializer = prismicR.composeSerializers(\n\t\t\t\ttypeof props.components === \"object\"\n\t\t\t\t\t? prismicR.wrapMapSerializer(props.components)\n\t\t\t\t\t: props.components,\n\t\t\t\ttypeof context.richTextComponents === \"object\"\n\t\t\t\t\t? prismicR.wrapMapSerializer(context.richTextComponents)\n\t\t\t\t\t: context.richTextComponents,\n\t\t\t\tcreateDefaultSerializer({\n\t\t\t\t\tlinkResolver,\n\t\t\t\t\tinternalLinkComponent: props.internalLinkComponent,\n\t\t\t\t\texternalLinkComponent: props.externalLinkComponent,\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\t// The serializer is wrapped in a higher-order function\n\t\t\t// that automatically applies a key to React Elements\n\t\t\t// if one is not already given.\n\t\t\tconst serialized = prismicR.serialize<JSX.Element>(\n\t\t\t\tprops.field,\n\t\t\t\t(type, node, text, children, key) => {\n\t\t\t\t\tconst result = serializer(type, node, text, children, key);\n\n\t\t\t\t\tif (React.isValidElement(result) && result.key == null) {\n\t\t\t\t\t\treturn React.cloneElement(result, { key });\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\n\t\t\treturn <>{serialized}</>;\n\t\t}\n\t}, [\n\t\tprops.field,\n\t\tprops.internalLinkComponent,\n\t\tprops.externalLinkComponent,\n\t\tprops.components,\n\t\tprops.linkResolver,\n\t\tcontext.linkResolver,\n\t\tcontext.richTextComponents,\n\t]);\n};\n","import type { PascalCase } from \"type-fest\";\n\nexport const pascalCase = <Input extends string>(\n\tinput: Input,\n): PascalCase<Input> => {\n\tconst camelCased = input.replace(/(?:-|_)(\\w)/g, (_, c) => {\n\t\treturn c ? c.toUpperCase() : \"\";\n\t});\n\n\treturn (camelCased[0].toUpperCase() +\n\t\tcamelCased.slice(1)) as PascalCase<Input>;\n};\n","import * as React from \"react\";\nimport * as prismicT from \"@prismicio/types\";\nimport type { PascalCase } from \"type-fest\";\n\nimport { __PRODUCTION__ } from \"./lib/__PRODUCTION__\";\nimport { pascalCase } from \"./lib/pascalCase\";\n\n/**\n * The minimum required properties to represent a Prismic Slice for the\n * `<SliceZone>` component.\n *\n * If using Prismic's REST API, use the `Slice` export from `@prismicio/types`\n * for a full interface.\n *\n * @typeParam SliceType - Type name of the Slice.\n */\nexport type SliceLike<SliceType extends string = string> = Pick<\n\tprismicT.Slice<SliceType>,\n\t\"slice_type\"\n>;\n\n/**\n * A looser version of the `SliceZone` type from `@prismicio/types` using `SliceLike`.\n *\n * If using Prismic's REST API, use the `SliceZone` export from\n * `@prismicio/types` for the full type.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n */\nexport type SliceZoneLike<TSlice extends SliceLike> = readonly TSlice[];\n\n/**\n * React props for a component rendering content from a Prismic Slice using the\n * `<SliceZone>` component.\n *\n * @typeParam TSlice - The Slice passed as a prop.\n * @typeParam TContext - Arbitrary data passed to `<SliceZone>` and made\n * available to all Slice components.\n */\nexport type SliceComponentProps<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = {\n\t/**\n\t * Slice data for this component.\n\t */\n\tslice: TSlice;\n\n\t/**\n\t * The index of the Slice in the Slice Zone.\n\t */\n\tindex: number;\n\n\t/**\n\t * All Slices from the Slice Zone to which the Slice belongs.\n\t */\n\t// TODO: We have to keep this list of Slices general due to circular\n\t// reference limtiations. If we had another generic to determine the full\n\t// union of Slice types, it would include TSlice. This causes TypeScript to\n\t// throw a compilation error.\n\tslices: SliceZoneLike<SliceLike>;\n\n\t/**\n\t * Arbitrary data passed to `<SliceZone>` and made available to all Slice components.\n\t */\n\tcontext: TContext;\n};\n\n/**\n * A React component to be rendered for each instance of its Slice.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n */\nexport type SliceComponentType<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = React.ComponentType<SliceComponentProps<TSlice, TContext>>;\n\n/**\n * A record of Slice types mapped to a React component. The component will be\n * rendered for each instance of its Slice.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n */\nexport type SliceZoneComponents<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> =\n\t// This is purposely not wrapped in Partial to ensure a component is provided\n\t// for all Slice types. <SliceZone> will render a default component if one is\n\t// not provided, but it *should* be a type error if an explicit component is\n\t// missing.\n\t//\n\t// If a developer purposely does not want to provide a component, they can\n\t// assign it to the TODOSliceComponent exported from this package. This\n\t// signals to future developers that it is a placeholder and should be\n\t// implemented.\n\t{\n\t\t[SliceType in keyof Record<\n\t\t\tTSlice[\"slice_type\"],\n\t\t\tnever\n\t\t>]: SliceComponentType<\n\t\t\tExtract<TSlice, SliceLike<SliceType>> extends never\n\t\t\t\t? SliceLike\n\t\t\t\t: Extract<TSlice, SliceLike<SliceType>>,\n\t\t\tTContext\n\t\t>;\n\t};\n\n/**\n * This Slice component can be used as a reminder to provide a proper implementation.\n *\n * This is also the default React component rendered when a component mapping\n * cannot be found in `<SliceZone>`.\n */\nexport const TODOSliceComponent = __PRODUCTION__\n\t? () => null\n\t: <TSlice extends SliceLike, TContext>({\n\t\t\tslice,\n\t }: SliceComponentProps<TSlice, TContext>): JSX.Element | null => {\n\t\t\tReact.useEffect(() => {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${slice.slice_type}\"`,\n\t\t\t\t\tslice,\n\t\t\t\t);\n\t\t\t}, [slice]);\n\n\t\t\treturn (\n\t\t\t\t<section\n\t\t\t\t\tdata-slice-zone-todo-component=\"\"\n\t\t\t\t\tdata-slice-type={slice.slice_type}\n\t\t\t\t>\n\t\t\t\t\tCould not find a component for Slice type “{slice.slice_type}\n\t\t\t\t\t”\n\t\t\t\t</section>\n\t\t\t);\n\t };\n\n/**\n * Arguments for a `<SliceZone>` `resolver` function.\n */\ntype SliceZoneResolverArgs<TSlice extends SliceLike = SliceLike> = {\n\t/**\n\t * The Slice to resolve to a React component.\n\t */\n\tslice: TSlice;\n\n\t/**\n\t * The name of the Slice.\n\t */\n\tsliceName: PascalCase<TSlice[\"slice_type\"]>;\n\n\t/**\n\t * The index of the Slice in the Slice Zone.\n\t */\n\ti: number;\n};\n\n/**\n * A function that determines the rendered React component for each Slice in the\n * Slice Zone. If a nullish value is returned, the component will fallback to\n * the `components` or `defaultComponent` props to determine the rendered component.\n *\n * @deprecated Use the `components` prop instead.\n *\n * @param args - Arguments for the resolver function.\n *\n * @returns The React component to render for a Slice.\n */\nexport type SliceZoneResolver<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = (\n\targs: SliceZoneResolverArgs<TSlice>,\n) => SliceComponentType<TSlice, TContext> | undefined | null;\n\n/**\n * React props for the `<SliceZone>` component.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n */\nexport type SliceZoneProps<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = {\n\t/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices?: SliceZoneLike<TSlice>;\n\n\t/**\n\t * A record mapping Slice types to React components.\n\t */\n\tcomponents?: SliceZoneComponents<TSlice, TContext>;\n\n\t/**\n\t * A function that determines the rendered React component for each Slice in\n\t * the Slice Zone.\n\t *\n\t * @deprecated Use the `components` prop instead.\n\t *\n\t * @param args - Arguments for the resolver function.\n\t *\n\t * @returns The React component to render for a Slice.\n\t */\n\tresolver?: SliceZoneResolver<TSlice, TContext>;\n\n\t/**\n\t * The React component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t */\n\tdefaultComponent?: SliceComponentType<TSlice, TContext>;\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext;\n};\n\n/**\n * Renders content from a Prismic Slice Zone using React components for each\n * type of Slice.\n *\n * If a component is not provided for a type of Slice, a default component can\n * be provided. A fallback component is provided by default that will not be\n * rendered in a production build of your app.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n *\n * @returns The Slice Zone's content as React components.\n *\n * @see Learn about Prismic Slices and Slice Zones {@link https://prismic.io/docs/core-concepts/slices}\n */\nexport const SliceZone = <TSlice extends SliceLike, TContext>({\n\tslices = [],\n\tcomponents = {} as SliceZoneComponents<TSlice, TContext>,\n\tresolver,\n\tdefaultComponent = TODOSliceComponent,\n\tcontext = {} as TContext,\n}: SliceZoneProps<TSlice, TContext>): JSX.Element => {\n\tconst renderedSlices = React.useMemo(() => {\n\t\treturn slices.map((slice, index) => {\n\t\t\tlet Comp = (components[slice.slice_type as keyof typeof components] ||\n\t\t\t\tdefaultComponent) as SliceComponentType<TSlice, TContext>;\n\n\t\t\t// TODO: Remove `resolver` in v3 in favor of `components`.\n\t\t\tif (resolver) {\n\t\t\t\tconst resolvedComp = resolver({\n\t\t\t\t\tslice,\n\t\t\t\t\tsliceName: pascalCase(slice.slice_type),\n\t\t\t\t\ti: index,\n\t\t\t\t});\n\n\t\t\t\tif (resolvedComp) {\n\t\t\t\t\tComp = resolvedComp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst key = `${index}-${JSON.stringify(slice)}`;\n\n\t\t\treturn (\n\t\t\t\t<Comp\n\t\t\t\t\tkey={key}\n\t\t\t\t\tslice={slice}\n\t\t\t\t\tindex={index}\n\t\t\t\t\tslices={slices}\n\t\t\t\t\tcontext={context}\n\t\t\t\t/>\n\t\t\t);\n\t\t});\n\t}, [components, context, defaultComponent, slices, resolver]);\n\n\treturn <>{renderedSlices}</>;\n};\n","import * as React from \"react\";\n\n/**\n * Props for `<PrismicToolbar>`.\n */\nexport type PrismicToolbarProps = {\n\t/**\n\t * The name of the Prismic repository. For example, `\"my-repo\"` if the\n\t * repository URL is `my-repo.prismic.io`.\n\t */\n\trepositoryName: string;\n\n\t/**\n\t * The type of toolbar needed for the repository. Defaults to `\"new\"`.\n\t *\n\t * @see To check which version you need, view the Prismic Toolbar documentation {@link https://prismic.io/docs/technologies/previews-and-the-prismic-toolbar-reactjs}\n\t */\n\ttype?: \"new\" | \"legacy\";\n};\n\n/**\n * React component that injects the Prismic Toolbar into the app. This component\n * can be placed anywhere in the React tree.\n */\nexport const PrismicToolbar = ({\n\trepositoryName,\n\ttype = \"new\",\n}: PrismicToolbarProps): null => {\n\tconst src = `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${\n\t\ttype === \"new\" ? \"&new=true\" : \"\"\n\t}`;\n\n\tReact.useEffect(() => {\n\t\tconst existingScript = document.querySelector(`script[src=\"${src}\"]`);\n\n\t\tif (!existingScript) {\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.src = src;\n\t\t\tscript.defer = true;\n\n\t\t\t// Used to distinguish the toolbar element from other elements.\n\t\t\tscript.dataset.prismicToolbar = \"\";\n\t\t\tscript.dataset.repositoryName = repositoryName;\n\t\t\tscript.dataset.type = type;\n\n\t\t\tdocument.body.appendChild(script);\n\t\t}\n\t}, [repositoryName, type, src]);\n\n\treturn null;\n};\n","import type * as prismic from \"@prismicio/client\";\n\nimport * as React from \"react\";\n\nimport { PrismicClientHookState } from \"./types\";\nimport { usePrismicClient } from \"./usePrismicClient\";\n\ntype StateMachineState<TData> = {\n\tstate: PrismicClientHookState;\n\tdata?: TData;\n\terror?: Error;\n};\n\ntype StateMachineAction<TData> =\n\t| [type: \"start\"]\n\t| [type: \"succeed\", payload: TData]\n\t| [type: \"fail\", payload: Error];\n\nconst reducer = <TData>(\n\tstate: StateMachineState<TData>,\n\taction: StateMachineAction<TData>,\n): StateMachineState<TData> => {\n\tswitch (action[0]) {\n\t\tcase \"start\": {\n\t\t\treturn { state: \"loading\" };\n\t\t}\n\n\t\tcase \"succeed\": {\n\t\t\treturn { state: \"loaded\", data: action[1] };\n\t\t}\n\n\t\tcase \"fail\": {\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tstate: \"failed\",\n\t\t\t\terror: action[1],\n\t\t\t};\n\t\t}\n\t}\n};\n\nconst initialState: StateMachineState<never> = {\n\tstate: \"idle\",\n};\n\ntype UnwrapPromise<T> = T extends Promise<infer U> ? U : T;\n\ntype ClientPrototype = typeof prismic.Client.prototype;\n\ntype ClientMethod<MethodName extends keyof ClientPrototype> =\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tClientPrototype[MethodName] extends (...args: any[]) => any\n\t\t? ClientPrototype[MethodName]\n\t\t: never;\n\ntype ClientMethodName = keyof {\n\t[P in keyof prismic.Client as prismic.Client[P] extends (\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t...args: any[]\n\t) => // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tPromise<any>\n\t\t? P\n\t\t: never]: unknown;\n};\n\nexport type ClientMethodParameters<MethodName extends keyof ClientPrototype> =\n\tParameters<ClientMethod<MethodName>>;\n\nexport type HookOnlyParameters = {\n\tclient?: prismic.Client;\n\tskip?: boolean;\n};\n\n/**\n * Determines if a value is a `@prismicio/client` params object.\n *\n * @param value - The value to check.\n *\n * @returns `true` if `value` is a `@prismicio/client` params object, `false` otherwise.\n */\nconst isParams = (\n\tvalue: unknown,\n): value is ClientMethodParameters<\"get\">[0] & HookOnlyParameters => {\n\t// This is a *very* naive check.\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n};\n\n/**\n * The return value of a `@prismicio/client` React hook.\n *\n * @typeParam TData - Data returned by the client.\n */\nexport type ClientHookReturnType<TData = unknown> = [\n\t/**\n\t * Data returned by the client.\n\t */\n\tdata: TData | undefined,\n\n\t/**\n\t * The current state of the hook's client method call.\n\t */\n\tstate: Pick<StateMachineState<TData>, \"state\" | \"error\">,\n];\n\n/**\n * Creates a React hook that forwards arguments to a specific method of a\n * `@prismicio/client` instance. The created hook has its own internal state\n * manager to report async status, such as pending or error statuses.\n *\n * @param methodName - The `@prismicio/client` method to which hook arguments\n * will be forwarded.\n *\n * @returns A new React hook configured for the provided method.\n *\n * @internal\n */\nexport const useStatefulPrismicClientMethod = <\n\tTMethodName extends ClientMethodName,\n\tTArgs extends Parameters<ClientMethod<TMethodName>>,\n\tTData extends UnwrapPromise<ReturnType<ClientMethod<TMethodName>>>,\n>(\n\tmethodName: TMethodName,\n\targs: TArgs,\n\texplicitClient?: prismic.Client,\n): ClientHookReturnType<TData> => {\n\tconst lastArg = args[args.length - 1];\n\tconst {\n\t\tclient: lastArgExplicitClient,\n\t\tskip,\n\t\t...params\n\t} = isParams(lastArg) ? lastArg : ({} as HookOnlyParameters);\n\tconst argsWithoutParams = isParams(lastArg) ? args.slice(0, -1) : args;\n\n\tconst client = usePrismicClient(explicitClient || lastArgExplicitClient);\n\n\tconst [state, dispatch] = React.useReducer<\n\t\tReact.Reducer<StateMachineState<TData>, StateMachineAction<TData>>\n\t>(reducer, initialState);\n\n\tReact.useEffect(\n\t\t() => {\n\t\t\t// Used to prevent dispatching an action if the hook was cleaned up.\n\t\t\tlet didCancel = false;\n\n\t\t\tif (!skip) {\n\t\t\t\tif (!didCancel) {\n\t\t\t\t\tdispatch([\"start\"]);\n\t\t\t\t}\n\n\t\t\t\tclient[methodName]\n\t\t\t\t\t.call(\n\t\t\t\t\t\tclient,\n\t\t\t\t\t\t// @ts-expect-error - Merging method arg types is too complex\n\t\t\t\t\t\t...argsWithoutParams,\n\t\t\t\t\t\tparams,\n\t\t\t\t\t)\n\t\t\t\t\t.then((result) => {\n\t\t\t\t\t\tif (!didCancel) {\n\t\t\t\t\t\t\tdispatch([\"succeed\", result as TData]);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tif (!didCancel) {\n\t\t\t\t\t\t\tdispatch([\"fail\", error]);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Ensure we don't dispatch an action if the hook is cleaned up.\n\t\t\t() => {\n\t\t\t\tdidCancel = true;\n\t\t\t};\n\t\t},\n\t\t// We must disable exhaustive-deps since we are using\n\t\t// JSON.stringify on params (effectively a deep equality check).\n\t\t// We want this effect to run again anytime params change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tclient,\n\t\t\tmethodName,\n\t\t\tskip,\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\tJSON.stringify(argsWithoutParams),\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\tJSON.stringify(params),\n\t\t],\n\t);\n\n\treturn React.useMemo(\n\t\t() => [\n\t\t\tstate.data,\n\t\t\t{\n\t\t\t\tstate: state.state,\n\t\t\t\terror: state.error,\n\t\t\t},\n\t\t],\n\t\t[state],\n\t);\n};\n","import type * as prismic from \"@prismicio/client\";\n\nimport * as React from \"react\";\n\nimport { usePrismicContext } from \"./usePrismicContext\";\nimport {\n\tClientHookReturnType,\n\tuseStatefulPrismicClientMethod,\n} from \"./useStatefulPrismicClientMethod\";\n\nexport type UsePrismicPreviewResolverArgs = {\n\t/**\n\t * An optional `@prismicio/client` instance to override the Client provided to\n\t * `<PrismicProvider>`\n\t */\n\tclient?: prismic.Client;\n\n\t/**\n\t * A function that maps a Prismic document to a URL within your app.\n\t */\n\tlinkResolver?: Parameters<\n\t\tprismic.Client[\"resolvePreviewURL\"]\n\t>[0][\"linkResolver\"];\n\n\t/**\n\t * A fallback URL if the Link Resolver does not return a value.\n\t */\n\tdefaultURL?: Parameters<prismic.Client[\"resolvePreviewURL\"]>[0][\"defaultURL\"];\n\n\t/**\n\t * The preview token (also known as a ref) that will be used to query preview\n\t * content from the Prismic repository.\n\t */\n\tpreviewToken?: Parameters<\n\t\tprismic.Client[\"resolvePreviewURL\"]\n\t>[0][\"previewToken\"];\n\n\t/**\n\t * The previewed document that will be used to determine the destination URL.\n\t */\n\tdocumentID?: Parameters<prismic.Client[\"resolvePreviewURL\"]>[0][\"documentID\"];\n\n\t/**\n\t * A function to automatically navigate to the resolved URL. If a function is\n\t * not provded, `usePreviewResolver` will not navigate to the URL.\n\t *\n\t * @param url - The resolved preview URL.\n\t */\n\tnavigate?: (url: string) => unknown;\n};\n\n/**\n * Resolve a preview session's URL. The resolved URL can be used to redirect to\n * the previewed document.\n *\n * If a `navigate` function is provided, the hook will automatically navigate to\n * the previewed document's URL.\n *\n * @param args - Arguments to configure how a URL is resolved.\n *\n * @returns A tuple containing the resolved URL and the hook's state.\n */\nexport const usePrismicPreviewResolver = (\n\targs: UsePrismicPreviewResolverArgs = {},\n): ClientHookReturnType<string> => {\n\tconst context = usePrismicContext();\n\n\tconst linkResolver = args.linkResolver || context.linkResolver;\n\n\tconst result = useStatefulPrismicClientMethod(\n\t\t\"resolvePreviewURL\",\n\t\t[\n\t\t\t{\n\t\t\t\tlinkResolver,\n\t\t\t\tdefaultURL: args.defaultURL || \"/\",\n\t\t\t\tpreviewToken: args.previewToken,\n\t\t\t\tdocumentID: args.documentID,\n\t\t\t},\n\t\t],\n\t\targs.client,\n\t);\n\n\tconst [resolvedURL] = result;\n\tconst { navigate } = args;\n\n\tReact.useEffect(() => {\n\t\tif (resolvedURL && navigate) {\n\t\t\tnavigate(resolvedURL);\n\t\t}\n\t}, [resolvedURL, navigate]);\n\n\treturn result;\n};\n","import type * as prismicT from \"@prismicio/types\";\n\nimport {\n\tClientHookReturnType,\n\tClientMethodParameters,\n\tHookOnlyParameters,\n\tuseStatefulPrismicClientMethod,\n} from \"./useStatefulPrismicClientMethod\";\n\n/**\n * A hook that queries content from the Prismic repository.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.get}\n */\nexport const usePrismicDocuments = <TDocument extends prismicT.PrismicDocument>(\n\t...args: [params?: ClientMethodParameters<\"get\">[0] & HookOnlyParameters]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"get\", args);\n\n/**\n * A hook that queries content from the Prismic repository and returns only the\n * first result, if any.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getFirst}\n */\nexport const useFirstPrismicDocument = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [params?: ClientMethodParameters<\"getFirst\">[0] & HookOnlyParameters]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getFirst\", args);\n\n/**\n * A hook that queries content from the Prismic repository and returns all\n * matching content. If no predicates are provided, all documents will be fetched.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAll}\n */\nexport const useAllPrismicDocumentsDangerously = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"dangerouslyGetAll\">[0] &\n\t\t\tHookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"dangerouslyGetAll\", args);\n\n/**\n * A hook that queries a document from the Prismic repository with a specific ID.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param id - ID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByID}\n */\nexport const usePrismicDocumentByID = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByID\">[0],\n\t\tparams?: ClientMethodParameters<\"getByID\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByID\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByIDs}\n */\nexport const usePrismicDocumentsByIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getByIDs\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByIDs\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getAllByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByIDs\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByIDs\", args);\n\n/**\n * A hook that queries a document from the Prismic repository with a specific\n * UID and Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uid - UID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const usePrismicDocumentByUID = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUID\">[0],\n\t\tuid: ClientMethodParameters<\"getByUID\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUID\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByUID\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific UIDs\n * of a Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs.\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const usePrismicDocumentsByUIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByUIDs\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * UIDs of a Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs.\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const useAllPrismicDocumentsByUIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByUIDs\", args);\n\n/**\n * A hook that queries a singleton document from the Prismic repository for a\n * specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the singleton Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getSingle}\n */\nexport const useSinglePrismicDocument = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getSingle\">[0],\n\t\tparams?: ClientMethodParameters<\"getSingle\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getSingle\", args);\n\n/**\n * A hook that queries documents from the Prismic repository for a specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByType}\n */\nexport const usePrismicDocumentsByType = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getByType\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByType\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository for a specific\n * Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByType}\n */\nexport const useAllPrismicDocumentsByType = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByType\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByType\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with a specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTag}\n */\nexport const usePrismicDocumentsByTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByTag\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with a specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTag}\n */\nexport const useAllPrismicDocumentsByTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByTag\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific tags.\n * A document must be tagged with at least one of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTags}\n */\nexport const usePrismicDocumentsBySomeTags = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getBySomeTags\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getBySomeTags\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * tags. A document must be tagged with at least one of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTags}\n */\nexport const useAllPrismicDocumentsBySomeTags = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllBySomeTags\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllBySomeTags\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific tags.\n * A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTags}\n */\nexport const usePrismicDocumentsByEveryTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByEveryTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByEveryTag\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * tags. A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTags}\n */\nexport const useAllPrismicDocumentsByEveryTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByEveryTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByEveryTag\", args);\n","export { PrismicProvider } from \"./PrismicProvider\";\nexport type {\n\tPrismicProviderProps,\n\tPrismicContextValue,\n} from \"./PrismicProvider\";\n\nexport { usePrismicContext } from \"./usePrismicContext\";\n\nexport { usePrismicClient } from \"./usePrismicClient\";\n\nexport { PrismicLink } from \"./PrismicLink\";\nexport type { PrismicLinkProps, LinkProps } from \"./PrismicLink\";\n\nexport { PrismicText } from \"./PrismicText\";\nexport type { PrismicTextProps } from \"./PrismicText\";\n\nexport { PrismicRichText } from \"./PrismicRichText\";\nexport type { PrismicRichTextProps } from \"./PrismicRichText\";\n\nimport { Element } from \"@prismicio/richtext\";\nexport { Element };\n/**\n * @deprecated Renamed to `Element` (without an \"s\").\n */\n// TODO: Remove in v3.\nexport const Elements = Element;\n\nexport { SliceZone, TODOSliceComponent } from \"./SliceZone\";\nexport type {\n\tSliceComponentProps,\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n\tSliceZoneProps,\n\tSliceZoneResolver,\n} from \"./SliceZone\";\n\nexport { PrismicToolbar } from \"./PrismicToolbar\";\nexport type { PrismicToolbarProps } from \"./PrismicToolbar\";\n\nexport { usePrismicPreviewResolver } from \"./usePrismicPreviewResolver\";\nexport type { UsePrismicPreviewResolverArgs } from \"./usePrismicPreviewResolver\";\n\nexport {\n\tuseAllPrismicDocumentsDangerously,\n\tuseAllPrismicDocumentsByEveryTag,\n\tuseAllPrismicDocumentsByIDs,\n\tuseAllPrismicDocumentsBySomeTags,\n\tuseAllPrismicDocumentsByTag,\n\tuseAllPrismicDocumentsByType,\n\tuseAllPrismicDocumentsByUIDs,\n\tuseFirstPrismicDocument,\n\tusePrismicDocumentByID,\n\tusePrismicDocumentByUID,\n\tusePrismicDocuments,\n\tusePrismicDocumentsByEveryTag,\n\tusePrismicDocumentsByIDs,\n\tusePrismicDocumentsBySomeTags,\n\tusePrismicDocumentsByTag,\n\tusePrismicDocumentsByType,\n\tusePrismicDocumentsByUIDs,\n\tuseSinglePrismicDocument,\n} from \"./clientHooks\";\n\nexport type {\n\tJSXMapSerializer,\n\tJSXFunctionSerializer,\n\tPrismicClientHookState,\n} from \"./types\";\n"],"names":["React","prismicH","prismicR","Element"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA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A+B,qBAAqB;MAiBxC,yBAAyB,IAGlC,SAKH,+BAA+B,WAAW;MAiB9B,2BAA2B,IAGpC,SAKH,+BAA+B,YAAY;MAiB/B,8BAA8B,IAGvC,SAKH,+BAA+B,eAAe;MAmBlC,0BAA0B,IAGnC,SAMH,+BAA+B,YAAY;MAmB/B,4BAA4B,IAGrC,SAMH,+BAA+B,aAAa;MAmBhC,+BAA+B,IAGxC,SAMH,+BAA+B,gBAAgB;MAkBnC,2BAA2B,IAGpC,SAKH,+BAA+B,aAAa;MAiBhC,4BAA4B,IAGrC,SAKH,+BAA+B,aAAa;MAkBhC,+BAA+B,IAGxC,SAKH,+BAA+B,gBAAgB;MAiBnC,2BAA2B,IAGpC,SAKH,+BAA+B,YAAY;MAiB/B,8BAA8B,IAGvC,SAKH,+BAA+B,eAAe;MAkBlC,gCAAgC,IAGzC,SAKH,+BAA+B,iBAAiB;MAkBpC,mCAAmC,IAG5C,SAKH,+BAA+B,oBAAoB;MAkBvC,gCAAgC,IAGzC,SAKH,+BAA+B,iBAAiB;MAkBpC,mCAAmC,IAG5C,SAKH,+BAA+B,oBAAoB;;MCtbvC,WAAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/PrismicProvider.tsx","../src/usePrismicContext.ts","../src/lib/__PRODUCTION__.ts","../src/lib/invariant.ts","../src/usePrismicClient.ts","../src/lib/isInternalURL.ts","../src/PrismicLink.tsx","../src/PrismicText.tsx","../src/PrismicRichText.tsx","../src/lib/pascalCase.ts","../src/SliceZone.tsx","../src/PrismicToolbar.tsx","../src/useStatefulPrismicClientMethod.ts","../src/usePrismicPreviewResolver.ts","../src/clientHooks.ts","../src/index.ts"],"sourcesContent":["import type * as prismic from \"@prismicio/client\";\n\nimport * as React from \"react\";\nimport * as prismicH from \"@prismicio/helpers\";\n\nimport { LinkProps } from \"./PrismicLink\";\nimport { JSXFunctionSerializer, JSXMapSerializer } from \"./types\";\n\n/**\n * React context value containing shared configuration for `@prismicio/react`\n * components and hooks.\n */\nexport type PrismicContextValue = {\n\t/**\n\t * A `@prismicio/client` instance used to fetch content from a Prismic\n\t * repository. This is used by `@prismicio/react` hooks, such as\n\t * `usePrismicDocuments()`.\n\t */\n\tclient?: prismic.Client;\n\n\t/**\n\t * A Link Resolver used to resolve links for `<PrismicLink>` and `<PrismicRichText>`.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: prismicH.LinkResolverFunction;\n\n\t/**\n\t * A map or function that maps a Rich Text block to a React component.\n\t *\n\t * @remarks\n\t * Prefer using a map serializer over the function serializer when possible.\n\t * The map serializer is simpler to maintain.\n\t * @example A map serializer.\n\t *\n\t * ```jsx\n\t * {\n\t * heading1: ({children}) => <Heading>{children}</Heading>\n\t * }\n\t * ```\n\t *\n\t * @example A function serializer.\n\t *\n\t * ```jsx\n\t * (type, node, content, children) => {\n\t * \tswitch (type) {\n\t * \t\tcase \"heading1\": {\n\t * \t\t\treturn <Heading>{chidlren}</Heading>;\n\t * \t\t}\n\t * \t}\n\t * };\n\t * ```\n\t */\n\trichTextComponents?: JSXMapSerializer | JSXFunctionSerializer;\n\n\t/**\n\t * The component rendered by `<PrismicLink>` for internal URLs. Defaults to `<a>`.\n\t */\n\tinternalLinkComponent?: React.ElementType<LinkProps>;\n\n\t/**\n\t * The component rendered by `<PrismicLink>` for external URLs. Defaults to `<a>`.\n\t */\n\texternalLinkComponent?: React.ElementType<LinkProps>;\n\n\t/**\n\t * Children for the component.\n\t */\n\tchildren?: React.ReactNode;\n};\n\n/**\n * React context containing shared configuration for `@prismicio/react`\n * components and hooks.\n */\nexport const PrismicContext = React.createContext<PrismicContextValue>({});\n\n/**\n * Props for `<PrismicProvider>`.\n */\nexport type PrismicProviderProps = PrismicContextValue;\n\n/**\n * React context provider to share configuration for `@prismicio/react`\n * components and hooks.\n *\n * @returns A React context provider with shared configuration.\n */\nexport const PrismicProvider = ({\n\tclient,\n\tlinkResolver,\n\trichTextComponents,\n\tinternalLinkComponent,\n\texternalLinkComponent,\n\tchildren,\n}: PrismicProviderProps): JSX.Element => {\n\tconst value = React.useMemo<PrismicContextValue>(\n\t\t() => ({\n\t\t\tclient,\n\t\t\tlinkResolver,\n\t\t\trichTextComponents,\n\t\t\tinternalLinkComponent,\n\t\t\texternalLinkComponent,\n\t\t}),\n\t\t[\n\t\t\tclient,\n\t\t\tlinkResolver,\n\t\t\trichTextComponents,\n\t\t\tinternalLinkComponent,\n\t\t\texternalLinkComponent,\n\t\t],\n\t);\n\n\treturn (\n\t\t<PrismicContext.Provider value={value}>{children}</PrismicContext.Provider>\n\t);\n};\n","import * as React from \"react\";\n\nimport { PrismicContext, PrismicContextValue } from \"./PrismicProvider\";\n\n/**\n * React hook used to read shared configuration for `@prismicio/react`\n * components and hooks.\n *\n * @returns The closest `<PrismicProvider>` context value.\n */\nexport const usePrismicContext = (): PrismicContextValue => {\n\treturn React.useContext(PrismicContext) || {};\n};\n","// We need to polyfill process if it doesn't exist, such as in the browser.\nif (typeof process === \"undefined\") {\n\tglobalThis.process = { env: {} } as typeof process;\n}\n\n/**\n * `true` if in the production environment, `false` otherwise.\n *\n * This boolean can be used to perform actions only in development environments,\n * such as logging.\n */\nexport const __PRODUCTION__ = process.env.NODE_ENV === \"production\";\n","/**\n * MIT License\n *\n * Copyright (c) 2019 Alexander Reardon\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { __PRODUCTION__ } from \"./__PRODUCTION__\";\n\nconst prefix = \"Invariant failed\";\n\n// Throw an error if the condition fails\n// Strip out error messages for production\n// > Not providing an inline default argument for message as the result is smaller\nexport function invariant(\n\tcondition: unknown,\n\tmessage?: string,\n): asserts condition {\n\tif (condition) {\n\t\treturn;\n\t}\n\t// Condition not passed\n\n\t// In production we strip the message but still throw\n\tif (__PRODUCTION__) {\n\t\tthrow new Error(prefix);\n\t}\n\n\t// When not in production we allow the message to pass through\n\t// *This block will be removed in production builds*\n\tthrow new Error(`${prefix}: ${message || \"\"}`);\n}\n","import type * as prismic from \"@prismicio/client\";\n\nimport { invariant } from \"./lib/invariant\";\n\nimport { usePrismicContext } from \"./usePrismicContext\";\n\n/**\n * Retrieve the `@prismicio/client` instance provided to `<PrismicProvider>`\n * higher in the React tree.\n *\n * @param explicitClient - An optional `@prismicio/client` instance to override\n * the Client provided to `<PrismicProvider>`.\n *\n * @returns The `@prismicio/client` instance provided to `<PrismicProvider>`.\n */\nexport const usePrismicClient = (\n\texplicitClient?: prismic.Client,\n): prismic.Client => {\n\tconst context = usePrismicContext();\n\n\tconst client = explicitClient || context?.client;\n\tinvariant(\n\t\tclient,\n\t\t\"A @prismicio/client is required to query documents. Provide a client to the hook or to a <PrismicProvider> higher in your component tree.\",\n\t);\n\n\treturn client;\n};\n","/**\n * Determines if a URL is internal or external.\n *\n * @param url - The URL to check if internal or external.\n *\n * @returns `true` if `url` is internal, `false` otherwise.\n */\n// TODO: This does not detect all relative URLs as internal such as `about` or `./about`. This function assumes relative URLs start with a \"/\" or \"#\"`.\nexport const isInternalURL = (url: string): boolean => {\n\tconst isInternal = /^(\\/(?!\\/)|#)/.test(url);\n\tconst isSpecialLink = !isInternal && !/^https?:\\/\\//.test(url);\n\n\treturn isInternal && !isSpecialLink;\n};\n","import * as React from \"react\";\nimport * as prismicH from \"@prismicio/helpers\";\nimport * as prismicT from \"@prismicio/types\";\n\nimport { isInternalURL } from \"./lib/isInternalURL\";\n\nimport { usePrismicContext } from \"./usePrismicContext\";\n\n/**\n * Props provided to a component when rendered with `<PrismicLink>`.\n */\nexport interface LinkProps {\n\t/**\n\t * The URL to link.\n\t */\n\thref: string;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: string;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Props for `<PrismicLink>`.\n */\nexport type PrismicLinkProps<\n\tInternalComponent extends React.ElementType<LinkProps> = React.ElementType<LinkProps>,\n\tExternalComponent extends React.ElementType<LinkProps> = React.ElementType<LinkProps>,\n\tLinkResolverFunction extends prismicH.LinkResolverFunction = prismicH.LinkResolverFunction,\n> = Omit<\n\tReact.ComponentProps<InternalComponent> &\n\t\tReact.ComponentProps<ExternalComponent>,\n\tkeyof LinkProps\n> & {\n\t/**\n\t * The Link Resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * The component rendered for internal URLs. Defaults to `<a>`.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t */\n\tinternalComponent?: InternalComponent;\n\n\t/**\n\t * The component rendered for external URLs. Defaults to `<a>`.\n\t */\n\texternalComponent?: ExternalComponent;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: string | null;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string | null;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n} & (\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The Prismic Link field containing the URL or document to link.\n\t\t\t\t *\n\t\t\t\t * @see Learn about Prismic Link fields {@link https://prismic.io/docs/core-concepts/link-content-relationship}\n\t\t\t\t */\n\t\t\t\tfield: prismicT.LinkField | null | undefined;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The Prismic document to link.\n\t\t\t\t */\n\t\t\t\tdocument: prismicT.PrismicDocument | null | undefined;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The URL to link.\n\t\t\t\t */\n\t\t\t\thref: string | null | undefined;\n\t\t }\n\t);\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"a\";\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\";\n\n/**\n * React component that renders a link from a Prismic Link field.\n *\n * Different components can be rendered depending on whether the link is\n * internal or external. This is helpful when integrating with client-side\n * routers, such as a router-specific Link component.\n *\n * If a link is configured to open in a new window using `target=\"_blank\"`,\n * `rel=\"noopener noreferrer\"` is set by default.\n *\n * @param props - Props for the component.\n *\n * @returns The internal or external link component depending on whether the\n * link is internal or external.\n */\nexport const PrismicLink = <\n\tInternalComponent extends React.ElementType<LinkProps> = typeof defaultInternalComponent,\n\tExternalComponent extends React.ElementType<LinkProps> = typeof defaultExternalComponent,\n\tLinkResolverFunction extends prismicH.LinkResolverFunction = prismicH.LinkResolverFunction,\n>(\n\tprops: PrismicLinkProps<\n\t\tInternalComponent,\n\t\tExternalComponent,\n\t\tLinkResolverFunction\n\t>,\n): JSX.Element | null => {\n\tconst context = usePrismicContext();\n\n\tconst linkResolver = props.linkResolver || context.linkResolver;\n\n\tlet href: string | null | undefined;\n\tif (\"href\" in props) {\n\t\thref = props.href;\n\t} else if (\"document\" in props && props.document) {\n\t\thref = prismicH.asLink(props.document, linkResolver);\n\t} else if (\"field\" in props && props.field) {\n\t\thref = prismicH.asLink(props.field, linkResolver);\n\t}\n\n\tconst target =\n\t\tprops.target ||\n\t\t(\"field\" in props &&\n\t\t\tprops.field &&\n\t\t\t\"target\" in props.field &&\n\t\t\tprops.field.target) ||\n\t\tundefined;\n\n\tconst rel =\n\t\tprops.rel || (target === \"_blank\" ? \"noopener noreferrer\" : undefined);\n\n\tconst InternalComponent: React.ElementType<LinkProps> =\n\t\tprops.internalComponent ||\n\t\tcontext.internalLinkComponent ||\n\t\tdefaultInternalComponent;\n\n\tconst ExternalComponent: React.ElementType<LinkProps> =\n\t\tprops.externalComponent ||\n\t\tcontext.externalLinkComponent ||\n\t\tdefaultExternalComponent;\n\n\tconst isInternal = href && isInternalURL(href);\n\n\tconst Component = isInternal ? InternalComponent : ExternalComponent;\n\n\tconst passthroughProps: typeof props = Object.assign({}, props);\n\tdelete passthroughProps.linkResolver;\n\tdelete passthroughProps.internalComponent;\n\tdelete passthroughProps.externalComponent;\n\tdelete passthroughProps.rel;\n\tdelete passthroughProps.target;\n\tif (\"field\" in passthroughProps) {\n\t\tdelete passthroughProps.field;\n\t} else if (\"document\" in passthroughProps) {\n\t\tdelete passthroughProps.document;\n\t} else if (\"href\" in passthroughProps) {\n\t\tdelete passthroughProps.href;\n\t}\n\n\treturn href ? (\n\t\t<Component {...passthroughProps} href={href} target={target} rel={rel} />\n\t) : null;\n};\n","import * as React from \"react\";\nimport * as prismicT from \"@prismicio/types\";\nimport * as prismicH from \"@prismicio/helpers\";\n\n/**\n * Props for `<PrismicText>`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic Rich Text field to render.\n\t */\n\tfield: prismicT.RichTextField | null | undefined;\n\n\t/**\n\t * The separator used between blocks. Defaults to `\\n`.\n\t */\n\tseparator?: string;\n};\n\n/**\n * React component that renders content from a Prismic Rich Text field as plain text.\n *\n * @remarks\n * This component returns a React fragment with no wrapping element around the\n * content. If you need a wrapper, add a component around `<PrismicText>`.\n * @example Rendering a Rich Text field as plain text.\n *\n * ```jsx\n * <PrismicText field={document.data.content} />;\n * ```\n *\n * @param props - Props for the component.\n *\n * @returns The Rich Text field's content as plain text.\n *\n * @see Learn about Rich Text fields {@link https://prismic.io/docs/core-concepts/rich-text-title}\n */\nexport const PrismicText = (props: PrismicTextProps): JSX.Element | null => {\n\treturn React.useMemo(() => {\n\t\tif (props.field) {\n\t\t\tconst text = prismicH.asText(props.field, props.separator);\n\n\t\t\treturn <>{text}</>;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}, [props.field, props.separator]);\n};\n","/* eslint-disable react/display-name */\n/* eslint-disable react/prop-types */\n\nimport * as React from \"react\";\nimport * as prismicT from \"@prismicio/types\";\nimport * as prismicH from \"@prismicio/helpers\";\nimport * as prismicR from \"@prismicio/richtext\";\n\nimport { JSXFunctionSerializer, JSXMapSerializer } from \"./types\";\nimport { PrismicLink, PrismicLinkProps } from \"./PrismicLink\";\nimport { usePrismicContext } from \"./usePrismicContext\";\n\n/**\n * Props for `<PrismicRichText>`.\n */\nexport type PrismicRichTextProps = {\n\t/**\n\t * The Prismic Rich Text field to render.\n\t */\n\tfield: prismicT.RichTextField | null | undefined;\n\n\t/**\n\t * The Link Resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: PrismicLinkProps[\"linkResolver\"];\n\n\t/**\n\t * A function that maps a Rich Text block to a React component.\n\t *\n\t * @deprecated Use the `components` prop instead. Prefer using a map\n\t * serializer when possible.\n\t * @see Learn about Rich Text serializers {@link https://prismic.io/docs/core-concepts/html-serializer}\n\t */\n\thtmlSerializer?: JSXFunctionSerializer;\n\n\t/**\n\t * A map or function that maps a Rich Text block to a React component.\n\t *\n\t * @remarks\n\t * Prefer using a map serializer over the function serializer when possible.\n\t * The map serializer is simpler to maintain.\n\t * @example A map serializer.\n\t *\n\t * ```jsx\n\t * {\n\t * heading1: ({children}) => <Heading>{children}</Heading>\n\t * }\n\t * ```\n\t *\n\t * @example A function serializer.\n\t *\n\t * ```jsx\n\t * (type, node, content, children) => {\n\t * \tswitch (type) {\n\t * \t\tcase \"heading1\": {\n\t * \t\t\treturn <Heading>{chidlren}</Heading>;\n\t * \t\t}\n\t * \t}\n\t * };\n\t * ```\n\t */\n\tcomponents?: JSXMapSerializer | JSXFunctionSerializer;\n\n\t/**\n\t * The React component rendered for links when the URL is internal.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\tinternalLinkComponent?: PrismicLinkProps[\"internalComponent\"];\n\n\t/**\n\t * The React component rendered for links when the URL is external.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalLinkComponent?: PrismicLinkProps[\"externalComponent\"];\n};\n\ntype CreateDefaultSerializerArgs = {\n\tlinkResolver: prismicH.LinkResolverFunction<string> | undefined;\n\tinternalLinkComponent: PrismicRichTextProps[\"internalLinkComponent\"];\n\texternalLinkComponent: PrismicRichTextProps[\"externalLinkComponent\"];\n};\n\nconst createDefaultSerializer = (\n\targs: CreateDefaultSerializerArgs,\n): JSXFunctionSerializer =>\n\tprismicR.wrapMapSerializer({\n\t\theading1: ({ children, key }) => <h1 key={key}>{children}</h1>,\n\t\theading2: ({ children, key }) => <h2 key={key}>{children}</h2>,\n\t\theading3: ({ children, key }) => <h3 key={key}>{children}</h3>,\n\t\theading4: ({ children, key }) => <h4 key={key}>{children}</h4>,\n\t\theading5: ({ children, key }) => <h5 key={key}>{children}</h5>,\n\t\theading6: ({ children, key }) => <h6 key={key}>{children}</h6>,\n\t\tparagraph: ({ children, key }) => <p key={key}>{children}</p>,\n\t\tpreformatted: ({ node, key }) => <pre key={key}>{node.text}</pre>,\n\t\tstrong: ({ children, key }) => <strong key={key}>{children}</strong>,\n\t\tem: ({ children, key }) => <em key={key}>{children}</em>,\n\t\tlistItem: ({ children, key }) => <li key={key}>{children}</li>,\n\t\toListItem: ({ children, key }) => <li key={key}>{children}</li>,\n\t\tlist: ({ children, key }) => <ul key={key}>{children}</ul>,\n\t\toList: ({ children, key }) => <ol key={key}>{children}</ol>,\n\t\timage: ({ node, key }) => {\n\t\t\tconst img = (\n\t\t\t\t<img\n\t\t\t\t\tsrc={node.url}\n\t\t\t\t\talt={node.alt ?? undefined}\n\t\t\t\t\tdata-copyright={node.copyright ? node.copyright : undefined}\n\t\t\t\t/>\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\t<p key={key} className=\"block-img\">\n\t\t\t\t\t{node.linkTo ? (\n\t\t\t\t\t\t<PrismicLink\n\t\t\t\t\t\t\tlinkResolver={args.linkResolver}\n\t\t\t\t\t\t\tinternalComponent={args.internalLinkComponent}\n\t\t\t\t\t\t\texternalComponent={args.externalLinkComponent}\n\t\t\t\t\t\t\tfield={node.linkTo}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{img}\n\t\t\t\t\t\t</PrismicLink>\n\t\t\t\t\t) : (\n\t\t\t\t\t\timg\n\t\t\t\t\t)}\n\t\t\t\t</p>\n\t\t\t);\n\t\t},\n\t\tembed: ({ node, key }) => (\n\t\t\t<div\n\t\t\t\tkey={key}\n\t\t\t\tdata-oembed={node.oembed.embed_url}\n\t\t\t\tdata-oembed-type={node.oembed.type}\n\t\t\t\tdata-oembed-provider={node.oembed.provider_name}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: node.oembed.html ?? \"\" }}\n\t\t\t/>\n\t\t),\n\t\thyperlink: ({ node, children, key }) => (\n\t\t\t<PrismicLink\n\t\t\t\tkey={key}\n\t\t\t\tfield={node.data}\n\t\t\t\tlinkResolver={args.linkResolver}\n\t\t\t\tinternalComponent={args.internalLinkComponent}\n\t\t\t\texternalComponent={args.externalLinkComponent}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</PrismicLink>\n\t\t),\n\t\tlabel: ({ node, children, key }) => (\n\t\t\t<span key={key} className={node.data.label}>\n\t\t\t\t{children}\n\t\t\t</span>\n\t\t),\n\t\tspan: ({ text, key }) => {\n\t\t\tconst result: React.ReactNode[] = [];\n\n\t\t\tlet i = 0;\n\t\t\tfor (const line of text.split(\"\\n\")) {\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tresult.push(<br key={`${i}__break`} />);\n\t\t\t\t}\n\n\t\t\t\tresult.push(<React.Fragment key={`${i}__line`}>{line}</React.Fragment>);\n\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\treturn <React.Fragment key={key}>{result}</React.Fragment>;\n\t\t},\n\t});\n\n/**\n * React component that renders content from a Prismic Rich Text field. By\n * default, HTML elements are rendered for each piece of content. A `heading1`\n * block will render an `<h1>` HTML element, for example. Links will use\n * `<PrismicLink>` by default which can be customized using the\n * `internalLinkComponent` and `externalLinkComponent` props.\n *\n * To customize the components that are rendered, provide a map or function\n * serializer to the `components` prop.\n *\n * Components can also be provided in a centralized location using the\n * `<PrismicProvider>` React context provider.\n *\n * @remarks\n * This component returns a React fragment with no wrapping element around the\n * content. If you need a wrapper, add a component around `<PrismicRichText>`.\n * @example Rendering a Rich Text field using the default HTMl elements.\n *\n * ```jsx\n * <PrismicRichText field={document.data.content} />;\n * ```\n *\n * @example Rendering a Rich Text field using a custom set of React components.\n *\n * ```jsx\n * <PrismicRichText\n * \tfield={document.data.content}\n * \tcomponents={{\n * \t\theading1: ({ children }) => <Heading>{children}</Heading>,\n * \t}}\n * />;\n * ```\n *\n * @param props - Props for the component.\n *\n * @returns The Rich Text field's content as React components.\n *\n * @see Learn about Rich Text fields {@link https://prismic.io/docs/core-concepts/rich-text-title}\n * @see Learn about Rich Text serializers {@link https://prismic.io/docs/core-concepts/html-serializer}\n */\nexport const PrismicRichText = (\n\tprops: PrismicRichTextProps,\n): JSX.Element | null => {\n\tconst context = usePrismicContext();\n\n\treturn React.useMemo(() => {\n\t\tif (!props.field) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tconst linkResolver = props.linkResolver || context.linkResolver;\n\n\t\t\tconst serializer = prismicR.composeSerializers(\n\t\t\t\ttypeof props.components === \"object\"\n\t\t\t\t\t? prismicR.wrapMapSerializer(props.components)\n\t\t\t\t\t: props.components,\n\t\t\t\ttypeof context.richTextComponents === \"object\"\n\t\t\t\t\t? prismicR.wrapMapSerializer(context.richTextComponents)\n\t\t\t\t\t: context.richTextComponents,\n\t\t\t\tcreateDefaultSerializer({\n\t\t\t\t\tlinkResolver,\n\t\t\t\t\tinternalLinkComponent: props.internalLinkComponent,\n\t\t\t\t\texternalLinkComponent: props.externalLinkComponent,\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\t// The serializer is wrapped in a higher-order function\n\t\t\t// that automatically applies a key to React Elements\n\t\t\t// if one is not already given.\n\t\t\tconst serialized = prismicR.serialize<JSX.Element>(\n\t\t\t\tprops.field,\n\t\t\t\t(type, node, text, children, key) => {\n\t\t\t\t\tconst result = serializer(type, node, text, children, key);\n\n\t\t\t\t\tif (React.isValidElement(result) && result.key == null) {\n\t\t\t\t\t\treturn React.cloneElement(result, { key });\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\n\t\t\treturn <>{serialized}</>;\n\t\t}\n\t}, [\n\t\tprops.field,\n\t\tprops.internalLinkComponent,\n\t\tprops.externalLinkComponent,\n\t\tprops.components,\n\t\tprops.linkResolver,\n\t\tcontext.linkResolver,\n\t\tcontext.richTextComponents,\n\t]);\n};\n","// `PascalCase`-related types have been taken from the `type-fest` package.\n//\n// They are copied here to mininize dependencies in this project.\n//\n// See: https://github.com/sindresorhus/type-fest/blob/61c35052f09caa23de5eef96d95196375d8ed498/source/camel-case.d.ts\n\ntype WordSeparators = \"-\" | \"_\" | \" \";\n\ntype Split<\n\tS extends string,\n\tDelimiter extends string,\n> = S extends `${infer Head}${Delimiter}${infer Tail}`\n\t? [Head, ...Split<Tail, Delimiter>]\n\t: S extends Delimiter\n\t? []\n\t: [S];\n\ntype InnerCamelCaseStringArray<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tParts extends readonly any[],\n\tPreviousPart,\n> = Parts extends [`${infer FirstPart}`, ...infer RemainingParts]\n\t? FirstPart extends undefined\n\t\t? \"\"\n\t\t: FirstPart extends \"\"\n\t\t? InnerCamelCaseStringArray<RemainingParts, PreviousPart>\n\t\t: `${PreviousPart extends \"\"\n\t\t\t\t? FirstPart\n\t\t\t\t: Capitalize<FirstPart>}${InnerCamelCaseStringArray<\n\t\t\t\tRemainingParts,\n\t\t\t\tFirstPart\n\t\t >}`\n\t: \"\";\n\ntype CamelCaseStringArray<Parts extends readonly string[]> = Parts extends [\n\t`${infer FirstPart}`,\n\t...infer RemainingParts\n]\n\t? Uncapitalize<`${FirstPart}${InnerCamelCaseStringArray<\n\t\t\tRemainingParts,\n\t\t\tFirstPart\n\t >}`>\n\t: never;\n\ntype CamelCase<K> = K extends string\n\t? CamelCaseStringArray<\n\t\t\tSplit<K extends Uppercase<K> ? Lowercase<K> : K, WordSeparators>\n\t >\n\t: K;\n\n/**\n * Converts a string literal to Pascal case.\n *\n * Taken from the `type-fest` package.\n *\n * See:\n * https://github.com/sindresorhus/type-fest/blob/61c35052f09caa23de5eef96d95196375d8ed498/source/pascal-case.d.ts\n */\nexport type PascalCase<Value> = CamelCase<Value> extends string\n\t? Capitalize<CamelCase<Value>>\n\t: CamelCase<Value>;\n\n/**\n * Converts a string to Pascal case.\n *\n * @param input - The string to convert.\n *\n * @returns `input` as Pascal case.\n */\nexport const pascalCase = <Input extends string>(\n\tinput: Input,\n): PascalCase<Input> => {\n\tconst camelCased = input.replace(/(?:-|_)(\\w)/g, (_, c) => {\n\t\treturn c ? c.toUpperCase() : \"\";\n\t});\n\n\treturn (camelCased[0].toUpperCase() +\n\t\tcamelCased.slice(1)) as PascalCase<Input>;\n};\n","import * as React from \"react\";\nimport * as prismicT from \"@prismicio/types\";\n\nimport { __PRODUCTION__ } from \"./lib/__PRODUCTION__\";\nimport { pascalCase, PascalCase } from \"./lib/pascalCase\";\n\n/**\n * The minimum required properties to represent a Prismic Slice for the\n * `<SliceZone>` component.\n *\n * If using Prismic's REST API, use the `Slice` export from `@prismicio/types`\n * for a full interface.\n *\n * @typeParam SliceType - Type name of the Slice.\n */\nexport type SliceLike<SliceType extends string = string> = Pick<\n\tprismicT.Slice<SliceType>,\n\t\"slice_type\"\n>;\n\n/**\n * A looser version of the `SliceZone` type from `@prismicio/types` using `SliceLike`.\n *\n * If using Prismic's REST API, use the `SliceZone` export from\n * `@prismicio/types` for the full type.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n */\nexport type SliceZoneLike<TSlice extends SliceLike> = readonly TSlice[];\n\n/**\n * React props for a component rendering content from a Prismic Slice using the\n * `<SliceZone>` component.\n *\n * @typeParam TSlice - The Slice passed as a prop.\n * @typeParam TContext - Arbitrary data passed to `<SliceZone>` and made\n * available to all Slice components.\n */\nexport type SliceComponentProps<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = {\n\t/**\n\t * Slice data for this component.\n\t */\n\tslice: TSlice;\n\n\t/**\n\t * The index of the Slice in the Slice Zone.\n\t */\n\tindex: number;\n\n\t/**\n\t * All Slices from the Slice Zone to which the Slice belongs.\n\t */\n\t// TODO: We have to keep this list of Slices general due to circular\n\t// reference limtiations. If we had another generic to determine the full\n\t// union of Slice types, it would include TSlice. This causes TypeScript to\n\t// throw a compilation error.\n\tslices: SliceZoneLike<SliceLike>;\n\n\t/**\n\t * Arbitrary data passed to `<SliceZone>` and made available to all Slice components.\n\t */\n\tcontext: TContext;\n};\n\n/**\n * A React component to be rendered for each instance of its Slice.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n */\nexport type SliceComponentType<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = React.ComponentType<SliceComponentProps<TSlice, TContext>>;\n\n/**\n * A record of Slice types mapped to a React component. The component will be\n * rendered for each instance of its Slice.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n */\nexport type SliceZoneComponents<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> =\n\t// This is purposely not wrapped in Partial to ensure a component is provided\n\t// for all Slice types. <SliceZone> will render a default component if one is\n\t// not provided, but it *should* be a type error if an explicit component is\n\t// missing.\n\t//\n\t// If a developer purposely does not want to provide a component, they can\n\t// assign it to the TODOSliceComponent exported from this package. This\n\t// signals to future developers that it is a placeholder and should be\n\t// implemented.\n\t{\n\t\t[SliceType in keyof Record<\n\t\t\tTSlice[\"slice_type\"],\n\t\t\tnever\n\t\t>]: SliceComponentType<\n\t\t\tExtract<TSlice, SliceLike<SliceType>> extends never\n\t\t\t\t? SliceLike\n\t\t\t\t: Extract<TSlice, SliceLike<SliceType>>,\n\t\t\tTContext\n\t\t>;\n\t};\n\n/**\n * This Slice component can be used as a reminder to provide a proper implementation.\n *\n * This is also the default React component rendered when a component mapping\n * cannot be found in `<SliceZone>`.\n */\nexport const TODOSliceComponent = __PRODUCTION__\n\t? () => null\n\t: <TSlice extends SliceLike, TContext>({\n\t\t\tslice,\n\t }: SliceComponentProps<TSlice, TContext>): JSX.Element | null => {\n\t\t\tReact.useEffect(() => {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${slice.slice_type}\"`,\n\t\t\t\t\tslice,\n\t\t\t\t);\n\t\t\t}, [slice]);\n\n\t\t\treturn (\n\t\t\t\t<section\n\t\t\t\t\tdata-slice-zone-todo-component=\"\"\n\t\t\t\t\tdata-slice-type={slice.slice_type}\n\t\t\t\t>\n\t\t\t\t\tCould not find a component for Slice type “{slice.slice_type}\n\t\t\t\t\t”\n\t\t\t\t</section>\n\t\t\t);\n\t };\n\n/**\n * Arguments for a `<SliceZone>` `resolver` function.\n */\ntype SliceZoneResolverArgs<TSlice extends SliceLike = SliceLike> = {\n\t/**\n\t * The Slice to resolve to a React component.\n\t */\n\tslice: TSlice;\n\n\t/**\n\t * The name of the Slice.\n\t */\n\tsliceName: PascalCase<TSlice[\"slice_type\"]>;\n\n\t/**\n\t * The index of the Slice in the Slice Zone.\n\t */\n\ti: number;\n};\n\n/**\n * A function that determines the rendered React component for each Slice in the\n * Slice Zone. If a nullish value is returned, the component will fallback to\n * the `components` or `defaultComponent` props to determine the rendered component.\n *\n * @deprecated Use the `components` prop instead.\n *\n * @param args - Arguments for the resolver function.\n *\n * @returns The React component to render for a Slice.\n */\nexport type SliceZoneResolver<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = (\n\targs: SliceZoneResolverArgs<TSlice>,\n) => SliceComponentType<TSlice, TContext> | undefined | null;\n\n/**\n * React props for the `<SliceZone>` component.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n */\nexport type SliceZoneProps<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = {\n\t/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices?: SliceZoneLike<TSlice>;\n\n\t/**\n\t * A record mapping Slice types to React components.\n\t */\n\tcomponents?: SliceZoneComponents<TSlice, TContext>;\n\n\t/**\n\t * A function that determines the rendered React component for each Slice in\n\t * the Slice Zone.\n\t *\n\t * @deprecated Use the `components` prop instead.\n\t *\n\t * @param args - Arguments for the resolver function.\n\t *\n\t * @returns The React component to render for a Slice.\n\t */\n\tresolver?: SliceZoneResolver<TSlice, TContext>;\n\n\t/**\n\t * The React component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t */\n\tdefaultComponent?: SliceComponentType<TSlice, TContext>;\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext;\n};\n\n/**\n * Renders content from a Prismic Slice Zone using React components for each\n * type of Slice.\n *\n * If a component is not provided for a type of Slice, a default component can\n * be provided. A fallback component is provided by default that will not be\n * rendered in a production build of your app.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n *\n * @returns The Slice Zone's content as React components.\n *\n * @see Learn about Prismic Slices and Slice Zones {@link https://prismic.io/docs/core-concepts/slices}\n */\nexport const SliceZone = <TSlice extends SliceLike, TContext>({\n\tslices = [],\n\tcomponents = {} as SliceZoneComponents<TSlice, TContext>,\n\tresolver,\n\tdefaultComponent = TODOSliceComponent,\n\tcontext = {} as TContext,\n}: SliceZoneProps<TSlice, TContext>): JSX.Element => {\n\tconst renderedSlices = React.useMemo(() => {\n\t\treturn slices.map((slice, index) => {\n\t\t\tlet Comp = (components[slice.slice_type as keyof typeof components] ||\n\t\t\t\tdefaultComponent) as SliceComponentType<TSlice, TContext>;\n\n\t\t\t// TODO: Remove `resolver` in v3 in favor of `components`.\n\t\t\tif (resolver) {\n\t\t\t\tconst resolvedComp = resolver({\n\t\t\t\t\tslice,\n\t\t\t\t\tsliceName: pascalCase(slice.slice_type),\n\t\t\t\t\ti: index,\n\t\t\t\t});\n\n\t\t\t\tif (resolvedComp) {\n\t\t\t\t\tComp = resolvedComp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst key = `${index}-${JSON.stringify(slice)}`;\n\n\t\t\treturn (\n\t\t\t\t<Comp\n\t\t\t\t\tkey={key}\n\t\t\t\t\tslice={slice}\n\t\t\t\t\tindex={index}\n\t\t\t\t\tslices={slices}\n\t\t\t\t\tcontext={context}\n\t\t\t\t/>\n\t\t\t);\n\t\t});\n\t}, [components, context, defaultComponent, slices, resolver]);\n\n\treturn <>{renderedSlices}</>;\n};\n","import * as React from \"react\";\n\n/**\n * Props for `<PrismicToolbar>`.\n */\nexport type PrismicToolbarProps = {\n\t/**\n\t * The name of the Prismic repository. For example, `\"my-repo\"` if the\n\t * repository URL is `my-repo.prismic.io`.\n\t */\n\trepositoryName: string;\n\n\t/**\n\t * The type of toolbar needed for the repository. Defaults to `\"new\"`.\n\t *\n\t * @see To check which version you need, view the Prismic Toolbar documentation {@link https://prismic.io/docs/technologies/previews-and-the-prismic-toolbar-reactjs}\n\t */\n\ttype?: \"new\" | \"legacy\";\n};\n\n/**\n * React component that injects the Prismic Toolbar into the app. This component\n * can be placed anywhere in the React tree.\n */\nexport const PrismicToolbar = ({\n\trepositoryName,\n\ttype = \"new\",\n}: PrismicToolbarProps): null => {\n\tconst src = `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${\n\t\ttype === \"new\" ? \"&new=true\" : \"\"\n\t}`;\n\n\tReact.useEffect(() => {\n\t\tconst existingScript = document.querySelector(`script[src=\"${src}\"]`);\n\n\t\tif (!existingScript) {\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.src = src;\n\t\t\tscript.defer = true;\n\n\t\t\t// Used to distinguish the toolbar element from other elements.\n\t\t\tscript.dataset.prismicToolbar = \"\";\n\t\t\tscript.dataset.repositoryName = repositoryName;\n\t\t\tscript.dataset.type = type;\n\n\t\t\tdocument.body.appendChild(script);\n\t\t}\n\t}, [repositoryName, type, src]);\n\n\treturn null;\n};\n","import type * as prismic from \"@prismicio/client\";\n\nimport * as React from \"react\";\n\nimport { PrismicClientHookState } from \"./types\";\nimport { usePrismicClient } from \"./usePrismicClient\";\n\ntype StateMachineState<TData> = {\n\tstate: PrismicClientHookState;\n\tdata?: TData;\n\terror?: Error;\n};\n\ntype StateMachineAction<TData> =\n\t| [type: \"start\"]\n\t| [type: \"succeed\", payload: TData]\n\t| [type: \"fail\", payload: Error];\n\nconst reducer = <TData>(\n\tstate: StateMachineState<TData>,\n\taction: StateMachineAction<TData>,\n): StateMachineState<TData> => {\n\tswitch (action[0]) {\n\t\tcase \"start\": {\n\t\t\treturn { state: \"loading\" };\n\t\t}\n\n\t\tcase \"succeed\": {\n\t\t\treturn { state: \"loaded\", data: action[1] };\n\t\t}\n\n\t\tcase \"fail\": {\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tstate: \"failed\",\n\t\t\t\terror: action[1],\n\t\t\t};\n\t\t}\n\t}\n};\n\nconst initialState: StateMachineState<never> = {\n\tstate: \"idle\",\n};\n\ntype UnwrapPromise<T> = T extends Promise<infer U> ? U : T;\n\ntype ClientPrototype = typeof prismic.Client.prototype;\n\ntype ClientMethod<MethodName extends keyof ClientPrototype> =\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tClientPrototype[MethodName] extends (...args: any[]) => any\n\t\t? ClientPrototype[MethodName]\n\t\t: never;\n\ntype ClientMethodName = keyof {\n\t[P in keyof prismic.Client as prismic.Client[P] extends (\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t...args: any[]\n\t) => // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tPromise<any>\n\t\t? P\n\t\t: never]: unknown;\n};\n\nexport type ClientMethodParameters<MethodName extends keyof ClientPrototype> =\n\tParameters<ClientMethod<MethodName>>;\n\nexport type HookOnlyParameters = {\n\tclient?: prismic.Client;\n\tskip?: boolean;\n};\n\n/**\n * Determines if a value is a `@prismicio/client` params object.\n *\n * @param value - The value to check.\n *\n * @returns `true` if `value` is a `@prismicio/client` params object, `false` otherwise.\n */\nconst isParams = (\n\tvalue: unknown,\n): value is ClientMethodParameters<\"get\">[0] & HookOnlyParameters => {\n\t// This is a *very* naive check.\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n};\n\n/**\n * The return value of a `@prismicio/client` React hook.\n *\n * @typeParam TData - Data returned by the client.\n */\nexport type ClientHookReturnType<TData = unknown> = [\n\t/**\n\t * Data returned by the client.\n\t */\n\tdata: TData | undefined,\n\n\t/**\n\t * The current state of the hook's client method call.\n\t */\n\tstate: Pick<StateMachineState<TData>, \"state\" | \"error\">,\n];\n\n/**\n * Creates a React hook that forwards arguments to a specific method of a\n * `@prismicio/client` instance. The created hook has its own internal state\n * manager to report async status, such as pending or error statuses.\n *\n * @param methodName - The `@prismicio/client` method to which hook arguments\n * will be forwarded.\n *\n * @returns A new React hook configured for the provided method.\n *\n * @internal\n */\nexport const useStatefulPrismicClientMethod = <\n\tTMethodName extends ClientMethodName,\n\tTArgs extends Parameters<ClientMethod<TMethodName>>,\n\tTData extends UnwrapPromise<ReturnType<ClientMethod<TMethodName>>>,\n>(\n\tmethodName: TMethodName,\n\targs: TArgs,\n\texplicitClient?: prismic.Client,\n): ClientHookReturnType<TData> => {\n\tconst lastArg = args[args.length - 1];\n\tconst {\n\t\tclient: lastArgExplicitClient,\n\t\tskip,\n\t\t...params\n\t} = isParams(lastArg) ? lastArg : ({} as HookOnlyParameters);\n\tconst argsWithoutParams = isParams(lastArg) ? args.slice(0, -1) : args;\n\n\tconst client = usePrismicClient(explicitClient || lastArgExplicitClient);\n\n\tconst [state, dispatch] = React.useReducer<\n\t\tReact.Reducer<StateMachineState<TData>, StateMachineAction<TData>>\n\t>(reducer, initialState);\n\n\tReact.useEffect(\n\t\t() => {\n\t\t\t// Used to prevent dispatching an action if the hook was cleaned up.\n\t\t\tlet didCancel = false;\n\n\t\t\tif (!skip) {\n\t\t\t\tif (!didCancel) {\n\t\t\t\t\tdispatch([\"start\"]);\n\t\t\t\t}\n\n\t\t\t\tclient[methodName]\n\t\t\t\t\t.call(\n\t\t\t\t\t\tclient,\n\t\t\t\t\t\t// @ts-expect-error - Merging method arg types is too complex\n\t\t\t\t\t\t...argsWithoutParams,\n\t\t\t\t\t\tparams,\n\t\t\t\t\t)\n\t\t\t\t\t.then((result) => {\n\t\t\t\t\t\tif (!didCancel) {\n\t\t\t\t\t\t\tdispatch([\"succeed\", result as TData]);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tif (!didCancel) {\n\t\t\t\t\t\t\tdispatch([\"fail\", error]);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Ensure we don't dispatch an action if the hook is cleaned up.\n\t\t\t() => {\n\t\t\t\tdidCancel = true;\n\t\t\t};\n\t\t},\n\t\t// We must disable exhaustive-deps since we are using\n\t\t// JSON.stringify on params (effectively a deep equality check).\n\t\t// We want this effect to run again anytime params change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tclient,\n\t\t\tmethodName,\n\t\t\tskip,\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\tJSON.stringify(argsWithoutParams),\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\tJSON.stringify(params),\n\t\t],\n\t);\n\n\treturn React.useMemo(\n\t\t() => [\n\t\t\tstate.data,\n\t\t\t{\n\t\t\t\tstate: state.state,\n\t\t\t\terror: state.error,\n\t\t\t},\n\t\t],\n\t\t[state],\n\t);\n};\n","import type * as prismic from \"@prismicio/client\";\n\nimport * as React from \"react\";\n\nimport { usePrismicContext } from \"./usePrismicContext\";\nimport {\n\tClientHookReturnType,\n\tuseStatefulPrismicClientMethod,\n} from \"./useStatefulPrismicClientMethod\";\n\nexport type UsePrismicPreviewResolverArgs = {\n\t/**\n\t * An optional `@prismicio/client` instance to override the Client provided to\n\t * `<PrismicProvider>`\n\t */\n\tclient?: prismic.Client;\n\n\t/**\n\t * A function that maps a Prismic document to a URL within your app.\n\t */\n\tlinkResolver?: Parameters<\n\t\tprismic.Client[\"resolvePreviewURL\"]\n\t>[0][\"linkResolver\"];\n\n\t/**\n\t * A fallback URL if the Link Resolver does not return a value.\n\t */\n\tdefaultURL?: Parameters<prismic.Client[\"resolvePreviewURL\"]>[0][\"defaultURL\"];\n\n\t/**\n\t * The preview token (also known as a ref) that will be used to query preview\n\t * content from the Prismic repository.\n\t */\n\tpreviewToken?: Parameters<\n\t\tprismic.Client[\"resolvePreviewURL\"]\n\t>[0][\"previewToken\"];\n\n\t/**\n\t * The previewed document that will be used to determine the destination URL.\n\t */\n\tdocumentID?: Parameters<prismic.Client[\"resolvePreviewURL\"]>[0][\"documentID\"];\n\n\t/**\n\t * A function to automatically navigate to the resolved URL. If a function is\n\t * not provded, `usePreviewResolver` will not navigate to the URL.\n\t *\n\t * @param url - The resolved preview URL.\n\t */\n\tnavigate?: (url: string) => unknown;\n};\n\n/**\n * Resolve a preview session's URL. The resolved URL can be used to redirect to\n * the previewed document.\n *\n * If a `navigate` function is provided, the hook will automatically navigate to\n * the previewed document's URL.\n *\n * @param args - Arguments to configure how a URL is resolved.\n *\n * @returns A tuple containing the resolved URL and the hook's state.\n */\nexport const usePrismicPreviewResolver = (\n\targs: UsePrismicPreviewResolverArgs = {},\n): ClientHookReturnType<string> => {\n\tconst context = usePrismicContext();\n\n\tconst linkResolver = args.linkResolver || context.linkResolver;\n\n\tconst result = useStatefulPrismicClientMethod(\n\t\t\"resolvePreviewURL\",\n\t\t[\n\t\t\t{\n\t\t\t\tlinkResolver,\n\t\t\t\tdefaultURL: args.defaultURL || \"/\",\n\t\t\t\tpreviewToken: args.previewToken,\n\t\t\t\tdocumentID: args.documentID,\n\t\t\t},\n\t\t],\n\t\targs.client,\n\t);\n\n\tconst [resolvedURL] = result;\n\tconst { navigate } = args;\n\n\tReact.useEffect(() => {\n\t\tif (resolvedURL && navigate) {\n\t\t\tnavigate(resolvedURL);\n\t\t}\n\t}, [resolvedURL, navigate]);\n\n\treturn result;\n};\n","import type * as prismicT from \"@prismicio/types\";\n\nimport {\n\tClientHookReturnType,\n\tClientMethodParameters,\n\tHookOnlyParameters,\n\tuseStatefulPrismicClientMethod,\n} from \"./useStatefulPrismicClientMethod\";\n\n/**\n * A hook that queries content from the Prismic repository.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.get}\n */\nexport const usePrismicDocuments = <TDocument extends prismicT.PrismicDocument>(\n\t...args: [params?: ClientMethodParameters<\"get\">[0] & HookOnlyParameters]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"get\", args);\n\n/**\n * A hook that queries content from the Prismic repository and returns only the\n * first result, if any.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getFirst}\n */\nexport const useFirstPrismicDocument = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [params?: ClientMethodParameters<\"getFirst\">[0] & HookOnlyParameters]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getFirst\", args);\n\n/**\n * A hook that queries content from the Prismic repository and returns all\n * matching content. If no predicates are provided, all documents will be fetched.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAll}\n */\nexport const useAllPrismicDocumentsDangerously = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"dangerouslyGetAll\">[0] &\n\t\t\tHookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"dangerouslyGetAll\", args);\n\n/**\n * A hook that queries a document from the Prismic repository with a specific ID.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param id - ID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByID}\n */\nexport const usePrismicDocumentByID = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByID\">[0],\n\t\tparams?: ClientMethodParameters<\"getByID\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByID\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByIDs}\n */\nexport const usePrismicDocumentsByIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getByIDs\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByIDs\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getAllByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByIDs\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByIDs\", args);\n\n/**\n * A hook that queries a document from the Prismic repository with a specific\n * UID and Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uid - UID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const usePrismicDocumentByUID = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUID\">[0],\n\t\tuid: ClientMethodParameters<\"getByUID\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUID\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByUID\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific UIDs\n * of a Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs.\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const usePrismicDocumentsByUIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByUIDs\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * UIDs of a Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs.\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const useAllPrismicDocumentsByUIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByUIDs\", args);\n\n/**\n * A hook that queries a singleton document from the Prismic repository for a\n * specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the singleton Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getSingle}\n */\nexport const useSinglePrismicDocument = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getSingle\">[0],\n\t\tparams?: ClientMethodParameters<\"getSingle\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getSingle\", args);\n\n/**\n * A hook that queries documents from the Prismic repository for a specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByType}\n */\nexport const usePrismicDocumentsByType = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getByType\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByType\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository for a specific\n * Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByType}\n */\nexport const useAllPrismicDocumentsByType = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByType\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByType\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with a specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTag}\n */\nexport const usePrismicDocumentsByTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByTag\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with a specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTag}\n */\nexport const useAllPrismicDocumentsByTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByTag\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific tags.\n * A document must be tagged with at least one of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTags}\n */\nexport const usePrismicDocumentsBySomeTags = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getBySomeTags\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getBySomeTags\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * tags. A document must be tagged with at least one of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTags}\n */\nexport const useAllPrismicDocumentsBySomeTags = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllBySomeTags\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllBySomeTags\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific tags.\n * A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTags}\n */\nexport const usePrismicDocumentsByEveryTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByEveryTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByEveryTag\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * tags. A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTags}\n */\nexport const useAllPrismicDocumentsByEveryTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByEveryTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByEveryTag\", args);\n","export { PrismicProvider } from \"./PrismicProvider\";\nexport type {\n\tPrismicProviderProps,\n\tPrismicContextValue,\n} from \"./PrismicProvider\";\n\nexport { usePrismicContext } from \"./usePrismicContext\";\n\nexport { usePrismicClient } from \"./usePrismicClient\";\n\nexport { PrismicLink } from \"./PrismicLink\";\nexport type { PrismicLinkProps, LinkProps } from \"./PrismicLink\";\n\nexport { PrismicText } from \"./PrismicText\";\nexport type { PrismicTextProps } from \"./PrismicText\";\n\nexport { PrismicRichText } from \"./PrismicRichText\";\nexport type { PrismicRichTextProps } from \"./PrismicRichText\";\n\nimport { Element } from \"@prismicio/richtext\";\nexport { Element };\n/**\n * @deprecated Renamed to `Element` (without an \"s\").\n */\n// TODO: Remove in v3.\nexport const Elements = Element;\n\nexport { SliceZone, TODOSliceComponent } from \"./SliceZone\";\nexport type {\n\tSliceComponentProps,\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n\tSliceZoneProps,\n\tSliceZoneResolver,\n} from \"./SliceZone\";\n\nexport { PrismicToolbar } from \"./PrismicToolbar\";\nexport type { PrismicToolbarProps } from \"./PrismicToolbar\";\n\nexport { usePrismicPreviewResolver } from \"./usePrismicPreviewResolver\";\nexport type { UsePrismicPreviewResolverArgs } from \"./usePrismicPreviewResolver\";\n\nexport {\n\tuseAllPrismicDocumentsDangerously,\n\tuseAllPrismicDocumentsByEveryTag,\n\tuseAllPrismicDocumentsByIDs,\n\tuseAllPrismicDocumentsBySomeTags,\n\tuseAllPrismicDocumentsByTag,\n\tuseAllPrismicDocumentsByType,\n\tuseAllPrismicDocumentsByUIDs,\n\tuseFirstPrismicDocument,\n\tusePrismicDocumentByID,\n\tusePrismicDocumentByUID,\n\tusePrismicDocuments,\n\tusePrismicDocumentsByEveryTag,\n\tusePrismicDocumentsByIDs,\n\tusePrismicDocumentsBySomeTags,\n\tusePrismicDocumentsByTag,\n\tusePrismicDocumentsByType,\n\tusePrismicDocumentsByUIDs,\n\tuseSinglePrismicDocument,\n} from \"./clientHooks\";\n\nexport type {\n\tJSXMapSerializer,\n\tJSXFunctionSerializer,\n\tPrismicClientHookState,\n} from \"./types\";\n"],"names":["React","prismicH","prismicR","Element"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8Ea,iBAAiBA,iBAAM,cAAmC;MAa1D,kBAAkB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACwC;AACxC,QAAM,QAAQA,iBAAM,QACnB;AAAO,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MAED;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAIF,wDACE,eAAe,UAAhB;AAAA,IAAyB;AAAA,KAAe;AAAA;;MC3G7B,oBAAoB,MAA2B;AAC3D,SAAOA,iBAAM,WAAW,mBAAmB;AAAA;;ACV5C,IAAI,OAAO,YAAY,aAAa;AACnC,aAAW,UAAU,EAAE,KAAK;AAAA;MAShB,iBAAiB,QAAQ,IAAI,aAAa;;ACevD,MAAM,SAAS;mBAMd,WACA,SACoB;AACpB,MAAI,WAAW;AACd;AAAA;AAKD,MAAI,gBAAgB;AACnB,UAAM,IAAI,MAAM;AAAA;AAKjB,QAAM,IAAI,MAAM,GAAG,WAAW,WAAW;AAAA;;MChC7B,mBAAmB,CAC/B,mBACoB;AACpB,QAAM,UAAU;AAEhB,QAAM,SAAS,sDAA2B;AAC1C,YACC,QACA;AAGD,SAAO;AAAA;;MClBK,gBAAgB,CAAC,QAAyB;AACtD,QAAM,aAAa,gBAAgB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ismicT from '@prismicio/types';
|
|
5
5
|
import * as prismicR from '@prismicio/richtext';
|
|
6
6
|
export { Element } from '@prismicio/richtext';
|
|
7
|
-
import { PascalCase } from 'type-fest';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Props provided to a component when rendered with `<PrismicLink>`.
|
|
@@ -352,6 +351,24 @@ declare type PrismicRichTextProps = {
|
|
|
352
351
|
*/
|
|
353
352
|
declare const PrismicRichText: (props: PrismicRichTextProps) => JSX.Element | null;
|
|
354
353
|
|
|
354
|
+
declare type WordSeparators = "-" | "_" | " ";
|
|
355
|
+
declare type Split<S extends string, Delimiter extends string> = S extends `${infer Head}${Delimiter}${infer Tail}` ? [Head, ...Split<Tail, Delimiter>] : S extends Delimiter ? [] : [S];
|
|
356
|
+
declare type InnerCamelCaseStringArray<Parts extends readonly any[], PreviousPart> = Parts extends [`${infer FirstPart}`, ...infer RemainingParts] ? FirstPart extends undefined ? "" : FirstPart extends "" ? InnerCamelCaseStringArray<RemainingParts, PreviousPart> : `${PreviousPart extends "" ? FirstPart : Capitalize<FirstPart>}${InnerCamelCaseStringArray<RemainingParts, FirstPart>}` : "";
|
|
357
|
+
declare type CamelCaseStringArray<Parts extends readonly string[]> = Parts extends [
|
|
358
|
+
`${infer FirstPart}`,
|
|
359
|
+
...infer RemainingParts
|
|
360
|
+
] ? Uncapitalize<`${FirstPart}${InnerCamelCaseStringArray<RemainingParts, FirstPart>}`> : never;
|
|
361
|
+
declare type CamelCase<K> = K extends string ? CamelCaseStringArray<Split<K extends Uppercase<K> ? Lowercase<K> : K, WordSeparators>> : K;
|
|
362
|
+
/**
|
|
363
|
+
* Converts a string literal to Pascal case.
|
|
364
|
+
*
|
|
365
|
+
* Taken from the `type-fest` package.
|
|
366
|
+
*
|
|
367
|
+
* See:
|
|
368
|
+
* https://github.com/sindresorhus/type-fest/blob/61c35052f09caa23de5eef96d95196375d8ed498/source/pascal-case.d.ts
|
|
369
|
+
*/
|
|
370
|
+
declare type PascalCase<Value> = CamelCase<Value> extends string ? Capitalize<CamelCase<Value>> : CamelCase<Value>;
|
|
371
|
+
|
|
355
372
|
/**
|
|
356
373
|
* The minimum required properties to represent a Prismic Slice for the
|
|
357
374
|
* `<SliceZone>` component.
|
package/dist/index.js
CHANGED
|
@@ -426,4 +426,4 @@ const useAllPrismicDocumentsByEveryTag = (...args) => useStatefulPrismicClientMe
|
|
|
426
426
|
const Elements = Element;
|
|
427
427
|
|
|
428
428
|
export { Elements, PrismicLink, PrismicProvider, PrismicRichText, PrismicText, PrismicToolbar, SliceZone, TODOSliceComponent, useAllPrismicDocumentsByEveryTag, useAllPrismicDocumentsByIDs, useAllPrismicDocumentsBySomeTags, useAllPrismicDocumentsByTag, useAllPrismicDocumentsByType, useAllPrismicDocumentsByUIDs, useAllPrismicDocumentsDangerously, useFirstPrismicDocument, usePrismicClient, usePrismicContext, usePrismicDocumentByID, usePrismicDocumentByUID, usePrismicDocuments, usePrismicDocumentsByEveryTag, usePrismicDocumentsByIDs, usePrismicDocumentsBySomeTags, usePrismicDocumentsByTag, usePrismicDocumentsByType, usePrismicDocumentsByUIDs, usePrismicPreviewResolver, useSinglePrismicDocument };
|
|
429
|
-
//# sourceMappingURL=index.
|
|
429
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/PrismicProvider.tsx","../src/usePrismicContext.ts","../src/lib/__PRODUCTION__.ts","../src/lib/invariant.ts","../src/usePrismicClient.ts","../src/lib/isInternalURL.ts","../src/PrismicLink.tsx","../src/PrismicText.tsx","../src/PrismicRichText.tsx","../src/lib/pascalCase.ts","../src/SliceZone.tsx","../src/PrismicToolbar.tsx","../src/useStatefulPrismicClientMethod.ts","../src/usePrismicPreviewResolver.ts","../src/clientHooks.ts","../src/index.ts"],"sourcesContent":["import type * as prismic from \"@prismicio/client\";\n\nimport * as React from \"react\";\nimport * as prismicH from \"@prismicio/helpers\";\n\nimport { LinkProps } from \"./PrismicLink\";\nimport { JSXFunctionSerializer, JSXMapSerializer } from \"./types\";\n\n/**\n * React context value containing shared configuration for `@prismicio/react`\n * components and hooks.\n */\nexport type PrismicContextValue = {\n\t/**\n\t * A `@prismicio/client` instance used to fetch content from a Prismic\n\t * repository. This is used by `@prismicio/react` hooks, such as\n\t * `usePrismicDocuments()`.\n\t */\n\tclient?: prismic.Client;\n\n\t/**\n\t * A Link Resolver used to resolve links for `<PrismicLink>` and `<PrismicRichText>`.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: prismicH.LinkResolverFunction;\n\n\t/**\n\t * A map or function that maps a Rich Text block to a React component.\n\t *\n\t * @remarks\n\t * Prefer using a map serializer over the function serializer when possible.\n\t * The map serializer is simpler to maintain.\n\t * @example A map serializer.\n\t *\n\t * ```jsx\n\t * {\n\t * heading1: ({children}) => <Heading>{children}</Heading>\n\t * }\n\t * ```\n\t *\n\t * @example A function serializer.\n\t *\n\t * ```jsx\n\t * (type, node, content, children) => {\n\t * \tswitch (type) {\n\t * \t\tcase \"heading1\": {\n\t * \t\t\treturn <Heading>{chidlren}</Heading>;\n\t * \t\t}\n\t * \t}\n\t * };\n\t * ```\n\t */\n\trichTextComponents?: JSXMapSerializer | JSXFunctionSerializer;\n\n\t/**\n\t * The component rendered by `<PrismicLink>` for internal URLs. Defaults to `<a>`.\n\t */\n\tinternalLinkComponent?: React.ElementType<LinkProps>;\n\n\t/**\n\t * The component rendered by `<PrismicLink>` for external URLs. Defaults to `<a>`.\n\t */\n\texternalLinkComponent?: React.ElementType<LinkProps>;\n\n\t/**\n\t * Children for the component.\n\t */\n\tchildren?: React.ReactNode;\n};\n\n/**\n * React context containing shared configuration for `@prismicio/react`\n * components and hooks.\n */\nexport const PrismicContext = React.createContext<PrismicContextValue>({});\n\n/**\n * Props for `<PrismicProvider>`.\n */\nexport type PrismicProviderProps = PrismicContextValue;\n\n/**\n * React context provider to share configuration for `@prismicio/react`\n * components and hooks.\n *\n * @returns A React context provider with shared configuration.\n */\nexport const PrismicProvider = ({\n\tclient,\n\tlinkResolver,\n\trichTextComponents,\n\tinternalLinkComponent,\n\texternalLinkComponent,\n\tchildren,\n}: PrismicProviderProps): JSX.Element => {\n\tconst value = React.useMemo<PrismicContextValue>(\n\t\t() => ({\n\t\t\tclient,\n\t\t\tlinkResolver,\n\t\t\trichTextComponents,\n\t\t\tinternalLinkComponent,\n\t\t\texternalLinkComponent,\n\t\t}),\n\t\t[\n\t\t\tclient,\n\t\t\tlinkResolver,\n\t\t\trichTextComponents,\n\t\t\tinternalLinkComponent,\n\t\t\texternalLinkComponent,\n\t\t],\n\t);\n\n\treturn (\n\t\t<PrismicContext.Provider value={value}>{children}</PrismicContext.Provider>\n\t);\n};\n","import * as React from \"react\";\n\nimport { PrismicContext, PrismicContextValue } from \"./PrismicProvider\";\n\n/**\n * React hook used to read shared configuration for `@prismicio/react`\n * components and hooks.\n *\n * @returns The closest `<PrismicProvider>` context value.\n */\nexport const usePrismicContext = (): PrismicContextValue => {\n\treturn React.useContext(PrismicContext) || {};\n};\n","// We need to polyfill process if it doesn't exist, such as in the browser.\nif (typeof process === \"undefined\") {\n\tglobalThis.process = { env: {} } as typeof process;\n}\n\n/**\n * `true` if in the production environment, `false` otherwise.\n *\n * This boolean can be used to perform actions only in development environments,\n * such as logging.\n */\nexport const __PRODUCTION__ = process.env.NODE_ENV === \"production\";\n","/**\n * MIT License\n *\n * Copyright (c) 2019 Alexander Reardon\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { __PRODUCTION__ } from \"./__PRODUCTION__\";\n\nconst prefix = \"Invariant failed\";\n\n// Throw an error if the condition fails\n// Strip out error messages for production\n// > Not providing an inline default argument for message as the result is smaller\nexport function invariant(\n\tcondition: unknown,\n\tmessage?: string,\n): asserts condition {\n\tif (condition) {\n\t\treturn;\n\t}\n\t// Condition not passed\n\n\t// In production we strip the message but still throw\n\tif (__PRODUCTION__) {\n\t\tthrow new Error(prefix);\n\t}\n\n\t// When not in production we allow the message to pass through\n\t// *This block will be removed in production builds*\n\tthrow new Error(`${prefix}: ${message || \"\"}`);\n}\n","import type * as prismic from \"@prismicio/client\";\n\nimport { invariant } from \"./lib/invariant\";\n\nimport { usePrismicContext } from \"./usePrismicContext\";\n\n/**\n * Retrieve the `@prismicio/client` instance provided to `<PrismicProvider>`\n * higher in the React tree.\n *\n * @param explicitClient - An optional `@prismicio/client` instance to override\n * the Client provided to `<PrismicProvider>`.\n *\n * @returns The `@prismicio/client` instance provided to `<PrismicProvider>`.\n */\nexport const usePrismicClient = (\n\texplicitClient?: prismic.Client,\n): prismic.Client => {\n\tconst context = usePrismicContext();\n\n\tconst client = explicitClient || context?.client;\n\tinvariant(\n\t\tclient,\n\t\t\"A @prismicio/client is required to query documents. Provide a client to the hook or to a <PrismicProvider> higher in your component tree.\",\n\t);\n\n\treturn client;\n};\n","/**\n * Determines if a URL is internal or external.\n *\n * @param url - The URL to check if internal or external.\n *\n * @returns `true` if `url` is internal, `false` otherwise.\n */\n// TODO: This does not detect all relative URLs as internal such as `about` or `./about`. This function assumes relative URLs start with a \"/\" or \"#\"`.\nexport const isInternalURL = (url: string): boolean => {\n\tconst isInternal = /^(\\/(?!\\/)|#)/.test(url);\n\tconst isSpecialLink = !isInternal && !/^https?:\\/\\//.test(url);\n\n\treturn isInternal && !isSpecialLink;\n};\n","import * as React from \"react\";\nimport * as prismicH from \"@prismicio/helpers\";\nimport * as prismicT from \"@prismicio/types\";\n\nimport { isInternalURL } from \"./lib/isInternalURL\";\n\nimport { usePrismicContext } from \"./usePrismicContext\";\n\n/**\n * Props provided to a component when rendered with `<PrismicLink>`.\n */\nexport interface LinkProps {\n\t/**\n\t * The URL to link.\n\t */\n\thref: string;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: string;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Props for `<PrismicLink>`.\n */\nexport type PrismicLinkProps<\n\tInternalComponent extends React.ElementType<LinkProps> = React.ElementType<LinkProps>,\n\tExternalComponent extends React.ElementType<LinkProps> = React.ElementType<LinkProps>,\n\tLinkResolverFunction extends prismicH.LinkResolverFunction = prismicH.LinkResolverFunction,\n> = Omit<\n\tReact.ComponentProps<InternalComponent> &\n\t\tReact.ComponentProps<ExternalComponent>,\n\tkeyof LinkProps\n> & {\n\t/**\n\t * The Link Resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * The component rendered for internal URLs. Defaults to `<a>`.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t */\n\tinternalComponent?: InternalComponent;\n\n\t/**\n\t * The component rendered for external URLs. Defaults to `<a>`.\n\t */\n\texternalComponent?: ExternalComponent;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: string | null;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string | null;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n} & (\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The Prismic Link field containing the URL or document to link.\n\t\t\t\t *\n\t\t\t\t * @see Learn about Prismic Link fields {@link https://prismic.io/docs/core-concepts/link-content-relationship}\n\t\t\t\t */\n\t\t\t\tfield: prismicT.LinkField | null | undefined;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The Prismic document to link.\n\t\t\t\t */\n\t\t\t\tdocument: prismicT.PrismicDocument | null | undefined;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The URL to link.\n\t\t\t\t */\n\t\t\t\thref: string | null | undefined;\n\t\t }\n\t);\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"a\";\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\";\n\n/**\n * React component that renders a link from a Prismic Link field.\n *\n * Different components can be rendered depending on whether the link is\n * internal or external. This is helpful when integrating with client-side\n * routers, such as a router-specific Link component.\n *\n * If a link is configured to open in a new window using `target=\"_blank\"`,\n * `rel=\"noopener noreferrer\"` is set by default.\n *\n * @param props - Props for the component.\n *\n * @returns The internal or external link component depending on whether the\n * link is internal or external.\n */\nexport const PrismicLink = <\n\tInternalComponent extends React.ElementType<LinkProps> = typeof defaultInternalComponent,\n\tExternalComponent extends React.ElementType<LinkProps> = typeof defaultExternalComponent,\n\tLinkResolverFunction extends prismicH.LinkResolverFunction = prismicH.LinkResolverFunction,\n>(\n\tprops: PrismicLinkProps<\n\t\tInternalComponent,\n\t\tExternalComponent,\n\t\tLinkResolverFunction\n\t>,\n): JSX.Element | null => {\n\tconst context = usePrismicContext();\n\n\tconst linkResolver = props.linkResolver || context.linkResolver;\n\n\tlet href: string | null | undefined;\n\tif (\"href\" in props) {\n\t\thref = props.href;\n\t} else if (\"document\" in props && props.document) {\n\t\thref = prismicH.asLink(props.document, linkResolver);\n\t} else if (\"field\" in props && props.field) {\n\t\thref = prismicH.asLink(props.field, linkResolver);\n\t}\n\n\tconst target =\n\t\tprops.target ||\n\t\t(\"field\" in props &&\n\t\t\tprops.field &&\n\t\t\t\"target\" in props.field &&\n\t\t\tprops.field.target) ||\n\t\tundefined;\n\n\tconst rel =\n\t\tprops.rel || (target === \"_blank\" ? \"noopener noreferrer\" : undefined);\n\n\tconst InternalComponent: React.ElementType<LinkProps> =\n\t\tprops.internalComponent ||\n\t\tcontext.internalLinkComponent ||\n\t\tdefaultInternalComponent;\n\n\tconst ExternalComponent: React.ElementType<LinkProps> =\n\t\tprops.externalComponent ||\n\t\tcontext.externalLinkComponent ||\n\t\tdefaultExternalComponent;\n\n\tconst isInternal = href && isInternalURL(href);\n\n\tconst Component = isInternal ? InternalComponent : ExternalComponent;\n\n\tconst passthroughProps: typeof props = Object.assign({}, props);\n\tdelete passthroughProps.linkResolver;\n\tdelete passthroughProps.internalComponent;\n\tdelete passthroughProps.externalComponent;\n\tdelete passthroughProps.rel;\n\tdelete passthroughProps.target;\n\tif (\"field\" in passthroughProps) {\n\t\tdelete passthroughProps.field;\n\t} else if (\"document\" in passthroughProps) {\n\t\tdelete passthroughProps.document;\n\t} else if (\"href\" in passthroughProps) {\n\t\tdelete passthroughProps.href;\n\t}\n\n\treturn href ? (\n\t\t<Component {...passthroughProps} href={href} target={target} rel={rel} />\n\t) : null;\n};\n","import * as React from \"react\";\nimport * as prismicT from \"@prismicio/types\";\nimport * as prismicH from \"@prismicio/helpers\";\n\n/**\n * Props for `<PrismicText>`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic Rich Text field to render.\n\t */\n\tfield: prismicT.RichTextField | null | undefined;\n\n\t/**\n\t * The separator used between blocks. Defaults to `\\n`.\n\t */\n\tseparator?: string;\n};\n\n/**\n * React component that renders content from a Prismic Rich Text field as plain text.\n *\n * @remarks\n * This component returns a React fragment with no wrapping element around the\n * content. If you need a wrapper, add a component around `<PrismicText>`.\n * @example Rendering a Rich Text field as plain text.\n *\n * ```jsx\n * <PrismicText field={document.data.content} />;\n * ```\n *\n * @param props - Props for the component.\n *\n * @returns The Rich Text field's content as plain text.\n *\n * @see Learn about Rich Text fields {@link https://prismic.io/docs/core-concepts/rich-text-title}\n */\nexport const PrismicText = (props: PrismicTextProps): JSX.Element | null => {\n\treturn React.useMemo(() => {\n\t\tif (props.field) {\n\t\t\tconst text = prismicH.asText(props.field, props.separator);\n\n\t\t\treturn <>{text}</>;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}, [props.field, props.separator]);\n};\n","/* eslint-disable react/display-name */\n/* eslint-disable react/prop-types */\n\nimport * as React from \"react\";\nimport * as prismicT from \"@prismicio/types\";\nimport * as prismicH from \"@prismicio/helpers\";\nimport * as prismicR from \"@prismicio/richtext\";\n\nimport { JSXFunctionSerializer, JSXMapSerializer } from \"./types\";\nimport { PrismicLink, PrismicLinkProps } from \"./PrismicLink\";\nimport { usePrismicContext } from \"./usePrismicContext\";\n\n/**\n * Props for `<PrismicRichText>`.\n */\nexport type PrismicRichTextProps = {\n\t/**\n\t * The Prismic Rich Text field to render.\n\t */\n\tfield: prismicT.RichTextField | null | undefined;\n\n\t/**\n\t * The Link Resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses Route Resolvers when querying for your Prismic\n\t * repository's content, a Link Resolver does not need to be provided.\n\t * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: PrismicLinkProps[\"linkResolver\"];\n\n\t/**\n\t * A function that maps a Rich Text block to a React component.\n\t *\n\t * @deprecated Use the `components` prop instead. Prefer using a map\n\t * serializer when possible.\n\t * @see Learn about Rich Text serializers {@link https://prismic.io/docs/core-concepts/html-serializer}\n\t */\n\thtmlSerializer?: JSXFunctionSerializer;\n\n\t/**\n\t * A map or function that maps a Rich Text block to a React component.\n\t *\n\t * @remarks\n\t * Prefer using a map serializer over the function serializer when possible.\n\t * The map serializer is simpler to maintain.\n\t * @example A map serializer.\n\t *\n\t * ```jsx\n\t * {\n\t * heading1: ({children}) => <Heading>{children}</Heading>\n\t * }\n\t * ```\n\t *\n\t * @example A function serializer.\n\t *\n\t * ```jsx\n\t * (type, node, content, children) => {\n\t * \tswitch (type) {\n\t * \t\tcase \"heading1\": {\n\t * \t\t\treturn <Heading>{chidlren}</Heading>;\n\t * \t\t}\n\t * \t}\n\t * };\n\t * ```\n\t */\n\tcomponents?: JSXMapSerializer | JSXFunctionSerializer;\n\n\t/**\n\t * The React component rendered for links when the URL is internal.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\tinternalLinkComponent?: PrismicLinkProps[\"internalComponent\"];\n\n\t/**\n\t * The React component rendered for links when the URL is external.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalLinkComponent?: PrismicLinkProps[\"externalComponent\"];\n};\n\ntype CreateDefaultSerializerArgs = {\n\tlinkResolver: prismicH.LinkResolverFunction<string> | undefined;\n\tinternalLinkComponent: PrismicRichTextProps[\"internalLinkComponent\"];\n\texternalLinkComponent: PrismicRichTextProps[\"externalLinkComponent\"];\n};\n\nconst createDefaultSerializer = (\n\targs: CreateDefaultSerializerArgs,\n): JSXFunctionSerializer =>\n\tprismicR.wrapMapSerializer({\n\t\theading1: ({ children, key }) => <h1 key={key}>{children}</h1>,\n\t\theading2: ({ children, key }) => <h2 key={key}>{children}</h2>,\n\t\theading3: ({ children, key }) => <h3 key={key}>{children}</h3>,\n\t\theading4: ({ children, key }) => <h4 key={key}>{children}</h4>,\n\t\theading5: ({ children, key }) => <h5 key={key}>{children}</h5>,\n\t\theading6: ({ children, key }) => <h6 key={key}>{children}</h6>,\n\t\tparagraph: ({ children, key }) => <p key={key}>{children}</p>,\n\t\tpreformatted: ({ node, key }) => <pre key={key}>{node.text}</pre>,\n\t\tstrong: ({ children, key }) => <strong key={key}>{children}</strong>,\n\t\tem: ({ children, key }) => <em key={key}>{children}</em>,\n\t\tlistItem: ({ children, key }) => <li key={key}>{children}</li>,\n\t\toListItem: ({ children, key }) => <li key={key}>{children}</li>,\n\t\tlist: ({ children, key }) => <ul key={key}>{children}</ul>,\n\t\toList: ({ children, key }) => <ol key={key}>{children}</ol>,\n\t\timage: ({ node, key }) => {\n\t\t\tconst img = (\n\t\t\t\t<img\n\t\t\t\t\tsrc={node.url}\n\t\t\t\t\talt={node.alt ?? undefined}\n\t\t\t\t\tdata-copyright={node.copyright ? node.copyright : undefined}\n\t\t\t\t/>\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\t<p key={key} className=\"block-img\">\n\t\t\t\t\t{node.linkTo ? (\n\t\t\t\t\t\t<PrismicLink\n\t\t\t\t\t\t\tlinkResolver={args.linkResolver}\n\t\t\t\t\t\t\tinternalComponent={args.internalLinkComponent}\n\t\t\t\t\t\t\texternalComponent={args.externalLinkComponent}\n\t\t\t\t\t\t\tfield={node.linkTo}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{img}\n\t\t\t\t\t\t</PrismicLink>\n\t\t\t\t\t) : (\n\t\t\t\t\t\timg\n\t\t\t\t\t)}\n\t\t\t\t</p>\n\t\t\t);\n\t\t},\n\t\tembed: ({ node, key }) => (\n\t\t\t<div\n\t\t\t\tkey={key}\n\t\t\t\tdata-oembed={node.oembed.embed_url}\n\t\t\t\tdata-oembed-type={node.oembed.type}\n\t\t\t\tdata-oembed-provider={node.oembed.provider_name}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: node.oembed.html ?? \"\" }}\n\t\t\t/>\n\t\t),\n\t\thyperlink: ({ node, children, key }) => (\n\t\t\t<PrismicLink\n\t\t\t\tkey={key}\n\t\t\t\tfield={node.data}\n\t\t\t\tlinkResolver={args.linkResolver}\n\t\t\t\tinternalComponent={args.internalLinkComponent}\n\t\t\t\texternalComponent={args.externalLinkComponent}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</PrismicLink>\n\t\t),\n\t\tlabel: ({ node, children, key }) => (\n\t\t\t<span key={key} className={node.data.label}>\n\t\t\t\t{children}\n\t\t\t</span>\n\t\t),\n\t\tspan: ({ text, key }) => {\n\t\t\tconst result: React.ReactNode[] = [];\n\n\t\t\tlet i = 0;\n\t\t\tfor (const line of text.split(\"\\n\")) {\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tresult.push(<br key={`${i}__break`} />);\n\t\t\t\t}\n\n\t\t\t\tresult.push(<React.Fragment key={`${i}__line`}>{line}</React.Fragment>);\n\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\treturn <React.Fragment key={key}>{result}</React.Fragment>;\n\t\t},\n\t});\n\n/**\n * React component that renders content from a Prismic Rich Text field. By\n * default, HTML elements are rendered for each piece of content. A `heading1`\n * block will render an `<h1>` HTML element, for example. Links will use\n * `<PrismicLink>` by default which can be customized using the\n * `internalLinkComponent` and `externalLinkComponent` props.\n *\n * To customize the components that are rendered, provide a map or function\n * serializer to the `components` prop.\n *\n * Components can also be provided in a centralized location using the\n * `<PrismicProvider>` React context provider.\n *\n * @remarks\n * This component returns a React fragment with no wrapping element around the\n * content. If you need a wrapper, add a component around `<PrismicRichText>`.\n * @example Rendering a Rich Text field using the default HTMl elements.\n *\n * ```jsx\n * <PrismicRichText field={document.data.content} />;\n * ```\n *\n * @example Rendering a Rich Text field using a custom set of React components.\n *\n * ```jsx\n * <PrismicRichText\n * \tfield={document.data.content}\n * \tcomponents={{\n * \t\theading1: ({ children }) => <Heading>{children}</Heading>,\n * \t}}\n * />;\n * ```\n *\n * @param props - Props for the component.\n *\n * @returns The Rich Text field's content as React components.\n *\n * @see Learn about Rich Text fields {@link https://prismic.io/docs/core-concepts/rich-text-title}\n * @see Learn about Rich Text serializers {@link https://prismic.io/docs/core-concepts/html-serializer}\n */\nexport const PrismicRichText = (\n\tprops: PrismicRichTextProps,\n): JSX.Element | null => {\n\tconst context = usePrismicContext();\n\n\treturn React.useMemo(() => {\n\t\tif (!props.field) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tconst linkResolver = props.linkResolver || context.linkResolver;\n\n\t\t\tconst serializer = prismicR.composeSerializers(\n\t\t\t\ttypeof props.components === \"object\"\n\t\t\t\t\t? prismicR.wrapMapSerializer(props.components)\n\t\t\t\t\t: props.components,\n\t\t\t\ttypeof context.richTextComponents === \"object\"\n\t\t\t\t\t? prismicR.wrapMapSerializer(context.richTextComponents)\n\t\t\t\t\t: context.richTextComponents,\n\t\t\t\tcreateDefaultSerializer({\n\t\t\t\t\tlinkResolver,\n\t\t\t\t\tinternalLinkComponent: props.internalLinkComponent,\n\t\t\t\t\texternalLinkComponent: props.externalLinkComponent,\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\t// The serializer is wrapped in a higher-order function\n\t\t\t// that automatically applies a key to React Elements\n\t\t\t// if one is not already given.\n\t\t\tconst serialized = prismicR.serialize<JSX.Element>(\n\t\t\t\tprops.field,\n\t\t\t\t(type, node, text, children, key) => {\n\t\t\t\t\tconst result = serializer(type, node, text, children, key);\n\n\t\t\t\t\tif (React.isValidElement(result) && result.key == null) {\n\t\t\t\t\t\treturn React.cloneElement(result, { key });\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\n\t\t\treturn <>{serialized}</>;\n\t\t}\n\t}, [\n\t\tprops.field,\n\t\tprops.internalLinkComponent,\n\t\tprops.externalLinkComponent,\n\t\tprops.components,\n\t\tprops.linkResolver,\n\t\tcontext.linkResolver,\n\t\tcontext.richTextComponents,\n\t]);\n};\n","// `PascalCase`-related types have been taken from the `type-fest` package.\n//\n// They are copied here to mininize dependencies in this project.\n//\n// See: https://github.com/sindresorhus/type-fest/blob/61c35052f09caa23de5eef96d95196375d8ed498/source/camel-case.d.ts\n\ntype WordSeparators = \"-\" | \"_\" | \" \";\n\ntype Split<\n\tS extends string,\n\tDelimiter extends string,\n> = S extends `${infer Head}${Delimiter}${infer Tail}`\n\t? [Head, ...Split<Tail, Delimiter>]\n\t: S extends Delimiter\n\t? []\n\t: [S];\n\ntype InnerCamelCaseStringArray<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tParts extends readonly any[],\n\tPreviousPart,\n> = Parts extends [`${infer FirstPart}`, ...infer RemainingParts]\n\t? FirstPart extends undefined\n\t\t? \"\"\n\t\t: FirstPart extends \"\"\n\t\t? InnerCamelCaseStringArray<RemainingParts, PreviousPart>\n\t\t: `${PreviousPart extends \"\"\n\t\t\t\t? FirstPart\n\t\t\t\t: Capitalize<FirstPart>}${InnerCamelCaseStringArray<\n\t\t\t\tRemainingParts,\n\t\t\t\tFirstPart\n\t\t >}`\n\t: \"\";\n\ntype CamelCaseStringArray<Parts extends readonly string[]> = Parts extends [\n\t`${infer FirstPart}`,\n\t...infer RemainingParts\n]\n\t? Uncapitalize<`${FirstPart}${InnerCamelCaseStringArray<\n\t\t\tRemainingParts,\n\t\t\tFirstPart\n\t >}`>\n\t: never;\n\ntype CamelCase<K> = K extends string\n\t? CamelCaseStringArray<\n\t\t\tSplit<K extends Uppercase<K> ? Lowercase<K> : K, WordSeparators>\n\t >\n\t: K;\n\n/**\n * Converts a string literal to Pascal case.\n *\n * Taken from the `type-fest` package.\n *\n * See:\n * https://github.com/sindresorhus/type-fest/blob/61c35052f09caa23de5eef96d95196375d8ed498/source/pascal-case.d.ts\n */\nexport type PascalCase<Value> = CamelCase<Value> extends string\n\t? Capitalize<CamelCase<Value>>\n\t: CamelCase<Value>;\n\n/**\n * Converts a string to Pascal case.\n *\n * @param input - The string to convert.\n *\n * @returns `input` as Pascal case.\n */\nexport const pascalCase = <Input extends string>(\n\tinput: Input,\n): PascalCase<Input> => {\n\tconst camelCased = input.replace(/(?:-|_)(\\w)/g, (_, c) => {\n\t\treturn c ? c.toUpperCase() : \"\";\n\t});\n\n\treturn (camelCased[0].toUpperCase() +\n\t\tcamelCased.slice(1)) as PascalCase<Input>;\n};\n","import * as React from \"react\";\nimport * as prismicT from \"@prismicio/types\";\n\nimport { __PRODUCTION__ } from \"./lib/__PRODUCTION__\";\nimport { pascalCase, PascalCase } from \"./lib/pascalCase\";\n\n/**\n * The minimum required properties to represent a Prismic Slice for the\n * `<SliceZone>` component.\n *\n * If using Prismic's REST API, use the `Slice` export from `@prismicio/types`\n * for a full interface.\n *\n * @typeParam SliceType - Type name of the Slice.\n */\nexport type SliceLike<SliceType extends string = string> = Pick<\n\tprismicT.Slice<SliceType>,\n\t\"slice_type\"\n>;\n\n/**\n * A looser version of the `SliceZone` type from `@prismicio/types` using `SliceLike`.\n *\n * If using Prismic's REST API, use the `SliceZone` export from\n * `@prismicio/types` for the full type.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n */\nexport type SliceZoneLike<TSlice extends SliceLike> = readonly TSlice[];\n\n/**\n * React props for a component rendering content from a Prismic Slice using the\n * `<SliceZone>` component.\n *\n * @typeParam TSlice - The Slice passed as a prop.\n * @typeParam TContext - Arbitrary data passed to `<SliceZone>` and made\n * available to all Slice components.\n */\nexport type SliceComponentProps<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = {\n\t/**\n\t * Slice data for this component.\n\t */\n\tslice: TSlice;\n\n\t/**\n\t * The index of the Slice in the Slice Zone.\n\t */\n\tindex: number;\n\n\t/**\n\t * All Slices from the Slice Zone to which the Slice belongs.\n\t */\n\t// TODO: We have to keep this list of Slices general due to circular\n\t// reference limtiations. If we had another generic to determine the full\n\t// union of Slice types, it would include TSlice. This causes TypeScript to\n\t// throw a compilation error.\n\tslices: SliceZoneLike<SliceLike>;\n\n\t/**\n\t * Arbitrary data passed to `<SliceZone>` and made available to all Slice components.\n\t */\n\tcontext: TContext;\n};\n\n/**\n * A React component to be rendered for each instance of its Slice.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n */\nexport type SliceComponentType<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = React.ComponentType<SliceComponentProps<TSlice, TContext>>;\n\n/**\n * A record of Slice types mapped to a React component. The component will be\n * rendered for each instance of its Slice.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n */\nexport type SliceZoneComponents<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> =\n\t// This is purposely not wrapped in Partial to ensure a component is provided\n\t// for all Slice types. <SliceZone> will render a default component if one is\n\t// not provided, but it *should* be a type error if an explicit component is\n\t// missing.\n\t//\n\t// If a developer purposely does not want to provide a component, they can\n\t// assign it to the TODOSliceComponent exported from this package. This\n\t// signals to future developers that it is a placeholder and should be\n\t// implemented.\n\t{\n\t\t[SliceType in keyof Record<\n\t\t\tTSlice[\"slice_type\"],\n\t\t\tnever\n\t\t>]: SliceComponentType<\n\t\t\tExtract<TSlice, SliceLike<SliceType>> extends never\n\t\t\t\t? SliceLike\n\t\t\t\t: Extract<TSlice, SliceLike<SliceType>>,\n\t\t\tTContext\n\t\t>;\n\t};\n\n/**\n * This Slice component can be used as a reminder to provide a proper implementation.\n *\n * This is also the default React component rendered when a component mapping\n * cannot be found in `<SliceZone>`.\n */\nexport const TODOSliceComponent = __PRODUCTION__\n\t? () => null\n\t: <TSlice extends SliceLike, TContext>({\n\t\t\tslice,\n\t }: SliceComponentProps<TSlice, TContext>): JSX.Element | null => {\n\t\t\tReact.useEffect(() => {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${slice.slice_type}\"`,\n\t\t\t\t\tslice,\n\t\t\t\t);\n\t\t\t}, [slice]);\n\n\t\t\treturn (\n\t\t\t\t<section\n\t\t\t\t\tdata-slice-zone-todo-component=\"\"\n\t\t\t\t\tdata-slice-type={slice.slice_type}\n\t\t\t\t>\n\t\t\t\t\tCould not find a component for Slice type “{slice.slice_type}\n\t\t\t\t\t”\n\t\t\t\t</section>\n\t\t\t);\n\t };\n\n/**\n * Arguments for a `<SliceZone>` `resolver` function.\n */\ntype SliceZoneResolverArgs<TSlice extends SliceLike = SliceLike> = {\n\t/**\n\t * The Slice to resolve to a React component.\n\t */\n\tslice: TSlice;\n\n\t/**\n\t * The name of the Slice.\n\t */\n\tsliceName: PascalCase<TSlice[\"slice_type\"]>;\n\n\t/**\n\t * The index of the Slice in the Slice Zone.\n\t */\n\ti: number;\n};\n\n/**\n * A function that determines the rendered React component for each Slice in the\n * Slice Zone. If a nullish value is returned, the component will fallback to\n * the `components` or `defaultComponent` props to determine the rendered component.\n *\n * @deprecated Use the `components` prop instead.\n *\n * @param args - Arguments for the resolver function.\n *\n * @returns The React component to render for a Slice.\n */\nexport type SliceZoneResolver<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = (\n\targs: SliceZoneResolverArgs<TSlice>,\n) => SliceComponentType<TSlice, TContext> | undefined | null;\n\n/**\n * React props for the `<SliceZone>` component.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n */\nexport type SliceZoneProps<\n\tTSlice extends SliceLike = SliceLike,\n\tTContext = unknown,\n> = {\n\t/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices?: SliceZoneLike<TSlice>;\n\n\t/**\n\t * A record mapping Slice types to React components.\n\t */\n\tcomponents?: SliceZoneComponents<TSlice, TContext>;\n\n\t/**\n\t * A function that determines the rendered React component for each Slice in\n\t * the Slice Zone.\n\t *\n\t * @deprecated Use the `components` prop instead.\n\t *\n\t * @param args - Arguments for the resolver function.\n\t *\n\t * @returns The React component to render for a Slice.\n\t */\n\tresolver?: SliceZoneResolver<TSlice, TContext>;\n\n\t/**\n\t * The React component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t */\n\tdefaultComponent?: SliceComponentType<TSlice, TContext>;\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext;\n};\n\n/**\n * Renders content from a Prismic Slice Zone using React components for each\n * type of Slice.\n *\n * If a component is not provided for a type of Slice, a default component can\n * be provided. A fallback component is provided by default that will not be\n * rendered in a production build of your app.\n *\n * @typeParam TSlice - The type(s) of a Slice in the Slice Zone.\n * @typeParam TContext - Arbitrary data made available to all Slice components.\n *\n * @returns The Slice Zone's content as React components.\n *\n * @see Learn about Prismic Slices and Slice Zones {@link https://prismic.io/docs/core-concepts/slices}\n */\nexport const SliceZone = <TSlice extends SliceLike, TContext>({\n\tslices = [],\n\tcomponents = {} as SliceZoneComponents<TSlice, TContext>,\n\tresolver,\n\tdefaultComponent = TODOSliceComponent,\n\tcontext = {} as TContext,\n}: SliceZoneProps<TSlice, TContext>): JSX.Element => {\n\tconst renderedSlices = React.useMemo(() => {\n\t\treturn slices.map((slice, index) => {\n\t\t\tlet Comp = (components[slice.slice_type as keyof typeof components] ||\n\t\t\t\tdefaultComponent) as SliceComponentType<TSlice, TContext>;\n\n\t\t\t// TODO: Remove `resolver` in v3 in favor of `components`.\n\t\t\tif (resolver) {\n\t\t\t\tconst resolvedComp = resolver({\n\t\t\t\t\tslice,\n\t\t\t\t\tsliceName: pascalCase(slice.slice_type),\n\t\t\t\t\ti: index,\n\t\t\t\t});\n\n\t\t\t\tif (resolvedComp) {\n\t\t\t\t\tComp = resolvedComp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst key = `${index}-${JSON.stringify(slice)}`;\n\n\t\t\treturn (\n\t\t\t\t<Comp\n\t\t\t\t\tkey={key}\n\t\t\t\t\tslice={slice}\n\t\t\t\t\tindex={index}\n\t\t\t\t\tslices={slices}\n\t\t\t\t\tcontext={context}\n\t\t\t\t/>\n\t\t\t);\n\t\t});\n\t}, [components, context, defaultComponent, slices, resolver]);\n\n\treturn <>{renderedSlices}</>;\n};\n","import * as React from \"react\";\n\n/**\n * Props for `<PrismicToolbar>`.\n */\nexport type PrismicToolbarProps = {\n\t/**\n\t * The name of the Prismic repository. For example, `\"my-repo\"` if the\n\t * repository URL is `my-repo.prismic.io`.\n\t */\n\trepositoryName: string;\n\n\t/**\n\t * The type of toolbar needed for the repository. Defaults to `\"new\"`.\n\t *\n\t * @see To check which version you need, view the Prismic Toolbar documentation {@link https://prismic.io/docs/technologies/previews-and-the-prismic-toolbar-reactjs}\n\t */\n\ttype?: \"new\" | \"legacy\";\n};\n\n/**\n * React component that injects the Prismic Toolbar into the app. This component\n * can be placed anywhere in the React tree.\n */\nexport const PrismicToolbar = ({\n\trepositoryName,\n\ttype = \"new\",\n}: PrismicToolbarProps): null => {\n\tconst src = `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${\n\t\ttype === \"new\" ? \"&new=true\" : \"\"\n\t}`;\n\n\tReact.useEffect(() => {\n\t\tconst existingScript = document.querySelector(`script[src=\"${src}\"]`);\n\n\t\tif (!existingScript) {\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.src = src;\n\t\t\tscript.defer = true;\n\n\t\t\t// Used to distinguish the toolbar element from other elements.\n\t\t\tscript.dataset.prismicToolbar = \"\";\n\t\t\tscript.dataset.repositoryName = repositoryName;\n\t\t\tscript.dataset.type = type;\n\n\t\t\tdocument.body.appendChild(script);\n\t\t}\n\t}, [repositoryName, type, src]);\n\n\treturn null;\n};\n","import type * as prismic from \"@prismicio/client\";\n\nimport * as React from \"react\";\n\nimport { PrismicClientHookState } from \"./types\";\nimport { usePrismicClient } from \"./usePrismicClient\";\n\ntype StateMachineState<TData> = {\n\tstate: PrismicClientHookState;\n\tdata?: TData;\n\terror?: Error;\n};\n\ntype StateMachineAction<TData> =\n\t| [type: \"start\"]\n\t| [type: \"succeed\", payload: TData]\n\t| [type: \"fail\", payload: Error];\n\nconst reducer = <TData>(\n\tstate: StateMachineState<TData>,\n\taction: StateMachineAction<TData>,\n): StateMachineState<TData> => {\n\tswitch (action[0]) {\n\t\tcase \"start\": {\n\t\t\treturn { state: \"loading\" };\n\t\t}\n\n\t\tcase \"succeed\": {\n\t\t\treturn { state: \"loaded\", data: action[1] };\n\t\t}\n\n\t\tcase \"fail\": {\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tstate: \"failed\",\n\t\t\t\terror: action[1],\n\t\t\t};\n\t\t}\n\t}\n};\n\nconst initialState: StateMachineState<never> = {\n\tstate: \"idle\",\n};\n\ntype UnwrapPromise<T> = T extends Promise<infer U> ? U : T;\n\ntype ClientPrototype = typeof prismic.Client.prototype;\n\ntype ClientMethod<MethodName extends keyof ClientPrototype> =\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tClientPrototype[MethodName] extends (...args: any[]) => any\n\t\t? ClientPrototype[MethodName]\n\t\t: never;\n\ntype ClientMethodName = keyof {\n\t[P in keyof prismic.Client as prismic.Client[P] extends (\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t...args: any[]\n\t) => // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tPromise<any>\n\t\t? P\n\t\t: never]: unknown;\n};\n\nexport type ClientMethodParameters<MethodName extends keyof ClientPrototype> =\n\tParameters<ClientMethod<MethodName>>;\n\nexport type HookOnlyParameters = {\n\tclient?: prismic.Client;\n\tskip?: boolean;\n};\n\n/**\n * Determines if a value is a `@prismicio/client` params object.\n *\n * @param value - The value to check.\n *\n * @returns `true` if `value` is a `@prismicio/client` params object, `false` otherwise.\n */\nconst isParams = (\n\tvalue: unknown,\n): value is ClientMethodParameters<\"get\">[0] & HookOnlyParameters => {\n\t// This is a *very* naive check.\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n};\n\n/**\n * The return value of a `@prismicio/client` React hook.\n *\n * @typeParam TData - Data returned by the client.\n */\nexport type ClientHookReturnType<TData = unknown> = [\n\t/**\n\t * Data returned by the client.\n\t */\n\tdata: TData | undefined,\n\n\t/**\n\t * The current state of the hook's client method call.\n\t */\n\tstate: Pick<StateMachineState<TData>, \"state\" | \"error\">,\n];\n\n/**\n * Creates a React hook that forwards arguments to a specific method of a\n * `@prismicio/client` instance. The created hook has its own internal state\n * manager to report async status, such as pending or error statuses.\n *\n * @param methodName - The `@prismicio/client` method to which hook arguments\n * will be forwarded.\n *\n * @returns A new React hook configured for the provided method.\n *\n * @internal\n */\nexport const useStatefulPrismicClientMethod = <\n\tTMethodName extends ClientMethodName,\n\tTArgs extends Parameters<ClientMethod<TMethodName>>,\n\tTData extends UnwrapPromise<ReturnType<ClientMethod<TMethodName>>>,\n>(\n\tmethodName: TMethodName,\n\targs: TArgs,\n\texplicitClient?: prismic.Client,\n): ClientHookReturnType<TData> => {\n\tconst lastArg = args[args.length - 1];\n\tconst {\n\t\tclient: lastArgExplicitClient,\n\t\tskip,\n\t\t...params\n\t} = isParams(lastArg) ? lastArg : ({} as HookOnlyParameters);\n\tconst argsWithoutParams = isParams(lastArg) ? args.slice(0, -1) : args;\n\n\tconst client = usePrismicClient(explicitClient || lastArgExplicitClient);\n\n\tconst [state, dispatch] = React.useReducer<\n\t\tReact.Reducer<StateMachineState<TData>, StateMachineAction<TData>>\n\t>(reducer, initialState);\n\n\tReact.useEffect(\n\t\t() => {\n\t\t\t// Used to prevent dispatching an action if the hook was cleaned up.\n\t\t\tlet didCancel = false;\n\n\t\t\tif (!skip) {\n\t\t\t\tif (!didCancel) {\n\t\t\t\t\tdispatch([\"start\"]);\n\t\t\t\t}\n\n\t\t\t\tclient[methodName]\n\t\t\t\t\t.call(\n\t\t\t\t\t\tclient,\n\t\t\t\t\t\t// @ts-expect-error - Merging method arg types is too complex\n\t\t\t\t\t\t...argsWithoutParams,\n\t\t\t\t\t\tparams,\n\t\t\t\t\t)\n\t\t\t\t\t.then((result) => {\n\t\t\t\t\t\tif (!didCancel) {\n\t\t\t\t\t\t\tdispatch([\"succeed\", result as TData]);\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tif (!didCancel) {\n\t\t\t\t\t\t\tdispatch([\"fail\", error]);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Ensure we don't dispatch an action if the hook is cleaned up.\n\t\t\t() => {\n\t\t\t\tdidCancel = true;\n\t\t\t};\n\t\t},\n\t\t// We must disable exhaustive-deps since we are using\n\t\t// JSON.stringify on params (effectively a deep equality check).\n\t\t// We want this effect to run again anytime params change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tclient,\n\t\t\tmethodName,\n\t\t\tskip,\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\tJSON.stringify(argsWithoutParams),\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\tJSON.stringify(params),\n\t\t],\n\t);\n\n\treturn React.useMemo(\n\t\t() => [\n\t\t\tstate.data,\n\t\t\t{\n\t\t\t\tstate: state.state,\n\t\t\t\terror: state.error,\n\t\t\t},\n\t\t],\n\t\t[state],\n\t);\n};\n","import type * as prismic from \"@prismicio/client\";\n\nimport * as React from \"react\";\n\nimport { usePrismicContext } from \"./usePrismicContext\";\nimport {\n\tClientHookReturnType,\n\tuseStatefulPrismicClientMethod,\n} from \"./useStatefulPrismicClientMethod\";\n\nexport type UsePrismicPreviewResolverArgs = {\n\t/**\n\t * An optional `@prismicio/client` instance to override the Client provided to\n\t * `<PrismicProvider>`\n\t */\n\tclient?: prismic.Client;\n\n\t/**\n\t * A function that maps a Prismic document to a URL within your app.\n\t */\n\tlinkResolver?: Parameters<\n\t\tprismic.Client[\"resolvePreviewURL\"]\n\t>[0][\"linkResolver\"];\n\n\t/**\n\t * A fallback URL if the Link Resolver does not return a value.\n\t */\n\tdefaultURL?: Parameters<prismic.Client[\"resolvePreviewURL\"]>[0][\"defaultURL\"];\n\n\t/**\n\t * The preview token (also known as a ref) that will be used to query preview\n\t * content from the Prismic repository.\n\t */\n\tpreviewToken?: Parameters<\n\t\tprismic.Client[\"resolvePreviewURL\"]\n\t>[0][\"previewToken\"];\n\n\t/**\n\t * The previewed document that will be used to determine the destination URL.\n\t */\n\tdocumentID?: Parameters<prismic.Client[\"resolvePreviewURL\"]>[0][\"documentID\"];\n\n\t/**\n\t * A function to automatically navigate to the resolved URL. If a function is\n\t * not provded, `usePreviewResolver` will not navigate to the URL.\n\t *\n\t * @param url - The resolved preview URL.\n\t */\n\tnavigate?: (url: string) => unknown;\n};\n\n/**\n * Resolve a preview session's URL. The resolved URL can be used to redirect to\n * the previewed document.\n *\n * If a `navigate` function is provided, the hook will automatically navigate to\n * the previewed document's URL.\n *\n * @param args - Arguments to configure how a URL is resolved.\n *\n * @returns A tuple containing the resolved URL and the hook's state.\n */\nexport const usePrismicPreviewResolver = (\n\targs: UsePrismicPreviewResolverArgs = {},\n): ClientHookReturnType<string> => {\n\tconst context = usePrismicContext();\n\n\tconst linkResolver = args.linkResolver || context.linkResolver;\n\n\tconst result = useStatefulPrismicClientMethod(\n\t\t\"resolvePreviewURL\",\n\t\t[\n\t\t\t{\n\t\t\t\tlinkResolver,\n\t\t\t\tdefaultURL: args.defaultURL || \"/\",\n\t\t\t\tpreviewToken: args.previewToken,\n\t\t\t\tdocumentID: args.documentID,\n\t\t\t},\n\t\t],\n\t\targs.client,\n\t);\n\n\tconst [resolvedURL] = result;\n\tconst { navigate } = args;\n\n\tReact.useEffect(() => {\n\t\tif (resolvedURL && navigate) {\n\t\t\tnavigate(resolvedURL);\n\t\t}\n\t}, [resolvedURL, navigate]);\n\n\treturn result;\n};\n","import type * as prismicT from \"@prismicio/types\";\n\nimport {\n\tClientHookReturnType,\n\tClientMethodParameters,\n\tHookOnlyParameters,\n\tuseStatefulPrismicClientMethod,\n} from \"./useStatefulPrismicClientMethod\";\n\n/**\n * A hook that queries content from the Prismic repository.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.get}\n */\nexport const usePrismicDocuments = <TDocument extends prismicT.PrismicDocument>(\n\t...args: [params?: ClientMethodParameters<\"get\">[0] & HookOnlyParameters]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"get\", args);\n\n/**\n * A hook that queries content from the Prismic repository and returns only the\n * first result, if any.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getFirst}\n */\nexport const useFirstPrismicDocument = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [params?: ClientMethodParameters<\"getFirst\">[0] & HookOnlyParameters]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getFirst\", args);\n\n/**\n * A hook that queries content from the Prismic repository and returns all\n * matching content. If no predicates are provided, all documents will be fetched.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAll}\n */\nexport const useAllPrismicDocumentsDangerously = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tparams?: ClientMethodParameters<\"dangerouslyGetAll\">[0] &\n\t\t\tHookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"dangerouslyGetAll\", args);\n\n/**\n * A hook that queries a document from the Prismic repository with a specific ID.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param id - ID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByID}\n */\nexport const usePrismicDocumentByID = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByID\">[0],\n\t\tparams?: ClientMethodParameters<\"getByID\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByID\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByIDs}\n */\nexport const usePrismicDocumentsByIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getByIDs\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByIDs\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific IDs.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param ids - A list of document IDs\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByIDs}\n */\nexport const useAllPrismicDocumentsByIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tid: ClientMethodParameters<\"getAllByIDs\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByIDs\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByIDs\", args);\n\n/**\n * A hook that queries a document from the Prismic repository with a specific\n * UID and Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uid - UID of the document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const usePrismicDocumentByUID = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUID\">[0],\n\t\tuid: ClientMethodParameters<\"getByUID\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUID\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getByUID\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific UIDs\n * of a Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs.\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const usePrismicDocumentsByUIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByUIDs\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * UIDs of a Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the document's Custom Type\n * @param uids - A list of document UIDs.\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByUID}\n */\nexport const useAllPrismicDocumentsByUIDs = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByUIDs\">[0],\n\t\tuids: ClientMethodParameters<\"getByUIDs\">[1],\n\t\tparams?: ClientMethodParameters<\"getByUIDs\">[2] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByUIDs\", args);\n\n/**\n * A hook that queries a singleton document from the Prismic repository for a\n * specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of the Prismic document returned\n *\n * @param documentType - The API ID of the singleton Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getSingle}\n */\nexport const useSinglePrismicDocument = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getSingle\">[0],\n\t\tparams?: ClientMethodParameters<\"getSingle\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument> =>\n\tuseStatefulPrismicClientMethod(\"getSingle\", args);\n\n/**\n * A hook that queries documents from the Prismic repository for a specific Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByType}\n */\nexport const usePrismicDocumentsByType = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getByType\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByType\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository for a specific\n * Custom Type.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param documentType - The API ID of the Custom Type\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByType}\n */\nexport const useAllPrismicDocumentsByType = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\tdocumentType: ClientMethodParameters<\"getAllByType\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByType\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByType\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with a specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTag}\n */\nexport const usePrismicDocumentsByTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByTag\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with a specific tag.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tag - The tag that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTag}\n */\nexport const useAllPrismicDocumentsByTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByTag\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific tags.\n * A document must be tagged with at least one of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTags}\n */\nexport const usePrismicDocumentsBySomeTags = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getBySomeTags\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getBySomeTags\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * tags. A document must be tagged with at least one of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTags}\n */\nexport const useAllPrismicDocumentsBySomeTags = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllBySomeTags\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllBySomeTags\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllBySomeTags\", args);\n\n/**\n * A hook that queries documents from the Prismic repository with specific tags.\n * A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter, sort, and paginate results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getByTags}\n */\nexport const usePrismicDocumentsByEveryTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getByEveryTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<prismicT.Query<TDocument>> =>\n\tuseStatefulPrismicClientMethod(\"getByEveryTag\", args);\n\n/**\n * A hook that queries all documents from the Prismic repository with specific\n * tags. A document must be tagged with all of the queried tags to be included.\n *\n * @remarks\n * An additional `@prismicio/client` instance can be provided at `params.client`.\n *\n * @typeParam TDocument - Type of Prismic documents returned\n *\n * @param tags - A list of tags that must be included on a document\n * @param params - Parameters to filter and sort results\n *\n * @returns The composable payload {@link ClientHookReturnType}\n *\n * @see Underlying `@prismicio/client` method {@link proto.getAllByTags}\n */\nexport const useAllPrismicDocumentsByEveryTag = <\n\tTDocument extends prismicT.PrismicDocument,\n>(\n\t...args: [\n\t\ttag: ClientMethodParameters<\"getAllByEveryTag\">[0],\n\t\tparams?: ClientMethodParameters<\"getAllByEveryTag\">[1] & HookOnlyParameters,\n\t]\n): ClientHookReturnType<TDocument[]> =>\n\tuseStatefulPrismicClientMethod(\"getAllByEveryTag\", args);\n","export { PrismicProvider } from \"./PrismicProvider\";\nexport type {\n\tPrismicProviderProps,\n\tPrismicContextValue,\n} from \"./PrismicProvider\";\n\nexport { usePrismicContext } from \"./usePrismicContext\";\n\nexport { usePrismicClient } from \"./usePrismicClient\";\n\nexport { PrismicLink } from \"./PrismicLink\";\nexport type { PrismicLinkProps, LinkProps } from \"./PrismicLink\";\n\nexport { PrismicText } from \"./PrismicText\";\nexport type { PrismicTextProps } from \"./PrismicText\";\n\nexport { PrismicRichText } from \"./PrismicRichText\";\nexport type { PrismicRichTextProps } from \"./PrismicRichText\";\n\nimport { Element } from \"@prismicio/richtext\";\nexport { Element };\n/**\n * @deprecated Renamed to `Element` (without an \"s\").\n */\n// TODO: Remove in v3.\nexport const Elements = Element;\n\nexport { SliceZone, TODOSliceComponent } from \"./SliceZone\";\nexport type {\n\tSliceComponentProps,\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n\tSliceZoneProps,\n\tSliceZoneResolver,\n} from \"./SliceZone\";\n\nexport { PrismicToolbar } from \"./PrismicToolbar\";\nexport type { PrismicToolbarProps } from \"./PrismicToolbar\";\n\nexport { usePrismicPreviewResolver } from \"./usePrismicPreviewResolver\";\nexport type { UsePrismicPreviewResolverArgs } from \"./usePrismicPreviewResolver\";\n\nexport {\n\tuseAllPrismicDocumentsDangerously,\n\tuseAllPrismicDocumentsByEveryTag,\n\tuseAllPrismicDocumentsByIDs,\n\tuseAllPrismicDocumentsBySomeTags,\n\tuseAllPrismicDocumentsByTag,\n\tuseAllPrismicDocumentsByType,\n\tuseAllPrismicDocumentsByUIDs,\n\tuseFirstPrismicDocument,\n\tusePrismicDocumentByID,\n\tusePrismicDocumentByUID,\n\tusePrismicDocuments,\n\tusePrismicDocumentsByEveryTag,\n\tusePrismicDocumentsByIDs,\n\tusePrismicDocumentsBySomeTags,\n\tusePrismicDocumentsByTag,\n\tusePrismicDocumentsByType,\n\tusePrismicDocumentsByUIDs,\n\tuseSinglePrismicDocument,\n} from \"./clientHooks\";\n\nexport type {\n\tJSXMapSerializer,\n\tJSXFunctionSerializer,\n\tPrismicClientHookState,\n} from \"./types\";\n"],"names":[],"mappings":";;;;;;MA8Ea,iBAAiB,MAAM,cAAmC;MAa1D,kBAAkB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACwC;AACxC,QAAM,QAAQ,MAAM,QACnB;AAAO,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MAED;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAIF,6CACE,eAAe,UAAhB;AAAA,IAAyB;AAAA,KAAe;AAAA;;MC3G7B,oBAAoB,MAA2B;AAC3D,SAAO,MAAM,WAAW,mBAAmB;AAAA;;ACV5C,IAAI,OAAO,YAAY,aAAa;AACnC,aAAW,UAAU,EAAE,KAAK;AAAA;MAShB,iBAAiB,QAAQ,IAAI,aAAa;;ACevD,MAAM,SAAS;mBAMd,WACA,SACoB;AACpB,MAAI,WAAW;AACd;AAAA;AAKD,MAAI,gBAAgB;AACnB,UAAM,IAAI,MAAM;AAAA;AAKjB,QAAM,IAAI,MAAM,GAAG,WAAW,WAAW;AAAA;;MChC7B,mBAAmB,CAC/B,mBACoB;AACpB,QAAM,UAAU;AAEhB,QAAM,SAAS,sDAA2B;AAC1C,YACC,QACA;AAGD,SAAO;AAAA;;MClBK,gBAAgB,CAAC,QAAyB;AACtD,QAAM,aAAa,gBAAgB,KAAK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