@page-speed/agent-everywhere 0.9.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -7977,7 +7977,7 @@ function KpiCardWithChart({
7977
7977
  return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { className: cn("w-full overflow-hidden bg-white p-7 sm:p-8", className), children: [
7978
7978
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
7979
7979
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
7980
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "truncate font-bold text-[1.4rem] text-slate-900 leading-tight tracking-tight", children: title }),
7980
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "truncate font-bold text-base text-slate-900 leading-tight tracking-tight", children: title }),
7981
7981
  formattedValue !== null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-1 flex items-center gap-2", children: [
7982
7982
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-bold text-2xl text-slate-900 tabular-nums", children: formattedValue }),
7983
7983
  delta && /* @__PURE__ */ jsxRuntime.jsx(DeltaPill, { value: delta.value, direction: delta.direction })
@@ -7986,7 +7986,7 @@ function KpiCardWithChart({
7986
7986
  rangeLabel && /* @__PURE__ */ jsxRuntime.jsx(
7987
7987
  "span",
7988
7988
  {
7989
- className: "shrink-0 rounded-full px-4 py-1.5 font-semibold text-sm",
7989
+ className: "shrink-0 rounded-full px-4 py-1.5 font-semibold text-xs",
7990
7990
  style: {
7991
7991
  color: pillColor,
7992
7992
  backgroundColor: hexToRgba(pillColor, 0.12)
@@ -8011,7 +8011,7 @@ function KpiCardWithChart({
8011
8011
  return /* @__PURE__ */ jsxRuntime.jsxs(
8012
8012
  "span",
8013
8013
  {
8014
- className: "flex flex-col text-slate-400 text-sm leading-tight",
8014
+ className: "flex flex-col text-slate-400 text-xs leading-tight",
8015
8015
  children: [
8016
8016
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: lead }),
8017
8017
  trailing !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { children: trailing })
@@ -8213,8 +8213,8 @@ function StackedSparklines({ rows, className }) {
8213
8213
  ),
8214
8214
  children: [
8215
8215
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
8216
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-[15px] text-slate-500 leading-tight", children: row.label }),
8217
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-bold text-3xl text-slate-900 leading-tight tracking-tight tabular-nums", children: row.value })
8216
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-slate-500 leading-tight", children: row.label }),
8217
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-bold text-2xl text-slate-900 leading-tight tracking-tight tabular-nums", children: row.value })
8218
8218
  ] }),
8219
8219
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-9 w-[28%] min-w-[88px] shrink-0", children: hasData ? /* @__PURE__ */ jsxRuntime.jsx(
8220
8220
  Sparkline,
@@ -8282,7 +8282,7 @@ function StatCardHalfCircle({
8282
8282
  /* @__PURE__ */ jsxRuntime.jsx(
8283
8283
  "h3",
8284
8284
  {
8285
- className: "font-semibold text-lg leading-tight",
8285
+ className: "font-semibold text-base leading-tight",
8286
8286
  style: { color: titleColor },
8287
8287
  children: title
8288
8288
  }
@@ -8330,7 +8330,7 @@ function StatCardHalfCircle({
8330
8330
  children: /* @__PURE__ */ jsxRuntime.jsx(
8331
8331
  "span",
8332
8332
  {
8333
- className: "font-bold text-5xl leading-none tabular-nums",
8333
+ className: "font-bold text-2xl leading-none tabular-nums",
8334
8334
  style: { color: valueColor },
8335
8335
  children: readout
8336
8336
  }
@@ -8339,11 +8339,11 @@ function StatCardHalfCircle({
8339
8339
  )
8340
8340
  ] }),
8341
8341
  (minLabel || maxLabel) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto mt-3 flex w-full max-w-[280px] items-baseline justify-between", children: [
8342
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm", style: { color: minLabelColor }, children: minLabel }),
8342
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-xs", style: { color: minLabelColor }, children: minLabel }),
8343
8343
  /* @__PURE__ */ jsxRuntime.jsx(
8344
8344
  "span",
8345
8345
  {
8346
- className: "font-semibold text-sm",
8346
+ className: "font-semibold text-xs",
8347
8347
  style: { color: resolvedMaxLabelColor },
8348
8348
  children: maxLabel
8349
8349
  }
@@ -8484,7 +8484,7 @@ function TableListArtifact({
8484
8484
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-4", className), children: [
8485
8485
  /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { className: "border-[#e5e7eb] p-6", children: [
8486
8486
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
8487
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-bold text-[1.125rem] text-slate-800 leading-snug", children: chartTitle }),
8487
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-bold text-base text-slate-800 leading-snug", children: chartTitle }),
8488
8488
  hasSeries && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-wrap items-center gap-x-4 gap-y-1", children: series.map((s) => /* @__PURE__ */ jsxRuntime.jsxs(
8489
8489
  "li",
8490
8490
  {
@@ -8617,7 +8617,7 @@ function TableListArtifact({
8617
8617
  hasSeries && xAxisLabels && xAxisLabels.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex justify-between px-1", children: xAxisLabels.map((label, i) => /* @__PURE__ */ jsxRuntime.jsx(
8618
8618
  "span",
8619
8619
  {
8620
- className: "text-slate-400 text-sm",
8620
+ className: "text-slate-400 text-xs",
8621
8621
  style: { color: AXIS_LABEL_COLOR },
8622
8622
  children: label
8623
8623
  },
@@ -8631,7 +8631,7 @@ function TableListArtifact({
8631
8631
  {
8632
8632
  scope: "col",
8633
8633
  className: cn(
8634
- "px-6 py-4 font-semibold text-[0.75rem] uppercase tracking-wider",
8634
+ "px-6 py-4 font-semibold text-xs uppercase tracking-wider",
8635
8635
  ALIGN_CLASS[col.align ?? "left"]
8636
8636
  ),
8637
8637
  style: { color: TABLE_HEADER_TEXT },
@@ -8652,7 +8652,7 @@ function TableListArtifact({
8652
8652
  "td",
8653
8653
  {
8654
8654
  className: cn(
8655
- "px-6 py-5 font-bold text-[1.0625rem]",
8655
+ "px-6 py-5 font-bold text-sm",
8656
8656
  ALIGN_CLASS[align]
8657
8657
  ),
8658
8658
  style: { color: FIRST_COL_TEXT },
@@ -8666,7 +8666,7 @@ function TableListArtifact({
8666
8666
  "td",
8667
8667
  {
8668
8668
  className: cn(
8669
- "px-6 py-5 text-[1.0625rem] text-slate-700 tabular-nums",
8669
+ "px-6 py-5 text-sm text-slate-700 tabular-nums",
8670
8670
  ALIGN_CLASS[align]
8671
8671
  ),
8672
8672
  children: row.value
@@ -8684,7 +8684,7 @@ function TableListArtifact({
8684
8684
  value: row.delta.text,
8685
8685
  direction: deltaDirection(row.delta.direction),
8686
8686
  hideArrow: true,
8687
- className: "bg-transparent px-0 py-0 font-semibold text-sm"
8687
+ className: "bg-transparent px-0 py-0 font-semibold text-xs"
8688
8688
  }
8689
8689
  ) : null
8690
8690
  },
@@ -8698,7 +8698,7 @@ function TableListArtifact({
8698
8698
  summaryText && /* @__PURE__ */ jsxRuntime.jsx(
8699
8699
  "p",
8700
8700
  {
8701
- className: "text-[1rem] leading-relaxed",
8701
+ className: "text-sm leading-relaxed",
8702
8702
  style: { color: SUMMARY_TEXT_COLOR },
8703
8703
  children: renderRich(summaryText)
8704
8704
  }
@@ -8736,12 +8736,12 @@ function KpiCardWithSparklines({
8736
8736
  const interactive = typeof onClick === "function";
8737
8737
  const body = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-6", children: [
8738
8738
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
8739
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-base text-slate-500 leading-snug", children: label }),
8739
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-xs text-slate-500 leading-snug", children: label }),
8740
8740
  icon != null && icon !== "" && /* @__PURE__ */ jsxRuntime.jsx(
8741
8741
  "span",
8742
8742
  {
8743
8743
  "aria-hidden": "true",
8744
- className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg font-semibold text-lg",
8744
+ className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg font-semibold text-base",
8745
8745
  style: {
8746
8746
  backgroundColor: iconChipBg ?? DEFAULT_ICON_CHIP_BG,
8747
8747
  color: iconChipFg ?? DEFAULT_ICON_CHIP_FG
@@ -8754,7 +8754,7 @@ function KpiCardWithSparklines({
8754
8754
  /* @__PURE__ */ jsxRuntime.jsx(
8755
8755
  "span",
8756
8756
  {
8757
- className: "font-extrabold text-5xl leading-none tracking-tight tabular-nums",
8757
+ className: "font-extrabold text-2xl leading-none tracking-tight tabular-nums",
8758
8758
  style: { color: valueColor ?? DEFAULT_VALUE_COLOR2 },
8759
8759
  children: value
8760
8760
  }
@@ -8765,7 +8765,7 @@ function KpiCardWithSparklines({
8765
8765
  value: delta.value,
8766
8766
  direction: delta.direction,
8767
8767
  tone: delta.tone,
8768
- className: "mb-1 px-2.5 py-1 text-sm"
8768
+ className: "mb-1 px-2.5 py-1 text-xs"
8769
8769
  }
8770
8770
  )
8771
8771
  ] }),
@@ -8818,7 +8818,7 @@ function LocationTableRow({ row }) {
8818
8818
  "span",
8819
8819
  {
8820
8820
  role: "cell",
8821
- className: "truncate font-semibold text-[1.0625rem] text-slate-800",
8821
+ className: "truncate font-semibold text-sm text-slate-800",
8822
8822
  children: row.name
8823
8823
  }
8824
8824
  ),
@@ -8826,7 +8826,7 @@ function LocationTableRow({ row }) {
8826
8826
  "span",
8827
8827
  {
8828
8828
  role: "cell",
8829
- className: "text-right text-[1.0625rem] text-slate-700 tabular-nums",
8829
+ className: "text-right text-sm text-slate-700 tabular-nums",
8830
8830
  children: row.revenue
8831
8831
  }
8832
8832
  ),
@@ -8856,7 +8856,7 @@ function LocationsRevenueCard({
8856
8856
  role: "row",
8857
8857
  className: cn(
8858
8858
  GRID_TEMPLATE,
8859
- "border-b bg-slate-50 py-4 font-semibold text-[0.75rem] text-slate-400 uppercase tracking-wider"
8859
+ "border-b bg-slate-50 py-4 font-semibold text-xs text-slate-400 uppercase tracking-wider"
8860
8860
  ),
8861
8861
  children: [
8862
8862
  /* @__PURE__ */ jsxRuntime.jsx("span", { role: "columnheader", className: "text-left", children: locationColumnLabel }),
@@ -8911,7 +8911,7 @@ function RowPair({ row, isLast, cellPadding }) {
8911
8911
  "dt",
8912
8912
  {
8913
8913
  className: cn(
8914
- "min-w-0 break-words bg-slate-50/70 font-normal text-slate-500 text-[0.9375rem] leading-snug",
8914
+ "min-w-0 break-words bg-slate-50/70 font-normal text-slate-500 text-sm leading-snug",
8915
8915
  cellPadding,
8916
8916
  !isLast && "border-slate-100 border-b"
8917
8917
  ),
@@ -8922,7 +8922,7 @@ function RowPair({ row, isLast, cellPadding }) {
8922
8922
  "dd",
8923
8923
  {
8924
8924
  className: cn(
8925
- "min-w-0 break-words border-slate-100 border-l font-medium text-[0.9375rem] leading-snug",
8925
+ "min-w-0 break-words border-slate-100 border-l font-medium text-sm leading-snug",
8926
8926
  valueColorClass,
8927
8927
  cellPadding,
8928
8928
  !isLast && "border-b"
@@ -8973,7 +8973,7 @@ function resolveDotColor(badge) {
8973
8973
  }
8974
8974
  function BadgePill({ badge, groupStyle }) {
8975
8975
  const style = badge.style ?? groupStyle;
8976
- const baseClass = "inline-flex items-center rounded-full px-4 py-1.5 font-medium text-sm whitespace-nowrap";
8976
+ const baseClass = "inline-flex items-center rounded-full px-4 py-1.5 font-medium text-xs whitespace-nowrap";
8977
8977
  if (style === "outline") {
8978
8978
  return /* @__PURE__ */ jsxRuntime.jsxs(
8979
8979
  "span",
@@ -9063,12 +9063,12 @@ function OrderedListArtifact({
9063
9063
  }) {
9064
9064
  const safeItems = Array.isArray(items) ? items : [];
9065
9065
  return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: cn("text-left", className), children: [
9066
- title ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-bold text-slate-900 text-xl leading-snug", children: title }) : null,
9066
+ title ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-bold text-slate-900 text-base leading-snug", children: title }) : null,
9067
9067
  intro ? /* @__PURE__ */ jsxRuntime.jsx(
9068
9068
  "p",
9069
9069
  {
9070
9070
  className: cn(
9071
- "text-slate-500 text-[16px] leading-relaxed",
9071
+ "text-slate-500 text-sm leading-relaxed",
9072
9072
  title && "mt-4"
9073
9073
  ),
9074
9074
  children: renderRich(intro)
@@ -9098,7 +9098,7 @@ function OrderedListArtifact({
9098
9098
  children: marker
9099
9099
  }
9100
9100
  ),
9101
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 pt-0.5 text-slate-900 text-[16px] leading-relaxed", children: renderRich(item.content) })
9101
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 pt-0.5 text-slate-900 text-sm leading-relaxed", children: renderRich(item.content) })
9102
9102
  ]
9103
9103
  },
9104
9104
  index
@@ -9312,7 +9312,7 @@ function DeepResearchProgress({
9312
9312
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex w-full flex-col gap-6 text-left", className), children: [
9313
9313
  /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { className: "rounded-xl border-slate-200/80 bg-slate-50/70 px-5 py-4 shadow-none", children: [
9314
9314
  taskLabel ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-[11px] text-slate-400 uppercase tracking-wider", children: taskLabel }) : null,
9315
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-[16px] text-slate-700 leading-relaxed", children: taskDescription })
9315
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-sm text-slate-700 leading-relaxed", children: taskDescription })
9316
9316
  ] }),
9317
9317
  safeSteps.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex list-none flex-col gap-5", children: safeSteps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs(
9318
9318
  "li",
@@ -9325,7 +9325,7 @@ function DeepResearchProgress({
9325
9325
  "span",
9326
9326
  {
9327
9327
  className: cn(
9328
- "text-[17px] leading-snug",
9328
+ "text-sm leading-snug",
9329
9329
  stepLabelClass(step.status)
9330
9330
  ),
9331
9331
  children: step.label
@@ -9339,7 +9339,7 @@ function DeepResearchProgress({
9339
9339
  /* @__PURE__ */ jsxRuntime.jsx("hr", { className: "border-slate-200 border-t" }),
9340
9340
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
9341
9341
  findingsLabel ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-[11px] text-slate-400 uppercase tracking-wider", children: findingsLabel }) : null,
9342
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-[16px] text-slate-700 leading-relaxed [&_strong]:text-slate-900", children: renderRich(findings) })
9342
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-sm text-slate-700 leading-relaxed [&_strong]:text-slate-900", children: renderRich(findings) })
9343
9343
  ] })
9344
9344
  ] }) : null
9345
9345
  ] });
@@ -9391,8 +9391,8 @@ function TimelineStep({
9391
9391
  }
9392
9392
  ),
9393
9393
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col gap-1.5 pt-1.5 pb-8", children: [
9394
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold text-[1.0625rem] text-slate-900 leading-snug", children: step.title }),
9395
- step.description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[0.9375rem] text-slate-500 leading-snug", children: step.description }) : null
9394
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold text-sm text-slate-900 leading-snug", children: step.title }),
9395
+ step.description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-slate-500 leading-snug", children: step.description }) : null
9396
9396
  ] })
9397
9397
  ] });
9398
9398
  }
@@ -9416,7 +9416,7 @@ function Tracker({
9416
9416
  },
9417
9417
  step.id ?? `${step.title}-${index}`
9418
9418
  )) }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-6 text-slate-400 text-sm", children: "No steps" }),
9419
- hasFooter ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 border-slate-200 border-t pt-5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-[0.9375rem] text-slate-500", children: [
9419
+ hasFooter ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 border-slate-200 border-t pt-5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-xs text-slate-500", children: [
9420
9420
  showFooterIcon ? /* @__PURE__ */ jsxRuntime.jsx(ClockIcon2, { className: "size-4 shrink-0" }) : null,
9421
9421
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: footerItems.join(FOOTER_SEPARATOR) })
9422
9422
  ] }) }) : null
@@ -9516,7 +9516,7 @@ function OptionRow({
9516
9516
  onClick: submitted ? void 0 : onSelect,
9517
9517
  onKeyDown: handleKeyDown,
9518
9518
  className: cn(
9519
- "flex items-start gap-3 rounded-xl border px-4 py-4 text-left transition-colors",
9519
+ "flex items-center gap-3 rounded-xl border px-4 py-4 text-left transition-colors",
9520
9520
  !submitted && "cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400/60",
9521
9521
  selected ? "font-medium" : "font-normal"
9522
9522
  ),
@@ -9555,13 +9555,13 @@ function OptionRow({
9555
9555
  onCustomCommit();
9556
9556
  }
9557
9557
  },
9558
- className: "flex-1 border-0 bg-transparent p-0 text-base leading-snug outline-none placeholder:text-slate-400",
9558
+ className: "flex-1 border-0 bg-transparent p-0 text-sm leading-snug outline-none placeholder:text-slate-400",
9559
9559
  style: { color: colors.selectedLabel }
9560
9560
  }
9561
9561
  ) : /* @__PURE__ */ jsxRuntime.jsx(
9562
9562
  "span",
9563
9563
  {
9564
- className: "flex-1 text-base leading-snug",
9564
+ className: "flex-1 text-sm leading-snug",
9565
9565
  style: { color: selected ? colors.selectedLabel : colors.unselectedLabel },
9566
9566
  children: option.label
9567
9567
  }
@@ -9651,17 +9651,17 @@ function BuiltInQuestions(props) {
9651
9651
  resolvedProgress ? /* @__PURE__ */ jsxRuntime.jsx(
9652
9652
  "span",
9653
9653
  {
9654
- className: "inline-flex items-center rounded-lg px-3 py-1 font-semibold text-[13px]",
9654
+ className: "inline-flex items-center rounded-lg px-3 py-1 font-semibold text-xs",
9655
9655
  style: { backgroundColor: colors.pillBg, color: colors.pillText },
9656
9656
  children: resolvedProgress
9657
9657
  }
9658
9658
  ) : /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true" }),
9659
- categoryLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", style: { color: colors.categoryText }, children: categoryLabel })
9659
+ categoryLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", style: { color: colors.categoryText }, children: categoryLabel })
9660
9660
  ] }),
9661
9661
  /* @__PURE__ */ jsxRuntime.jsx(
9662
9662
  "h3",
9663
9663
  {
9664
- className: "font-bold text-2xl leading-snug",
9664
+ className: "font-bold text-base leading-snug",
9665
9665
  style: { color: colors.titleColor },
9666
9666
  children: question
9667
9667
  }
@@ -9902,7 +9902,7 @@ function AudioPlayer({
9902
9902
  /* @__PURE__ */ jsxRuntime.jsxs(
9903
9903
  "span",
9904
9904
  {
9905
- className: "shrink-0 font-mono text-lg tabular-nums",
9905
+ className: "shrink-0 font-mono text-xs tabular-nums",
9906
9906
  style: { color: mutedText },
9907
9907
  children: [
9908
9908
  formatTime2(currentTime),
@@ -9928,7 +9928,7 @@ function AudioPlayer({
9928
9928
  /* @__PURE__ */ jsxRuntime.jsx(
9929
9929
  "span",
9930
9930
  {
9931
- className: "shrink-0 font-mono text-sm tabular-nums",
9931
+ className: "shrink-0 font-mono text-xs tabular-nums",
9932
9932
  style: { color: mutedText },
9933
9933
  children: formatTime2(chapter.startSeconds)
9934
9934
  }
@@ -9937,7 +9937,7 @@ function AudioPlayer({
9937
9937
  "span",
9938
9938
  {
9939
9939
  className: cn(
9940
- "text-base",
9940
+ "text-sm",
9941
9941
  isActive ? "font-semibold text-slate-900" : "font-normal text-slate-500"
9942
9942
  ),
9943
9943
  children: chapter.label
@@ -9949,6 +9949,813 @@ function AudioPlayer({
9949
9949
  }) })
9950
9950
  ] });
9951
9951
  }
9952
+ var ICON_MAP = {
9953
+ globe: lucideReact.Globe,
9954
+ facebook: lucideReact.Facebook,
9955
+ instagram: lucideReact.Instagram,
9956
+ twitter: lucideReact.Twitter,
9957
+ x: lucideReact.Twitter,
9958
+ linkedin: lucideReact.Linkedin,
9959
+ youtube: lucideReact.Youtube,
9960
+ github: lucideReact.Github,
9961
+ mail: lucideReact.Mail,
9962
+ email: lucideReact.Mail,
9963
+ phone: lucideReact.Phone,
9964
+ link: lucideReact.Link,
9965
+ url: lucideReact.Link,
9966
+ image: lucideReact.Image,
9967
+ photo: lucideReact.Image,
9968
+ video: lucideReact.Video,
9969
+ star: lucideReact.Star,
9970
+ heart: lucideReact.Heart,
9971
+ check: lucideReact.Check,
9972
+ settings: lucideReact.Settings,
9973
+ user: lucideReact.User,
9974
+ account: lucideReact.User,
9975
+ calendar: lucideReact.Calendar,
9976
+ "map-pin": lucideReact.MapPin,
9977
+ mappin: lucideReact.MapPin,
9978
+ location: lucideReact.MapPin,
9979
+ music: lucideReact.Music,
9980
+ camera: lucideReact.Camera,
9981
+ message: lucideReact.MessageCircle,
9982
+ chat: lucideReact.MessageCircle,
9983
+ cart: lucideReact.ShoppingCart,
9984
+ shop: lucideReact.ShoppingCart
9985
+ };
9986
+ function resolveIconName(name, className = "size-5 shrink-0") {
9987
+ if (!name) return null;
9988
+ const Icon = ICON_MAP[name.trim().toLowerCase()];
9989
+ return Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { "aria-hidden": "true", className }) : null;
9990
+ }
9991
+ var DEFAULT_OPEN_GRAPH_ENDPOINT = "/api/opengraph";
9992
+ function firstString(...values) {
9993
+ for (const value of values) {
9994
+ if (typeof value === "string" && value.trim()) {
9995
+ return value.trim();
9996
+ }
9997
+ }
9998
+ return null;
9999
+ }
10000
+ function imageUrlFromOpenGraph(image) {
10001
+ if (!image) return null;
10002
+ if (typeof image === "string") return firstString(image);
10003
+ return firstString(image.url);
10004
+ }
10005
+ function domainFromUrl(url) {
10006
+ try {
10007
+ return new URL(url).hostname.replace(/^www\./, "");
10008
+ } catch {
10009
+ return url;
10010
+ }
10011
+ }
10012
+ function normalizeUrlForPreview(input) {
10013
+ const trimmed = input.trim();
10014
+ if (!trimmed) return "";
10015
+ return /^https?:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
10016
+ }
10017
+ function buildEndpointUrl(endpoint, url) {
10018
+ const separator = endpoint.includes("?") ? "&" : "?";
10019
+ return `${endpoint}${separator}url=${encodeURIComponent(url)}`;
10020
+ }
10021
+ function getErrorMessage(body) {
10022
+ if (body && typeof body === "object" && "error" in body && typeof body.error === "string") {
10023
+ return body.error;
10024
+ }
10025
+ return "Could not load a preview for that link.";
10026
+ }
10027
+ function extractLinkPreview(data, fallbackUrl = "") {
10028
+ const hybridGraph = data.hybridGraph;
10029
+ const openGraph = data.openGraph;
10030
+ const htmlInferred = data.htmlInferred;
10031
+ const url = firstString(
10032
+ data.finalUrl,
10033
+ data.url,
10034
+ data.normalizedUrl,
10035
+ data.requestedUrl,
10036
+ openGraph?.url,
10037
+ hybridGraph?.url,
10038
+ htmlInferred?.url
10039
+ ) ?? normalizeUrlForPreview(fallbackUrl);
10040
+ return {
10041
+ url,
10042
+ domain: domainFromUrl(url),
10043
+ title: firstString(hybridGraph?.title, openGraph?.title, htmlInferred?.title),
10044
+ description: firstString(
10045
+ hybridGraph?.description,
10046
+ openGraph?.description,
10047
+ htmlInferred?.description
10048
+ ),
10049
+ image: firstString(
10050
+ hybridGraph?.image,
10051
+ imageUrlFromOpenGraph(openGraph?.image ?? null),
10052
+ htmlInferred?.image,
10053
+ htmlInferred?.images?.[0]
10054
+ ),
10055
+ favicon: firstString(hybridGraph?.favicon, htmlInferred?.favicon),
10056
+ siteName: firstString(
10057
+ htmlInferred?.site_name,
10058
+ openGraph?.site_name,
10059
+ hybridGraph?.site_name
10060
+ )
10061
+ };
10062
+ }
10063
+ async function fetchOpenGraphPreview(url, endpoint = DEFAULT_OPEN_GRAPH_ENDPOINT) {
10064
+ const response = await fetch(buildEndpointUrl(endpoint, url), {
10065
+ headers: { Accept: "application/json" }
10066
+ });
10067
+ let body = null;
10068
+ try {
10069
+ body = await response.json();
10070
+ } catch {
10071
+ body = null;
10072
+ }
10073
+ if (!response.ok) {
10074
+ throw new Error(getErrorMessage(body));
10075
+ }
10076
+ return body;
10077
+ }
10078
+ function LinkInput({
10079
+ label = "Add a link",
10080
+ icon,
10081
+ iconName,
10082
+ placeholder = "Paste or type a URL...",
10083
+ defaultUrl = "",
10084
+ defaultValue = null,
10085
+ value,
10086
+ defaultExpanded = false,
10087
+ expanded: controlledExpanded,
10088
+ disabled = false,
10089
+ endpoint = DEFAULT_OPEN_GRAPH_ENDPOINT,
10090
+ fetcher,
10091
+ onSubmit,
10092
+ onValueChange,
10093
+ onClear,
10094
+ onExpandedChange,
10095
+ className
10096
+ }) {
10097
+ const [uncontrolledExpanded, setUncontrolledExpanded] = React4.useState(defaultExpanded);
10098
+ const [url, setUrl] = React4.useState(defaultUrl || defaultValue?.url || "");
10099
+ const [submittedUrl, setSubmittedUrl] = React4.useState(
10100
+ defaultUrl || defaultValue?.url || ""
10101
+ );
10102
+ const [status, setStatus] = React4.useState("idle");
10103
+ const [error, setError] = React4.useState(null);
10104
+ const [internalPreview, setInternalPreview] = React4.useState(
10105
+ defaultValue
10106
+ );
10107
+ const inputRef = React4.useRef(null);
10108
+ const reactId = React4.useId();
10109
+ const inputId = `link-input-${reactId}`;
10110
+ const errorId = `link-input-error-${reactId}`;
10111
+ const isExpanded = controlledExpanded === void 0 ? uncontrolledExpanded : controlledExpanded;
10112
+ const isPreviewControlled = value !== void 0;
10113
+ const preview = (isPreviewControlled ? value : internalPreview) ?? null;
10114
+ const isLoading = status === "loading";
10115
+ const hasPreview = preview !== null;
10116
+ const resolvedIcon = icon ?? resolveIconName(iconName, "size-5") ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { "aria-hidden": true, className: "size-5" });
10117
+ const resolvedFetcher = React4.useCallback(
10118
+ (nextUrl) => fetcher?.(nextUrl) ?? fetchOpenGraphPreview(nextUrl, endpoint),
10119
+ [endpoint, fetcher]
10120
+ );
10121
+ const setExpanded = React4.useCallback(
10122
+ (next) => {
10123
+ if (controlledExpanded === void 0) {
10124
+ setUncontrolledExpanded(next);
10125
+ }
10126
+ onExpandedChange?.(next);
10127
+ },
10128
+ [controlledExpanded, onExpandedChange]
10129
+ );
10130
+ React4.useEffect(() => {
10131
+ if (value !== void 0) {
10132
+ const nextUrl = value?.url ?? "";
10133
+ setSubmittedUrl(nextUrl);
10134
+ if (!isExpanded) setUrl(nextUrl);
10135
+ }
10136
+ }, [isExpanded, value]);
10137
+ React4.useEffect(() => {
10138
+ if (!isExpanded) return;
10139
+ const timeout = window.setTimeout(() => inputRef.current?.focus(), 60);
10140
+ return () => window.clearTimeout(timeout);
10141
+ }, [isExpanded]);
10142
+ async function handleSubmit(event) {
10143
+ event?.preventDefault();
10144
+ const nextUrl = url.trim();
10145
+ if (!nextUrl || isLoading || disabled) return;
10146
+ setStatus("loading");
10147
+ setError(null);
10148
+ try {
10149
+ const data = await resolvedFetcher(nextUrl);
10150
+ const nextPreview = extractLinkPreview(data, nextUrl);
10151
+ if (!isPreviewControlled) {
10152
+ setInternalPreview(nextPreview);
10153
+ }
10154
+ setUrl(nextPreview.url);
10155
+ setSubmittedUrl(nextPreview.url);
10156
+ setStatus("idle");
10157
+ setExpanded(false);
10158
+ onValueChange?.(nextPreview, data);
10159
+ onSubmit?.(data, nextPreview);
10160
+ } catch (submitError) {
10161
+ setStatus("error");
10162
+ setError(
10163
+ submitError instanceof Error ? submitError.message : "Something went wrong."
10164
+ );
10165
+ }
10166
+ }
10167
+ function handleEdit() {
10168
+ if (disabled) return;
10169
+ setUrl(submittedUrl);
10170
+ setStatus("idle");
10171
+ setError(null);
10172
+ setExpanded(true);
10173
+ }
10174
+ function handleClose() {
10175
+ setUrl(submittedUrl);
10176
+ setStatus("idle");
10177
+ setError(null);
10178
+ setExpanded(false);
10179
+ }
10180
+ function handleDelete() {
10181
+ if (disabled) return;
10182
+ if (!isPreviewControlled) {
10183
+ setInternalPreview(null);
10184
+ }
10185
+ setUrl("");
10186
+ setSubmittedUrl("");
10187
+ setStatus("idle");
10188
+ setError(null);
10189
+ setExpanded(false);
10190
+ onValueChange?.(null, null);
10191
+ onClear?.();
10192
+ }
10193
+ return /* @__PURE__ */ jsxRuntime.jsxs(
10194
+ "div",
10195
+ {
10196
+ "data-state": isExpanded ? "editing" : hasPreview ? "filled" : "idle",
10197
+ className: cn(
10198
+ "group/link-input overflow-hidden rounded-xl border bg-card text-card-foreground transition-colors",
10199
+ isExpanded || hasPreview ? "border-foreground/80 shadow-sm" : "border-border hover:border-foreground/30",
10200
+ disabled && "opacity-60",
10201
+ className
10202
+ ),
10203
+ children: [
10204
+ isExpanded ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex w-full flex-col gap-3 px-4 py-3.5", children: [
10205
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-5 items-center justify-center text-muted-foreground [&_svg]:size-5", children: resolvedIcon }),
10206
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 text-sm font-medium leading-5 text-foreground", children: label }),
10207
+ /* @__PURE__ */ jsxRuntime.jsx(
10208
+ "button",
10209
+ {
10210
+ type: "button",
10211
+ onClick: handleClose,
10212
+ "aria-label": "Close link input",
10213
+ className: "absolute right-2.5 top-2.5 flex size-6 items-center justify-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60",
10214
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-4" })
10215
+ }
10216
+ )
10217
+ ] }) : hasPreview ? /* @__PURE__ */ jsxRuntime.jsx(
10218
+ LinkInputPreview,
10219
+ {
10220
+ preview,
10221
+ onEdit: handleEdit,
10222
+ onDelete: handleDelete,
10223
+ disabled
10224
+ }
10225
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(
10226
+ "button",
10227
+ {
10228
+ type: "button",
10229
+ onClick: () => setExpanded(true),
10230
+ "aria-expanded": false,
10231
+ disabled,
10232
+ className: "flex w-full flex-col gap-3 px-4 py-3.5 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/60 disabled:cursor-not-allowed",
10233
+ children: [
10234
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-5 items-center justify-center text-muted-foreground [&_svg]:size-5", children: resolvedIcon }),
10235
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 text-sm font-medium leading-5 text-foreground", children: label })
10236
+ ]
10237
+ }
10238
+ ),
10239
+ isExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border px-4 pb-4 pt-3", children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, className: "space-y-2", children: [
10240
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
10241
+ /* @__PURE__ */ jsxRuntime.jsx(
10242
+ Input,
10243
+ {
10244
+ ref: inputRef,
10245
+ id: inputId,
10246
+ type: "text",
10247
+ inputMode: "url",
10248
+ autoComplete: "off",
10249
+ spellCheck: false,
10250
+ value: url,
10251
+ disabled: disabled || isLoading,
10252
+ "aria-invalid": status === "error",
10253
+ "aria-describedby": status === "error" ? errorId : void 0,
10254
+ onChange: (event) => {
10255
+ setUrl(event.target.value);
10256
+ if (status === "error") {
10257
+ setStatus("idle");
10258
+ setError(null);
10259
+ }
10260
+ },
10261
+ placeholder,
10262
+ className: cn(
10263
+ "h-10 rounded-lg bg-background pr-[5.25rem] text-sm shadow-sm placeholder:text-muted-foreground/70 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40",
10264
+ status === "error" && "border-destructive/60"
10265
+ )
10266
+ }
10267
+ ),
10268
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-y-0 right-1.5 flex items-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
10269
+ Button,
10270
+ {
10271
+ type: "submit",
10272
+ size: "sm",
10273
+ disabled: !url.trim() || isLoading || disabled,
10274
+ className: "h-7 gap-1 px-2",
10275
+ children: [
10276
+ isLoading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { "aria-hidden": true, className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CornerDownLeft, { "aria-hidden": true, className: "size-3.5" }),
10277
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", children: isLoading ? "Loading" : "Enter" })
10278
+ ]
10279
+ }
10280
+ ) })
10281
+ ] }),
10282
+ status === "error" && error ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: errorId, role: "alert", className: "px-0.5 text-xs text-destructive", children: error }) : /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "px-0.5 text-xs text-muted-foreground", children: [
10283
+ "Press",
10284
+ " ",
10285
+ /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "rounded border border-border bg-muted px-1 font-sans text-[0.65rem] text-muted-foreground", children: "Enter" }),
10286
+ " ",
10287
+ "to fetch a preview."
10288
+ ] })
10289
+ ] }) })
10290
+ ]
10291
+ }
10292
+ );
10293
+ }
10294
+ function LinkInputPreview({
10295
+ preview,
10296
+ onEdit,
10297
+ onDelete,
10298
+ disabled
10299
+ }) {
10300
+ const [imageError, setImageError] = React4.useState(false);
10301
+ const [faviconError, setFaviconError] = React4.useState(false);
10302
+ const showImage = Boolean(preview.image) && !imageError;
10303
+ const showFavicon = Boolean(preview.favicon) && !faviconError;
10304
+ const title = preview.title || preview.siteName || preview.domain || "Untitled link";
10305
+ React4.useEffect(() => {
10306
+ setImageError(false);
10307
+ setFaviconError(false);
10308
+ }, [preview.favicon, preview.image]);
10309
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-stretch gap-3 p-3", children: [
10310
+ /* @__PURE__ */ jsxRuntime.jsx(
10311
+ "a",
10312
+ {
10313
+ href: preview.url || "#",
10314
+ target: "_blank",
10315
+ rel: "noopener noreferrer",
10316
+ className: "relative flex size-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-muted outline-none focus-visible:ring-2 focus-visible:ring-ring/60",
10317
+ children: showImage ? /* @__PURE__ */ jsxRuntime.jsx(
10318
+ "img",
10319
+ {
10320
+ src: preview.image,
10321
+ alt: "",
10322
+ crossOrigin: "anonymous",
10323
+ onError: () => setImageError(true),
10324
+ className: "size-full object-cover"
10325
+ }
10326
+ ) : showFavicon ? /* @__PURE__ */ jsxRuntime.jsx(
10327
+ "img",
10328
+ {
10329
+ src: preview.favicon,
10330
+ alt: "",
10331
+ crossOrigin: "anonymous",
10332
+ onError: () => setFaviconError(true),
10333
+ className: "size-7"
10334
+ }
10335
+ ) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { "aria-hidden": true, className: "size-7 text-muted-foreground" })
10336
+ }
10337
+ ),
10338
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col justify-center py-0.5", children: [
10339
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
10340
+ showFavicon && showImage ? /* @__PURE__ */ jsxRuntime.jsx(
10341
+ "img",
10342
+ {
10343
+ src: preview.favicon,
10344
+ alt: "",
10345
+ crossOrigin: "anonymous",
10346
+ onError: () => setFaviconError(true),
10347
+ className: "size-3.5 shrink-0 rounded-sm"
10348
+ }
10349
+ ) : null,
10350
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs font-medium text-muted-foreground", children: preview.domain || preview.siteName })
10351
+ ] }),
10352
+ /* @__PURE__ */ jsxRuntime.jsx(
10353
+ "a",
10354
+ {
10355
+ href: preview.url || "#",
10356
+ target: "_blank",
10357
+ rel: "noopener noreferrer",
10358
+ className: "mt-0.5 line-clamp-1 text-sm font-semibold text-foreground outline-none hover:underline focus-visible:underline",
10359
+ children: title
10360
+ }
10361
+ ),
10362
+ preview.description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 line-clamp-2 text-xs leading-4 text-muted-foreground", children: preview.description }) : null
10363
+ ] }),
10364
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 flex-col items-center gap-1", children: [
10365
+ /* @__PURE__ */ jsxRuntime.jsx(
10366
+ Button,
10367
+ {
10368
+ type: "button",
10369
+ size: "icon",
10370
+ variant: "ghost",
10371
+ onClick: onEdit,
10372
+ disabled,
10373
+ "aria-label": "Edit link",
10374
+ className: "size-7 rounded-full",
10375
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "size-3.5" })
10376
+ }
10377
+ ),
10378
+ /* @__PURE__ */ jsxRuntime.jsx(
10379
+ Button,
10380
+ {
10381
+ type: "button",
10382
+ size: "icon",
10383
+ variant: "ghost",
10384
+ onClick: onDelete,
10385
+ disabled,
10386
+ "aria-label": "Delete link",
10387
+ className: "size-7 rounded-full",
10388
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "size-3.5" })
10389
+ }
10390
+ )
10391
+ ] })
10392
+ ] });
10393
+ }
10394
+ function LinkInputGroup({
10395
+ options,
10396
+ onSubmit,
10397
+ onValueChange,
10398
+ onClear,
10399
+ className
10400
+ }) {
10401
+ const [openId, setOpenId] = React4.useState(null);
10402
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col gap-3", className), children: options.map(({ id, ...option }) => /* @__PURE__ */ jsxRuntime.jsx(
10403
+ LinkInput,
10404
+ {
10405
+ ...option,
10406
+ expanded: openId === id,
10407
+ onExpandedChange: (next) => setOpenId((currentId) => {
10408
+ if (next) return id;
10409
+ return currentId === id ? null : currentId;
10410
+ }),
10411
+ onSubmit: (data, preview) => {
10412
+ setOpenId(null);
10413
+ onSubmit?.(id, data, preview);
10414
+ },
10415
+ onValueChange: (preview, data) => {
10416
+ onValueChange?.(id, preview, data);
10417
+ },
10418
+ onClear: () => onClear?.(id)
10419
+ },
10420
+ id
10421
+ )) });
10422
+ }
10423
+ var getDimensionStyle = (width, height) => {
10424
+ const style = {};
10425
+ if (width) style.width = typeof width === "number" ? `${width}px` : width;
10426
+ if (height) style.height = typeof height === "number" ? `${height}px` : height;
10427
+ return style;
10428
+ };
10429
+ var getThumbnailSizing = (thumbnailHeight) => ({
10430
+ heightClass: typeof thumbnailHeight === "number" ? "" : thumbnailHeight,
10431
+ heightStyle: typeof thumbnailHeight === "number" ? { height: `${thumbnailHeight}px` } : void 0
10432
+ });
10433
+ function MediaFallback() {
10434
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full min-h-28 w-full items-center justify-center bg-muted text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ImageIcon, { className: "size-7", "aria-hidden": "true" }) });
10435
+ }
10436
+ function MediaOptionItem({
10437
+ option,
10438
+ isChecked,
10439
+ onToggle,
10440
+ thumbnailHeight
10441
+ }) {
10442
+ const {
10443
+ value,
10444
+ label,
10445
+ subtitle,
10446
+ mediaUrl,
10447
+ mediaType,
10448
+ thumbnailUrl,
10449
+ width,
10450
+ height,
10451
+ disabled
10452
+ } = option;
10453
+ const videoRef = React4.useRef(null);
10454
+ const [playing, setPlaying] = React4.useState(false);
10455
+ const [mediaError, setMediaError] = React4.useState(!mediaUrl);
10456
+ const sizeStyle = getDimensionStyle(width, height);
10457
+ const { heightClass, heightStyle } = getThumbnailSizing(thumbnailHeight);
10458
+ const handleMouseEnter = () => {
10459
+ if (mediaType === "video" && videoRef.current && !disabled) {
10460
+ videoRef.current.play().then(() => setPlaying(true)).catch(() => {
10461
+ });
10462
+ }
10463
+ };
10464
+ const handleMouseLeave = () => {
10465
+ if (mediaType === "video" && videoRef.current) {
10466
+ videoRef.current.pause();
10467
+ setPlaying(false);
10468
+ }
10469
+ };
10470
+ const handleVideoClick = (e) => {
10471
+ e.stopPropagation();
10472
+ if (mediaType !== "video" || !videoRef.current || disabled) return;
10473
+ if (playing) {
10474
+ videoRef.current.pause();
10475
+ setPlaying(false);
10476
+ return;
10477
+ }
10478
+ videoRef.current.play().then(() => setPlaying(true)).catch(() => {
10479
+ });
10480
+ };
10481
+ return /* @__PURE__ */ jsxRuntime.jsxs(
10482
+ "label",
10483
+ {
10484
+ className: cn(
10485
+ "group block h-full",
10486
+ disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"
10487
+ ),
10488
+ style: sizeStyle,
10489
+ children: [
10490
+ /* @__PURE__ */ jsxRuntime.jsx(
10491
+ "input",
10492
+ {
10493
+ type: "checkbox",
10494
+ className: "peer sr-only",
10495
+ checked: isChecked,
10496
+ disabled,
10497
+ onChange: () => onToggle(value)
10498
+ }
10499
+ ),
10500
+ /* @__PURE__ */ jsxRuntime.jsxs(
10501
+ "span",
10502
+ {
10503
+ className: cn(
10504
+ "relative flex h-full flex-col overflow-hidden rounded-lg border bg-card text-card-foreground shadow-xs transition-all duration-200 ease-in-out",
10505
+ "border-input hover:border-border hover:shadow-sm",
10506
+ "peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-background",
10507
+ isChecked && "border-primary shadow-sm ring-1 ring-primary/30 hover:border-primary",
10508
+ disabled && "pointer-events-none"
10509
+ ),
10510
+ children: [
10511
+ /* @__PURE__ */ jsxRuntime.jsxs(
10512
+ "span",
10513
+ {
10514
+ className: cn("relative block overflow-hidden bg-muted", heightClass),
10515
+ style: heightStyle,
10516
+ onMouseEnter: handleMouseEnter,
10517
+ onMouseLeave: handleMouseLeave,
10518
+ children: [
10519
+ mediaError ? /* @__PURE__ */ jsxRuntime.jsx(MediaFallback, {}) : mediaType === "image" ? /* @__PURE__ */ jsxRuntime.jsx(
10520
+ "img",
10521
+ {
10522
+ src: mediaUrl,
10523
+ alt: label,
10524
+ className: "h-full w-full object-cover transition-transform duration-300 ease-out group-hover:scale-[1.015]",
10525
+ onError: () => setMediaError(true)
10526
+ }
10527
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10528
+ /* @__PURE__ */ jsxRuntime.jsx(
10529
+ "video",
10530
+ {
10531
+ ref: videoRef,
10532
+ src: mediaUrl,
10533
+ poster: thumbnailUrl,
10534
+ muted: true,
10535
+ loop: true,
10536
+ playsInline: true,
10537
+ preload: "metadata",
10538
+ onClick: handleVideoClick,
10539
+ onError: () => setMediaError(true),
10540
+ className: cn(
10541
+ "h-full w-full object-cover transition duration-300 ease-out group-hover:scale-[1.015]",
10542
+ playing ? "grayscale-0" : "grayscale"
10543
+ )
10544
+ }
10545
+ ),
10546
+ /* @__PURE__ */ jsxRuntime.jsx(
10547
+ "span",
10548
+ {
10549
+ className: cn(
10550
+ "absolute bottom-2 left-2 flex size-7 items-center justify-center rounded-full bg-background/85 text-foreground shadow-xs backdrop-blur",
10551
+ playing && "opacity-0"
10552
+ ),
10553
+ "aria-hidden": "true",
10554
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { className: "ml-0.5 size-3.5 fill-current" })
10555
+ }
10556
+ )
10557
+ ] }),
10558
+ /* @__PURE__ */ jsxRuntime.jsx(
10559
+ "span",
10560
+ {
10561
+ className: cn(
10562
+ "absolute right-3 top-3 flex size-6 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-xs transition-all duration-200",
10563
+ isChecked ? "scale-100 opacity-100 ring-2 ring-white ring-offset-2" : "scale-75 opacity-0"
10564
+ ),
10565
+ "aria-hidden": "true",
10566
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3.5 stroke-[2.5]" })
10567
+ }
10568
+ )
10569
+ ]
10570
+ }
10571
+ ),
10572
+ /* @__PURE__ */ jsxRuntime.jsxs(
10573
+ "span",
10574
+ {
10575
+ className: cn(
10576
+ "flex min-h-[82px] flex-col gap-1 border-t border-border bg-card px-3 py-3 text-card-foreground",
10577
+ isChecked && "bg-primary text-primary-foreground"
10578
+ ),
10579
+ children: [
10580
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "line-clamp-1 text-sm font-semibold leading-5", children: label }),
10581
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "line-clamp-2 text-sm leading-5", children: subtitle })
10582
+ ]
10583
+ }
10584
+ )
10585
+ ]
10586
+ }
10587
+ )
10588
+ ]
10589
+ }
10590
+ );
10591
+ }
10592
+ function MediaCheckboxes({
10593
+ options,
10594
+ selectedValues,
10595
+ defaultSelectedValues,
10596
+ onSelect,
10597
+ minSelection = 0,
10598
+ maxSelection,
10599
+ className,
10600
+ thumbnailHeight = "h-48"
10601
+ }) {
10602
+ const isControlled = Array.isArray(selectedValues);
10603
+ const [internal, setInternal] = React4.useState(
10604
+ defaultSelectedValues ?? []
10605
+ );
10606
+ const current = isControlled ? selectedValues : internal;
10607
+ const max = maxSelection ?? options.length;
10608
+ const toggleOption = React4.useCallback(
10609
+ (value) => {
10610
+ const isSelected = current.includes(value);
10611
+ let updated;
10612
+ if (isSelected) {
10613
+ updated = current.filter((v) => v !== value);
10614
+ if (updated.length < minSelection) return;
10615
+ } else if (max === 1) {
10616
+ updated = [value];
10617
+ } else {
10618
+ if (current.length >= max) return;
10619
+ updated = [...current, value];
10620
+ }
10621
+ if (!isControlled) setInternal(updated);
10622
+ onSelect?.(updated);
10623
+ },
10624
+ [current, isControlled, max, minSelection, onSelect]
10625
+ );
10626
+ return /* @__PURE__ */ jsxRuntime.jsx(
10627
+ "fieldset",
10628
+ {
10629
+ className: cn(
10630
+ "grid w-full grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",
10631
+ className
10632
+ ),
10633
+ children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
10634
+ MediaOptionItem,
10635
+ {
10636
+ option,
10637
+ isChecked: current.includes(option.value),
10638
+ onToggle: toggleOption,
10639
+ thumbnailHeight
10640
+ },
10641
+ option.value
10642
+ ))
10643
+ }
10644
+ );
10645
+ }
10646
+ function renderTileIcon(item) {
10647
+ if (item.icon != null) {
10648
+ if (React4.isValidElement(item.icon)) {
10649
+ return React4.cloneElement(item.icon, {
10650
+ className: cn(item.icon.props.className, "size-5 shrink-0")
10651
+ });
10652
+ }
10653
+ return item.icon;
10654
+ }
10655
+ return resolveIconName(item.iconName);
10656
+ }
10657
+ function IconCheckboxes({
10658
+ options,
10659
+ selectedValues,
10660
+ defaultSelectedValues,
10661
+ onSelect,
10662
+ minSelection = 0,
10663
+ maxSelection,
10664
+ className
10665
+ }) {
10666
+ const isControlled = Array.isArray(selectedValues);
10667
+ const [internal, setInternal] = React4.useState(
10668
+ defaultSelectedValues ?? []
10669
+ );
10670
+ const current = isControlled ? selectedValues : internal;
10671
+ const max = maxSelection ?? options.length;
10672
+ const commit = (updated) => {
10673
+ if (!isControlled) setInternal(updated);
10674
+ onSelect?.(updated);
10675
+ };
10676
+ const toggleOption = (value) => {
10677
+ const isSelected = current.includes(value);
10678
+ let updated;
10679
+ if (isSelected) {
10680
+ updated = current.filter((v) => v !== value);
10681
+ if (updated.length < minSelection) return;
10682
+ } else if (max === 1) {
10683
+ updated = [value];
10684
+ } else {
10685
+ if (current.length >= max) return;
10686
+ updated = [...current, value];
10687
+ }
10688
+ commit(updated);
10689
+ };
10690
+ return /* @__PURE__ */ jsxRuntime.jsx(
10691
+ "fieldset",
10692
+ {
10693
+ className: cn(
10694
+ "grid w-full max-w-sm grid-cols-[repeat(auto-fit,minmax(7rem,1fr))] gap-3",
10695
+ className
10696
+ ),
10697
+ children: options.map((item) => {
10698
+ const { value, label, disabled } = item;
10699
+ const isChecked = current.includes(value);
10700
+ return /* @__PURE__ */ jsxRuntime.jsxs(
10701
+ "label",
10702
+ {
10703
+ className: cn(
10704
+ "block",
10705
+ disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"
10706
+ ),
10707
+ children: [
10708
+ /* @__PURE__ */ jsxRuntime.jsx(
10709
+ "input",
10710
+ {
10711
+ type: "checkbox",
10712
+ className: "peer sr-only",
10713
+ checked: isChecked,
10714
+ disabled,
10715
+ onChange: () => toggleOption(value)
10716
+ }
10717
+ ),
10718
+ /* @__PURE__ */ jsxRuntime.jsxs(
10719
+ "span",
10720
+ {
10721
+ className: cn(
10722
+ "relative flex min-h-[88px] flex-col items-start justify-center rounded-lg border bg-card px-4 py-3 text-left text-muted-foreground transition-all duration-200 ease-in-out",
10723
+ "border-input hover:border-border hover:bg-accent/40",
10724
+ "peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-background",
10725
+ isChecked && "border-primary bg-primary/5 text-primary shadow-xs ring-1 ring-primary/20 hover:border-primary hover:bg-primary/5",
10726
+ disabled && "pointer-events-none"
10727
+ ),
10728
+ children: [
10729
+ /* @__PURE__ */ jsxRuntime.jsx(
10730
+ "span",
10731
+ {
10732
+ "aria-hidden": "true",
10733
+ className: "mb-3 flex size-5 items-center justify-center",
10734
+ children: renderTileIcon(item)
10735
+ }
10736
+ ),
10737
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-full break-words text-sm font-medium leading-tight transition-colors duration-200 ease-in-out", children: label }),
10738
+ /* @__PURE__ */ jsxRuntime.jsx(
10739
+ lucideReact.CircleCheck,
10740
+ {
10741
+ "aria-hidden": "true",
10742
+ className: cn(
10743
+ "absolute right-2 top-2 size-5 rounded-full fill-primary text-primary-foreground transition-all duration-200 ease-in-out",
10744
+ isChecked ? "scale-100 opacity-100" : "scale-75 opacity-0"
10745
+ )
10746
+ }
10747
+ )
10748
+ ]
10749
+ }
10750
+ )
10751
+ ]
10752
+ },
10753
+ value
10754
+ );
10755
+ })
10756
+ }
10757
+ );
10758
+ }
9952
10759
  var ARTIFACT_REGISTRY = {
9953
10760
  chart: ({ payload, className }) => payload.chart ? /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { data: payload.chart, className }) : null,
9954
10761
  metrics: ({ payload, className }) => payload.metrics ? /* @__PURE__ */ jsxRuntime.jsx(MetricsGrid, { metrics: payload.metrics, className }) : null,
@@ -9966,7 +10773,10 @@ var ARTIFACT_REGISTRY = {
9966
10773
  "deep-research-progress": ({ payload, className }) => payload.deepResearchProgress ? /* @__PURE__ */ jsxRuntime.jsx(DeepResearchProgress, { ...payload.deepResearchProgress, className }) : null,
9967
10774
  tracker: ({ payload, className }) => payload.tracker ? /* @__PURE__ */ jsxRuntime.jsx(Tracker, { ...payload.tracker, className }) : null,
9968
10775
  "built-in-questions": ({ payload, className }) => payload.builtInQuestions ? /* @__PURE__ */ jsxRuntime.jsx(BuiltInQuestions, { ...payload.builtInQuestions, className }) : null,
9969
- "audio-player": ({ payload, className }) => payload.audioPlayer ? /* @__PURE__ */ jsxRuntime.jsx(AudioPlayer, { ...payload.audioPlayer, className }) : null
10776
+ "audio-player": ({ payload, className }) => payload.audioPlayer ? /* @__PURE__ */ jsxRuntime.jsx(AudioPlayer, { ...payload.audioPlayer, className }) : null,
10777
+ "link-input": ({ payload, className }) => payload.linkInput ? /* @__PURE__ */ jsxRuntime.jsx(LinkInput, { ...payload.linkInput, className }) : null,
10778
+ "media-checkboxes": ({ payload, className }) => payload.mediaCheckboxes ? /* @__PURE__ */ jsxRuntime.jsx(MediaCheckboxes, { ...payload.mediaCheckboxes, className }) : null,
10779
+ "icon-checkboxes": ({ payload, className }) => payload.iconCheckboxes ? /* @__PURE__ */ jsxRuntime.jsx(IconCheckboxes, { ...payload.iconCheckboxes, className }) : null
9970
10780
  };
9971
10781
  function DataPayloadView({ payload, className }) {
9972
10782
  const render = ARTIFACT_REGISTRY[payload.type];
@@ -11425,6 +12235,7 @@ exports.ConfirmationPanel = ConfirmationPanel;
11425
12235
  exports.ControlGrid = ControlGrid;
11426
12236
  exports.ConversationAnalytics = ConversationAnalytics;
11427
12237
  exports.ConversationArtifact = ConversationArtifact;
12238
+ exports.DEFAULT_OPEN_GRAPH_ENDPOINT = DEFAULT_OPEN_GRAPH_ENDPOINT;
11428
12239
  exports.DataPayloadView = DataPayloadView;
11429
12240
  exports.DataTable = DataTable;
11430
12241
  exports.DeepResearchProgress = DeepResearchProgress;
@@ -11435,13 +12246,17 @@ exports.FloatingWidget = FloatingWidget;
11435
12246
  exports.FullBleedSurface = FullBleedSurface;
11436
12247
  exports.FullscreenDashboard = FullscreenDashboard;
11437
12248
  exports.GuidedLessonFlow = GuidedLessonFlow;
12249
+ exports.IconCheckboxes = IconCheckboxes;
11438
12250
  exports.ImageGenerator = ImageGenerator;
11439
12251
  exports.InlineSuggestionsInput = InlineSuggestionsInput;
11440
12252
  exports.Input = Input;
11441
12253
  exports.KpiCardWithChart = KpiCardWithChart;
11442
12254
  exports.KpiCardWithSparklines = KpiCardWithSparklines;
12255
+ exports.LinkInput = LinkInput;
12256
+ exports.LinkInputGroup = LinkInputGroup;
11443
12257
  exports.ListingFeed = ListingFeed;
11444
12258
  exports.LocationsRevenueCard = LocationsRevenueCard;
12259
+ exports.MediaCheckboxes = MediaCheckboxes;
11445
12260
  exports.MediaEditorCanvas = MediaEditorCanvas;
11446
12261
  exports.MediaGallery = MediaGallery;
11447
12262
  exports.MessageActions = MessageActions;
@@ -11509,6 +12324,8 @@ exports.copyToClipboard = copyToClipboard;
11509
12324
  exports.createMockBackend = createMockBackend;
11510
12325
  exports.debounce = debounce;
11511
12326
  exports.delay = delay;
12327
+ exports.extractLinkPreview = extractLinkPreview;
12328
+ exports.fetchOpenGraphPreview = fetchOpenGraphPreview;
11512
12329
  exports.findComponentsByCapability = findComponentsByCapability;
11513
12330
  exports.findComponentsByCategory = findComponentsByCategory;
11514
12331
  exports.findComponentsBySurface = findComponentsBySurface;