@vantageos/mosaic-blocks 0.5.33-alpha → 0.5.35-alpha

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
@@ -48,7 +48,7 @@ function _interopNamespace(e) {
48
48
  var React30__namespace = /*#__PURE__*/_interopNamespace(React30);
49
49
 
50
50
  // src/version.ts
51
- var version = "0.5.33-alpha";
51
+ var version = "0.5.35-alpha";
52
52
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
53
53
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
54
54
  }
@@ -815,7 +815,9 @@ function MosaicThemeToggle({
815
815
  "aria-pressed": isDark,
816
816
  onClick: handleToggle,
817
817
  className: cn12(
818
- "inline-flex size-9 items-center justify-center rounded-full border border-[oklch(0.9_0.005_250)] bg-[oklch(var(--mosaic-surface,1_0_0))] transition-colors hover:bg-[oklch(0.95_0.005_250)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[oklch(0.5_0.15_250)]",
818
+ "inline-flex size-9 items-center justify-center rounded-full border border-border",
819
+ "bg-secondary text-foreground transition-colors hover:bg-accent",
820
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
819
821
  className
820
822
  ),
821
823
  children: isDark ? /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2217,7 +2219,11 @@ function MosaicCombobox({
2217
2219
  disabled,
2218
2220
  name,
2219
2221
  emptyMessage,
2220
- className
2222
+ className,
2223
+ side,
2224
+ align,
2225
+ collisionBoundary,
2226
+ collisionPadding
2221
2227
  }) {
2222
2228
  const [inputValue, setInputValue] = React30__namespace.useState("");
2223
2229
  const filter = combobox.Combobox.useFilter({ sensitivity: "base" });
@@ -2249,39 +2255,46 @@ function MosaicCombobox({
2249
2255
  )
2250
2256
  }
2251
2257
  ),
2252
- /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Positioner, { sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
2253
- combobox.Combobox.Popup,
2258
+ /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
2259
+ combobox.Combobox.Positioner,
2254
2260
  {
2255
- className: cn35(
2256
- "z-50 min-w-[8rem] overflow-hidden rounded-md border border-border",
2257
- "bg-popover p-1 text-popover-foreground shadow-md",
2258
- "origin-[var(--transform-origin)]",
2259
- "transition-[transform,scale,opacity]",
2260
- "data-[open]:scale-100 data-[open]:opacity-100",
2261
- "data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
2262
- "data-[starting-style]:scale-95 data-[starting-style]:opacity-0"
2263
- ),
2264
- children: /* @__PURE__ */ jsxRuntime.jsxs(combobox.Combobox.List, { children: [
2265
- filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
2266
- combobox.Combobox.Item,
2267
- {
2268
- value: item.value,
2269
- disabled: item.disabled,
2270
- className: cn35(
2271
- "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5",
2272
- "text-sm text-popover-foreground outline-none",
2273
- "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
2274
- "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
2275
- "data-[selected]:font-medium"
2276
- ),
2277
- children: item.label
2278
- },
2279
- item.value
2280
- )),
2281
- /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Empty, { className: "py-2 text-center text-sm text-muted-foreground", children: emptyMessage })
2282
- ] })
2261
+ sideOffset: 4,
2262
+ side,
2263
+ align,
2264
+ collisionBoundary,
2265
+ collisionPadding,
2266
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2267
+ combobox.Combobox.Popup,
2268
+ {
2269
+ className: cn35(
2270
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border border-border",
2271
+ "bg-popover p-1 text-popover-foreground shadow-md",
2272
+ "origin-[var(--transform-origin)]",
2273
+ "transition-[transform,scale,opacity]",
2274
+ "data-[open]:scale-100 data-[open]:opacity-100",
2275
+ "data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
2276
+ "data-[starting-style]:scale-95 data-[starting-style]:opacity-0"
2277
+ ),
2278
+ children: /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.List, { children: filteredItems.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Empty, { className: "py-2 text-center text-sm text-muted-foreground", children: emptyMessage }) : filteredItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
2279
+ combobox.Combobox.Item,
2280
+ {
2281
+ value: item.value,
2282
+ disabled: item.disabled,
2283
+ className: cn35(
2284
+ "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5",
2285
+ "text-sm text-popover-foreground outline-none",
2286
+ "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
2287
+ "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
2288
+ "data-[selected]:font-medium"
2289
+ ),
2290
+ children: item.label
2291
+ },
2292
+ item.value
2293
+ )) })
2294
+ }
2295
+ )
2283
2296
  }
2284
- ) }) })
2297
+ ) })
2285
2298
  ] })
2286
2299
  }
2287
2300
  );
@@ -2322,7 +2335,11 @@ function MosaicModelSelector({
2322
2335
  emptyMessage,
2323
2336
  disabled,
2324
2337
  name,
2325
- className
2338
+ className,
2339
+ side,
2340
+ align,
2341
+ collisionBoundary,
2342
+ collisionPadding
2326
2343
  }) {
2327
2344
  const [inputValue, setInputValue] = React30__namespace.useState("");
2328
2345
  const filter = combobox.Combobox.useFilter({ sensitivity: "base" });
@@ -2361,40 +2378,47 @@ function MosaicModelSelector({
2361
2378
  }
2362
2379
  ),
2363
2380
  value != null && value in labelMap && inputValue === "" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute inset-y-0 left-3 flex items-center text-sm text-foreground", children: labelMap[value] }),
2364
- /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Positioner, { sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
2365
- combobox.Combobox.Popup,
2381
+ /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
2382
+ combobox.Combobox.Positioner,
2366
2383
  {
2367
- className: cn36(
2368
- "z-50 min-w-[16rem] overflow-hidden rounded-md border border-border",
2369
- "bg-popover p-1 text-popover-foreground shadow-md",
2370
- "origin-[var(--transform-origin)]",
2371
- "transition-[transform,scale,opacity]",
2372
- "data-[open]:scale-100 data-[open]:opacity-100",
2373
- "data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
2374
- "data-[starting-style]:scale-95 data-[starting-style]:opacity-0"
2375
- ),
2376
- children: /* @__PURE__ */ jsxRuntime.jsxs(combobox.Combobox.List, { children: [
2377
- filteredModels.map((model) => /* @__PURE__ */ jsxRuntime.jsxs(
2378
- combobox.Combobox.Item,
2379
- {
2380
- value: model.value,
2381
- disabled: model.disabled,
2382
- className: modelSelectorItemVariants({ className: void 0 }),
2383
- children: [
2384
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
2385
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: model.label }),
2386
- model.badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs text-secondary-foreground", children: model.badge })
2387
- ] }),
2388
- model.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: model.description }),
2389
- model.meta && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: model.meta })
2390
- ]
2391
- },
2392
- model.value
2393
- )),
2394
- /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Empty, { className: "py-2 text-center text-sm text-muted-foreground", children: emptyMessage })
2395
- ] })
2384
+ sideOffset: 4,
2385
+ side,
2386
+ align,
2387
+ collisionBoundary,
2388
+ collisionPadding,
2389
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2390
+ combobox.Combobox.Popup,
2391
+ {
2392
+ className: cn36(
2393
+ "z-50 min-w-[16rem] overflow-hidden rounded-md border border-border",
2394
+ "bg-popover p-1 text-popover-foreground shadow-md",
2395
+ "origin-[var(--transform-origin)]",
2396
+ "transition-[transform,scale,opacity]",
2397
+ "data-[open]:scale-100 data-[open]:opacity-100",
2398
+ "data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
2399
+ "data-[starting-style]:scale-95 data-[starting-style]:opacity-0"
2400
+ ),
2401
+ children: /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.List, { children: filteredModels.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Empty, { className: "py-2 text-center text-sm text-muted-foreground", children: emptyMessage }) : filteredModels.map((model) => /* @__PURE__ */ jsxRuntime.jsxs(
2402
+ combobox.Combobox.Item,
2403
+ {
2404
+ value: model.value,
2405
+ disabled: model.disabled,
2406
+ className: modelSelectorItemVariants({ className: void 0 }),
2407
+ children: [
2408
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
2409
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: model.label }),
2410
+ model.badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs text-secondary-foreground", children: model.badge })
2411
+ ] }),
2412
+ model.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: model.description }),
2413
+ model.meta && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: model.meta })
2414
+ ]
2415
+ },
2416
+ model.value
2417
+ )) })
2418
+ }
2419
+ )
2396
2420
  }
2397
- ) }) })
2421
+ ) })
2398
2422
  ] })
2399
2423
  }
2400
2424
  );
@@ -16919,6 +16943,1281 @@ function MosaicSaveChatAsMemoryForm({
16919
16943
  );
16920
16944
  }
16921
16945
  MosaicSaveChatAsMemoryForm.displayName = "MosaicSaveChatAsMemoryForm";
16946
+ var calloutVariants = classVarianceAuthority.cva(
16947
+ ["flex items-start gap-2.5", "rounded-md border", "px-3 py-2.5", "text-sm"],
16948
+ {
16949
+ variants: {
16950
+ variant: {
16951
+ info: "border-info-500/30 bg-info-50 text-foreground",
16952
+ warning: "border-warning-500/30 bg-warning-50 text-foreground"
16953
+ }
16954
+ },
16955
+ defaultVariants: {
16956
+ variant: "info"
16957
+ }
16958
+ }
16959
+ );
16960
+ function cn114(...classes) {
16961
+ return classes.filter(Boolean).join(" ");
16962
+ }
16963
+ function MosaicCallout({
16964
+ variant = "info",
16965
+ title,
16966
+ children,
16967
+ icon,
16968
+ className,
16969
+ ref,
16970
+ ...props
16971
+ }) {
16972
+ const role = variant === "warning" ? "alert" : "status";
16973
+ return /* @__PURE__ */ jsxRuntime.jsxs(
16974
+ "div",
16975
+ {
16976
+ ref,
16977
+ role,
16978
+ "data-slot": "callout",
16979
+ className: cn114(calloutVariants({ variant }), className),
16980
+ ...props,
16981
+ children: [
16982
+ icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "mt-0.5 shrink-0", children: icon }) : null,
16983
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0.5", children: [
16984
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium", children: title }),
16985
+ children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground", children }) : null
16986
+ ] })
16987
+ ]
16988
+ }
16989
+ );
16990
+ }
16991
+ MosaicCallout.displayName = "MosaicCallout";
16992
+ var matchStateVariants = classVarianceAuthority.cva(["text-xs font-medium"], {
16993
+ variants: {
16994
+ matchState: {
16995
+ exact: "text-success-700",
16996
+ partial: "text-warning-700",
16997
+ ambiguous: "text-warning-700",
16998
+ none: "text-destructive"
16999
+ }
17000
+ },
17001
+ defaultVariants: {
17002
+ matchState: "none"
17003
+ }
17004
+ });
17005
+ function matchStateSignal(matchState) {
17006
+ switch (matchState) {
17007
+ case "exact":
17008
+ return { role: "status", ariaLive: "off" };
17009
+ case "partial":
17010
+ return { role: "status", ariaLive: "polite" };
17011
+ case "ambiguous":
17012
+ return { role: "alert", ariaLive: "assertive" };
17013
+ case "none":
17014
+ return { role: "alert", ariaLive: "polite" };
17015
+ }
17016
+ }
17017
+ function cn115(...classes) {
17018
+ return classes.filter(Boolean).join(" ");
17019
+ }
17020
+ function MosaicMatchInput({
17021
+ matchState,
17022
+ stateLabels,
17023
+ locked,
17024
+ className,
17025
+ ...comboboxProps
17026
+ }) {
17027
+ const { role, ariaLive } = matchStateSignal(matchState);
17028
+ const label = stateLabels[matchState];
17029
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "match-input", className: cn115("flex flex-col gap-1", className), children: [
17030
+ /* @__PURE__ */ jsxRuntime.jsx(MosaicCombobox, { ...comboboxProps, disabled: locked }),
17031
+ /* @__PURE__ */ jsxRuntime.jsx(
17032
+ "span",
17033
+ {
17034
+ role,
17035
+ "aria-live": ariaLive,
17036
+ "data-match-state": matchState,
17037
+ className: matchStateVariants({ matchState }),
17038
+ children: label
17039
+ }
17040
+ )
17041
+ ] });
17042
+ }
17043
+ MosaicMatchInput.displayName = "MosaicMatchInput";
17044
+ var editableCellVariants = classVarianceAuthority.cva(
17045
+ ["inline-flex w-full items-center rounded-sm px-1.5 py-1 text-sm"],
17046
+ {
17047
+ variants: {
17048
+ disabled: {
17049
+ true: "cursor-not-allowed text-muted-foreground",
17050
+ false: "cursor-text hover:bg-accent/50"
17051
+ }
17052
+ },
17053
+ defaultVariants: {
17054
+ disabled: false
17055
+ }
17056
+ }
17057
+ );
17058
+ function cn116(...classes) {
17059
+ return classes.filter(Boolean).join(" ");
17060
+ }
17061
+ function MosaicEditableCell({
17062
+ value,
17063
+ onCommit,
17064
+ onCancel,
17065
+ validate,
17066
+ editAriaLabel,
17067
+ disabled,
17068
+ className,
17069
+ ref
17070
+ }) {
17071
+ const [isEditing, setIsEditing] = React30__namespace.useState(false);
17072
+ const [draft, setDraft] = React30__namespace.useState("");
17073
+ const [error, setError] = React30__namespace.useState(null);
17074
+ function startEdit() {
17075
+ if (disabled) return;
17076
+ setDraft(value);
17077
+ setError(null);
17078
+ setIsEditing(true);
17079
+ }
17080
+ function commit() {
17081
+ const message = validate ? validate(draft) : null;
17082
+ if (message) {
17083
+ setError(message);
17084
+ return;
17085
+ }
17086
+ setError(null);
17087
+ setIsEditing(false);
17088
+ onCommit(draft);
17089
+ }
17090
+ function cancel() {
17091
+ setDraft(value);
17092
+ setError(null);
17093
+ setIsEditing(false);
17094
+ onCancel?.();
17095
+ }
17096
+ function handleKeyDown(event) {
17097
+ if (event.key === "Enter") {
17098
+ commit();
17099
+ } else if (event.key === "Escape") {
17100
+ cancel();
17101
+ }
17102
+ }
17103
+ if (!isEditing) {
17104
+ return /* @__PURE__ */ jsxRuntime.jsx(
17105
+ "button",
17106
+ {
17107
+ ref,
17108
+ type: "button",
17109
+ "data-slot": "editable-cell",
17110
+ disabled,
17111
+ "aria-label": editAriaLabel,
17112
+ className: cn116(editableCellVariants({ disabled }), "text-left", className),
17113
+ onDoubleClick: startEdit,
17114
+ onKeyDown: (event) => {
17115
+ if (!disabled && event.key === "Enter") {
17116
+ startEdit();
17117
+ }
17118
+ },
17119
+ children: value
17120
+ }
17121
+ );
17122
+ }
17123
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17124
+ "div",
17125
+ {
17126
+ ref,
17127
+ "data-slot": "editable-cell",
17128
+ className: cn116("flex flex-col gap-1", className),
17129
+ children: [
17130
+ /* @__PURE__ */ jsxRuntime.jsx(
17131
+ MosaicInput,
17132
+ {
17133
+ "aria-label": editAriaLabel,
17134
+ value: draft,
17135
+ autoFocus: true,
17136
+ onChange: (event) => setDraft(event.target.value),
17137
+ onKeyDown: handleKeyDown,
17138
+ onBlur: commit
17139
+ }
17140
+ ),
17141
+ error ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-destructive", children: error }) : null
17142
+ ]
17143
+ }
17144
+ );
17145
+ }
17146
+ MosaicEditableCell.displayName = "MosaicEditableCell";
17147
+
17148
+ // src/components/artifact-canvas-adapter/normalize.ts
17149
+ var KNOWN_TYPES = ["document", "data-table", "checklist", "chart"];
17150
+ function isArtifactType(value) {
17151
+ return KNOWN_TYPES.includes(value);
17152
+ }
17153
+ function titleFromData(data) {
17154
+ return typeof data.title === "string" ? data.title : "";
17155
+ }
17156
+ function normalizeFromAiSdkArtifacts(source) {
17157
+ if (!source.activeId) return null;
17158
+ const entry = source.artifacts.find((a) => a.id === source.activeId);
17159
+ if (!entry) return null;
17160
+ if (!isArtifactType(entry.type)) return null;
17161
+ return {
17162
+ id: entry.id,
17163
+ type: entry.type,
17164
+ title: titleFromData(entry.data),
17165
+ data: entry.data
17166
+ };
17167
+ }
17168
+ function normalizeFromMcpToolResult(source) {
17169
+ const resourceUri = source.toolResult?._meta?.ui?.resourceUri;
17170
+ if (!resourceUri) return null;
17171
+ const segments = resourceUri.split("/").filter(Boolean);
17172
+ const typeSegment = segments[segments.length - 1];
17173
+ if (!typeSegment || !isArtifactType(typeSegment)) return null;
17174
+ const data = source.toolResult.structuredContent ?? {};
17175
+ const id = typeof data.id === "string" ? data.id : resourceUri;
17176
+ return {
17177
+ id,
17178
+ type: typeSegment,
17179
+ title: titleFromData(data),
17180
+ data
17181
+ };
17182
+ }
17183
+ function normalizeArtifact(source) {
17184
+ if (source.kind === "ai-sdk-artifacts") return normalizeFromAiSdkArtifacts(source);
17185
+ if (source.kind === "mcp-ui") return normalizeFromMcpToolResult(source);
17186
+ return null;
17187
+ }
17188
+ function cn117(...classes) {
17189
+ return classes.filter(Boolean).join(" ");
17190
+ }
17191
+ function MosaicArtifactCanvasAdapter({
17192
+ source,
17193
+ isOpen,
17194
+ onToggle,
17195
+ onClose,
17196
+ labels,
17197
+ className,
17198
+ ref
17199
+ }) {
17200
+ const artifact = source ? normalizeArtifact(source) : null;
17201
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, "data-slot": "artifact-canvas-adapter", className: cn117("relative", className), children: [
17202
+ /* @__PURE__ */ jsxRuntime.jsx(
17203
+ "button",
17204
+ {
17205
+ type: "button",
17206
+ "data-slot": "artifact-canvas-toggle",
17207
+ "aria-label": labels.toggleLabel,
17208
+ "aria-expanded": isOpen,
17209
+ onClick: onToggle,
17210
+ className: cn117(
17211
+ "inline-flex items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium",
17212
+ "outline-none transition-colors",
17213
+ "focus-visible:ring-ring focus-visible:ring-[3px]",
17214
+ "bg-muted text-muted-foreground hover:text-foreground"
17215
+ ),
17216
+ children: labels.toggleLabel
17217
+ }
17218
+ ),
17219
+ isOpen && /* @__PURE__ */ jsxRuntime.jsxs(
17220
+ "section",
17221
+ {
17222
+ "aria-label": labels.toolbarHeading,
17223
+ "data-slot": "artifact-canvas",
17224
+ className: cn117(
17225
+ "mt-2 flex flex-col rounded-lg border border-border bg-background",
17226
+ "shadow-xs"
17227
+ ),
17228
+ children: [
17229
+ /* @__PURE__ */ jsxRuntime.jsxs(
17230
+ "div",
17231
+ {
17232
+ "data-slot": "artifact-canvas-toolbar",
17233
+ className: "flex items-center justify-between border-border border-b px-4 py-2",
17234
+ children: [
17235
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm", children: labels.toolbarHeading }),
17236
+ /* @__PURE__ */ jsxRuntime.jsx(
17237
+ "button",
17238
+ {
17239
+ type: "button",
17240
+ "aria-label": labels.closeLabel,
17241
+ onClick: onClose,
17242
+ className: cn117(
17243
+ "rounded-md p-1 outline-none transition-colors",
17244
+ "focus-visible:ring-ring focus-visible:ring-[3px]",
17245
+ "hover:bg-muted"
17246
+ ),
17247
+ children: labels.closeLabel
17248
+ }
17249
+ )
17250
+ ]
17251
+ }
17252
+ ),
17253
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "artifact-canvas-body", className: "flex-1 p-4", children: [
17254
+ !source && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
17255
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-muted-foreground", children: labels.emptyTitle }),
17256
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-muted-foreground/70 text-sm", children: labels.emptyBody })
17257
+ ] }),
17258
+ source && !artifact && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
17259
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-muted-foreground", children: labels.notFoundTitle }),
17260
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-muted-foreground/70 text-sm", children: labels.notFoundBody })
17261
+ ] }),
17262
+ artifact && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "artifact-canvas-artifact", "data-artifact-type": artifact.type, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
17263
+ /* @__PURE__ */ jsxRuntime.jsx(
17264
+ "span",
17265
+ {
17266
+ "data-slot": "artifact-canvas-type-badge",
17267
+ className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
17268
+ children: labels.typeLabel(artifact.type)
17269
+ }
17270
+ ),
17271
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-base", children: artifact.title })
17272
+ ] }) })
17273
+ ] })
17274
+ ]
17275
+ }
17276
+ )
17277
+ ] });
17278
+ }
17279
+ MosaicArtifactCanvasAdapter.displayName = "MosaicArtifactCanvasAdapter";
17280
+ function cn118(...classes) {
17281
+ return classes.filter(Boolean).join(" ");
17282
+ }
17283
+ function MosaicArtifactDocument({
17284
+ data,
17285
+ labels,
17286
+ className,
17287
+ ref
17288
+ }) {
17289
+ const sortedSections = data.sections ? [...data.sections].sort((a, b) => a.order - b.order) : [];
17290
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17291
+ "div",
17292
+ {
17293
+ ref,
17294
+ "data-slot": "artifact-document",
17295
+ className: cn118(
17296
+ "flex h-full flex-col rounded-lg border border-border bg-background",
17297
+ className
17298
+ ),
17299
+ children: [
17300
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3 border-border border-b px-4 py-3", children: [
17301
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
17302
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "truncate font-medium text-base", children: data.title }),
17303
+ /* @__PURE__ */ jsxRuntime.jsx(
17304
+ "span",
17305
+ {
17306
+ "data-slot": "artifact-document-type-badge",
17307
+ className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
17308
+ children: labels.typeBadgeLabel
17309
+ }
17310
+ )
17311
+ ] }),
17312
+ data.metadata?.updatedAt && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-muted-foreground text-xs", children: labels.updatedLabel(new Date(data.metadata.updatedAt).toLocaleDateString()) })
17313
+ ] }),
17314
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-auto p-6", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "whitespace-pre-wrap text-sm leading-relaxed", children: data.content || labels.emptyContentMessage }) }),
17315
+ sortedSections.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-border border-t p-4", children: [
17316
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "mb-3 font-medium text-sm", children: labels.sectionsHeading }),
17317
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-2", children: sortedSections.map((section) => /* @__PURE__ */ jsxRuntime.jsxs(
17318
+ "li",
17319
+ {
17320
+ "data-slot": "artifact-document-section",
17321
+ className: "flex items-center gap-2 rounded bg-muted/50 p-2",
17322
+ children: [
17323
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-4 w-1 shrink-0 rounded-full bg-primary" }),
17324
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm", children: section.title }),
17325
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto rounded-full border border-border px-2 py-0.5 text-muted-foreground text-xs", children: labels.charsLabel(section.content.length) })
17326
+ ]
17327
+ },
17328
+ section.id
17329
+ )) })
17330
+ ] }),
17331
+ data.metadata?.tags && data.metadata.tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-border border-t p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
17332
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs", children: labels.tagsLabel }),
17333
+ data.metadata.tags.map((tag) => /* @__PURE__ */ jsxRuntime.jsx(
17334
+ "span",
17335
+ {
17336
+ "data-slot": "artifact-document-tag",
17337
+ className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
17338
+ children: tag
17339
+ },
17340
+ tag
17341
+ ))
17342
+ ] }) })
17343
+ ]
17344
+ }
17345
+ );
17346
+ }
17347
+ MosaicArtifactDocument.displayName = "MosaicArtifactDocument";
17348
+ function cn119(...classes) {
17349
+ return classes.filter(Boolean).join(" ");
17350
+ }
17351
+ function MosaicArtifactDataTable({
17352
+ data,
17353
+ labels,
17354
+ className,
17355
+ ref
17356
+ }) {
17357
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17358
+ "div",
17359
+ {
17360
+ ref,
17361
+ "data-slot": "artifact-data-table",
17362
+ className: cn119(
17363
+ "flex h-full flex-col rounded-lg border border-border bg-background",
17364
+ className
17365
+ ),
17366
+ children: [
17367
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 border-border border-b px-4 py-3", children: [
17368
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-medium text-base", children: data.title }),
17369
+ /* @__PURE__ */ jsxRuntime.jsx(
17370
+ "span",
17371
+ {
17372
+ "data-slot": "artifact-data-table-type-badge",
17373
+ className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
17374
+ children: labels.typeBadgeLabel
17375
+ }
17376
+ ),
17377
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full border border-border px-2 py-0.5 text-muted-foreground text-xs", children: labels.rowsColsLabel(data.rows.length, data.columns.length) })
17378
+ ] }),
17379
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
17380
+ MosaicDataTable,
17381
+ {
17382
+ columns: data.columns.map((column) => ({
17383
+ key: column.id,
17384
+ header: column.name,
17385
+ render: (row) => {
17386
+ const value = row[column.id];
17387
+ if (column.type === "boolean") {
17388
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs", children: value ? labels.yesLabel : labels.noLabel });
17389
+ }
17390
+ if (column.type === "number") {
17391
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: String(value ?? "") });
17392
+ }
17393
+ return String(value ?? "");
17394
+ }
17395
+ })),
17396
+ rows: data.rows,
17397
+ emptyMessage: labels.emptyMessage
17398
+ }
17399
+ ) })
17400
+ ]
17401
+ }
17402
+ );
17403
+ }
17404
+ MosaicArtifactDataTable.displayName = "MosaicArtifactDataTable";
17405
+ function cn120(...classes) {
17406
+ return classes.filter(Boolean).join(" ");
17407
+ }
17408
+ var CHART_COLORS = [
17409
+ "var(--color-chart-1, #8884d8)",
17410
+ "var(--color-chart-2, #82ca9d)",
17411
+ "var(--color-chart-3, #ffc658)",
17412
+ "var(--color-chart-4, #ff7300)",
17413
+ "var(--color-chart-5, #00c2ff)"
17414
+ ];
17415
+ function seriesKeys(rows, xAxisKey) {
17416
+ return Object.keys(rows[0] ?? {}).filter((key) => key !== xAxisKey);
17417
+ }
17418
+ function renderChart(data, labels, recharts) {
17419
+ const {
17420
+ BarChart,
17421
+ Bar,
17422
+ LineChart,
17423
+ Line,
17424
+ PieChart,
17425
+ Pie,
17426
+ Cell,
17427
+ XAxis,
17428
+ YAxis,
17429
+ CartesianGrid,
17430
+ Tooltip: Tooltip2,
17431
+ Legend,
17432
+ ResponsiveContainer
17433
+ } = recharts;
17434
+ const xAxisKey = data.config?.xAxis ?? Object.keys(data.data[0] ?? {})[0] ?? "";
17435
+ const colors = data.config?.colors ?? CHART_COLORS;
17436
+ if (data.type === "bar") {
17437
+ return /* @__PURE__ */ jsxRuntime.jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(BarChart, { data: data.data, margin: { top: 20, right: 30, left: 20, bottom: 5 }, children: [
17438
+ data.config?.grid && /* @__PURE__ */ jsxRuntime.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
17439
+ /* @__PURE__ */ jsxRuntime.jsx(XAxis, { dataKey: xAxisKey }),
17440
+ /* @__PURE__ */ jsxRuntime.jsx(YAxis, {}),
17441
+ /* @__PURE__ */ jsxRuntime.jsx(Tooltip2, {}),
17442
+ data.config?.legend && /* @__PURE__ */ jsxRuntime.jsx(Legend, {}),
17443
+ seriesKeys(data.data, xAxisKey).map((key, index) => /* @__PURE__ */ jsxRuntime.jsx(Bar, { dataKey: key, fill: colors[index % colors.length] }, key))
17444
+ ] }) });
17445
+ }
17446
+ if (data.type === "line") {
17447
+ return /* @__PURE__ */ jsxRuntime.jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(LineChart, { data: data.data, margin: { top: 20, right: 30, left: 20, bottom: 5 }, children: [
17448
+ data.config?.grid && /* @__PURE__ */ jsxRuntime.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
17449
+ /* @__PURE__ */ jsxRuntime.jsx(XAxis, { dataKey: xAxisKey }),
17450
+ /* @__PURE__ */ jsxRuntime.jsx(YAxis, {}),
17451
+ /* @__PURE__ */ jsxRuntime.jsx(Tooltip2, {}),
17452
+ data.config?.legend && /* @__PURE__ */ jsxRuntime.jsx(Legend, {}),
17453
+ seriesKeys(data.data, xAxisKey).map((key, index) => /* @__PURE__ */ jsxRuntime.jsx(
17454
+ Line,
17455
+ {
17456
+ type: "monotone",
17457
+ dataKey: key,
17458
+ stroke: colors[index % colors.length],
17459
+ strokeWidth: 2
17460
+ },
17461
+ key
17462
+ ))
17463
+ ] }) });
17464
+ }
17465
+ if (data.type === "pie") {
17466
+ const nameKey = Object.keys(data.data[0] ?? {})[0] ?? "name";
17467
+ const valueKey = Object.keys(data.data[0] ?? {})[1] ?? "value";
17468
+ return /* @__PURE__ */ jsxRuntime.jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(PieChart, { children: [
17469
+ /* @__PURE__ */ jsxRuntime.jsx(Pie, { data: data.data, cx: "50%", cy: "50%", outerRadius: 80, dataKey: valueKey, children: data.data.map((entry, index) => /* @__PURE__ */ jsxRuntime.jsx(Cell, { fill: colors[index % colors.length] }, String(entry[nameKey] ?? index))) }),
17470
+ /* @__PURE__ */ jsxRuntime.jsx(Tooltip2, {}),
17471
+ data.config?.legend && /* @__PURE__ */ jsxRuntime.jsx(Legend, {})
17472
+ ] }) });
17473
+ }
17474
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center text-muted-foreground text-sm", children: labels.unsupportedTypeMessage(data.type) });
17475
+ }
17476
+ function MosaicArtifactChart({
17477
+ data,
17478
+ labels,
17479
+ recharts,
17480
+ className,
17481
+ ref
17482
+ }) {
17483
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17484
+ "div",
17485
+ {
17486
+ ref,
17487
+ "data-slot": "artifact-chart",
17488
+ className: cn120(
17489
+ "flex h-full flex-col rounded-lg border border-border bg-background",
17490
+ className
17491
+ ),
17492
+ children: [
17493
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 border-border border-b px-4 py-3", children: [
17494
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-medium text-base", children: data.title }),
17495
+ /* @__PURE__ */ jsxRuntime.jsx(
17496
+ "span",
17497
+ {
17498
+ "data-slot": "artifact-chart-type-badge",
17499
+ className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
17500
+ children: labels.typeBadgeLabel(data.type)
17501
+ }
17502
+ ),
17503
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full border border-border px-2 py-0.5 text-muted-foreground text-xs", children: labels.pointsLabel(data.data.length) })
17504
+ ] }),
17505
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-64 flex-1 p-6", children: recharts ? renderChart(data, labels, recharts) : /* @__PURE__ */ jsxRuntime.jsx(
17506
+ "div",
17507
+ {
17508
+ "data-slot": "artifact-chart-unavailable",
17509
+ className: "flex h-full items-center justify-center text-muted-foreground text-sm",
17510
+ children: labels.unavailableMessage
17511
+ }
17512
+ ) }),
17513
+ (data.metadata?.dataSource || data.metadata?.description) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-border border-t px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 text-muted-foreground text-xs", children: [
17514
+ data.metadata?.dataSource && /* @__PURE__ */ jsxRuntime.jsx("span", { children: data.metadata.dataSource }),
17515
+ data.metadata?.description && /* @__PURE__ */ jsxRuntime.jsx("span", { children: data.metadata.description })
17516
+ ] }) })
17517
+ ]
17518
+ }
17519
+ );
17520
+ }
17521
+ MosaicArtifactChart.displayName = "MosaicArtifactChart";
17522
+ function cn121(...classes) {
17523
+ return classes.filter(Boolean).join(" ");
17524
+ }
17525
+ function MosaicArtifactChecklist({
17526
+ data,
17527
+ labels,
17528
+ className,
17529
+ ref
17530
+ }) {
17531
+ const completedCount = data.items.filter((item) => item.completed).length;
17532
+ const totalCount = data.items.length;
17533
+ const progress = totalCount > 0 ? completedCount / totalCount * 100 : 0;
17534
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17535
+ "div",
17536
+ {
17537
+ ref,
17538
+ "data-slot": "artifact-checklist",
17539
+ className: cn121(
17540
+ "flex h-full flex-col rounded-lg border border-border bg-background",
17541
+ className
17542
+ ),
17543
+ children: [
17544
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 border-border border-b px-4 py-3", children: [
17545
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-medium text-base", children: data.title }),
17546
+ /* @__PURE__ */ jsxRuntime.jsx(
17547
+ "span",
17548
+ {
17549
+ "data-slot": "artifact-checklist-type-badge",
17550
+ className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
17551
+ children: labels.typeBadgeLabel
17552
+ }
17553
+ ),
17554
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full border border-border px-2 py-0.5 text-muted-foreground text-xs", children: labels.progressLabel(completedCount, totalCount) })
17555
+ ] }),
17556
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 border-border border-b bg-muted/20 p-4", children: [
17557
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between text-sm", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: labels.completedOfTotalLabel(completedCount, totalCount, Math.round(progress)) }) }),
17558
+ /* @__PURE__ */ jsxRuntime.jsx(MosaicProgress, { value: progress, "aria-label": labels.typeBadgeLabel }),
17559
+ data.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: data.description })
17560
+ ] }),
17561
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-auto p-4", children: totalCount === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-8 text-center text-muted-foreground text-sm", children: labels.emptyMessage }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-3", children: data.items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
17562
+ "li",
17563
+ {
17564
+ "data-slot": "artifact-checklist-item",
17565
+ className: cn121(
17566
+ "flex items-start gap-3 rounded-lg border p-3",
17567
+ item.completed ? "border-primary/20 bg-primary/10" : "border-border bg-background"
17568
+ ),
17569
+ children: [
17570
+ /* @__PURE__ */ jsxRuntime.jsx(
17571
+ "span",
17572
+ {
17573
+ "aria-hidden": "true",
17574
+ className: cn121(
17575
+ "mt-0.5 h-4 w-4 shrink-0 rounded border-2",
17576
+ item.completed ? "border-primary bg-primary" : "border-muted-foreground"
17577
+ )
17578
+ }
17579
+ ),
17580
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
17581
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-2", children: [
17582
+ /* @__PURE__ */ jsxRuntime.jsx(
17583
+ "span",
17584
+ {
17585
+ className: cn121(
17586
+ "text-sm leading-relaxed",
17587
+ item.completed && "text-muted-foreground line-through"
17588
+ ),
17589
+ children: item.text
17590
+ }
17591
+ ),
17592
+ item.priority && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 rounded-full border border-border px-2 py-0.5 text-xs", children: labels.priorityLabel(item.priority) })
17593
+ ] }),
17594
+ item.notes && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 rounded bg-muted/50 p-2 text-muted-foreground text-xs", children: item.notes })
17595
+ ] })
17596
+ ]
17597
+ },
17598
+ item.id
17599
+ )) }) }),
17600
+ data.metadata?.category && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-border border-t bg-muted/20 px-4 py-3 text-muted-foreground text-xs", children: data.metadata.category })
17601
+ ]
17602
+ }
17603
+ );
17604
+ }
17605
+ MosaicArtifactChecklist.displayName = "MosaicArtifactChecklist";
17606
+ function cn122(...classes) {
17607
+ return classes.filter(Boolean).join(" ");
17608
+ }
17609
+ function SearchIcon10() {
17610
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17611
+ "svg",
17612
+ {
17613
+ xmlns: "http://www.w3.org/2000/svg",
17614
+ width: "16",
17615
+ height: "16",
17616
+ viewBox: "0 0 24 24",
17617
+ fill: "none",
17618
+ stroke: "currentColor",
17619
+ strokeWidth: "2",
17620
+ strokeLinecap: "round",
17621
+ strokeLinejoin: "round",
17622
+ "aria-hidden": "true",
17623
+ children: [
17624
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11", cy: "11", r: "8" }),
17625
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
17626
+ ]
17627
+ }
17628
+ );
17629
+ }
17630
+ function MosaicArtifactLibrary({
17631
+ items,
17632
+ selectedId,
17633
+ onSelect,
17634
+ source,
17635
+ isCanvasOpen,
17636
+ onToggleCanvas,
17637
+ onCloseCanvas,
17638
+ title,
17639
+ searchPlaceholder,
17640
+ searchAriaLabel,
17641
+ emptyMessage,
17642
+ typeLabel,
17643
+ countLabel,
17644
+ adapterLabels,
17645
+ className
17646
+ }) {
17647
+ const [query, setQuery] = React30__namespace.useState("");
17648
+ const filtered = React30__namespace.useMemo(() => {
17649
+ const q = query.trim().toLowerCase();
17650
+ if (!q) return items;
17651
+ return items.filter((item) => item.title.toLowerCase().includes(q));
17652
+ }, [items, query]);
17653
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "artifact-library", className: cn122("flex h-full flex-col", className), children: [
17654
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-border border-b px-4 py-3", children: [
17655
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
17656
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-semibold text-lg", children: title }),
17657
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs", children: countLabel(filtered.length) })
17658
+ ] }),
17659
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
17660
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "-translate-y-1/2 absolute top-1/2 left-3 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(SearchIcon10, {}) }),
17661
+ /* @__PURE__ */ jsxRuntime.jsx(
17662
+ "input",
17663
+ {
17664
+ type: "search",
17665
+ "data-slot": "artifact-library-search",
17666
+ value: query,
17667
+ onChange: (e) => setQuery(e.target.value),
17668
+ placeholder: searchPlaceholder,
17669
+ "aria-label": searchAriaLabel,
17670
+ className: cn122(
17671
+ "w-full rounded-md border border-input bg-background py-2 pr-3 pl-9",
17672
+ "text-sm placeholder:text-muted-foreground",
17673
+ "outline-none focus-visible:ring-[3px] focus-visible:ring-ring"
17674
+ )
17675
+ }
17676
+ )
17677
+ ] })
17678
+ ] }),
17679
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 overflow-y-auto p-4", children: [
17680
+ filtered.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-10 text-center text-muted-foreground text-sm", children: emptyMessage }),
17681
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { "data-slot": "artifact-library-list", className: "space-y-2", children: filtered.map((item) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
17682
+ "button",
17683
+ {
17684
+ type: "button",
17685
+ "data-slot": "artifact-library-item",
17686
+ "aria-current": selectedId === item.id ? "true" : void 0,
17687
+ onClick: () => onSelect(item.id),
17688
+ className: cn122(
17689
+ "flex w-full items-start justify-between gap-3 rounded-md border border-border px-3 py-2 text-left",
17690
+ "outline-none transition-colors hover:bg-muted",
17691
+ "focus-visible:ring-[3px] focus-visible:ring-ring",
17692
+ selectedId === item.id && "border-primary bg-primary/5"
17693
+ ),
17694
+ children: [
17695
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
17696
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate font-medium text-sm", children: item.title }),
17697
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-muted-foreground text-xs", children: item.updatedAtLabel })
17698
+ ] }),
17699
+ /* @__PURE__ */ jsxRuntime.jsx(
17700
+ "span",
17701
+ {
17702
+ "data-slot": "artifact-library-item-type",
17703
+ className: "shrink-0 rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
17704
+ children: typeLabel(item.type)
17705
+ }
17706
+ )
17707
+ ]
17708
+ }
17709
+ ) }, item.id)) })
17710
+ ] }),
17711
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "artifact-library-canvas", className: "border-border border-t p-4", children: /* @__PURE__ */ jsxRuntime.jsx(
17712
+ MosaicArtifactCanvasAdapter,
17713
+ {
17714
+ source,
17715
+ isOpen: isCanvasOpen,
17716
+ onToggle: onToggleCanvas,
17717
+ onClose: onCloseCanvas,
17718
+ labels: adapterLabels
17719
+ }
17720
+ ) })
17721
+ ] });
17722
+ }
17723
+ MosaicArtifactLibrary.displayName = "MosaicArtifactLibrary";
17724
+ var artifactSaveAsMemoryFormRootVariants = classVarianceAuthority.cva(["flex flex-col gap-4"]);
17725
+ var artifactSaveAsMemoryFormPreviewVariants = classVarianceAuthority.cva([
17726
+ "flex items-start gap-3 rounded-md border border-border p-3"
17727
+ ]);
17728
+ var artifactSaveAsMemoryFormFieldVariants = classVarianceAuthority.cva(["flex flex-col gap-1.5"]);
17729
+ var artifactSaveAsMemoryFormErrorVariants = classVarianceAuthority.cva(["text-xs font-medium text-destructive"]);
17730
+ var artifactSaveAsMemoryFormLearningVariants = classVarianceAuthority.cva([
17731
+ "flex items-start gap-2 rounded-md border border-border p-2"
17732
+ ]);
17733
+ var artifactSaveAsMemoryFormFooterVariants = classVarianceAuthority.cva([
17734
+ "flex items-center justify-end gap-3 border-t border-border pt-4"
17735
+ ]);
17736
+ var artifactSaveAsMemoryFormButtonVariants = classVarianceAuthority.cva(
17737
+ [
17738
+ "inline-flex min-h-9 items-center justify-center gap-2 rounded-md px-4 text-sm font-medium",
17739
+ "transition-colors disabled:cursor-not-allowed disabled:opacity-50"
17740
+ ],
17741
+ {
17742
+ variants: {
17743
+ intent: {
17744
+ cancel: "border border-border bg-background hover:bg-muted",
17745
+ save: "border border-transparent bg-primary text-primary-foreground hover:bg-primary/90",
17746
+ ghost: "border border-transparent bg-transparent hover:bg-muted"
17747
+ }
17748
+ },
17749
+ defaultVariants: {
17750
+ intent: "cancel"
17751
+ }
17752
+ }
17753
+ );
17754
+ function cn123(...classes) {
17755
+ return classes.filter(Boolean).join(" ");
17756
+ }
17757
+ function MosaicArtifactSaveAsMemoryForm({
17758
+ artifact,
17759
+ typeLabel,
17760
+ title,
17761
+ onTitleChange,
17762
+ titleLabel,
17763
+ titlePlaceholder,
17764
+ titleError,
17765
+ learnings,
17766
+ onEditLearning,
17767
+ onRemoveLearning,
17768
+ learningsLabel,
17769
+ learningsDescription,
17770
+ editLearningAriaLabel,
17771
+ removeLearningAriaLabel,
17772
+ scope,
17773
+ onScopeChange,
17774
+ scopeLabel,
17775
+ scopeOptions,
17776
+ tags,
17777
+ onAddTag,
17778
+ onRemoveTag,
17779
+ tagsLabel,
17780
+ tagInputPlaceholder,
17781
+ removeTagAriaLabel,
17782
+ suggestedTags,
17783
+ maxTags,
17784
+ isSaving,
17785
+ canSave,
17786
+ onSave,
17787
+ onCancel,
17788
+ saveLabel,
17789
+ savingLabel,
17790
+ cancelLabel,
17791
+ className
17792
+ }) {
17793
+ const titleErrorId = React30.useId();
17794
+ const scopeId = React30.useId();
17795
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17796
+ "div",
17797
+ {
17798
+ "data-slot": "artifact-save-as-memory-form",
17799
+ className: cn123(artifactSaveAsMemoryFormRootVariants(), className),
17800
+ children: [
17801
+ /* @__PURE__ */ jsxRuntime.jsx(
17802
+ "div",
17803
+ {
17804
+ "data-slot": "artifact-save-as-memory-form-preview",
17805
+ className: artifactSaveAsMemoryFormPreviewVariants(),
17806
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
17807
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate font-medium text-sm", children: artifact.title }),
17808
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 line-clamp-2 text-muted-foreground text-xs", children: artifact.preview || artifact.content }),
17809
+ /* @__PURE__ */ jsxRuntime.jsx(
17810
+ "span",
17811
+ {
17812
+ "data-slot": "artifact-save-as-memory-form-type",
17813
+ className: "mt-2 inline-block shrink-0 rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs",
17814
+ children: typeLabel(artifact.type)
17815
+ }
17816
+ )
17817
+ ] })
17818
+ }
17819
+ ),
17820
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: artifactSaveAsMemoryFormFieldVariants(), children: [
17821
+ /* @__PURE__ */ jsxRuntime.jsx(
17822
+ "label",
17823
+ {
17824
+ htmlFor: "mosaic-artifact-save-as-memory-title",
17825
+ className: "text-sm font-medium text-foreground",
17826
+ children: titleLabel
17827
+ }
17828
+ ),
17829
+ /* @__PURE__ */ jsxRuntime.jsx(
17830
+ MosaicInput,
17831
+ {
17832
+ id: "mosaic-artifact-save-as-memory-title",
17833
+ value: title,
17834
+ placeholder: titlePlaceholder,
17835
+ onChange: (e) => onTitleChange(e.target.value),
17836
+ "aria-invalid": titleError ? "true" : "false",
17837
+ "aria-describedby": titleError ? titleErrorId : void 0
17838
+ }
17839
+ ),
17840
+ titleError && /* @__PURE__ */ jsxRuntime.jsx("p", { id: titleErrorId, className: artifactSaveAsMemoryFormErrorVariants(), children: titleError })
17841
+ ] }),
17842
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: artifactSaveAsMemoryFormFieldVariants(), children: [
17843
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: learningsLabel }),
17844
+ learningsDescription && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-xs", children: learningsDescription }),
17845
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: learnings.map((learning, index) => /* @__PURE__ */ jsxRuntime.jsxs(
17846
+ "div",
17847
+ {
17848
+ "data-slot": "artifact-save-as-memory-form-learning",
17849
+ className: artifactSaveAsMemoryFormLearningVariants(),
17850
+ children: [
17851
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "flex-1 text-sm", children: learning }),
17852
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 gap-1", children: [
17853
+ /* @__PURE__ */ jsxRuntime.jsx(
17854
+ "button",
17855
+ {
17856
+ type: "button",
17857
+ "data-slot": "artifact-save-as-memory-form-learning-edit",
17858
+ onClick: () => onEditLearning(index),
17859
+ "aria-label": editLearningAriaLabel(index),
17860
+ className: artifactSaveAsMemoryFormButtonVariants({ intent: "ghost" }),
17861
+ children: editLearningAriaLabel(index)
17862
+ }
17863
+ ),
17864
+ /* @__PURE__ */ jsxRuntime.jsx(
17865
+ "button",
17866
+ {
17867
+ type: "button",
17868
+ "data-slot": "artifact-save-as-memory-form-learning-remove",
17869
+ onClick: () => onRemoveLearning(index),
17870
+ "aria-label": removeLearningAriaLabel(index),
17871
+ className: artifactSaveAsMemoryFormButtonVariants({ intent: "ghost" }),
17872
+ children: removeLearningAriaLabel(index)
17873
+ }
17874
+ )
17875
+ ] })
17876
+ ]
17877
+ },
17878
+ `${index}-${learning}`
17879
+ )) })
17880
+ ] }),
17881
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: artifactSaveAsMemoryFormFieldVariants(), children: [
17882
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: scopeId, className: "text-sm font-medium text-foreground", children: scopeLabel }),
17883
+ /* @__PURE__ */ jsxRuntime.jsx(
17884
+ "select",
17885
+ {
17886
+ id: scopeId,
17887
+ "data-slot": "artifact-save-as-memory-form-scope",
17888
+ value: scope,
17889
+ onChange: (e) => onScopeChange(e.target.value),
17890
+ className: cn123(
17891
+ "h-9 rounded-md border border-input bg-background px-3 text-sm",
17892
+ "outline-none focus-visible:ring-[3px] focus-visible:ring-ring"
17893
+ ),
17894
+ children: scopeOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: option.value, children: option.label }, option.value))
17895
+ }
17896
+ )
17897
+ ] }),
17898
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: artifactSaveAsMemoryFormFieldVariants(), children: [
17899
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: tagsLabel }),
17900
+ /* @__PURE__ */ jsxRuntime.jsx(
17901
+ MosaicTagInput,
17902
+ {
17903
+ tags,
17904
+ onAddTag,
17905
+ onRemoveTag,
17906
+ placeholder: tagInputPlaceholder,
17907
+ removeTagAriaLabel,
17908
+ suggestions: suggestedTags,
17909
+ maxTags
17910
+ }
17911
+ )
17912
+ ] }),
17913
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: artifactSaveAsMemoryFormFooterVariants(), children: [
17914
+ /* @__PURE__ */ jsxRuntime.jsx(
17915
+ "button",
17916
+ {
17917
+ type: "button",
17918
+ "data-slot": "artifact-save-as-memory-form-cancel-button",
17919
+ onClick: onCancel,
17920
+ disabled: isSaving,
17921
+ className: artifactSaveAsMemoryFormButtonVariants({ intent: "cancel" }),
17922
+ children: cancelLabel
17923
+ }
17924
+ ),
17925
+ /* @__PURE__ */ jsxRuntime.jsx(
17926
+ "button",
17927
+ {
17928
+ type: "button",
17929
+ "data-slot": "artifact-save-as-memory-form-save-button",
17930
+ onClick: onSave,
17931
+ disabled: !canSave || isSaving,
17932
+ "aria-busy": isSaving ? "true" : "false",
17933
+ className: artifactSaveAsMemoryFormButtonVariants({ intent: "save" }),
17934
+ children: isSaving ? savingLabel : saveLabel
17935
+ }
17936
+ )
17937
+ ] })
17938
+ ]
17939
+ }
17940
+ );
17941
+ }
17942
+ MosaicArtifactSaveAsMemoryForm.displayName = "MosaicArtifactSaveAsMemoryForm";
17943
+ function cn124(...classes) {
17944
+ return classes.filter(Boolean).join(" ");
17945
+ }
17946
+ function MosaicArtifactVersionHistory(props) {
17947
+ const {
17948
+ versions,
17949
+ selectedId,
17950
+ onSelectVersion,
17951
+ title,
17952
+ emptyMessage,
17953
+ currentLabel,
17954
+ selectAriaLabel,
17955
+ className
17956
+ } = props;
17957
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "artifact-version-history", className: cn124("flex h-full flex-col", className), children: [
17958
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-border border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-semibold text-lg", children: title }) }),
17959
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 overflow-y-auto p-4", children: [
17960
+ versions.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-10 text-center text-muted-foreground text-sm", children: emptyMessage }),
17961
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { "data-slot": "artifact-version-history-list", className: "space-y-2", children: versions.map((version2) => /* @__PURE__ */ jsxRuntime.jsx("li", { "data-slot": "artifact-version-history-item", children: /* @__PURE__ */ jsxRuntime.jsxs(
17962
+ "div",
17963
+ {
17964
+ className: cn124(
17965
+ "flex items-start justify-between gap-3 rounded-md border border-border px-3 py-2",
17966
+ selectedId === version2.id && "border-primary bg-primary/5"
17967
+ ),
17968
+ children: [
17969
+ /* @__PURE__ */ jsxRuntime.jsxs(
17970
+ "button",
17971
+ {
17972
+ type: "button",
17973
+ "aria-current": selectedId === version2.id ? "true" : void 0,
17974
+ onClick: () => onSelectVersion(version2.id),
17975
+ className: cn124(
17976
+ "min-w-0 flex-1 text-left",
17977
+ "outline-none transition-colors",
17978
+ "focus-visible:ring-[3px] focus-visible:ring-ring"
17979
+ ),
17980
+ "aria-label": selectAriaLabel(version2),
17981
+ children: [
17982
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-1 flex flex-wrap items-center gap-2", children: [
17983
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full border border-border px-2 py-0.5 text-xs", children: version2.versionLabel }),
17984
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-secondary-foreground text-xs", children: version2.changeTypeLabel }),
17985
+ version2.isCurrent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-primary px-2 py-0.5 text-primary-foreground text-xs", children: currentLabel })
17986
+ ] }),
17987
+ version2.descriptionLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-1 truncate font-medium text-sm", children: version2.descriptionLabel }),
17988
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3 text-muted-foreground text-xs", children: [
17989
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: version2.authorLabel }),
17990
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: version2.timestampLabel })
17991
+ ] })
17992
+ ]
17993
+ }
17994
+ ),
17995
+ props.onRestoreVersion && !version2.isCurrent && /* @__PURE__ */ jsxRuntime.jsx(
17996
+ "button",
17997
+ {
17998
+ type: "button",
17999
+ onClick: () => props.onRestoreVersion?.(version2.id),
18000
+ className: cn124(
18001
+ "shrink-0 rounded-md border border-input px-2 py-1 text-xs",
18002
+ "outline-none transition-colors hover:bg-muted",
18003
+ "focus-visible:ring-[3px] focus-visible:ring-ring"
18004
+ ),
18005
+ "aria-label": props.restoreAriaLabel(version2),
18006
+ children: props.restoreLabel
18007
+ }
18008
+ )
18009
+ ]
18010
+ }
18011
+ ) }, version2.id)) })
18012
+ ] })
18013
+ ] });
18014
+ }
18015
+ MosaicArtifactVersionHistory.displayName = "MosaicArtifactVersionHistory";
18016
+ function cn125(...classes) {
18017
+ return classes.filter(Boolean).join(" ");
18018
+ }
18019
+ function ChevronDownIcon6() {
18020
+ return /* @__PURE__ */ jsxRuntime.jsx(
18021
+ "svg",
18022
+ {
18023
+ xmlns: "http://www.w3.org/2000/svg",
18024
+ width: "16",
18025
+ height: "16",
18026
+ viewBox: "0 0 24 24",
18027
+ fill: "none",
18028
+ stroke: "currentColor",
18029
+ strokeWidth: "2",
18030
+ strokeLinecap: "round",
18031
+ strokeLinejoin: "round",
18032
+ "aria-hidden": "true",
18033
+ className: "h-4 w-4 shrink-0 text-muted-foreground",
18034
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 9 6 6 6-6" })
18035
+ }
18036
+ );
18037
+ }
18038
+ function OrgAvatar({ org }) {
18039
+ if (org.avatarUrl) {
18040
+ return /* @__PURE__ */ jsxRuntime.jsx(
18041
+ "img",
18042
+ {
18043
+ src: org.avatarUrl,
18044
+ alt: "",
18045
+ className: "h-8 w-8 shrink-0 rounded-full object-cover md:h-10 md:w-10"
18046
+ }
18047
+ );
18048
+ }
18049
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/10 md:h-10 md:w-10", children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "text-primary text-sm font-medium", children: org.name.charAt(0).toUpperCase() }) });
18050
+ }
18051
+ function MosaicOrgContextDisplay(props) {
18052
+ const { org, roleLabel, roleDescription, memberCountLabel, className } = props;
18053
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
18054
+ /* @__PURE__ */ jsxRuntime.jsx(OrgAvatar, { org }),
18055
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 text-left", children: [
18056
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
18057
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-medium text-sm md:text-base", children: org.name }),
18058
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden md:inline-flex", children: /* @__PURE__ */ jsxRuntime.jsx(MosaicOrgRoleBadge, { role: org.role, label: roleLabel, description: roleDescription }) })
18059
+ ] }),
18060
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden text-muted-foreground text-xs md:block", children: memberCountLabel(org.memberCount) })
18061
+ ] })
18062
+ ] });
18063
+ if (!props.onSwitchOrg) {
18064
+ return /* @__PURE__ */ jsxRuntime.jsx(
18065
+ "div",
18066
+ {
18067
+ "data-slot": "org-context-display",
18068
+ className: cn125("flex w-full items-center gap-3 min-h-[44px] p-2 md:p-3", className),
18069
+ children: content
18070
+ }
18071
+ );
18072
+ }
18073
+ return /* @__PURE__ */ jsxRuntime.jsxs(
18074
+ "button",
18075
+ {
18076
+ type: "button",
18077
+ "data-slot": "org-context-display",
18078
+ onClick: props.onSwitchOrg,
18079
+ "aria-label": props.switchAriaLabel,
18080
+ className: cn125(
18081
+ "flex w-full items-center gap-3 justify-start rounded-md border border-border",
18082
+ "outline-none transition-colors hover:bg-accent min-h-[44px] p-2 md:p-3",
18083
+ "focus-visible:ring-[3px] focus-visible:ring-ring",
18084
+ className
18085
+ ),
18086
+ children: [
18087
+ content,
18088
+ /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon6, {})
18089
+ ]
18090
+ }
18091
+ );
18092
+ }
18093
+ MosaicOrgContextDisplay.displayName = "MosaicOrgContextDisplay";
18094
+ function cn126(...classes) {
18095
+ return classes.filter(Boolean).join(" ");
18096
+ }
18097
+ function ShieldIcon() {
18098
+ return /* @__PURE__ */ jsxRuntime.jsx(
18099
+ "svg",
18100
+ {
18101
+ xmlns: "http://www.w3.org/2000/svg",
18102
+ width: "16",
18103
+ height: "16",
18104
+ viewBox: "0 0 24 24",
18105
+ fill: "none",
18106
+ stroke: "currentColor",
18107
+ strokeWidth: "2",
18108
+ strokeLinecap: "round",
18109
+ strokeLinejoin: "round",
18110
+ "aria-hidden": "true",
18111
+ className: "size-3 shrink-0 md:size-4",
18112
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 13c0 5-3.5 7.5-7.35 8.95a1 1 0 0 1-1.3 0C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.79 17 5 19 5a1 1 0 0 1 1 1z" })
18113
+ }
18114
+ );
18115
+ }
18116
+ function AlertTriangleIcon() {
18117
+ return /* @__PURE__ */ jsxRuntime.jsxs(
18118
+ "svg",
18119
+ {
18120
+ xmlns: "http://www.w3.org/2000/svg",
18121
+ width: "16",
18122
+ height: "16",
18123
+ viewBox: "0 0 24 24",
18124
+ fill: "none",
18125
+ stroke: "currentColor",
18126
+ strokeWidth: "2",
18127
+ strokeLinecap: "round",
18128
+ strokeLinejoin: "round",
18129
+ "aria-hidden": "true",
18130
+ className: "size-8 shrink-0 text-destructive md:size-10",
18131
+ children: [
18132
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" }),
18133
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 9v4" }),
18134
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 17h.01" })
18135
+ ]
18136
+ }
18137
+ );
18138
+ }
18139
+ function ArrowLeftIcon2() {
18140
+ return /* @__PURE__ */ jsxRuntime.jsxs(
18141
+ "svg",
18142
+ {
18143
+ xmlns: "http://www.w3.org/2000/svg",
18144
+ width: "16",
18145
+ height: "16",
18146
+ viewBox: "0 0 24 24",
18147
+ fill: "none",
18148
+ stroke: "currentColor",
18149
+ strokeWidth: "2",
18150
+ strokeLinecap: "round",
18151
+ strokeLinejoin: "round",
18152
+ "aria-hidden": "true",
18153
+ className: "size-4 shrink-0",
18154
+ children: [
18155
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m12 19-7-7 7-7" }),
18156
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 12H5" })
18157
+ ]
18158
+ }
18159
+ );
18160
+ }
18161
+ function DefaultLoadingFallback() {
18162
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-screen items-center justify-center p-4 md:p-8", children: /* @__PURE__ */ jsxRuntime.jsx(
18163
+ "div",
18164
+ {
18165
+ "data-slot": "admin-only-guard-loading",
18166
+ "aria-hidden": "true",
18167
+ className: "size-8 animate-spin rounded-full border-2 border-muted-foreground/30 border-t-primary md:size-10"
18168
+ }
18169
+ ) });
18170
+ }
18171
+ function MosaicAdminOnlyGuard(props) {
18172
+ const {
18173
+ children,
18174
+ isAdmin,
18175
+ isLoaded,
18176
+ title,
18177
+ description,
18178
+ requiredRoleLabel,
18179
+ loadingFallback,
18180
+ className
18181
+ } = props;
18182
+ if (!isLoaded) {
18183
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: loadingFallback ?? /* @__PURE__ */ jsxRuntime.jsx(DefaultLoadingFallback, {}) });
18184
+ }
18185
+ if (!isAdmin) {
18186
+ return /* @__PURE__ */ jsxRuntime.jsx(
18187
+ "div",
18188
+ {
18189
+ "data-slot": "admin-only-guard",
18190
+ className: cn126(
18191
+ "flex min-h-screen flex-col items-center justify-center p-4 md:p-8",
18192
+ className
18193
+ ),
18194
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-md flex-col items-center gap-4 rounded-lg border bg-card p-6 md:gap-6 md:p-8", children: [
18195
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-16 items-center justify-center rounded-full bg-destructive/10 md:size-20", children: /* @__PURE__ */ jsxRuntime.jsx(AlertTriangleIcon, {}) }),
18196
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-center font-semibold text-lg md:text-xl", children: title }),
18197
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-center text-muted-foreground text-sm md:text-base", children: description }),
18198
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 rounded-md bg-primary/10 px-3 py-2 text-primary text-xs md:text-sm", children: [
18199
+ /* @__PURE__ */ jsxRuntime.jsx(ShieldIcon, {}),
18200
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: requiredRoleLabel })
18201
+ ] }),
18202
+ props.onExit ? /* @__PURE__ */ jsxRuntime.jsxs(
18203
+ MosaicButton,
18204
+ {
18205
+ onClick: props.onExit,
18206
+ "aria-label": props.exitAriaLabel,
18207
+ className: "mt-2 min-h-[44px] w-full",
18208
+ children: [
18209
+ /* @__PURE__ */ jsxRuntime.jsx(ArrowLeftIcon2, {}),
18210
+ props.exitLabel
18211
+ ]
18212
+ }
18213
+ ) : null
18214
+ ] })
18215
+ }
18216
+ );
18217
+ }
18218
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
18219
+ }
18220
+ MosaicAdminOnlyGuard.displayName = "MosaicAdminOnlyGuard";
16922
18221
 
16923
18222
  Object.defineProperty(exports, "Accordion", {
16924
18223
  enumerable: true,
@@ -16938,6 +18237,7 @@ exports.MosaicAdaptiveGrid = MosaicAdaptiveGrid;
16938
18237
  exports.MosaicAdaptiveModal = MosaicAdaptiveModal;
16939
18238
  exports.MosaicAdaptiveNavigation = MosaicAdaptiveNavigation;
16940
18239
  exports.MosaicAddMemoryForm = MosaicAddMemoryForm;
18240
+ exports.MosaicAdminOnlyGuard = MosaicAdminOnlyGuard;
16941
18241
  exports.MosaicAgentBuilderModal = MosaicAgentBuilderModal;
16942
18242
  exports.MosaicAgentCard = MosaicAgentCard;
16943
18243
  exports.MosaicAgentChat = MosaicAgentChat;
@@ -16965,10 +18265,19 @@ exports.MosaicAnimatedList = MosaicAnimatedList;
16965
18265
  exports.MosaicApiKeyPanel = MosaicApiKeyPanel;
16966
18266
  exports.MosaicAppSidebar = MosaicAppSidebar;
16967
18267
  exports.MosaicApprovalPrompt = MosaicApprovalPrompt;
18268
+ exports.MosaicArtifactCanvasAdapter = MosaicArtifactCanvasAdapter;
18269
+ exports.MosaicArtifactChart = MosaicArtifactChart;
18270
+ exports.MosaicArtifactChecklist = MosaicArtifactChecklist;
18271
+ exports.MosaicArtifactDataTable = MosaicArtifactDataTable;
18272
+ exports.MosaicArtifactDocument = MosaicArtifactDocument;
18273
+ exports.MosaicArtifactLibrary = MosaicArtifactLibrary;
18274
+ exports.MosaicArtifactSaveAsMemoryForm = MosaicArtifactSaveAsMemoryForm;
18275
+ exports.MosaicArtifactVersionHistory = MosaicArtifactVersionHistory;
16968
18276
  exports.MosaicAvatar = MosaicAvatar;
16969
18277
  exports.MosaicBadge = MosaicBadge;
16970
18278
  exports.MosaicBlurredOrb = MosaicBlurredOrb;
16971
18279
  exports.MosaicButton = MosaicButton;
18280
+ exports.MosaicCallout = MosaicCallout;
16972
18281
  exports.MosaicCard = MosaicCard;
16973
18282
  exports.MosaicCardContent = MosaicCardContent;
16974
18283
  exports.MosaicCardDescription = MosaicCardDescription;
@@ -16999,6 +18308,7 @@ exports.MosaicDrawer = MosaicDrawer;
16999
18308
  exports.MosaicDropdownMenu = MosaicDropdownMenu;
17000
18309
  exports.MosaicEditMemoryDialog = MosaicEditMemoryDialog;
17001
18310
  exports.MosaicEditSessionDialog = MosaicEditSessionDialog;
18311
+ exports.MosaicEditableCell = MosaicEditableCell;
17002
18312
  exports.MosaicEmptyState = MosaicEmptyState;
17003
18313
  exports.MosaicFallingPattern = MosaicFallingPattern;
17004
18314
  exports.MosaicFeature3Col = MosaicFeature3Col;
@@ -17025,6 +18335,7 @@ exports.MosaicMarketplaceCard = MosaicMarketplaceCard;
17025
18335
  exports.MosaicMarketplaceList = MosaicMarketplaceList;
17026
18336
  exports.MosaicMarketplaceListDesktop = MarketplaceListDesktop;
17027
18337
  exports.MosaicMarketplaceListMobile = MarketplaceListMobile;
18338
+ exports.MosaicMatchInput = MosaicMatchInput;
17028
18339
  exports.MosaicMemberList = MosaicMemberList;
17029
18340
  exports.MosaicMemoryCard = MosaicMemoryCard;
17030
18341
  exports.MosaicMemoryDashboard = MosaicMemoryDashboard;
@@ -17044,6 +18355,7 @@ exports.MosaicModuleLibrary = MosaicModuleLibrary;
17044
18355
  exports.MosaicMultiOrgIndicator = MosaicMultiOrgIndicator;
17045
18356
  exports.MosaicMultiTenantProvider = MosaicMultiTenantProvider;
17046
18357
  exports.MosaicNavbar = MosaicNavbar;
18358
+ exports.MosaicOrgContextDisplay = MosaicOrgContextDisplay;
17047
18359
  exports.MosaicOrgPanel = MosaicOrgPanel;
17048
18360
  exports.MosaicOrgProfilePage = MosaicOrgProfilePage;
17049
18361
  exports.MosaicOrgRoleBadge = MosaicOrgRoleBadge;
@@ -17118,8 +18430,16 @@ exports.agentEditorVariants = agentEditorVariants;
17118
18430
  exports.agentPreviewVariants = agentPreviewVariants;
17119
18431
  exports.alertDialogContentVariants = alertDialogContentVariants;
17120
18432
  exports.alertDialogOverlayVariants = alertDialogOverlayVariants;
18433
+ exports.artifactSaveAsMemoryFormButtonVariants = artifactSaveAsMemoryFormButtonVariants;
18434
+ exports.artifactSaveAsMemoryFormErrorVariants = artifactSaveAsMemoryFormErrorVariants;
18435
+ exports.artifactSaveAsMemoryFormFieldVariants = artifactSaveAsMemoryFormFieldVariants;
18436
+ exports.artifactSaveAsMemoryFormFooterVariants = artifactSaveAsMemoryFormFooterVariants;
18437
+ exports.artifactSaveAsMemoryFormLearningVariants = artifactSaveAsMemoryFormLearningVariants;
18438
+ exports.artifactSaveAsMemoryFormPreviewVariants = artifactSaveAsMemoryFormPreviewVariants;
18439
+ exports.artifactSaveAsMemoryFormRootVariants = artifactSaveAsMemoryFormRootVariants;
17121
18440
  exports.badgeVariants = badgeVariants;
17122
18441
  exports.buttonVariants = buttonVariants;
18442
+ exports.calloutVariants = calloutVariants;
17123
18443
  exports.chatMessageBubbleVariants = chatMessageBubbleVariants;
17124
18444
  exports.chatMessageContainerVariants = chatMessageContainerVariants;
17125
18445
  exports.chatMessageToolStatusVariants = chatMessageToolStatusVariants;
@@ -17135,7 +18455,9 @@ exports.editSessionDialogButtonVariants = editSessionDialogButtonVariants;
17135
18455
  exports.editSessionDialogErrorVariants = editSessionDialogErrorVariants;
17136
18456
  exports.editSessionDialogFieldVariants = editSessionDialogFieldVariants;
17137
18457
  exports.editSessionDialogFooterVariants = editSessionDialogFooterVariants;
18458
+ exports.editableCellVariants = editableCellVariants;
17138
18459
  exports.marketplaceCardVariants = marketplaceCardVariants;
18460
+ exports.matchStateVariants = matchStateVariants;
17139
18461
  exports.memoryDashboardViewToggleButtonVariants = memoryDashboardViewToggleButtonVariants;
17140
18462
  exports.memoryGridVariants = memoryGridVariants;
17141
18463
  exports.memoryListItemVariants = memoryListItemVariants;
@@ -17144,6 +18466,9 @@ exports.memorySearchFilterChipVariants = memorySearchFilterChipVariants;
17144
18466
  exports.mentionInputFieldVariants = mentionInputFieldVariants;
17145
18467
  exports.mentionListItemVariants = mentionListItemVariants;
17146
18468
  exports.mentionListVariants = mentionListVariants;
18469
+ exports.normalizeArtifact = normalizeArtifact;
18470
+ exports.normalizeFromAiSdkArtifacts = normalizeFromAiSdkArtifacts;
18471
+ exports.normalizeFromMcpToolResult = normalizeFromMcpToolResult;
17147
18472
  exports.pdfViewerFrameVariants = pdfViewerFrameVariants;
17148
18473
  exports.pdfViewerStatusVariants = pdfViewerStatusVariants;
17149
18474
  exports.pdfViewerToolbarButtonVariants = pdfViewerToolbarButtonVariants;