{"version":3,"file":"PointsWidget-Mu6mq7T2.cjs","names":["useWidgetsApi","useWidgetPreviewContext","useDataSourceRegistryConfig","useOptionalStore","borderWidthClasses","borderColorClasses","WidgetLoadingSkeleton","ErrorState","Coins","ChevronDown","getFontSizeField","getColorField","getPaddingField","getBorderRadiusField","getBorderWidthField","getBorderColorField"],"sources":["../../core/src/format/title-case.ts","../../widgets/src/hooks/use-points-ledger.preview.ts","../../widgets/src/hooks/use-points-ledger.ts","../../react/src/hooks/use-points-label.ts","../../widgets/src/widgets/PointsWidget.tsx"],"sourcesContent":["/**\n * Turn a snake_case value into Title Case words, e.g. `order_redemption` ->\n * `Order Redemption`. Only the first character of each word is upper-cased; the\n * rest is left verbatim.\n *\n * Shared by the portal points-history surfaces (PointsWidget, ProfileLayout) so\n * they render labels like points-ledger transaction types identically. The\n * standalone apps (fluid-pay, fluid-checkout) and profile-ui intentionally keep\n * their own transaction-type formatters — they live in separate translation\n * domains and aren't consolidated here.\n */\nexport function titleCaseFromSnake(value: string): string {\n  return value\n    .split(\"_\")\n    .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n    .join(\" \");\n}\n","import type { PointsData } from \"@fluid-app/portal-core/widgets-api-types\";\n\nconst now = new Date();\n\nfunction daysAgo(days: number): string {\n  return new Date(now.getTime() - days * 86_400_000).toISOString();\n}\n\nexport const PREVIEW_DATA: PointsData = {\n  balance: 25,\n  entries: [\n    {\n      id: 1,\n      amount: 20,\n      createdAt: daysAgo(3),\n      transactionType: \"new_order\",\n      hasSource: true,\n    },\n    {\n      id: 2,\n      amount: 50,\n      createdAt: daysAgo(14),\n      transactionType: \"referral_bonus\",\n      hasSource: true,\n    },\n    {\n      id: 3,\n      amount: -75,\n      createdAt: daysAgo(60),\n      transactionType: null,\n      hasSource: true,\n    },\n    {\n      id: 4,\n      amount: 30,\n      createdAt: daysAgo(90),\n      transactionType: \"welcome_reward\",\n      hasSource: true,\n    },\n  ],\n};\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useWidgetsApi } from \"@fluid-app/portal-core/widgets-api-context\";\nimport { useWidgetPreviewContext } from \"@fluid-app/portal-react/data-sources/preview-context\";\nimport { useDataSourceRegistryConfig } from \"@fluid-app/portal-react/data-sources/registry-context\";\nimport { PREVIEW_DATA } from \"./use-points-ledger.preview\";\nimport type { PointsData } from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport type {\n  PointsData,\n  PointsEntry,\n} from \"@fluid-app/portal-core/widgets-api-types\";\n\nexport const POINTS_LEDGER_QUERY_KEY = \"points-ledger\" as const;\n\nexport function usePointsLedger(): UseQueryResult<PointsData, Error> {\n  const widgetsApi = useWidgetsApi();\n  const { isPreview } = useWidgetPreviewContext();\n  const registryConfig = useDataSourceRegistryConfig();\n  const { baseUrl } = registryConfig;\n  const customerId = registryConfig.variables?.customer_id;\n\n  // Contract: the BFF adapter (portal app, composite factory spreads BFF over\n  // legacy) ignores customerId and infers the customer from the JWT, so the\n  // portal renders this widget with no registry-variable plumbing. The legacy\n  // adapter (fluid-admin) builds /v202506/customers/{customerId}/points_ledgers\n  // and MUST receive a real id; that consumer always supplies one via registry\n  // variables, so empty string never reaches the legacy URL in practice. If a\n  // future caller wires this hook to a legacy-only adapter, configure\n  // registry variables.customer_id at the provider — otherwise the request\n  // would 404 on /customers//points_ledgers.\n  return useQuery({\n    queryKey: [\n      \"portal-widget-use\",\n      POINTS_LEDGER_QUERY_KEY,\n      isPreview ? \"preview\" : baseUrl,\n      customerId ?? null,\n    ] as const,\n    queryFn: ({ signal }) =>\n      widgetsApi.fetchPointsLedger(customerId ?? \"\", signal),\n    enabled: !isPreview,\n    ...(isPreview && { placeholderData: PREVIEW_DATA }),\n  });\n}\n","import { useMemo } from \"react\";\nimport { useOptionalStore } from \"./use-optional-store\";\n\nexport interface PointsLabel {\n  singular: string;\n  plural: string;\n}\n\n/**\n * Platform defaults, mirroring the backend column defaults. Used whenever the\n * store is unavailable (preview/builder) or a company hasn't overridden the\n * label.\n */\nexport const DEFAULT_POINTS_LABEL: PointsLabel = {\n  singular: \"point\",\n  plural: \"points\",\n};\n\n/**\n * Resolves the per-company reward-points label for use across portal surfaces\n * (widgets, order details, etc.).\n *\n * Reads the store via `useOptionalStore()`, which is preview-safe: the widget\n * palette / drag-preview mounts widgets without a StoreApiProvider, so the\n * underlying query is disabled and we fall back to the platform defaults. The\n * shared hook reuses `useStore()`'s cache key, so the result is deduped with\n * the rest of the app's store cache.\n */\nexport function usePointsLabel(): PointsLabel {\n  const { data } = useOptionalStore();\n\n  // `.trim() ||` (not `??`) so a blank/whitespace-only tenant label falls back\n  // to the platform default instead of rendering an empty string — matching the\n  // fluid-pay / fluid-checkout points-label helpers.\n  const singular =\n    data?.reward_points_label_singular?.trim() || DEFAULT_POINTS_LABEL.singular;\n  const plural =\n    data?.reward_points_label_plural?.trim() || DEFAULT_POINTS_LABEL.plural;\n\n  return useMemo(() => ({ singular, plural }), [singular, plural]);\n}\n","import { useId, useState, type ComponentProps } from \"react\";\nimport type React from \"react\";\nimport type {\n  BackgroundValue,\n  BorderRadiusOptions,\n  BorderWidthOptions,\n  ColorOptions,\n  FontSizeOptions,\n  PaddingOptions,\n} from \"@fluid-app/portal-core/types\";\nimport type { WidgetPropertySchema } from \"@fluid-app/portal-core/registries\";\nimport { titleCaseFromSnake } from \"@fluid-app/portal-core/format/title-case\";\nimport {\n  getBorderRadiusField,\n  getBorderWidthField,\n  getBorderColorField,\n  getColorField,\n  getFontSizeField,\n  getPaddingField,\n  borderWidthClasses,\n  borderColorClasses,\n} from \"../core/fields\";\nimport { usePointsLedger, type PointsEntry } from \"../hooks/use-points-ledger\";\nimport { usePointsLabel } from \"@fluid-app/portal-react/hooks/use-points-label\";\nimport { ErrorState } from \"../components/error-state\";\nimport { WidgetLoadingSkeleton } from \"../components/WidgetLoadingSkeleton\";\nimport { ChevronDown, Coins } from \"lucide-react\";\n\nconst formatBalance = (balance: number): string => {\n  return balance.toLocaleString(\"en-US\");\n};\n\n/** Capitalize the first letter for display in headings / sentence-leading copy. */\nconst capitalize = (value: string): string =>\n  value.charAt(0).toUpperCase() + value.slice(1);\n\nexport function formatTransactionType(\n  entry: PointsEntry,\n  pluralLabel: string,\n): string {\n  // Rails stamps \"order_credit\" on an order's points accrual. That is the same\n  // event the hasSource branch below renders, so it keeps the company's own\n  // points label instead of falling through to the generic type name.\n  //\n  // Handled directly rather than by falling through, matching the profile,\n  // checkout and pay formatters. hasSource is set only when metadata.source is\n  // present, and the public ledger endpoint passes client metadata through\n  // verbatim, so a typed entry can arrive without one and must still be\n  // branded rather than read \"Transaction\".\n  if (entry.transactionType === \"order_credit\") {\n    return entry.amount > 0\n      ? `${pluralLabel} Awarded`\n      : `${pluralLabel} Redeemed`;\n  }\n  if (entry.transactionType) {\n    return titleCaseFromSnake(entry.transactionType);\n  }\n  if (entry.hasSource) {\n    return entry.amount > 0\n      ? `${pluralLabel} Awarded`\n      : `${pluralLabel} Redeemed`;\n  }\n  return \"Transaction\";\n}\n\nfunction formatEntryDate(dateString: string): string {\n  if (!dateString) return \"\";\n  const date = new Date(dateString);\n  return date.toLocaleDateString(undefined, {\n    month: \"short\",\n    day: \"numeric\",\n    year: \"numeric\",\n  });\n}\n\ntype PointsWidgetProps = ComponentProps<\"div\"> & {\n  // Title\n  titleEnabled?: boolean;\n  title?: string;\n  titleFontSize?: FontSizeOptions;\n  titleColor?: ColorOptions;\n\n  // Balance\n  balanceColor?: ColorOptions;\n\n  // History\n  historyEnabled?: boolean;\n  historyTitle?: string;\n\n  // Styling\n  background?: BackgroundValue;\n  textColor?: ColorOptions;\n  accentColor?: ColorOptions;\n  padding?: PaddingOptions;\n  borderRadius?: BorderRadiusOptions;\n  borderWidth?: BorderWidthOptions;\n  borderColor?: ColorOptions;\n};\n\nfunction PointsEntryRow({\n  entry,\n  isLast,\n  textColor,\n  accentColor,\n  backgroundColor,\n  pointsLabelPlural,\n}: {\n  entry: PointsEntry;\n  isLast: boolean;\n  textColor: ColorOptions;\n  accentColor: ColorOptions;\n  backgroundColor: ColorOptions;\n  pointsLabelPlural: string;\n}) {\n  const isPositive = entry.amount >= 0;\n  const prefix = isPositive ? \"+\" : \"\";\n  return (\n    <div className=\"flex flex-row items-stretch gap-3\">\n      <div className=\"relative flex w-2 flex-col items-center\">\n        {!isLast && (\n          <div\n            className={`bg-${textColor}/40 absolute top-3 -bottom-3 left-1/2 w-px -translate-x-1/2`}\n          />\n        )}\n        <div\n          className={`border-${textColor}/60 bg-${backgroundColor} relative mt-3 h-2 w-2 shrink-0 rounded-full border`}\n        />\n      </div>\n      <div className=\"flex flex-1 flex-row items-start justify-between py-1.5\">\n        <div className=\"flex min-w-0 flex-col\">\n          <div className={`text-sm font-medium text-${textColor} truncate`}>\n            {formatTransactionType(entry, pointsLabelPlural)}\n          </div>\n          <div className={`text-sm text-${textColor} opacity-70`}>\n            {formatEntryDate(entry.createdAt)}\n          </div>\n        </div>\n        <div\n          className={`text-sm font-medium ${isPositive ? `text-${accentColor}` : \"text-destructive\"}`}\n        >\n          {prefix}\n          {entry.amount.toLocaleString(\"en-US\")}\n        </div>\n      </div>\n    </div>\n  );\n}\n\nexport function PointsWidget({\n  // Title\n  titleEnabled = true,\n  title,\n  titleFontSize = \"md\",\n  titleColor = \"foreground\",\n\n  // Balance\n  balanceColor = \"primary\",\n\n  // History\n  historyEnabled = true,\n  historyTitle = \"History\",\n\n  // Styling\n  background = { type: \"solid\", color: \"background\" },\n  textColor = \"foreground\",\n  accentColor = \"primary\",\n  padding = 4,\n  borderRadius = \"md\",\n  borderWidth = \"none\",\n  borderColor = \"muted\",\n\n  className,\n  ...props\n}: PointsWidgetProps): React.JSX.Element {\n  const [historyOpen, setHistoryOpen] = useState(false);\n  const historyPanelId = useId();\n\n  // Per-company reward-points label (falls back to \"points\"). Used as the\n  // default heading and in empty/transaction copy when the admin hasn't set a\n  // custom title.\n  const { plural } = usePointsLabel();\n  const pointsLabelPlural = capitalize(plural);\n\n  const backgroundColor = background.color || \"background\";\n  const backgroundImage =\n    (background.resource?.image_url || background.resource?.imageUrl) &&\n    background.type === \"image\"\n      ? `url(${background.resource.image_url || background.resource.imageUrl})`\n      : \"none\";\n\n  const { data, isLoading, isError } = usePointsLedger();\n\n  return (\n    <div\n      className={`@container overflow-hidden rounded-${borderRadius} bg-${backgroundColor} ${borderWidthClasses[borderWidth]} ${borderWidth !== \"none\" ? borderColorClasses[borderColor] : \"\"} ${className ?? \"\"}`}\n      style={{ backgroundImage }}\n      {...props}\n    >\n      <div className={`p-${padding} flex flex-col gap-2.5`}>\n        {/* Header: Title + Balance */}\n        {titleEnabled && (\n          <h2\n            className={`text-${titleFontSize} font-header font-bold text-${titleColor}`}\n          >\n            {title?.trim() ? title : pointsLabelPlural}\n          </h2>\n        )}\n        {!isLoading && data && (\n          <span\n            className={`text-3xl font-semibold text-${balanceColor} font-header leading-snug`}\n          >\n            {formatBalance(data.balance)}\n          </span>\n        )}\n\n        {/* Loading */}\n        {isLoading ? (\n          <WidgetLoadingSkeleton minHeight={60} rows={1} />\n        ) : isError ? (\n          <ErrorState />\n        ) : historyEnabled && (!data || data.entries.length === 0) ? (\n          /* Empty state — only shown when history is enabled but no entries */\n          <div className=\"flex min-h-[60px] flex-col items-center justify-center gap-2\">\n            <Coins className={`size-10 text-${textColor} opacity-30`} />\n            <p className={`text-sm font-semibold text-${textColor} opacity-50`}>\n              No {pointsLabelPlural} Activity\n            </p>\n          </div>\n        ) : historyEnabled && data && data.entries.length > 0 ? (\n          /* History dropdown */\n          <div className=\"flex flex-col gap-2\">\n            {/* Dropdown toggle */}\n            <button\n              type=\"button\"\n              aria-expanded={historyOpen}\n              aria-controls={historyPanelId}\n              onClick={() => setHistoryOpen((prev) => !prev)}\n              className={`flex w-full items-center text-xs font-semibold text-${textColor} cursor-pointer`}\n            >\n              <span className=\"flex-1 text-left\">{historyTitle}</span>\n              <ChevronDown\n                className={`size-4 transition-transform duration-200 ${historyOpen ? \"rotate-180\" : \"\"}`}\n              />\n            </button>\n            <div className={`bg-${textColor}/20 h-px w-full`} />\n\n            {/* Collapsible entries */}\n            <div\n              id={historyPanelId}\n              className={`flex flex-col ${!historyOpen ? \"hidden\" : \"\"}`}\n            >\n              {data.entries.map((entry, index) => (\n                <PointsEntryRow\n                  key={entry.id}\n                  entry={entry}\n                  isLast={index === data.entries.length - 1}\n                  textColor={textColor}\n                  accentColor={accentColor}\n                  backgroundColor={backgroundColor}\n                  pointsLabelPlural={pointsLabelPlural}\n                />\n              ))}\n            </div>\n          </div>\n        ) : null}\n      </div>\n    </div>\n  );\n}\n\nexport const pointsWidgetPropertySchema: WidgetPropertySchema = {\n  widgetType: \"PointsWidget\",\n  displayName: \"Points\",\n  fields: [\n    // Title group\n    {\n      key: \"titleEnabled\",\n      label: \"Show Title\",\n      type: \"boolean\",\n      description: \"Toggle title visibility\",\n      defaultValue: true,\n\n      group: \"Title\",\n    },\n    {\n      key: \"title\",\n      label: \"Title\",\n      type: \"text\",\n      description:\n        \"Title text displayed above the balance. Leave blank to use the company's configured points label.\",\n      defaultValue: \"\",\n\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: \"md\",\n\n      group: \"Title\",\n      requiresKeyToBeTrue: \"titleEnabled\",\n    }),\n    getColorField({\n      key: \"titleColor\",\n      label: \"Title Color\",\n      description: \"Color for the title\",\n      defaultValue: \"foreground\",\n\n      group: \"Title\",\n      requiresKeyToBeTrue: \"titleEnabled\",\n    }),\n\n    // Balance group\n    getColorField({\n      key: \"balanceColor\",\n      label: \"Balance Color\",\n      description: \"Color for the points balance number\",\n      defaultValue: \"primary\",\n\n      group: \"Balance\",\n    }),\n\n    // History group\n    {\n      key: \"historyEnabled\",\n      label: \"Show History\",\n      type: \"boolean\",\n      description: \"Show a collapsible history dropdown below the balance\",\n      defaultValue: true,\n\n      group: \"History\",\n    },\n    {\n      key: \"historyTitle\",\n      label: \"History Title\",\n      type: \"text\",\n      description: \"Title for the history dropdown\",\n      defaultValue: \"History\",\n\n      group: \"History\",\n      requiresKeyToBeTrue: \"historyEnabled\",\n    },\n\n    // Design group\n    {\n      type: \"background\",\n      key: \"background\",\n      label: \"Background\",\n      description: \"Background for the widget\",\n      defaultValue: { type: \"solid\", color: \"background\" },\n\n      group: \"Design\",\n    },\n    getColorField({\n      key: \"textColor\",\n      label: \"Text Color\",\n      description: \"Default text color\",\n      defaultValue: \"foreground\",\n\n      group: \"Design\",\n    }),\n    getColorField({\n      key: \"accentColor\",\n      label: \"Accent Color\",\n      description: \"Color for positive points amounts\",\n      defaultValue: \"primary\",\n\n      group: \"Design\",\n    }),\n    {\n      key: \"separator\",\n      type: \"separator\",\n      label: \"Separator\",\n\n      group: \"Design\",\n    },\n    getPaddingField({\n      key: \"padding\",\n      label: \"Padding\",\n      description: \"Widget padding\",\n      defaultValue: 4,\n\n      group: \"Design\",\n    }),\n    getBorderRadiusField({\n      key: \"borderRadius\",\n      label: \"Border Radius\",\n      description: \"Widget border radius\",\n      defaultValue: \"md\",\n\n      group: \"Design\",\n    }),\n    getBorderWidthField({\n      key: \"borderWidth\",\n      label: \"Border Width\",\n      description: \"Widget border width\",\n      defaultValue: \"none\",\n\n      group: \"Design\",\n    }),\n    getBorderColorField({\n      key: \"borderColor\",\n      label: \"Border Color\",\n      description: \"Widget border color\",\n      defaultValue: \"muted\",\n\n      group: \"Design\",\n    }),\n  ],\n} as const satisfies WidgetPropertySchema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAgB,mBAAmB,OAAuB;AACxD,QAAO,MACJ,MAAM,IAAI,CACV,KAAK,SAAS,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,CAC3D,KAAK,IAAI;;;;ACbd,MAAM,sBAAM,IAAI,MAAM;AAEtB,SAAS,QAAQ,MAAsB;AACrC,yBAAO,IAAI,KAAK,IAAI,SAAS,GAAG,OAAO,MAAW,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