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AS3H,EAAO2H,QAAQjG,IAAIqG,IAAMqC,EAAAA,EAAAA,IAAAA,EAAAA,EAAAA,GAAA,GAAUrC,GAAM,IAAEqL,WAAYrL,EAAOC,uBACrE,IAAAsvB,EAAAA,EAAI,IAEN,CAACT,IAEJ,OACC13B,EAAAA,cAAA,OAAKqD,UAAU,gBACdrD,EAAAA,cAACs4B,EAAAA,GAA0B,KAC1Bt4B,EAAAA,cAACkM,GAAuBd,SAAQ,CAAC5I,MAAOw1B,GACvCh4B,EAAAA,cAACtB,EAAAA,EAAa,KACbsB,EAAAA,cAACqM,GAA4B,CAC5BC,MAAO6qB,EACP5qB,OAAQ8qB,EACR7qB,UAAW+qB,EACX9qB,oBAAqBA,EACrBE,OAAQA,GAER3M,EAAAA,cAACwJ,EAAwB,CAACtB,kBAAmBA,GAC5ClI,EAAAA,cAAC2zB,GAAoB,CACpBC,WAAYiE,EACZ9gB,oBAAqBA,EACrB2T,iBAAkBA,EAClB1F,qBAAsBA,EACtBwJ,oBAAqBA,EACrBC,WAAYA,EACZC,WAAYA,QAMjB1uB,EAAAA,cAAC6yB,EAAe,CAACztB,YAAY,wBAIjC,gBG1xBO,SAAS8yB,EAAuB32B,GACtC,GAAIA,QACH,OAAO,KAGR,IACC,OAAOg3B,KAAKC,MAAMj3B,EACnB,CAAE,MAAAiJ,GACD,OAAO,IACR,CACD","sources":["webpack://@logos/commerceweb-frontend/./Scripts/site/components/error-boundary/index.jsx","webpack://@logos/commerceweb-frontend/./Scripts/site/hooks/use-author.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/shared/books-by-author/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/hooks/use-publisher.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/content/section-content.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/clients/content-client.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/category-content.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/user-search-filter-context.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/accordion/accordion.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/search-resources.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/algolia-search-context.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/util.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/filters.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/refinements.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/hidden-facet-refinements.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/skeleton/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/shared/enhanced-for-logos-label/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/shared/enhanced-for-logos-with-tooltip/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/product-card/use-product-card.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/product-card/product-image.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/product-card/discount-badge.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/product-card/product-title.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/product-card/product-authors.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/product-card/product-pricing.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/product-card/algolia-grid-card.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/product-card/product-overview.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/product-card/algolia-list-card.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/products.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/radio-accordion.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/sort-by-accordion.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/hits-per-page-accordion.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/use-view-mode.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/routing.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/hooks/use-search-impressions.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/search/hooks/use-search-analytics.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/util/safe-json-parse.ts"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass ErrorBoundary extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\thasError: false,\n\t\t\terror: null,\n\t\t\terrorInfo: null,\n\t\t};\n\t}\n\n\tstatic getDerivedStateFromError(error) {\n\t\t// Update state so the next render will show the fallback UI\n\t\treturn { hasError: true };\n\t}\n\n\tcomponentDidCatch(error, errorInfo) {\n\t\t// Store error details in state\n\t\tthis.setState({\n\t\t\terror,\n\t\t\terrorInfo,\n\t\t});\n\n\t\t// Notify parent component about the error\n\t\tif (this.props.onError) {\n\t\t\tthis.props.onError(error, errorInfo);\n\t\t}\n\n\t\t// Log error to console or external service\n\t\tconsole.error('ErrorBoundary caught an error:', error, errorInfo);\n\t}\n\n\tresetErrorBoundary = () => {\n\t\tthis.setState({\n\t\t\thasError: false,\n\t\t\terror: null,\n\t\t\terrorInfo: null,\n\t\t});\n\n\t\t// Notify parent that error was reset\n\t\tif (this.props.onReset) {\n\t\t\tthis.props.onReset();\n\t\t}\n\t};\n\n\trender() {\n\t\tif (this.state.hasError) {\n\t\t\t// If custom error template is provided, use it\n\t\t\tif (this.props.fallback) {\n\t\t\t\tif (typeof this.props.fallback !== 'function') {\n\t\t\t\t\treturn this.fallback;\n\t\t\t\t}\n\n\t\t\t\t// Pass error details and reset function to custom template\n\t\t\t\treturn this.props.fallback({\n\t\t\t\t\terror: this.state.error,\n\t\t\t\t\terrorInfo: this.state.errorInfo,\n\t\t\t\t\tresetErrorBoundary: this.resetErrorBoundary,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// If fallbackComponent is provided as a React component\n\t\t\tif (this.props.fallbackComponent) {\n\t\t\t\tconst FallbackComponent = this.props.fallbackComponent;\n\t\t\t\treturn (\n\t\t\t\t\t<FallbackComponent\n\t\t\t\t\t\terror={this.state.error}\n\t\t\t\t\t\terrorInfo={this.state.errorInfo}\n\t\t\t\t\t\tresetErrorBoundary={this.resetErrorBoundary}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.props.children;\n\t}\n}\n\nErrorBoundary.propTypes = {\n\tchildren: PropTypes.node.isRequired,\n\tfallback: PropTypes.func,\n\tfallbackComponent: PropTypes.elementType,\n\tonError: PropTypes.func,\n\tonReset: PropTypes.func,\n\tshowError: PropTypes.bool,\n};\n\nErrorBoundary.defaultProps = {\n\tshowError: false,\n};\n\nexport default ErrorBoundary;\n","import { createBatchContext } from './use-batch';\n\ninterface AuthorInfo {\n\tid: string;\n\tdisplayName: string;\n\timageUrlLarge?: string;\n\tlongDescription?: string;\n}\n\nexport const AuthorBatch = createBatchContext<string, AuthorInfo>(\n\tasync ids => {\n\t\tconst nonEmptyIds = ids.filter(id => id);\n\t\tif (nonEmptyIds.length === 0) {\n\t\t\treturn [];\n\t\t}\n\t\tconst response = await fetch(`/api/authors?ids=${nonEmptyIds.join(',')}`);\n\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(`HTTP error! status: ${response.status}`);\n\t\t}\n\n\t\treturn (await response.json()) as AuthorInfo[];\n\t},\n\t(id, data) => data.find(d => d.id === id)\n);\n\nexport function useAuthor(id: string) {\n\treturn AuthorBatch.useData(id);\n}\n","import React, { useState } from 'react';\nimport { IconButton, Typography } from '@faithlife/commerce-components';\nimport { ChevronDown, ChevronUp } from 'lucide-react';\nimport { useRefinementList } from 'react-instantsearch';\nimport { AuthorBio } from '../author-bio';\nimport { useAuthor } from '../../../hooks/use-author';\n\nconst useGetRefinedValues = (attribute: string) =>\n\tuseRefinementList({ attribute })\n\t\t.items.filter(item => item.isRefined)\n\t\t.map(item => item.value) ?? [];\n\ninterface BooksByAuthorProps {\n\tresources: {\n\t\tbooksBy: string;\n\t\tshowMore: string;\n\t\tshowLess: string;\n\t};\n}\n\nexport const BooksByAuthor = ({ resources }: BooksByAuthorProps) => {\n\tconst refinedAuthorIds = useGetRefinedValues('authorIds');\n\tconst authorId = refinedAuthorIds?.length === 1 ? refinedAuthorIds[0] : '';\n\tconst { data: author, isLoading } = useAuthor(authorId);\n\n\tconst [isCollapsed, setIsCollapsed] = useState(false);\n\n\tif (isLoading || !authorId || !author || !author.displayName || !author.longDescription) {\n\t\treturn <></>;\n\t}\n\n\treturn (\n\t\t<div className=\"bg-[#f2f2f2] border-t border-b border-[#b1b1b1] px-3 py-4 md:p-6\">\n\t\t\t<div className=\"flex justify-between\">\n\t\t\t\t<Typography variant=\"headingH6\">\n\t\t\t\t\t{resources.booksBy} {author?.displayName}\n\t\t\t\t</Typography>\n\t\t\t\t<IconButton aria-label=\"Toggle collapse\" scale=\"sm\" onClick={() => setIsCollapsed(!isCollapsed)}>\n\t\t\t\t\t{isCollapsed ? <ChevronDown /> : <ChevronUp />}\n\t\t\t\t</IconButton>\n\t\t\t</div>\n\t\t\t{!isCollapsed && (\n\t\t\t\t<AuthorBio\n\t\t\t\t\tclassName=\"mt-4 rounded-[3px] border border-[#d8d8d8] bg-white p-4 md:p-8\"\n\t\t\t\t\tresources={resources}\n\t\t\t\t\tdisplayName={author?.displayName}\n\t\t\t\t\timageUrl={author?.imageUrlLarge}\n\t\t\t\t\tbio={author?.longDescription}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { createBatchContext } from './use-batch';\n\nexport interface PublisherInfo {\n\tid: string;\n\tdisplayName: string;\n}\n\nexport const PublisherBatch = createBatchContext<string, PublisherInfo>(\n\tasync ids => {\n\t\tconst nonEmptyIds = ids.filter(id => id);\n\t\tif (nonEmptyIds.length === 0) {\n\t\t\treturn [];\n\t\t}\n\t\tconst response = await fetch(`/api/publisher?ids=${nonEmptyIds.join(',')}`);\n\n\t\tif (!response.ok) {\n\t\t\tthrow new Error(`HTTP error! status: ${response.status}`);\n\t\t}\n\n\t\treturn (await response.json()) as PublisherInfo[];\n\t},\n\t(id, data) => data.find(d => d.id === id)\n);\n\nexport function usePublisher(id: string) {\n\treturn PublisherBatch.useData(id);\n}\n","import React, { useEffect, useState } from 'react';\n\nimport { RenderBuilderContent } from '../builder';\nimport { getSections } from '../../clients/content-client';\nimport { useLocation } from '../../location';\nimport { useIsPreviewingThisBuilderModel, SectionContentViewModel, SectionKind } from '../../builder';\nimport { c_defaultUserInfo } from '../per-user-data/per-user-data-context';\nimport { notifyWarning } from '../notifications';\n\ninterface ContentChangeEvent {\n\thasContent: boolean;\n\tcontentKey: string;\n}\n\nconst builderIoModelNamesBySectionKindMap: Record<SectionKind, string> = {\n\tsearchResultsAbove: 'search-results-above',\n\tsearchResultsBelow: 'search-results-below',\n\tuniversalHeader: 'universal-header',\n\tuniversalFooter: 'universal-footer',\n\tsubscriptionChurnPrevention: 'subscription-churn-prevention',\n\tconfigurationWizardSubscriptionsBanner: 'configuration-wizard-subscriptions-banner',\n\tconfigurationWizardSubscriptionsContent: 'configuration-wizard-subscriptions-content',\n\tconfigurationWizardLibrariesBanner: 'configuration-wizard-libraries-banner',\n\torderSummary: 'order-summary',\n\torderSummaryFooter: 'order-summary-footer',\n\tproductPage: 'product-page',\n\tadzone: 'adzone',\n\tnotifications: 'notifications',\n};\n\nfunction getContentKey(sectionContents: SectionContentViewModel[]): string {\n\treturn sectionContents\n\t\t.filter(sc => !!sc)\n\t\t.map(sc => `${sc.sectionKind}:${sc.contentSourceKind}:${sc.contentId}`)\n\t\t.join('|');\n}\n\nconst SectionContent = ({\n\tsectionKind,\n\tonContentChange,\n}: {\n\tsectionKind: SectionKind;\n\tonContentChange?: (event: ContentChangeEvent) => void;\n}) => {\n\tconst [sectionContents, setSectionContents] = useState<SectionContentViewModel[]>([]);\n\tconst builderIoModel = builderIoModelNamesBySectionKindMap[sectionKind];\n\tconst isBuilderIoPreviewingThisModel = useIsPreviewingThisBuilderModel(builderIoModel);\n\tconst location = useLocation();\n\n\tuseEffect(() => {\n\t\tconst fetchSections = async () => {\n\t\t\tconst sections = await getSections({\n\t\t\t\tkind: sectionKind,\n\t\t\t\turl: location.href,\n\t\t\t});\n\n\t\t\tsetSectionContents(sections);\n\n\t\t\tconst filteredSections = sections.filter(sc => !!sc);\n\t\t\tonContentChange?.({\n\t\t\t\thasContent: filteredSections.length > 0 || isBuilderIoPreviewingThisModel,\n\t\t\t\tcontentKey: getContentKey(filteredSections),\n\t\t\t});\n\t\t};\n\n\t\tif (!isBuilderIoPreviewingThisModel) {\n\t\t\tfetchSections();\n\t\t}\n\t}, [sectionKind, location.href, onContentChange, isBuilderIoPreviewingThisModel]);\n\n\tuseEffect(() => {\n\t\tif (isBuilderIoPreviewingThisModel) {\n\t\t\tnotifyWarning(`You are previewing the \"${builderIoModel}\" Builder.io model.`);\n\t\t}\n\t}, [isBuilderIoPreviewingThisModel, builderIoModel]);\n\n\tif (isBuilderIoPreviewingThisModel) {\n\t\treturn (\n\t\t\t<RenderBuilderContent\n\t\t\t\tmodel={builderIoModel}\n\t\t\t\tstaticData={{\n\t\t\t\t\tstaticProductData: [],\n\t\t\t\t\tuserInfo: c_defaultUserInfo,\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst filteredContents = sectionContents.filter(sc => !!sc);\n\tconst hasContent = filteredContents.length > 0;\n\n\tif (!hasContent) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{filteredContents.map(sc =>\n\t\t\t\tsc.contentSourceKind === 'builderIo' ? <RenderBuilderContent key={sc.contentId} {...sc.builderIo} /> : null\n\t\t\t)}\n\t\t</>\n\t);\n};\n\nexport default SectionContent;\n","import { fetch } from '../util/fetch';\nimport { SectionContentViewModel, SectionKind } from '../builder';\n\ninterface Params {\n\tkind: SectionKind;\n\turl: string;\n}\n\nexport async function getSections({ kind, url }: Params): Promise<SectionContentViewModel[]> {\n\ttry {\n\t\tconst response = await fetch.get({\n\t\t\turl: '/api/sections',\n\t\t\tparams: { kind, url },\n\t\t});\n\n\t\tconst results = await response.json();\n\t\treturn results as unknown as SectionContentViewModel[];\n\t} catch (error) {\n\t\treturn [];\n\t}\n}\n","import React, { useState, useCallback } from 'react';\n\nimport ReadMoreReadLess from '../read-more-read-less';\nimport { SectionContent } from '../content';\nimport ErrorBoundary from '../error-boundary';\nimport { SectionKind } from '../../builder';\n\ninterface Props {\n\tsectionKind: SectionKind;\n}\n\ninterface ContentChangeEvent {\n\thasContent: boolean;\n\tcontentKey: string;\n}\n\nconst CategoryContent = ({ sectionKind }: Props) => {\n\t// Merged into one state object so both values update in a single render,\n\t// avoiding separate re-renders that can cause SectionContent to remount.\n\tconst [{ hasContent, contentKey }, setContentState] = useState({ hasContent: false, contentKey: '' });\n\n\tconst handleContentChange = useCallback((event: ContentChangeEvent) => {\n\t\tsetContentState(prev =>\n\t\t\tprev.hasContent === event.hasContent && prev.contentKey === event.contentKey\n\t\t\t\t? prev\n\t\t\t\t: { hasContent: event.hasContent, contentKey: event.contentKey }\n\t\t);\n\t}, []);\n\n\t// SectionContent always stays in the same tree position (inside ReadMoreReadLess).\n\t// Changing the parent conditionally would cause SectionContent to unmount/remount\n\t// and re-fire the sections AJAX on every hasContent or contentKey state change.\n\treturn (\n\t\t<ErrorBoundary>\n\t\t\t<div className={hasContent ? 'w-full' : 'hidden'}>\n\t\t\t\t<ReadMoreReadLess contentKey={contentKey}>\n\t\t\t\t\t<SectionContent sectionKind={sectionKind} onContentChange={handleContentChange} />\n\t\t\t\t</ReadMoreReadLess>\n\t\t\t</div>\n\t\t</ErrorBoundary>\n\t);\n};\n\nexport default CategoryContent;\n","import React, { createContext, useContext, useEffect, useMemo, useState } from 'react';\n\nimport { useLocation } from '../../location';\n\nexport interface UserSearchFilterOption {\n\tdisplayName: string;\n\tisDefault?: boolean;\n\talgoliaValue: string;\n\ttoken: string;\n}\n\nexport interface UserSearchFilter {\n\ttitle: string;\n\toptions: UserSearchFilterOption[];\n\ttoken: string;\n}\n\nexport interface UserSearchFilters {\n\tfilters: UserSearchFilter[];\n}\n\ninterface UserSearchFilterContextValue {\n\tselectedFilterOptions: Record<string, string>;\n\tsetSelectedFilterOption: (filterToken: string, optionToken: string) => void;\n\tuserSearchFilters: UserSearchFilter[];\n}\n\nconst UserSearchFilterContext = createContext<UserSearchFilterContextValue | null>(null);\n\nfunction getDefaultSelectedFilterOptions(userSearchFilters: UserSearchFilter[]) {\n\treturn userSearchFilters.reduce<Record<string, string>>((selectedOptions, filter) => {\n\t\tconst options = Array.isArray(filter?.options) ? filter.options : [];\n\t\tconst selectedOption = options.find(option => option?.isDefault) ?? options[0];\n\n\t\tif (selectedOption?.token) {\n\t\t\tselectedOptions[filter.token] = selectedOption.token;\n\t\t}\n\n\t\treturn selectedOptions;\n\t}, {});\n}\n\nfunction readUserFilterSelectionsFromUrl(\n\tuserSearchFilters: UserSearchFilter[],\n\tsearchParams: URLSearchParams\n): Record<string, string> {\n\tconst defaults = getDefaultSelectedFilterOptions(userSearchFilters);\n\n\treturn userSearchFilters.reduce<Record<string, string>>((selectedOptions, filter) => {\n\t\tconst options = Array.isArray(filter?.options) ? filter.options : [];\n\t\tconst urlValue = searchParams.get(filter.token);\n\t\tconst matchingOption = urlValue ? options.find(option => option?.token === urlValue) : undefined;\n\n\t\tconst resolved = matchingOption?.token ?? defaults[filter.token];\n\t\tif (resolved) {\n\t\t\tselectedOptions[filter.token] = resolved;\n\t\t}\n\n\t\treturn selectedOptions;\n\t}, {});\n}\n\nfunction writeUserFilterSelectionsToUrl(\n\tselectedFilterOptions: Record<string, string>,\n\tuserSearchFilters: UserSearchFilter[],\n\tsearch: string,\n\tpathname: string,\n\treplaceUrl: (url: string) => void\n) {\n\tlet url: URL;\n\ttry {\n\t\turl = new URL(`https://placeholder${pathname}${search}`);\n\t} catch {\n\t\t// Malformed pathname/search — skip URL update rather than crash.\n\t\treturn;\n\t}\n\n\tfor (const filter of userSearchFilters) {\n\t\tconst selectedToken = selectedFilterOptions[filter.token];\n\n\t\tif (selectedToken) {\n\t\t\turl.searchParams.set(filter.token, selectedToken);\n\t\t} else {\n\t\t\turl.searchParams.delete(filter.token);\n\t\t}\n\t}\n\n\ttry {\n\t\treplaceUrl(`${url.pathname}${url.search}`);\n\t} catch {\n\t\t// History replacement can fail in some browsers / iframes.\n\t}\n}\n\nexport function useUserSearchFilterContext() {\n\tconst context = useContext(UserSearchFilterContext);\n\tif (!context) {\n\t\tthrow new Error('useUserSearchFilterContext must be used within UserSearchFilterProvider');\n\t}\n\treturn context;\n}\n\nexport function UserSearchFilterProvider({\n\tuserSearchFilters,\n\tsetSelectedFilterOptionsOverride,\n\tchildren,\n}: {\n\tuserSearchFilters: UserSearchFilter[];\n\tsetSelectedFilterOptionsOverride?: () => Record<string, string>;\n\tchildren: React.ReactNode;\n}) {\n\tconst { search, pathname, replaceUrl } = useLocation();\n\tconst searchParams = useMemo(() => new URLSearchParams(search), [search]);\n\n\tconst [selectedFilterOptions, setSelectedFilterOptions] = useState<Record<string, string>>(() =>\n\t\treadUserFilterSelectionsFromUrl(userSearchFilters, searchParams)\n\t);\n\n\tuseEffect(() => {\n\t\tsetSelectedFilterOptions(prev => {\n\t\t\tif (setSelectedFilterOptionsOverride) {\n\t\t\t\treturn setSelectedFilterOptionsOverride();\n\t\t\t}\n\n\t\t\tconst urlSelections = readUserFilterSelectionsFromUrl(userSearchFilters, searchParams);\n\n\t\t\t// Only reset if userSearchFilters changed (not a URL-driven update).\n\t\t\t// Preserve current selection if the option is still valid for the new filter set.\n\t\t\treturn userSearchFilters.reduce<Record<string, string>>((next, filter) => {\n\t\t\t\tconst currentSelection = prev[filter.token];\n\t\t\t\tconst isStillValid = filter.options.some(option => option.token === currentSelection);\n\n\t\t\t\tnext[filter.token] = isStillValid ? currentSelection : urlSelections[filter.token];\n\n\t\t\t\treturn next;\n\t\t\t}, {});\n\t\t});\n\t}, [setSelectedFilterOptionsOverride, userSearchFilters, searchParams]);\n\n\tuseEffect(() => {\n\t\twriteUserFilterSelectionsToUrl(selectedFilterOptions, userSearchFilters, search, pathname, replaceUrl);\n\t}, [selectedFilterOptions, userSearchFilters, search, pathname, replaceUrl]);\n\n\tconst handleSetSelectedFilterOption = (filterToken: string, optionToken: string) => {\n\t\tsetSelectedFilterOptions(prev => ({\n\t\t\t...prev,\n\t\t\t[filterToken]: optionToken,\n\t\t}));\n\t};\n\n\tconst contextValue = useMemo(\n\t\t() => ({\n\t\t\tselectedFilterOptions,\n\t\t\tsetSelectedFilterOption: handleSetSelectedFilterOption,\n\t\t\tuserSearchFilters,\n\t\t}),\n\t\t[selectedFilterOptions, userSearchFilters]\n\t);\n\n\treturn <UserSearchFilterContext.Provider value={contextValue}>{children}</UserSearchFilterContext.Provider>;\n}\n","import * as React from 'react';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { ChevronDown } from 'lucide-react';\n\nimport { cn } from '../../util/cn';\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = React.forwardRef<\n\tReact.ComponentRef<typeof AccordionPrimitive.Item>,\n\tReact.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => <AccordionPrimitive.Item className={cn('', className)} ref={ref} {...props} />);\n\nAccordionItem.displayName = AccordionPrimitive.Item.displayName;\n\nconst AccordionTrigger = React.forwardRef<\n\tReact.ComponentRef<typeof AccordionPrimitive.Trigger>,\n\tReact.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n\t<AccordionPrimitive.Header className=\"flex\">\n\t\t<AccordionPrimitive.Trigger\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-1 items-center justify-between py-[9.5px] text-lg font-bold outline-hidden transition-all hover:text-secondary focus-visible:text-secondary [&[data-state=open]>svg]:rotate-180',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t{/* TODO: For the sake of moving fast we are leaving this in, but in the future we need to figure out how enable custom icons */}\n\t\t\t<ChevronDown className=\"h-6 w-6 shrink-0 transition-transform duration-200\" />\n\t\t</AccordionPrimitive.Trigger>\n\t</AccordionPrimitive.Header>\n));\n\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = React.forwardRef<\n\tReact.ComponentRef<typeof AccordionPrimitive.Content>,\n\tReact.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n\t<AccordionPrimitive.Content\n\t\tclassName={cn(\n\t\t\t'data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down mb-4 overflow-hidden transition-all',\n\t\t\tclassName\n\t\t)}\n\t\tref={ref}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</AccordionPrimitive.Content>\n));\n\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n","import { createContext, useContext } from 'react';\n\nexport const SearchResourcesContext = createContext<Record<string, string>>({});\n\nexport function useSearchResources(): Record<string, string> {\n\treturn useContext(SearchResourcesContext);\n}\n","import React, { createContext, useContext, useEffect, useMemo } from 'react';\nimport { algoliasearch } from 'algoliasearch';\nimport insightsClient from 'search-insights';\n\n// ---------------------------------------------------------------------------\n// Algolia search context — provides the configured Algolia client\n// ---------------------------------------------------------------------------\n\ninterface AlgoliaSearchContextValue {\n\tclient: ReturnType<typeof algoliasearch>;\n\tindexName: string;\n\tstorefrontShortname: string;\n\tuserId: string | null;\n}\n\nconst AlgoliaSearchContext = createContext<AlgoliaSearchContextValue | null>(null);\n\ninterface AlgoliaSearchContextProviderProps {\n\tappId: string;\n\tappKey: string;\n\tindexName: string;\n\tstorefrontShortname: string;\n\tuserId?: string | null;\n\tchildren: React.ReactNode;\n}\n\nexport function AlgoliaSearchContextProvider({\n\tappId,\n\tappKey,\n\tindexName,\n\tstorefrontShortname,\n\tuserId = null,\n\tchildren,\n}: AlgoliaSearchContextProviderProps) {\n\tconst client = useMemo(() => algoliasearch(appId, appKey), [appId, appKey]);\n\n\tuseEffect(() => {\n\t\tinsightsClient('init', { appId, apiKey: appKey });\n\t\tif (userId) {\n\t\t\tinsightsClient('setAuthenticatedUserToken', userId);\n\t\t}\n\t}, [appId, appKey, userId]);\n\n\tconst value = useMemo(\n\t\t() => ({ client, indexName, storefrontShortname, userId }),\n\t\t[client, indexName, storefrontShortname, userId]\n\t);\n\n\treturn <AlgoliaSearchContext.Provider value={value}>{children}</AlgoliaSearchContext.Provider>;\n}\n\nexport function useAlgoliaSearch(): AlgoliaSearchContextValue {\n\tconst context = useContext(AlgoliaSearchContext);\n\n\tif (!context) {\n\t\tthrow new Error('useAlgoliaSearch must be used within an AlgoliaSearchContextProvider');\n\t}\n\n\treturn context;\n}\n","import type { ProductPriceAmount } from '../per-user-data/per-user-data-context';\n\ninterface SavingsPrices {\n\tsalePrice?: Pick<ProductPriceAmount, 'amount'> | null;\n\tanchorPrice?: Pick<ProductPriceAmount, 'amount'> | null;\n}\n\n/**\n * Transliterates Unicode characters to their closest ASCII equivalents.\n * Approximates the behavior of the .NET Unidecode library used by SlugHelper on the server.\n */\nfunction unidecode(text: string): string {\n\t// Handle characters that don't decompose via NFD but have ASCII equivalents.\n\t// Order matters: apply multi-char replacements before NFD strips combining marks.\n\tconst result = text\n\t\t.replace(/ß/g, 'ss')\n\t\t.replace(/[æÆ]/g, 'ae')\n\t\t.replace(/[œŒ]/g, 'oe')\n\t\t.replace(/[øØ]/g, 'o')\n\t\t.replace(/[ðÐ]/g, 'd')\n\t\t.replace(/[þÞ]/g, 'th')\n\t\t.replace(/[łŁ]/g, 'l');\n\n\t// Strip combining diacritical marks from remaining Latin characters via NFD normalization.\n\treturn result.normalize('NFD').replace(/\\p{Mn}/gu, '');\n}\n\n/**\n * Converts a string to a URL-friendly slug.\n * Matches the server-side SlugHelper.Slugify method used to generate product URL slugs.\n */\nexport function slugify(value: string | undefined): string {\n\tif (!value) {\n\t\treturn '';\n\t}\n\n\t// Remove trademark/registered symbols\n\tlet input = value.replace(/®/g, '').replace(/™/g, '');\n\n\t// Transliterate Unicode → ASCII, then lowercase (matches .Unidecode().ToLowerInvariant())\n\tinput = unidecode(input).toLowerCase();\n\n\t// Remove trailing parenthetical and bracket blocks, e.g. \"Title (Subtitle) [Edition]\"\n\t// Matches s_parenBlocks = new Regex(\"(\\\\(.*\\\\))?(\\\\s*\\\\[.*\\\\])*$\")\n\tinput = input.replace(/(\\(.*\\))?(\\s*\\[.*\\])*$/g, '');\n\n\t// Strip HTML tags — matches s_htmlTags = new Regex(\"</?[^>]+>\")\n\tinput = input.replace(/<\\/?[^>]+>/g, '');\n\n\t// Expand ampersand\n\tinput = input.replace(/ & /g, ' and ');\n\n\t// Convert separating punctuation to spaces — matches s_punctuationForSpace = new Regex(\"[/\\\\-:_]\")\n\tinput = input.replace(/[/\\-:_]/g, ' ');\n\n\t// Remove all remaining non-alphanumeric, non-space characters — matches s_punctuationAndNonAlpha = new Regex(\"[^a-z0-9 ]\")\n\tinput = input.replace(/[^a-z0-9 ]/g, '');\n\n\t// Collapse whitespace runs to hyphens — matches s_excessWhitespace = new Regex(\"\\\\s+\")\n\treturn input.trim().replace(/\\s+/g, '-');\n}\n\nexport function getSavingsPercent(prices: SavingsPrices | null | undefined): number {\n\tconst anchor = prices?.anchorPrice?.amount;\n\tconst sale = prices?.salePrice?.amount;\n\tif (!anchor || !sale) {\n\t\treturn 0;\n\t}\n\tif (anchor <= 0) {\n\t\treturn 0;\n\t}\n\treturn ((anchor - sale) / anchor) * 100;\n}\n\n/**\n * Splits an author/publisher facet value of the form \"id:displayName\" into its parts.\n * Uses the first colon as the separator so display names that themselves contain colons\n * are preserved. When no colon is present, the whole value is treated as both id and name.\n */\nexport function parseFacetValue(value: string): { id: string; displayName: string } {\n\tconst separatorIndex = value.indexOf(':');\n\tif (separatorIndex === -1) {\n\t\treturn { id: value, displayName: value };\n\t}\n\treturn {\n\t\tid: value.substring(0, separatorIndex),\n\t\tdisplayName: value.substring(separatorIndex + 1),\n\t};\n}\n\nexport function safeUrl(input: string, base?: string): URL | null {\n\ttry {\n\t\treturn new URL(input, base);\n\t} catch {\n\t\treturn null;\n\t}\n}\n","import React, { useEffect, useRef, useState } from 'react';\nimport insightsClient from 'search-insights';\nimport { LinkButton, Typography } from '@faithlife/commerce-components';\nimport {\n\tRefinementListItem,\n\tRefinementListRenderState,\n} from 'instantsearch.js/es/connectors/refinement-list/connectRefinementList';\nimport { useRefinementList } from 'react-instantsearch';\nimport { cn } from '../../util/cn';\n\nimport { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '../accordion';\nimport { useSearchResources } from './search-resources';\nimport { UserSearchFilter, UserSearchFilterOption, useUserSearchFilterContext } from './user-search-filter-context';\nimport { useAlgoliaSearch } from './algolia-search-context';\nimport { parseFacetValue } from './util';\n\nfunction Check({ className, checked }: { className?: string; checked: boolean }) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={cn('inline', className)}\n\t\t\tfill=\"none\"\n\t\t\theight=\"14\"\n\t\t\tviewBox=\"0 0 13 14\"\n\t\t\twidth=\"13\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<rect\n\t\t\t\tfill={checked ? '#1E6AFE' : 'white'}\n\t\t\t\theight=\"13\"\n\t\t\t\trx=\"1\"\n\t\t\t\tstroke={checked ? undefined : '#C7C7C7'}\n\t\t\t\twidth=\"13\"\n\t\t\t\ty=\"0.5\"\n\t\t\t/>\n\t\t\t<path d=\"M3.28223 7.73706L5.2634 9.71824L9.71857 5.26308\" stroke=\"white\" strokeLinecap=\"round\" />\n\t\t</svg>\n\t);\n}\n\nconst c_statusLabelKeys: Record<string, string> = {\n\t'status > live': 'liveStatusText',\n\t'status > prepub': 'prepubStatusText',\n\t'status > prepub > gatheringinterest': 'gatheringInterestStatusText',\n\t'status > prepub > undercontract': 'underContractStatusText',\n\t'status > prepub > gatheringinterest > almostfunded': 'almostFundedStatusText',\n\t'status > prepub > undercontract > shippingsoon': 'shippingSoonStatusText',\n};\n\nfunction ShowMoreToggle({\n\tshowMore,\n\tattribute,\n\tsetShowMore,\n}: {\n\tshowMore: string | undefined;\n\tattribute: string;\n\tsetShowMore: (showMore: string | undefined) => void;\n}) {\n\tconst resources = useSearchResources();\n\tconst isShowingMore = showMore === attribute;\n\n\treturn (\n\t\t<LinkButton as=\"button\" onClick={() => setShowMore(isShowingMore ? undefined : attribute)} scale=\"sm\">\n\t\t\t{isShowingMore ? resources['showLess'] : resources['showMore']}\n\t\t</LinkButton>\n\t);\n}\n\nfunction countDepth(value: string) {\n\tlet index = value.indexOf('>');\n\tlet depth = 0;\n\n\twhile (index !== -1) {\n\t\tindex = value.indexOf('>', index + 1);\n\t\tdepth += 1;\n\t}\n\n\treturn depth;\n}\n\nexport interface RefinementItem {\n\trefinement: RefinementListRenderState;\n\titem: RefinementListItem;\n}\n\nfunction hasChildren(items: RefinementItem[], { item: parent }: RefinementItem) {\n\treturn items.some(({ item }) => parent !== item && item.value.startsWith(parent.value));\n}\n\nfunction getChildren(items: RefinementItem[], parent: RefinementItem) {\n\tconst depth = countDepth(parent.item.value);\n\n\treturn items.filter(({ item }) => countDepth(item.value) === depth + 1 && item.value.startsWith(parent.item.value));\n}\n\nexport function getAccordions(category: string, items: RefinementItem[]) {\n\tconst root = {\n\t\tkey: category,\n\t\tlabel: category,\n\t\titems: items.filter(({ item }) => countDepth(item.value) === 0),\n\t};\n\n\tconst subCategories = items\n\t\t.filter(({ item }) => item.isRefined)\n\t\t.filter(parent => hasChildren(items, parent))\n\t\t.map(c => ({\n\t\t\tkey: c.item.value,\n\t\t\tlabel: c.item.label.replace(/^((.*) > )*/, ''),\n\t\t\titems: getChildren(items, c),\n\t\t}));\n\n\treturn [root, ...subCategories];\n}\n\nfunction useRefinementLists(category: string, levels?: number) {\n\t// not neccessary, but let's avoid shooting ourselves in the foot, shall we?\n\tconst levelsRef = useRef(levels);\n\tconst items: RefinementItem[] = [];\n\n\tif (levelsRef.current !== undefined) {\n\t\tfor (let level = 0; level <= levelsRef.current; level += 1) {\n\t\t\tconst attribute = `${category}.lvl${level}`;\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tconst refinement = useRefinementList({ attribute, limit: 1000 }, { skipSuspense: level < levelsRef.current - 1 });\n\n\t\t\titems.push(...refinement.items.map(item => ({ item, refinement })));\n\t\t}\n\t} else {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst refinement = useRefinementList({ attribute: category, limit: 1000 });\n\n\t\titems.push(...refinement.items.map(item => ({ item, refinement })));\n\t}\n\n\treturn items;\n}\n\nfunction Category({\n\tcategory,\n\tsetExpandedFacets,\n\tsetShowMore,\n\tshowMore,\n\tmaxLevel,\n}: {\n\tcategory: string;\n\tsetExpandedFacets: (setState: (expandedFacets: string[]) => string[]) => void;\n\tsetShowMore: (showMore: string | undefined) => void;\n\tshowMore: string | undefined;\n\tmaxLevel?: number;\n}) {\n\tconst resources = useSearchResources();\n\tconst { indexName } = useAlgoliaSearch();\n\tconst items = useRefinementLists(category, maxLevel);\n\n\tif (!items?.length) {\n\t\treturn null;\n\t}\n\n\tconst accordions = getAccordions(category, items);\n\n\treturn accordions.map(accordion => (\n\t\t<AccordionItem key={accordion.key} value={accordion.key}>\n\t\t\t<AccordionTrigger className=\"border-t border-primary-100 p-4 lg:border-t-0 [&>svg]:text-primary\">\n\t\t\t\t<Typography className=\"text-primary-400\" variant=\"bodyRegular\" tag=\"div\">\n\t\t\t\t\t{resources[accordion.label] ?? accordion.label}\n\t\t\t\t</Typography>\n\t\t\t</AccordionTrigger>\n\t\t\t<AccordionContent className=\"m-0 bg-grey-200 p-4\">\n\t\t\t\t<div className=\"flex flex-col gap-y-4\">\n\t\t\t\t\t{(showMore === accordion.key ? accordion.items : accordion.items.slice(0, 7)).map(({ item, refinement }) => (\n\t\t\t\t\t\t<div key={item.value}>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'text-black-200 hover:text-secondary-200': !item.isRefined,\n\t\t\t\t\t\t\t\t\t\t'text-primary': item.isRefined,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t'bodySm w-full text-left capitalize'\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\trefinement.refine(item.value);\n\n\t\t\t\t\t\t\t\t\tinsightsClient('clickedFilters', {\n\t\t\t\t\t\t\t\t\t\tindex: indexName,\n\t\t\t\t\t\t\t\t\t\teventName: 'Clicked filter',\n\t\t\t\t\t\t\t\t\t\tfilters: [`${category}:${item.value}`],\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\tif (!item.isRefined) {\n\t\t\t\t\t\t\t\t\t\tsetExpandedFacets(old => [...old, item.value]);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\titems\n\t\t\t\t\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t\t\t\t\t({ item: child }) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\tchild.isRefined && child.value !== item.value && child.value.startsWith(item.value)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t.forEach(({ item: child, refinement: childRefinement }) => {\n\t\t\t\t\t\t\t\t\t\t\t\tchildRefinement.refine(child.value);\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\tsetExpandedFacets(old => old.filter(v => !v.startsWith(item.value)));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Check checked={item.isRefined} className=\"mr-3\" />\n\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t{`${\n\t\t\t\t\t\t\t\t\t\titem.label.lastIndexOf('>') === -1\n\t\t\t\t\t\t\t\t\t\t\t? item.label\n\t\t\t\t\t\t\t\t\t\t\t: item.label.substring(item.label.lastIndexOf('>') + 2)\n\t\t\t\t\t\t\t\t\t} `}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span className=\"text-black-100\">\n\t\t\t\t\t\t\t\t\t{'('}\n\t\t\t\t\t\t\t\t\t{item.count}\n\t\t\t\t\t\t\t\t\t{')'}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t\t{accordion.items.length > 7 && (\n\t\t\t\t\t\t<ShowMoreToggle attribute={accordion.key} setShowMore={setShowMore} showMore={showMore} />\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</AccordionContent>\n\t\t</AccordionItem>\n\t));\n}\n\nfunction AuthorFacetItem({\n\tid,\n\tdisplayName,\n\tcount,\n\tisRefined,\n\tonRefine,\n}: {\n\tid: string;\n\tdisplayName: string;\n\tcount: number;\n\tisRefined: boolean;\n\tonRefine: (id: string) => void;\n}) {\n\treturn (\n\t\t<div>\n\t\t\t<button\n\t\t\t\tclassName={cn(\n\t\t\t\t\t{\n\t\t\t\t\t\t'text-black-200 hover:text-secondary-200': !isRefined,\n\t\t\t\t\t\t'text-primary': isRefined,\n\t\t\t\t\t},\n\t\t\t\t\t'bodySm w-full text-left capitalize'\n\t\t\t\t)}\n\t\t\t\tonClick={() => onRefine(id)}\n\t\t\t>\n\t\t\t\t{displayName}{' '}\n\t\t\t\t<span className=\"text-black-100\">\n\t\t\t\t\t{'('}\n\t\t\t\t\t{count}\n\t\t\t\t\t{')'}\n\t\t\t\t</span>\n\t\t\t</button>\n\t\t</div>\n\t);\n}\n\nfunction PublisherFacetItem({\n\tid,\n\tdisplayName,\n\tcount,\n\tisRefined,\n\tonRefine,\n}: {\n\tid: string;\n\tdisplayName: string;\n\tcount: number;\n\tisRefined: boolean;\n\tonRefine: (id: string) => void;\n}) {\n\treturn (\n\t\t<div>\n\t\t\t<button\n\t\t\t\tclassName={cn(\n\t\t\t\t\t{\n\t\t\t\t\t\t'text-black-200 hover:text-secondary-200': !isRefined,\n\t\t\t\t\t\t'text-primary': isRefined,\n\t\t\t\t\t},\n\t\t\t\t\t'bodySm w-full text-left capitalize'\n\t\t\t\t)}\n\t\t\t\tonClick={() => onRefine(id)}\n\t\t\t>\n\t\t\t\t{displayName}{' '}\n\t\t\t\t<span className=\"text-black-100\">\n\t\t\t\t\t{'('}\n\t\t\t\t\t{count}\n\t\t\t\t\t{')'}\n\t\t\t\t</span>\n\t\t\t</button>\n\t\t</div>\n\t);\n}\n\nfunction AuthorsOrPublishers({\n\tattribute,\n\tnameAttribute,\n\tsetShowMore,\n\tshowMore,\n}: {\n\tattribute: 'authorIds' | 'publisherIds';\n\tnameAttribute: 'authorFacets' | 'publisherFacets';\n\tshowMore: string | undefined;\n\tsetShowMore: (showMore: string | undefined) => void;\n}) {\n\tconst resources = useSearchResources();\n\tconst { indexName } = useAlgoliaSearch();\n\n\tconst { isShowingMore, items, canToggleShowMore, toggleShowMore } = useRefinementList({\n\t\tattribute: nameAttribute,\n\t\tlimit: 7,\n\t\tshowMore: true,\n\t});\n\tconst { items: idItems, refine } = useRefinementList({\n\t\tattribute,\n\t});\n\n\tuseEffect(() => {\n\t\tif ((showMore === attribute) !== isShowingMore) {\n\t\t\ttoggleShowMore();\n\t\t}\n\t}, [attribute, isShowingMore, showMore, toggleShowMore]);\n\n\tconst FacetItem = attribute === 'authorIds' ? AuthorFacetItem : PublisherFacetItem;\n\n\tconst facetItems = items.map(item => {\n\t\tconst { id, displayName } = parseFacetValue(item.value);\n\t\treturn {\n\t\t\tid,\n\t\t\tdisplayName,\n\t\t\tcount: item.count,\n\t\t\tisRefined: idItems.some(idItem => idItem.value === id && idItem.isRefined),\n\t\t};\n\t});\n\n\tfacetItems.sort((a, b) => {\n\t\tif (a.isRefined && !b.isRefined) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif (!a.isRefined && b.isRefined) {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn b.count - a.count;\n\t});\n\n\treturn (\n\t\t<AccordionItem value={attribute}>\n\t\t\t<AccordionTrigger className=\"border-t border-primary-100 p-4 lg:border-t-0 [&>svg]:text-primary\">\n\t\t\t\t<Typography className=\"text-primary-400\" variant=\"bodyRegular\" tag=\"div\">\n\t\t\t\t\t{resources[attribute] ?? attribute}\n\t\t\t\t</Typography>\n\t\t\t</AccordionTrigger>\n\t\t\t<AccordionContent className=\"m-0 bg-grey-200 p-4\">\n\t\t\t\t<div className=\"flex flex-col gap-y-4\">\n\t\t\t\t\t{facetItems.map(i => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<FacetItem\n\t\t\t\t\t\t\t\tkey={i.id}\n\t\t\t\t\t\t\t\t{...i}\n\t\t\t\t\t\t\t\tonRefine={id => {\n\t\t\t\t\t\t\t\t\trefine(id);\n\t\t\t\t\t\t\t\t\tinsightsClient('clickedFilters', {\n\t\t\t\t\t\t\t\t\t\tindex: indexName,\n\t\t\t\t\t\t\t\t\t\teventName: 'Clicked filter',\n\t\t\t\t\t\t\t\t\t\tfilters: [`${attribute}:${id}`],\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t\t{canToggleShowMore && <ShowMoreToggle attribute={attribute} setShowMore={setShowMore} showMore={showMore} />}\n\t\t\t\t</div>\n\t\t\t</AccordionContent>\n\t\t</AccordionItem>\n\t);\n}\n\nfunction Statuses({\n\tsetExpandedFacets,\n}: {\n\tsetExpandedFacets: (setState: (expandedFacets: string[]) => string[]) => void;\n}) {\n\tconst resources = useSearchResources();\n\tconst { indexName } = useAlgoliaSearch();\n\tconst level1 = useRefinementList({ attribute: 'categories.lvl1', limit: 100 }, { skipSuspense: true });\n\tconst level2 = useRefinementList({ attribute: 'categories.lvl2', limit: 1000 }, { skipSuspense: true });\n\tconst level3 = useRefinementList({ attribute: 'categories.lvl3', limit: 1000 }, { skipSuspense: true });\n\tconst level4 = useRefinementList({ attribute: 'categories.lvl4', limit: 1000 }, { skipSuspense: true });\n\n\tconst sections: {\n\t\tvalue: string;\n\t\trefinement: RefinementListRenderState;\n\t\titems: RefinementListItem[];\n\t}[] = [\n\t\t{\n\t\t\tvalue: 'status',\n\t\t\trefinement: level1,\n\t\t\titems: level1.items.filter(i => i.value.startsWith('status')),\n\t\t},\n\t\t...level1.items\n\t\t\t.filter(i => i.isRefined && i.value.startsWith('status'))\n\t\t\t.map(status => ({\n\t\t\t\tvalue: status.value,\n\t\t\t\trefinement: level2,\n\t\t\t\titems: level2.items.filter(i => i.value.startsWith(status.value)),\n\t\t\t})),\n\t\t...level2.items\n\t\t\t.filter(i => i.isRefined && i.value.startsWith('status'))\n\t\t\t.map(status => ({\n\t\t\t\tvalue: status.value,\n\t\t\t\trefinement: level3,\n\t\t\t\titems: level3.items.filter(i => i.value.startsWith(status.value)),\n\t\t\t})),\n\t\t...level3.items\n\t\t\t.filter(i => i.isRefined && i.value.startsWith('status'))\n\t\t\t.map(status => ({\n\t\t\t\tvalue: status.value,\n\t\t\t\trefinement: level4,\n\t\t\t\titems: level4.items.filter(i => i.value.startsWith(status.value)),\n\t\t\t})),\n\t];\n\n\treturn (\n\t\t<>\n\t\t\t{sections.map(({ value, refinement, items }) =>\n\t\t\t\titems.length ? (\n\t\t\t\t\t<AccordionItem key={value} value={value}>\n\t\t\t\t\t\t<AccordionTrigger className=\"border-t border-primary-100 p-4 lg:border-t-0 [&>svg]:text-primary\">\n\t\t\t\t\t\t\t<Typography className=\"text-primary-400\" variant=\"bodyRegular\" tag=\"div\">\n\t\t\t\t\t\t\t\t{resources[c_statusLabelKeys[value] ?? value] ?? value}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</AccordionTrigger>\n\t\t\t\t\t\t<AccordionContent className=\"m-0 bg-grey-200 p-4\">\n\t\t\t\t\t\t\t<div className=\"flex flex-col gap-y-4\">\n\t\t\t\t\t\t\t\t{items.map(item => (\n\t\t\t\t\t\t\t\t\t<div key={item.value}>\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t'text-black-200 hover:text-secondary-200': !item.isRefined,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'text-primary': item.isRefined,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t'bodySm w-full text-left capitalize'\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\t\trefinement.refine(item.value);\n\n\t\t\t\t\t\t\t\t\t\t\t\tinsightsClient('clickedFilters', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex: indexName,\n\t\t\t\t\t\t\t\t\t\t\t\t\teventName: 'Clicked filter',\n\t\t\t\t\t\t\t\t\t\t\t\t\tfilters: [`categories:${item.value}`],\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (!item.isRefined) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetExpandedFacets(old => [...old, item.value]);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{resources[c_statusLabelKeys[item.value] ?? item.value] ?? item.value}{' '}\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"text-black-100\">\n\t\t\t\t\t\t\t\t\t\t\t\t{'('}\n\t\t\t\t\t\t\t\t\t\t\t\t{item.count}\n\t\t\t\t\t\t\t\t\t\t\t\t{')'}\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</AccordionContent>\n\t\t\t\t\t</AccordionItem>\n\t\t\t\t) : null\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport function UserSearchFilterAccordionItem({ filter }: { filter: UserSearchFilter }) {\n\tconst { selectedFilterOptions, setSelectedFilterOption } = useUserSearchFilterContext();\n\tconst selectedFilterOption = selectedFilterOptions[filter.token];\n\tconst title = filter.title;\n\tconst options = (Array.isArray(filter.options) ? filter.options : []).filter(\n\t\t(option: { displayName: string }) => option && option.displayName !== ''\n\t);\n\n\tif (!title || options.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<AccordionItem value={`user-filter-${title}`}>\n\t\t\t<AccordionTrigger className=\"border-t border-primary-100 p-4 lg:border-t-0 [&>svg]:text-primary\">\n\t\t\t\t<Typography className=\"text-primary-400\" variant=\"bodyRegular\" tag=\"div\">\n\t\t\t\t\t{title}\n\t\t\t\t</Typography>\n\t\t\t</AccordionTrigger>\n\t\t\t<AccordionContent className=\"m-0 bg-grey-200 p-4\">\n\t\t\t\t<div className=\"flex flex-col gap-y-4\">\n\t\t\t\t\t{options.map((option: UserSearchFilterOption) => {\n\t\t\t\t\t\tconst label = option.displayName;\n\t\t\t\t\t\tconst isSelected = selectedFilterOption === option.token;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\tvariant=\"bodySmall\"\n\t\t\t\t\t\t\t\tclassName=\"flex cursor-pointer items-center text-black-200\"\n\t\t\t\t\t\t\t\tkey={label}\n\t\t\t\t\t\t\t\ttag=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\tchecked={isSelected}\n\t\t\t\t\t\t\t\t\tclassName=\"mr-3 h-[13px] w-[13px] border-grey-100 text-primary\"\n\t\t\t\t\t\t\t\t\tonChange={() => setSelectedFilterOption(filter.token, option.token)}\n\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\tvalue={option.token}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<span className={cn(isSelected ? 'text-primary' : 'text-black-200 hover:text-secondary-200')}>\n\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</AccordionContent>\n\t\t</AccordionItem>\n\t);\n}\n\nexport function Categories() {\n\tconst [expandedFacets, setExpandedFacets] = useState<string[]>([]);\n\tconst [showMore, setShowMore] = useState<string>();\n\tconst { userSearchFilters } = useUserSearchFilterContext();\n\n\treturn (\n\t\t<Accordion onValueChange={setExpandedFacets} type=\"multiple\" value={expandedFacets}>\n\t\t\t{userSearchFilters?.map((filter, index) => {\n\t\t\t\tconst key = `${filter.title}-${index}`;\n\n\t\t\t\treturn <UserSearchFilterAccordionItem filter={filter} key={key} />;\n\t\t\t})}\n\t\t\t<Category\n\t\t\t\tcategory=\"topic\"\n\t\t\t\tmaxLevel={3}\n\t\t\t\tsetExpandedFacets={setExpandedFacets}\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t\t<Category\n\t\t\t\tcategory=\"resourceType\"\n\t\t\t\tmaxLevel={1}\n\t\t\t\tsetExpandedFacets={setExpandedFacets}\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t\t<AuthorsOrPublishers\n\t\t\t\tattribute=\"authorIds\"\n\t\t\t\tnameAttribute=\"authorFacets\"\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t\t<Statuses setExpandedFacets={setExpandedFacets} />\n\t\t\t<Category\n\t\t\t\tcategory=\"specials\"\n\t\t\t\tsetExpandedFacets={setExpandedFacets}\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t\t<Category\n\t\t\t\tcategory=\"language\"\n\t\t\t\tsetExpandedFacets={setExpandedFacets}\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t\t<Category\n\t\t\t\tcategory=\"seriesSets\"\n\t\t\t\tmaxLevel={1}\n\t\t\t\tsetExpandedFacets={setExpandedFacets}\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t\t<AuthorsOrPublishers\n\t\t\t\tattribute=\"publisherIds\"\n\t\t\t\tnameAttribute=\"publisherFacets\"\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t\t<Category\n\t\t\t\tcategory=\"bibleAndApocrypha\"\n\t\t\t\tmaxLevel={3}\n\t\t\t\tsetExpandedFacets={setExpandedFacets}\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t\t<Category\n\t\t\t\tcategory=\"containment\"\n\t\t\t\tmaxLevel={1}\n\t\t\t\tsetExpandedFacets={setExpandedFacets}\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t\t<Category category=\"format\" setExpandedFacets={setExpandedFacets} setShowMore={setShowMore} showMore={showMore} />\n\t\t\t<Category\n\t\t\t\tcategory=\"genre\"\n\t\t\t\tmaxLevel={2}\n\t\t\t\tsetExpandedFacets={setExpandedFacets}\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t\t<Category\n\t\t\t\tcategory=\"licensingMethod\"\n\t\t\t\tsetExpandedFacets={setExpandedFacets}\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t\t<Category\n\t\t\t\tcategory=\"religiousGroup\"\n\t\t\t\tmaxLevel={0}\n\t\t\t\tsetExpandedFacets={setExpandedFacets}\n\t\t\t\tsetShowMore={setShowMore}\n\t\t\t\tshowMore={showMore}\n\t\t\t/>\n\t\t</Accordion>\n\t);\n}\n","import React, { useEffect } from 'react';\nimport {\n\tCurrentRefinementsConnectorParamsItem,\n\tCurrentRefinementsConnectorParamsRefinement,\n} from 'instantsearch.js/es/connectors/current-refinements/connectCurrentRefinements';\nimport { X } from 'lucide-react';\nimport { useCurrentRefinements, useRefinementList, useSearchBox } from 'react-instantsearch';\n\nimport { useLocation } from '../../location';\nimport { useAuthor } from '../../hooks/use-author';\nimport { usePublisher } from '../../hooks/use-publisher';\nimport { parseFacetValue } from './util';\n\n// ---------------------------------------------------------------------------\n// CurrentRefinements — chips for active facet refinements\n// ---------------------------------------------------------------------------\n\nfunction RefinementLabel({ attribute, value }: { attribute: string; value: string }) {\n\tconst stringValue = typeof value === 'string' ? value : String(value ?? '');\n\n\tif (attribute === 'authorIds') {\n\t\treturn <AuthorLabel value={stringValue} />;\n\t}\n\n\tif (attribute === 'publisherIds') {\n\t\treturn <PublisherLabel value={stringValue} />;\n\t}\n\n\treturn <span>{stringValue.replace(/^((.*) > )*/, '')}</span>;\n}\n\nfunction AuthorLabel({ value }: { value: string }) {\n\tconst { items } = useRefinementList({ attribute: 'authorFacets' });\n\n\tif (!items.length) {\n\t\treturn <span>{'…'}</span>;\n\t}\n\n\tconst item = items.find(i => i.value.startsWith(`${value}:`));\n\n\tif (item) {\n\t\tconst { displayName } = parseFacetValue(item.label);\n\t\treturn <span>{displayName}</span>;\n\t}\n\n\treturn <AuthorApiLabel value={value} />;\n}\n\nfunction AuthorApiLabel({ value }: { value: string }) {\n\tconst { data, isLoading } = useAuthor(value);\n\n\tif (isLoading) {\n\t\treturn <span>{'…'}</span>;\n\t}\n\n\tif (!data) {\n\t\treturn null;\n\t}\n\n\treturn <span>{data.displayName}</span>;\n}\n\nfunction PublisherLabel({ value }: { value: string }) {\n\tconst { items } = useRefinementList({ attribute: 'publisherFacets' });\n\n\tif (!items.length) {\n\t\treturn <span>{'…'}</span>;\n\t}\n\n\tconst item = items.find(i => i.value.startsWith(`${value}:`));\n\n\tif (item) {\n\t\tconst { displayName } = parseFacetValue(item.label);\n\t\treturn <span>{displayName}</span>;\n\t}\n\n\treturn <PublisherApiLabel value={value} />;\n}\n\nfunction PublisherApiLabel({ value }: { value: string }) {\n\tconst { data, isLoading } = usePublisher(value);\n\n\tif (isLoading) {\n\t\treturn <span>{'…'}</span>;\n\t}\n\n\tif (!data) {\n\t\treturn null;\n\t}\n\n\treturn <span>{data.displayName}</span>;\n}\n\nexport function CurrentRefinements() {\n\tconst currentRefinements = useCurrentRefinements();\n\tconst itemsByAttribute: Record<string, CurrentRefinementsConnectorParamsItem> = {};\n\tconst refinementList: CurrentRefinementsConnectorParamsRefinement[] = [];\n\n\tfor (const item of currentRefinements?.items ?? []) {\n\t\titemsByAttribute[item.attribute] = item;\n\n\t\tfor (const refinement of item.refinements ?? []) {\n\t\t\trefinementList.push(refinement);\n\t\t}\n\t}\n\n\treturn refinementList.map(item => {\n\t\tconst itemValue = item.value;\n\t\tconst itemAndChildren =\n\t\t\ttypeof itemValue === 'string'\n\t\t\t\t? refinementList.filter(r => typeof r.value === 'string' && r.value.startsWith(itemValue))\n\t\t\t\t: [item];\n\n\t\treturn (\n\t\t\t<RefinementChip\n\t\t\t\tattribute={item.attribute}\n\t\t\t\titemAndChildren={itemAndChildren}\n\t\t\t\titemsByAttribute={itemsByAttribute}\n\t\t\t\tkey={`${item.attribute}:${String(itemValue)}`}\n\t\t\t\tlabel={item.label}\n\t\t\t\tvalue={String(itemValue)}\n\t\t\t/>\n\t\t);\n\t});\n}\n\nfunction RefinementChip({\n\tattribute,\n\tvalue,\n\tlabel,\n\titemAndChildren,\n\titemsByAttribute,\n}: {\n\tattribute: string;\n\tvalue: string;\n\tlabel: string;\n\titemAndChildren: CurrentRefinementsConnectorParamsRefinement[];\n\titemsByAttribute: Record<string, CurrentRefinementsConnectorParamsItem>;\n}) {\n\treturn (\n\t\t<button\n\t\t\taria-label={`Remove ${label} from filters`}\n\t\t\tclassName=\"flex items-center gap-x-1 bg-grey-200 py-[6px] pl-3 pr-2 text-xs capitalize text-black-100\"\n\t\t\tonClick={() => itemAndChildren.forEach(i => itemsByAttribute[attribute]?.refine(i))}\n\t\t>\n\t\t\t<RefinementLabel attribute={attribute} value={value} />\n\t\t\t<X aria-hidden=\"true\" height={14} width={14} />\n\t\t</button>\n\t);\n}\n\n// ---------------------------------------------------------------------------\n// CurrentQueryRefinement — chip for the active search query\n// ---------------------------------------------------------------------------\n\nexport default function CurrentQueryRefinement() {\n\tconst { searchParams } = useLocation();\n\tconst urlQuery = searchParams.get('query') ?? '';\n\n\tconst { query, refine, clear } = useSearchBox();\n\n\tuseEffect(() => {\n\t\tif (urlQuery) {\n\t\t\trefine(urlQuery);\n\t\t}\n\t}, [urlQuery, refine]);\n\n\tconst removeQuery = () => {\n\t\tclear();\n\t};\n\n\treturn query ? (\n\t\t<button\n\t\t\taria-label=\"remove search term from filters\"\n\t\t\tclassName=\"flex items-center gap-x-1 bg-grey-200 py-[6px] pl-3 pr-2 text-xs capitalize text-black-100\"\n\t\t\tonClick={removeQuery}\n\t\t>\n\t\t\t<span>\n\t\t\t\t{'\"'}\n\t\t\t\t{query}\n\t\t\t\t{'\"'}\n\t\t\t</span>\n\t\t\t<X aria-hidden=\"true\" height={14} width={14} />\n\t\t</button>\n\t) : null;\n}\n","import React from 'react';\nimport { useRefinementList } from 'react-instantsearch';\n\nimport type { FacetConfiguration } from './routing';\n\n// Keeps a real refinementList widget mounted for each hidden facet attribute (and, for hierarchical facets,\n// each of its levels) so Algolia treats it as refinable, without rendering any UI. Filtering itself is driven\n// entirely by the URL via routing.ts.\n// skipSuspense avoids blocking rendering on data that is never displayed.\nfunction HiddenRefinementList({ attribute }: { attribute: string }) {\n\tuseRefinementList({ attribute }, { skipSuspense: true });\n\n\treturn null;\n}\n\nfunction getHiddenAlgoliaAttributes(config: FacetConfiguration): string[] {\n\tif (config.type === 'simple') {\n\t\treturn [config.algoliaAttribute];\n\t}\n\n\tconst attributes: string[] = [];\n\n\tfor (let level = config.minLevel; level <= config.maxLevel; level += 1) {\n\t\tattributes.push(`${config.algoliaAttributeBase}.lvl${level}`);\n\t}\n\n\treturn attributes;\n}\n\nexport default function HiddenFacetRefinements({ facetConfigurations }: { facetConfigurations: FacetConfiguration[] }) {\n\tconst attributes = facetConfigurations.filter(config => config.isHidden).flatMap(getHiddenAlgoliaAttributes);\n\n\treturn (\n\t\t<>\n\t\t\t{attributes.map(attribute => (\n\t\t\t\t<HiddenRefinementList attribute={attribute} key={attribute} />\n\t\t\t))}\n\t\t</>\n\t);\n}\n","import React, { ReactNode } from 'react';\nimport { cn } from '../../util/cn';\n\nfunction SkeletonRoot({\n\tclassName,\n\tchildren,\n\tpending = false,\n\thideOverflow = false,\n}: {\n\tclassName?: string;\n\tchildren?: React.ReactNode;\n\tpending?: boolean;\n\thideOverflow?: boolean;\n}) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn('@container', hideOverflow && 'overflow-hidden', className)}\n\t\t\tdata-pending={pending ? '' : undefined}\n\t\t\trole={pending ? 'status' : undefined}\n\t\t>\n\t\t\t{children}\n\t\t\t{pending && <span className=\"sr-only\">{'Loading...'}</span>}\n\t\t</div>\n\t);\n}\n\nfunction SkeletonBox({ className }: { className?: string }) {\n\treturn <div className={cn('rounded-lg bg-gray-300', className)} />;\n}\n\nfunction SkeletonText({ characterCount = 10, className }: { characterCount?: number | 'full'; className?: string }) {\n\treturn (\n\t\t<div className={cn('flex h-[1lh] items-center', className)}>\n\t\t\t<div\n\t\t\t\tclassName={cn(`h-[1ex] max-w-full rounded-[inherit] bg-gray-300`)}\n\t\t\t\tstyle={{ width: characterCount === 'full' ? '100%' : `${characterCount}ch` }}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction SkeletonIcon({ className, icon }: { className?: string; icon: ReactNode }) {\n\treturn <div className={cn('text-gray-300 opacity-25', className)}>{icon}</div>;\n}\n\nexport { SkeletonIcon as Icon, SkeletonRoot as Root, SkeletonBox as Box, SkeletonText as Text };\n","import React from 'react';\n\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { useLocalization } from '../../../localization';\nimport { useBrandName } from '../../../util/brand-name-context';\n\nexport default function EnhancedForLogosLabel() {\n\tconst resources = useLocalization('CommerceWeb.Resources.Search.DisplayTemplates.ProductSearchResultViewModel');\n\tconst logosOrVerbum = useBrandName();\n\tconst isVerbum = logosOrVerbum?.toLowerCase() === 'verbum';\n\treturn (\n\t\t<CommandSentence className=\"text-xs text-primary\" template={resources.EnhancedForLogos}>\n\t\t\t<CommandSentence.Field name=\"ICON\">\n\t\t\t\t<img\n\t\t\t\t\tclassName={\n\t\t\t\t\t\tisVerbum\n\t\t\t\t\t\t\t? 'inline-block w-[17px] h-[12px] [vertical-align:-1.5px]'\n\t\t\t\t\t\t\t: 'inline-block w-[14px] h-[14px] [vertical-align:-2px] mx-px'\n\t\t\t\t\t}\n\t\t\t\t\talt={logosOrVerbum}\n\t\t\t\t\tsrc={\n\t\t\t\t\t\tisVerbum\n\t\t\t\t\t\t\t? 'https://files.logoscdn.com/v1/files/70496318/assets/14995970/content.svg?signature=SsnOeyt3lPzdfqreDLuA7km2gRs'\n\t\t\t\t\t\t\t: 'https://files.logoscdn.com/v1/files/71036773/assets/14991834/content.svg?signature=NlgSyNjXKmP7caOrWgZiZv5hSEE'\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</CommandSentence.Field>\n\t\t</CommandSentence>\n\t);\n}\n","import React from 'react';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\n\nimport EnhancedForLogosLabel from '../enhanced-for-logos-label';\nimport Tooltip from '../tooltip';\nimport { InfoIconSvgUrl } from '../svgs';\n\nimport { useLocalization } from '../../../localization';\nimport { useBrandName } from '../../../util/brand-name-context';\n\nexport interface EnhancedForLogosWithTooltipProps {\n\tclassName?: string;\n}\n\nconst EnhancedForLogosWithTooltip = ({ className }: EnhancedForLogosWithTooltipProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Search.DisplayTemplates.ProductSearchResultViewModel');\n\n\tconst logosOrVerbum = useBrandName();\n\n\treturn (\n\t\t<Tooltip placement=\"bottom\" className={className} link={<EnhancedForLogosLabel />}>\n\t\t\t<div className={'w-[250px] text-start flex items-start gap-sp8'}>\n\t\t\t\t<div>\n\t\t\t\t\t<img className=\"max-w-none w-[20px] h-[20px]\" src={InfoIconSvgUrl} alt=\"\" />\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<CommandSentence className=\"text-xs\" template={resources.EnhancedForLogosTooltipContent}>\n\t\t\t\t\t\t<CommandSentence.Field name=\"LOGOSORVERBUM\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t\t\t</CommandSentence>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Tooltip>\n\t);\n};\n\nexport default EnhancedForLogosWithTooltip;\n","import { useCallback, useEffect, useRef, useState } from 'react';\nimport insightsClient from 'search-insights';\n\nimport { useCurrentUser, usePricing } from '../../per-user-data/per-user-data-context';\nimport type { ProductPrices } from '../../per-user-data/per-user-data-context';\nimport { detectIsAmberOptimizedUrl } from '../../shared/enhanced-image-tag/image';\nimport { getSavingsPercent, slugify } from '../util';\nimport { ProductHitResult } from '../types';\nimport { useSearchResources } from '../search-resources';\nimport { useAlgoliaSearch } from '../algolia-search-context';\n\nconst usdFormat = new Intl.NumberFormat('en-US', {\n\tstyle: 'currency',\n\tcurrency: 'USD',\n\tminimumFractionDigits: 2,\n\tmaximumFractionDigits: 2,\n});\n\nconst placeholderImage = 'https://files.logoscdn.com/v1/assets/15953102/optimized';\n\ninterface UseProductCardProps {\n\thit: ProductHitResult;\n\tqueryId?: string | null;\n\tposition?: number;\n}\n\nexport function useProductCard({ hit, queryId = null, position }: UseProductCardProps) {\n\tconst { data: pricingData } = usePricing(hit.productId);\n\tconst { preferredCurrency } = useCurrentUser();\n\tconst { indexName } = useAlgoliaSearch();\n\tconst hasGeoRestriction = pricingData?.isGeographicallyRestricted;\n\tconst [isAddingToCart, setIsAddingToCart] = useState(false);\n\tconst resources = useSearchResources();\n\tconst productId = hit?.productId;\n\tconst requestIdRef = useRef<string | null>(null);\n\n\t// Use API pricing when available, fall back to Algolia pricing\n\tconst prices: ProductPrices = pricingData?.primarySku?.prices ?? {\n\t\tsalePrice: {\n\t\t\tamount: hit.salePrice ?? 0,\n\t\t\tdisplayAmount: usdFormat.format(hit.salePrice ?? 0),\n\t\t\tdisplayAmountCurrencyCode: null,\n\t\t\tlocalizedDisplayAmount: null,\n\t\t\tcurrencyCode: 'USD',\n\t\t\tdisplayAmountByCurrency: null,\n\t\t},\n\t\tanchorPrice:\n\t\t\thit.salePrice !== hit.anchorPrice\n\t\t\t\t? {\n\t\t\t\t\t\tamount: hit.anchorPrice ?? 0,\n\t\t\t\t\t\tdisplayAmount: usdFormat.format(hit.anchorPrice ?? 0),\n\t\t\t\t\t\tdisplayAmountCurrencyCode: 'USD',\n\t\t\t\t\t\tlocalizedDisplayAmount: null,\n\t\t\t\t\t\tcurrencyCode: 'USD',\n\t\t\t\t\t\tdisplayAmountByCurrency: null,\n\t\t\t\t\t}\n\t\t\t\t: null,\n\t\tdiscountSavings: null,\n\t};\n\n\tconst accessKind = pricingData?.accessKind;\n\tconst isOwned = accessKind === 'Permanent' || accessKind === 'Temporary';\n\tconst hasPreorder = pricingData?.hasPreorder;\n\tconst isPrepubProduct = pricingData?.isPrepubProduct;\n\tconst prepubProductStatusSummary = pricingData?.prepubProductStatusSummary;\n\tconst skuId = pricingData?.primarySku?.skuId;\n\tconst isPurchasable = pricingData?.primarySku?.isPurchasable ?? undefined;\n\n\tuseEffect(() => {\n\t\tconst handleCartUpdated = (e: CustomEvent) => {\n\t\t\tif (e.detail.requestId === requestIdRef.current) {\n\t\t\t\tsetIsAddingToCart(false);\n\t\t\t}\n\t\t};\n\n\t\tconst handleCartUpdateError = (e: CustomEvent) => {\n\t\t\tif (e.detail.requestId === requestIdRef.current) {\n\t\t\t\tsetIsAddingToCart(false);\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener('faithlife.sites.cart.updated', handleCartUpdated as EventListener);\n\t\tdocument.addEventListener('faithlife.sites.cart.updateError', handleCartUpdateError as EventListener);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('faithlife.sites.cart.updated', handleCartUpdated as EventListener);\n\t\t\tdocument.removeEventListener('faithlife.sites.cart.updateError', handleCartUpdateError as EventListener);\n\t\t};\n\t}, []);\n\n\tconst slug = slugify(hit.title);\n\tconst productPath = slug ? `/product/${productId}/${slug}` : `/product/${productId}`;\n\tconst productUrl = queryId ? `${productPath}?queryId=${encodeURIComponent(queryId)}` : productPath;\n\tconst productName = hit.title ?? '';\n\tconst regularPrice = prices?.anchorPrice?.displayAmount;\n\tconst salePrice = prices?.salePrice?.displayAmount;\n\tconst salePriceCurrency = preferredCurrency !== 'USD' ? 'USD' : undefined;\n\tconst localizedSalePrice = prices?.salePrice?.localizedDisplayAmount ?? undefined;\n\tconst discountPercentage = getSavingsPercent(prices);\n\tconst isDiscounted = !!pricingData?.primarySku?.prices?.discountSavings;\n\tconst productImageSrc = hit.primaryImageUri;\n\tconst imageSrc = detectIsAmberOptimizedUrl(productImageSrc ?? '') ? productImageSrc : placeholderImage;\n\tconst isLogosEdition = hit.isLogosEdition ?? false;\n\n\tconst handleProductClick = useCallback(() => {\n\t\tif (!productId) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (queryId && position) {\n\t\t\tinsightsClient('clickedObjectIDsAfterSearch', {\n\t\t\t\tindex: indexName,\n\t\t\t\teventName: `Clicked result on ${window.location.pathname}`.substring(0, 64),\n\t\t\t\tqueryID: queryId,\n\t\t\t\tobjectIDs: [productId],\n\t\t\t\tpositions: [position],\n\t\t\t});\n\t\t} else {\n\t\t\tinsightsClient('clickedObjectIDs', {\n\t\t\t\tindex: indexName,\n\t\t\t\teventName: `Clicked result on ${window.location.pathname}`.substring(0, 64),\n\t\t\t\tobjectIDs: [productId],\n\t\t\t});\n\t\t}\n\t}, [productId, queryId, position, indexName]);\n\n\tconst handleAddToCart = (e: React.MouseEvent<HTMLButtonElement>) => {\n\t\tif (!skuId || isAddingToCart) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Track add-to-cart with Algolia insights\n\t\tif (productId) {\n\t\t\tconst eventType = queryId ? 'addedToCartObjectIDsAfterSearch' : 'addedToCartObjectIDs';\n\t\t\tconst eventData: Record<string, any> = {\n\t\t\t\tindex: indexName,\n\t\t\t\teventName: `Added product to cart on ${window.location.pathname}`.substring(0, 64),\n\t\t\t\tobjectIDs: [productId],\n\t\t\t};\n\t\t\tif (queryId) {\n\t\t\t\teventData.queryID = queryId;\n\t\t\t}\n\t\t\tinsightsClient(eventType as any, eventData);\n\t\t}\n\n\t\tconst requestId = (requestIdRef.current = `${Date.now()}-${Math.random()}`);\n\n\t\tconst eventDetail: Record<string, any> = {\n\t\t\taddToCartUrl: pricingData?.primarySku?.routes?.AddToCartUrl,\n\t\t\tskuIds: [skuId],\n\t\t\tquantity: 1,\n\t\t\tpayInFull: true,\n\t\t\trequestId,\n\t\t};\n\n\t\t// Include searchData for Algolia purchase attribution\n\t\tif (queryId && productId) {\n\t\t\teventDetail.searchData = {\n\t\t\t\tqueryId,\n\t\t\t\tproductIds: [productId],\n\t\t\t};\n\t\t}\n\n\t\te.currentTarget.dispatchEvent(\n\t\t\tnew CustomEvent('faithlife.sites.addToCartButton.click', {\n\t\t\t\tbubbles: true,\n\t\t\t\tdetail: eventDetail,\n\t\t\t})\n\t\t);\n\n\t\tsetIsAddingToCart(true);\n\t};\n\n\treturn {\n\t\tresources,\n\t\tproductUrl,\n\t\tproductName,\n\t\timageSrc,\n\t\tisLogosEdition,\n\t\tregularPrice,\n\t\tsalePrice,\n\t\tsalePriceCurrency,\n\t\tlocalizedSalePrice,\n\t\tdiscountPercentage,\n\t\tisDiscounted,\n\t\taccessKind,\n\t\tisOwned,\n\t\thasGeoRestriction,\n\t\tisPurchasable,\n\t\thasPreorder,\n\t\tisPrepubProduct,\n\t\tprepubProductStatusSummary,\n\t\tskuId,\n\t\tisAddingToCart,\n\t\thandleProductClick,\n\t\thandleAddToCart,\n\t\thit,\n\t};\n}\n\nexport type ProductCardData = ReturnType<typeof useProductCard>;\n","import React from 'react';\nimport { LinkButton } from '@faithlife/commerce-components';\n\nimport { Image } from '../../shared/enhanced-image-tag/image';\n\ninterface ProductImageProps {\n\tproductName: string;\n\timageSrc: string;\n\tproductUrl: string;\n\tpriority?: boolean;\n\thandleProductClick: () => void;\n}\n\nexport function ProductImage({ productName, imageSrc, productUrl, priority, handleProductClick }: ProductImageProps) {\n\treturn (\n\t\t<LinkButton\n\t\t\tclassName=\"flex aspect-[100/122] w-auto justify-center before:hidden [&>span]:contents lg:aspect-[129/158]\"\n\t\t\thref={productUrl}\n\t\t\tintent=\"none\"\n\t\t\tonClick={handleProductClick}\n\t\t\tonAuxClick={handleProductClick}\n\t\t\tscale=\"sm\"\n\t\t\ttouchTarget=\"sm\"\n\t\t>\n\t\t\t<Image\n\t\t\t\talt={productName}\n\t\t\t\tbelowTheFold={!priority}\n\t\t\t\tclassName=\"w-[100px] h-[122px] object-contain lg:h-[158px] lg:w-[129px]\"\n\t\t\t\tsizes={{ mobile: '100vw', tablet: '50vw', desktop: 129 }}\n\t\t\t\tsrc={imageSrc}\n\t\t\t\ttargetAspectRatio={[129, 158]}\n\t\t\t/>\n\t\t</LinkButton>\n\t);\n}\n","import React from 'react';\nimport { Typography } from '@faithlife/commerce-components';\n\nimport { useSearchResources } from '../search-resources';\n\ninterface DiscountBadgeProps {\n\tdiscountPercentage: number;\n\tisDiscounted: boolean;\n\tclassName?: string;\n}\n\nexport function DiscountBadge({ discountPercentage, isDiscounted, className }: DiscountBadgeProps) {\n\tconst resources = useSearchResources();\n\n\tif (discountPercentage <= 1) {\n\t\treturn null;\n\t}\n\n\tconst badgeClassName = isDiscounted ? 'bg-red-300 text-white' : 'bg-primary-200 text-primary-400';\n\n\treturn (\n\t\t<Typography className={`rounded-full px-2 py-[2px] ${badgeClassName} ${className ?? ''}`} variant=\"finePrint\">\n\t\t\t{resources['discountFormat']?.replace('%DISCOUNT_PERCENTAGE%', discountPercentage.toFixed())}\n\t\t</Typography>\n\t);\n}\n","import React from 'react';\nimport { LinkButton, Typography } from '@faithlife/commerce-components';\n\nimport { cn } from '../../../util/cn';\n\ninterface ProductTitleProps {\n\tproductName: string;\n\tproductUrl: string;\n\thandleProductClick: () => void;\n\tclassName?: string;\n}\n\nexport function ProductTitle({ productName, productUrl, handleProductClick, className }: ProductTitleProps) {\n\treturn (\n\t\t<Typography\n\t\t\tclassName={cn('line-clamp-2 hover:underline focus-visible:underline', className)}\n\t\t\ttag=\"h3\"\n\t\t\tvariant=\"bodySmall\"\n\t\t>\n\t\t\t<LinkButton\n\t\t\t\tclassName=\"inline text-inherit [font:inherit] before:hidden [&>span]:contents [&>span]:[font:inherit] [&>span]:tracking-[inherit]\"\n\t\t\t\thref={productUrl}\n\t\t\t\tintent=\"none\"\n\t\t\t\tonAuxClick={handleProductClick}\n\t\t\t\tonClick={handleProductClick}\n\t\t\t\tscale=\"sm\"\n\t\t\t\ttitle={productName}\n\t\t\t\ttouchTarget=\"sm\"\n\t\t\t>\n\t\t\t\t{productName}\n\t\t\t</LinkButton>\n\t\t</Typography>\n\t);\n}\n","import React from 'react';\nimport { Typography } from '@faithlife/commerce-components';\n\ninterface ProductAuthorsProps {\n\tauthors?: string[];\n}\n\nexport function ProductAuthors({ authors }: ProductAuthorsProps) {\n\treturn (\n\t\t<Typography className=\"bodyMd line-clamp-1 text-black\" variant=\"finePrint\">\n\t\t\t{authors?.join(', ')}\n\t\t</Typography>\n\t);\n}\n","import React from 'react';\nimport { Button, PriceLabel, Typography } from '@faithlife/commerce-components';\nimport type { buttonScaleOptions } from '@faithlife/commerce-components';\n\nimport { cn } from '../../../util/cn';\nimport * as Skeleton from '../../skeleton';\nimport { useSearchResources } from '../search-resources';\nimport { ProductCardData } from './use-product-card';\n\ntype ButtonScale = (typeof buttonScaleOptions)[number];\n\nconst ctaButtonScale: ButtonScale = 'medium';\nconst skeletonHeightByButtonScale = {\n\tsmall: 'h-8',\n\tmedium: 'h-12',\n\tlarge: 'h-[60px]',\n} satisfies Record<ButtonScale, string>;\n\ninterface ProductPricingProps {\n\tcardData: ProductCardData;\n\tbuttonLayoutClassName: string;\n}\n\nfunction getOwnershipLabel(\n\tresources: ReturnType<typeof useSearchResources>,\n\thasGeoRestriction: boolean | undefined,\n\taccessKind: string | undefined,\n\thasPreorder: boolean | undefined\n): string | null {\n\tif (hasGeoRestriction) {\n\t\treturn resources['geoRestrictionMessage'];\n\t}\n\tif (accessKind === 'Permanent') {\n\t\treturn resources['permanentOwnMessage'];\n\t}\n\tif (accessKind === 'Temporary') {\n\t\treturn resources['temporaryOwnMessage'];\n\t}\n\tif (hasPreorder) {\n\t\treturn resources['hasPreorderMessage'];\n\t}\n\treturn null;\n}\n\nexport function ProductPricing({ cardData, buttonLayoutClassName }: ProductPricingProps) {\n\treturn (\n\t\t<>\n\t\t\t<ProductPrice cardData={cardData} className=\"items-end\" />\n\t\t\t<ProductCta\n\t\t\t\tbuttonLayoutClassName={buttonLayoutClassName}\n\t\t\t\tcardData={cardData}\n\t\t\t\townershipLabelClassName=\"text-right\"\n\t\t\t/>\n\t\t</>\n\t);\n}\n\ninterface ProductPriceProps {\n\tcardData: ProductCardData;\n\tclassName?: string;\n}\n\nexport function ProductPrice({ cardData, className }: ProductPriceProps) {\n\tconst { salePrice, salePriceCurrency, regularPrice, localizedSalePrice, isDiscounted, accessKind } = cardData;\n\n\tif (accessKind === 'Permanent' || accessKind === 'Temporary') {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PriceLabel\n\t\t\tvariant={isDiscounted ? 'sale' : 'value'}\n\t\t\tlayout=\"vertical\"\n\t\t\tsalePrice={salePrice ?? ''}\n\t\t\tsalePriceCurrency={salePriceCurrency ?? undefined}\n\t\t\tanchorPrice={regularPrice}\n\t\t\tlocalizedSalePrice={localizedSalePrice ?? undefined}\n\t\t\tclassName={cn(className)}\n\t\t/>\n\t);\n}\n\ninterface ProductCtaProps {\n\tcardData: ProductCardData;\n\tbuttonLayoutClassName: string;\n\townershipLabelClassName?: string;\n}\n\nexport function ProductCta({ cardData, buttonLayoutClassName, ownershipLabelClassName }: ProductCtaProps) {\n\tconst resources = useSearchResources();\n\tconst {\n\t\tisPurchasable,\n\t\thasGeoRestriction,\n\t\taccessKind,\n\t\thasPreorder,\n\t\tskuId,\n\t\tisAddingToCart,\n\t\tisPrepubProduct,\n\t\thandleAddToCart,\n\t} = cardData;\n\n\tlet purchaseStatusMessage = getOwnershipLabel(resources, hasGeoRestriction, accessKind, hasPreorder);\n\n\tif (isPurchasable !== undefined && !isPurchasable && !purchaseStatusMessage) {\n\t\tpurchaseStatusMessage = resources['UnavailableToPurchase'];\n\t}\n\n\tif (purchaseStatusMessage) {\n\t\treturn (\n\t\t\t<Typography\n\t\t\t\tvariant=\"bodyRegular\"\n\t\t\t\tclassName={cn('text-primary-500', ownershipLabelClassName ?? cn('text-center', !hasPreorder && 'md:pt-sp16'))}\n\t\t\t>\n\t\t\t\t{purchaseStatusMessage}\n\t\t\t</Typography>\n\t\t);\n\t}\n\n\tif (skuId) {\n\t\treturn (\n\t\t\t<div className={cn('inline-flex gap-2 lg:gap-3', buttonLayoutClassName)}>\n\t\t\t\t<Button\n\t\t\t\t\tdisabled={isAddingToCart}\n\t\t\t\t\tonClick={handleAddToCart}\n\t\t\t\t\tscale={ctaButtonScale}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t>\n\t\t\t\t\t{isAddingToCart\n\t\t\t\t\t\t? resources['addingToCart']\n\t\t\t\t\t\t: isPrepubProduct\n\t\t\t\t\t\t\t? resources['preorder']\n\t\t\t\t\t\t\t: resources['addToCart']}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Skeleton.Root className={cn('animate-pulse inline-flex gap-2 lg:gap-3', buttonLayoutClassName)}>\n\t\t\t<Skeleton.Box className={cn('w-full', skeletonHeightByButtonScale[ctaButtonScale])} />\n\t\t</Skeleton.Root>\n\t);\n}\n","import React from 'react';\nimport { StarRating } from '@faithlife/commerce-components';\n\nimport { ProductHitResult } from '../types';\nimport { useProductInWishList } from '../../add-to-wish-list/hooks';\nimport { AddToWishListWithForm } from '../../add-to-wish-list';\nimport EnhancedForLogosWithTooltip from '../../shared/enhanced-for-logos-with-tooltip';\nimport { hasValidReviewData } from '../../shared/ratings/review-data';\nimport { PrepubProductStatusSummary } from '../../product/product-details-page/right-column/prepub-product-status-summary';\nimport { useProductCard } from './use-product-card';\nimport { ProductImage } from './product-image';\nimport { DiscountBadge } from './discount-badge';\nimport { ProductTitle } from './product-title';\nimport { ProductAuthors } from './product-authors';\nimport { ProductPrice, ProductCta } from './product-pricing';\n\ninterface AlgoliaGridCardProps {\n\thit: ProductHitResult;\n\tpriority?: boolean;\n\tqueryId?: string | null;\n\tposition?: number;\n}\n\nexport function AlgoliaGridCard({ hit, priority, queryId = null, position }: AlgoliaGridCardProps) {\n\tconst cardData = useProductCard({ hit, queryId, position });\n\tconst {\n\t\tproductUrl,\n\t\tproductName,\n\t\timageSrc,\n\t\tdiscountPercentage,\n\t\tisDiscounted,\n\t\thandleProductClick,\n\t\tskuId,\n\t\tisLogosEdition,\n\t\tprepubProductStatusSummary,\n\t\tisOwned,\n\t} = cardData;\n\tconst productInWishlist = useProductInWishList(hit.productId, skuId, !isOwned);\n\tconst averageRating = hit.averageRating ?? 0;\n\tconst reviewCount = hit.reviewCount ?? 0;\n\tconst hasReviewData = hasValidReviewData(averageRating, reviewCount);\n\n\treturn (\n\t\t<div className=\"grid gap-y-0 grid-rows-subgrid row-span-5 grid-cols-1\">\n\t\t\t{/* Row 1: Image — fixed aspect ratio, never grows */}\n\t\t\t<div className=\"relative flex flex-col items-center justify-start gap-sp12 pt-3 lg:pt-4\">\n\t\t\t\t<div className=\"flex h-43.5 w-full items-end justify-center\">\n\t\t\t\t\t<ProductImage\n\t\t\t\t\t\thandleProductClick={handleProductClick}\n\t\t\t\t\t\timageSrc={imageSrc}\n\t\t\t\t\t\tpriority={priority}\n\t\t\t\t\t\tproductName={productName}\n\t\t\t\t\t\tproductUrl={productUrl}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"h-4 text-center\">{isLogosEdition && <EnhancedForLogosWithTooltip />}</div>\n\t\t\t\t{!isOwned && (\n\t\t\t\t\t<DiscountBadge\n\t\t\t\t\t\tclassName=\"absolute top-2 left-2\"\n\t\t\t\t\t\tdiscountPercentage={discountPercentage}\n\t\t\t\t\t\tisDiscounted={isDiscounted}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t<AddToWishListWithForm {...productInWishlist} variant=\"icon\" isOwned={isOwned} />\n\t\t\t</div>\n\n\t\t\t{/* Row 2: Info — grows to absorb variable space */}\n\t\t\t<div className=\"px-2 pt-sp12 pb-1 lg:px-4 lg:pb-2\">\n\t\t\t\t<ProductTitle\n\t\t\t\t\tclassName=\"line-clamp-2\"\n\t\t\t\t\thandleProductClick={handleProductClick}\n\t\t\t\t\tproductName={productName}\n\t\t\t\t\tproductUrl={productUrl}\n\t\t\t\t/>\n\n\t\t\t\t<div className=\"mt-sp8\">\n\t\t\t\t\t<ProductAuthors authors={hit.authors} />\n\t\t\t\t</div>\n\n\t\t\t\t{hasReviewData && (\n\t\t\t\t\t<div className=\"mt-sp8\">\n\t\t\t\t\t\t<StarRating rating={averageRating} reviewCount={reviewCount} />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{/* Row 3: Prepub summary — empty when not present */}\n\t\t\t<div className=\"px-2 lg:px-4\">\n\t\t\t\t{prepubProductStatusSummary && (\n\t\t\t\t\t<PrepubProductStatusSummary {...prepubProductStatusSummary} variant=\"search-grid\" />\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{/* Row 4: Price — always aligned across cards */}\n\t\t\t<div className=\"flex items-end px-2 md:pb-1 lg:px-4\">\n\t\t\t\t<ProductPrice cardData={cardData} />\n\t\t\t</div>\n\n\t\t\t{/* Row 5: CTA — always aligned across cards */}\n\t\t\t<ProductCta buttonLayoutClassName=\"w-full flex-col px-2 pb-2 pt-2 lg:px-4 lg:pb-4\" cardData={cardData} />\n\t\t</div>\n\t);\n}\n","import React, { useEffect, useRef, useState } from 'react';\nimport { LinkButton } from '@faithlife/commerce-components';\n\nimport { cn } from '../../../util/cn';\nimport { useSearchResources } from '../search-resources';\n\ninterface ProductOverviewProps {\n\toverview?: string;\n}\n\nexport function ProductOverview({ overview }: ProductOverviewProps) {\n\tconst [isExpanded, setIsExpanded] = useState(false);\n\tconst [showButton, setShowButton] = useState(false);\n\tconst overviewRef = useRef<HTMLDivElement>(null);\n\tconst resources = useSearchResources();\n\n\tuseEffect(() => {\n\t\tconst element = overviewRef.current;\n\n\t\tif (element) {\n\t\t\ttry {\n\t\t\t\tconst height = element.scrollHeight;\n\t\t\t\tconst computedLineHeight = getComputedStyle(element).lineHeight;\n\t\t\t\tconst parsedLineHeight = parseInt(computedLineHeight, 10);\n\t\t\t\tconst lineHeight = Number.isFinite(parsedLineHeight) && parsedLineHeight > 0 ? parsedLineHeight : 20;\n\t\t\t\tconst maxHeight = lineHeight * 4;\n\t\t\t\tconst maxHeightMobile = lineHeight * 2;\n\n\t\t\t\tif (height > maxHeight || height > maxHeightMobile) {\n\t\t\t\t\tsetShowButton(true);\n\t\t\t\t} else {\n\t\t\t\t\tsetShowButton(false);\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\tsetShowButton(false);\n\t\t\t}\n\t\t}\n\t}, [overview]);\n\n\tconst toggleExpand = () => {\n\t\tsetIsExpanded(!isExpanded);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'hidden text-black [&>*:first-child]:mt-0',\n\t\t\t\t\t!isExpanded && 'md:line-clamp-2',\n\t\t\t\t\tisExpanded && 'md:line-clamp-none'\n\t\t\t\t)}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: overview ?? '' }}\n\t\t\t\tref={overviewRef}\n\t\t\t/>\n\t\t\t{showButton && (\n\t\t\t\t<LinkButton\n\t\t\t\t\tas=\"button\"\n\t\t\t\t\tclassName=\"hidden md:inline-flex bodyMd !font-normal\"\n\t\t\t\t\tintent=\"none\"\n\t\t\t\t\tonClick={toggleExpand}\n\t\t\t\t\tscale=\"sm\"\n\t\t\t\t>\n\t\t\t\t\t{isExpanded ? resources['readLess'] : resources['readMore']}\n\t\t\t\t</LinkButton>\n\t\t\t)}\n\t\t</>\n\t);\n}\n","import React from 'react';\nimport { StarRating } from '@faithlife/commerce-components';\n\nimport { ProductHitResult } from '../types';\nimport { AddToWishListWithForm } from '../../add-to-wish-list';\nimport { useProductInWishList } from '../../add-to-wish-list/hooks';\nimport EnhancedForLogosWithTooltip from '../../shared/enhanced-for-logos-with-tooltip';\nimport { hasValidReviewData } from '../../shared/ratings/review-data';\nimport { PrepubProductStatusSummary } from '../../product/product-details-page/right-column/prepub-product-status-summary';\nimport { useProductCard } from './use-product-card';\nimport { DiscountBadge } from './discount-badge';\nimport { ProductTitle } from './product-title';\nimport { ProductAuthors } from './product-authors';\nimport { ProductOverview } from './product-overview';\nimport { ProductPricing } from './product-pricing';\nimport { ProductImage } from './product-image';\n\ninterface AlgoliaListCardProps {\n\thit: ProductHitResult;\n\tpriority?: boolean;\n\tqueryId?: string | null;\n\tposition?: number;\n}\n\nexport function AlgoliaListCard({ hit, priority, queryId = null, position }: AlgoliaListCardProps) {\n\tconst cardData = useProductCard({ hit, queryId, position });\n\tconst {\n\t\tproductUrl,\n\t\tproductName,\n\t\timageSrc,\n\t\tdiscountPercentage,\n\t\tisDiscounted,\n\t\thandleProductClick,\n\t\tskuId,\n\t\tisOwned,\n\t\tisLogosEdition,\n\t\tprepubProductStatusSummary,\n\t} = cardData;\n\tconst productInWishlist = useProductInWishList(hit.productId, skuId, !isOwned);\n\tconst averageRating = hit.averageRating ?? 0;\n\tconst reviewCount = hit.reviewCount ?? 0;\n\tconst hasReviewData = hasValidReviewData(averageRating, reviewCount);\n\n\treturn (\n\t\t<div className=\"grid grid-cols-[139px_auto] md:grid-cols-[190px_auto]\">\n\t\t\t<div className=\"relative col-span-1 flex w-full items-start justify-center\">\n\t\t\t\t<div className=\"flex w-auto flex-col gap-sp8 pt-2 pb-[43px] lg:pt-3 md:pb-9\">\n\t\t\t\t\t<div className=\"relative\">\n\t\t\t\t\t\t<ProductImage\n\t\t\t\t\t\t\thandleProductClick={handleProductClick}\n\t\t\t\t\t\t\timageSrc={imageSrc}\n\t\t\t\t\t\t\tpriority={priority}\n\t\t\t\t\t\t\tproductName={productName}\n\t\t\t\t\t\t\tproductUrl={productUrl}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{!isOwned && (\n\t\t\t\t\t\t\t<DiscountBadge\n\t\t\t\t\t\t\t\tclassName=\"absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 pointer-events-none\"\n\t\t\t\t\t\t\t\tdiscountPercentage={discountPercentage}\n\t\t\t\t\t\t\t\tisDiscounted={isDiscounted}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{isLogosEdition && (\n\t\t\t\t\t\t<div className=\"text-center\">\n\t\t\t\t\t\t\t<EnhancedForLogosWithTooltip />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div className=\"grid p-2 pb-8 md:grid-cols-[auto_168px] md:gap-8 md:pb-2 lg:p-3\">\n\t\t\t\t<div className=\"flex-1\">\n\t\t\t\t\t<ProductTitle handleProductClick={handleProductClick} productName={productName} productUrl={productUrl} />\n\n\t\t\t\t\t<div className=\"mt-sp8\">\n\t\t\t\t\t\t<ProductAuthors authors={hit.authors} />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{hasReviewData && (\n\t\t\t\t\t\t<div className=\"mt-sp8\">\n\t\t\t\t\t\t\t<StarRating rating={averageRating} reviewCount={reviewCount} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div className=\"mt-sp12\">\n\t\t\t\t\t\t<ProductOverview overview={hit.overview} />\n\t\t\t\t\t</div>\n\t\t\t\t\t{prepubProductStatusSummary && (\n\t\t\t\t\t\t<PrepubProductStatusSummary {...prepubProductStatusSummary} variant=\"search-list\" />\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"flex grow-0 flex-col gap-2 lg:gap-3 items-end\">\n\t\t\t\t\t<ProductPricing\n\t\t\t\t\t\tbuttonLayoutClassName=\"w-full flex-col xmd:flex-row md:flex-col max-w-[145px]\"\n\t\t\t\t\t\tcardData={cardData}\n\t\t\t\t\t/>\n\t\t\t\t\t<AddToWishListWithForm {...productInWishlist} variant=\"link\" isOwned={isOwned} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import React, { useCallback } from 'react';\nimport { Hit } from 'instantsearch.js';\nimport { Hits, useInstantSearch } from 'react-instantsearch';\n\nimport { cn } from '../../util/cn';\nimport * as Skeleton from '../skeleton';\nimport { WishListProductBatchProvider } from '../add-to-wish-list/hooks';\nimport { ProductHitResult } from './types';\nimport { AlgoliaGridCard } from './product-card/algolia-grid-card';\nimport { AlgoliaListCard } from './product-card/algolia-list-card';\n\n// ---------------------------------------------------------------------------\n// ProductHits — grid/list of search result cards\n// ---------------------------------------------------------------------------\n\ninterface ProductHitsProps {\n\tlayoutType: 'grid' | 'list';\n\twishListsProductsUrl: string;\n\tcurrentHitsPerPage: number;\n}\n\nfunction SkeletonBlock({ className, rootClassName }: { className: string; rootClassName?: string }) {\n\treturn <Skeleton.Box className={cn(className, rootClassName)} />;\n}\n\nfunction SkeletonButton({ className }: { className: string }) {\n\treturn <Skeleton.Box className={cn('h-12 inline-flex gap-2 lg:gap-3', className)} />;\n}\n\nfunction ProductSkeleton({ layoutType }: { layoutType: 'grid' | 'list' }) {\n\tif (layoutType === 'list') {\n\t\treturn (\n\t\t\t<Skeleton.Root className=\"animate-pulse\">\n\t\t\t\t<div className=\"grid grid-cols-[139px_auto] md:grid-cols-[190px_auto]\">\n\t\t\t\t\t<div className=\"relative col-span-1 flex w-full items-start justify-center\">\n\t\t\t\t\t\t<div className=\"flex w-auto flex-col gap-sp8 pt-2 pb-[43px] lg:pt-3 md:pb-9\">\n\t\t\t\t\t\t\t<div className=\"relative\">\n\t\t\t\t\t\t\t\t<SkeletonBlock className=\"h-[122px] w-[122px] lg:h-[158px] lg:w-[158px]\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"text-center\">\n\t\t\t\t\t\t\t\t<SkeletonBlock className=\"h-4 w-20\" rootClassName=\"mx-auto h-4 w-20\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"grid gap-sp8 p-2 pb-8 md:grid-cols-[auto_168px] md:gap-8 md:pb-2 lg:p-3\">\n\t\t\t\t\t\t<div className=\"flex-1\">\n\t\t\t\t\t\t\t<SkeletonBlock className=\"h-12 w-full\" />\n\t\t\t\t\t\t\t<SkeletonBlock className=\"mt-sp8 h-4 w-3/5\" />\n\t\t\t\t\t\t\t<SkeletonBlock className=\"mt-sp8 h-5 w-2/5\" />\n\t\t\t\t\t\t\t<SkeletonBlock className=\"mt-sp12 h-16 w-full\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"flex flex-col items-end gap-2 lg:gap-3\">\n\t\t\t\t\t\t\t<div className=\"flex flex-col items-end gap-sp4\">\n\t\t\t\t\t\t\t\t<SkeletonBlock className=\"h-4 w-20\" />\n\t\t\t\t\t\t\t\t<SkeletonBlock className=\"h-7 w-24\" />\n\t\t\t\t\t\t\t\t<SkeletonBlock className=\"h-4 w-16\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<SkeletonButton className=\"w-full max-w-[145px]\" />\n\t\t\t\t\t\t\t<SkeletonBlock className=\"h-4 w-24\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</Skeleton.Root>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Skeleton.Root className=\"animate-pulse grid gap-y-0 grid-rows-subgrid row-span-5 grid-cols-1\">\n\t\t\t<div className=\"relative flex flex-col items-center justify-start gap-sp12 pt-3 lg:pt-4\">\n\t\t\t\t<div className=\"flex h-43.5 w-full items-end justify-center\">\n\t\t\t\t\t<SkeletonBlock\n\t\t\t\t\t\tclassName=\"h-[122px] w-[100px] lg:h-[158px] lg:w-[129px]\"\n\t\t\t\t\t\trootClassName=\"h-[122px] w-[100px] lg:h-[158px] lg:w-[129px]\"\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<SkeletonBlock className=\"h-4 w-20\" rootClassName=\"mx-auto h-4 w-20\" />\n\t\t\t</div>\n\t\t\t<div className=\"px-2 pt-sp12 pb-1 lg:px-4 lg:pb-2\">\n\t\t\t\t<SkeletonBlock className=\"h-12 w-full\" />\n\t\t\t\t<SkeletonBlock className=\"mt-sp8 h-4 w-3/5\" />\n\t\t\t\t<SkeletonBlock className=\"mt-sp8 h-5 w-2/5\" />\n\t\t\t</div>\n\t\t\t<div className=\"px-2 lg:px-4\" />\n\t\t\t<div className=\"flex items-end px-2 md:pb-1 lg:px-4\">\n\t\t\t\t<div className=\"flex w-full flex-col gap-sp4\">\n\t\t\t\t\t<SkeletonBlock className=\"h-4 w-3/5\" rootClassName=\"h-4 w-3/5\" />\n\t\t\t\t\t<SkeletonBlock className=\"h-7 w-4/5\" rootClassName=\"h-7 w-4/5\" />\n\t\t\t\t\t<SkeletonBlock className=\"h-4 w-2/5\" rootClassName=\"h-4 w-2/5\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"flex items-end justify-center px-2 pb-2 pt-2 lg:px-4 lg:pb-4\">\n\t\t\t\t<SkeletonButton className=\"w-full\" />\n\t\t\t</div>\n\t\t</Skeleton.Root>\n\t);\n}\n\nfunction ProductSkeletons({\n\tlayoutType,\n\tcurrentHitsPerPage,\n}: {\n\tlayoutType: 'grid' | 'list';\n\tcurrentHitsPerPage: number;\n}) {\n\treturn (\n\t\t<ol\n\t\t\taria-label=\"Loading search results\"\n\t\t\tclassName={cn(\n\t\t\t\t'grid grid-cols-1',\n\t\t\t\tlayoutType === 'grid' &&\n\t\t\t\t\t'auto-rows-[max-content_auto_max-content_max-content_max-content] grid-cols-2 gap-sp8 lg:grid-cols-3 lg:gap-sp16',\n\t\t\t\tlayoutType === 'list' && 'gap-6 md:gap-8'\n\t\t\t)}\n\t\t>\n\t\t\t{Array.from({ length: currentHitsPerPage }, (_, index) => (\n\t\t\t\t<li\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\tlayoutType === 'grid' &&\n\t\t\t\t\t\t\t'grid gap-y-0 grid-rows-subgrid row-span-5 grid-cols-1 outline outline-1 outline-grey',\n\t\t\t\t\t\tlayoutType === 'list' && 'first:border-t border-b border-grey-200 first:pt-6 first:md:pt-8'\n\t\t\t\t\t)}\n\t\t\t\t\tkey={index}\n\t\t\t\t>\n\t\t\t\t\t<ProductSkeleton layoutType={layoutType} />\n\t\t\t\t</li>\n\t\t\t))}\n\t\t</ol>\n\t);\n}\n\nfunction toProductHitResult(hit: Hit<ProductHitResult>): ProductHitResult {\n\treturn {\n\t\t...hit,\n\t\tproductId: hit.productId !== null && hit.productId !== undefined ? hit.productId.toString() : undefined,\n\t};\n}\n\nexport function ProductHits({ layoutType, wishListsProductsUrl, currentHitsPerPage }: ProductHitsProps) {\n\tconst Card = layoutType === 'list' ? AlgoliaListCard : AlgoliaGridCard;\n\tconst { status } = useInstantSearch();\n\tconst HitComponent = useCallback(\n\t\t({ hit }: { hit: Hit<ProductHitResult> }) => (\n\t\t\t<Card\n\t\t\t\thit={toProductHitResult(hit)}\n\t\t\t\t// eslint-disable-next-line no-underscore-dangle\n\t\t\t\tpriority={typeof hit.__position === 'number' && hit.__position <= 6}\n\t\t\t\t// eslint-disable-next-line no-underscore-dangle\n\t\t\t\tqueryId={(hit as any).__queryID ?? null}\n\t\t\t\t// eslint-disable-next-line no-underscore-dangle\n\t\t\t\tposition={hit.__position}\n\t\t\t/>\n\t\t),\n\t\t[Card]\n\t);\n\n\treturn (\n\t\t<WishListProductBatchProvider wishListsProductsUrl={wishListsProductsUrl}>\n\t\t\t<section aria-label=\"Search results\">\n\t\t\t\t{status === 'stalled' && (\n\t\t\t\t\t<div className=\"pt-4 pb-6 lg:px-4 lg:py-8\">\n\t\t\t\t\t\t<ProductSkeletons layoutType={layoutType} currentHitsPerPage={currentHitsPerPage} />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t<Hits\n\t\t\t\t\tclassNames={{\n\t\t\t\t\t\troot: cn('pt-4 pb-6 lg:px-4 lg:py-8', status === 'stalled' && 'hidden'),\n\t\t\t\t\t\tlist: cn(\n\t\t\t\t\t\t\t'grid grid-cols-1',\n\t\t\t\t\t\t\tlayoutType === 'grid' &&\n\t\t\t\t\t\t\t\t'auto-rows-[max-content_auto_max-content_max-content_max-content] grid-cols-2 gap-sp8 lg:grid-cols-3 lg:gap-sp16',\n\t\t\t\t\t\t\tlayoutType === 'list' && 'gap-6 md:gap-8'\n\t\t\t\t\t\t),\n\t\t\t\t\t\titem: cn(\n\t\t\t\t\t\t\t/* the grid definition must match AlgoliaGridCard to pass subgrid tracks to it correctly */\n\t\t\t\t\t\t\tlayoutType === 'grid' &&\n\t\t\t\t\t\t\t\t'grid gap-y-0 grid-rows-subgrid row-span-5 grid-cols-1 outline outline-1 outline-grey',\n\t\t\t\t\t\t\t/* first:pt matches the gap-6/md:gap-8 list gutter so item 1's top spacing matches the gap preceding every other item */\n\t\t\t\t\t\t\tlayoutType === 'list' && 'first:border-t border-b border-grey-200 first:pt-6 first:md:pt-8'\n\t\t\t\t\t\t),\n\t\t\t\t\t}}\n\t\t\t\t\thitComponent={HitComponent}\n\t\t\t\t/>\n\t\t\t</section>\n\t\t</WishListProductBatchProvider>\n\t);\n}\n\nexport default ProductHits;\n","import React from 'react';\nimport { Typography } from '@faithlife/commerce-components';\n\nimport { cn } from '../../util/cn';\nimport { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '../accordion';\n\nexport interface RadioAccordionItem<TValue extends string | number> {\n\tchecked: boolean;\n\tlabel: string;\n\tvalue: TValue;\n}\n\ninterface RadioAccordionProps<TValue extends string | number> {\n\tradioGroupName: string;\n\titems: RadioAccordionItem<TValue>[];\n\tonSelect: (value: TValue) => void;\n\tprefixLabel: string;\n}\n\nexport default function RadioAccordion<TValue extends string | number>({\n\tradioGroupName,\n\titems,\n\tonSelect,\n\tprefixLabel,\n}: RadioAccordionProps<TValue>) {\n\tconst currentItem = items.find(item => item.checked);\n\n\treturn (\n\t\t<Accordion collapsible type=\"single\">\n\t\t\t<AccordionItem value={radioGroupName}>\n\t\t\t\t<AccordionTrigger className=\"border-t border-primary-100 p-4 lg:border-t-0 [&>svg]:text-primary\">\n\t\t\t\t\t<Typography className=\"text-primary-400\" variant=\"bodyRegular\">\n\t\t\t\t\t\t{prefixLabel} {}\n\t\t\t\t\t\t{currentItem && <span className=\"font-semibold\">{currentItem.label}</span>}\n\t\t\t\t\t</Typography>\n\t\t\t\t</AccordionTrigger>\n\t\t\t\t<AccordionContent className=\"m-0 bg-grey-200 p-4\">\n\t\t\t\t\t<div className=\"flex flex-col gap-y-4\">\n\t\t\t\t\t\t{items.map(item => (\n\t\t\t\t\t\t\t<label className=\"bodySm flex cursor-pointer items-center text-black-200\" key={item.value}>\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\tchecked={item.checked}\n\t\t\t\t\t\t\t\t\tname={radioGroupName}\n\t\t\t\t\t\t\t\t\tclassName=\"mr-3 h-3.25 w-3.25 border-grey-100 text-primary\"\n\t\t\t\t\t\t\t\t\tonChange={() => onSelect(item.value)}\n\t\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\t\tvalue={item.value}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<span className={cn(item.checked ? 'text-primary' : 'text-black-200 hover:text-secondary-200')}>\n\t\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t</AccordionContent>\n\t\t\t</AccordionItem>\n\t\t</Accordion>\n\t);\n}\n","import React from 'react';\nimport { useSortBy } from 'react-instantsearch';\n\nimport { useSearchResources } from './search-resources';\nimport RadioAccordion from './radio-accordion';\n\ninterface SortByItem {\n\tlabel: string;\n\tvalue: string;\n}\n\ninterface SortByAccordionProps {\n\titems: SortByItem[];\n}\n\nexport default function SortByAccordion({ items }: SortByAccordionProps) {\n\tconst resources = useSearchResources();\n\tconst { currentRefinement, refine } = useSortBy({ items });\n\n\treturn (\n\t\t<RadioAccordion\n\t\t\tradioGroupName=\"sort-by\"\n\t\t\titems={items.map(item => ({ ...item, checked: item.value === currentRefinement }))}\n\t\t\tonSelect={refine}\n\t\t\tprefixLabel={resources['sortBy']}\n\t\t/>\n\t);\n}\n","import React from 'react';\nimport { useHitsPerPage } from 'react-instantsearch';\n\nimport { useSearchResources } from './search-resources';\nimport RadioAccordion from './radio-accordion';\n\ninterface HitsPerPageItem {\n\tdefault?: boolean;\n\tlabel: string;\n\tvalue: number;\n}\n\ninterface HitsPerPageAccordionProps {\n\titems: HitsPerPageItem[];\n}\n\nexport default function HitsPerPageAccordion({ items }: HitsPerPageAccordionProps) {\n\tconst resources = useSearchResources();\n\tconst { items: showItems, refine } = useHitsPerPage({ items });\n\n\treturn (\n\t\t<RadioAccordion\n\t\t\tradioGroupName=\"hits-per-page\"\n\t\t\titems={showItems.map(item => ({ ...item, checked: item.isRefined }))}\n\t\t\tonSelect={refine}\n\t\t\tprefixLabel={resources['show']}\n\t\t/>\n\t);\n}\n","import React, { createContext, useContext, useEffect, useState } from 'react';\nimport Cookies from 'js-cookie';\nimport { safeUrl } from './util';\n\nexport enum ViewMode {\n\tgrid = 'grid',\n\tlist = 'list',\n}\n\ninterface ViewModeContextType {\n\tviewMode: ViewMode;\n\tsetViewMode: (mode: ViewMode) => void;\n}\n\nconst ViewModeContext = createContext<ViewModeContextType | null>(null);\n\nexport const viewModeKey = 'viewMode';\nconst viewModeValues = Object.values(ViewMode);\n\nconst getInitialViewMode = (): ViewMode => {\n\tconst url = typeof window !== 'undefined' ? safeUrl(window.location.href) : null;\n\n\tconst urlViewMode = url?.searchParams.get(viewModeKey);\n\tif (viewModeValues.includes(urlViewMode as ViewMode)) {\n\t\treturn urlViewMode as ViewMode;\n\t}\n\n\tconst cookieViewMode = Cookies.get(viewModeKey);\n\tif (viewModeValues.includes(cookieViewMode as ViewMode)) {\n\t\treturn cookieViewMode as ViewMode;\n\t}\n\n\treturn ViewMode.grid;\n};\n\nexport const ViewModeProvider = ({ children }: { children: React.ReactNode }) => {\n\tconst [viewMode, setViewMode] = useState<ViewMode>(() => getInitialViewMode());\n\n\tuseEffect(() => {\n\t\tconst url = typeof window !== 'undefined' ? safeUrl(window.location.href) : null;\n\t\tif (url) {\n\t\t\turl?.searchParams.set(viewModeKey, viewMode);\n\t\t\twindow.history.replaceState({}, '', url);\n\t\t}\n\t\tCookies.set(viewModeKey, viewMode);\n\t}, [viewMode]);\n\n\treturn <ViewModeContext.Provider value={{ viewMode, setViewMode }}>{children}</ViewModeContext.Provider>;\n};\n\nexport const useViewMode = () => {\n\tconst context = useContext(ViewModeContext);\n\n\tif (!context) {\n\t\tthrow new Error('useViewMode must be used within ViewModeProvider');\n\t}\n\n\treturn context;\n};\n","import { StateMapping, UiState } from 'instantsearch.js';\nimport history from 'instantsearch.js/es/lib/routers/history';\n\nimport { SearchCategory } from './types';\nimport { UserSearchFilter } from './user-search-filter-context';\nimport { safeUrl } from './util';\nimport { viewModeKey } from './use-view-mode';\n\n// ---------------------------------------------------------------------------\n// Facet configuration\n// ---------------------------------------------------------------------------\n\nexport interface SimpleFacetConfiguration {\n\ttype: 'simple';\n\talgoliaAttribute: string;\n\trouteKey: string;\n\tisHidden?: boolean;\n}\n\nexport interface HierarchicalFacetConfiguration {\n\ttype: 'hierarchical';\n\talgoliaAttributeBase: string;\n\trouteKeyPrefix: string;\n\tminLevel: number;\n\tmaxLevel: number;\n\tcategoryToken?: string;\n\tisHidden?: boolean;\n}\n\nexport type FacetConfiguration = SimpleFacetConfiguration | HierarchicalFacetConfiguration;\n\n// ---------------------------------------------------------------------------\n// Route state types and helpers\n// ---------------------------------------------------------------------------\n\ntype RouteStateFacets = Record<string, string[]>;\ntype RouteStateFilters = Record<string, string>;\n\nfunction getAllFacetingKeys(facetConfigurations: FacetConfiguration[]): string[] {\n\treturn [\n\t\t...facetConfigurations\n\t\t\t.filter((config): config is SimpleFacetConfiguration => config.type === 'simple')\n\t\t\t.map(config => config.routeKey),\n\t\t...facetConfigurations\n\t\t\t.filter((config): config is HierarchicalFacetConfiguration => config.type === 'hierarchical')\n\t\t\t.flatMap(config => {\n\t\t\t\tconst keys: string[] = [];\n\n\t\t\t\tfor (let level = config.minLevel; level <= config.maxLevel; level += 1) {\n\t\t\t\t\tkeys.push(`${config.routeKeyPrefix}${level}`);\n\t\t\t\t}\n\n\t\t\t\treturn keys;\n\t\t\t}),\n\t];\n}\n\nfunction getQueryParamNameByTopLevelTokenMap(facetConfigurations: FacetConfiguration[]): Record<string, string> {\n\tconst map: Record<string, string> = {};\n\n\tfor (const config of facetConfigurations) {\n\t\tif (config.type === 'hierarchical' && config.categoryToken) {\n\t\t\tmap[config.categoryToken] = `${config.routeKeyPrefix}${config.minLevel}`;\n\t\t}\n\t}\n\n\treturn map;\n}\n\nexport interface RouteState {\n\tquery?: string;\n\n\tfacets?: RouteStateFacets;\n\tfilters?: RouteStateFilters;\n\n\tsortBy?: string;\n\tlimit?: number;\n\tpage?: number;\n}\n\nconst delimiter = '+';\n\nfunction arrayToQueryParam(array: string[] | undefined): string | undefined {\n\treturn array?.length ? array.join(delimiter) : undefined;\n}\n\nfunction emptyIfUndefined<T>(array: T[] | undefined): T[] {\n\treturn array && array.length > 0 ? array : [];\n}\n\nfunction getTrimmedOrUndefinedIfStringEmpty(value: string): string | undefined {\n\tconst trimmed = value.trim();\n\n\treturn trimmed.length > 0 ? trimmed : undefined;\n}\n\ninterface CategoryPageFacetConfiguration {\n\tqueryParamName: string;\n\tvalue: string;\n}\n\ninterface CategoryPageConfiguration {\n\tfacets: CategoryPageFacetConfiguration[];\n\tcategoryPageUrl: string;\n\tpageTitle: string;\n}\n\nfunction getMatchingCategoryPageFromRouteState(\n\trouteState: RouteState,\n\tcategoryPageConfigurations: CategoryPageConfiguration[],\n\tallFacetingKeys: string[]\n): CategoryPageConfiguration | null {\n\tconst facetKeys = new Set([...allFacetingKeys, ...Object.keys(routeState.facets ?? {})]);\n\tconst facets = [...facetKeys].map(key => ({\n\t\tkey,\n\t\tvalue: routeState.facets?.[key],\n\t}));\n\n\tfor (const categoryPageConfiguration of categoryPageConfigurations) {\n\t\tconst matches = checkCategoryPageConfigurationMatches(categoryPageConfiguration, facets);\n\n\t\tif (matches) {\n\t\t\treturn categoryPageConfiguration;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nfunction preserveCustomQueryParams(sourceUrl: URL, targetUrl: URL, preserveKeys: Set<string>) {\n\tfor (const [key, value] of sourceUrl.searchParams.entries()) {\n\t\tif (preserveKeys.has(key)) {\n\t\t\ttargetUrl.searchParams.set(key, value);\n\t\t}\n\t}\n}\n\nfunction writeFacetsSearchParams(url: URL, facets?: RouteStateFacets, excludedKeys?: Set<string>) {\n\tif (!facets) {\n\t\treturn;\n\t}\n\n\tfor (const [key, value] of Object.entries(facets)) {\n\t\tif (excludedKeys?.has(key)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst candidateQueryParamValue = arrayToQueryParam(value);\n\n\t\tif (candidateQueryParamValue !== undefined) {\n\t\t\turl.searchParams.set(key, candidateQueryParamValue);\n\t\t}\n\t}\n}\n\nfunction writeUserFilterSearchParams(targetUrl: URL, userSearchFilters: UserSearchFilter[], sourceUrl: URL) {\n\tfor (const filter of userSearchFilters) {\n\t\tconst value = sourceUrl.searchParams.get(filter.token);\n\n\t\tif (value) {\n\t\t\ttargetUrl.searchParams.set(filter.token, value);\n\t\t}\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// State mapping — Algolia UI state ↔ route state\n// ---------------------------------------------------------------------------\n\nexport function makeStateMapping(\n\tindex: string,\n\tfacetConfigurations: FacetConfiguration[]\n): StateMapping<UiState, RouteState> {\n\tconst sortByPrefix = `${index}_virtual_`;\n\n\treturn {\n\t\tstateToRoute: (uiState: UiState) => {\n\t\t\tconst indexUiState = uiState[index];\n\n\t\t\tif (!indexUiState) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst facets: RouteStateFacets = {};\n\n\t\t\tfor (const config of facetConfigurations) {\n\t\t\t\tif (config.type === 'simple') {\n\t\t\t\t\tconst facetValues = indexUiState.refinementList?.[config.algoliaAttribute];\n\n\t\t\t\t\tif (facetValues) {\n\t\t\t\t\t\tfacets[config.routeKey] = facetValues;\n\t\t\t\t\t}\n\t\t\t\t} else if (config.type === 'hierarchical') {\n\t\t\t\t\tfor (let level = config.minLevel; level <= config.maxLevel; level += 1) {\n\t\t\t\t\t\tconst routeKey = `${config.routeKeyPrefix}${level}`;\n\t\t\t\t\t\tconst algoliaAttribute = `${config.algoliaAttributeBase}.lvl${level}`;\n\n\t\t\t\t\t\tconst facetValues = indexUiState.refinementList?.[algoliaAttribute];\n\n\t\t\t\t\t\tif (facetValues) {\n\t\t\t\t\t\t\tfacets[routeKey] = facetValues;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tquery: indexUiState.query,\n\t\t\t\tfacets,\n\t\t\t\tsortBy: indexUiState.sortBy?.replace(sortByPrefix, ''),\n\t\t\t\tlimit: indexUiState.hitsPerPage,\n\t\t\t\tpage: indexUiState.page,\n\t\t\t} satisfies RouteState;\n\t\t},\n\t\trouteToState: (routeState: RouteState) => {\n\t\t\tconst refinementList: Record<string, string[]> = {};\n\n\t\t\tfor (const config of facetConfigurations) {\n\t\t\t\tif (config.type === 'simple') {\n\t\t\t\t\trefinementList[config.algoliaAttribute] = emptyIfUndefined(routeState.facets?.[config.routeKey]);\n\t\t\t\t} else if (config.type === 'hierarchical') {\n\t\t\t\t\tfor (let level = config.minLevel; level <= config.maxLevel; level += 1) {\n\t\t\t\t\t\tconst routeKey = `${config.routeKeyPrefix}${level}`;\n\n\t\t\t\t\t\tconst algoliaAttribute = `${config.algoliaAttributeBase}.lvl${level}`;\n\n\t\t\t\t\t\trefinementList[algoliaAttribute] = emptyIfUndefined(routeState.facets?.[routeKey]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t[index]: {\n\t\t\t\t\tquery: routeState.query,\n\t\t\t\t\tsortBy: routeState.sortBy && `${sortByPrefix}${routeState.sortBy}`,\n\t\t\t\t\thitsPerPage: routeState.limit,\n\t\t\t\t\trefinementList,\n\t\t\t\t\tpage: routeState.page,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// Category page configuration\n// ---------------------------------------------------------------------------\n\nfunction checkFacetValueConfigurationMatches(\n\tfacetValueConfiguration: string,\n\trouteStateFacetValue: string[] | undefined\n): boolean {\n\tif (routeStateFacetValue === undefined) {\n\t\treturn false;\n\t}\n\n\tif (routeStateFacetValue.length !== 1) {\n\t\treturn false;\n\t}\n\n\treturn facetValueConfiguration === routeStateFacetValue[0];\n}\n\nfunction checkCategoryPageConfigurationMatches(\n\tcategoryPageConfiguration: CategoryPageConfiguration,\n\trouteStateFacets: {\n\t\tkey: string;\n\t\tvalue: string[] | undefined;\n\t}[]\n): boolean {\n\tconst { facets: facetsConfiguration } = categoryPageConfiguration;\n\n\tlet matches = true;\n\n\tfor (const routeStateFacet of routeStateFacets) {\n\t\tconst facetConfiguration = facetsConfiguration.find(f => f.queryParamName === routeStateFacet.key);\n\n\t\tif (facetConfiguration) {\n\t\t\tif (!checkFacetValueConfigurationMatches(facetConfiguration.value, routeStateFacet.value)) {\n\t\t\t\tmatches = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (routeStateFacet.value !== undefined && routeStateFacet.value.length > 0) {\n\t\t\tmatches = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn matches;\n}\n\nfunction writeCommonSearchParams(url: URL, routeState: RouteState) {\n\tif (routeState.query) {\n\t\turl.searchParams.set('query', routeState.query);\n\t}\n\n\tif (routeState.sortBy) {\n\t\turl.searchParams.set('sortBy', routeState.sortBy);\n\t}\n\n\tif (routeState.limit !== undefined) {\n\t\turl.searchParams.set('limit', String(routeState.limit));\n\t}\n\n\tif (routeState.page !== undefined) {\n\t\turl.searchParams.set('page', String(routeState.page));\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Router — URL creation and parsing\n// ---------------------------------------------------------------------------\n\nexport function makeRouter(\n\tcategoryPageConfigurations: CategoryPageConfiguration[],\n\tfacetConfigurations: FacetConfiguration[],\n\tuserSearchFilters: UserSearchFilter[] = []\n) {\n\tconst allFacetingKeys = getAllFacetingKeys(facetConfigurations);\n\tconst allFacetingKeysSet = new Set<string>(allFacetingKeys);\n\tconst userFilterKeysSet = new Set<string>(userSearchFilters.map(f => f.token));\n\tconst categoryPagesByCategoryPageUrl: Map<string, CategoryPageConfiguration> = new Map<\n\t\tstring,\n\t\tCategoryPageConfiguration\n\t>();\n\n\tfor (const configuration of categoryPageConfigurations) {\n\t\tcategoryPagesByCategoryPageUrl.set(configuration.categoryPageUrl, configuration);\n\t}\n\n\treturn history({\n\t\tcleanUrlOnDispose: false,\n\n\t\tcreateURL({ location, routeState }: { location: { href: string }; routeState: RouteState }) {\n\t\t\ttry {\n\t\t\t\tconst preserveCustomKeysSet = new Set<string>([viewModeKey, 'ownership', 'geographicAvailability']);\n\t\t\t\t// detect if we match a category page\n\t\t\t\tconst matchingCategoryPage = getMatchingCategoryPageFromRouteState(\n\t\t\t\t\trouteState,\n\t\t\t\t\tcategoryPageConfigurations,\n\t\t\t\t\tallFacetingKeys\n\t\t\t\t);\n\n\t\t\t\tconst currentUrl = safeUrl(location.href);\n\t\t\t\tif (!currentUrl) {\n\t\t\t\t\treturn location.href;\n\t\t\t\t}\n\n\t\t\t\tif (matchingCategoryPage) {\n\t\t\t\t\tconst categoryPageUrl = safeUrl(matchingCategoryPage.categoryPageUrl, location.href);\n\t\t\t\t\tif (categoryPageUrl) {\n\t\t\t\t\t\twriteCommonSearchParams(categoryPageUrl, routeState);\n\t\t\t\t\t\tconst categoryFacetKeys = new Set(\n\t\t\t\t\t\t\tmatchingCategoryPage.facets.map(facetConfiguration => facetConfiguration.queryParamName)\n\t\t\t\t\t\t);\n\t\t\t\t\t\twriteFacetsSearchParams(categoryPageUrl, routeState.facets, categoryFacetKeys);\n\t\t\t\t\t\twriteUserFilterSearchParams(categoryPageUrl, userSearchFilters, currentUrl);\n\t\t\t\t\t\tpreserveCustomQueryParams(currentUrl, categoryPageUrl, preserveCustomKeysSet);\n\n\t\t\t\t\t\treturn categoryPageUrl.href;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst url = safeUrl('/search', location.href);\n\t\t\t\tif (!url) {\n\t\t\t\t\treturn location.href;\n\t\t\t\t}\n\n\t\t\t\twriteCommonSearchParams(url, routeState);\n\t\t\t\twriteFacetsSearchParams(url, routeState.facets);\n\t\t\t\twriteUserFilterSearchParams(url, userSearchFilters, currentUrl);\n\t\t\t\tpreserveCustomQueryParams(currentUrl, url, preserveCustomKeysSet);\n\n\t\t\t\treturn url.href;\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('[search] router.createURL failed', err);\n\t\t\t\treturn location.href;\n\t\t\t}\n\t\t},\n\n\t\tparseURL({ location }: { location: { href: string } }) {\n\t\t\ttry {\n\t\t\t\tconst locationUrl = safeUrl(location.href);\n\t\t\t\tif (!locationUrl) {\n\t\t\t\t\treturn {};\n\t\t\t\t}\n\t\t\t\tconst locationPathname = locationUrl.pathname;\n\n\t\t\t\tconst matchingCategoryPage = categoryPagesByCategoryPageUrl.get(locationPathname);\n\n\t\t\t\tconst routeState: RouteState = {};\n\n\t\t\t\tconst addRouteStateFacetValues = (key: string, values: string[]) => {\n\t\t\t\t\tif (values.length === 0) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\trouteState.facets ??= {};\n\t\t\t\t\trouteState.facets[key] ??= [];\n\n\t\t\t\t\tfor (const value of values) {\n\t\t\t\t\t\trouteState.facets[key].push(value);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif (matchingCategoryPage) {\n\t\t\t\t\tfor (const facetConfiguration of matchingCategoryPage.facets) {\n\t\t\t\t\t\taddRouteStateFacetValues(facetConfiguration.queryParamName, [facetConfiguration.value]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst queryParams = locationUrl.searchParams;\n\n\t\t\t\tfor (const [paramName, paramValue] of queryParams.entries()) {\n\t\t\t\t\tif (allFacetingKeysSet.has(paramName)) {\n\t\t\t\t\t\tif (matchingCategoryPage?.facets.some(facet => facet.queryParamName === paramName)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taddRouteStateFacetValues(\n\t\t\t\t\t\t\tparamName,\n\t\t\t\t\t\t\tparamValue\n\t\t\t\t\t\t\t\t.split(delimiter)\n\t\t\t\t\t\t\t\t.map(v => getTrimmedOrUndefinedIfStringEmpty(v))\n\t\t\t\t\t\t\t\t.filter((v): v is string => v !== undefined)\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if (userFilterKeysSet.has(paramName)) {\n\t\t\t\t\t\trouteState.filters ??= {};\n\t\t\t\t\t\trouteState.filters[paramName] = paramValue;\n\t\t\t\t\t} else if (paramName === 'query') {\n\t\t\t\t\t\trouteState.query = getTrimmedOrUndefinedIfStringEmpty(paramValue);\n\t\t\t\t\t} else if (paramName === 'sortBy') {\n\t\t\t\t\t\trouteState.sortBy = paramValue;\n\t\t\t\t\t} else if (paramName === 'limit') {\n\t\t\t\t\t\tconst limit = parseInt(paramValue, 10);\n\n\t\t\t\t\t\tif (Number.isFinite(limit) && limit > 0) {\n\t\t\t\t\t\t\trouteState.limit = limit;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (paramName === 'page') {\n\t\t\t\t\t\tconst page = parseInt(paramValue, 10);\n\n\t\t\t\t\t\tif (Number.isFinite(page) && page >= 1) {\n\t\t\t\t\t\t\trouteState.page = page;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn routeState;\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('[search] router.parseURL failed', err);\n\t\t\t\treturn {};\n\t\t\t}\n\t\t},\n\n\t\twindowTitle(routeState: RouteState) {\n\t\t\ttry {\n\t\t\t\tconst matchingCategoryPage = getMatchingCategoryPageFromRouteState(\n\t\t\t\t\trouteState,\n\t\t\t\t\tcategoryPageConfigurations,\n\t\t\t\t\tallFacetingKeys\n\t\t\t\t);\n\n\t\t\t\tif (matchingCategoryPage) {\n\t\t\t\t\treturn matchingCategoryPage.pageTitle;\n\t\t\t\t}\n\n\t\t\t\treturn 'Search';\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('[search] router.windowTitle failed', err);\n\t\t\t\treturn 'Search';\n\t\t\t}\n\t\t},\n\t});\n}\n\n// ---------------------------------------------------------------------------\n// Convert search categories to category page configurations\n// ---------------------------------------------------------------------------\n\nexport function convertSearchCategoriesToCategoryPageConfiguration(\n\tcategories: SearchCategory[],\n\tfacetConfigurations: FacetConfiguration[]\n): CategoryPageConfiguration[] {\n\tconst queryParamNameByTopLevelTokenMap = getQueryParamNameByTopLevelTokenMap(facetConfigurations);\n\n\treturn (categories ?? [])\n\t\t.map(category => {\n\t\t\tif (!category) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst { token } = category;\n\t\t\tif (!token || typeof token !== 'string') {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst [topLevelToken, secondLevelToken] = token.split('-');\n\n\t\t\tif (topLevelToken === undefined || secondLevelToken === undefined) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst categoryPageUrl = category.categoryPageUrl;\n\t\t\tif (!categoryPageUrl) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst queryParamName = queryParamNameByTopLevelTokenMap[topLevelToken];\n\n\t\t\tif (!queryParamName) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcategoryPageUrl,\n\t\t\t\tfacets: [\n\t\t\t\t\t{\n\t\t\t\t\t\tqueryParamName,\n\t\t\t\t\t\tvalue: category.displayName,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tpageTitle: category.pageTitle,\n\t\t\t} satisfies CategoryPageConfiguration;\n\t\t})\n\t\t.filter((x): x is CategoryPageConfiguration => x !== null);\n}\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { Button, Typography } from '@faithlife/commerce-components';\nimport { ChevronDown } from 'lucide-react';\nimport { UiState } from 'instantsearch.js';\nimport { Configure, ConfigureProps, InstantSearch, InstantSearchProps } from 'react-instantsearch';\nimport {\n\tPagination,\n\tuseHitsPerPage,\n\tuseInstantSearch,\n\tuseCurrentRefinements,\n\tusePagination,\n\tuseSearchBox,\n\tuseSortBy,\n} from 'react-instantsearch';\nimport Drawer from '../shared/drawer';\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuRadioGroup,\n\tDropdownMenuRadioItem,\n\tDropdownMenuTrigger,\n} from '../shared/dropdown-menu';\nimport useScreensize from '../../util/hooks/use-screensize';\n\nimport { cn } from '../../util/cn';\nimport { PerUserDataContextProvider, useCurrentUser } from '../per-user-data/per-user-data-context';\n\nimport { safeJsonParse } from '../../util/safe-json-parse';\nimport { useLocalization } from '../../localization';\nimport ErrorBoundary from '../error-boundary';\nimport { BooksByAuthor } from '../shared/books-by-author';\nimport { AuthorBatch } from '../../hooks/use-author';\nimport { PublisherBatch } from '../../hooks/use-publisher';\nimport CategoryContent from './category-content';\nimport {\n\tUserSearchFilter,\n\tUserSearchFilters,\n\tUserSearchFilterProvider,\n\tuseUserSearchFilterContext,\n} from './user-search-filter-context';\nimport { Categories } from './filters';\nimport CurrentQueryRefinement, { CurrentRefinements } from './refinements';\nimport HiddenFacetRefinements from './hidden-facet-refinements';\nimport ProductHits from './products';\nimport SortByAccordion from './sort-by-accordion';\nimport HitsPerPageAccordion from './hits-per-page-accordion';\nimport { SearchCategory } from './types';\nimport { makeStateMapping, makeRouter, convertSearchCategoriesToCategoryPageConfiguration } from './routing';\nimport type { FacetConfiguration, RouteState } from './routing';\nexport { SearchResourcesContext, useSearchResources } from './search-resources';\nimport { SearchResourcesContext, useSearchResources } from './search-resources';\nimport { useSearchImpressions } from './hooks/use-search-impressions';\nimport { useSearchAnalytics } from './hooks/use-search-analytics';\nexport { AlgoliaSearchContextProvider, useAlgoliaSearch } from './algolia-search-context';\nimport { AlgoliaSearchContextProvider, useAlgoliaSearch } from './algolia-search-context';\nimport { useViewMode, ViewMode, ViewModeProvider } from './use-view-mode';\n\n// ---------------------------------------------------------------------------\n// AlgoliaSSRProvider / AlgoliaProvider — InstantSearch + Configure wrappers\n// ---------------------------------------------------------------------------\n\ntype AlgoliaSearchParameters = Record<string, any>;\n\ntype ConfigurableConfigureProps = Pick<\n\tConfigureProps,\n\t'attributesToHighlight' | 'attributesToRetrieve' | 'queryType' | 'restrictSearchableAttributes'\n> & { searchParameters?: AlgoliaSearchParameters; userSearchFilters?: UserSearchFilter[] };\n\ntype AlgoliaProviderProps<TUiState extends UiState, TRouteState> = Pick<\n\tInstantSearchProps<TUiState, TRouteState>,\n\t'routing' | 'searchClient'\n> &\n\tConfigurableConfigureProps;\n\nfunction AlgoliaSSRProvider<TUiState extends UiState = UiState, TRouteState = TUiState>(\n\tprops: React.PropsWithChildren<AlgoliaProviderProps<TUiState, TRouteState>>\n) {\n\treturn <AlgoliaProvider {...props} />;\n}\n\nfunction AlgoliaProvider<TUiState extends UiState = UiState, TRouteState = TUiState>({\n\tattributesToHighlight,\n\tattributesToRetrieve,\n\tqueryType,\n\trestrictSearchableAttributes,\n\trouting,\n\tsearchClient,\n\tsearchParameters,\n\tchildren,\n}: React.PropsWithChildren<AlgoliaProviderProps<TUiState, TRouteState>>) {\n\tconst { indexName } = useAlgoliaSearch();\n\n\treturn (\n\t\t<ViewModeProvider>\n\t\t\t<InstantSearch\n\t\t\t\tfuture={{\n\t\t\t\t\tpreserveSharedStateOnUnmount: true,\n\t\t\t\t}}\n\t\t\t\tindexName={indexName}\n\t\t\t\tinsights\n\t\t\t\trouting={routing}\n\t\t\t\tsearchClient={searchClient}\n\t\t\t>\n\t\t\t\t<ConfigureCore\n\t\t\t\t\tattributesToHighlight={attributesToHighlight}\n\t\t\t\t\tattributesToRetrieve={attributesToRetrieve}\n\t\t\t\t\tqueryType={queryType}\n\t\t\t\t\trestrictSearchableAttributes={restrictSearchableAttributes}\n\t\t\t\t\tsearchParameters={searchParameters}\n\t\t\t\t/>\n\t\t\t\t{children}\n\t\t\t</InstantSearch>\n\t\t</ViewModeProvider>\n\t);\n}\n\nconst ParameterBlacklist = new Set(['facets']);\n\nfunction ConfigureCore({\n\tattributesToHighlight,\n\tattributesToRetrieve,\n\tqueryType,\n\trestrictSearchableAttributes,\n\tsearchParameters,\n}: ConfigurableConfigureProps) {\n\tconst { selectedFilterOptions, userSearchFilters } = useUserSearchFilterContext();\n\n\tconst props = useMemo(() => {\n\t\tconst mergedParams = { ...(searchParameters ?? {}) };\n\t\tconst userFilters = Array.isArray(userSearchFilters) ? userSearchFilters : [];\n\n\t\tconst selectedOptions = userFilters\n\t\t\t.map(uf => {\n\t\t\t\tconst selectedOptionToken = selectedFilterOptions[uf.token];\n\t\t\t\tif (!selectedOptionToken) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tconst selectedOption = uf.options?.find(o => o.token === selectedOptionToken);\n\t\t\t\tif (!selectedOption?.algoliaValue) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn selectedOption.algoliaValue;\n\t\t\t})\n\t\t\t.filter((o): o is string => typeof o === 'string' && o.length > 0);\n\n\t\tconst filterParts = [mergedParams.filters, ...selectedOptions].filter(\n\t\t\t(f): f is string => typeof f === 'string' && f.length > 0\n\t\t);\n\t\tif (filterParts.length > 0) {\n\t\t\tmergedParams.filters = filterParts.join(' AND ');\n\t\t} else {\n\t\t\tdelete mergedParams.filters;\n\t\t}\n\n\t\treturn Object.fromEntries(Object.entries(mergedParams).filter(([key]) => !ParameterBlacklist.has(key)));\n\t}, [searchParameters, userSearchFilters, selectedFilterOptions]);\n\n\treturn (\n\t\t<Configure\n\t\t\tattributesToHighlight={attributesToHighlight}\n\t\t\tattributesToRetrieve={attributesToRetrieve}\n\t\t\tdistinct\n\t\t\tqueryType={queryType}\n\t\t\trestrictSearchableAttributes={restrictSearchableAttributes}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// ---------------------------------------------------------------------------\n// Icons\n// ---------------------------------------------------------------------------\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction CloseIcon({ className, fillColor: _fillColor, ...rest }: any) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"none\"\n\t\t\theight=\"16\"\n\t\t\tviewBox=\"0 0 16 16\"\n\t\t\twidth=\"16\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...rest}\n\t\t>\n\t\t\t<path d=\"M12.5 3.5L3.5 12.5M3.5 3.5l9 9\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeWidth=\"1.5\" />\n\t\t</svg>\n\t);\n}\n\nfunction FilterIcon({ className, ...rest }: any) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"none\"\n\t\t\theight=\"16\"\n\t\t\tviewBox=\"0 0 16 16\"\n\t\t\twidth=\"16\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...rest}\n\t\t>\n\t\t\t<path d=\"M2 4h12M4 8h8M6 12h4\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeWidth=\"1.5\" />\n\t\t</svg>\n\t);\n}\n\nfunction LayoutGridIcon({ className, ...rest }: any) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"none\"\n\t\t\theight=\"16\"\n\t\t\tviewBox=\"0 0 16 16\"\n\t\t\twidth=\"16\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...rest}\n\t\t>\n\t\t\t<rect height=\"5\" rx=\"1\" stroke=\"currentColor\" width=\"5\" x=\"1.5\" y=\"1.5\" />\n\t\t\t<rect height=\"5\" rx=\"1\" stroke=\"currentColor\" width=\"5\" x=\"9.5\" y=\"1.5\" />\n\t\t\t<rect height=\"5\" rx=\"1\" stroke=\"currentColor\" width=\"5\" x=\"1.5\" y=\"9.5\" />\n\t\t\t<rect height=\"5\" rx=\"1\" stroke=\"currentColor\" width=\"5\" x=\"9.5\" y=\"9.5\" />\n\t\t</svg>\n\t);\n}\n\nfunction LayoutListIcon({ className, ...rest }: any) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"none\"\n\t\t\theight=\"16\"\n\t\t\tviewBox=\"0 0 16 16\"\n\t\t\twidth=\"16\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...rest}\n\t\t>\n\t\t\t<rect height=\"3\" rx=\"1\" stroke=\"currentColor\" width=\"14\" x=\"1\" y=\"1.5\" />\n\t\t\t<rect height=\"3\" rx=\"1\" stroke=\"currentColor\" width=\"14\" x=\"1\" y=\"6.5\" />\n\t\t\t<rect height=\"3\" rx=\"1\" stroke=\"currentColor\" width=\"14\" x=\"1\" y=\"11.5\" />\n\t\t</svg>\n\t);\n}\n\n// ---------------------------------------------------------------------------\n// Layout buttons — grid/list toggle\n// ---------------------------------------------------------------------------\n\nconst LayoutButtonOptions = [\n\t{ label: 'Grid Layout', value: ViewMode.grid, icon: LayoutGridIcon, additionalClassNames: 'lg:p-[6px]' },\n\t{ label: 'List Layout', value: ViewMode.list, icon: LayoutListIcon, additionalClassNames: 'lg:px-[3px] lg:py-[6px]' },\n];\n\nfunction LayoutButtons({\n\tcurrentLayoutType,\n\tsetLayoutType,\n}: {\n\tcurrentLayoutType: ViewMode;\n\tsetLayoutType: (mode: ViewMode) => void;\n}) {\n\treturn (\n\t\t<div className=\"flex gap-[6px]\">\n\t\t\t{LayoutButtonOptions.map(option => {\n\t\t\t\tconst isSelected = currentLayoutType === option.value;\n\t\t\t\tconst IconComponent = option.icon;\n\n\t\t\t\treturn (\n\t\t\t\t\t<button\n\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\taria-label={option.label}\n\t\t\t\t\t\taria-pressed={isSelected}\n\t\t\t\t\t\tonClick={() => setLayoutType(option.value)}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'px-sp16 py-sp16',\n\t\t\t\t\t\t\t'inline-flex items-center gap-sp8',\n\t\t\t\t\t\t\t'rounded-[4px] border border-primary-500 lg:border-0',\n\t\t\t\t\t\t\t'cursor-pointer',\n\t\t\t\t\t\t\t'text-black-100 aria-pressed:text-primary-400',\n\t\t\t\t\t\t\toption.additionalClassNames\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<IconComponent />\n\t\t\t\t\t</button>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n}\n\n// ---------------------------------------------------------------------------\n// ScrollToTopOnPaginationChange\n// ---------------------------------------------------------------------------\n\nfunction DesktopSearchControl({\n\tprefixText,\n\tvalue,\n\titems,\n\tonChange,\n\ttestId,\n\tcontentClassName,\n}: {\n\tprefixText: string;\n\tvalue: string | number;\n\titems: { label: string; value: string | number }[];\n\tonChange: (value: string | number) => void;\n\ttestId: string;\n\tcontentClassName?: string;\n}) {\n\tconst selectedItem = useMemo(() => {\n\t\treturn items.find(item => item.value === value) ?? items[0];\n\t}, [items, value]);\n\n\tconst selectedLabel = selectedItem?.label ?? value.toString();\n\n\tconst handleValueChange = useCallback(\n\t\t(newValue: string) => {\n\t\t\tconst matchedItem = items.find(item => item.value.toString() === newValue);\n\t\t\tif (matchedItem) {\n\t\t\t\tonChange(matchedItem.value);\n\t\t\t}\n\t\t},\n\t\t[items, onChange]\n\t);\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger\n\t\t\t\tclassName=\"inline-flex cursor-pointer items-center whitespace-nowrap border-0 bg-transparent p-0 text-black [&[data-state=open]>svg]:rotate-180\"\n\t\t\t\tdata-testid={testId}\n\t\t\t>\n\t\t\t\t<span className=\"mr-[3px] font-normal\">{prefixText}</span>\n\t\t\t\t<span className=\"font-semibold\">{selectedLabel}</span>\n\t\t\t\t<ChevronDown className=\"ml-[2px] h-4 w-4 transition-transform\" />\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent className={contentClassName}>\n\t\t\t\t<DropdownMenuRadioGroup onValueChange={handleValueChange} value={value.toString()}>\n\t\t\t\t\t{items.map(item => (\n\t\t\t\t\t\t<DropdownMenuRadioItem\n\t\t\t\t\t\t\tclassName=\"w-full data-[state=checked]:bg-primary-100 active:bg-secondary-100 focus-visible:ring-2 focus-visible:ring-primary\"\n\t\t\t\t\t\t\tkey={item.value.toString()}\n\t\t\t\t\t\t\tvalue={item.value.toString()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t</DropdownMenuRadioItem>\n\t\t\t\t\t))}\n\t\t\t\t</DropdownMenuRadioGroup>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n}\n\nfunction ScrollToTopOnPaginationChange() {\n\tconst { currentRefinement } = usePagination();\n\n\tuseEffect(() => {\n\t\twindow.scrollTo({ top: 0, behavior: 'smooth' });\n\t}, [currentRefinement]);\n\n\treturn null;\n}\n\nfunction NoResultsState({ query }: { query: string }) {\n\tconst resources = useSearchResources();\n\tconst normalizedQuery = query.trim();\n\tconst noResultsMessageTemplate = resources['noResults'];\n\tconst searchTips = [resources['checkSpelling'], resources['differentKeywords'], resources['lessSpecific']];\n\n\treturn (\n\t\t<section className=\"my-sp60 mx-auto flex w-full max-w-[640px] flex-col items-start gap-sp48 rounded-md border border-grey-200 bg-grey-50 p-sp60 text-left shadow-sm\">\n\t\t\t<Typography className=\"break-words text-left font-semibold text-black\" tag=\"p\" variant=\"bodyLarge\">\n\t\t\t\t{normalizedQuery && (\n\t\t\t\t\t<CommandSentence Container={React.Fragment} template={noResultsMessageTemplate}>\n\t\t\t\t\t\t<CommandSentence.Field name=\"QUERY\">{normalizedQuery}</CommandSentence.Field>\n\t\t\t\t\t</CommandSentence>\n\t\t\t\t)}\n\t\t\t</Typography>\n\t\t\t<div className=\"flex flex-col items-start gap-sp8 text-left text-black\">\n\t\t\t\t<Typography className=\"font-semibold text-black\" tag=\"p\" variant=\"bodyRegular\">\n\t\t\t\t\t{resources['searchTips']}\n\t\t\t\t</Typography>\n\t\t\t\t<ul className=\"list-disc pl-5\">\n\t\t\t\t\t{searchTips.map(tip => (\n\t\t\t\t\t\t<li className=\"bodyMd\" key={tip}>\n\t\t\t\t\t\t\t{tip}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t))}\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<Button onClick={() => window.location.assign('/search')} type=\"button\" variant=\"primary\">\n\t\t\t\t{resources['seeAllProducts']}\n\t\t\t</Button>\n\t\t</section>\n\t);\n}\n// ---------------------------------------------------------------------------\n// FilterSortLayout — main search page layout\n// ---------------------------------------------------------------------------\n\nconst FilterSortLayout = ({\n\twishListsProductsUrl,\n\tenableAuthorBioView,\n\tpageLimits,\n\tsortOrders,\n}: {\n\twishListsProductsUrl: string;\n\tenableAuthorBioView: boolean;\n\tpageLimits: number[];\n\tsortOrders: { label: string; value: string | null }[];\n}) => {\n\tconst resources = useSearchResources();\n\tconst authorBioResources = useLocalization('CommerceWeb.Resources.Search.AuthorBio');\n\n\tconst { indexName } = useAlgoliaSearch();\n\tconst [isMobileFilterOpen, setIsMobileFilterOpen] = useState(false);\n\n\tconst { viewMode, setViewMode } = useViewMode();\n\tconst { isMobile, isDesktop } = useScreensize();\n\n\tuseSearchImpressions();\n\tuseSearchAnalytics();\n\tconst { results } = useInstantSearch();\n\tconst { query } = useSearchBox();\n\tconst hasNoSearchResults = !results.__isArtificial && results.nbHits === 0;\n\tconst shouldShowResultsRoute = !hasNoSearchResults;\n\tconst { items: currentRefinements } = useCurrentRefinements();\n\n\tconst allSortItems = useMemo(\n\t\t() =>\n\t\t\tsortOrders.map(sortOrder => ({\n\t\t\t\tlabel: resources[sortOrder.label] ?? sortOrder.label,\n\t\t\t\tvalue: sortOrder.value ? `${indexName}_virtual_${sortOrder.value}` : indexName,\n\t\t\t})),\n\t\t[resources, indexName, sortOrders]\n\t);\n\tconst { currentRefinement: currentSortBy, refine: refineSortBy } = useSortBy({ items: allSortItems });\n\tconst hasPrepubCategory = currentRefinements.some(\n\t\titem =>\n\t\t\titem.attribute === 'categories.lvl1' &&\n\t\t\titem.refinements?.some(refinement => refinement.value === 'status > prepub')\n\t);\n\tconst sortItems = useMemo(\n\t\t() =>\n\t\t\tallSortItems.filter(\n\t\t\t\titem =>\n\t\t\t\t\titem.value !== `${indexName}_virtual_percentCommitted_desc` ||\n\t\t\t\t\thasPrepubCategory ||\n\t\t\t\t\titem.value === currentSortBy\n\t\t\t),\n\t\t[allSortItems, currentSortBy, hasPrepubCategory, indexName]\n\t);\n\n\tconst hitsPerPageItems = useMemo(\n\t\t() => pageLimits.map((pageLimit, index) => ({ default: index === 0, label: String(pageLimit), value: pageLimit })),\n\t\t[pageLimits]\n\t);\n\tconst { items: showItems, refine: refineHitsPerPage } = useHitsPerPage({\n\t\titems: hitsPerPageItems,\n\t});\n\tconst currentHitsPerPage = showItems.find(item => item.isRefined)?.value ?? hitsPerPageItems[0].value;\n\n\tconst closeFilter = useCallback(() => setIsMobileFilterOpen(false), []);\n\tconst toggleFilter = useCallback(() => setIsMobileFilterOpen(prev => !prev), []);\n\n\t// Close when resized to desktop\n\tuseEffect(() => {\n\t\tif (isDesktop) {\n\t\t\tcloseFilter();\n\t\t}\n\t}, [isDesktop, closeFilter]);\n\n\tuseEffect(() => {\n\t\tif (hasNoSearchResults) {\n\t\t\tcloseFilter();\n\t\t}\n\t}, [hasNoSearchResults, closeFilter]);\n\n\t// Shared filter panel content used in both mobile fullscreen and tablet drawer\n\tconst filterPanelContent = (\n\t\t<div className=\"isolate flex h-full flex-col\">\n\t\t\t{/* Sticky header — title + close button always visible */}\n\t\t\t<div className=\"sticky top-0 z-10 flex items-center justify-between bg-white py-4 pl-4 pr-5 shadow-sm\">\n\t\t\t\t<Typography className=\"!font-medium text-primary-400\" variant=\"bodyLarge\">\n\t\t\t\t\t{resources['filterAndSort']}\n\t\t\t\t</Typography>\n\t\t\t\t<button\n\t\t\t\t\taria-label=\"Close\"\n\t\t\t\t\tclassName=\"w-auto border-0 bg-transparent p-0 hover:bg-transparent\"\n\t\t\t\t\tonClick={closeFilter}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t>\n\t\t\t\t\t<CloseIcon className=\"h-4 w-4\" fillColor=\"fill-primary-400\" />\n\t\t\t\t</button>\n\t\t\t</div>\n\n\t\t\t{/* Scrollable body — active refinements, \"All filters\" label, sort, filter accordions, see results */}\n\t\t\t<div className=\"flex-1 overflow-y-auto\">\n\t\t\t\t<div className=\"px-4 pt-4\">\n\t\t\t\t\t<Typography className=\"mb-2 text-black\" variant=\"bodySmall\">\n\t\t\t\t\t\t{resources['allFilters']}\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<div className=\"mb-4 flex flex-wrap gap-1\">\n\t\t\t\t\t\t<CurrentQueryRefinement />\n\t\t\t\t\t\t<CurrentRefinements />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<SortByAccordion items={sortItems} />\n\t\t\t\t<HitsPerPageAccordion items={hitsPerPageItems} />\n\t\t\t\t<Categories />\n\t\t\t\t<div className=\"border-t border-grey-200 p-4\">\n\t\t\t\t\t<Button className=\"w-full\" onClick={closeFilter} type=\"button\" variant=\"primary\">\n\t\t\t\t\t\t{resources['seeResults']}\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{/* Tablet & Mobile: left-side slide-in drawer with scrim via react-modern-drawer, full screen on mobile*/}\n\t\t\t{!isDesktop && shouldShowResultsRoute && (\n\t\t\t\t<Drawer\n\t\t\t\t\tid=\"search-filter-drawer\"\n\t\t\t\t\tisOpen={isMobileFilterOpen}\n\t\t\t\t\tonClose={closeFilter}\n\t\t\t\t\tplacement=\"left\"\n\t\t\t\t\tsize={isMobile ? '100vw' : '320px' /* isTablet */}\n\t\t\t\t\tzIndex={5000}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"h-full bg-white\">{filterPanelContent}</div>\n\t\t\t\t</Drawer>\n\t\t\t)}\n\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'relative grid gap-8 px-4 md:px-6 lg:mx-auto lg:max-w-[1323px] xxlg:px-4',\n\t\t\t\t\tshouldShowResultsRoute ? 'lg:grid-cols-[300px_auto] xl:grid-cols-[375px_auto]' : 'lg:grid-cols-1'\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<ScrollToTopOnPaginationChange />\n\n\t\t\t\t{/* Desktop: static sidebar (always visible in grid flow) */}\n\t\t\t\t{shouldShowResultsRoute && (\n\t\t\t\t\t<div className=\"mt-sp20 hidden self-start border-b border-primary-100 lg:block\">\n\t\t\t\t\t\t<Typography className=\"mb-8 text-black\" variant=\"bodyLarge\">\n\t\t\t\t\t\t\t{resources['allFilters']}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t<Categories />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\n\t\t\t\t<div>\n\t\t\t\t\t<div className=\"flex flex-col gap-8\">\n\t\t\t\t\t\t<CategoryContent sectionKind=\"searchResultsAbove\" />\n\t\t\t\t\t\t{enableAuthorBioView && <BooksByAuthor resources={authorBioResources} />}\n\t\t\t\t\t\t{hasNoSearchResults ? (\n\t\t\t\t\t\t\t<NoResultsState query={query} />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className=\"mt-sp20 -mx-4 flex flex-col-reverse justify-between px-4 md:-mx-6 md:px-6 lg:mx-0 lg:flex-row lg:items-start lg:px-0\">\n\t\t\t\t\t\t\t\t<div className=\"mt-4 flex flex-wrap items-center gap-1 lg:mt-0 lg:min-w-0 lg:flex-1\">\n\t\t\t\t\t\t\t\t\t<CurrentQueryRefinement />\n\t\t\t\t\t\t\t\t\t<CurrentRefinements />\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<div className=\"flex shrink-0 gap-8\">\n\t\t\t\t\t\t\t\t\t<div className=\"mr-auto lg:hidden\">\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"inline-flex cursor-pointer items-center gap-sp8 rounded-[4px] border border-primary-500 px-sp16 py-sp16 text-primary-500 focus:outline-0 focus:ring-0\"\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"filter-and-sort-button\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={toggleFilter}\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<FilterIcon />\n\t\t\t\t\t\t\t\t\t\t\t<Typography className=\"text-primary-500 font-medium leading-[100%]\" variant=\"bodySmall\">\n\t\t\t\t\t\t\t\t\t\t\t\t{resources['filterAndSort']}\n\t\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<LayoutButtons currentLayoutType={viewMode} setLayoutType={setViewMode} />\n\t\t\t\t\t\t\t\t\t<div className=\"bodyMd hidden shrink-0 items-center text-black lg:flex\">\n\t\t\t\t\t\t\t\t\t\t<DesktopSearchControl\n\t\t\t\t\t\t\t\t\t\t\tonChange={newSortBy => refineSortBy(newSortBy.toString())}\n\t\t\t\t\t\t\t\t\t\t\titems={sortItems}\n\t\t\t\t\t\t\t\t\t\t\tprefixText={resources['sortBy']}\n\t\t\t\t\t\t\t\t\t\t\ttestId=\"sort-by-menu-button\"\n\t\t\t\t\t\t\t\t\t\t\tvalue={currentSortBy ?? sortItems[0].value}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div className=\"bodyMd hidden shrink-0 items-center text-black lg:flex\">\n\t\t\t\t\t\t\t\t\t\t<DesktopSearchControl\n\t\t\t\t\t\t\t\t\t\t\tcontentClassName=\"w-(--radix-popper-anchor-width) min-w-0\"\n\t\t\t\t\t\t\t\t\t\t\tonChange={newHitsPerPage => refineHitsPerPage(Number(newHitsPerPage))}\n\t\t\t\t\t\t\t\t\t\t\titems={showItems.map(item => ({\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: item.label,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue: item.value,\n\t\t\t\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t\t\t\t\tprefixText={resources['show']}\n\t\t\t\t\t\t\t\t\t\t\ttestId=\"hits-per-page-menu-button\"\n\t\t\t\t\t\t\t\t\t\t\tvalue={currentHitsPerPage ?? hitsPerPageItems[0].value}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{shouldShowResultsRoute && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ProductHits\n\t\t\t\t\t\t\t\tlayoutType={viewMode}\n\t\t\t\t\t\t\t\twishListsProductsUrl={wishListsProductsUrl}\n\t\t\t\t\t\t\t\tcurrentHitsPerPage={currentHitsPerPage}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Pagination\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'[&>ul>li.previous-page-item>.ais-Pagination-link]:bodyLg',\n\t\t\t\t\t\t\t\t\t'[&>ul>li.next-page-item>.ais-Pagination-link]:bodyLg'\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tclassNames={{\n\t\t\t\t\t\t\t\t\troot: 'py-4 lg:px-4 lg:py-8',\n\t\t\t\t\t\t\t\t\tnoRefinementRoot: 'hidden',\n\t\t\t\t\t\t\t\t\tlist: 'flex gap-[2px] items-center justify-center',\n\t\t\t\t\t\t\t\t\titem: 'bodySm text-black h-6 w-[23px]',\n\t\t\t\t\t\t\t\t\tpreviousPageItem: 'previous-page-item text-primary',\n\t\t\t\t\t\t\t\t\tpageItem: 'pageItem',\n\t\t\t\t\t\t\t\t\tselectedItem: 'bg-primary-100 text-primary',\n\t\t\t\t\t\t\t\t\tdisabledItem: 'opacity-25',\n\t\t\t\t\t\t\t\t\tnextPageItem: 'next-page-item text-primary',\n\t\t\t\t\t\t\t\t\tlink: 'flex items-center justify-center px-2 py-1 h-full w-full',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tshowFirst={false}\n\t\t\t\t\t\t\t\tshowLast={false}\n\t\t\t\t\t\t\t\tshowNext\n\t\t\t\t\t\t\t\tshowPrevious\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\n// ---------------------------------------------------------------------------\n// InstantSearchWrapper — wires up Algolia routing + providers\n// ---------------------------------------------------------------------------\n\nconst InstantSearchWrapper = ({\n\tcategories,\n\tfacetConfigurations,\n\tsearchParameters,\n\twishListsProductsUrl,\n\tenableAuthorBioView,\n\tpageLimits,\n\tsortOrders,\n}: {\n\tcategories: SearchCategory[];\n\tfacetConfigurations: FacetConfiguration[];\n\tsearchParameters: AlgoliaSearchParameters;\n\twishListsProductsUrl: string;\n\tenableAuthorBioView: boolean;\n\tpageLimits: number[];\n\tsortOrders: { label: string; value: string | null }[];\n}) => {\n\tconst { client: searchClient, indexName } = useAlgoliaSearch();\n\tconst { userSearchFilters } = useUserSearchFilterContext();\n\tconst stateMapping = useMemo(\n\t\t() => makeStateMapping(indexName, facetConfigurations),\n\t\t[indexName, facetConfigurations]\n\t);\n\tconst categoryPageConfigurations = useMemo(\n\t\t() => convertSearchCategoriesToCategoryPageConfiguration(categories, facetConfigurations),\n\t\t[categories, facetConfigurations]\n\t);\n\tconst router = useMemo(\n\t\t() => makeRouter(categoryPageConfigurations, facetConfigurations, userSearchFilters),\n\t\t[categoryPageConfigurations, facetConfigurations, userSearchFilters]\n\t);\n\tconst routing = useMemo(() => ({ router, stateMapping }), [router, stateMapping]);\n\treturn (\n\t\t<AlgoliaSSRProvider<UiState, RouteState>\n\t\t\tattributesToRetrieve={[\n\t\t\t\t'title',\n\t\t\t\t'productId',\n\t\t\t\t'overview',\n\t\t\t\t'authors',\n\t\t\t\t'region',\n\t\t\t\t'primaryImageUri',\n\t\t\t\t'anchorPrice',\n\t\t\t\t'salePrice',\n\t\t\t\t'averageRating',\n\t\t\t\t'reviewCount',\n\t\t\t\t'isLogosEdition',\n\t\t\t]}\n\t\t\tqueryType=\"prefixNone\"\n\t\t\trouting={routing}\n\t\t\tsearchClient={searchClient}\n\t\t\tsearchParameters={searchParameters}\n\t\t>\n\t\t\t<HiddenFacetRefinements facetConfigurations={facetConfigurations} />\n\t\t\t<AuthorBatch.Provider>\n\t\t\t\t<PublisherBatch.Provider>\n\t\t\t\t\t<FilterSortLayout\n\t\t\t\t\t\tpageLimits={pageLimits}\n\t\t\t\t\t\tsortOrders={sortOrders}\n\t\t\t\t\t\twishListsProductsUrl={wishListsProductsUrl}\n\t\t\t\t\t\tenableAuthorBioView={enableAuthorBioView}\n\t\t\t\t\t/>\n\t\t\t\t</PublisherBatch.Provider>\n\t\t\t</AuthorBatch.Provider>\n\t\t</AlgoliaSSRProvider>\n\t);\n};\n\n// ---------------------------------------------------------------------------\n// Search — top-level entry component (default export)\n// ---------------------------------------------------------------------------\n\ninterface SearchProps {\n\talgoliaAppId?: string;\n\talgoliaAppKey?: string;\n\talgoliaIndexName?: string;\n\tstorefrontShortname?: string;\n\talgoliaSearchParametersJson?: string;\n\tuserSearchFiltersJson?: string;\n\tfacetConfigurations?: FacetConfiguration[];\n\tsearchCategories?: SearchCategory[];\n\twishListsProductsUrl?: string;\n\tenableAuthorBioView?: boolean;\n\tpageLimits: number[];\n\tsortOrders: { label: string; value: string | null }[];\n}\n\nexport default function Search({\n\talgoliaAppId = '',\n\talgoliaAppKey = '',\n\talgoliaIndexName = '',\n\tstorefrontShortname = '',\n\talgoliaSearchParametersJson,\n\tuserSearchFiltersJson,\n\tfacetConfigurations = [],\n\tsearchCategories = [],\n\twishListsProductsUrl = '',\n\tenableAuthorBioView = false,\n\tpageLimits,\n\tsortOrders,\n}: SearchProps) {\n\tconst localizedResources = useLocalization('CommerceWeb.Resources.Search.Search');\n\tconst { userId } = useCurrentUser();\n\tconst searchParameters = useMemo(\n\t\t() => safeJsonParse(algoliaSearchParametersJson) ?? {},\n\t\t[algoliaSearchParametersJson]\n\t);\n\tconst userSearchFilters = useMemo((): UserSearchFilter[] => {\n\t\tconst parsedFilters = safeJsonParse<UserSearchFilters>(userSearchFiltersJson);\n\t\treturn (\n\t\t\tparsedFilters?.filters?.map(filter => ({\n\t\t\t\t...filter,\n\t\t\t\toptions: filter.options.map(option => ({ ...option, isSelected: option.isDefault })),\n\t\t\t})) ?? []\n\t\t);\n\t}, [userSearchFiltersJson]);\n\n\treturn (\n\t\t<div className=\"tw-preflight\">\n\t\t\t<PerUserDataContextProvider>\n\t\t\t\t<SearchResourcesContext.Provider value={localizedResources}>\n\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t<AlgoliaSearchContextProvider\n\t\t\t\t\t\t\tappId={algoliaAppId}\n\t\t\t\t\t\t\tappKey={algoliaAppKey}\n\t\t\t\t\t\t\tindexName={algoliaIndexName}\n\t\t\t\t\t\t\tstorefrontShortname={storefrontShortname}\n\t\t\t\t\t\t\tuserId={userId}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<UserSearchFilterProvider userSearchFilters={userSearchFilters}>\n\t\t\t\t\t\t\t\t<InstantSearchWrapper\n\t\t\t\t\t\t\t\t\tcategories={searchCategories}\n\t\t\t\t\t\t\t\t\tfacetConfigurations={facetConfigurations}\n\t\t\t\t\t\t\t\t\tsearchParameters={searchParameters}\n\t\t\t\t\t\t\t\t\twishListsProductsUrl={wishListsProductsUrl}\n\t\t\t\t\t\t\t\t\tenableAuthorBioView={enableAuthorBioView}\n\t\t\t\t\t\t\t\t\tpageLimits={pageLimits}\n\t\t\t\t\t\t\t\t\tsortOrders={sortOrders}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</UserSearchFilterProvider>\n\t\t\t\t\t\t</AlgoliaSearchContextProvider>\n\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t</SearchResourcesContext.Provider>\n\t\t\t\t<CategoryContent sectionKind=\"searchResultsBelow\" />\n\t\t\t</PerUserDataContextProvider>\n\t\t</div>\n\t);\n}\n","import { useEffect, useRef } from 'react';\nimport { useHits } from 'react-instantsearch';\n\nimport { ProductHit } from '../types';\n\n/**\n * Pushes UA Enhanced Ecommerce impression data to the dataLayer when search results change.\n * Matches the Skeletor pattern of `dataLayer.push({ ecommerce: { impressions: [...] } })`.\n */\nexport function useSearchImpressions() {\n\tconst { results } = useHits<ProductHit>();\n\tconst lastPushedQueryRef = useRef<string | null>(null);\n\n\tuseEffect(() => {\n\t\tif (!results?.hits?.length) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Deduplicate pushes by using the Algolia query ID (or query string + page as fallback)\n\t\tconst queryKey = (results as any).queryID ?? `${results.query ?? ''}_${results.page ?? 0}`;\n\t\tif (queryKey === lastPushedQueryRef.current) {\n\t\t\treturn;\n\t\t}\n\t\tlastPushedQueryRef.current = queryKey;\n\n\t\tconst impressions = results.hits.map((hit, index) => ({\n\t\t\tid: String(hit.productId),\n\t\t\tname: hit.title ?? '',\n\t\t\tprice: String(hit.salePrice ?? 0),\n\t\t\tlist: 'Search Results',\n\t\t\tposition: String(index),\n\t\t}));\n\n\t\t(window as any).dataLayer = (window as any).dataLayer || [];\n\t\t(window as any).dataLayer.push({\n\t\t\tecommerce: {\n\t\t\t\timpressions,\n\t\t\t},\n\t\t});\n\t}, [results]);\n}\n","import { useEffect, useRef } from 'react';\nimport { useInstantSearch } from 'react-instantsearch';\n\n/**\n * Pushes GTM dataLayer events when users interact with search facets, sort options,\n * and hits-per-page controls. Matches the Skeletor `facet_search` and `results_search` events.\n */\nexport function useSearchAnalytics() {\n\tconst { indexUiState } = useInstantSearch();\n\tconst previousStateRef = useRef<typeof indexUiState | null>(null);\n\n\tuseEffect(() => {\n\t\tconst prevState = previousStateRef.current;\n\t\tpreviousStateRef.current = indexUiState;\n\n\t\t// Skip the initial render — only track user-initiated changes\n\t\tif (!prevState) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst dataLayer = ((window as any).dataLayer = (window as any).dataLayer || []);\n\n\t\t// Track sort changes\n\t\tif (indexUiState.sortBy !== prevState.sortBy) {\n\t\t\tdataLayer.push({\n\t\t\t\tevent: 'results_search',\n\t\t\t\tselection: {\n\t\t\t\t\tgroup: 'Sort By',\n\t\t\t\t\toption: indexUiState.sortBy ?? 'default',\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// Track hits-per-page changes\n\t\tif (indexUiState.hitsPerPage !== prevState.hitsPerPage) {\n\t\t\tdataLayer.push({\n\t\t\t\tevent: 'results_search',\n\t\t\t\tselection: {\n\t\t\t\t\tgroup: 'Show',\n\t\t\t\t\toption: String(indexUiState.hitsPerPage ?? 15),\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// Track refinement list (facet) changes\n\t\tconst currentRefinements = indexUiState.refinementList ?? {};\n\t\tconst previousRefinements = prevState.refinementList ?? {};\n\n\t\tconst allFacetKeys = new Set([...Object.keys(currentRefinements), ...Object.keys(previousRefinements)]);\n\n\t\tfor (const facetKey of allFacetKeys) {\n\t\t\tconst currentValues = new Set(currentRefinements[facetKey] ?? []);\n\t\t\tconst previousValues = new Set(previousRefinements[facetKey] ?? []);\n\n\t\t\t// Find newly selected facets\n\t\t\tfor (const value of currentValues) {\n\t\t\t\tif (!previousValues.has(value)) {\n\t\t\t\t\tdataLayer.push({\n\t\t\t\t\t\tevent: 'facet_search',\n\t\t\t\t\t\tselection: {\n\t\t\t\t\t\t\tfacetGroup: facetKey,\n\t\t\t\t\t\t\tfacet: value,\n\t\t\t\t\t\t\tchecked: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Find deselected facets\n\t\t\tfor (const value of previousValues) {\n\t\t\t\tif (!currentValues.has(value)) {\n\t\t\t\t\tdataLayer.push({\n\t\t\t\t\t\tevent: 'facet_search',\n\t\t\t\t\t\tselection: {\n\t\t\t\t\t\t\tfacetGroup: facetKey,\n\t\t\t\t\t\t\tfacet: value,\n\t\t\t\t\t\t\tchecked: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Track page changes\n\t\tif (indexUiState.page !== prevState.page) {\n\t\t\tdataLayer.push({\n\t\t\t\tevent: 'results_search',\n\t\t\t\tselection: {\n\t\t\t\t\tgroup: 'Page',\n\t\t\t\t\toption: String(indexUiState.page ?? 1),\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}, [indexUiState]);\n}\n","export function safeJsonParse<T = any>(json: string | null | undefined): T | null {\n\tif (json === null || json === undefined) {\n\t\treturn null;\n\t}\n\n\ttry {\n\t\treturn JSON.parse(json) as T;\n\t} catch {\n\t\treturn null;\n\t}\n}\n"],"names":["ErrorBoundary","Component","constructor","props","super","_defineProperty","this","setState","hasError","error","errorInfo","onReset","state","getDerivedStateFromError","componentDidCatch","onError","console","render","fallback","resetErrorBoundary","fallbackComponent","FallbackComponent","React","children","propTypes","PropTypes","isRequired","showError","defaultProps","__WEBPACK_DEFAULT_EXPORT__","AuthorBatch","createBatchContext","async","nonEmptyIds","ids","filter","id","length","response","fetch","concat","join","ok","Error","status","json","data","find","d","useAuthor","useData","BooksByAuthor","_ref","resources","refinedAuthorIds","_useRefinementList$it","useRefinementList","attribute","items","item","isRefined","map","value","authorId","_useAuthor","author","isLoading","_useState","useState","_useState2","_slicedToArray","isCollapsed","setIsCollapsed","displayName","longDescription","className","Typography","variant","booksBy","IconButton","scale","onClick","ChevronDown","ChevronUp","AuthorBio","imageUrl","imageUrlLarge","bio","PublisherBatch","builderIoModelNamesBySectionKindMap","searchResultsAbove","searchResultsBelow","universalHeader","universalFooter","subscriptionChurnPrevention","configurationWizardSubscriptionsBanner","configurationWizardSubscriptionsContent","configurationWizardLibrariesBanner","orderSummary","orderSummaryFooter","productPage","adzone","notifications","getContentKey","sectionContents","sc","sectionKind","contentSourceKind","contentId","section_content","onContentChange","setSectionContents","builderIoModel","isBuilderIoPreviewingThisModel","useIsPreviewingThisBuilderModel","location","useLocation","useEffect","sections","kind","url","get","params","getSections","href","filteredSections","hasContent","contentKey","fetchSections","notifyWarning","RenderBuilderContent","model","staticData","staticProductData","userInfo","c_defaultUserInfo","filteredContents","_extends","key","builderIo","category_content","_useState2$","setContentState","handleContentChange","useCallback","event","prev","ReadMoreReadLess","SectionContent","UserSearchFilterContext","createContext","readUserFilterSelectionsFromUrl","userSearchFilters","searchParams","defaults","reduce","selectedOptions","_options$find","options","Array","isArray","selectedOption","option","isDefault","token","getDefaultSelectedFilterOptions","_matchingOption$token","urlValue","matchingOption","undefined","resolved","useUserSearchFilterContext","context","useContext","UserSearchFilterProvider","setSelectedFilterOptionsOverride","_useLocation","search","pathname","replaceUrl","useMemo","URLSearchParams","selectedFilterOptions","setSelectedFilterOptions","urlSelections","next","currentSelection","isStillValid","some","URL","_unused","selectedToken","set","delete","_unused2","writeUserFilterSelectionsToUrl","handleSetSelectedFilterOption","filterToken","optionToken","_objectSpread","contextValue","setSelectedFilterOption","Provider","Accordion","AccordionPrimitive","AccordionItem","ref","_objectWithoutProperties","_excluded","cn","AccordionTrigger","_ref2","_excluded2","AccordionContent","_ref3","_excluded3","SearchResourcesContext","useSearchResources","AlgoliaSearchContext","AlgoliaSearchContextProvider","appId","appKey","indexName","storefrontShortname","_ref$userId","userId","client","algoliasearch","insightsClient","apiKey","useAlgoliaSearch","parseFacetValue","separatorIndex","indexOf","substring","safeUrl","input","base","Check","checked","fill","height","viewBox","width","xmlns","rx","stroke","y","strokeLinecap","c_statusLabelKeys","ShowMoreToggle","showMore","setShowMore","isShowingMore","LinkButton","as","countDepth","index","depth","getChildren","parent","_ref5","startsWith","Category","_ref8","category","setExpandedFacets","maxLevel","levels","levelsRef","useRef","current","level","refinement","limit","skipSuspense","push","useRefinementLists","accordions","root","label","_ref6","subCategories","_ref7","_ref4","hasChildren","c","replace","getAccordions","accordion","_resources$accordion$","tag","slice","_ref9","refine","eventName","filters","_ref0","child","forEach","_ref1","old","v","lastIndexOf","count","AuthorFacetItem","_ref10","onRefine","PublisherFacetItem","_ref11","AuthorsOrPublishers","_ref12","_resources$attribute","nameAttribute","_useRefinementList","canToggleShowMore","toggleShowMore","_useRefinementList2","idItems","FacetItem","facetItems","_parseFacetValue","idItem","sort","a","b","i","Statuses","_ref13","level1","level2","level3","level4","_ref14","_resources","_c_statusLabelKeys$va","_resources2","_c_statusLabelKeys$it","UserSearchFilterAccordionItem","_ref15","_useUserSearchFilterC","selectedFilterOption","title","isSelected","onChange","type","Categories","expandedFacets","_useState3","_useState4","onValueChange","RefinementLabel","stringValue","String","AuthorLabel","PublisherLabel","AuthorApiLabel","PublisherApiLabel","_usePublisher","CurrentRefinements","currentRefinements","useCurrentRefinements","itemsByAttribute","refinementList","_currentRefinements$i","_item$refinements","refinements","itemValue","itemAndChildren","r","RefinementChip","_itemsByAttribute$att","X","CurrentQueryRefinement","_searchParams$get","urlQuery","_useSearchBox","useSearchBox","query","clear","removeQuery","HiddenRefinementList","getHiddenAlgoliaAttributes","config","algoliaAttribute","attributes","minLevel","algoliaAttributeBase","HiddenFacetRefinements","facetConfigurations","isHidden","flatMap","SkeletonRoot","_ref$pending","pending","_ref$hideOverflow","hideOverflow","role","SkeletonBox","EnhancedForLogosLabel","useLocalization","logosOrVerbum","useBrandName","isVerbum","toLowerCase","CommandSentence","template","EnhancedForLogos","Field","name","alt","src","enhanced_for_logos_with_tooltip","Tooltip","placement","link","InfoIconSvgUrl","EnhancedForLogosTooltipContent","usdFormat","Intl","NumberFormat","style","currency","minimumFractionDigits","maximumFractionDigits","useProductCard","_pricingData$primaryS","_pricingData$primaryS2","_hit$salePrice","_hit$salePrice2","_hit$anchorPrice","_hit$anchorPrice2","_pricingData$primaryS3","_pricingData$primaryS4","_pricingData$primaryS5","_hit$title","_prices$anchorPrice","_prices$salePrice","_prices$salePrice$loc","_prices$salePrice2","_pricingData$primaryS6","_hit$isLogosEdition","hit","_ref$queryId","queryId","position","pricingData","usePricing","productId","preferredCurrency","useCurrentUser","hasGeoRestriction","isGeographicallyRestricted","isAddingToCart","setIsAddingToCart","requestIdRef","prices","primarySku","salePrice","amount","displayAmount","format","displayAmountCurrencyCode","localizedDisplayAmount","currencyCode","displayAmountByCurrency","anchorPrice","discountSavings","accessKind","isOwned","hasPreorder","isPrepubProduct","prepubProductStatusSummary","skuId","isPurchasable","handleCartUpdated","e","detail","requestId","handleCartUpdateError","document","addEventListener","removeEventListener","slug","text","normalize","trim","slugify","productPath","productUrl","encodeURIComponent","productName","regularPrice","salePriceCurrency","localizedSalePrice","discountPercentage","anchor","sale","getSavingsPercent","isDiscounted","productImageSrc","primaryImageUri","imageSrc","detectIsAmberOptimizedUrl","isLogosEdition","handleProductClick","window","queryID","objectIDs","positions","handleAddToCart","_pricingData$primaryS7","eventType","eventData","Date","now","Math","random","eventDetail","addToCartUrl","routes","AddToCartUrl","skuIds","quantity","payInFull","searchData","productIds","currentTarget","dispatchEvent","CustomEvent","bubbles","ProductImage","priority","intent","onAuxClick","touchTarget","Image","belowTheFold","sizes","mobile","tablet","desktop","targetAspectRatio","DiscountBadge","_resources$discountFo","badgeClassName","toFixed","ProductTitle","ProductAuthors","authors","ctaButtonScale","skeletonHeightByButtonScale","small","medium","large","ProductPricing","cardData","buttonLayoutClassName","ProductPrice","ProductCta","ownershipLabelClassName","PriceLabel","layout","purchaseStatusMessage","getOwnershipLabel","Button","disabled","Skeleton","AlgoliaGridCard","_hit$averageRating","_hit$reviewCount","productInWishlist","useProductInWishList","averageRating","reviewCount","hasReviewData","hasValidReviewData","EnhancedForLogosWithTooltip","AddToWishListWithForm","StarRating","rating","PrepubProductStatusSummary","ProductOverview","overview","isExpanded","setIsExpanded","showButton","setShowButton","overviewRef","element","scrollHeight","computedLineHeight","getComputedStyle","lineHeight","parsedLineHeight","parseInt","Number","isFinite","dangerouslySetInnerHTML","__html","toggleExpand","AlgoliaListCard","SkeletonBlock","rootClassName","SkeletonButton","ProductSkeleton","layoutType","ProductSkeletons","currentHitsPerPage","from","_","toProductHitResult","toString","products","wishListsProductsUrl","Card","useInstantSearch","HitComponent","_queryID","__position","__queryID","WishListProductBatchProvider","Hits","classNames","list","hitComponent","RadioAccordion","radioGroupName","onSelect","prefixLabel","currentItem","collapsible","SortByAccordion","_useSortBy","useSortBy","currentRefinement","HitsPerPageAccordion","_useHitsPerPage","useHitsPerPage","showItems","ViewMode","ViewModeContext","viewModeKey","viewModeValues","Object","values","ViewModeProvider","getInitialViewMode","urlViewMode","includes","cookieViewMode","Cookies","grid","viewMode","setViewMode","history","replaceState","arrayToQueryParam","array","emptyIfUndefined","getTrimmedOrUndefinedIfStringEmpty","trimmed","getMatchingCategoryPageFromRouteState","routeState","categoryPageConfigurations","allFacetingKeys","_routeState$facets","facets","Set","keys","_routeState$facets2","categoryPageConfiguration","checkCategoryPageConfigurationMatches","preserveCustomQueryParams","sourceUrl","targetUrl","preserveKeys","entries","has","writeFacetsSearchParams","excludedKeys","candidateQueryParamValue","writeUserFilterSearchParams","checkFacetValueConfigurationMatches","facetValueConfiguration","routeStateFacetValue","routeStateFacets","facetsConfiguration","matches","routeStateFacet","facetConfiguration","f","queryParamName","writeCommonSearchParams","sortBy","page","AlgoliaSSRProvider","AlgoliaProvider","attributesToHighlight","attributesToRetrieve","queryType","restrictSearchableAttributes","routing","searchClient","searchParameters","InstantSearch","future","preserveSharedStateOnUnmount","insights","ConfigureCore","ParameterBlacklist","mergedParams","uf","_uf$options","selectedOptionToken","o","algoliaValue","filterParts","fromEntries","Configure","distinct","CloseIcon","rest","fillColor","strokeWidth","FilterIcon","LayoutButtonOptions","icon","x","additionalClassNames","_excluded4","LayoutButtons","currentLayoutType","setLayoutType","IconComponent","DesktopSearchControl","_selectedItem$label","prefixText","testId","contentClassName","selectedItem","_items$find","selectedLabel","handleValueChange","newValue","matchedItem","DropdownMenu","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuRadioGroup","DropdownMenuRadioItem","ScrollToTopOnPaginationChange","usePagination","scrollTo","top","behavior","NoResultsState","normalizedQuery","noResultsMessageTemplate","searchTips","Container","tip","assign","FilterSortLayout","_showItems$find$value","_showItems$find","enableAuthorBioView","pageLimits","sortOrders","authorBioResources","isMobileFilterOpen","setIsMobileFilterOpen","_useViewMode","useViewMode","_useScreensize","useScreensize","isMobile","isDesktop","results","useHits","lastPushedQueryRef","_results$hits","_results$query","_results$page","hits","queryKey","impressions","price","dataLayer","ecommerce","useSearchImpressions","indexUiState","previousStateRef","_indexUiState$refinem","_prevState$refinement","prevState","_indexUiState$sortBy","_indexUiState$hitsPer","selection","group","hitsPerPage","previousRefinements","allFacetKeys","facetKey","_currentRefinements$f","_previousRefinements$","currentValues","previousValues","facetGroup","facet","_indexUiState$page","useSearchAnalytics","hasNoSearchResults","__isArtificial","nbHits","shouldShowResultsRoute","allSortItems","sortOrder","_resources$sortOrder$","currentSortBy","refineSortBy","hasPrepubCategory","sortItems","hitsPerPageItems","pageLimit","default","refineHitsPerPage","closeFilter","toggleFilter","filterPanelContent","Drawer","isOpen","onClose","size","zIndex","CategoryContent","newSortBy","newHitsPerPage","ProductHits","Pagination","noRefinementRoot","previousPageItem","pageItem","disabledItem","nextPageItem","showFirst","showLast","showNext","showPrevious","InstantSearchWrapper","categories","_useAlgoliaSearch3","stateMapping","sortByPrefix","stateToRoute","uiState","facetValues","routeKey","_indexUiState$refinem2","routeKeyPrefix","routeToState","_routeState$facets3","_routeState$facets4","makeStateMapping","queryParamNameByTopLevelTokenMap","categoryToken","getQueryParamNameByTopLevelTokenMap","_token$split","split","_token$split2","topLevelToken","secondLevelToken","categoryPageUrl","pageTitle","convertSearchCategoriesToCategoryPageConfiguration","router","arguments","getAllFacetingKeys","allFacetingKeysSet","userFilterKeysSet","categoryPagesByCategoryPageUrl","Map","configuration","cleanUrlOnDispose","createURL","preserveCustomKeysSet","matchingCategoryPage","currentUrl","categoryFacetKeys","err","parseURL","locationUrl","locationPathname","addRouteStateFacetValues","_routeState$facets5","_routeState$facets6","_routeState$facets6$k","queryParams","paramName","paramValue","_routeState$filters","windowTitle","makeRouter","Search","_ref12$algoliaAppId","algoliaAppId","_ref12$algoliaAppKey","algoliaAppKey","_ref12$algoliaIndexNa","algoliaIndexName","_ref12$storefrontShor","algoliaSearchParametersJson","userSearchFiltersJson","_ref12$facetConfigura","_ref12$searchCategori","searchCategories","_ref12$wishListsProdu","_ref12$enableAuthorBi","localizedResources","_safeJsonParse","safeJsonParse","_parsedFilters$filter","_parsedFilters$filter2","parsedFilters","PerUserDataContextProvider","JSON","parse"],"sourceRoot":""}