@wix/web5-core 1.59.0 → 1.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/cjs/component/componentDefinitions/ComparisonSectionDefinition.js +33 -1
  2. package/dist/cjs/component/componentDefinitions/ComparisonSectionDefinition.js.map +1 -1
  3. package/dist/cjs/component/componentDefinitions/FeatureSection9PlusDefinition.js +9 -5
  4. package/dist/cjs/component/componentDefinitions/FeatureSection9PlusDefinition.js.map +1 -1
  5. package/dist/cjs/component/componentDefinitions/listItemsSectionDefinition.js +10 -5
  6. package/dist/cjs/component/componentDefinitions/listItemsSectionDefinition.js.map +1 -1
  7. package/dist/cjs/component/componentDefinitions/parse-utils.js +45 -8
  8. package/dist/cjs/component/componentDefinitions/parse-utils.js.map +1 -1
  9. package/dist/cjs/component/componentParser.js +15 -0
  10. package/dist/cjs/component/componentParser.js.map +1 -1
  11. package/dist/cjs/component/section-definition.js +14 -0
  12. package/dist/cjs/component/section-definition.js.map +1 -1
  13. package/dist/cjs/components/ui/MarkdownText.js +41 -42
  14. package/dist/cjs/components/ui/MarkdownText.js.map +1 -1
  15. package/dist/cjs/components/ui/UnifiedLink.js +22 -10
  16. package/dist/cjs/components/ui/UnifiedLink.js.map +1 -1
  17. package/dist/cjs/index.js +5 -3
  18. package/dist/cjs/index.js.map +1 -1
  19. package/dist/cjs/utils/markdownPreprocessor.js +162 -8
  20. package/dist/cjs/utils/markdownPreprocessor.js.map +1 -1
  21. package/dist/esm/component/componentDefinitions/ComparisonSectionDefinition.js +34 -1
  22. package/dist/esm/component/componentDefinitions/ComparisonSectionDefinition.js.map +1 -1
  23. package/dist/esm/component/componentDefinitions/FeatureSection9PlusDefinition.js +10 -6
  24. package/dist/esm/component/componentDefinitions/FeatureSection9PlusDefinition.js.map +1 -1
  25. package/dist/esm/component/componentDefinitions/listItemsSectionDefinition.js +11 -6
  26. package/dist/esm/component/componentDefinitions/listItemsSectionDefinition.js.map +1 -1
  27. package/dist/esm/component/componentDefinitions/parse-utils.js +44 -8
  28. package/dist/esm/component/componentDefinitions/parse-utils.js.map +1 -1
  29. package/dist/esm/component/componentParser.js +15 -0
  30. package/dist/esm/component/componentParser.js.map +1 -1
  31. package/dist/esm/component/section-definition.js +13 -1
  32. package/dist/esm/component/section-definition.js.map +1 -1
  33. package/dist/esm/components/ui/MarkdownText.js +8 -9
  34. package/dist/esm/components/ui/MarkdownText.js.map +1 -1
  35. package/dist/esm/components/ui/UnifiedLink.js +7 -1
  36. package/dist/esm/components/ui/UnifiedLink.js.map +1 -1
  37. package/dist/esm/index.js +2 -0
  38. package/dist/esm/index.js.map +1 -1
  39. package/dist/esm/utils/markdownPreprocessor.js +160 -8
  40. package/dist/esm/utils/markdownPreprocessor.js.map +1 -1
  41. package/dist/types/component/componentDefinitions/ComparisonSectionDefinition.d.ts +2 -2
  42. package/dist/types/component/componentDefinitions/ComparisonSectionDefinition.d.ts.map +1 -1
  43. package/dist/types/component/componentDefinitions/FeatureSection9PlusDefinition.d.ts.map +1 -1
  44. package/dist/types/component/componentDefinitions/listItemsSectionDefinition.d.ts.map +1 -1
  45. package/dist/types/component/componentDefinitions/parse-utils.d.ts +10 -0
  46. package/dist/types/component/componentDefinitions/parse-utils.d.ts.map +1 -1
  47. package/dist/types/component/componentParser.d.ts.map +1 -1
  48. package/dist/types/component/section-definition.d.ts +13 -1
  49. package/dist/types/component/section-definition.d.ts.map +1 -1
  50. package/dist/types/components/ui/MarkdownText.d.ts +13 -0
  51. package/dist/types/components/ui/MarkdownText.d.ts.map +1 -1
  52. package/dist/types/components/ui/UnifiedLink.d.ts +1 -1
  53. package/dist/types/components/ui/UnifiedLink.d.ts.map +1 -1
  54. package/dist/types/index.d.ts +2 -1
  55. package/dist/types/index.d.ts.map +1 -1
  56. package/dist/types/utils/markdownPreprocessor.d.ts +30 -5
  57. package/dist/types/utils/markdownPreprocessor.d.ts.map +1 -1
  58. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"names":["React","isWeb5AskUrl","isWeb5ActionUrl","validateLinkUrl","cn","useWeb5Link","useComponentDependencies","DIAGNOSTIC_TYPES","ArrowUpIcon","ArrowTopRightIcon","LinkType","ARROW_BY_TYPE","ASK","ACTION","NAVIGATE","detectLinkType","href","UnifiedLink","_ref","linkType","linkTypeProp","variant","active","hideArrow","className","children","onClick","props","handleLinkClick","resolveUrl","reportDiagnostic","BROKEN_WEB5_LINK","resolvedHref","ArrowIcon","showArrow","safeHref","startsWith","handleClick","e","defaultPrevented","createElement","_extends"],"sources":["../../../../src/components/ui/UnifiedLink.tsx"],"sourcesContent":["import React from 'react';\nimport { isWeb5AskUrl, isWeb5ActionUrl } from '../../types/link-types';\nimport { validateLinkUrl } from '../../utils/entityLinkParser';\nimport { cn } from '../../lib/utils';\nimport { useWeb5Link } from '../../hooks/useWeb5Link';\nimport { useComponentDependencies } from '../../context/ComponentDependenciesContext';\nimport { DIAGNOSTIC_TYPES } from '../../component/diagnosticTypes';\nimport { ArrowUpIcon } from './icons/ArrowUpIcon';\nimport { ArrowTopRightIcon } from './icons/ArrowTopRightIcon';\n\nexport enum LinkType {\n ASK = 'ask',\n ACTION = 'action',\n NAVIGATE = 'navigate',\n}\n\nexport type LinkVariant = 'primary' | 'secondary' | 'inline';\n\nexport interface UnifiedLinkProps\n extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n href?: string;\n /** Override auto-detected link type */\n linkType?: LinkType;\n /** Visual variant */\n variant?: LinkVariant;\n /** Whether this is the first/active item (dark bg). Only applies to primary variant. */\n active?: boolean;\n /** Hide the arrow icon */\n hideArrow?: boolean;\n children: React.ReactNode;\n}\n\nconst ARROW_BY_TYPE: Record<\n LinkType,\n React.FC<React.SVGProps<SVGSVGElement>>\n> = {\n [LinkType.ASK]: ArrowUpIcon,\n [LinkType.ACTION]: ArrowTopRightIcon,\n [LinkType.NAVIGATE]: ArrowUpIcon,\n};\n\nexport function detectLinkType(href: string | undefined): LinkType {\n if (!href) {\n return LinkType.NAVIGATE;\n }\n if (isWeb5AskUrl(href)) {\n return LinkType.ASK;\n }\n if (isWeb5ActionUrl(href)) {\n return LinkType.ACTION;\n }\n return LinkType.NAVIGATE;\n}\n\nexport function UnifiedLink({\n href,\n linkType: linkTypeProp,\n variant = 'primary',\n active = false,\n hideArrow,\n className,\n children,\n onClick,\n ...props\n}: UnifiedLinkProps) {\n const { handleLinkClick, resolveUrl } = useWeb5Link();\n const { reportDiagnostic } = useComponentDependencies();\n\n if (!validateLinkUrl(href)) {\n reportDiagnostic?.(\n DIAGNOSTIC_TYPES.BROKEN_WEB5_LINK,\n 'unifiedLink',\n `link rejected: \"${href}\"`,\n );\n return null;\n }\n\n const resolvedHref = resolveUrl(href) ?? href;\n const linkType = linkTypeProp ?? detectLinkType(href);\n const ArrowIcon = ARROW_BY_TYPE[linkType];\n const showArrow = !hideArrow && variant !== 'inline';\n\n // web5:// hrefs must never reach the browser — Safari iOS attempts custom-scheme\n // navigation before JS fires, producing an \"address is invalid\" error.\n const safeHref = href?.startsWith('web5://') ? '#' : resolvedHref;\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n onClick?.(e);\n if (!e.defaultPrevented && resolvedHref) {\n handleLinkClick(e, resolvedHref);\n }\n };\n\n if (variant === 'inline') {\n return (\n <a\n href={safeHref}\n className={cn(\n 'text-primary underline underline-offset-4 hover:text-primary/80 cursor-pointer',\n className,\n )}\n onClick={handleClick}\n {...props}\n >\n {children}\n </a>\n );\n }\n\n if (variant === 'secondary') {\n return (\n <a\n href={safeHref}\n className={cn(\n 'inline w-fit cursor-pointer',\n 'text-sm leading-[18px] text-text-accent',\n className,\n )}\n onClick={handleClick}\n {...props}\n >\n {children}\n {showArrow && (\n <span className=\"inline whitespace-nowrap\">\n &nbsp;\n <ArrowIcon className=\"ml-0.5 inline-block size-4 align-middle\" />\n </span>\n )}\n </a>\n );\n }\n\n // Primary variant — pill with arrow circle and hover overlay\n return (\n <a\n href={safeHref}\n className={cn(\n 'group relative flex md:w-fit md:max-w-[500px] items-center justify-between rounded-[80px] pl-5 pr-[3px] py-[3px] gap-2 cursor-pointer overflow-hidden',\n 'text-sm leading-[14px]',\n active\n ? 'bg-text-accent text-white'\n : 'bg-white border border-text-accent/30 text-text-accent',\n className,\n )}\n onClick={handleClick}\n {...props}\n >\n {/* Hover overlay — expands from right (arrow) to fill pill */}\n <span\n className={cn(\n 'absolute inset-[3px] rounded-[80px] pointer-events-none',\n 'origin-right scale-x-0 group-hover:scale-x-100',\n 'transition-transform duration-300 ease-out',\n active ? 'bg-text-accent-hover' : 'bg-text-accent/10',\n )}\n />\n <span className=\"relative z-[1] min-w-0 py-[10px] truncate\">\n {children}\n </span>\n {showArrow && (\n <span\n className={cn(\n 'relative z-[1] flex items-center justify-center rounded-full shrink-0',\n 'size-[34px] p-2.5',\n active ? 'bg-text-accent-hover' : 'bg-text-accent/10',\n )}\n >\n <ArrowIcon className=\"size-4\" />\n </span>\n )}\n </a>\n );\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,EAAEC,eAAe,QAAQ,wBAAwB;AACtE,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,wBAAwB,QAAQ,4CAA4C;AACrF,SAASC,gBAAgB,QAAQ,iCAAiC;AAClE,SAASC,WAAW,QAAQ,qBAAqB;AACjD,SAASC,iBAAiB,QAAQ,2BAA2B;AAE7D,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAsBpB,MAAMC,aAGL,GAAG;EACF,CAACD,QAAQ,CAACE,GAAG,GAAGJ,WAAW;EAC3B,CAACE,QAAQ,CAACG,MAAM,GAAGJ,iBAAiB;EACpC,CAACC,QAAQ,CAACI,QAAQ,GAAGN;AACvB,CAAC;AAED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;EAAE,CACH,CAAC,eACFtB,KAAA,CAAAwC,aAAA;IAAMhB,SAAS,EAAC;EAA2C,GACxDC,QACG,CAAC,EACNS,SAAS,iBACRlC,KAAA,CAAAwC,aAAA;IACEhB,SAAS,EAAEpB,EAAE,CACX,uEAAuE,EACvE,mBAAmB,EACnBkB,MAAM,GAAG,sBAAsB,GAAG,mBACpC;EAAE,gBAEFtB,KAAA,CAAAwC,aAAA,CAACP,SAAS;IAACT,SAAS,EAAC;EAAQ,CAAE,CAC3B,CAEP,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["React","isWeb5AskUrl","isWeb5ActionUrl","validateLinkUrl","cn","useWeb5Link","useComponentDependencies","DIAGNOSTIC_TYPES","ArrowUpIcon","ArrowTopRightIcon","LinkType","ARROW_BY_TYPE","ASK","ACTION","NAVIGATE","detectLinkType","href","UnifiedLink","_ref","linkType","linkTypeProp","variant","active","hideArrow","className","children","onClick","props","handleLinkClick","resolveUrl","reportDiagnostic","BROKEN_WEB5_LINK","createElement","resolvedHref","ArrowIcon","showArrow","safeHref","startsWith","handleClick","e","defaultPrevented","_extends"],"sources":["../../../../src/components/ui/UnifiedLink.tsx"],"sourcesContent":["import React from 'react';\nimport { isWeb5AskUrl, isWeb5ActionUrl } from '../../types/link-types';\nimport { validateLinkUrl } from '../../utils/entityLinkParser';\nimport { cn } from '../../lib/utils';\nimport { useWeb5Link } from '../../hooks/useWeb5Link';\nimport { useComponentDependencies } from '../../context/ComponentDependenciesContext';\nimport { DIAGNOSTIC_TYPES } from '../../component/diagnosticTypes';\nimport { ArrowUpIcon } from './icons/ArrowUpIcon';\nimport { ArrowTopRightIcon } from './icons/ArrowTopRightIcon';\n\nexport enum LinkType {\n ASK = 'ask',\n ACTION = 'action',\n NAVIGATE = 'navigate',\n}\n\nexport type LinkVariant = 'primary' | 'secondary' | 'inline';\n\nexport interface UnifiedLinkProps\n extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n href?: string;\n /** Override auto-detected link type */\n linkType?: LinkType;\n /** Visual variant */\n variant?: LinkVariant;\n /** Whether this is the first/active item (dark bg). Only applies to primary variant. */\n active?: boolean;\n /** Hide the arrow icon */\n hideArrow?: boolean;\n children: React.ReactNode;\n}\n\nconst ARROW_BY_TYPE: Record<\n LinkType,\n React.FC<React.SVGProps<SVGSVGElement>>\n> = {\n [LinkType.ASK]: ArrowUpIcon,\n [LinkType.ACTION]: ArrowTopRightIcon,\n [LinkType.NAVIGATE]: ArrowUpIcon,\n};\n\nexport function detectLinkType(href: string | undefined): LinkType {\n if (!href) {\n return LinkType.NAVIGATE;\n }\n if (isWeb5AskUrl(href)) {\n return LinkType.ASK;\n }\n if (isWeb5ActionUrl(href)) {\n return LinkType.ACTION;\n }\n return LinkType.NAVIGATE;\n}\n\nexport function UnifiedLink({\n href,\n linkType: linkTypeProp,\n variant = 'primary',\n active = false,\n hideArrow,\n className,\n children,\n onClick,\n ...props\n}: UnifiedLinkProps) {\n const { handleLinkClick, resolveUrl } = useWeb5Link();\n const { reportDiagnostic } = useComponentDependencies();\n\n if (!validateLinkUrl(href)) {\n reportDiagnostic?.(\n DIAGNOSTIC_TYPES.BROKEN_WEB5_LINK,\n 'unifiedLink',\n `link rejected: \"${href}\"`,\n );\n // Degrade to the label as plain text rather than dropping it. Returning\n // null used to delete the children too, so a bad href silently removed\n // words from the middle of a sentence — the reader lost prose, not just a\n // link. An unclickable phrase is the smaller failure.\n return <span className={className}>{children}</span>;\n }\n\n const resolvedHref = resolveUrl(href) ?? href;\n const linkType = linkTypeProp ?? detectLinkType(href);\n const ArrowIcon = ARROW_BY_TYPE[linkType];\n const showArrow = !hideArrow && variant !== 'inline';\n\n // web5:// hrefs must never reach the browser — Safari iOS attempts custom-scheme\n // navigation before JS fires, producing an \"address is invalid\" error.\n const safeHref = href?.startsWith('web5://') ? '#' : resolvedHref;\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n onClick?.(e);\n if (!e.defaultPrevented && resolvedHref) {\n handleLinkClick(e, resolvedHref);\n }\n };\n\n if (variant === 'inline') {\n return (\n <a\n href={safeHref}\n className={cn(\n 'text-primary underline underline-offset-4 hover:text-primary/80 cursor-pointer',\n className,\n )}\n onClick={handleClick}\n {...props}\n >\n {children}\n </a>\n );\n }\n\n if (variant === 'secondary') {\n return (\n <a\n href={safeHref}\n className={cn(\n 'inline w-fit cursor-pointer',\n 'text-sm leading-[18px] text-text-accent',\n className,\n )}\n onClick={handleClick}\n {...props}\n >\n {children}\n {showArrow && (\n <span className=\"inline whitespace-nowrap\">\n &nbsp;\n <ArrowIcon className=\"ml-0.5 inline-block size-4 align-middle\" />\n </span>\n )}\n </a>\n );\n }\n\n // Primary variant — pill with arrow circle and hover overlay\n return (\n <a\n href={safeHref}\n className={cn(\n 'group relative flex md:w-fit md:max-w-[500px] items-center justify-between rounded-[80px] pl-5 pr-[3px] py-[3px] gap-2 cursor-pointer overflow-hidden',\n 'text-sm leading-[14px]',\n active\n ? 'bg-text-accent text-white'\n : 'bg-white border border-text-accent/30 text-text-accent',\n className,\n )}\n onClick={handleClick}\n {...props}\n >\n {/* Hover overlay — expands from right (arrow) to fill pill */}\n <span\n className={cn(\n 'absolute inset-[3px] rounded-[80px] pointer-events-none',\n 'origin-right scale-x-0 group-hover:scale-x-100',\n 'transition-transform duration-300 ease-out',\n active ? 'bg-text-accent-hover' : 'bg-text-accent/10',\n )}\n />\n <span className=\"relative z-[1] min-w-0 py-[10px] truncate\">\n {children}\n </span>\n {showArrow && (\n <span\n className={cn(\n 'relative z-[1] flex items-center justify-center rounded-full shrink-0',\n 'size-[34px] p-2.5',\n active ? 'bg-text-accent-hover' : 'bg-text-accent/10',\n )}\n >\n <ArrowIcon className=\"size-4\" />\n </span>\n )}\n </a>\n );\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,EAAEC,eAAe,QAAQ,wBAAwB;AACtE,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAASC,EAAE,QAAQ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SAAS,iBACRnC,KAAA,CAAAgC,aAAA;MAAMR,SAAS,EAAC;IAA0B,GAAC,MAEzC,eAAAxB,KAAA,CAAAgC,aAAA,CAACE,SAAS;MAACV,SAAS,EAAC;IAAyC,CAAE,CAC5D,CAEP,CAAC;EAER;;EAEA;EACA,oBACExB,KAAA,CAAAgC,aAAA,MAAAS,QAAA;IACEzB,IAAI,EAAEoB,QAAS;IACfZ,SAAS,EAAEpB,EAAE,CACX,uJAAuJ,EACvJ,wBAAwB,EACxBkB,MAAM,GACF,2BAA2B,GAC3B,wDAAwD,EAC5DE,SACF,CAAE;IACFE,OAAO,EAAEY;EAAY,GACjBX,KAAK,gBAGT3B,KAAA,CAAAgC,aAAA;IACER,SAAS,EAAEpB,EAAE,CACX,yDAAyD,EACzD,gDAAgD,EAChD,4CAA4C,EAC5CkB,MAAM,GAAG,sBAAsB,GAAG,mBACpC;EAAE,CACH,CAAC,eACFtB,KAAA,CAAAgC,aAAA;IAAMR,SAAS,EAAC;EAA2C,GACxDC,QACG,CAAC,EACNU,SAAS,iBACRnC,KAAA,CAAAgC,aAAA;IACER,SAAS,EAAEpB,EAAE,CACX,uEAAuE,EACvE,mBAAmB,EACnBkB,MAAM,GAAG,sBAAsB,GAAG,mBACpC;EAAE,gBAEFtB,KAAA,CAAAgC,aAAA,CAACE,SAAS;IAACV,SAAS,EAAC;EAAQ,CAAE,CAC3B,CAEP,CAAC;AAER","ignoreList":[]}
package/dist/esm/index.js CHANGED
@@ -11,6 +11,8 @@ export { getPartsByType, getPartByRole, getAllByRole, getHeading, getImages, get
11
11
 
12
12
  // Section definition
13
13
 
14
+ export { DROP_SECTION } from './component/section-definition.js';
15
+
14
16
  // Diagnostic types
15
17
  export { DIAGNOSTIC_TYPES } from './component/diagnosticTypes.js';
16
18
  // Image search filters
@@ -1 +1 @@
1
- {"version":3,"names":["CLIENT_IDS","EXPERIMENT_IDS","createFeatureToggleReader","FeatureToggleProvider","useFeatureToggles","useFeatureToggle","getPartsByType","getPartByRole","getAllByRole","getHeading","getImages","getLinks","extractContent","extractContentMarkdown","deriveRole","DIAGNOSTIC_TYPES","buildImageSearchFilter","ImageSearchFilterToken","backgroundFilter","HeroSectionDefinition","HeroEntitySectionDefinition","KpiSectionDefinition","FeatureCardsSectionDefinition","EntitySectionDefinition","EntityCollectionSectionDefinition","ComparisonSectionDefinition","TextBlockSectionDefinition","CtaBannerSectionDefinition","CalloutSectionDefinition","NextStepsSectionDefinition","FeatureSection9PlusDefinition","ListItemsSectionDefinition","SkipNodesSectionDefinition","HtmlCommentSectionDefinition","SearchSectionDefinition","ErrorSectionDefinition","FallbackSectionDefinition","createSdkRegistry","ComponentRegistry","validatePattern","validatePatternSyntax","validatePatternWithBlocks","convertToBlockElements","convertToBlockElementsWithMapping","Web5UrlType","isWeb5AskUrl","isWeb5EntityUrl","isWeb5ImageUrl","isWeb5IconUrl","isWeb5ActionUrl","isWeb5SearchUrl","isWeb5Url","isNavigableUrl","isValidLinkUrl","isLegacyUrl","parseWeb5Url","isValidWeb5Url","validateLinkUrl","isEntityLink","parseEntityLink","extractProtocol","extractLinkMetadata","findInvalidWeb5Links","hasImage","isHtmlComment","matchMarkdown","matchAllSections","nodesToParts","ComponentDependenciesProvider","useComponentDependencies","UserQueryProvider","useUserQuery","ChipsProvider","useChips","defaultExtractor","enrichEntitiesFromPayload","fetchEntityListData","listEntityItems","LIST_ITEMS_ENDPOINT","getEntityExtractor","registerEntityExtractor","transformToSolutionEntityData","transformToBlogPostEntityData","transformToGenericEntityData","CALLOUT_KINDS","useWeb5Link","useConversation","useDebugImageContext","useResolvedImageSources","useResolveGenericEntityData","useEntityTransforms","useMarkdownUtils","useResolveShopifyEntityData","useResolveSearchSpringEntityData","fetchProductsByHandles","fetchProductsByHandlesMap","transformSSProductToEntityItemData","addToCart","ShopifyStorefrontClient","resolveShopifyConfig","resolveShopifyEntity","transformShopifyProduct","transformShopifyCollection","transformShopifyArticle","transformShopifyEntityToItemData","PRODUCT_BY_HANDLE_QUERY","COLLECTION_BY_HANDLE_QUERY","ARTICLE_BY_HANDLE_QUERY","cn","normalizeImageUrl","getResizedImageUrl","analyzeBackdrop","computeContentBBox","buildProbeUrl","loadImagePixels","loadBackdropAnalysis","stripMarkdown","rgbToHsl","hslToRgb","ensureMinLightness","toRgb","deriveDarkColor","deriveDarkGradient","deriveLightColor","pushEvent","pushPromptSubmit","pushLinkClick","pushError","pushExit","pushEntityFiltered","hasAnalyticsConsent","ERROR_MARKDOWN","getErrorTypeFromStatus","createErrorMarkdown","STREAMING_TIMEOUT_MS","DEFAULT_ERROR_TEMPLATES","resolveErrorTemplate","getForwardStack","setForwardStack","clearForwardStack","pushToForwardStack","popFromForwardStack","UserQuery","PRODUCT_BACK_SESSION_KEY","writeProductBackHandoff","readProductBackHandoff","PromptEntryEmptyState","SearchSection","FeedbackBar","Disclaimer","BottomContainer","MarkdownText","CalloutBlock","OptimizedImage","SectionSkeleton","SmartIcon","Loader","PlacementLoader","UnifiedLink","detectLinkType","LinkType","Table","TableHeader","TableBody","TableFooter","TableHead","TableRow","TableCell","TableCaption","WEB5_USER_QUERY_EVENT","WEB5_ANSWER_UPDATED_EVENT","WEB5_REDIRECT_EVENT","loadClientBundle","getClientBundleOverride","isTrustedBundleHost","TEMPLATES_CDN_BASE","TEMPLATES_MANIFEST_URL","getTemplateOverride","isTemplatePickerRequested","isValidTemplateId","resolveClientBundleUrl","mergeClientConfig","applyThemeOverrides","THEME_OVERRIDE_TOKENS","PlacementResponseRenderer","PlacementSmoothHeight","buildPlacementDependencies","PlacementPayloadProvider","usePlacementPayload","UnifiedMarkdownParser","parseMarkdownToAst","parseAstToMarkdown","escapeWeb5Links","fixMalformedLinks","trimTrailingWhitespace","normalizeIconUrls","decodeLinkText","preprocessMarkdown","ComponentTracking","findKeywordsInContent","getContextualImageFilename","extractIntentFromMarkdown","getIntentFromMarkdown","createPageSection","generateSectionId","generateId","findImageInNode","findImageInChildren","DiagnosticsCollector","REFRESH_PROMPTS_UNTIL_KEY","REFRESH_PROMPTS_WINDOW_MS","getRefreshPromptsExpiry","shouldRefreshPrompts","enableRefreshPrompts","disableRefreshPrompts","BACKEND_ENVIRONMENT_KEY","BACKEND_ENVIRONMENT_QUERY_PARAM","DEFAULT_BACKEND_ENVIRONMENT","getBackendEnvironment","setBackendEnvironment","usesStagingBackend","MATCH_DEBUG_KEY","MATCH_DEBUG_QUERY_PARAM","isMatchDebugEnabled","setMatchDebug","resetMatchDebugCache","logMatchDebug","createWixAuthFetch","getOrCreateSessionId","getSessionId","getChatId","startNewChatId","setChatId","resetChatIdForTests","parseMarkdownToComponents","tryParseComponent","mergeSectionsWithStableReferences","WEB5_ROOT_ID","WEB5_ROOT_CLASS","WEB5_SCOPES","WEB5_SCOPE","WEB5_GLOBAL_TOKENS"],"sources":["../../src/index.ts"],"sourcesContent":["// Client IDs and experiment IDs\nexport { CLIENT_IDS, EXPERIMENT_IDS } from './clients';\n\nexport {\n type EmbedFeatureToggleResult,\n type FeatureToggleReader,\n createFeatureToggleReader,\n FeatureToggleProvider,\n useFeatureToggles,\n useFeatureToggle,\n} from './featureToggles/FeatureToggleContext';\n\n// Dev-only chrome injection contract for client packages\nexport type { DevEnvironment } from './client/devEnvironment';\n\n// Part types and helpers\nexport {\n type PartType,\n type Part,\n type HeadingPart,\n type ImagePart,\n type LinkPart,\n type ListPart,\n type ListItemPart,\n type KpiItemPart,\n type CardPart,\n type IconPart,\n type CalloutPart,\n type EntityPart,\n getPartsByType,\n getPartByRole,\n getAllByRole,\n getHeading,\n getImages,\n getLinks,\n extractContent,\n extractContentMarkdown,\n deriveRole,\n} from './parts/parts';\n\n// Component types\nexport type {\n BaseCompProps,\n SlotCompProps,\n SectionCompProps,\n SectionCompPropsWithSlot,\n TextCompProps,\n ButtonCompProps,\n ImageCompProps,\n BadgeCompProps,\n HeroButton,\n KpiItemCompProps,\n FeatureItemCompProps,\n FeatureCardCompProps,\n EntityItemData,\n EntityItem,\n GenericEntityData,\n GenericEntityCompProps,\n ComparisonRow,\n ComparisonColumn,\n AiNarrativeCompProps,\n HeroCompProps,\n HeroEntityCompProps,\n KpiCompProps,\n FeatureCardsCompProps,\n EntityCompProps,\n ComparisonCompProps,\n TextBlockCompProps,\n Component,\n BaseComponent,\n SlotComponent,\n SectionComponent,\n TextComponent,\n ButtonComponent,\n ImageComponent,\n BadgeComponent,\n KpiItemComponent,\n FeatureItemComponent,\n FeatureCardComponent,\n GenericEntityComponent,\n AiNarrativeComponent,\n ComparisonSectionComponent,\n TextBlockSectionComponent,\n HeroSectionComponent,\n HeroEntitySectionComponent,\n KpiSectionComponent,\n FeatureCardsSectionComponent,\n EntitySectionComponent,\n PropsOf,\n SectionFixture,\n CtaBannerCompProps,\n CtaBannerSectionComponent,\n CalloutCompProps,\n CalloutSectionComponent,\n NextStepsCompProps,\n NextStepsSectionComponent,\n FeatureSection9PlusCompProps,\n FeatureSection9PlusSectionComponent,\n ListItemsSectionCompProps,\n ListItemsSectionComponent,\n ErrorCompProps,\n ErrorSectionComponent,\n NullCompProps,\n NullSectionComponent,\n SolutionEntityCompProps,\n SolutionEntitySectionComponent,\n SolutionEntityData,\n BlogEntityCompProps,\n BlogEntitySectionComponent,\n BlogEntityData,\n GeneralTextCompProps,\n GeneralTextSectionComponent,\n PersonalizedNarrativeCompProps,\n PersonalizedNarrativeSectionComponent,\n} from './component/types';\n\n// Section definition\nexport type {\n SectionDefinition,\n ParseContext,\n ContextualImageResult,\n} from './component/section-definition';\n\n// Diagnostic types\nexport { DIAGNOSTIC_TYPES } from './component/diagnosticTypes';\nexport type { DiagnosticType } from './component/diagnosticTypes';\n\n// Image search filters\nexport {\n buildImageSearchFilter,\n type ImageSearchFilterString,\n} from './image/imageSearchFilterTypes';\nexport {\n ImageSearchFilterToken,\n backgroundFilter,\n} from './image/imageSearchFilters';\nexport type {\n ContextualImageAsset,\n ImageSourceInput,\n ResolvedImageSource,\n ResolvedImageSourceKind,\n} from './image/contextualImageTypes';\n\n// Section definition classes + createSdkRegistry\nexport {\n HeroSectionDefinition,\n HeroEntitySectionDefinition,\n KpiSectionDefinition,\n FeatureCardsSectionDefinition,\n EntitySectionDefinition,\n EntityCollectionSectionDefinition,\n ComparisonSectionDefinition,\n TextBlockSectionDefinition,\n CtaBannerSectionDefinition,\n CalloutSectionDefinition,\n NextStepsSectionDefinition,\n FeatureSection9PlusDefinition,\n ListItemsSectionDefinition,\n SkipNodesSectionDefinition,\n HtmlCommentSectionDefinition,\n SearchSectionDefinition,\n ErrorSectionDefinition,\n FallbackSectionDefinition,\n createSdkRegistry,\n} from './component/componentDefinitions';\n\n// Registry\nexport { ComponentRegistry } from './registry';\nexport type {\n SlotOptions,\n SectionOptions,\n SectionRegistration,\n SlotNode,\n SlotIntentNode,\n SectionIntentNode,\n SectionNode,\n SlotVariant,\n SectionVariant,\n RegistryCatalog,\n ActionResult,\n ActionHandler,\n} from './registry';\n\n// Pattern validator\nexport {\n validatePattern,\n validatePatternSyntax,\n validatePatternWithBlocks,\n type PatternValidationResult,\n type BlockElement,\n type EnrichedBlockElement,\n type LinkMetadata,\n type LinkAttribute,\n} from './patternValidator';\n\n// Markdown blocks\nexport {\n convertToBlockElements,\n convertToBlockElementsWithMapping,\n type BlockElementsWithMapping,\n} from './markdownBlocks';\n\n// Link types, enum & guards\nexport {\n Web5UrlType,\n type Web5AskUrl,\n type Web5EntityUrl,\n type Web5ImageUrl,\n type Web5IconUrl,\n type Web5ActionUrl,\n type Web5SearchUrl,\n type Web5Url,\n type HttpsUrl,\n type HttpUrl,\n type MailtoUrl,\n type RelativeUrl,\n type NavigableUrl,\n type ValidLinkUrl,\n type AnyKnownUrl,\n type LegacyUrl,\n isWeb5AskUrl,\n isWeb5EntityUrl,\n isWeb5ImageUrl,\n isWeb5IconUrl,\n isWeb5ActionUrl,\n isWeb5SearchUrl,\n isWeb5Url,\n isNavigableUrl,\n isValidLinkUrl,\n isLegacyUrl,\n} from './types/link-types';\n\n// Entity/URL parsing\nexport {\n parseWeb5Url,\n isValidWeb5Url,\n validateLinkUrl,\n type Web5UrlParsed,\n type Web5AskParsed,\n type Web5EntityParsed,\n type Web5ImageParsed,\n type Web5IconParsed,\n type Web5ActionParsed,\n type Web5SearchParsed,\n isEntityLink,\n parseEntityLink,\n extractProtocol,\n extractLinkMetadata,\n} from './utils/entityLinkParser';\n\n// Web5 link validation\nexport {\n findInvalidWeb5Links,\n type InvalidWeb5Link,\n} from './utils/web5LinkValidator';\n\n// Node matchers\nexport { hasImage, isHtmlComment } from './utils/nodeMatchers';\n\n// Match API\nexport {\n matchMarkdown,\n type MarkdownMatchResult,\n matchAllSections,\n type MatchAllSectionsResult,\n nodesToParts,\n} from './match';\n\n// ---------------------------------------------------------------------------\n// DI Infrastructure (moved from @wix/w5-client-circana)\n// ---------------------------------------------------------------------------\n\n// DI context and provider\nexport {\n ComponentDependenciesProvider,\n useComponentDependencies,\n type ComponentDependenciesProviderProps,\n} from './context/ComponentDependenciesContext';\n\n// Raw user query for the current response page\nexport {\n UserQueryProvider,\n useUserQuery,\n type UserQueryProviderProps,\n} from './context/UserQueryContext';\n\n// Chips context (suggestion chips shared between SearchSection and error states)\nexport {\n ChipsProvider,\n useChips,\n type SuggestionChip,\n} from './context/ChipsContext';\n\n// DI types\nexport type {\n ComponentDependencies,\n Web5LinkApi,\n ConversationApi,\n SendMessageTrackingOptions,\n SendMessageOptions,\n ComparisonSubmitPayload,\n ComparisonSelectedProduct,\n ProductComparisonSelectionState,\n ProductComparisonApi,\n EntityTransforms,\n MarkdownUtils,\n ResolveGenericEntityDataOptions,\n} from './types/dependencies';\nexport type {\n ApiPayloadItem,\n EntityTypeConfig,\n EntityConfig,\n EntityExtractionContext,\n} from './types/entity';\nexport {\n defaultExtractor,\n enrichEntitiesFromPayload,\n fetchEntityListData,\n listEntityItems,\n LIST_ITEMS_ENDPOINT,\n getEntityExtractor,\n registerEntityExtractor,\n transformToSolutionEntityData,\n transformToBlogPostEntityData,\n transformToGenericEntityData,\n} from './entity';\nexport type {\n EntityExtractor,\n FetchEntityListDataOptions,\n ListEntityItemsOptions,\n} from './entity';\nexport { CALLOUT_KINDS, type CalloutKind, type Callout } from './types/callout';\n\n// Wrapper hooks\nexport { useWeb5Link } from './hooks/useWeb5Link';\nexport { useConversation } from './hooks/useConversation';\nexport { useDebugImageContext } from './hooks/useDebugImageContext';\nexport { useResolvedImageSources } from './hooks/useResolvedImageSources';\nexport { useResolveGenericEntityData } from './hooks/useResolveGenericEntityData';\nexport { useEntityTransforms } from './hooks/useEntityTransforms';\nexport { useMarkdownUtils } from './hooks/useMarkdownUtils';\nexport { useResolveShopifyEntityData } from './hooks/useResolveShopifyEntityData';\nexport { useResolveSearchSpringEntityData } from './hooks/useResolveSearchSpringEntityData';\n\n// SearchSpring\nexport {\n fetchProductsByHandles,\n fetchProductsByHandlesMap,\n transformSSProductToEntityItemData,\n} from './services/searchspring';\nexport type {\n SearchSpringConfig,\n SSProduct,\n SSSearchResponse,\n SSSizeData,\n} from './services/searchspring';\n\n// Shopify Storefront API\n// Cart actions\nexport { addToCart } from './services/cart';\n\nexport {\n ShopifyStorefrontClient,\n resolveShopifyConfig,\n resolveShopifyEntity,\n transformShopifyProduct,\n transformShopifyCollection,\n transformShopifyArticle,\n transformShopifyEntityToItemData,\n PRODUCT_BY_HANDLE_QUERY,\n COLLECTION_BY_HANDLE_QUERY,\n ARTICLE_BY_HANDLE_QUERY,\n} from './services/shopify';\nexport type {\n ShopifyStorefrontConfig,\n ShopifyProduct,\n ShopifyCollection,\n ShopifyArticle,\n ShopifyImage,\n ShopifyMoneyV2,\n} from './services/shopify';\n\n// Utilities\nexport { cn } from './lib/utils';\nexport { normalizeImageUrl, getResizedImageUrl } from './utils/image-utils';\nexport {\n analyzeBackdrop,\n computeContentBBox,\n buildProbeUrl,\n loadImagePixels,\n loadBackdropAnalysis,\n type BackdropAnalysis,\n type ContentBBox,\n type ImagePixels,\n} from './utils/imageBackdrop';\nexport { stripMarkdown } from './component/componentDefinitions/parse-utils';\n\n// Color utilities\nexport {\n type RGB,\n rgbToHsl,\n hslToRgb,\n ensureMinLightness,\n toRgb,\n deriveDarkColor,\n deriveDarkGradient,\n deriveLightColor,\n} from './color/colorUtils';\n\n// Analytics\nexport {\n pushEvent,\n pushPromptSubmit,\n pushLinkClick,\n pushError,\n pushExit,\n pushEntityFiltered,\n hasAnalyticsConsent,\n type EntityFilteredReason,\n} from './utils/analyticsEvents';\n\n// Error handling types and utilities\nexport {\n type ConversationErrorType,\n ERROR_MARKDOWN,\n getErrorTypeFromStatus,\n createErrorMarkdown,\n STREAMING_TIMEOUT_MS,\n type ErrorActionType,\n type ErrorIconType,\n type ErrorTemplateButton,\n type ErrorTemplate,\n type ErrorTemplateOverrides,\n DEFAULT_ERROR_TEMPLATES,\n resolveErrorTemplate,\n} from './errors';\n\n// Navigation utilities\nexport {\n getForwardStack,\n setForwardStack,\n clearForwardStack,\n pushToForwardStack,\n popFromForwardStack,\n} from './utils/navigationStack';\n\n// UI components\nexport {\n UserQuery,\n type UserQueryProps,\n type ProductBackContext,\n} from './components/ui/UserQuery';\nexport {\n PRODUCT_BACK_SESSION_KEY,\n writeProductBackHandoff,\n readProductBackHandoff,\n type ProductBackHandoff,\n} from './utils/productBackHandoff';\nexport {\n PromptEntryEmptyState,\n type PromptEntryEmptyStateProps,\n} from './components/ui/PromptEntryEmptyState';\nexport {\n SearchSection,\n type SearchSectionProps,\n type SearchSectionHandle,\n type ScrollChip,\n} from './components/ui/SearchSection';\nexport {\n FeedbackBar,\n type FeedbackBarProps,\n type FeedbackCategoryOption,\n type FeedbackSentiment,\n type FeedbackSubmitInput,\n} from './components/ui/FeedbackBar';\nexport {\n Disclaimer,\n type DisclaimerProps,\n} from './components/ui/Disclaimer';\nexport {\n BottomContainer,\n type BottomContainerProps,\n} from './components/ui/BottomContainer';\nexport { MarkdownText } from './components/ui/MarkdownText';\nexport {\n CalloutBlock,\n type CalloutBlockProps,\n} from './components/ui/CalloutBlock';\nexport {\n OptimizedImage,\n type OptimizedImageProps,\n} from './components/ui/OptimizedImage';\nexport {\n SectionSkeleton,\n type SectionSkeletonProps,\n} from './components/ui/SectionSkeleton';\nexport { SmartIcon, type SmartIconProps } from './components/ui/SmartIcon';\nexport { Loader, type LoaderProps } from './components/ui/Loader';\nexport {\n PlacementLoader,\n type PlacementLoaderProps,\n} from './components/ui/PlacementLoader';\nexport {\n UnifiedLink,\n detectLinkType,\n type UnifiedLinkProps,\n LinkType,\n type LinkVariant,\n} from './components/ui/UnifiedLink';\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from './components/ui/table';\n\n// Placement (DL #088, DL #102 behavior declarations)\nexport type {\n PlacementBehaviorConfig,\n PlacementConfig,\n PlacementPrompts,\n} from './types/placement';\n\n// Cross-bundle user-query broadcast event (DL #097 D2)\nexport {\n WEB5_USER_QUERY_EVENT,\n type Web5UserQueryEventDetail,\n type Web5UserQueryEvent,\n} from './types/userQueryEvent';\n\n// Cross-bundle answer-updated broadcast event (B2B-4121)\nexport {\n WEB5_ANSWER_UPDATED_EVENT,\n type Web5AnswerUpdatedEventDetail,\n type Web5AnswerUpdatedEvent,\n} from './types/answerUpdatedEvent';\n\n// Cross-bundle redirect broadcast event (DL #098 D3)\nexport {\n WEB5_REDIRECT_EVENT,\n type Web5RedirectEventDetail,\n type Web5RedirectEvent,\n type Web5RedirectReason,\n} from './types/redirectEvent';\n// `placementFilter` was removed — hero/next-steps exclusion is the prompt's job\n// and placement-specific designs belong as `{ placement: true }` registry\n// variants (resolved automatically via `resolveSection(type, { placement: true })`).\n\n// Client bundle loader (DL #088 D3.3)\nexport { loadClientBundle } from './client/loadClientBundle';\n\n// `?clientBundleUrl=` dev override — shared by `web50-server-ui` and\n// `embed-placement` so the trusted-host gate can't drift between them.\nexport {\n getClientBundleOverride,\n isTrustedBundleHost,\n} from './client/clientBundleOverride';\n\n// Client-UMD URL resolution (DL #094 per-msid, DL #129 per-template) and the\n// universal bundle←backend config merge (DL #129 Q3/Q7) — shared by\n// `web50-server-ui` and `embed-placement`, the two client-bundle load sites.\nexport {\n TEMPLATES_CDN_BASE,\n TEMPLATES_MANIFEST_URL,\n getTemplateOverride,\n isTemplatePickerRequested,\n isValidTemplateId,\n resolveClientBundleUrl,\n} from './client/clientBundleUrl';\nexport { mergeClientConfig, type DeepPartial } from './client/mergeClientConfig';\nexport {\n applyThemeOverrides,\n THEME_OVERRIDE_TOKENS,\n type ThemeOverrideKey,\n type ThemeOverrides,\n} from './client/applyThemeOverrides';\n\n// Placement renderer + DI helper (DL #088 D3.2, D3.4)\nexport {\n PlacementResponseRenderer,\n PlacementSmoothHeight,\n type PlacementResponseRendererProps,\n type PlacementSection,\n type PlacementVariant,\n} from './components/placement/PlacementResponseRenderer';\nexport {\n buildPlacementDependencies,\n type BuildPlacementDependenciesOptions,\n} from './components/placement/buildPlacementDependencies';\nexport {\n PlacementPayloadProvider,\n usePlacementPayload,\n type PlacementPayloadContextValue,\n} from './components/placement/PlacementPayloadContext';\n\n// Markdown parsing utilities — lifted from web50-server-ui (DL #088 B9.1)\nexport {\n UnifiedMarkdownParser,\n parseMarkdownToAst,\n parseAstToMarkdown,\n} from './utils/unifiedMarkdownParser';\nexport {\n escapeWeb5Links,\n fixMalformedLinks,\n trimTrailingWhitespace,\n normalizeIconUrls,\n decodeLinkText,\n preprocessMarkdown,\n type PreprocessorDiagnostic,\n type PreprocessResult,\n} from './utils/markdownPreprocessor';\nexport {\n ComponentTracking,\n type ComponentNodeRange,\n} from './utils/componentTracking';\nexport {\n findKeywordsInContent,\n getContextualImageFilename,\n} from './utils/contentKeywordMatcher';\nexport {\n extractIntentFromMarkdown,\n getIntentFromMarkdown,\n type IntentInfo,\n type IntentExtractionOptions,\n type ResponseState,\n} from './utils/intentExtractor';\nexport type { PageSection } from './types/page-section';\nexport {\n createPageSection,\n generateSectionId,\n generateId,\n findImageInNode,\n findImageInChildren,\n type Product,\n type ComparisonProduct,\n type ProductComparisonSectionProps,\n} from './utils/propsExtractor';\nexport {\n DiagnosticsCollector,\n type DiagnosticEntry,\n} from './utils/diagnosticsCollector';\nexport {\n REFRESH_PROMPTS_UNTIL_KEY,\n REFRESH_PROMPTS_WINDOW_MS,\n getRefreshPromptsExpiry,\n shouldRefreshPrompts,\n enableRefreshPrompts,\n disableRefreshPrompts,\n} from './utils/refreshPrompts';\nexport {\n type BackendEnvironment,\n BACKEND_ENVIRONMENT_KEY,\n BACKEND_ENVIRONMENT_QUERY_PARAM,\n DEFAULT_BACKEND_ENVIRONMENT,\n getBackendEnvironment,\n setBackendEnvironment,\n usesStagingBackend,\n} from './utils/backendEnvironment';\nexport {\n MATCH_DEBUG_KEY,\n MATCH_DEBUG_QUERY_PARAM,\n isMatchDebugEnabled,\n setMatchDebug,\n resetMatchDebugCache,\n logMatchDebug,\n} from './utils/matchDebug';\nexport { createWixAuthFetch } from './client/wixAuthFetch';\nexport {\n getOrCreateSessionId,\n getSessionId,\n getChatId,\n startNewChatId,\n setChatId,\n resetChatIdForTests,\n} from './utils/sessionManager';\n\n// Component parser orchestrator — lifted from web50-server-ui (DL #088 B9.5)\nexport {\n parseMarkdownToComponents,\n tryParseComponent,\n mergeSectionsWithStableReferences,\n type ParseMarkdownOptions,\n type ParseMarkdownResult,\n type ComponentMatch,\n type ParserContext,\n} from './component/componentParser';\nexport type {\n ParserClientConfig,\n EnrichEntityProps,\n} from './component/parser-types';\n\n// Host-mount scope contract — shared by web50-server-ui (which stamps the\n// class and mounts), embed-placement (which mounts the same bundle elsewhere),\n// and the client CDN build (which compiles every selector against it).\nexport {\n WEB5_ROOT_ID,\n WEB5_ROOT_CLASS,\n WEB5_SCOPES,\n WEB5_SCOPE,\n WEB5_GLOBAL_TOKENS,\n type HostFitConfig,\n} from './hostScope';\n"],"mappings":"AAAA;AACA,SAASA,UAAU,EAAEC,cAAc,QAAQ,WAAW;AAEtD,SAGEC,yBAAyB,EACzBC,qBAAqB,EACrBC,iBAAiB,EACjBC,gBAAgB,QACX,uCAAuC;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e,EACfC,uBAAuB,EACvBC,mBAAmB,EACnBC,aAAa,EACbC,oBAAoB,EACpBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SACEC,oBAAoB,EACpBC,YAAY,EACZC,SAAS,EACTC,cAAc,EACdC,SAAS,EACTC,mBAAmB,QACd,wBAAwB;;AAE/B;AACA,SACEC,yBAAyB,EACzBC,iBAAiB,EACjBC,iCAAiC,QAK5B,6BAA6B;AAMpC;AACA;AACA;AACA,SACEC,YAAY,EACZC,eAAe,EACfC,WAAW,EACXC,UAAU,EACVC,kBAAkB,QAEb,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["CLIENT_IDS","EXPERIMENT_IDS","createFeatureToggleReader","FeatureToggleProvider","useFeatureToggles","useFeatureToggle","getPartsByType","getPartByRole","getAllByRole","getHeading","getImages","getLinks","extractContent","extractContentMarkdown","deriveRole","DROP_SECTION","DIAGNOSTIC_TYPES","buildImageSearchFilter","ImageSearchFilterToken","backgroundFilter","HeroSectionDefinition","HeroEntitySectionDefinition","KpiSectionDefinition","FeatureCardsSectionDefinition","EntitySectionDefinition","EntityCollectionSectionDefinition","ComparisonSectionDefinition","TextBlockSectionDefinition","CtaBannerSectionDefinition","CalloutSectionDefinition","NextStepsSectionDefinition","FeatureSection9PlusDefinition","ListItemsSectionDefinition","SkipNodesSectionDefinition","HtmlCommentSectionDefinition","SearchSectionDefinition","ErrorSectionDefinition","FallbackSectionDefinition","createSdkRegistry","ComponentRegistry","validatePattern","validatePatternSyntax","validatePatternWithBlocks","convertToBlockElements","convertToBlockElementsWithMapping","Web5UrlType","isWeb5AskUrl","isWeb5EntityUrl","isWeb5ImageUrl","isWeb5IconUrl","isWeb5ActionUrl","isWeb5SearchUrl","isWeb5Url","isNavigableUrl","isValidLinkUrl","isLegacyUrl","parseWeb5Url","isValidWeb5Url","validateLinkUrl","isEntityLink","parseEntityLink","extractProtocol","extractLinkMetadata","findInvalidWeb5Links","hasImage","isHtmlComment","matchMarkdown","matchAllSections","nodesToParts","ComponentDependenciesProvider","useComponentDependencies","UserQueryProvider","useUserQuery","ChipsProvider","useChips","defaultExtractor","enrichEntitiesFromPayload","fetchEntityListData","listEntityItems","LIST_ITEMS_ENDPOINT","getEntityExtractor","registerEntityExtractor","transformToSolutionEntityData","transformToBlogPostEntityData","transformToGenericEntityData","CALLOUT_KINDS","useWeb5Link","useConversation","useDebugImageContext","useResolvedImageSources","useResolveGenericEntityData","useEntityTransforms","useMarkdownUtils","useResolveShopifyEntityData","useResolveSearchSpringEntityData","fetchProductsByHandles","fetchProductsByHandlesMap","transformSSProductToEntityItemData","addToCart","ShopifyStorefrontClient","resolveShopifyConfig","resolveShopifyEntity","transformShopifyProduct","transformShopifyCollection","transformShopifyArticle","transformShopifyEntityToItemData","PRODUCT_BY_HANDLE_QUERY","COLLECTION_BY_HANDLE_QUERY","ARTICLE_BY_HANDLE_QUERY","cn","normalizeImageUrl","getResizedImageUrl","analyzeBackdrop","computeContentBBox","buildProbeUrl","loadImagePixels","loadBackdropAnalysis","stripMarkdown","rgbToHsl","hslToRgb","ensureMinLightness","toRgb","deriveDarkColor","deriveDarkGradient","deriveLightColor","pushEvent","pushPromptSubmit","pushLinkClick","pushError","pushExit","pushEntityFiltered","hasAnalyticsConsent","ERROR_MARKDOWN","getErrorTypeFromStatus","createErrorMarkdown","STREAMING_TIMEOUT_MS","DEFAULT_ERROR_TEMPLATES","resolveErrorTemplate","getForwardStack","setForwardStack","clearForwardStack","pushToForwardStack","popFromForwardStack","UserQuery","PRODUCT_BACK_SESSION_KEY","writeProductBackHandoff","readProductBackHandoff","PromptEntryEmptyState","SearchSection","FeedbackBar","Disclaimer","BottomContainer","MarkdownText","CalloutBlock","OptimizedImage","SectionSkeleton","SmartIcon","Loader","PlacementLoader","UnifiedLink","detectLinkType","LinkType","Table","TableHeader","TableBody","TableFooter","TableHead","TableRow","TableCell","TableCaption","WEB5_USER_QUERY_EVENT","WEB5_ANSWER_UPDATED_EVENT","WEB5_REDIRECT_EVENT","loadClientBundle","getClientBundleOverride","isTrustedBundleHost","TEMPLATES_CDN_BASE","TEMPLATES_MANIFEST_URL","getTemplateOverride","isTemplatePickerRequested","isValidTemplateId","resolveClientBundleUrl","mergeClientConfig","applyThemeOverrides","THEME_OVERRIDE_TOKENS","PlacementResponseRenderer","PlacementSmoothHeight","buildPlacementDependencies","PlacementPayloadProvider","usePlacementPayload","UnifiedMarkdownParser","parseMarkdownToAst","parseAstToMarkdown","escapeWeb5Links","fixMalformedLinks","trimTrailingWhitespace","normalizeIconUrls","decodeLinkText","preprocessMarkdown","ComponentTracking","findKeywordsInContent","getContextualImageFilename","extractIntentFromMarkdown","getIntentFromMarkdown","createPageSection","generateSectionId","generateId","findImageInNode","findImageInChildren","DiagnosticsCollector","REFRESH_PROMPTS_UNTIL_KEY","REFRESH_PROMPTS_WINDOW_MS","getRefreshPromptsExpiry","shouldRefreshPrompts","enableRefreshPrompts","disableRefreshPrompts","BACKEND_ENVIRONMENT_KEY","BACKEND_ENVIRONMENT_QUERY_PARAM","DEFAULT_BACKEND_ENVIRONMENT","getBackendEnvironment","setBackendEnvironment","usesStagingBackend","MATCH_DEBUG_KEY","MATCH_DEBUG_QUERY_PARAM","isMatchDebugEnabled","setMatchDebug","resetMatchDebugCache","logMatchDebug","createWixAuthFetch","getOrCreateSessionId","getSessionId","getChatId","startNewChatId","setChatId","resetChatIdForTests","parseMarkdownToComponents","tryParseComponent","mergeSectionsWithStableReferences","WEB5_ROOT_ID","WEB5_ROOT_CLASS","WEB5_SCOPES","WEB5_SCOPE","WEB5_GLOBAL_TOKENS"],"sources":["../../src/index.ts"],"sourcesContent":["// Client IDs and experiment IDs\nexport { CLIENT_IDS, EXPERIMENT_IDS } from './clients';\n\nexport {\n type EmbedFeatureToggleResult,\n type FeatureToggleReader,\n createFeatureToggleReader,\n FeatureToggleProvider,\n useFeatureToggles,\n useFeatureToggle,\n} from './featureToggles/FeatureToggleContext';\n\n// Dev-only chrome injection contract for client packages\nexport type { DevEnvironment } from './client/devEnvironment';\n\n// Part types and helpers\nexport {\n type PartType,\n type Part,\n type HeadingPart,\n type ImagePart,\n type LinkPart,\n type ListPart,\n type ListItemPart,\n type KpiItemPart,\n type CardPart,\n type IconPart,\n type CalloutPart,\n type EntityPart,\n getPartsByType,\n getPartByRole,\n getAllByRole,\n getHeading,\n getImages,\n getLinks,\n extractContent,\n extractContentMarkdown,\n deriveRole,\n} from './parts/parts';\n\n// Component types\nexport type {\n BaseCompProps,\n SlotCompProps,\n SectionCompProps,\n SectionCompPropsWithSlot,\n TextCompProps,\n ButtonCompProps,\n ImageCompProps,\n BadgeCompProps,\n HeroButton,\n KpiItemCompProps,\n FeatureItemCompProps,\n FeatureCardCompProps,\n EntityItemData,\n EntityItem,\n GenericEntityData,\n GenericEntityCompProps,\n ComparisonRow,\n ComparisonColumn,\n AiNarrativeCompProps,\n HeroCompProps,\n HeroEntityCompProps,\n KpiCompProps,\n FeatureCardsCompProps,\n EntityCompProps,\n ComparisonCompProps,\n TextBlockCompProps,\n Component,\n BaseComponent,\n SlotComponent,\n SectionComponent,\n TextComponent,\n ButtonComponent,\n ImageComponent,\n BadgeComponent,\n KpiItemComponent,\n FeatureItemComponent,\n FeatureCardComponent,\n GenericEntityComponent,\n AiNarrativeComponent,\n ComparisonSectionComponent,\n TextBlockSectionComponent,\n HeroSectionComponent,\n HeroEntitySectionComponent,\n KpiSectionComponent,\n FeatureCardsSectionComponent,\n EntitySectionComponent,\n PropsOf,\n SectionFixture,\n CtaBannerCompProps,\n CtaBannerSectionComponent,\n CalloutCompProps,\n CalloutSectionComponent,\n NextStepsCompProps,\n NextStepsSectionComponent,\n FeatureSection9PlusCompProps,\n FeatureSection9PlusSectionComponent,\n ListItemsSectionCompProps,\n ListItemsSectionComponent,\n ErrorCompProps,\n ErrorSectionComponent,\n NullCompProps,\n NullSectionComponent,\n SolutionEntityCompProps,\n SolutionEntitySectionComponent,\n SolutionEntityData,\n BlogEntityCompProps,\n BlogEntitySectionComponent,\n BlogEntityData,\n GeneralTextCompProps,\n GeneralTextSectionComponent,\n PersonalizedNarrativeCompProps,\n PersonalizedNarrativeSectionComponent,\n} from './component/types';\n\n// Section definition\nexport type {\n SectionDefinition,\n ParseContext,\n ContextualImageResult,\n DropSection,\n} from './component/section-definition';\nexport { DROP_SECTION } from './component/section-definition';\n\n// Diagnostic types\nexport { DIAGNOSTIC_TYPES } from './component/diagnosticTypes';\nexport type { DiagnosticType } from './component/diagnosticTypes';\n\n// Image search filters\nexport {\n buildImageSearchFilter,\n type ImageSearchFilterString,\n} from './image/imageSearchFilterTypes';\nexport {\n ImageSearchFilterToken,\n backgroundFilter,\n} from './image/imageSearchFilters';\nexport type {\n ContextualImageAsset,\n ImageSourceInput,\n ResolvedImageSource,\n ResolvedImageSourceKind,\n} from './image/contextualImageTypes';\n\n// Section definition classes + createSdkRegistry\nexport {\n HeroSectionDefinition,\n HeroEntitySectionDefinition,\n KpiSectionDefinition,\n FeatureCardsSectionDefinition,\n EntitySectionDefinition,\n EntityCollectionSectionDefinition,\n ComparisonSectionDefinition,\n TextBlockSectionDefinition,\n CtaBannerSectionDefinition,\n CalloutSectionDefinition,\n NextStepsSectionDefinition,\n FeatureSection9PlusDefinition,\n ListItemsSectionDefinition,\n SkipNodesSectionDefinition,\n HtmlCommentSectionDefinition,\n SearchSectionDefinition,\n ErrorSectionDefinition,\n FallbackSectionDefinition,\n createSdkRegistry,\n} from './component/componentDefinitions';\n\n// Registry\nexport { ComponentRegistry } from './registry';\nexport type {\n SlotOptions,\n SectionOptions,\n SectionRegistration,\n SlotNode,\n SlotIntentNode,\n SectionIntentNode,\n SectionNode,\n SlotVariant,\n SectionVariant,\n RegistryCatalog,\n ActionResult,\n ActionHandler,\n} from './registry';\n\n// Pattern validator\nexport {\n validatePattern,\n validatePatternSyntax,\n validatePatternWithBlocks,\n type PatternValidationResult,\n type BlockElement,\n type EnrichedBlockElement,\n type LinkMetadata,\n type LinkAttribute,\n} from './patternValidator';\n\n// Markdown blocks\nexport {\n convertToBlockElements,\n convertToBlockElementsWithMapping,\n type BlockElementsWithMapping,\n} from './markdownBlocks';\n\n// Link types, enum & guards\nexport {\n Web5UrlType,\n type Web5AskUrl,\n type Web5EntityUrl,\n type Web5ImageUrl,\n type Web5IconUrl,\n type Web5ActionUrl,\n type Web5SearchUrl,\n type Web5Url,\n type HttpsUrl,\n type HttpUrl,\n type MailtoUrl,\n type RelativeUrl,\n type NavigableUrl,\n type ValidLinkUrl,\n type AnyKnownUrl,\n type LegacyUrl,\n isWeb5AskUrl,\n isWeb5EntityUrl,\n isWeb5ImageUrl,\n isWeb5IconUrl,\n isWeb5ActionUrl,\n isWeb5SearchUrl,\n isWeb5Url,\n isNavigableUrl,\n isValidLinkUrl,\n isLegacyUrl,\n} from './types/link-types';\n\n// Entity/URL parsing\nexport {\n parseWeb5Url,\n isValidWeb5Url,\n validateLinkUrl,\n type Web5UrlParsed,\n type Web5AskParsed,\n type Web5EntityParsed,\n type Web5ImageParsed,\n type Web5IconParsed,\n type Web5ActionParsed,\n type Web5SearchParsed,\n isEntityLink,\n parseEntityLink,\n extractProtocol,\n extractLinkMetadata,\n} from './utils/entityLinkParser';\n\n// Web5 link validation\nexport {\n findInvalidWeb5Links,\n type InvalidWeb5Link,\n} from './utils/web5LinkValidator';\n\n// Node matchers\nexport { hasImage, isHtmlComment } from './utils/nodeMatchers';\n\n// Match API\nexport {\n matchMarkdown,\n type MarkdownMatchResult,\n matchAllSections,\n type MatchAllSectionsResult,\n nodesToParts,\n} from './match';\n\n// ---------------------------------------------------------------------------\n// DI Infrastructure (moved from @wix/w5-client-circana)\n// ---------------------------------------------------------------------------\n\n// DI context and provider\nexport {\n ComponentDependenciesProvider,\n useComponentDependencies,\n type ComponentDependenciesProviderProps,\n} from './context/ComponentDependenciesContext';\n\n// Raw user query for the current response page\nexport {\n UserQueryProvider,\n useUserQuery,\n type UserQueryProviderProps,\n} from './context/UserQueryContext';\n\n// Chips context (suggestion chips shared between SearchSection and error states)\nexport {\n ChipsProvider,\n useChips,\n type SuggestionChip,\n} from './context/ChipsContext';\n\n// DI types\nexport type {\n ComponentDependencies,\n Web5LinkApi,\n ConversationApi,\n SendMessageTrackingOptions,\n SendMessageOptions,\n ComparisonSubmitPayload,\n ComparisonSelectedProduct,\n ProductComparisonSelectionState,\n ProductComparisonApi,\n EntityTransforms,\n MarkdownUtils,\n ResolveGenericEntityDataOptions,\n} from './types/dependencies';\nexport type {\n ApiPayloadItem,\n EntityTypeConfig,\n EntityConfig,\n EntityExtractionContext,\n} from './types/entity';\nexport {\n defaultExtractor,\n enrichEntitiesFromPayload,\n fetchEntityListData,\n listEntityItems,\n LIST_ITEMS_ENDPOINT,\n getEntityExtractor,\n registerEntityExtractor,\n transformToSolutionEntityData,\n transformToBlogPostEntityData,\n transformToGenericEntityData,\n} from './entity';\nexport type {\n EntityExtractor,\n FetchEntityListDataOptions,\n ListEntityItemsOptions,\n} from './entity';\nexport { CALLOUT_KINDS, type CalloutKind, type Callout } from './types/callout';\n\n// Wrapper hooks\nexport { useWeb5Link } from './hooks/useWeb5Link';\nexport { useConversation } from './hooks/useConversation';\nexport { useDebugImageContext } from './hooks/useDebugImageContext';\nexport { useResolvedImageSources } from './hooks/useResolvedImageSources';\nexport { useResolveGenericEntityData } from './hooks/useResolveGenericEntityData';\nexport { useEntityTransforms } from './hooks/useEntityTransforms';\nexport { useMarkdownUtils } from './hooks/useMarkdownUtils';\nexport { useResolveShopifyEntityData } from './hooks/useResolveShopifyEntityData';\nexport { useResolveSearchSpringEntityData } from './hooks/useResolveSearchSpringEntityData';\n\n// SearchSpring\nexport {\n fetchProductsByHandles,\n fetchProductsByHandlesMap,\n transformSSProductToEntityItemData,\n} from './services/searchspring';\nexport type {\n SearchSpringConfig,\n SSProduct,\n SSSearchResponse,\n SSSizeData,\n} from './services/searchspring';\n\n// Shopify Storefront API\n// Cart actions\nexport { addToCart } from './services/cart';\n\nexport {\n ShopifyStorefrontClient,\n resolveShopifyConfig,\n resolveShopifyEntity,\n transformShopifyProduct,\n transformShopifyCollection,\n transformShopifyArticle,\n transformShopifyEntityToItemData,\n PRODUCT_BY_HANDLE_QUERY,\n COLLECTION_BY_HANDLE_QUERY,\n ARTICLE_BY_HANDLE_QUERY,\n} from './services/shopify';\nexport type {\n ShopifyStorefrontConfig,\n ShopifyProduct,\n ShopifyCollection,\n ShopifyArticle,\n ShopifyImage,\n ShopifyMoneyV2,\n} from './services/shopify';\n\n// Utilities\nexport { cn } from './lib/utils';\nexport { normalizeImageUrl, getResizedImageUrl } from './utils/image-utils';\nexport {\n analyzeBackdrop,\n computeContentBBox,\n buildProbeUrl,\n loadImagePixels,\n loadBackdropAnalysis,\n type BackdropAnalysis,\n type ContentBBox,\n type ImagePixels,\n} from './utils/imageBackdrop';\nexport { stripMarkdown } from './component/componentDefinitions/parse-utils';\n\n// Color utilities\nexport {\n type RGB,\n rgbToHsl,\n hslToRgb,\n ensureMinLightness,\n toRgb,\n deriveDarkColor,\n deriveDarkGradient,\n deriveLightColor,\n} from './color/colorUtils';\n\n// Analytics\nexport {\n pushEvent,\n pushPromptSubmit,\n pushLinkClick,\n pushError,\n pushExit,\n pushEntityFiltered,\n hasAnalyticsConsent,\n type EntityFilteredReason,\n} from './utils/analyticsEvents';\n\n// Error handling types and utilities\nexport {\n type ConversationErrorType,\n ERROR_MARKDOWN,\n getErrorTypeFromStatus,\n createErrorMarkdown,\n STREAMING_TIMEOUT_MS,\n type ErrorActionType,\n type ErrorIconType,\n type ErrorTemplateButton,\n type ErrorTemplate,\n type ErrorTemplateOverrides,\n DEFAULT_ERROR_TEMPLATES,\n resolveErrorTemplate,\n} from './errors';\n\n// Navigation utilities\nexport {\n getForwardStack,\n setForwardStack,\n clearForwardStack,\n pushToForwardStack,\n popFromForwardStack,\n} from './utils/navigationStack';\n\n// UI components\nexport {\n UserQuery,\n type UserQueryProps,\n type ProductBackContext,\n} from './components/ui/UserQuery';\nexport {\n PRODUCT_BACK_SESSION_KEY,\n writeProductBackHandoff,\n readProductBackHandoff,\n type ProductBackHandoff,\n} from './utils/productBackHandoff';\nexport {\n PromptEntryEmptyState,\n type PromptEntryEmptyStateProps,\n} from './components/ui/PromptEntryEmptyState';\nexport {\n SearchSection,\n type SearchSectionProps,\n type SearchSectionHandle,\n type ScrollChip,\n} from './components/ui/SearchSection';\nexport {\n FeedbackBar,\n type FeedbackBarProps,\n type FeedbackCategoryOption,\n type FeedbackSentiment,\n type FeedbackSubmitInput,\n} from './components/ui/FeedbackBar';\nexport {\n Disclaimer,\n type DisclaimerProps,\n} from './components/ui/Disclaimer';\nexport {\n BottomContainer,\n type BottomContainerProps,\n} from './components/ui/BottomContainer';\nexport { MarkdownText } from './components/ui/MarkdownText';\nexport {\n CalloutBlock,\n type CalloutBlockProps,\n} from './components/ui/CalloutBlock';\nexport {\n OptimizedImage,\n type OptimizedImageProps,\n} from './components/ui/OptimizedImage';\nexport {\n SectionSkeleton,\n type SectionSkeletonProps,\n} from './components/ui/SectionSkeleton';\nexport { SmartIcon, type SmartIconProps } from './components/ui/SmartIcon';\nexport { Loader, type LoaderProps } from './components/ui/Loader';\nexport {\n PlacementLoader,\n type PlacementLoaderProps,\n} from './components/ui/PlacementLoader';\nexport {\n UnifiedLink,\n detectLinkType,\n type UnifiedLinkProps,\n LinkType,\n type LinkVariant,\n} from './components/ui/UnifiedLink';\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from './components/ui/table';\n\n// Placement (DL #088, DL #102 behavior declarations)\nexport type {\n PlacementBehaviorConfig,\n PlacementConfig,\n PlacementPrompts,\n} from './types/placement';\n\n// Cross-bundle user-query broadcast event (DL #097 D2)\nexport {\n WEB5_USER_QUERY_EVENT,\n type Web5UserQueryEventDetail,\n type Web5UserQueryEvent,\n} from './types/userQueryEvent';\n\n// Cross-bundle answer-updated broadcast event (B2B-4121)\nexport {\n WEB5_ANSWER_UPDATED_EVENT,\n type Web5AnswerUpdatedEventDetail,\n type Web5AnswerUpdatedEvent,\n} from './types/answerUpdatedEvent';\n\n// Cross-bundle redirect broadcast event (DL #098 D3)\nexport {\n WEB5_REDIRECT_EVENT,\n type Web5RedirectEventDetail,\n type Web5RedirectEvent,\n type Web5RedirectReason,\n} from './types/redirectEvent';\n// `placementFilter` was removed — hero/next-steps exclusion is the prompt's job\n// and placement-specific designs belong as `{ placement: true }` registry\n// variants (resolved automatically via `resolveSection(type, { placement: true })`).\n\n// Client bundle loader (DL #088 D3.3)\nexport { loadClientBundle } from './client/loadClientBundle';\n\n// `?clientBundleUrl=` dev override — shared by `web50-server-ui` and\n// `embed-placement` so the trusted-host gate can't drift between them.\nexport {\n getClientBundleOverride,\n isTrustedBundleHost,\n} from './client/clientBundleOverride';\n\n// Client-UMD URL resolution (DL #094 per-msid, DL #129 per-template) and the\n// universal bundle←backend config merge (DL #129 Q3/Q7) — shared by\n// `web50-server-ui` and `embed-placement`, the two client-bundle load sites.\nexport {\n TEMPLATES_CDN_BASE,\n TEMPLATES_MANIFEST_URL,\n getTemplateOverride,\n isTemplatePickerRequested,\n isValidTemplateId,\n resolveClientBundleUrl,\n} from './client/clientBundleUrl';\nexport { mergeClientConfig, type DeepPartial } from './client/mergeClientConfig';\nexport {\n applyThemeOverrides,\n THEME_OVERRIDE_TOKENS,\n type ThemeOverrideKey,\n type ThemeOverrides,\n} from './client/applyThemeOverrides';\n\n// Placement renderer + DI helper (DL #088 D3.2, D3.4)\nexport {\n PlacementResponseRenderer,\n PlacementSmoothHeight,\n type PlacementResponseRendererProps,\n type PlacementSection,\n type PlacementVariant,\n} from './components/placement/PlacementResponseRenderer';\nexport {\n buildPlacementDependencies,\n type BuildPlacementDependenciesOptions,\n} from './components/placement/buildPlacementDependencies';\nexport {\n PlacementPayloadProvider,\n usePlacementPayload,\n type PlacementPayloadContextValue,\n} from './components/placement/PlacementPayloadContext';\n\n// Markdown parsing utilities — lifted from web50-server-ui (DL #088 B9.1)\nexport {\n UnifiedMarkdownParser,\n parseMarkdownToAst,\n parseAstToMarkdown,\n} from './utils/unifiedMarkdownParser';\nexport {\n escapeWeb5Links,\n fixMalformedLinks,\n trimTrailingWhitespace,\n normalizeIconUrls,\n decodeLinkText,\n preprocessMarkdown,\n type PreprocessorDiagnostic,\n type PreprocessResult,\n} from './utils/markdownPreprocessor';\nexport {\n ComponentTracking,\n type ComponentNodeRange,\n} from './utils/componentTracking';\nexport {\n findKeywordsInContent,\n getContextualImageFilename,\n} from './utils/contentKeywordMatcher';\nexport {\n extractIntentFromMarkdown,\n getIntentFromMarkdown,\n type IntentInfo,\n type IntentExtractionOptions,\n type ResponseState,\n} from './utils/intentExtractor';\nexport type { PageSection } from './types/page-section';\nexport {\n createPageSection,\n generateSectionId,\n generateId,\n findImageInNode,\n findImageInChildren,\n type Product,\n type ComparisonProduct,\n type ProductComparisonSectionProps,\n} from './utils/propsExtractor';\nexport {\n DiagnosticsCollector,\n type DiagnosticEntry,\n} from './utils/diagnosticsCollector';\nexport {\n REFRESH_PROMPTS_UNTIL_KEY,\n REFRESH_PROMPTS_WINDOW_MS,\n getRefreshPromptsExpiry,\n shouldRefreshPrompts,\n enableRefreshPrompts,\n disableRefreshPrompts,\n} from './utils/refreshPrompts';\nexport {\n type BackendEnvironment,\n BACKEND_ENVIRONMENT_KEY,\n BACKEND_ENVIRONMENT_QUERY_PARAM,\n DEFAULT_BACKEND_ENVIRONMENT,\n getBackendEnvironment,\n setBackendEnvironment,\n usesStagingBackend,\n} from './utils/backendEnvironment';\nexport {\n MATCH_DEBUG_KEY,\n MATCH_DEBUG_QUERY_PARAM,\n isMatchDebugEnabled,\n setMatchDebug,\n resetMatchDebugCache,\n logMatchDebug,\n} from './utils/matchDebug';\nexport { createWixAuthFetch } from './client/wixAuthFetch';\nexport {\n getOrCreateSessionId,\n getSessionId,\n getChatId,\n startNewChatId,\n setChatId,\n resetChatIdForTests,\n} from './utils/sessionManager';\n\n// Component parser orchestrator — lifted from web50-server-ui (DL #088 B9.5)\nexport {\n parseMarkdownToComponents,\n tryParseComponent,\n mergeSectionsWithStableReferences,\n type ParseMarkdownOptions,\n type ParseMarkdownResult,\n type ComponentMatch,\n type ParserContext,\n} from './component/componentParser';\nexport type {\n ParserClientConfig,\n EnrichEntityProps,\n} from './component/parser-types';\n\n// Host-mount scope contract — shared by web50-server-ui (which stamps the\n// class and mounts), embed-placement (which mounts the same bundle elsewhere),\n// and the client CDN build (which compiles every selector against it).\nexport {\n WEB5_ROOT_ID,\n WEB5_ROOT_CLASS,\n WEB5_SCOPES,\n WEB5_SCOPE,\n WEB5_GLOBAL_TOKENS,\n type HostFitConfig,\n} from './hostScope';\n"],"mappings":"AAAA;AACA,SAASA,UAAU,EAAEC,cAAc,QAAQ,WAAW;AAEtD,SAGEC,yBAAyB,EACzBC,qBAAqB,EACrBC,iBAAiB,EACjBC,gBAAgB,QACX,uCAAuC;;AAE9C;;AAGA;AACA,SAaEC,cAAc,EACdC,aAAa,EACbC,YAAY,EACZC,UAAU,EACVC,SAAS,EACTC,QAAQ,EACRC,cAAc,EACdC,sBAAsB,EACtBC,UAAU,QACL,eAAe;;AAEtB;;AA4EA;;AAOA,SAASC,YAAY,QAAQ,gCAAgC;;AAE7D;AACA,SAASC,gBAAgB,QAAQ,6BAA6B;AAG9D;AACA,SACEC,sBAAsB,QAEjB,gCAAgC;AACvC,SACEC,sBAAsB,EACtBC,gBAAgB,QACX,4BAA4B;AAQnC;AACA,SACEC,qBAAqB,EACrBC,2BAA2B,EAC3BC,oBAAoB,EACpBC,6BAA6B,EAC7BC,uBAAuB,EACvBC,iCAAiC,EACjCC,2BAA2B,EAC3BC,0BAA0B,EAC1BC,0BAA0B,EAC1BC,wBAAwB,EACxBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,0BAA0B,EAC1BC,4BAA4B,EAC5BC,uBAAuB,EACvBC,sBAAsB,EACtBC,yBAAyB,EACzBC,iBAAiB,QACZ,kCAAkC;;AAEzC;A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iBAAiB,EACjBC,sBAAsB,EACtBC,iBAAiB,EACjBC,cAAc,EACdC,kBAAkB,QAGb,8BAA8B;AACrC,SACEC,iBAAiB,QAEZ,2BAA2B;AAClC,SACEC,qBAAqB,EACrBC,0BAA0B,QACrB,+BAA+B;AACtC,SACEC,yBAAyB,EACzBC,qBAAqB,QAIhB,yBAAyB;AAEhC,SACEC,iBAAiB,EACjBC,iBAAiB,EACjBC,UAAU,EACVC,eAAe,EACfC,mBAAmB,QAId,wBAAwB;AAC/B,SACEC,oBAAoB,QAEf,8BAA8B;AACrC,SACEC,yBAAyB,EACzBC,yBAAyB,EACzBC,uBAAuB,EACvBC,oBAAoB,EACpBC,oBAAoB,EACpBC,qBAAqB,QAChB,wBAAwB;AAC/B,SAEEC,uBAAuB,EACvBC,+BAA+B,EAC/BC,2BAA2B,EAC3BC,qBAAqB,EACrBC,qBAAqB,EACrBC,kBAAkB,QACb,4BAA4B;AACnC,SACEC,eAAe,EACfC,uBAAuB,EACvBC,mBAAmB,EACnBC,aAAa,EACbC,oBAAoB,EACpBC,aAAa,QACR,oBAAoB;AAC3B,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SACEC,oBAAoB,EACpBC,YAAY,EACZC,SAAS,EACTC,cAAc,EACdC,SAAS,EACTC,mBAAmB,QACd,wBAAwB;;AAE/B;AACA,SACEC,yBAAyB,EACzBC,iBAAiB,EACjBC,iCAAiC,QAK5B,6BAA6B;AAMpC;AACA;AACA;AACA,SACEC,YAAY,EACZC,eAAe,EACfC,WAAW,EACXC,UAAU,EACVC,kBAAkB,QAEb,aAAa","ignoreList":[]}
@@ -70,6 +70,148 @@ export function recoverOrphanedEmphasisLinks(markdown) {
70
70
  };
71
71
  }
72
72
 
73
+ /**
74
+ * A `web5://` link target whose opening `[` never arrived, e.g.
75
+ * `try filtering for men](web5://ask/Which+are+for+men%3F)`.
76
+ *
77
+ * Dropping the opening bracket is the most common way an inline ask link is
78
+ * mis-emitted, and it is the worst one: remark parses nothing as a link, so the
79
+ * scheme renders as literal text and the visitor reads `web5://ask/...`.
80
+ *
81
+ * `run` is the text before the `]` on the same line, which is what the label
82
+ * should have been. It may be empty, in which case there is nothing to promote
83
+ * and the construct is dropped instead.
84
+ */
85
+ const ORPHANED_WEB5_TARGET = /([^[\]()*\n]{0,80}?)\]\((web5:\/\/[^)\s]*)\)/g;
86
+
87
+ /** Any `web5://` url, for the final check that none is visible as text. */
88
+ const ANY_WEB5_URL = /web5:\/\/[^\s)\]]*/g;
89
+
90
+ /** Longest label we will promote out of surrounding prose. */
91
+ const MAX_RECOVERED_LABEL_WORDS = 4;
92
+
93
+ /**
94
+ * Words a label should start *after* rather than with. The label is cut at the
95
+ * last of these inside the window, so a promoted phrase reads as a noun phrase
96
+ * ("sensitive skin") instead of trailing off a verb or preposition
97
+ * ("carry for sensitive skin").
98
+ */
99
+ const LABEL_BOUNDARY_WORDS = new Set(['a', 'an', 'and', 'at', 'but', 'by', 'for', 'from', 'in', 'into', 'of', 'on', 'or', 'the', 'to', 'with']);
100
+
101
+ /**
102
+ * True when `segment` holds a `[` that is still waiting to be closed — meaning
103
+ * the `](` after it closes a real link and there is nothing to repair.
104
+ */
105
+ function hasOpenLinkBracket(segment) {
106
+ return segment.lastIndexOf('[') > segment.lastIndexOf(']');
107
+ }
108
+
109
+ /**
110
+ * Split `run` into the prose to leave in place and the phrase to promote into
111
+ * the link label. Slices on token offsets rather than rejoining words, so the
112
+ * original spacing around the label is preserved exactly.
113
+ *
114
+ * An empty label means there is nothing worth promoting and the caller should
115
+ * drop the link instead.
116
+ */
117
+ function splitRecoveredLabel(run) {
118
+ // Never let the label cross a sentence boundary.
119
+ let sentenceStart = 0;
120
+ for (const boundary of run.matchAll(/(?<=[.!?;:])\s+/g)) {
121
+ sentenceStart = (boundary.index ?? 0) + boundary[0].length;
122
+ }
123
+ const tokens = [...run.slice(sentenceStart).matchAll(/\S+/g)].map(token => ({
124
+ word: token[0],
125
+ start: sentenceStart + (token.index ?? 0)
126
+ }));
127
+ let window = tokens.slice(-MAX_RECOVERED_LABEL_WORDS);
128
+ for (let i = window.length - 1; i >= 0; i--) {
129
+ const bare = window[i].word.toLowerCase().replace(/[^a-z]/g, '');
130
+ if (LABEL_BOUNDARY_WORDS.has(bare)) {
131
+ window = window.slice(i + 1);
132
+ break;
133
+ }
134
+ }
135
+ if (window.length === 0) {
136
+ return {
137
+ prefix: run,
138
+ label: ''
139
+ };
140
+ }
141
+ return {
142
+ prefix: run.slice(0, window[0].start),
143
+ label: run.slice(window[0].start).trim()
144
+ };
145
+ }
146
+
147
+ /**
148
+ * Repair `web5://` links that lost their opening `[`.
149
+ *
150
+ * Recovers the link by promoting the words immediately before the `]` into its
151
+ * label; when there are no words to promote, drops the whole construct. Either
152
+ * way the scheme stops being visible, which is the point — a link the visitor
153
+ * cannot use is a smaller failure than a url the visitor can read.
154
+ */
155
+ export function repairOrphanedWeb5Links(markdown) {
156
+ const diagnostics = [];
157
+ const result = markdown.replace(ORPHANED_WEB5_TARGET, (match, run, href, offset, whole) => {
158
+ const lineStart = whole.lastIndexOf('\n', offset) + 1;
159
+ if (hasOpenLinkBracket(whole.slice(lineStart, offset))) {
160
+ // A real `[label](url)` — the bracket is there, leave it alone.
161
+ return match;
162
+ }
163
+ const {
164
+ prefix,
165
+ label
166
+ } = splitRecoveredLabel(run);
167
+ if (!label) {
168
+ diagnostics.push({
169
+ type: 'orphaned_web5_link_dropped',
170
+ original: match,
171
+ normalized: run
172
+ });
173
+ return run;
174
+ }
175
+ const normalized = `${prefix}[${label}](${href})`;
176
+ diagnostics.push({
177
+ type: 'orphaned_web5_link_recovered',
178
+ original: match,
179
+ normalized
180
+ });
181
+ return normalized;
182
+ });
183
+ return {
184
+ result,
185
+ diagnostics
186
+ };
187
+ }
188
+
189
+ /**
190
+ * Last resort: remove any `web5://` url still sitting in visible text.
191
+ *
192
+ * Runs after every recovery step, so anything left here is a url no repair
193
+ * could turn back into a link. A url in a link target (`](web5://...)`) is
194
+ * left alone — only text the visitor would actually read is scrubbed.
195
+ */
196
+ export function scrubVisibleWeb5Urls(markdown) {
197
+ const diagnostics = [];
198
+ const result = markdown.replace(ANY_WEB5_URL, (match, offset, whole) => {
199
+ if (whole.slice(offset - 2, offset) === '](') {
200
+ return match;
201
+ }
202
+ diagnostics.push({
203
+ type: 'visible_web5_url_scrubbed',
204
+ original: match,
205
+ normalized: ''
206
+ });
207
+ return '';
208
+ });
209
+ return {
210
+ result,
211
+ diagnostics
212
+ };
213
+ }
214
+
73
215
  /**
74
216
  * Trim trailing whitespace from lines that contain text
75
217
  *
@@ -220,11 +362,13 @@ export function decodeLinkText(markdown) {
220
362
  * The preprocessing steps are applied in the following order:
221
363
  * 1. Recover orphaned emphasized web5 links
222
364
  * 2. Fix malformed links (remove whitespace between ] and () - must happen before web5 links are matched)
223
- * 3. Decode URL-encoded link text
224
- * 4. Escape web5:// links (URL-encode URLs)
225
- * 5. Normalize icon URLs
226
- * 6. Insert missing table separators for obvious pipe tables
227
- * 7. Trim trailing whitespace from lines
365
+ * 3. Repair web5 links missing their opening `[` (after step 2, so `] (url)` is already normalized)
366
+ * 4. Decode URL-encoded link text
367
+ * 5. Escape web5:// links (URL-encode URLs)
368
+ * 6. Normalize icon URLs
369
+ * 7. Insert missing table separators for obvious pipe tables
370
+ * 8. Scrub any web5:// url still visible as text (last, so every repair has had its chance)
371
+ * 9. Trim trailing whitespace from lines
228
372
  *
229
373
  * @param markdown - The raw markdown string to preprocess
230
374
  * @returns The preprocessed markdown string ready for AST parsing
@@ -235,10 +379,14 @@ export function preprocessMarkdown(markdown) {
235
379
  diagnostics: recoveredLinkDiagnostics
236
380
  } = recoverOrphanedEmphasisLinks(markdown);
237
381
  let processed = fixMalformedLinks(recoveredLinks);
382
+ const {
383
+ result: repairedLinks,
384
+ diagnostics: repairedLinkDiagnostics
385
+ } = repairOrphanedWeb5Links(processed);
238
386
  const {
239
387
  result: decodedText,
240
388
  diagnostics: decodeDiagnostics
241
- } = decodeLinkText(processed);
389
+ } = decodeLinkText(repairedLinks);
242
390
  processed = escapeWeb5Links(decodedText);
243
391
  const {
244
392
  result: normalized,
@@ -248,10 +396,14 @@ export function preprocessMarkdown(markdown) {
248
396
  result: tableNormalized,
249
397
  diagnostics: tableDiagnostics
250
398
  } = insertMissingTableSeparators(normalized);
251
- processed = trimTrailingWhitespace(tableNormalized);
399
+ const {
400
+ result: scrubbed,
401
+ diagnostics: scrubDiagnostics
402
+ } = scrubVisibleWeb5Urls(tableNormalized);
403
+ processed = trimTrailingWhitespace(scrubbed);
252
404
  return {
253
405
  markdown: processed,
254
- diagnostics: [...recoveredLinkDiagnostics, ...decodeDiagnostics, ...iconDiagnostics, ...tableDiagnostics]
406
+ diagnostics: [...recoveredLinkDiagnostics, ...repairedLinkDiagnostics, ...decodeDiagnostics, ...iconDiagnostics, ...tableDiagnostics, ...scrubDiagnostics]
255
407
  };
256
408
  }
257
409
  //# sourceMappingURL=markdownPreprocessor.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["escapeWeb5Links","markdown","replace","match","linkText","protocol","url","decodedUrl","decodeURIComponent","encodedUrl","encodeURI","fixMalformedLinks","recoverOrphanedEmphasisLinks","diagnostics","result","prefix","href","normalized","trim","push","type","original","trimTrailingWhitespace","lines","split","processedLines","line","trimmedLine","length","trimEnd","join","normalizeIconUrls","rest","spaceName","cleanName","isFenceToggle","test","splitPipeRow","trimmed","startsWith","endsWith","slice","map","cell","isPipeRow","isTableDelimiterRow","cells","every","insertMissingTableSeparators","inFence","i","previousLine","nextLine","headerCells","nextCells","separator","decodeLinkText","decoded","preprocessMarkdown","recoveredLinks","recoveredLinkDiagnostics","processed","decodedText","decodeDiagnostics","iconDiagnostics","tableNormalized","tableDiagnostics"],"sources":["../../../src/utils/markdownPreprocessor.ts"],"sourcesContent":["/**\n * Markdown preprocessing utilities\n *\n * These functions fix common markdown formatting issues before AST parsing.\n * They are applied in a specific order to ensure proper processing.\n */\n\nexport interface PreprocessorDiagnostic {\n type: string;\n original: string;\n normalized: string;\n}\n\nexport interface PreprocessResult {\n markdown: string;\n diagnostics: PreprocessorDiagnostic[];\n}\n\n/**\n * Escape web5:// links by URL-encoding the URL part\n * e.g. [text](web5://some text with spaces) → [text](web5://some%20text%20with%20spaces)\n *\n * @param markdown - The markdown string to process\n * @returns The markdown string with web5:// URLs properly encoded\n */\nexport function escapeWeb5Links(markdown: string): string {\n // Match markdown links with web5:// protocol\n // Pattern: [text](web5://...)\n return markdown.replace(\n /\\[([^\\]]+)\\]\\((web5|entity|image):\\/\\/([^)]+)\\)/g,\n (match, linkText, protocol, url) => {\n try {\n // Decode first to avoid double-encoding (e.g. %20 → %2520)\n const decodedUrl = decodeURIComponent(url);\n // Use encodeURI (not encodeURIComponent) to preserve URL structure\n // characters like /, ?, &, = while encoding spaces and unsafe chars\n const encodedUrl = encodeURI(decodedUrl);\n return `[${linkText}](${protocol}://${encodedUrl})`;\n } catch {\n // decodeURIComponent throws on a malformed percent sequence (raw `%`\n // or truncated `%X`), encodeURI on a lone surrogate. During streaming\n // this happens when chunks are concatenated mid-escape or a multi-byte\n // char is split. Leave the link untouched rather than throw — an\n // uncaught error here aborts the whole streaming parse and surfaces as\n // a 908 conversation-streaming-error even though the page rendered.\n return match;\n }\n },\n );\n}\n\n/**\n * Fix malformed markdown links with whitespace (spaces, tabs, newlines) between ] and (\n * e.g. [text] (url) → [text](url)\n * e.g. [text]\\n(url) → [text](url)\n *\n * @param markdown - The markdown string to process\n * @returns The markdown string with fixed link formatting\n */\nexport function fixMalformedLinks(markdown: string): string {\n // \\s matches spaces, tabs, and newlines; + means one or more\n // Also handle cases with newlines explicitly\n return markdown.replace(/\\][\\s\\r\\n]+\\(/g, '](');\n}\n\n/**\n * Recover inline CTA chips where the LLM emitted emphasized text followed by a\n * dangling markdown link close, e.g. `**label →**](web5://ask/query)`.\n */\nexport function recoverOrphanedEmphasisLinks(markdown: string): {\n result: string;\n diagnostics: PreprocessorDiagnostic[];\n} {\n const diagnostics: PreprocessorDiagnostic[] = [];\n const result = markdown.replace(\n /(^|[^\\[])\\*\\*([^\\n\\]*]+?)\\*\\*\\]\\((web5:\\/\\/(?:ask|action)\\/[^)]+)\\)/g,\n (match, prefix: string, linkText: string, href: string) => {\n const normalized = `${prefix}[${linkText.trim()}](${href})`;\n diagnostics.push({\n type: 'orphaned_emphasis_link_recovered',\n original: match,\n normalized,\n });\n return normalized;\n },\n );\n return { result, diagnostics };\n}\n\n/**\n * Trim trailing whitespace from lines that contain text\n *\n * @param markdown - The markdown string to process\n * @returns The markdown string with trailing whitespace trimmed from text lines\n */\nexport function trimTrailingWhitespace(markdown: string): string {\n const lines = markdown.split('\\n');\n const processedLines: string[] = [];\n\n for (const line of lines) {\n const trimmedLine = line.trim();\n\n // If the line has content, trim trailing whitespace (keep leading spaces for indentation)\n if (trimmedLine.length > 0) {\n processedLines.push(line.trimEnd());\n } else {\n // Lines with only whitespace become empty lines\n processedLines.push('');\n }\n }\n\n return processedLines.join('\\n');\n}\n\n/**\n * Normalize malformed web5://icon URLs to the canonical web5://icon/{name} format.\n * Handles variants like web5://icon:arrow, web5://icon-arrow, web5://icon arrow → web5://icon/arrow.\n * Only alphanumeric characters and dashes are kept in the icon name.\n */\nexport function normalizeIconUrls(markdown: string): {\n result: string;\n diagnostics: PreprocessorDiagnostic[];\n} {\n const diagnostics: PreprocessorDiagnostic[] = [];\n const result = markdown.replace(\n /web5:\\/\\/icon(?:([:/-][^)\\s]+)|(?:\\s+([a-zA-Z0-9-]+)))/g,\n (match, rest: string | undefined, spaceName: string | undefined) => {\n const cleanName = (spaceName ?? rest ?? '')\n .replace(/[^a-zA-Z0-9-]/g, '')\n .replace(/^-+|-+$/g, '');\n const normalized = `web5://icon/${cleanName}`;\n if (match !== normalized) {\n diagnostics.push({\n type: 'icon_url_normalized',\n original: match,\n normalized,\n });\n }\n return normalized;\n },\n );\n return { result, diagnostics };\n}\n\nfunction isFenceToggle(line: string): boolean {\n return /^\\s*(`{3,}|~{3,})/.test(line);\n}\n\nfunction splitPipeRow(line: string): string[] {\n const trimmed = line.trim();\n if (!trimmed.startsWith('|') || !trimmed.endsWith('|')) {\n return [];\n }\n return trimmed\n .slice(1, -1)\n .split('|')\n .map((cell) => cell.trim());\n}\n\nfunction isPipeRow(line: string): boolean {\n return splitPipeRow(line).length >= 2;\n}\n\nfunction isTableDelimiterRow(line: string): boolean {\n const cells = splitPipeRow(line);\n return (\n cells.length >= 2 &&\n cells.every((cell) => /^:?-{3,}:?$/.test(cell.replace(/\\s+/g, '')))\n );\n}\n\n/**\n * Repair LLM-emitted pipe tables that omit the GFM delimiter row.\n * Without this line remark-gfm parses the rows as plain paragraphs, so\n * registry sections such as comparison never receive a `table` part.\n */\nexport function insertMissingTableSeparators(markdown: string): {\n result: string;\n diagnostics: PreprocessorDiagnostic[];\n} {\n const diagnostics: PreprocessorDiagnostic[] = [];\n const lines = markdown.split('\\n');\n const result: string[] = [];\n let inFence = false;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n const previousLine = result[result.length - 1] ?? '';\n const nextLine = lines[i + 1] ?? '';\n\n if (isFenceToggle(line)) {\n inFence = !inFence;\n result.push(line);\n continue;\n }\n\n result.push(line);\n\n if (inFence || !isPipeRow(line) || isPipeRow(previousLine)) {\n continue;\n }\n if (!isPipeRow(nextLine) || isTableDelimiterRow(nextLine)) {\n continue;\n }\n\n const headerCells = splitPipeRow(line);\n const nextCells = splitPipeRow(nextLine);\n if (headerCells.length !== nextCells.length) {\n continue;\n }\n\n const separator = `| ${headerCells.map(() => '---').join(' | ')} |`;\n result.push(separator);\n diagnostics.push({\n type: 'table_separator_inserted',\n original: line,\n normalized: `${line}\\n${separator}`,\n });\n }\n\n return { result: result.join('\\n'), diagnostics };\n}\n\n/**\n * Decode URL-encoded text in markdown link labels.\n * e.g. [Some%20Text](https://example.com) → [Some Text](https://example.com)\n * e.g. [Which+solution%3F](web5://...) → [Which solution?](web5://...)\n *\n * Only decodes the text portion [text], never the URL portion (url).\n * Handles both `+` (form-encoded space) and `%XX` escapes; falls back to\n * the original string on malformed percent sequences.\n */\nexport function decodeLinkText(markdown: string): {\n result: string;\n diagnostics: PreprocessorDiagnostic[];\n} {\n const diagnostics: PreprocessorDiagnostic[] = [];\n const result = markdown.replace(\n /\\[([^\\]]+)\\]\\(/g,\n (match, linkText: string) => {\n try {\n const decoded = decodeURIComponent(linkText.replace(/\\+/g, '%20'));\n if (decoded !== linkText) {\n diagnostics.push({\n type: 'link_text_decoded',\n original: linkText,\n normalized: decoded,\n });\n }\n return `[${decoded}](`;\n } catch {\n // If decodeURIComponent fails (e.g. malformed percent sequence like %ZZ),\n // leave the text unchanged\n return match;\n }\n },\n );\n return { result, diagnostics };\n}\n\n/**\n * Preprocess markdown to fix common formatting issues before AST parsing.\n *\n * The preprocessing steps are applied in the following order:\n * 1. Recover orphaned emphasized web5 links\n * 2. Fix malformed links (remove whitespace between ] and () - must happen before web5 links are matched)\n * 3. Decode URL-encoded link text\n * 4. Escape web5:// links (URL-encode URLs)\n * 5. Normalize icon URLs\n * 6. Insert missing table separators for obvious pipe tables\n * 7. Trim trailing whitespace from lines\n *\n * @param markdown - The raw markdown string to preprocess\n * @returns The preprocessed markdown string ready for AST parsing\n */\nexport function preprocessMarkdown(markdown: string): PreprocessResult {\n const { result: recoveredLinks, diagnostics: recoveredLinkDiagnostics } =\n recoverOrphanedEmphasisLinks(markdown);\n let processed = fixMalformedLinks(recoveredLinks);\n const { result: decodedText, diagnostics: decodeDiagnostics } =\n decodeLinkText(processed);\n processed = escapeWeb5Links(decodedText);\n const { result: normalized, diagnostics: iconDiagnostics } =\n normalizeIconUrls(processed);\n const { result: tableNormalized, diagnostics: tableDiagnostics } =\n insertMissingTableSeparators(normalized);\n processed = trimTrailingWhitespace(tableNormalized);\n return {\n markdown: processed,\n diagnostics: [\n ...recoveredLinkDiagnostics,\n ...decodeDiagnostics,\n ...iconDiagnostics,\n ...tableDiagnostics,\n ],\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA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EAC1C4C,SAAS,GAAGvC,sBAAsB,CAAC2C,eAAe,CAAC;EACnD,OAAO;IACLhE,QAAQ,EAAE4D,SAAS;IACnBhD,WAAW,EAAE,CACX,GAAG+C,wBAAwB,EAC3B,GAAGG,iBAAiB,EACpB,GAAGC,eAAe,EAClB,GAAGE,gBAAgB;EAEvB,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["escapeWeb5Links","markdown","replace","match","linkText","protocol","url","decodedUrl","decodeURIComponent","encodedUrl","encodeURI","fixMalformedLinks","recoverOrphanedEmphasisLinks","diagnostics","result","prefix","href","normalized","trim","push","type","original","ORPHANED_WEB5_TARGET","ANY_WEB5_URL","MAX_RECOVERED_LABEL_WORDS","LABEL_BOUNDARY_WORDS","Set","hasOpenLinkBracket","segment","lastIndexOf","splitRecoveredLabel","run","sentenceStart","boundary","matchAll","index","length","tokens","slice","map","token","word","start","window","i","bare","toLowerCase","has","label","repairOrphanedWeb5Links","offset","whole","lineStart","scrubVisibleWeb5Urls","trimTrailingWhitespace","lines","split","processedLines","line","trimmedLine","trimEnd","join","normalizeIconUrls","rest","spaceName","cleanName","isFenceToggle","test","splitPipeRow","trimmed","startsWith","endsWith","cell","isPipeRow","isTableDelimiterRow","cells","every","insertMissingTableSeparators","inFence","previousLine","nextLine","headerCells","nextCells","separator","decodeLinkText","decoded","preprocessMarkdown","recoveredLinks","recoveredLinkDiagnostics","processed","repairedLinks","repairedLinkDiagnostics","decodedText","decodeDiagnostics","iconDiagnostics","tableNormalized","tableDiagnostics","scrubbed","scrubDiagnostics"],"sources":["../../../src/utils/markdownPreprocessor.ts"],"sourcesContent":["/**\n * Markdown preprocessing utilities\n *\n * These functions fix common markdown formatting issues before AST parsing.\n * They are applied in a specific order to ensure proper processing.\n */\n\nexport interface PreprocessorDiagnostic {\n type: string;\n original: string;\n normalized: string;\n}\n\nexport interface PreprocessResult {\n markdown: string;\n diagnostics: PreprocessorDiagnostic[];\n}\n\n/**\n * Escape web5:// links by URL-encoding the URL part\n * e.g. [text](web5://some text with spaces) → [text](web5://some%20text%20with%20spaces)\n *\n * @param markdown - The markdown string to process\n * @returns The markdown string with web5:// URLs properly encoded\n */\nexport function escapeWeb5Links(markdown: string): string {\n // Match markdown links with web5:// protocol\n // Pattern: [text](web5://...)\n return markdown.replace(\n /\\[([^\\]]+)\\]\\((web5|entity|image):\\/\\/([^)]+)\\)/g,\n (match, linkText, protocol, url) => {\n try {\n // Decode first to avoid double-encoding (e.g. %20 → %2520)\n const decodedUrl = decodeURIComponent(url);\n // Use encodeURI (not encodeURIComponent) to preserve URL structure\n // characters like /, ?, &, = while encoding spaces and unsafe chars\n const encodedUrl = encodeURI(decodedUrl);\n return `[${linkText}](${protocol}://${encodedUrl})`;\n } catch {\n // decodeURIComponent throws on a malformed percent sequence (raw `%`\n // or truncated `%X`), encodeURI on a lone surrogate. During streaming\n // this happens when chunks are concatenated mid-escape or a multi-byte\n // char is split. Leave the link untouched rather than throw — an\n // uncaught error here aborts the whole streaming parse and surfaces as\n // a 908 conversation-streaming-error even though the page rendered.\n return match;\n }\n },\n );\n}\n\n/**\n * Fix malformed markdown links with whitespace (spaces, tabs, newlines) between ] and (\n * e.g. [text] (url) → [text](url)\n * e.g. [text]\\n(url) → [text](url)\n *\n * @param markdown - The markdown string to process\n * @returns The markdown string with fixed link formatting\n */\nexport function fixMalformedLinks(markdown: string): string {\n // \\s matches spaces, tabs, and newlines; + means one or more\n // Also handle cases with newlines explicitly\n return markdown.replace(/\\][\\s\\r\\n]+\\(/g, '](');\n}\n\n/**\n * Recover inline CTA chips where the LLM emitted emphasized text followed by a\n * dangling markdown link close, e.g. `**label →**](web5://ask/query)`.\n */\nexport function recoverOrphanedEmphasisLinks(markdown: string): {\n result: string;\n diagnostics: PreprocessorDiagnostic[];\n} {\n const diagnostics: PreprocessorDiagnostic[] = [];\n const result = markdown.replace(\n /(^|[^\\[])\\*\\*([^\\n\\]*]+?)\\*\\*\\]\\((web5:\\/\\/(?:ask|action)\\/[^)]+)\\)/g,\n (match, prefix: string, linkText: string, href: string) => {\n const normalized = `${prefix}[${linkText.trim()}](${href})`;\n diagnostics.push({\n type: 'orphaned_emphasis_link_recovered',\n original: match,\n normalized,\n });\n return normalized;\n },\n );\n return { result, diagnostics };\n}\n\n/**\n * A `web5://` link target whose opening `[` never arrived, e.g.\n * `try filtering for men](web5://ask/Which+are+for+men%3F)`.\n *\n * Dropping the opening bracket is the most common way an inline ask link is\n * mis-emitted, and it is the worst one: remark parses nothing as a link, so the\n * scheme renders as literal text and the visitor reads `web5://ask/...`.\n *\n * `run` is the text before the `]` on the same line, which is what the label\n * should have been. It may be empty, in which case there is nothing to promote\n * and the construct is dropped instead.\n */\nconst ORPHANED_WEB5_TARGET = /([^[\\]()*\\n]{0,80}?)\\]\\((web5:\\/\\/[^)\\s]*)\\)/g;\n\n/** Any `web5://` url, for the final check that none is visible as text. */\nconst ANY_WEB5_URL = /web5:\\/\\/[^\\s)\\]]*/g;\n\n/** Longest label we will promote out of surrounding prose. */\nconst MAX_RECOVERED_LABEL_WORDS = 4;\n\n/**\n * Words a label should start *after* rather than with. The label is cut at the\n * last of these inside the window, so a promoted phrase reads as a noun phrase\n * (\"sensitive skin\") instead of trailing off a verb or preposition\n * (\"carry for sensitive skin\").\n */\nconst LABEL_BOUNDARY_WORDS = new Set([\n 'a',\n 'an',\n 'and',\n 'at',\n 'but',\n 'by',\n 'for',\n 'from',\n 'in',\n 'into',\n 'of',\n 'on',\n 'or',\n 'the',\n 'to',\n 'with',\n]);\n\n/**\n * True when `segment` holds a `[` that is still waiting to be closed — meaning\n * the `](` after it closes a real link and there is nothing to repair.\n */\nfunction hasOpenLinkBracket(segment: string): boolean {\n return segment.lastIndexOf('[') > segment.lastIndexOf(']');\n}\n\n/**\n * Split `run` into the prose to leave in place and the phrase to promote into\n * the link label. Slices on token offsets rather than rejoining words, so the\n * original spacing around the label is preserved exactly.\n *\n * An empty label means there is nothing worth promoting and the caller should\n * drop the link instead.\n */\nfunction splitRecoveredLabel(run: string): { prefix: string; label: string } {\n // Never let the label cross a sentence boundary.\n let sentenceStart = 0;\n for (const boundary of run.matchAll(/(?<=[.!?;:])\\s+/g)) {\n sentenceStart = (boundary.index ?? 0) + boundary[0].length;\n }\n\n const tokens = [...run.slice(sentenceStart).matchAll(/\\S+/g)].map(\n (token) => ({\n word: token[0],\n start: sentenceStart + (token.index ?? 0),\n }),\n );\n\n let window = tokens.slice(-MAX_RECOVERED_LABEL_WORDS);\n for (let i = window.length - 1; i >= 0; i--) {\n const bare = window[i].word.toLowerCase().replace(/[^a-z]/g, '');\n if (LABEL_BOUNDARY_WORDS.has(bare)) {\n window = window.slice(i + 1);\n break;\n }\n }\n\n if (window.length === 0) {\n return { prefix: run, label: '' };\n }\n\n return {\n prefix: run.slice(0, window[0].start),\n label: run.slice(window[0].start).trim(),\n };\n}\n\n/**\n * Repair `web5://` links that lost their opening `[`.\n *\n * Recovers the link by promoting the words immediately before the `]` into its\n * label; when there are no words to promote, drops the whole construct. Either\n * way the scheme stops being visible, which is the point — a link the visitor\n * cannot use is a smaller failure than a url the visitor can read.\n */\nexport function repairOrphanedWeb5Links(markdown: string): {\n result: string;\n diagnostics: PreprocessorDiagnostic[];\n} {\n const diagnostics: PreprocessorDiagnostic[] = [];\n const result = markdown.replace(\n ORPHANED_WEB5_TARGET,\n (\n match: string,\n run: string,\n href: string,\n offset: number,\n whole: string,\n ) => {\n const lineStart = whole.lastIndexOf('\\n', offset) + 1;\n if (hasOpenLinkBracket(whole.slice(lineStart, offset))) {\n // A real `[label](url)` — the bracket is there, leave it alone.\n return match;\n }\n\n const { prefix, label } = splitRecoveredLabel(run);\n if (!label) {\n diagnostics.push({\n type: 'orphaned_web5_link_dropped',\n original: match,\n normalized: run,\n });\n return run;\n }\n\n const normalized = `${prefix}[${label}](${href})`;\n diagnostics.push({\n type: 'orphaned_web5_link_recovered',\n original: match,\n normalized,\n });\n return normalized;\n },\n );\n return { result, diagnostics };\n}\n\n/**\n * Last resort: remove any `web5://` url still sitting in visible text.\n *\n * Runs after every recovery step, so anything left here is a url no repair\n * could turn back into a link. A url in a link target (`](web5://...)`) is\n * left alone — only text the visitor would actually read is scrubbed.\n */\nexport function scrubVisibleWeb5Urls(markdown: string): {\n result: string;\n diagnostics: PreprocessorDiagnostic[];\n} {\n const diagnostics: PreprocessorDiagnostic[] = [];\n const result = markdown.replace(\n ANY_WEB5_URL,\n (match: string, offset: number, whole: string) => {\n if (whole.slice(offset - 2, offset) === '](') {\n return match;\n }\n diagnostics.push({\n type: 'visible_web5_url_scrubbed',\n original: match,\n normalized: '',\n });\n return '';\n },\n );\n return { result, diagnostics };\n}\n\n/**\n * Trim trailing whitespace from lines that contain text\n *\n * @param markdown - The markdown string to process\n * @returns The markdown string with trailing whitespace trimmed from text lines\n */\nexport function trimTrailingWhitespace(markdown: string): string {\n const lines = markdown.split('\\n');\n const processedLines: string[] = [];\n\n for (const line of lines) {\n const trimmedLine = line.trim();\n\n // If the line has content, trim trailing whitespace (keep leading spaces for indentation)\n if (trimmedLine.length > 0) {\n processedLines.push(line.trimEnd());\n } else {\n // Lines with only whitespace become empty lines\n processedLines.push('');\n }\n }\n\n return processedLines.join('\\n');\n}\n\n/**\n * Normalize malformed web5://icon URLs to the canonical web5://icon/{name} format.\n * Handles variants like web5://icon:arrow, web5://icon-arrow, web5://icon arrow → web5://icon/arrow.\n * Only alphanumeric characters and dashes are kept in the icon name.\n */\nexport function normalizeIconUrls(markdown: string): {\n result: string;\n diagnostics: PreprocessorDiagnostic[];\n} {\n const diagnostics: PreprocessorDiagnostic[] = [];\n const result = markdown.replace(\n /web5:\\/\\/icon(?:([:/-][^)\\s]+)|(?:\\s+([a-zA-Z0-9-]+)))/g,\n (match, rest: string | undefined, spaceName: string | undefined) => {\n const cleanName = (spaceName ?? rest ?? '')\n .replace(/[^a-zA-Z0-9-]/g, '')\n .replace(/^-+|-+$/g, '');\n const normalized = `web5://icon/${cleanName}`;\n if (match !== normalized) {\n diagnostics.push({\n type: 'icon_url_normalized',\n original: match,\n normalized,\n });\n }\n return normalized;\n },\n );\n return { result, diagnostics };\n}\n\nfunction isFenceToggle(line: string): boolean {\n return /^\\s*(`{3,}|~{3,})/.test(line);\n}\n\nfunction splitPipeRow(line: string): string[] {\n const trimmed = line.trim();\n if (!trimmed.startsWith('|') || !trimmed.endsWith('|')) {\n return [];\n }\n return trimmed\n .slice(1, -1)\n .split('|')\n .map((cell) => cell.trim());\n}\n\nfunction isPipeRow(line: string): boolean {\n return splitPipeRow(line).length >= 2;\n}\n\nfunction isTableDelimiterRow(line: string): boolean {\n const cells = splitPipeRow(line);\n return (\n cells.length >= 2 &&\n cells.every((cell) => /^:?-{3,}:?$/.test(cell.replace(/\\s+/g, '')))\n );\n}\n\n/**\n * Repair LLM-emitted pipe tables that omit the GFM delimiter row.\n * Without this line remark-gfm parses the rows as plain paragraphs, so\n * registry sections such as comparison never receive a `table` part.\n */\nexport function insertMissingTableSeparators(markdown: string): {\n result: string;\n diagnostics: PreprocessorDiagnostic[];\n} {\n const diagnostics: PreprocessorDiagnostic[] = [];\n const lines = markdown.split('\\n');\n const result: string[] = [];\n let inFence = false;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n const previousLine = result[result.length - 1] ?? '';\n const nextLine = lines[i + 1] ?? '';\n\n if (isFenceToggle(line)) {\n inFence = !inFence;\n result.push(line);\n continue;\n }\n\n result.push(line);\n\n if (inFence || !isPipeRow(line) || isPipeRow(previousLine)) {\n continue;\n }\n if (!isPipeRow(nextLine) || isTableDelimiterRow(nextLine)) {\n continue;\n }\n\n const headerCells = splitPipeRow(line);\n const nextCells = splitPipeRow(nextLine);\n if (headerCells.length !== nextCells.length) {\n continue;\n }\n\n const separator = `| ${headerCells.map(() => '---').join(' | ')} |`;\n result.push(separator);\n diagnostics.push({\n type: 'table_separator_inserted',\n original: line,\n normalized: `${line}\\n${separator}`,\n });\n }\n\n return { result: result.join('\\n'), diagnostics };\n}\n\n/**\n * Decode URL-encoded text in markdown link labels.\n * e.g. [Some%20Text](https://example.com) → [Some Text](https://example.com)\n * e.g. [Which+solution%3F](web5://...) → [Which solution?](web5://...)\n *\n * Only decodes the text portion [text], never the URL portion (url).\n * Handles both `+` (form-encoded space) and `%XX` escapes; falls back to\n * the original string on malformed percent sequences.\n */\nexport function decodeLinkText(markdown: string): {\n result: string;\n diagnostics: PreprocessorDiagnostic[];\n} {\n const diagnostics: PreprocessorDiagnostic[] = [];\n const result = markdown.replace(\n /\\[([^\\]]+)\\]\\(/g,\n (match, linkText: string) => {\n try {\n const decoded = decodeURIComponent(linkText.replace(/\\+/g, '%20'));\n if (decoded !== linkText) {\n diagnostics.push({\n type: 'link_text_decoded',\n original: linkText,\n normalized: decoded,\n });\n }\n return `[${decoded}](`;\n } catch {\n // If decodeURIComponent fails (e.g. malformed percent sequence like %ZZ),\n // leave the text unchanged\n return match;\n }\n },\n );\n return { result, diagnostics };\n}\n\n/**\n * Preprocess markdown to fix common formatting issues before AST parsing.\n *\n * The preprocessing steps are applied in the following order:\n * 1. Recover orphaned emphasized web5 links\n * 2. Fix malformed links (remove whitespace between ] and () - must happen before web5 links are matched)\n * 3. Repair web5 links missing their opening `[` (after step 2, so `] (url)` is already normalized)\n * 4. Decode URL-encoded link text\n * 5. Escape web5:// links (URL-encode URLs)\n * 6. Normalize icon URLs\n * 7. Insert missing table separators for obvious pipe tables\n * 8. Scrub any web5:// url still visible as text (last, so every repair has had its chance)\n * 9. Trim trailing whitespace from lines\n *\n * @param markdown - The raw markdown string to preprocess\n * @returns The preprocessed markdown string ready for AST parsing\n */\nexport function preprocessMarkdown(markdown: string): PreprocessResult {\n const { result: recoveredLinks, diagnostics: recoveredLinkDiagnostics } =\n recoverOrphanedEmphasisLinks(markdown);\n let processed = fixMalformedLinks(recoveredLinks);\n const { result: repairedLinks, diagnostics: repairedLinkDiagnostics } =\n repairOrphanedWeb5Links(processed);\n const { result: decodedText, diagnostics: decodeDiagnostics } =\n decodeLinkText(repairedLinks);\n processed = escapeWeb5Links(decodedText);\n const { result: normalized, diagnostics: iconDiagnostics } =\n normalizeIconUrls(processed);\n const { result: tableNormalized, diagnostics: tableDiagnostics } =\n insertMissingTableSeparators(normalized);\n const { result: scrubbed, diagnostics: scrubDiagnostics } =\n scrubVisibleWeb5Urls(tableNormalized);\n processed = trimTrailingWhitespace(scrubbed);\n return {\n markdown: processed,\n diagnostics: [\n ...recoveredLinkDiagnostics,\n ...repairedLinkDiagnostics,\n ...decodeDiagnostics,\n ...iconDiagnostics,\n ...tableDiagnostics,\n ...scrubDiagnostics,\n ],\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,eAAeA,CAACC,QAAgB,EAAU;EACxD;EACA;EACA,OAAOA,QAAQ,CAACC,OAAO,CACrB,kDAAkD,EAClD,CAACC,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,GAAG,KAAK;IAClC,IAAI;MACF;MACA,MAAMC,UAAU,GAAGC,kBAAkB,CAACF,GAAG,CAAC;MAC1C;MACA;MACA,MAAMG,UAAU,GAAGC,SAAS,CAACH,UAAU,CAAC;MACxC,OAAO,IAAIH,QAAQ,KAAKC,QAAQ,MAAMI,UAAU,GAAG;IACrD,CAAC,CAAC,MAAM;MACN;MACA;MACA;MACA;MACA;MACA;MACA,OAAON,KAAK;IACd;EACF,CACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASQ,iBAAiBA,CAACV,QAAgB,EAAU;EAC1D;EACA;EACA,OAAOA,QAAQ,CAACC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC;AACjD;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASU,4BAA4BA,CAACX,QAAgB,EAG3D;EACA,MAAMY,WAAqC,GAAG,EAAE;EAChD,MAAMC,MAAM,GAAGb,QAAQ,CAACC,OAAO,CAC7B,sEAAsE,EACtE,CAACC,KAAK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AC;EACpC,MAAM;IAAE3E,MAAM,EAAE8E,WAAW;IAAE/E,WAAW,EAAEgF;EAAkB,CAAC,GAC3DT,cAAc,CAACM,aAAa,CAAC;EAC/BD,SAAS,GAAGzF,eAAe,CAAC4F,WAAW,CAAC;EACxC,MAAM;IAAE9E,MAAM,EAAEG,UAAU;IAAEJ,WAAW,EAAEiF;EAAgB,CAAC,GACxDhC,iBAAiB,CAAC2B,SAAS,CAAC;EAC9B,MAAM;IAAE3E,MAAM,EAAEiF,eAAe;IAAElF,WAAW,EAAEmF;EAAiB,CAAC,GAC9DnB,4BAA4B,CAAC5D,UAAU,CAAC;EAC1C,MAAM;IAAEH,MAAM,EAAEmF,QAAQ;IAAEpF,WAAW,EAAEqF;EAAiB,CAAC,GACvD7C,oBAAoB,CAAC0C,eAAe,CAAC;EACvCN,SAAS,GAAGnC,sBAAsB,CAAC2C,QAAQ,CAAC;EAC5C,OAAO;IACLhG,QAAQ,EAAEwF,SAAS;IACnB5E,WAAW,EAAE,CACX,GAAG2E,wBAAwB,EAC3B,GAAGG,uBAAuB,EAC1B,GAAGE,iBAAiB,EACpB,GAAGC,eAAe,EAClB,GAAGE,gBAAgB,EACnB,GAAGE,gBAAgB;EAEvB,CAAC;AACH","ignoreList":[]}
@@ -1,11 +1,11 @@
1
1
  import { type Part } from '../../parts/parts';
2
2
  import type { ComparisonCompProps, ComparisonSectionComponent, SectionFixture } from '../types';
3
- import type { SectionDefinition, ParseContext } from '../section-definition';
3
+ import type { SectionDefinition, ParseContext, DropSection } from '../section-definition';
4
4
  export declare class ComparisonSectionDefinition implements SectionDefinition<ComparisonSectionComponent> {
5
5
  sectionType: "comparison";
6
6
  patterns: string[];
7
7
  defaults: ComparisonCompProps;
8
8
  fixtures: SectionFixture<ComparisonCompProps>[];
9
- parse(parts: Part[], context?: ParseContext): ComparisonCompProps;
9
+ parse(parts: Part[], context?: ParseContext): ComparisonCompProps | DropSection;
10
10
  }
11
11
  //# sourceMappingURL=ComparisonSectionDefinition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComparisonSectionDefinition.d.ts","sourceRoot":"","sources":["../../../../src/component/componentDefinitions/ComparisonSectionDefinition.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAEV,mBAAmB,EAEnB,0BAA0B,EAC1B,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG7E,qBAAa,2BACX,YAAW,iBAAiB,CAAC,0BAA0B,CAAC;IAExD,WAAW,eAAyB;IACpC,QAAQ,WAEN;IAEF,QAAQ,EAAE,mBAAmB,CAO3B;IAEF,QAAQ,EAAE,cAAc,CAAC,mBAAmB,CAAC,EAAE,CA8C7C;IAEF,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,mBAAmB;CA2ElE"}
1
+ {"version":3,"file":"ComparisonSectionDefinition.d.ts","sourceRoot":"","sources":["../../../../src/component/componentDefinitions/ComparisonSectionDefinition.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAEV,mBAAmB,EAEnB,0BAA0B,EAC1B,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAmB/B,qBAAa,2BACX,YAAW,iBAAiB,CAAC,0BAA0B,CAAC;IAExD,WAAW,eAAyB;IACpC,QAAQ,WAEN;IAEF,QAAQ,EAAE,mBAAmB,CAO3B;IAEF,QAAQ,EAAE,cAAc,CAAC,mBAAmB,CAAC,EAAE,CA8C7C;IAEF,KAAK,CACH,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,CAAC,EAAE,YAAY,GACrB,mBAAmB,GAAG,WAAW;CAqGrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureSection9PlusDefinition.d.ts","sourceRoot":"","sources":["../../../../src/component/componentDefinitions/FeatureSection9PlusDefinition.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,IAAI,EAGV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,4BAA4B,EAC5B,mCAAmC,EACnC,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,qBAAa,6BACX,YAAW,iBAAiB,CAAC,mCAAmC,CAAC;IAEjE,WAAW,wBAAkC;IAC7C,QAAQ,WAEN;IAEF,QAAQ,EAAE,4BAA4B,CAGpC;IAEF,QAAQ,EAAE,cAAc,CAAC,4BAA4B,CAAC,EAAE,CAAM;IAE9D,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,4BAA4B;CA8DnD"}
1
+ {"version":3,"file":"FeatureSection9PlusDefinition.d.ts","sourceRoot":"","sources":["../../../../src/component/componentDefinitions/FeatureSection9PlusDefinition.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,IAAI,EAGV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,4BAA4B,EAC5B,mCAAmC,EACnC,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,qBAAa,6BACX,YAAW,iBAAiB,CAAC,mCAAmC,CAAC;IAEjE,WAAW,wBAAkC;IAC7C,QAAQ,WAEN;IAEF,QAAQ,EAAE,4BAA4B,CAGpC;IAEF,QAAQ,EAAE,cAAc,CAAC,4BAA4B,CAAC,EAAE,CAAM;IAE9D,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,4BAA4B;CAkEnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"listItemsSectionDefinition.d.ts","sourceRoot":"","sources":["../../../../src/component/componentDefinitions/listItemsSectionDefinition.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,IAAI,EAAiB,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAK/D,qBAAa,0BACX,YAAW,iBAAiB,CAAC,yBAAyB,CAAC;IAEvD,WAAW,qBAA+B;IAW1C,QAAQ,WAEN;IAEF,QAAQ,EAAE,yBAAyB,CAGjC;IAEF,QAAQ,EAAE,cAAc,CAAC,yBAAyB,CAAC,EAAE,CAAM;IAE3D,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,yBAAyB,GAAG,IAAI;CAmDvD"}
1
+ {"version":3,"file":"listItemsSectionDefinition.d.ts","sourceRoot":"","sources":["../../../../src/component/componentDefinitions/listItemsSectionDefinition.ts"],"names":[],"mappings":"AAKA,OAAO,EAAkB,KAAK,IAAI,EAAiB,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,cAAc,EACf,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAK/D,qBAAa,0BACX,YAAW,iBAAiB,CAAC,yBAAyB,CAAC;IAEvD,WAAW,qBAA+B;IAW1C,QAAQ,WAEN;IAEF,QAAQ,EAAE,yBAAyB,CAGjC;IAEF,QAAQ,EAAE,cAAc,CAAC,yBAAyB,CAAC,EAAE,CAAM;IAE3D,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,yBAAyB,GAAG,IAAI;CAwDvD"}
@@ -50,6 +50,16 @@ export declare function parseKpiItem(markdown: string): {
50
50
  title: string;
51
51
  description: string;
52
52
  } | null;
53
+ /**
54
+ * Serialize a run of inline parts back to markdown, preserving links.
55
+ *
56
+ * Concatenating `part.content` alone silently deletes links: a `link` part
57
+ * keeps its label in `content` and its url in `meta.href`, so a filter that
58
+ * reads only text parts turns `Read the [pricing page](/pricing) first` into
59
+ * `Read the first` — url and label both vanish, with nothing in the output to
60
+ * show anything was lost.
61
+ */
62
+ export declare function inlinePartsToMarkdown(parts: Part[]): string;
53
63
  export declare function extractListItemText(item: ListItemPart): string;
54
64
  /**
55
65
  * Reconstruct markdown-like content from parts.
@@ -1 +1 @@
1
- {"version":3,"file":"parse-utils.d.ts","sourceRoot":"","sources":["../../../../src/component/componentDefinitions/parse-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EAGJ,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAS3B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiB3C,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAUhD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAOrE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAO9C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAY3D;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,CAoB9D;AAED,6DAA6D;AAC7D,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,GAAG,SAAS,CAI/D;AAED,8CAA8C;AAC9C,wB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