{"version":3,"file":"QuickShareWidget-DosUe2am.mjs","names":["ImageIcon"],"sources":["../../widgets/src/widgets/QuickShareWidget.tsx"],"sourcesContent":["import {\n  useCallback,\n  useEffect,\n  useMemo,\n  useState,\n  type ComponentProps,\n  type CSSProperties,\n} from \"react\";\nimport type React from \"react\";\nimport type {\n  BorderRadiusOptions,\n  BorderWidthOptions,\n  ColorOptions,\n  FontSizeOptions,\n  PaddingOptions,\n  ShareableItem,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport { useShareLink } from \"@fluid-app/shareables-core/hooks/use-share-link\";\nimport {\n  borderColorClasses,\n  borderWidthClasses,\n  getBorderColorField,\n  getBorderRadiusField,\n  getBorderWidthField,\n  getColorField,\n  getFontSizeField,\n  getPaddingField,\n} from \"../core/fields\";\nimport { useWidgetInteraction } from \"../contexts/WidgetInteractionContext\";\nimport { QRCodeSVG } from \"qrcode.react\";\nimport {\n  BookOpen,\n  Check,\n  CircleDot,\n  Copy,\n  FileText,\n  Image as ImageIcon,\n  Mail,\n  MessageCircle,\n  Package,\n  RotateCw,\n  Share2,\n  ShoppingCart,\n  Ticket,\n  type LucideIcon,\n} from \"lucide-react\";\n\ntype QuickShareWidgetProps = ComponentProps<\"div\"> & {\n  // Resource\n  shareableResource?: ShareableItem;\n\n  // Title\n  titleEnabled?: boolean;\n  titleText?: string;\n  titleFontSize?: FontSizeOptions;\n  titleColor?: ColorOptions;\n\n  // Styling\n  textColor?: ColorOptions;\n  accentColor?: ColorOptions;\n  padding?: PaddingOptions;\n  borderRadius?: BorderRadiusOptions;\n  borderWidth?: BorderWidthOptions;\n  borderColor?: ColorOptions;\n\n  // Overlay\n  overlayEnabled?: boolean;\n  overlayType?: \"solid\" | \"gradient\";\n  overlayIntensity?: number;\n\n  // Actions\n  showBuyButton?: boolean;\n\n  // Polish (new, additive)\n  showResourceType?: boolean;\n  showShareActions?: boolean;\n  showDomainPrefix?: boolean;\n};\n\ntype ResourceDescriptor = {\n  label: string;\n  icon: LucideIcon;\n};\n\ntype QuickShareCSSProperties = CSSProperties &\n  Record<`--${string}`, string | number | undefined>;\n\nconst RESOURCE_TYPE_MAP: Record<string, ResourceDescriptor> = {\n  Product: { label: \"Product\", icon: Package },\n  Page: { label: \"Page\", icon: FileText },\n  EnrollmentPack: { label: \"Enrollment\", icon: Ticket },\n  Medium: { label: \"Media\", icon: ImageIcon },\n  Library: { label: \"Library\", icon: BookOpen },\n};\n\nconst getResourceDescriptor = (\n  resource: ShareableItem | undefined,\n): ResourceDescriptor | null => {\n  const rawType = (resource?.type || resource?.shareableType || \"\") as string;\n  if (!rawType) return null;\n  return RESOURCE_TYPE_MAP[rawType] ?? { label: rawType, icon: CircleDot };\n};\n\nconst splitUrl = (url: string): { prefix: string; path: string } => {\n  try {\n    const parsed = new URL(url);\n    return {\n      prefix: `${parsed.protocol}//${parsed.host}`,\n      path: `${parsed.pathname}${parsed.search}${parsed.hash}`,\n    };\n  } catch {\n    return { prefix: \"\", path: url };\n  }\n};\n\nconst CURRENCY_FIELD_KEYS = [\n  \"currency\",\n  \"currency_code\",\n  \"currencyCode\",\n  \"currencyIso\",\n  \"currency_iso\",\n] as const;\n\nconst getResourceCurrency = (\n  resource: ShareableItem | undefined,\n): string | null => {\n  if (!resource) return null;\n  for (const key of CURRENCY_FIELD_KEYS) {\n    const value = resource[key];\n    if (typeof value === \"string\" && /^[A-Z]{3}$/i.test(value)) {\n      return value.toUpperCase();\n    }\n  }\n  return null;\n};\n\nconst formatNumericPrice = (price: number, resource: ShareableItem): string => {\n  const currency = getResourceCurrency(resource);\n  if (!currency) return String(price);\n  try {\n    return price.toLocaleString(undefined, { style: \"currency\", currency });\n  } catch {\n    return String(price);\n  }\n};\n\nconst getDisplayPrice = (\n  resource: ShareableItem | undefined,\n): string | null => {\n  if (!resource) return null;\n  if (typeof resource.display_price === \"string\" && resource.display_price) {\n    return resource.display_price;\n  }\n  if (resource.price != null) {\n    return typeof resource.price === \"number\"\n      ? formatNumericPrice(resource.price, resource)\n      : String(resource.price);\n  }\n  return null;\n};\n\nconst getColorCssValue = (color: ColorOptions): string =>\n  color === \"transparent\" ? \"transparent\" : `var(--color-${color})`;\n\nconst colorMix = (color: ColorOptions, amount: number): string =>\n  color === \"transparent\"\n    ? \"transparent\"\n    : `color-mix(in oklch, ${getColorCssValue(color)} ${amount}%, transparent)`;\n\nconst insetBorder = (color: ColorOptions, amount: number): string =>\n  `inset 0 0 0 1px ${colorMix(color, amount)}`;\n\ntype CopyState = \"idle\" | \"copied\";\n\nfunction useTimedCopyState(timeoutMs: number) {\n  const [copyState, setCopyState] = useState<CopyState>(\"idle\");\n\n  useEffect(() => {\n    if (copyState !== \"copied\") return;\n    const id = window.setTimeout(() => setCopyState(\"idle\"), timeoutMs);\n    return () => window.clearTimeout(id);\n  }, [copyState, timeoutMs]);\n\n  const markCopied = useCallback(() => {\n    setCopyState(\"copied\");\n  }, []);\n\n  return { copyState, markCopied };\n}\n\nfunction useImageFailureFallback(imageUrl: string) {\n  const [imageFailed, setImageFailed] = useState(false);\n\n  // Reset the failed-image state when the resource (and thus the image URL)\n  // changes — otherwise switching to a new resource keeps showing EmptyHero\n  // because the React state outlives the previous load failure.\n  useEffect(() => {\n    setImageFailed(false);\n  }, [imageUrl]);\n\n  const handleImageError = useCallback(() => {\n    setImageFailed(true);\n  }, []);\n\n  return { imageFailed, handleImageError };\n}\n\nfunction useShareCapabilities() {\n  const [canNativeShare, setCanNativeShare] = useState(false);\n  const [canSendSms, setCanSendSms] = useState(false);\n\n  useEffect(() => {\n    setCanNativeShare(\n      typeof navigator !== \"undefined\" && typeof navigator.share === \"function\",\n    );\n    setCanSendSms(\n      typeof navigator !== \"undefined\" &&\n        (/Android|iPhone|iPad|iPod/i.test(navigator.userAgent) ||\n          (/Macintosh/i.test(navigator.userAgent) &&\n            navigator.maxTouchPoints > 1)),\n    );\n  }, []);\n\n  return { canNativeShare, canSendSms };\n}\n\nexport function QuickShareWidget({\n  shareableResource,\n\n  titleEnabled = true,\n  titleText = \"\",\n  titleFontSize = \"2xl\",\n  titleColor = \"background\",\n\n  textColor = \"background\",\n  accentColor = \"primary\",\n  padding = 6,\n  borderRadius = \"xl\",\n  borderWidth = \"none\",\n  borderColor = \"muted\",\n\n  overlayEnabled = true,\n  overlayType = \"gradient\",\n  overlayIntensity = 70,\n\n  showBuyButton = false,\n\n  showResourceType = true,\n  showShareActions = true,\n  showDomainPrefix = true,\n\n  className,\n  style,\n  ...props\n}: QuickShareWidgetProps): React.JSX.Element {\n  const backgroundImageUrl =\n    shareableResource?.image_url || shareableResource?.imageUrl || \"\";\n  const { copyState, markCopied } = useTimedCopyState(1600);\n  // Hero image fallback: if the resource image 404s or fails to decode, flip\n  // to the EmptyHero treatment instead of rendering a broken image.\n  const { imageFailed, handleImageError } =\n    useImageFailureFallback(backgroundImageUrl);\n  const { onItemClick } = useWidgetInteraction();\n\n  const shareableType = (shareableResource?.type ||\n    shareableResource?.shareableType ||\n    \"\") as string;\n  const isClickable = Boolean(\n    onItemClick && shareableResource && shareableType,\n  );\n\n  const handleItemClick = useCallback(() => {\n    if (!onItemClick || !shareableResource || !shareableType) return;\n    onItemClick({\n      ...shareableResource,\n      shareable_type: shareableType,\n    });\n  }, [onItemClick, shareableResource, shareableType]);\n\n  const showHeroImage = Boolean(backgroundImageUrl) && !imageFailed;\n\n  // Attribution must follow the logged-in portal user, not whoever built\n  // the page. The builder freezes shareableResource.share_link into widget\n  // config at edit-time (admin's affiliate code embedded), so we ignore it\n  // and ask the BFF to mint a fresh per-user link from id + type. Passing\n  // only { id } prevents useShareLink's \"return existing share_link\"\n  // short-circuit on the stale value.\n  const resourceId = useMemo<number | undefined>(() => {\n    const raw = shareableResource?.id;\n    if (typeof raw === \"number\" && Number.isInteger(raw)) return raw;\n    if (typeof raw === \"string\") {\n      const parsed = Number.parseInt(raw, 10);\n      return Number.isFinite(parsed) ? parsed : undefined;\n    }\n    return undefined;\n  }, [shareableResource?.id]);\n  const {\n    shareLink: resolvedShareLink,\n    loading: shareLinkLoading,\n    error: shareLinkError,\n    getShareLink: retryShareLink,\n  } = useShareLink(resourceId == null ? {} : { id: resourceId }, shareableType);\n  const shareLink = resolvedShareLink ?? \"\";\n  const hasShareLink = !!shareLink;\n  const shareLinkFailed = Boolean(shareLinkError) && !shareLinkLoading;\n  const handleRetryShareLink = useCallback(() => {\n    void retryShareLink();\n  }, [retryShareLink]);\n\n  const displayTitle =\n    titleText || shareableResource?.title || \"Select content to share\";\n  const resourceDescriptor = getResourceDescriptor(shareableResource);\n  const displayPrice = getDisplayPrice(shareableResource);\n\n  const isProduct =\n    shareableResource?.type === \"Product\" ||\n    shareableResource?.shareableType === \"Product\";\n  const shouldShowBuyButton = showBuyButton && isProduct;\n\n  const parsedOverlayIntensity = Number(\n    String(overlayIntensity).replace(\"%\", \"\"),\n  );\n  const overlayOpacity =\n    (Number.isFinite(parsedOverlayIntensity)\n      ? Math.min(100, Math.max(0, parsedOverlayIntensity))\n      : 70) / 100;\n\n  const editorialGradient: CSSProperties | undefined =\n    overlayEnabled && showHeroImage\n      ? {\n          background: `linear-gradient(to top, color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 100)}%, transparent), color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 55)}%, transparent) 45%, transparent 85%)`,\n        }\n      : undefined;\n\n  const handleCopy = async () => {\n    if (!hasShareLink) return;\n    try {\n      await navigator.clipboard.writeText(shareLink);\n      markCopied();\n    } catch (error) {\n      console.error(\"Failed to copy to clipboard:\", error);\n    }\n  };\n\n  const handleNativeShare = async () => {\n    if (!hasShareLink) return;\n    if (typeof navigator.share === \"function\") {\n      try {\n        await navigator.share({\n          title: displayTitle,\n          url: shareLink,\n        });\n      } catch {\n        // Ignore abort\n      }\n    } else {\n      await handleCopy();\n    }\n  };\n\n  const { prefix, path } = hasShareLink\n    ? splitUrl(shareLink)\n    : { prefix: \"\", path: \"\" };\n\n  return (\n    <div\n      className={`relative isolate overflow-hidden rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} bg-muted text-${textColor} ${className ?? \"\"}`}\n      style={{\n        // Themed dual-shadow (crisp + soft ambient), derived from the\n        // foreground token so the lift reads in both light and dark.\n        boxShadow: `0 1px 2px color-mix(in oklch, var(--color-foreground) 4%, transparent), 0 20px 40px -20px color-mix(in oklch, var(--color-foreground) 25%, transparent)`,\n        ...style,\n      }}\n      {...props}\n    >\n      {/* Hero image or empty-state surface */}\n      {showHeroImage ? (\n        <div className=\"absolute inset-0\">\n          <img\n            src={backgroundImageUrl}\n            alt=\"\"\n            loading=\"lazy\"\n            onError={handleImageError}\n            className=\"h-full w-full object-cover\"\n          />\n          {overlayEnabled && (\n            <>\n              {/* Layer 1 — main bottom-to-top legibility gradient */}\n              <div\n                className=\"pointer-events-none absolute inset-0\"\n                style={editorialGradient}\n              />\n              {/* Layer 2 — diagonal bottom-left anchor (image reads top-right, content reads bottom-left) */}\n              <div\n                className=\"pointer-events-none absolute inset-0\"\n                style={{\n                  background: `linear-gradient(to top right, color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 65)}%, transparent), color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 25)}%, transparent) 35%, transparent 65%)`,\n                }}\n              />\n              {/* Layer 3 — radial pool anchoring the bottom-left share panel */}\n              <div\n                className=\"pointer-events-none absolute inset-0\"\n                style={{\n                  background: `radial-gradient(ellipse 70% 55% at 15% 100%, color-mix(in oklch, var(--color-foreground) ${Math.round(overlayOpacity * 45)}%, transparent), transparent 70%)`,\n                }}\n              />\n              {overlayType === \"solid\" && (\n                <div\n                  className=\"bg-foreground pointer-events-none absolute inset-0\"\n                  style={{ opacity: overlayOpacity * 0.35 }}\n                />\n              )}\n            </>\n          )}\n        </div>\n      ) : (\n        <EmptyHero accentColor={accentColor} textColor={textColor} />\n      )}\n\n      {/* Content */}\n      <div className={`relative flex min-h-[440px] flex-col p-${padding}`}>\n        {/* Top row: resource type eyebrow + optional price chip */}\n        {(showResourceType && resourceDescriptor) || displayPrice ? (\n          <div className=\"flex items-start justify-between gap-3\">\n            {showResourceType && resourceDescriptor ? (\n              (() => {\n                const { icon: ResourceIcon, label } = resourceDescriptor;\n                return (\n                  <span\n                    className={`inline-flex items-center gap-1.5 rounded-${borderRadius} bg-${textColor}/15 px-2.5 py-1 text-[10px] font-bold tracking-[0.18em] uppercase text-${textColor} backdrop-blur-sm`}\n                    style={{\n                      boxShadow: insetBorder(textColor, 15),\n                    }}\n                  >\n                    <ResourceIcon className=\"size-3\" />\n                    {label}\n                  </span>\n                );\n              })()\n            ) : (\n              <span />\n            )}\n            {displayPrice && (\n              <span\n                className={`inline-flex items-center rounded-${borderRadius} bg-${accentColor} px-2.5 py-1 text-[11px] font-bold tabular-nums text-${accentColor}-foreground`}\n                style={{\n                  boxShadow: `0 4px 14px -4px color-mix(in oklch, var(--color-foreground) 30%, transparent)`,\n                }}\n              >\n                {displayPrice}\n              </span>\n            )}\n          </div>\n        ) : null}\n\n        {/* Middle: spacer that keeps share panel bottom-anchored.\n            Optional title renders inside it without changing layout rhythm. */}\n        <div\n          className={`mt-4 flex flex-1 flex-col justify-end ${isClickable ? \"cursor-pointer\" : \"\"}`}\n          {...(isClickable\n            ? {\n                role: \"button\" as const,\n                tabIndex: 0,\n                \"aria-label\": displayTitle || \"View item detail\",\n                onClick: handleItemClick,\n                onKeyDown: (e: React.KeyboardEvent) => {\n                  if (e.key === \"Enter\" || e.key === \" \") {\n                    e.preventDefault();\n                    handleItemClick();\n                  }\n                },\n              }\n            : {})}\n        >\n          {titleEnabled && displayTitle && (\n            <h2\n              className={`text-${titleFontSize} font-header leading-[1.12] font-bold tracking-[-0.015em] text-${titleColor}`}\n              style={{\n                // Themed via foreground so the legibility shadow flips with\n                // the title color when the theme switches to dark mode.\n                textShadow: showHeroImage\n                  ? `0 2px 12px color-mix(in oklch, var(--color-foreground) 40%, transparent)`\n                  : undefined,\n              }}\n            >\n              {displayTitle}\n            </h2>\n          )}\n        </div>\n\n        {/* Bottom: share panel */}\n        <div className=\"mt-6 flex flex-col gap-3\">\n          <div className=\"flex items-stretch gap-3\">\n            {/* QR card */}\n            <div\n              className={`group relative shrink-0 rounded-${borderRadius} bg-white p-2.5 transition-transform duration-300 hover:scale-[1.02]`}\n              style={{\n                // QR card stays white for scanner contrast; lift shadow is\n                // themed via foreground so it reads in dark mode too.\n                boxShadow: `0 4px 16px -4px color-mix(in oklch, var(--color-foreground) 25%, transparent), inset 0 0 0 1px rgba(255,255,255,0.4)`,\n              }}\n              aria-label=\"QR code for share link\"\n            >\n              <QRCodeSVG\n                value={shareLink || \"https://example.com\"}\n                size={96}\n                level=\"H\"\n                bgColor=\"#ffffff\"\n                fgColor=\"#0f172a\"\n              />\n            </div>\n\n            {/* URL chip + share actions rail */}\n            <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n              <span\n                className={`text-[10px] font-bold tracking-[0.16em] uppercase text-${textColor}/70`}\n              >\n                Share link\n              </span>\n              <button\n                type=\"button\"\n                onClick={shareLinkFailed ? handleRetryShareLink : handleCopy}\n                disabled={!hasShareLink && !shareLinkFailed}\n                aria-label={\n                  shareLinkFailed\n                    ? \"Retry loading share link\"\n                    : copyState === \"copied\"\n                      ? \"Copied to clipboard\"\n                      : \"Copy link\"\n                }\n                className={`group flex items-center justify-between gap-2 rounded-${borderRadius} bg-${textColor}/10 px-3 py-2 text-left text-[12px] backdrop-blur-sm transition-all duration-300 hover:bg-${textColor}/15 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--quick-share-focus-ring)] disabled:opacity-50 ${copyState === \"copied\" ? `bg-${accentColor}/20` : \"\"}`}\n                style={\n                  {\n                    \"--quick-share-focus-ring\": colorMix(accentColor, 40),\n                    boxShadow: insetBorder(textColor, 15),\n                  } as QuickShareCSSProperties\n                }\n              >\n                <span\n                  className={`min-w-0 flex-1 truncate font-medium tabular-nums text-${textColor}`}\n                >\n                  {hasShareLink ? (\n                    <>\n                      {showDomainPrefix && prefix && (\n                        <span className={`opacity-60`}>{prefix}</span>\n                      )}\n                      <span className=\"font-semibold\">{path}</span>\n                    </>\n                  ) : shareLinkFailed ? (\n                    <span className={`opacity-80`}>\n                      Couldn&apos;t load link — tap to retry\n                    </span>\n                  ) : shareLinkLoading ? (\n                    <span className={`opacity-60`}>Loading link…</span>\n                  ) : (\n                    <span className={`opacity-60`}>No link yet</span>\n                  )}\n                </span>\n                <span\n                  className={`flex size-7 shrink-0 items-center justify-center rounded-full transition-all duration-300 ${copyState === \"copied\" ? `bg-${accentColor} text-${accentColor}-foreground scale-110` : `bg-${textColor}/15 text-${textColor}`}`}\n                >\n                  {shareLinkFailed ? (\n                    <RotateCw className=\"size-3.5\" />\n                  ) : copyState === \"copied\" ? (\n                    <Check className=\"size-3.5\" />\n                  ) : (\n                    <Copy className=\"size-3.5\" />\n                  )}\n                </span>\n              </button>\n              <span className=\"sr-only\" aria-live=\"polite\" role=\"status\">\n                {copyState === \"copied\"\n                  ? \"Copied to clipboard\"\n                  : shareLinkFailed\n                    ? \"Couldn't load share link, tap to retry\"\n                    : \"\"}\n              </span>\n\n              {showShareActions && (\n                <ShareActionRow\n                  shareLink={shareLink}\n                  displayTitle={displayTitle}\n                  accentColor={accentColor}\n                  textColor={textColor}\n                  borderRadius={borderRadius}\n                  onNative={handleNativeShare}\n                />\n              )}\n            </div>\n          </div>\n\n          {shouldShowBuyButton &&\n            (hasShareLink ? (\n              <a\n                href={shareLink}\n                target=\"_blank\"\n                rel=\"noopener noreferrer\"\n                className={`flex w-full items-center justify-center gap-2 rounded-${borderRadius} bg-${accentColor} px-4 py-3 text-[13px] font-bold text-${accentColor}-foreground transition-transform hover:scale-[1.01]`}\n                style={{\n                  boxShadow: `0 8px 22px -8px color-mix(in oklch, var(--color-foreground) 35%, transparent)`,\n                }}\n              >\n                <ShoppingCart className=\"size-4\" />\n                <span>Buy now</span>\n              </a>\n            ) : (\n              <button\n                type=\"button\"\n                disabled\n                className={`flex w-full cursor-not-allowed items-center justify-center gap-2 rounded-${borderRadius} bg-${accentColor} px-4 py-3 text-[13px] font-bold text-${accentColor}-foreground opacity-50`}\n                style={{\n                  boxShadow: `0 8px 22px -8px color-mix(in oklch, var(--color-foreground) 35%, transparent)`,\n                }}\n              >\n                <ShoppingCart className=\"size-4\" />\n                <span>Buy now</span>\n              </button>\n            ))}\n        </div>\n      </div>\n    </div>\n  );\n}\n\ntype ShareActionRowProps = {\n  shareLink: string;\n  displayTitle: string;\n  accentColor: ColorOptions;\n  textColor: ColorOptions;\n  borderRadius: BorderRadiusOptions;\n  onNative: () => void;\n};\n\nfunction ShareActionRow({\n  shareLink,\n  displayTitle,\n  accentColor,\n  textColor,\n  borderRadius,\n  onNative,\n}: ShareActionRowProps) {\n  const disabled = !shareLink;\n  const { canNativeShare, canSendSms } = useShareCapabilities();\n\n  const emailHref = shareLink\n    ? `mailto:?subject=${encodeURIComponent(displayTitle)}&body=${encodeURIComponent(shareLink)}`\n    : undefined;\n  const smsHref = shareLink\n    ? `sms:?body=${encodeURIComponent(`${displayTitle} — ${shareLink}`)}`\n    : undefined;\n\n  return (\n    <div className=\"flex items-center gap-1.5\">\n      <ShareActionButton\n        icon={Mail}\n        label=\"Email\"\n        href={emailHref}\n        disabled={disabled}\n        accentColor={accentColor}\n        textColor={textColor}\n        borderRadius={borderRadius}\n      />\n      {canSendSms && (\n        <ShareActionButton\n          icon={MessageCircle}\n          label=\"Text\"\n          href={smsHref}\n          disabled={disabled}\n          accentColor={accentColor}\n          textColor={textColor}\n          borderRadius={borderRadius}\n        />\n      )}\n      {canNativeShare && (\n        <ShareActionButton\n          icon={Share2}\n          label=\"Share\"\n          onClick={onNative}\n          disabled={disabled}\n          accentColor={accentColor}\n          textColor={textColor}\n          borderRadius={borderRadius}\n        />\n      )}\n    </div>\n  );\n}\n\ntype ShareActionButtonProps = {\n  icon: LucideIcon;\n  label: string;\n  href?: string | undefined;\n  onClick?: () => void;\n  disabled: boolean;\n  accentColor: ColorOptions;\n  textColor: ColorOptions;\n  borderRadius: BorderRadiusOptions;\n};\n\nfunction ShareActionButton({\n  icon: Icon,\n  label,\n  href,\n  onClick,\n  disabled,\n  accentColor,\n  textColor,\n  borderRadius,\n}: ShareActionButtonProps) {\n  const className = `group inline-flex items-center gap-1.5 rounded-${borderRadius} bg-${textColor}/10 px-2.5 py-1.5 text-[11px] font-semibold text-${textColor} backdrop-blur-sm transition-all duration-200 hover:-translate-y-0.5 hover:bg-${accentColor} hover:text-${accentColor}-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--quick-share-focus-ring)] disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:translate-y-0`;\n  const style: QuickShareCSSProperties = {\n    \"--quick-share-focus-ring\": colorMix(accentColor, 40),\n    boxShadow: insetBorder(textColor, 15),\n  };\n\n  const content = (\n    <>\n      <Icon className=\"size-3\" />\n      <span>{label}</span>\n    </>\n  );\n\n  if (href && !disabled) {\n    return (\n      <a href={href} className={className} style={style} aria-label={label}>\n        {content}\n      </a>\n    );\n  }\n\n  return (\n    <button\n      type=\"button\"\n      onClick={onClick}\n      disabled={disabled}\n      className={className}\n      style={style}\n      aria-label={label}\n    >\n      {content}\n    </button>\n  );\n}\n\nfunction EmptyHero({\n  accentColor,\n  textColor,\n}: {\n  accentColor: ColorOptions;\n  textColor: ColorOptions;\n}) {\n  return (\n    <div className={`bg-muted absolute inset-0`}>\n      <div\n        className=\"absolute inset-0\"\n        style={{\n          background: `radial-gradient(circle at 30% 20%, ${colorMix(accentColor, 15)}, transparent 60%), radial-gradient(circle at 80% 90%, ${colorMix(accentColor, 10)}, transparent 55%)`,\n        }}\n      />\n      <div className=\"absolute inset-0 flex flex-col items-center justify-center gap-3\">\n        <div\n          className={`flex size-14 items-center justify-center rounded-2xl bg-${textColor}/5`}\n          style={{ boxShadow: insetBorder(textColor, 10) }}\n        >\n          <ImageIcon className={`size-6 text-${textColor}/40`} />\n        </div>\n        <span\n          className={`text-[10px] font-bold tracking-[0.2em] uppercase text-${textColor}/45`}\n        >\n          Nothing selected\n        </span>\n      </div>\n    </div>\n  );\n}\n\nexport const quickShareWidgetPropertySchema: WidgetPropertySchema = {\n  widgetType: \"QuickShareWidget\",\n  displayName: \"Quick Share Widget\",\n  tabsConfig: [{ id: \"styling\", label: \"Styling\" }],\n  fields: [\n    // Content\n    {\n      key: \"shareableResource\",\n      label: \"Shareable Content\",\n      type: \"resource\",\n      description: \"Select the content to generate a share link for\",\n      // See link-type-schema-fields.ts — the share path has no\n      // enrollment-pack shareable type.\n      allowedTypes: [\"Product\", \"Page\", \"Medium\", \"Library\"],\n      tab: \"styling\",\n      group: \"Content\",\n    },\n\n    // Title\n    {\n      key: \"titleEnabled\",\n      label: \"Show Title\",\n      type: \"boolean\",\n      description: \"Display a title on the hero\",\n      defaultValue: true,\n      tab: \"styling\",\n      group: \"Title\",\n    },\n    {\n      key: \"titleText\",\n      label: \"Title\",\n      type: \"text\",\n      description:\n        \"Custom title text (defaults to the resource title if empty)\",\n      defaultValue: \"\",\n      tab: \"styling\",\n      group: \"Title\",\n      requiresKeyToBeTrue: \"titleEnabled\",\n    },\n    getFontSizeField({\n      key: \"titleFontSize\",\n      label: \"Title Font Size\",\n      description: \"Font size for the title\",\n      defaultValue: \"2xl\",\n      tab: \"styling\",\n      group: \"Title\",\n      requiresKeyToBeTrue: \"titleEnabled\",\n    }),\n    getColorField({\n      key: \"titleColor\",\n      label: \"Title Color\",\n      description: \"Color for the title\",\n      defaultValue: \"background\",\n      tab: \"styling\",\n      group: \"Title\",\n      requiresKeyToBeTrue: \"titleEnabled\",\n    }),\n\n    // Share panel polish (new)\n    {\n      key: \"showResourceType\",\n      label: \"Show Resource Type Pill\",\n      type: \"boolean\",\n      description:\n        \"Display a small type eyebrow chip (Product · Page · Media…)\",\n      defaultValue: true,\n      tab: \"styling\",\n      group: \"Share Panel\",\n    },\n    {\n      key: \"showShareActions\",\n      label: \"Show Share Actions\",\n      type: \"boolean\",\n      description:\n        \"Show Email, Text, and native Share buttons under the link chip\",\n      defaultValue: true,\n      tab: \"styling\",\n      group: \"Share Panel\",\n    },\n    {\n      key: \"showDomainPrefix\",\n      label: \"Show Domain Prefix\",\n      type: \"boolean\",\n      description:\n        \"Include the domain in the link chip (dimmed) with the path emphasized\",\n      defaultValue: true,\n      tab: \"styling\",\n      group: \"Share Panel\",\n    },\n    {\n      key: \"showBuyButton\",\n      label: \"Show Buy Button\",\n      type: \"boolean\",\n      description: \"Display the Buy button (only shown for Product resources)\",\n      defaultValue: false,\n      tab: \"styling\",\n      group: \"Share Panel\",\n    },\n\n    // Design\n    getColorField({\n      key: \"textColor\",\n      label: \"Text Color\",\n      description: \"Default text color for widget content (over the hero)\",\n      defaultValue: \"background\",\n      tab: \"styling\",\n      group: \"Design\",\n    }),\n    getColorField({\n      key: \"accentColor\",\n      label: \"Accent Color\",\n      description:\n        \"Drives the price chip, primary button, and copy-success flash\",\n      defaultValue: \"primary\",\n      tab: \"styling\",\n      group: \"Design\",\n    }),\n    {\n      key: \"overlayEnabled\",\n      label: \"Enable Overlay\",\n      type: \"boolean\",\n      description: \"Add editorial gradient stack for legibility over the hero\",\n      defaultValue: true,\n      tab: \"styling\",\n      group: \"Design\",\n    },\n    {\n      key: \"overlayType\",\n      label: \"Overlay Type\",\n      type: \"buttonGroup\",\n      description:\n        \"Gradient only (recommended) or gradient + solid wash (heavier)\",\n      defaultValue: \"gradient\",\n      options: [\n        { label: \"Gradient\", value: \"gradient\" },\n        { label: \"Solid\", value: \"solid\" },\n      ],\n      tab: \"styling\",\n      group: \"Design\",\n      requiresKeyToBeTrue: \"overlayEnabled\",\n    },\n    {\n      key: \"overlayIntensity\",\n      label: \"Overlay Intensity\",\n      type: \"slider\",\n      description: \"Opacity of the overlay (0-100)\",\n      min: 0,\n      max: 100,\n      step: 5,\n      defaultValue: 70,\n      unit: \"%\",\n      tab: \"styling\",\n      group: \"Design\",\n      requiresKeyToBeTrue: \"overlayEnabled\",\n    },\n    {\n      key: \"separator\",\n      type: \"separator\",\n      label: \"Separator\",\n      tab: \"styling\",\n      group: \"Design\",\n    },\n    getPaddingField({\n      key: \"padding\",\n      label: \"Padding\",\n      description: \"Padding around the widget content\",\n      defaultValue: 6,\n      tab: \"styling\",\n      group: \"Design\",\n    }),\n    getBorderRadiusField({\n      key: \"borderRadius\",\n      label: \"Border Radius\",\n      description: \"Border radius for the widget container\",\n      defaultValue: \"xl\",\n      tab: \"styling\",\n      group: \"Design\",\n    }),\n    getBorderWidthField({\n      key: \"borderWidth\",\n      label: \"Border Width\",\n      description: \"Border width for the widget container\",\n      defaultValue: \"none\",\n      tab: \"styling\",\n      group: \"Design\",\n    }),\n    getBorderColorField({\n      key: \"borderColor\",\n      label: \"Border Color\",\n      description: \"Border color for the widget container\",\n      defaultValue: \"muted\",\n      tab: \"styling\",\n      group: \"Design\",\n    }),\n  ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;AAwFA,MAAM,oBAAwD;CAC5D,SAAS;EAAE,OAAO;EAAW,MAAM;EAAS;CAC5C,MAAM;EAAE,OAAO;EAAQ,MAAM;EAAU;CACvC,gBAAgB;EAAE,OAAO;EAAc,MAAM;EAAQ;CACrD,QAAQ;EAAE,OAAO;EAAS,MAAMA;EAAW;CAC3C,SAAS;EAAE,OAAO;EAAW,MAAM;EAAU;CAC9C;AAED,MAAM,yBACJ,aAC8B;CAC9B,MAAM,UAAW,UAAU,QAAQ,UAAU,iBAAiB;AAC9D,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO,kBAAkB,YAAY;EAAE,OAAO;EAAS,MAAM;EAAW;;AAG1E,MAAM,YAAY,QAAkD;AAClE,KAAI;EACF,MAAM,SAAS,IAAI,IAAI,IAAI;AAC3B,SAAO;GACL,QAAQ,GAAG,OAAO,SAAS,IAAI,OAAO;GACtC,MAAM,GAAG,OAAO,WAAW,OAAO,SAAS,OAAO;GACnD;SACK;AACN,SAAO;GAAE,QAAQ;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KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD,iBAAiB;GACf,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB,CAAC;EAGF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EAGD,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,cAAc;GACZ,KAAK;GACL,OAAO;GACP,aACE;GACF,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aACE;GACF,cAAc;GACd,SAAS,CACP;IAAE,OAAO;IAAY,OAAO;IAAY,EACxC;IAAE,OAAO;IAAS,OAAO;IAAS,CACnC;GACD,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,OAAO;GACP,MAAM;GACN,aAAa;GACb,KAAK;GACL,KAAK;GACL,MAAM;GACN,cAAc;GACd,MAAM;GACN,KAAK;GACL,OAAO;GACP,qBAAqB;GACtB;EACD;GACE,KAAK;GACL,MAAM;GACN,OAAO;GACP,KAAK;GACL,OAAO;GACR;EACD,gBAAgB;GACd,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,qBAAqB;GACnB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACF,oBAAoB;GAClB,KAAK;GACL,OAAO;GACP,aAAa;GACb,cAAc;GACd,KAAK;GACL,OAAO;GACR,CAAC;EACH;CACF"}