@chaibuilder/sdk 1.2.92 → 1.2.93-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{CodeEditor-orTEdw7a.js → CodeEditor-_pniWL9A.js} +20 -20
  2. package/dist/CodeEditor-hbpcHA6a.cjs +1 -0
  3. package/dist/GlobalBlockSettings-1Ix883dP.cjs +1 -0
  4. package/dist/GlobalBlockSettings-eytCBAHr.js +44 -0
  5. package/dist/Topbar-0dGbwmC_.cjs +1 -0
  6. package/dist/{Topbar-OPlOc1Ha.js → Topbar-AzDg5F6n.js} +12 -12
  7. package/dist/{UnsplashImages-WaGyNL1z.js → UnsplashImages-Gdm78EC5.js} +36 -36
  8. package/dist/UnsplashImages-etSQzJ6J.cjs +1 -0
  9. package/dist/{UploadImages-GiKofaXX.js → UploadImages-2XWy9JHd.js} +10 -10
  10. package/dist/UploadImages-lyC-Th50.cjs +1 -0
  11. package/dist/{context-menu-yLeOsx9j.js → context-menu-9cWJcKdh.js} +463 -427
  12. package/dist/context-menu-sQn7ryJ6.cjs +1 -0
  13. package/dist/core.cjs +1 -1
  14. package/dist/core.js +52 -52
  15. package/dist/iconBase-HBZkvN04.js +330 -0
  16. package/dist/iconBase-kuD_VwQx.cjs +1 -0
  17. package/dist/index-lynOzeB3.cjs +223 -0
  18. package/dist/{index-yJ1H6b2C.js → index-zgy8mVKm.js} +28 -35
  19. package/dist/ui.cjs +1 -1
  20. package/dist/ui.js +112 -113
  21. package/dist/useGlobalBlocksStore-1wJUEOl4.cjs +1 -0
  22. package/dist/useGlobalBlocksStore-HlGhDxuV.js +1258 -0
  23. package/dist/web-blocks.cjs +1 -1
  24. package/dist/web-blocks.js +245 -272
  25. package/package.json +1 -1
  26. package/dist/CodeEditor-awVVPqel.cjs +0 -1
  27. package/dist/Topbar--KOfsR94.cjs +0 -1
  28. package/dist/UnsplashImages-g-8MvB9W.cjs +0 -1
  29. package/dist/UploadImages-Ic_iZgWY.cjs +0 -1
  30. package/dist/button-9Duvj2dH.js +0 -42
  31. package/dist/button-oQgWN0j0.cjs +0 -1
  32. package/dist/context-menu-8MWP_Ikf.cjs +0 -1
  33. package/dist/iconBase-BnEC5_qG.js +0 -1583
  34. package/dist/iconBase-_bgMuxa5.cjs +0 -1
  35. package/dist/index-Hj8wMhx_.cjs +0 -223
@@ -4,10 +4,11 @@ var Fe = (r, n, a) => (ht(r, typeof n != "symbol" ? n + "" : n, a), a);
4
4
  import { j as jsxRuntimeExports } from "./jsx-runtime-Sp0orL4X.js";
5
5
  import * as React from "react";
6
6
  import React__default, { useCallback as useCallback$1, useEffect as useEffect$1, useState as useState$1, Component, Children, Suspense, useMemo as useMemo$1, useRef as useRef$1, memo, createElement as createElement$1, createContext as createContext$1, useContext as useContext$1, useLayoutEffect as useLayoutEffect$1, forwardRef as forwardRef$1, cloneElement, Fragment, useReducer, lazy } from "react";
7
- import { S as Skeleton, C as ContextMenu, a as ContextMenuTrigger, b as ContextMenuContent, c as ContextMenuItem, T as Tooltip$1, d as TooltipTrigger, e as TooltipContent, f as Card, g as CardHeader, h as CardDescription, i as CardContent, L as Label, j as Textarea, k as CardFooter, D as Dialog, l as DialogTrigger, m as DialogContent, n as DialogHeader, o as DialogTitle, p as DialogDescription, q as DialogFooter, P as Popover$1, r as PopoverTrigger, s as PopoverContent, t as Command, u as CommandInput, v as CommandList, w as CommandEmpty, x as CommandGroup, y as CommandItem, z as Tabs$1, A as TabsList$1, B as TabsTrigger, E as TabsContent, F as Switch, G as Accordion, H as AccordionItem, I as AccordionTrigger, J as AccordionContent, K as useToast, M as Input$2, N as TooltipPortal, O as DropdownMenu, Q as DropdownMenuTrigger, R as DropdownMenuContent, U as ScrollArea$1, V as DropdownMenuLabel, W as DropdownMenuSeparator, X as DropdownMenuGroup, Y as DropdownMenuItem, Z as DropdownMenuShortcut, _ as AlertDialog, $ as AlertDialogContent, a0 as AlertDialogHeader, a1 as AlertDialogTitle, a2 as AlertDialogTrigger, a3 as AlertDialogDescription, a4 as AlertDialogFooter, a5 as AlertDialogCancel, a6 as AlertDialogAction, a7 as DropdownMenuCheckboxItem, a8 as HoverCard, a9 as HoverCardTrigger, aa as HoverCardContent, ab as Separator, ac as Badge$1, ad as Select$1, ae as SelectTrigger, af as SelectValue, ag as SelectContent, ah as SelectItem, ai as TooltipProvider, aj as Toaster } from "./context-menu-yLeOsx9j.js";
7
+ import { S as Skeleton, B as Button$1, C as ContextMenu, a as ContextMenuTrigger, b as ContextMenuContent, c as ContextMenuItem, T as Tooltip$1, d as TooltipTrigger, e as TooltipContent, f as Card, g as CardHeader, h as CardDescription, i as CardContent, L as Label, j as Textarea, k as CardFooter, D as Dialog, l as DialogTrigger, m as DialogContent, n as DialogHeader, o as DialogTitle, p as DialogDescription, q as DialogFooter, P as Popover$1, r as PopoverTrigger, s as PopoverContent, t as Command, u as CommandInput, v as CommandList, w as CommandEmpty, x as CommandGroup, y as CommandItem, z as Tabs$1, A as TabsList$1, E as TabsTrigger, F as TabsContent, G as Switch, H as Accordion, I as AccordionItem, J as AccordionTrigger, K as AccordionContent, M as useToast, N as Input$2, O as TooltipPortal, Q as DropdownMenu, R as DropdownMenuTrigger, U as DropdownMenuContent, V as ScrollArea$1, W as DropdownMenuLabel, X as DropdownMenuSeparator, Y as DropdownMenuGroup, Z as DropdownMenuItem, _ as DropdownMenuShortcut, $ as AlertDialog, a0 as AlertDialogContent, a1 as AlertDialogHeader, a2 as AlertDialogTitle, a3 as AlertDialogTrigger, a4 as AlertDialogDescription, a5 as AlertDialogFooter, a6 as AlertDialogCancel, a7 as AlertDialogAction, a8 as DropdownMenuCheckboxItem, a9 as HoverCard, aa as HoverCardTrigger, ab as HoverCardContent, ac as Separator, ad as Badge$1, ae as Select$1, af as SelectTrigger, ag as SelectValue, ah as SelectContent, ai as SelectItem, aj as TooltipProvider, ak as Toaster } from "./context-menu-9cWJcKdh.js";
8
8
  import { has, includes, set, get as get$1, isEmpty, map, forIn, filter, first, find, startsWith, range, values, flattenDeep, flatten, isNull, each, pick, sortBy, isString as isString$1, without, throttle, omit, memoize as memoize$1, reverse, noop as noop$1, debounce as debounce$1, flatMapDeep, forEach, capitalize, last, startCase, truncate, isArray as isArray$5, split, toLower, keys, cloneDeep, reject, nth, isNumber as isNumber$1, parseInt as parseInt$1, isNaN as isNaN$1, findLast, intersection, groupBy, isFunction as isFunction$1, uniq, toUpper, round, compact } from "lodash-es";
9
9
  import { atom, useAtom, useSetAtom, useAtomValue, getDefaultStore } from "jotai";
10
- import { g as generateUUID, u as useBlocksStore, a as useSelectedBlockIds, b as useBlocksStoreUndoableActions, M as MODIFIERS, p as pageBlocksAtomsAtom, s as styleBreakpointAtom, c as atomWithStorage, d as getBreakpointValue$1, e as getDuplicatedBlocks, f as presentBlocksAtom, h as selectedBlockAtom, i as styleStateAtom, j as useUndoManager, k as useAtom$1, l as useGlobalBlocksStore, m as useBuilderProp, n as useUpdateBlocksProps, o as useRemoveBlocks, q as useBrandingOptions, r as chaiExternalDataAtom, t as usePageDataProviders, v as useSelectedBlock, w as useSelectedBlockHierarchy, x as useBlocksContainer, y as f, z as y, A as h, B as cn, G as GenIcon, C as treeDSBlocks, D as useUpdateBlocksPropsRealtime, E as useStreamMultipleBlocksProps, F as useUpdateMultipleBlocksProps, H as useSelectedBlocksDisplayChild, I as useStore, J as atom$1, K as atomWithDefault, L as useAtomValue$1, N as useSetAtom$1, O as createStore, P as builderSaveStateAtom, Q as useWatchGlobalBlocks, R as chaiBuilderPropsAtom, S as dataProvidersAtom, T as useSavePage } from "./iconBase-BnEC5_qG.js";
10
+ import { g as generateUUID, a as getBreakpointValue$1, f, y, h, c as cn, G as GenIcon } from "./iconBase-HBZkvN04.js";
11
+ import { u as useBlocksStore, a as useSelectedBlockIds, b as useBlocksStoreUndoableActions, M as MODIFIERS, p as pageBlocksAtomsAtom, s as styleBreakpointAtom, c as atomWithStorage, g as getDuplicatedBlocks, d as presentBlocksAtom, e as selectedBlockAtom, f as styleStateAtom, h as useUndoManager, i as useAtom$1, j as useGlobalBlocksStore, k as useBuilderProp, l as useUpdateBlocksProps, m as useRemoveBlocks, n as useBrandingOptions, o as chaiExternalDataAtom, q as usePageDataProviders, r as useSelectedBlock, t as useSelectedBlockHierarchy, v as useBlocksContainer, w as treeDSBlocks, x as useUpdateBlocksPropsRealtime, y as useStreamMultipleBlocksProps, z as useUpdateMultipleBlocksProps, A as useSelectedBlocksDisplayChild, B as useStore, C as atom$1, D as atomWithDefault, E as useAtomValue$1, F as useSetAtom$1, G as createStore, H as builderSaveStateAtom, I as useWatchGlobalBlocks, J as chaiBuilderPropsAtom, K as dataProvidersAtom, L as useSavePage } from "./useGlobalBlocksStore-HlGhDxuV.js";
11
12
  import { useTranslation, initReactI18next } from "react-i18next";
12
13
  import ReactQuill, { Quill } from "react-quill";
13
14
  import { getBlockComponent, getChaiDataProviders, useGlobalStylingPresets, useChaiBlocks, syncBlocksWithDefaults } from "@chaibuilder/runtime";
@@ -30,7 +31,6 @@ import ReactDOM, { flushSync, createPortal } from "react-dom";
30
31
  import PropTypes from "prop-types";
31
32
  import { ErrorBoundary as ErrorBoundary$1 } from "react-error-boundary";
32
33
  import { Resizable } from "re-resizable";
33
- import { B as Button$1 } from "./button-9Duvj2dH.js";
34
34
  import { DatabaseIcon, ChevronRight, PlusIcon as PlusIcon$1, EyeOff, EditIcon, TrashIcon as TrashIcon$1, Check, Loader as Loader$1, SparklesIcon, SmileIcon, ShuffleIcon, ChevronDown, Edit2, X, LayoutTemplate, Layers, PaintBucketIcon } from "lucide-react";
35
35
  import validator from "@rjsf/validator-ajv8";
36
36
  import Form from "@rjsf/core";
@@ -2171,11 +2171,6 @@ const useHandleCanvasDblClick = () => {
2171
2171
  }
2172
2172
  }
2173
2173
  return l[o];
2174
- }, getSlots = (r) => {
2175
- const n = {};
2176
- return Object.keys(r).forEach((a) => {
2177
- isString$1(r[a]) && r[a].startsWith(SLOT_KEY) && (n[a] = r[a].replace(SLOT_KEY, "").split(","));
2178
- }), n;
2179
2174
  }, generateClassNames = memoize$1((r) => {
2180
2175
  const n = r.replace(STYLES_KEY, "").split(",");
2181
2176
  return twMerge(n[0], n[1]);
@@ -2212,34 +2207,32 @@ function isDescendant(r, n, a) {
2212
2207
  const i = filter(a, { _parent: r });
2213
2208
  return i.some((l) => l._id === n) ? !0 : i.some((l) => isDescendant(l._id, n, a));
2214
2209
  }
2215
- function BlocksRendererStatic({ blocks: r }) {
2216
- const [n] = useBlocksStore(), [a] = useAtom(xShowBlocksAtom), [o] = useCutBlockIds(), [i] = useAtom(draggedBlockAtom), [l] = useAtom(dropTargetBlockIdAtom), [, c] = useCanvasWidth(), [u] = useCanvasSettings(), [d] = useHiddenBlockIds(), { getGlobalBlocks: g } = useGlobalBlocksStore(), p = useCallback$1((S) => getStyleAttrs(S, c), [c]), [m] = useChaiExternalData(), [b] = useAtom(inlineEditingActiveAtom), v = useCallback$1(
2210
+ const RenderGlobalBlock = ({ blocks: r, allBlocks: n }) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { allBlocks: n, blocks: r });
2211
+ function BlocksRendererStatic({ blocks: r, allBlocks: n }) {
2212
+ const [a] = useAtom(xShowBlocksAtom), [o] = useCutBlockIds(), [i] = useAtom(draggedBlockAtom), [l] = useAtom(dropTargetBlockIdAtom), [, c] = useCanvasWidth(), [u] = useCanvasSettings(), [d] = useHiddenBlockIds(), { getGlobalBlocks: g } = useGlobalBlocksStore(), p = useCallback$1((S) => getStyleAttrs(S, c), [c]), [m] = useChaiExternalData(), [b] = useAtom(inlineEditingActiveAtom), v = useCallback$1(
2217
2213
  (S) => S.reduce((x, E) => {
2218
2214
  const w = get$1(u, E, {});
2219
2215
  return { ...x, ...w };
2220
2216
  }, {}),
2221
- [u, n]
2217
+ [u]
2222
2218
  );
2223
2219
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: React__default.Children.toArray(
2224
2220
  r.map((S, x) => {
2225
2221
  if (b === S._id || d.includes(S._id))
2226
2222
  return null;
2227
- const E = getSlots(S), w = {};
2228
- isEmpty(E) || Object.keys(E).forEach((T) => {
2229
- w[T] = React__default.Children.toArray(
2230
- E[T].map((M) => /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { blocks: [find(n, { _id: M })] }))
2231
- );
2232
- });
2233
- const A = S._type === "GlobalBlock" ? g(S) : filter(n, { _parent: S._id });
2234
- w.children = A.length ? /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { blocks: A }) : null;
2235
- const R = getBlockComponent(S._type), P = get$1(R, "builderComponent", get$1(R, "component", null));
2236
- if (isNull(P))
2223
+ const E = {}, w = filter(n, { _parent: S._id });
2224
+ if (E.children = w.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { allBlocks: n, blocks: w }) : null, S._type === "GlobalBlock") {
2225
+ const I = g(S);
2226
+ E.children = /* @__PURE__ */ jsxRuntimeExports.jsx(RenderGlobalBlock, { blocks: filter(I, (T) => !T._parent), allBlocks: I });
2227
+ }
2228
+ const A = getBlockComponent(S._type), R = get$1(A, "builderComponent", get$1(A, "component", null));
2229
+ if (isNull(R))
2237
2230
  return /* @__PURE__ */ jsxRuntimeExports.jsx("noscript", { children: `<!-- ${S == null ? void 0 : S._type} not registered -->` });
2238
- const C = has(R, "getBlockStateFrom") ? R == null ? void 0 : R.getBlockStateFrom(S, n) : [], j = v(C), k = p(S);
2239
- if (get$1(k, "__isHidden", !1) && !includes(a, S._id))
2231
+ const P = has(A, "getBlockStateFrom") ? A == null ? void 0 : A.getBlockStateFrom(S, n) : [], C = v(P), j = p(S);
2232
+ if (get$1(j, "__isHidden", !1) && !includes(a, S._id))
2240
2233
  return null;
2241
- const I = i && isDescendant(i._id, S._id, n);
2242
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(P, {
2234
+ const k = i && isDescendant(i._id, S._id, n);
2235
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(R, {
2243
2236
  blockProps: {
2244
2237
  ...includes(a, S._id) ? { "force-show": "" } : {},
2245
2238
  "data-block-id": S._id,
@@ -2248,18 +2241,18 @@ function BlocksRendererStatic({ blocks: r }) {
2248
2241
  // @ts-ignore
2249
2242
  {
2250
2243
  "data-dnd": canAcceptChildBlock(S._type, i == null ? void 0 : i._type) ? "yes" : "no",
2251
- "data-dnd-dragged": i._id === S._id || I ? "yes" : "no"
2244
+ "data-dnd-dragged": i._id === S._id || k ? "yes" : "no"
2252
2245
  }
2253
2246
  ) : {},
2254
- ...l === S._id && !I ? { "data-drop": "yes" } : {},
2247
+ ...l === S._id && !k ? { "data-drop": "yes" } : {},
2255
2248
  ...includes(o, S._id) ? { "data-cut-block": "yes" } : {}
2256
2249
  },
2257
2250
  index: x,
2258
2251
  ...applyBindings(S, m),
2259
- ...omit(k, ["__isHidden"]),
2260
- ...w,
2252
+ ...omit(j, ["__isHidden"]),
2253
+ ...E,
2261
2254
  inBuilder: !0,
2262
- blockState: j
2255
+ blockState: C
2263
2256
  }) });
2264
2257
  })
2265
2258
  ) });
@@ -2280,7 +2273,7 @@ const useAllDataProviders = () => useMemo$1(() => getChaiDataProviders(), []), B
2280
2273
  });
2281
2274
  }), [o, a, n]), /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: r });
2282
2275
  }, StaticBlocksRenderer = () => {
2283
- const [r] = useBlocksStore(), n = isEmpty(r) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksExternalDataProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { blocks: filter(r, (a) => isEmpty(a._parent)) }) });
2276
+ const [r] = useBlocksStore(), n = isEmpty(r) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksExternalDataProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(BlocksRendererStatic, { allBlocks: r, blocks: filter(r, (a) => isEmpty(a._parent)) }) });
2284
2277
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: n });
2285
2278
  }, AddBlockAtBottom = () => {
2286
2279
  const { t: r } = useTranslation();
@@ -2483,7 +2476,7 @@ const useAllDataProviders = () => useMemo$1(() => getChaiDataProviders(), []), B
2483
2476
  i !== r.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { size: 16 })
2484
2477
  ] }, i))
2485
2478
  ] }) });
2486
- }, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-orTEdw7a.js")), CanvasArea = () => {
2479
+ }, CodeEditor$1 = React__default.lazy(() => import("./CodeEditor-_pniWL9A.js")), CanvasArea = () => {
2487
2480
  const [r] = useCodeEditor(), n = useBuilderProp("onError", noop$1);
2488
2481
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full max-h-full w-full flex-1 flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex h-full max-h-full flex-col overflow-hidden bg-gray-100/40 px-2", children: [
2489
2482
  /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "h-full" }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary$1, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(FallbackError, {}), onError: n, children: /* @__PURE__ */ jsxRuntimeExports.jsx(StaticCanvas$1, {}) }) }),
@@ -3868,7 +3861,7 @@ const ViewData = ({ data: r, fullView: n }) => {
3868
3861
  }
3869
3862
  )
3870
3863
  ] });
3871
- }, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-WaGyNL1z.js")), UploadImages = React__default.lazy(() => import("./UploadImages-GiKofaXX.js")), ImagesPanel = ({
3864
+ }, UnsplashImages = React__default.lazy(() => import("./UnsplashImages-Gdm78EC5.js")), UploadImages = React__default.lazy(() => import("./UploadImages-2XWy9JHd.js")), ImagesPanel = ({
3872
3865
  isModalView: r = !1,
3873
3866
  onSelect: n = () => {
3874
3867
  }
@@ -4174,7 +4167,7 @@ function BlockSettings() {
4174
4167
  properties: b
4175
4168
  }
4176
4169
  ),
4177
- v ? React__default.createElement(v) : null,
4170
+ v ? /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { children: React__default.createElement(v) }) : null,
4178
4171
  /* @__PURE__ */ jsxRuntimeExports.jsx(CanvasSettings, {})
4179
4172
  ] });
4180
4173
  }
@@ -33084,7 +33077,7 @@ const PageDataProviders = () => {
33084
33077
  function AiFillDatabase(r) {
33085
33078
  return GenIcon({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M832 64H192c-17.7 0-32 14.3-32 32v224h704V96c0-17.7-14.3-32-32-32zM288 232c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zM160 928c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V704H160v224zm128-136c22.1 0 40 17.9 40 40s-17.9 40-40 40-40-17.9-40-40 17.9-40 40-40zM160 640h704V384H160v256zm128-168c22.1 0 40 17.9 40 40s-17.9 40-40 40-40-17.9-40-40 17.9-40 40-40z" }, child: [] }] })(r);
33086
33079
  }
33087
- const TopBar = lazy(() => import("./Topbar-OPlOc1Ha.js"));
33080
+ const TopBar = lazy(() => import("./Topbar-AzDg5F6n.js"));
33088
33081
  function useSidebarMenuItems(r) {
33089
33082
  const n = r === "SINGLE_SIDE_PANEL", { t: a } = useTranslation(), o = useBuilderProp("dataBindingSupport", !1), i = useBuilderProp("askAiCallBack", null);
33090
33083
  return useMemo$1(() => {
package/dist/ui.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-JYMCiFoE.cjs"),V=require("react"),z=require("@radix-ui/react-toggle"),p=require("class-variance-authority"),s=require("./button-oQgWN0j0.cjs"),e=require("./context-menu-8MWP_Ikf.cjs"),c=require("@radix-ui/react-icons"),F=require("@radix-ui/react-menubar"),_=require("@radix-ui/react-dialog");require("@radix-ui/react-slot");require("clsx");require("tailwind-merge");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");function m(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(o,r,i.get?i:{enumerable:!0,get:()=>t[r]})}}return o.default=t,Object.freeze(o)}const d=m(V),x=m(z),n=m(F),l=m(_),g=p.cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),b=d.forwardRef(({className:t,variant:o,size:r,...i},u)=>a.jsxRuntimeExports.jsx(x.Root,{ref:u,className:s.cn(g({variant:o,size:r,className:t})),...i}));b.displayName=x.Root.displayName;const O=p.cva("relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),f=d.forwardRef(({className:t,variant:o,...r},i)=>a.jsxRuntimeExports.jsx("div",{ref:i,role:"alert",className:s.cn(O({variant:o}),t),...r}));f.displayName="Alert";const C=d.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx("h5",{ref:r,className:s.cn("mb-1 font-medium leading-none tracking-tight",t),...o}));C.displayName="AlertTitle";const M=d.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx("div",{ref:r,className:s.cn("text-sm [&_p]:leading-relaxed",t),...o}));M.displayName="AlertDescription";const B=n.Menu,J=n.Group,K=n.Portal,Q=n.Sub,U=n.RadioGroup,h=d.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(n.Root,{ref:r,className:s.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",t),...o}));h.displayName=n.Root.displayName;const S=d.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(n.Trigger,{ref:r,className:s.cn("flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t),...o}));S.displayName=n.Trigger.displayName;const j=d.forwardRef(({className:t,inset:o,children:r,...i},u)=>a.jsxRuntimeExports.jsxs(n.SubTrigger,{ref:u,className:s.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",o&&"pl-8",t),...i,children:[r,a.jsxRuntimeExports.jsx(c.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));j.displayName=n.SubTrigger.displayName;const D=d.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(n.SubContent,{ref:r,className:s.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...o}));D.displayName=n.SubContent.displayName;const v=d.forwardRef(({className:t,align:o="start",alignOffset:r=-4,sideOffset:i=8,...u},H)=>a.jsxRuntimeExports.jsx(n.Portal,{children:a.jsxRuntimeExports.jsx(n.Content,{ref:H,align:o,alignOffset:r,sideOffset:i,className:s.cn("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...u})}));v.displayName=n.Content.displayName;const T=d.forwardRef(({className:t,inset:o,...r},i)=>a.jsxRuntimeExports.jsx(n.Item,{ref:i,className:s.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o&&"pl-8",t),...r}));T.displayName=n.Item.displayName;const R=d.forwardRef(({className:t,children:o,checked:r,...i},u)=>a.jsxRuntimeExports.jsxs(n.CheckboxItem,{ref:u,className:s.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...i,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(n.ItemIndicator,{children:a.jsxRuntimeExports.jsx(c.CheckIcon,{className:"h-4 w-4"})})}),o]}));R.displayName=n.CheckboxItem.displayName;const y=d.forwardRef(({className:t,children:o,...r},i)=>a.jsxRuntimeExports.jsxs(n.RadioItem,{ref:i,className:s.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(n.ItemIndicator,{children:a.jsxRuntimeExports.jsx(c.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),o]}));y.displayName=n.RadioItem.displayName;const w=d.forwardRef(({className:t,inset:o,...r},i)=>a.jsxRuntimeExports.jsx(n.Label,{ref:i,className:s.cn("px-2 py-1.5 text-sm font-semibold",o&&"pl-8",t),...r}));w.displayName=n.Label.displayName;const N=d.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(n.Separator,{ref:r,className:s.cn("-mx-1 my-1 h-px bg-muted",t),...o}));N.displayName=n.Separator.displayName;const I=({className:t,...o})=>a.jsxRuntimeExports.jsx("span",{className:s.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...o});I.displayname="MenubarShortcut";const W=l.Root,X=l.Trigger,Y=l.Close,A=({className:t,...o})=>a.jsxRuntimeExports.jsx(l.Portal,{className:s.cn(t),...o});A.displayName=l.Portal.displayName;const E=d.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(l.Overlay,{className:s.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...o,ref:r}));E.displayName=l.Overlay.displayName;const Z=p.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),P=d.forwardRef(({side:t="right",className:o,children:r,...i},u)=>a.jsxRuntimeExports.jsxs(A,{children:[a.jsxRuntimeExports.jsx(E,{}),a.jsxRuntimeExports.jsxs(l.Content,{ref:u,className:s.cn(Z({side:t}),o),...i,children:[r,a.jsxRuntimeExports.jsxs(l.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[a.jsxRuntimeExports.jsx(c.Cross2Icon,{className:"h-4 w-4"}),a.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));P.displayName=l.Content.displayName;const q=({className:t,...o})=>a.jsxRuntimeExports.jsx("div",{className:s.cn("flex flex-col space-y-2 text-center sm:text-left",t),...o});q.displayName="SheetHeader";const k=({className:t,...o})=>a.jsxRuntimeExports.jsx("div",{className:s.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...o});k.displayName="SheetFooter";const G=d.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(l.Title,{ref:r,className:s.cn("text-lg font-semibold text-foreground",t),...o}));G.displayName=l.Title.displayName;const L=d.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(l.Description,{ref:r,className:s.cn("text-sm text-muted-foreground",t),...o}));L.displayName=l.Description.displayName;exports.Button=s.Button;exports.buttonVariants=s.buttonVariants;exports.Accordion=e.Accordion;exports.AccordionContent=e.AccordionContent;exports.AccordionItem=e.AccordionItem;exports.AccordionTrigger=e.AccordionTrigger;exports.AlertDialog=e.AlertDialog;exports.AlertDialogAction=e.AlertDialogAction;exports.AlertDialogCancel=e.AlertDialogCancel;exports.AlertDialogContent=e.AlertDialogContent;exports.AlertDialogDescription=e.AlertDialogDescription;exports.AlertDialogFooter=e.AlertDialogFooter;exports.AlertDialogHeader=e.AlertDialogHeader;exports.AlertDialogTitle=e.AlertDialogTitle;exports.AlertDialogTrigger=e.AlertDialogTrigger;exports.Badge=e.Badge;exports.Card=e.Card;exports.CardContent=e.CardContent;exports.CardDescription=e.CardDescription;exports.CardFooter=e.CardFooter;exports.CardHeader=e.CardHeader;exports.CardTitle=e.CardTitle;exports.Command=e.Command;exports.CommandDialog=e.CommandDialog;exports.CommandEmpty=e.CommandEmpty;exports.CommandGroup=e.CommandGroup;exports.CommandInput=e.CommandInput;exports.CommandItem=e.CommandItem;exports.CommandList=e.CommandList;exports.CommandSeparator=e.CommandSeparator;exports.CommandShortcut=e.CommandShortcut;exports.ContextMenu=e.ContextMenu;exports.ContextMenuCheckboxItem=e.ContextMenuCheckboxItem;exports.ContextMenuContent=e.ContextMenuContent;exports.ContextMenuGroup=e.ContextMenuGroup;exports.ContextMenuItem=e.ContextMenuItem;exports.ContextMenuLabel=e.ContextMenuLabel;exports.ContextMenuPortal=e.ContextMenuPortal;exports.ContextMenuRadioGroup=e.ContextMenuRadioGroup;exports.ContextMenuRadioItem=e.ContextMenuRadioItem;exports.ContextMenuSeparator=e.ContextMenuSeparator;exports.ContextMenuShortcut=e.ContextMenuShortcut;exports.ContextMenuSub=e.ContextMenuSub;exports.ContextMenuSubContent=e.ContextMenuSubContent;exports.ContextMenuSubTrigger=e.ContextMenuSubTrigger;exports.ContextMenuTrigger=e.ContextMenuTrigger;exports.Dialog=e.Dialog;exports.DialogContent=e.DialogContent;exports.DialogDescription=e.DialogDescription;exports.DialogFooter=e.DialogFooter;exports.DialogHeader=e.DialogHeader;exports.DialogTitle=e.DialogTitle;exports.DialogTrigger=e.DialogTrigger;exports.DropdownMenu=e.DropdownMenu;exports.DropdownMenuCheckboxItem=e.DropdownMenuCheckboxItem;exports.DropdownMenuContent=e.DropdownMenuContent;exports.DropdownMenuGroup=e.DropdownMenuGroup;exports.DropdownMenuItem=e.DropdownMenuItem;exports.DropdownMenuLabel=e.DropdownMenuLabel;exports.DropdownMenuPortal=e.DropdownMenuPortal;exports.DropdownMenuRadioGroup=e.DropdownMenuRadioGroup;exports.DropdownMenuRadioItem=e.DropdownMenuRadioItem;exports.DropdownMenuSeparator=e.DropdownMenuSeparator;exports.DropdownMenuShortcut=e.DropdownMenuShortcut;exports.DropdownMenuSub=e.DropdownMenuSub;exports.DropdownMenuSubContent=e.DropdownMenuSubContent;exports.DropdownMenuSubTrigger=e.DropdownMenuSubTrigger;exports.DropdownMenuTrigger=e.DropdownMenuTrigger;exports.HoverCard=e.HoverCard;exports.HoverCardContent=e.HoverCardContent;exports.HoverCardTrigger=e.HoverCardTrigger;exports.Input=e.Input;exports.Label=e.Label;exports.Popover=e.Popover;exports.PopoverContent=e.PopoverContent;exports.PopoverTrigger=e.PopoverTrigger;exports.ScrollArea=e.ScrollArea;exports.ScrollBar=e.ScrollBar;exports.Select=e.Select;exports.SelectContent=e.SelectContent;exports.SelectGroup=e.SelectGroup;exports.SelectItem=e.SelectItem;exports.SelectLabel=e.SelectLabel;exports.SelectSeparator=e.SelectSeparator;exports.SelectTrigger=e.SelectTrigger;exports.SelectValue=e.SelectValue;exports.Separator=e.Separator;exports.Skeleton=e.Skeleton;exports.Switch=e.Switch;exports.Tabs=e.Tabs;exports.TabsContent=e.TabsContent;exports.TabsList=e.TabsList;exports.TabsTrigger=e.TabsTrigger;exports.Textarea=e.Textarea;exports.Toaster=e.Toaster;exports.Tooltip=e.Tooltip;exports.TooltipContent=e.TooltipContent;exports.TooltipPortal=e.TooltipPortal;exports.TooltipProvider=e.TooltipProvider;exports.TooltipTrigger=e.TooltipTrigger;exports.badgeVariants=e.badgeVariants;exports.reducer=e.reducer;exports.toast=e.toast;exports.useToast=e.useToast;exports.Alert=f;exports.AlertDescription=M;exports.AlertTitle=C;exports.Menubar=h;exports.MenubarCheckboxItem=R;exports.MenubarContent=v;exports.MenubarGroup=J;exports.MenubarItem=T;exports.MenubarLabel=w;exports.MenubarMenu=B;exports.MenubarPortal=K;exports.MenubarRadioGroup=U;exports.MenubarRadioItem=y;exports.MenubarSeparator=N;exports.MenubarShortcut=I;exports.MenubarSub=Q;exports.MenubarSubContent=D;exports.MenubarSubTrigger=j;exports.MenubarTrigger=S;exports.Sheet=W;exports.SheetClose=Y;exports.SheetContent=P;exports.SheetDescription=L;exports.SheetFooter=k;exports.SheetHeader=q;exports.SheetTitle=G;exports.SheetTrigger=X;exports.Toggle=b;exports.toggleVariants=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-JYMCiFoE.cjs"),H=require("react"),V=require("@radix-ui/react-toggle"),m=require("class-variance-authority"),e=require("./context-menu-sQn7ryJ6.cjs"),u=require("@radix-ui/react-icons"),z=require("@radix-ui/react-menubar"),F=require("@radix-ui/react-dialog");require("@radix-ui/react-switch");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-slot");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("clsx");require("tailwind-merge");function c(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(o,r,s.get?s:{enumerable:!0,get:()=>t[r]})}}return o.default=t,Object.freeze(o)}const i=c(H),p=c(V),n=c(z),d=c(F),x=m.cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),g=i.forwardRef(({className:t,variant:o,size:r,...s},l)=>a.jsxRuntimeExports.jsx(p.Root,{ref:l,className:e.cn(x({variant:o,size:r,className:t})),...s}));g.displayName=p.Root.displayName;const _=m.cva("relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),b=i.forwardRef(({className:t,variant:o,...r},s)=>a.jsxRuntimeExports.jsx("div",{ref:s,role:"alert",className:e.cn(_({variant:o}),t),...r}));b.displayName="Alert";const f=i.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx("h5",{ref:r,className:e.cn("mb-1 font-medium leading-none tracking-tight",t),...o}));f.displayName="AlertTitle";const C=i.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx("div",{ref:r,className:e.cn("text-sm [&_p]:leading-relaxed",t),...o}));C.displayName="AlertDescription";const O=n.Menu,B=n.Group,J=n.Portal,K=n.Sub,Q=n.RadioGroup,M=i.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(n.Root,{ref:r,className:e.cn("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",t),...o}));M.displayName=n.Root.displayName;const h=i.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(n.Trigger,{ref:r,className:e.cn("flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t),...o}));h.displayName=n.Trigger.displayName;const S=i.forwardRef(({className:t,inset:o,children:r,...s},l)=>a.jsxRuntimeExports.jsxs(n.SubTrigger,{ref:l,className:e.cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",o&&"pl-8",t),...s,children:[r,a.jsxRuntimeExports.jsx(u.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));S.displayName=n.SubTrigger.displayName;const j=i.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(n.SubContent,{ref:r,className:e.cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...o}));j.displayName=n.SubContent.displayName;const D=i.forwardRef(({className:t,align:o="start",alignOffset:r=-4,sideOffset:s=8,...l},L)=>a.jsxRuntimeExports.jsx(n.Portal,{children:a.jsxRuntimeExports.jsx(n.Content,{ref:L,align:o,alignOffset:r,sideOffset:s,className:e.cn("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...l})}));D.displayName=n.Content.displayName;const v=i.forwardRef(({className:t,inset:o,...r},s)=>a.jsxRuntimeExports.jsx(n.Item,{ref:s,className:e.cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o&&"pl-8",t),...r}));v.displayName=n.Item.displayName;const T=i.forwardRef(({className:t,children:o,checked:r,...s},l)=>a.jsxRuntimeExports.jsxs(n.CheckboxItem,{ref:l,className:e.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...s,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(n.ItemIndicator,{children:a.jsxRuntimeExports.jsx(u.CheckIcon,{className:"h-4 w-4"})})}),o]}));T.displayName=n.CheckboxItem.displayName;const R=i.forwardRef(({className:t,children:o,...r},s)=>a.jsxRuntimeExports.jsxs(n.RadioItem,{ref:s,className:e.cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[a.jsxRuntimeExports.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsxRuntimeExports.jsx(n.ItemIndicator,{children:a.jsxRuntimeExports.jsx(u.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),o]}));R.displayName=n.RadioItem.displayName;const y=i.forwardRef(({className:t,inset:o,...r},s)=>a.jsxRuntimeExports.jsx(n.Label,{ref:s,className:e.cn("px-2 py-1.5 text-sm font-semibold",o&&"pl-8",t),...r}));y.displayName=n.Label.displayName;const w=i.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(n.Separator,{ref:r,className:e.cn("-mx-1 my-1 h-px bg-muted",t),...o}));w.displayName=n.Separator.displayName;const N=({className:t,...o})=>a.jsxRuntimeExports.jsx("span",{className:e.cn("ml-auto text-xs tracking-widest text-muted-foreground",t),...o});N.displayname="MenubarShortcut";const U=d.Root,W=d.Trigger,X=d.Close,I=({className:t,...o})=>a.jsxRuntimeExports.jsx(d.Portal,{className:e.cn(t),...o});I.displayName=d.Portal.displayName;const A=i.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(d.Overlay,{className:e.cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...o,ref:r}));A.displayName=d.Overlay.displayName;const Y=m.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),E=i.forwardRef(({side:t="right",className:o,children:r,...s},l)=>a.jsxRuntimeExports.jsxs(I,{children:[a.jsxRuntimeExports.jsx(A,{}),a.jsxRuntimeExports.jsxs(d.Content,{ref:l,className:e.cn(Y({side:t}),o),...s,children:[r,a.jsxRuntimeExports.jsxs(d.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[a.jsxRuntimeExports.jsx(u.Cross2Icon,{className:"h-4 w-4"}),a.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));E.displayName=d.Content.displayName;const P=({className:t,...o})=>a.jsxRuntimeExports.jsx("div",{className:e.cn("flex flex-col space-y-2 text-center sm:text-left",t),...o});P.displayName="SheetHeader";const q=({className:t,...o})=>a.jsxRuntimeExports.jsx("div",{className:e.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...o});q.displayName="SheetFooter";const k=i.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(d.Title,{ref:r,className:e.cn("text-lg font-semibold text-foreground",t),...o}));k.displayName=d.Title.displayName;const G=i.forwardRef(({className:t,...o},r)=>a.jsxRuntimeExports.jsx(d.Description,{ref:r,className:e.cn("text-sm text-muted-foreground",t),...o}));G.displayName=d.Description.displayName;exports.Accordion=e.Accordion;exports.AccordionContent=e.AccordionContent;exports.AccordionItem=e.AccordionItem;exports.AccordionTrigger=e.AccordionTrigger;exports.AlertDialog=e.AlertDialog;exports.AlertDialogAction=e.AlertDialogAction;exports.AlertDialogCancel=e.AlertDialogCancel;exports.AlertDialogContent=e.AlertDialogContent;exports.AlertDialogDescription=e.AlertDialogDescription;exports.AlertDialogFooter=e.AlertDialogFooter;exports.AlertDialogHeader=e.AlertDialogHeader;exports.AlertDialogTitle=e.AlertDialogTitle;exports.AlertDialogTrigger=e.AlertDialogTrigger;exports.Badge=e.Badge;exports.Button=e.Button;exports.Card=e.Card;exports.CardContent=e.CardContent;exports.CardDescription=e.CardDescription;exports.CardFooter=e.CardFooter;exports.CardHeader=e.CardHeader;exports.CardTitle=e.CardTitle;exports.Command=e.Command;exports.CommandDialog=e.CommandDialog;exports.CommandEmpty=e.CommandEmpty;exports.CommandGroup=e.CommandGroup;exports.CommandInput=e.CommandInput;exports.CommandItem=e.CommandItem;exports.CommandList=e.CommandList;exports.CommandSeparator=e.CommandSeparator;exports.CommandShortcut=e.CommandShortcut;exports.ContextMenu=e.ContextMenu;exports.ContextMenuCheckboxItem=e.ContextMenuCheckboxItem;exports.ContextMenuContent=e.ContextMenuContent;exports.ContextMenuGroup=e.ContextMenuGroup;exports.ContextMenuItem=e.ContextMenuItem;exports.ContextMenuLabel=e.ContextMenuLabel;exports.ContextMenuPortal=e.ContextMenuPortal;exports.ContextMenuRadioGroup=e.ContextMenuRadioGroup;exports.ContextMenuRadioItem=e.ContextMenuRadioItem;exports.ContextMenuSeparator=e.ContextMenuSeparator;exports.ContextMenuShortcut=e.ContextMenuShortcut;exports.ContextMenuSub=e.ContextMenuSub;exports.ContextMenuSubContent=e.ContextMenuSubContent;exports.ContextMenuSubTrigger=e.ContextMenuSubTrigger;exports.ContextMenuTrigger=e.ContextMenuTrigger;exports.Dialog=e.Dialog;exports.DialogContent=e.DialogContent;exports.DialogDescription=e.DialogDescription;exports.DialogFooter=e.DialogFooter;exports.DialogHeader=e.DialogHeader;exports.DialogTitle=e.DialogTitle;exports.DialogTrigger=e.DialogTrigger;exports.DropdownMenu=e.DropdownMenu;exports.DropdownMenuCheckboxItem=e.DropdownMenuCheckboxItem;exports.DropdownMenuContent=e.DropdownMenuContent;exports.DropdownMenuGroup=e.DropdownMenuGroup;exports.DropdownMenuItem=e.DropdownMenuItem;exports.DropdownMenuLabel=e.DropdownMenuLabel;exports.DropdownMenuPortal=e.DropdownMenuPortal;exports.DropdownMenuRadioGroup=e.DropdownMenuRadioGroup;exports.DropdownMenuRadioItem=e.DropdownMenuRadioItem;exports.DropdownMenuSeparator=e.DropdownMenuSeparator;exports.DropdownMenuShortcut=e.DropdownMenuShortcut;exports.DropdownMenuSub=e.DropdownMenuSub;exports.DropdownMenuSubContent=e.DropdownMenuSubContent;exports.DropdownMenuSubTrigger=e.DropdownMenuSubTrigger;exports.DropdownMenuTrigger=e.DropdownMenuTrigger;exports.HoverCard=e.HoverCard;exports.HoverCardContent=e.HoverCardContent;exports.HoverCardTrigger=e.HoverCardTrigger;exports.Input=e.Input;exports.Label=e.Label;exports.Popover=e.Popover;exports.PopoverContent=e.PopoverContent;exports.PopoverTrigger=e.PopoverTrigger;exports.ScrollArea=e.ScrollArea;exports.ScrollBar=e.ScrollBar;exports.Select=e.Select;exports.SelectContent=e.SelectContent;exports.SelectGroup=e.SelectGroup;exports.SelectItem=e.SelectItem;exports.SelectLabel=e.SelectLabel;exports.SelectSeparator=e.SelectSeparator;exports.SelectTrigger=e.SelectTrigger;exports.SelectValue=e.SelectValue;exports.Separator=e.Separator;exports.Skeleton=e.Skeleton;exports.Switch=e.Switch;exports.Tabs=e.Tabs;exports.TabsContent=e.TabsContent;exports.TabsList=e.TabsList;exports.TabsTrigger=e.TabsTrigger;exports.Textarea=e.Textarea;exports.Toaster=e.Toaster;exports.Tooltip=e.Tooltip;exports.TooltipContent=e.TooltipContent;exports.TooltipPortal=e.TooltipPortal;exports.TooltipProvider=e.TooltipProvider;exports.TooltipTrigger=e.TooltipTrigger;exports.badgeVariants=e.badgeVariants;exports.buttonVariants=e.buttonVariants;exports.reducer=e.reducer;exports.toast=e.toast;exports.useToast=e.useToast;exports.Alert=b;exports.AlertDescription=C;exports.AlertTitle=f;exports.Menubar=M;exports.MenubarCheckboxItem=T;exports.MenubarContent=D;exports.MenubarGroup=B;exports.MenubarItem=v;exports.MenubarLabel=y;exports.MenubarMenu=O;exports.MenubarPortal=J;exports.MenubarRadioGroup=Q;exports.MenubarRadioItem=R;exports.MenubarSeparator=w;exports.MenubarShortcut=N;exports.MenubarSub=K;exports.MenubarSubContent=j;exports.MenubarSubTrigger=S;exports.MenubarTrigger=h;exports.Sheet=U;exports.SheetClose=X;exports.SheetContent=E;exports.SheetDescription=G;exports.SheetFooter=q;exports.SheetHeader=P;exports.SheetTitle=k;exports.SheetTrigger=W;exports.Toggle=g;exports.toggleVariants=x;
package/dist/ui.js CHANGED
@@ -2,18 +2,15 @@ import { j as o } from "./jsx-runtime-Sp0orL4X.js";
2
2
  import * as n from "react";
3
3
  import * as m from "@radix-ui/react-toggle";
4
4
  import { cva as c } from "class-variance-authority";
5
- import { c as r } from "./button-9Duvj2dH.js";
6
- import { B as ye, b as Ne } from "./button-9Duvj2dH.js";
7
- import { G as we, J as Se, H as Me, I as je, _ as De, a6 as Te, a5 as Re, $ as Ie, a3 as Ae, a4 as ke, a0 as Pe, a1 as ze, a2 as Ge, ac as Le, f as He, i as Ve, h as Fe, k as Be, g as Ee, al as Oe, t as qe, ay as Je, w as Ke, x as _e, u as Qe, y as Ue, v as We, aA as Xe, az as Ye, C as Ze, aB as $e, b as ea, aG as aa, c as ta, aD as oa, aH as sa, aL as ra, aC as na, aE as ia, aF as da, aI as la, aJ as ca, aK as ma, a as pa, D as ua, m as fa, p as ga, q as xa, n as ba, o as ha, l as Ca, O as ya, a7 as Na, R as va, X as wa, Y as Sa, V as Ma, ar as ja, av as Da, aq as Ta, W as Ra, Z as Ia, as as Aa, at as ka, au as Pa, Q as za, a8 as Ga, aa as La, a9 as Ha, M as Va, L as Fa, P as Ba, s as Ea, r as Oa, U as qa, am as Ja, ad as Ka, ag as _a, an as Qa, ah as Ua, ao as Wa, ap as Xa, ae as Ya, af as Za, ab as $a, S as et, F as at, z as tt, E as ot, A as st, B as rt, j as nt, aj as it, T as dt, e as lt, N as ct, ai as mt, d as pt, ak as ut, aw as ft, ax as gt, K as xt } from "./context-menu-yLeOsx9j.js";
5
+ import { al as r } from "./context-menu-9cWJcKdh.js";
6
+ import { H as ye, K as Ne, I as ve, J as we, $ as Se, a7 as Me, a6 as je, a0 as De, a4 as Te, a5 as Re, a1 as Ie, a2 as Ae, a3 as ke, ad as Pe, B as ze, f as Ge, i as Le, h as He, k as Ve, g as Fe, ao as Be, t as Oe, aB as Ee, w as qe, x as Je, u as Ke, y as _e, v as Qe, aD as Ue, aC as We, C as Xe, aE as Ye, b as Ze, aJ as $e, c as ea, aG as aa, aK as ta, aO as oa, aF as sa, aH as ra, aI as na, aL as ia, aM as da, aN as la, a as ca, D as ma, m as pa, p as ua, q as fa, n as ga, o as xa, l as ba, Q as ha, a8 as Ca, U as ya, Y as Na, Z as va, W as wa, au as Sa, ay as Ma, at as ja, X as Da, _ as Ta, av as Ra, aw as Ia, ax as Aa, R as ka, a9 as Pa, ab as za, aa as Ga, N as La, L as Ha, P as Va, s as Fa, r as Ba, V as Oa, ap as Ea, ae as qa, ah as Ja, aq as Ka, ai as _a, ar as Qa, as as Ua, af as Wa, ag as Xa, ac as Ya, S as Za, G as $a, z as et, F as at, A as tt, E as ot, j as st, ak as rt, T as nt, e as it, O as dt, aj as lt, d as ct, an as mt, am as pt, az as ut, aA as ft, M as gt } from "./context-menu-9cWJcKdh.js";
8
7
  import { ChevronRightIcon as g, CheckIcon as x, DotFilledIcon as b, Cross2Icon as h } from "@radix-ui/react-icons";
9
8
  import * as s from "@radix-ui/react-menubar";
10
9
  import * as d from "@radix-ui/react-dialog";
11
- import "@radix-ui/react-slot";
12
- import "clsx";
13
- import "tailwind-merge";
14
10
  import "@radix-ui/react-switch";
15
11
  import "@radix-ui/react-accordion";
16
12
  import "@radix-ui/react-alert-dialog";
13
+ import "@radix-ui/react-slot";
17
14
  import "@radix-ui/react-label";
18
15
  import "@radix-ui/react-scroll-area";
19
16
  import "@radix-ui/react-tabs";
@@ -26,6 +23,8 @@ import "@radix-ui/react-separator";
26
23
  import "@radix-ui/react-toast";
27
24
  import "cmdk";
28
25
  import "@radix-ui/react-context-menu";
26
+ import "clsx";
27
+ import "tailwind-merge";
29
28
  const C = c(
30
29
  "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
31
30
  {
@@ -242,84 +241,84 @@ const F = ({ className: e, ...a }) => /* @__PURE__ */ o.jsx("div", { className:
242
241
  F.displayName = "SheetFooter";
243
242
  const B = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(d.Title, { ref: t, className: r("text-lg font-semibold text-foreground", e), ...a }));
244
243
  B.displayName = d.Title.displayName;
245
- const E = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(d.Description, { ref: t, className: r("text-sm text-muted-foreground", e), ...a }));
246
- E.displayName = d.Description.displayName;
244
+ const O = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o.jsx(d.Description, { ref: t, className: r("text-sm text-muted-foreground", e), ...a }));
245
+ O.displayName = d.Description.displayName;
247
246
  export {
248
- we as Accordion,
249
- Se as AccordionContent,
250
- Me as AccordionItem,
251
- je as AccordionTrigger,
247
+ ye as Accordion,
248
+ Ne as AccordionContent,
249
+ ve as AccordionItem,
250
+ we as AccordionTrigger,
252
251
  v as Alert,
253
252
  S as AlertDescription,
254
- De as AlertDialog,
255
- Te as AlertDialogAction,
256
- Re as AlertDialogCancel,
257
- Ie as AlertDialogContent,
258
- Ae as AlertDialogDescription,
259
- ke as AlertDialogFooter,
260
- Pe as AlertDialogHeader,
261
- ze as AlertDialogTitle,
262
- Ge as AlertDialogTrigger,
253
+ Se as AlertDialog,
254
+ Me as AlertDialogAction,
255
+ je as AlertDialogCancel,
256
+ De as AlertDialogContent,
257
+ Te as AlertDialogDescription,
258
+ Re as AlertDialogFooter,
259
+ Ie as AlertDialogHeader,
260
+ Ae as AlertDialogTitle,
261
+ ke as AlertDialogTrigger,
263
262
  w as AlertTitle,
264
- Le as Badge,
265
- ye as Button,
266
- He as Card,
267
- Ve as CardContent,
268
- Fe as CardDescription,
269
- Be as CardFooter,
270
- Ee as CardHeader,
271
- Oe as CardTitle,
272
- qe as Command,
273
- Je as CommandDialog,
274
- Ke as CommandEmpty,
275
- _e as CommandGroup,
276
- Qe as CommandInput,
277
- Ue as CommandItem,
278
- We as CommandList,
279
- Xe as CommandSeparator,
280
- Ye as CommandShortcut,
281
- Ze as ContextMenu,
282
- $e as ContextMenuCheckboxItem,
283
- ea as ContextMenuContent,
284
- aa as ContextMenuGroup,
285
- ta as ContextMenuItem,
286
- oa as ContextMenuLabel,
287
- sa as ContextMenuPortal,
288
- ra as ContextMenuRadioGroup,
289
- na as ContextMenuRadioItem,
290
- ia as ContextMenuSeparator,
291
- da as ContextMenuShortcut,
292
- la as ContextMenuSub,
293
- ca as ContextMenuSubContent,
294
- ma as ContextMenuSubTrigger,
295
- pa as ContextMenuTrigger,
296
- ua as Dialog,
297
- fa as DialogContent,
298
- ga as DialogDescription,
299
- xa as DialogFooter,
300
- ba as DialogHeader,
301
- ha as DialogTitle,
302
- Ca as DialogTrigger,
303
- ya as DropdownMenu,
304
- Na as DropdownMenuCheckboxItem,
305
- va as DropdownMenuContent,
306
- wa as DropdownMenuGroup,
307
- Sa as DropdownMenuItem,
308
- Ma as DropdownMenuLabel,
309
- ja as DropdownMenuPortal,
310
- Da as DropdownMenuRadioGroup,
311
- Ta as DropdownMenuRadioItem,
312
- Ra as DropdownMenuSeparator,
313
- Ia as DropdownMenuShortcut,
314
- Aa as DropdownMenuSub,
315
- ka as DropdownMenuSubContent,
316
- Pa as DropdownMenuSubTrigger,
317
- za as DropdownMenuTrigger,
318
- Ga as HoverCard,
319
- La as HoverCardContent,
320
- Ha as HoverCardTrigger,
321
- Va as Input,
322
- Fa as Label,
263
+ Pe as Badge,
264
+ ze as Button,
265
+ Ge as Card,
266
+ Le as CardContent,
267
+ He as CardDescription,
268
+ Ve as CardFooter,
269
+ Fe as CardHeader,
270
+ Be as CardTitle,
271
+ Oe as Command,
272
+ Ee as CommandDialog,
273
+ qe as CommandEmpty,
274
+ Je as CommandGroup,
275
+ Ke as CommandInput,
276
+ _e as CommandItem,
277
+ Qe as CommandList,
278
+ Ue as CommandSeparator,
279
+ We as CommandShortcut,
280
+ Xe as ContextMenu,
281
+ Ye as ContextMenuCheckboxItem,
282
+ Ze as ContextMenuContent,
283
+ $e as ContextMenuGroup,
284
+ ea as ContextMenuItem,
285
+ aa as ContextMenuLabel,
286
+ ta as ContextMenuPortal,
287
+ oa as ContextMenuRadioGroup,
288
+ sa as ContextMenuRadioItem,
289
+ ra as ContextMenuSeparator,
290
+ na as ContextMenuShortcut,
291
+ ia as ContextMenuSub,
292
+ da as ContextMenuSubContent,
293
+ la as ContextMenuSubTrigger,
294
+ ca as ContextMenuTrigger,
295
+ ma as Dialog,
296
+ pa as DialogContent,
297
+ ua as DialogDescription,
298
+ fa as DialogFooter,
299
+ ga as DialogHeader,
300
+ xa as DialogTitle,
301
+ ba as DialogTrigger,
302
+ ha as DropdownMenu,
303
+ Ca as DropdownMenuCheckboxItem,
304
+ ya as DropdownMenuContent,
305
+ Na as DropdownMenuGroup,
306
+ va as DropdownMenuItem,
307
+ wa as DropdownMenuLabel,
308
+ Sa as DropdownMenuPortal,
309
+ Ma as DropdownMenuRadioGroup,
310
+ ja as DropdownMenuRadioItem,
311
+ Da as DropdownMenuSeparator,
312
+ Ta as DropdownMenuShortcut,
313
+ Ra as DropdownMenuSub,
314
+ Ia as DropdownMenuSubContent,
315
+ Aa as DropdownMenuSubTrigger,
316
+ ka as DropdownMenuTrigger,
317
+ Pa as HoverCard,
318
+ za as HoverCardContent,
319
+ Ga as HoverCardTrigger,
320
+ La as Input,
321
+ Ha as Label,
323
322
  M as Menubar,
324
323
  A as MenubarCheckboxItem,
325
324
  R as MenubarContent,
@@ -336,46 +335,46 @@ export {
336
335
  T as MenubarSubContent,
337
336
  D as MenubarSubTrigger,
338
337
  j as MenubarTrigger,
339
- Ba as Popover,
340
- Ea as PopoverContent,
341
- Oa as PopoverTrigger,
342
- qa as ScrollArea,
343
- Ja as ScrollBar,
344
- Ka as Select,
345
- _a as SelectContent,
346
- Qa as SelectGroup,
347
- Ua as SelectItem,
348
- Wa as SelectLabel,
349
- Xa as SelectSeparator,
350
- Ya as SelectTrigger,
351
- Za as SelectValue,
352
- $a as Separator,
338
+ Va as Popover,
339
+ Fa as PopoverContent,
340
+ Ba as PopoverTrigger,
341
+ Oa as ScrollArea,
342
+ Ea as ScrollBar,
343
+ qa as Select,
344
+ Ja as SelectContent,
345
+ Ka as SelectGroup,
346
+ _a as SelectItem,
347
+ Qa as SelectLabel,
348
+ Ua as SelectSeparator,
349
+ Wa as SelectTrigger,
350
+ Xa as SelectValue,
351
+ Ya as Separator,
353
352
  ge as Sheet,
354
353
  be as SheetClose,
355
354
  H as SheetContent,
356
- E as SheetDescription,
355
+ O as SheetDescription,
357
356
  F as SheetFooter,
358
357
  V as SheetHeader,
359
358
  B as SheetTitle,
360
359
  xe as SheetTrigger,
361
- et as Skeleton,
362
- at as Switch,
363
- tt as Tabs,
364
- ot as TabsContent,
365
- st as TabsList,
366
- rt as TabsTrigger,
367
- nt as Textarea,
368
- it as Toaster,
360
+ Za as Skeleton,
361
+ $a as Switch,
362
+ et as Tabs,
363
+ at as TabsContent,
364
+ tt as TabsList,
365
+ ot as TabsTrigger,
366
+ st as Textarea,
367
+ rt as Toaster,
369
368
  y as Toggle,
370
- dt as Tooltip,
371
- lt as TooltipContent,
372
- ct as TooltipPortal,
373
- mt as TooltipProvider,
374
- pt as TooltipTrigger,
375
- ut as badgeVariants,
376
- Ne as buttonVariants,
377
- ft as reducer,
378
- gt as toast,
369
+ nt as Tooltip,
370
+ it as TooltipContent,
371
+ dt as TooltipPortal,
372
+ lt as TooltipProvider,
373
+ ct as TooltipTrigger,
374
+ mt as badgeVariants,
375
+ pt as buttonVariants,
376
+ ut as reducer,
377
+ ft as toast,
379
378
  C as toggleVariants,
380
- xt as useToast
379
+ gt as useToast
381
380
  };
@@ -0,0 +1 @@
1
+ "use strict";const P=require("react"),u=require("lodash-es"),b=require("jotai"),$=require("./iconBase-kuD_VwQx.cjs"),Ze=require("./_commonjsHelpers-f52AuuUj.cjs"),$e=require("@react-hookz/web");require("react-i18next");require("@chaibuilder/runtime");const Ke=require("tree-model");var x={VITE_OPENAI_API_KEY:"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",VITE_UNSPASH_ACCESS_KEY:"XgYBCm-XCHecRMsbfhw6oZWGkltco1U5TYMEd0LXZeA",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let Qe=0;function T(e,t){const o=`atom${++Qe}`,n={toString:()=>o};return typeof e=="function"?n.read=e:(n.init=e,n.read=s=>s(n),n.write=(s,r,c)=>r(n,typeof c=="function"?c(s(n)):c)),t&&(n.write=t),n}const te=e=>"init"in e,oe=e=>!!e.write,K=new WeakMap,et=(e,t)=>{K.set(e,t),e.catch(()=>{}).finally(()=>K.delete(e))},he=(e,t)=>{const o=K.get(e);o&&(K.delete(e),o(t))},ke=(e,t)=>{e.status="fulfilled",e.value=t},Be=(e,t)=>{e.status="rejected",e.reason=t},tt=e=>typeof(e==null?void 0:e.then)=="function",z=(e,t)=>"v"in e&&"v"in t&&Object.is(e.v,t.v),ve=(e,t)=>"e"in e&&"e"in t&&Object.is(e.e,t.e),H=e=>"v"in e&&e.v instanceof Promise,ot=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,Z=e=>{if("e"in e)throw e.e;return e.v},Se=()=>{const e=new WeakMap,t=new WeakMap,o=new Map;let n,s,r;(x?"production":void 0)!=="production"&&(n=new Set,s=new Set,r=new Set);const c=l=>e.get(l),a=(l,f)=>{(x?"production":void 0)!=="production"&&Object.freeze(f);const m=e.get(l);if(e.set(l,f),o.has(l)||o.set(l,m),m&&H(m)){const p="v"in f?f.v instanceof Promise?f.v:Promise.resolve(f.v):Promise.reject(f.e);he(m.v,p)}},d=(l,f,m)=>{const p=new Map;let h=!1;m.forEach((g,B)=>{!g&&B===l&&(g=f),g?(p.set(B,g),f.d.get(B)!==g&&(h=!0)):(x?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(h||f.d.size!==p.size)&&(f.d=p)},i=(l,f,m)=>{const p=c(l),h={d:(p==null?void 0:p.d)||new Map,v:f};if(m&&d(l,h,m),p&&z(p,h)&&p.d===h.d)return p;if(p&&H(p)&&H(h)&&ot(p,h)){if(p.d===h.d)return p;h.v=p.v}return a(l,h),h},k=(l,f,m,p)=>{if(tt(f)){let h;const g=new Promise((B,L)=>{let A=!1;f.then(S=>{if(!A){A=!0;const _=c(l),j=i(l,g,m);ke(g,S),B(S),(_==null?void 0:_.d)!==j.d&&M(l,j,_==null?void 0:_.d)}},S=>{if(!A){A=!0;const _=c(l),j=i(l,g,m);Be(g,S),L(S),(_==null?void 0:_.d)!==j.d&&M(l,j,_==null?void 0:_.d)}}),h=S=>{A||(A=!0,S.then(_=>ke(g,_),_=>Be(g,_)),B(S))}});return g.orig=f,g.status="pending",et(g,B=>{B&&h(B),p==null||p()}),i(l,g,m)}return i(l,f,m)},O=(l,f,m)=>{const p=c(l),h={d:(p==null?void 0:p.d)||new Map,e:f};return m&&d(l,h,m),p&&ve(p,h)&&p.d===h.d?p:(a(l,h),h)},F=l=>{const f=c(l);if(f&&(f.d.forEach((A,S)=>{S!==l&&!t.has(S)&&F(S)}),Array.from(f.d).every(([A,S])=>{const _=c(A);return A===l||_===S||_&&!H(_)&&z(_,S)})))return f;const m=new Map;let p=!0;const h=A=>{if(A===l){const _=c(A);if(_)return m.set(A,_),Z(_);if(te(A))return m.set(A,void 0),A.init;throw new Error("no atom init")}const S=F(A);return m.set(A,S),Z(S)};let g,B;const L={get signal(){return g||(g=new AbortController),g.signal},get setSelf(){return(x?"production":void 0)!=="production"&&!oe(l)&&console.warn("setSelf function cannot be used with read-only atom"),!B&&oe(l)&&(B=(...A)=>{if((x?"production":void 0)!=="production"&&p&&console.warn("setSelf function cannot be called in sync"),!p)return w(l,...A)}),B}};try{const A=l.read(h,L);return k(l,A,m,()=>g==null?void 0:g.abort())}catch(A){return O(l,A,m)}finally{p=!1}},V=l=>Z(F(l)),v=l=>{let f=t.get(l);return f||(f=C(l)),f},E=(l,f)=>!f.l.size&&(!f.t.size||f.t.size===1&&f.t.has(l)),I=l=>{const f=t.get(l);f&&E(l,f)&&D(l)},U=l=>{const f=new Map,m=new WeakMap,p=g=>{const B=t.get(g);B==null||B.t.forEach(L=>{L!==g&&(f.set(L,(f.get(L)||new Set).add(g)),m.set(L,(m.get(L)||0)+1),p(L))})};p(l);const h=g=>{const B=t.get(g);B==null||B.t.forEach(L=>{var A;if(L!==g){let S=m.get(L);if(S&&m.set(L,--S),!S){let _=!!((A=f.get(L))!=null&&A.size);if(_){const j=c(L),Je=F(L);_=!j||!z(j,Je)}_||f.forEach(j=>j.delete(L))}h(L)}})};h(l)},y=(l,...f)=>{let m=!0;const p=B=>Z(F(B)),h=(B,...L)=>{let A;if(B===l){if(!te(B))throw new Error("atom not writable");const S=c(B),_=k(B,L[0]);(!S||!z(S,_))&&U(B)}else A=y(B,...L);if(!m){const S=N();(x?"production":void 0)!=="production"&&s.forEach(_=>_({type:"async-write",flushed:S}))}return A},g=l.write(p,h,...f);return m=!1,g},w=(l,...f)=>{const m=y(l,...f),p=N();return(x?"production":void 0)!=="production"&&s.forEach(h=>h({type:"write",flushed:p})),m},C=(l,f)=>{const m={t:new Set(f&&[f]),l:new Set};if(t.set(l,m),(x?"production":void 0)!=="production"&&r.add(l),F(l).d.forEach((p,h)=>{const g=t.get(h);g?g.t.add(l):h!==l&&C(h,l)}),F(l),oe(l)&&l.onMount){const p=l.onMount((...h)=>w(l,...h));p&&(m.u=p)}return m},D=l=>{var f;const m=(f=t.get(l))==null?void 0:f.u;m&&m(),t.delete(l),(x?"production":void 0)!=="production"&&r.delete(l);const p=c(l);p?(H(p)&&he(p.v),p.d.forEach((h,g)=>{if(g!==l){const B=t.get(g);B&&(B.t.delete(l),E(g,B)&&D(g))}})):(x?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",l)},M=(l,f,m)=>{const p=new Set(f.d.keys());m==null||m.forEach((h,g)=>{if(p.has(g)){p.delete(g);return}const B=t.get(g);B&&(B.t.delete(l),E(g,B)&&D(g))}),p.forEach(h=>{const g=t.get(h);g?g.t.add(l):t.has(l)&&C(h,l)})},N=()=>{let l;for((x?"production":void 0)!=="production"&&(l=new Set);o.size;){const f=Array.from(o);o.clear(),f.forEach(([m,p])=>{const h=c(m);if(h){h.d!==(p==null?void 0:p.d)&&M(m,h,p==null?void 0:p.d);const g=t.get(m);g&&!(p&&!H(p)&&(z(p,h)||ve(p,h)))&&(g.l.forEach(B=>B()),(x?"production":void 0)!=="production"&&l.add(m))}else(x?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((x?"production":void 0)!=="production")return n.forEach(f=>f("state")),l},R=(l,f)=>{const m=v(l),p=N(),h=m.l;return h.add(f),(x?"production":void 0)!=="production"&&(n.forEach(g=>g("sub")),s.forEach(g=>g({type:"sub",flushed:p}))),()=>{h.delete(f),I(l),(x?"production":void 0)!=="production"&&(n.forEach(g=>g("unsub")),s.forEach(g=>g({type:"unsub"})))}};return(x?"production":void 0)!=="production"?{get:V,set:w,sub:R,dev_subscribe_store:(l,f)=>f!==2?(console.warn("The current StoreListener revision is 2. The older ones are deprecated."),n.add(l),()=>{n.delete(l)}):(s.add(l),()=>{s.delete(l)}),dev_get_mounted_atoms:()=>r.values(),dev_get_atom_state:l=>e.get(l),dev_get_mounted:l=>t.get(l),dev_restore_atoms:l=>{for(const[m,p]of l)te(m)&&(k(m,p),U(m));const f=N();s.forEach(m=>m({type:"restore",flushed:f}))}}:{get:V,set:w,sub:R}};let ne;const nt=()=>(ne||(ne=Se()),ne);var ce={VITE_OPENAI_API_KEY:"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",VITE_UNSPASH_ACCESS_KEY:"XgYBCm-XCHecRMsbfhw6oZWGkltco1U5TYMEd0LXZeA",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Ee=Symbol(),be=(e,t,o)=>(t.has(o)?t:t.set(o,e())).get(o),st=new WeakMap,rt=(e,t,o)=>{const n=be(()=>new WeakMap,st,t);return be(e,n,o)},ct={},Ae=e=>!!e.write,lt=e=>typeof e=="function";function it(e,t){return rt(()=>{const o=new WeakMap,n=(c,a)=>{let d=o.get(c);if(d)return d;const i=a&&o.get(a),k=[],O=[];return c.forEach((F,V)=>{const v=t?t(F):V;O[V]=v;const E=i&&i.atomList[i.keyList.indexOf(v)];if(E){k[V]=E;return}const I=y=>{const w=y(s),C=y(e),M=n(C,w==null?void 0:w.arr).keyList.indexOf(v);if(M<0||M>=C.length){const N=c[n(c).keyList.indexOf(v)];if(N)return N;throw new Error("splitAtom: index out of bounds for read")}return C[M]},U=(y,w,C)=>{const D=y(s),M=y(e),R=n(M,D==null?void 0:D.arr).keyList.indexOf(v);if(R<0||R>=M.length)throw new Error("splitAtom: index out of bounds for write");const l=lt(C)?C(M[R]):C;w(e,[...M.slice(0,R),l,...M.slice(R+1)])};k[V]=Ae(e)?T(I,U):T(I)}),i&&i.keyList.length===O.length&&i.keyList.every((F,V)=>F===O[V])?d=i:d={arr:c,atomList:k,keyList:O},o.set(c,d),d},s=T(c=>{const a=c(s),d=c(e);return n(d,a==null?void 0:a.arr)});(ce?"production":void 0)!=="production"&&(s.debugPrivate=!0),s.init=void 0;const r=Ae(e)?T(c=>c(s).atomList,(c,a,d)=>{switch(d.type){case"remove":{const i=c(r).indexOf(d.atom);if(i>=0){const k=c(e);a(e,[...k.slice(0,i),...k.slice(i+1)])}break}case"insert":{const i=d.before?c(r).indexOf(d.before):c(r).length;if(i>=0){const k=c(e);a(e,[...k.slice(0,i),d.value,...k.slice(i)])}break}case"move":{const i=c(r).indexOf(d.atom),k=d.before?c(r).indexOf(d.before):c(r).length;if(i>=0&&k>=0){const O=c(e);i<k?a(e,[...O.slice(0,i),...O.slice(i+1,k),O[i],...O.slice(k)]):a(e,[...O.slice(0,k),O[i],...O.slice(k,i),...O.slice(i+1)])}break}}}):T(c=>c(s).atomList);return r},e,t||ct)}function ut(e){const t=Symbol(),o=T(t);(ce?"production":void 0)!=="production"&&(o.debugPrivate=!0);const n=T((s,r)=>{const c=s(o);return c!==t?c:e(s,r)},(s,r,c)=>{if(c===Ee)r(o,t);else if(typeof c=="function"){const a=s(n);r(o,c(a))}else r(o,c)});return n}const at=e=>typeof(e==null?void 0:e.then)=="function";function dt(e){let t,o;const n={getItem:(s,r)=>{var c,a;const d=k=>{if(k=k||"",t!==k){try{o=JSON.parse(k)}catch{return r}t=k}return o},i=(a=(c=e())==null?void 0:c.getItem(s))!=null?a:null;return at(i)?i.then(d):d(i)},setItem:(s,r)=>{var c;return(c=e())==null?void 0:c.setItem(s,JSON.stringify(r))},removeItem:s=>{var r;return(r=e())==null?void 0:r.removeItem(s)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(n.subscribe=(s,r,c)=>{if(!(e()instanceof window.Storage))return()=>{};const a=d=>{if(d.storageArea===e()&&d.key===s){let i;try{i=JSON.parse(d.newValue||"")}catch{i=c}r(i)}};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}}),n}const ft=dt(()=>typeof window<"u"?window.localStorage:void 0);function we(e,t,o=ft,n){const s=n==null?void 0:n.unstable_getOnInit,r=T(s?o.getItem(e,t):t);return(ce?"production":void 0)!=="production"&&(r.debugPrivate=!0),r.onMount=a=>{s||a(o.getItem(e,t));let d;return o.subscribe&&(d=o.subscribe(e,a,t)),d},T(a=>a(r),(a,d,i)=>{const k=typeof i=="function"?i(a(r)):i;return k===Ee?(d(r,t),o.removeItem(e)):k instanceof Promise?k.then(O=>(d(r,O),o.setItem(e,O))):(d(r,k),o.setItem(e,k))})}var pt={VITE_OPENAI_API_KEY:"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",VITE_UNSPASH_ACCESS_KEY:"XgYBCm-XCHecRMsbfhw6oZWGkltco1U5TYMEd0LXZeA",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const gt=P.createContext(void 0),le=e=>{const t=P.useContext(gt);return(e==null?void 0:e.store)||t||nt()},mt=e=>typeof(e==null?void 0:e.then)=="function",ht=P.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function ye(e,t){const o=le(t),[[n,s,r],c]=P.useReducer(i=>{const k=o.get(e);return Object.is(i[0],k)&&i[1]===o&&i[2]===e?i:[k,o,e]},void 0,()=>[o.get(e),o,e]);let a=n;(s!==o||r!==e)&&(c(),a=o.get(e));const d=t==null?void 0:t.delay;return P.useEffect(()=>{const i=o.sub(e,()=>{if(typeof d=="number"){setTimeout(c,d);return}c()});return c(),i},[o,e,d]),P.useDebugValue(a),mt(a)?ht(a):a}function Pe(e,t){const o=le(t);return P.useCallback((...s)=>{if((pt?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return o.set(e,...s)},[o,e])}function J(e,t){return[ye(e,t),Pe(e,t)]}function Le(e,t,o){const n=u.filter(e,r=>r._parent===t),s=[];for(let r=0;r<n.length;r++){const c=Ie(n[r]);if(Object.keys(c).length>0&&Object.keys(c).forEach(a=>{n[r][a]=`slot:${$.generateUUID()}`}),u.filter(e,{_parent:n[r]._id}).length>0){const a=$.generateUUID();s.push({...n[r],oldId:n[r]._id,_id:a,_parent:o}),s.push(u.flatten(Le(e,n[r]._id,a)))}else s.push({...n[r],oldId:n[r]._id,_id:$.generateUUID(),_parent:o})}return u.flatten(s)}function Ce(e){const t={};e.forEach(n=>{t[n._id]={...n,children:[]}});const o=[];return e.forEach(n=>{if(n._parent){const s=t[n._parent];s&&s.children.push(t[n._id])}else o.push(t[n._id])}),o}const Ie=e=>{const t={};return Object.keys(e).forEach(o=>{u.isString(e[o])&&e[o].startsWith("slot")&&(t[o]=e[o].replace("slot:",""))}),t},kt=(e,t,o=null)=>{let n=u.find(e,{_id:t});n={...n,oldId:n._id,_id:$.generateUUID()},o&&(n={...n,_parent:o});const s=[n];u.filter(e,{_parent:t}).length>0&&s.push(u.flatten(Le(e,t,n._id)));const r=u.flatten(s);return u.map(r,c=>{const a=c,d=Ie(a);return Object.keys(d).length>0&&Object.keys(d).forEach(i=>{const k=u.find(r,{oldId:d[i].replace("slot:","")});a[i]=`slot:${k._id}`}),u.omit(a,["global","oldId"])})},Y=b.atom([]);Y.debugLabel="presentBlocksAtom";const Oe=b.atom(e=>{const t=e(Y);return Ce([...t])});Oe.debugLabel="treeDSBlocks";Y.debugLabel="presentBlocksAtom";const Me=it(Y);Me.debugLabel="pageBlocksAtomsAtom";const Bt=b.atom("");Bt.debugLabel="builderActivePageAtom";const vt=b.atom(-1);vt.debugLabel="destinationDropIndexAtom";const xe=b.atom([]);xe.debugLabel="buildingBlocksAtom";const bt=b.atom(e=>{const t=e(xe);return u.filter(t,o=>u.has(o,"blockId"))});bt.debugLabel="globalBlocksAtom";const ie=b.atom([]);ie.debugLabel="selectedBlockIdsAtom";const ue=b.atom(e=>{const t=e(Y),o=e(ie);return u.map(u.filter(t,({_id:n})=>u.includes(o,n)),n=>({...n}))});ue.debugLabel="selectedBlocksAtom";const Q=b.atom(e=>{const t=e(ue);if(t.length===0)return null;if(t.length===1)return t[0]});Q.debugLabel="selectedBlockAtom";const At=e=>u.get(e,"_parent",null),_t=b.atom(e=>{const t=e(ue),o=u.map(t,At);return u.filter(e(Y),n=>u.includes(o,n._id))});_t.debugLabel="selectedBlocksParentsAtom";const De=b.atom(()=>!1);De.debugLabel="selectedBlockFlexChildAtom";const Ue=b.atom(()=>!1);Ue.debugLabel="selectedBlockGridChildAtom";const Re=b.atom("");Re.debugLabel="styleStateAtom";const Te=we("styleBreakpoint","xs");Te.debugLabel="styleBreakpointAtom";const St=()=>({flexChild:b.useAtomValue(De),gridChild:b.useAtomValue(Ue)}),Et=()=>b.useAtomValue(Q),wt=b.atom(e=>{const t=e(Q),o=e(Y);let n=t;const s=[t];do{const r=o.find(({_id:c})=>c===(n==null?void 0:n._parent));n=r,r&&s.push(r)}while(n!=null&&n._parent);return s}),yt=()=>u.compact(b.useAtomValue(wt)),Fe=()=>{const[e,t]=b.useAtom(ie),o=P.useCallback(n=>{t(s=>u.includes(s,n)?u.without(s,n):[...s,n])},[t]);return[e,t,o]};var Ve={exports:{}};(function(e){(function(){function t(n,s,r){return n.splice(s,!r||1+r-s+(!(r<0^s>=0)&&(r<0||-1)*n.length)),n.length}let o=function(){let n=[],s=-1,r=0,c=!1,a;function d(i,k){return!i||typeof i[k]!="function"?this:(c=!0,i[k](),c=!1,this)}return{add:function(i){return c?this:(n.splice(s+1,n.length-s),n.push(i),r&&n.length>r&&t(n,0,-(r+1)),s=n.length-1,a&&a(),this)},setCallback:function(i){a=i},undo:function(){let i=n[s];if(!i)return this;const k=i.groupId;for(;i.groupId===k&&(d(i,"undo"),s-=1,i=n[s],!(!i||!i.groupId)););return a&&a(),this},redo:function(){let i=n[s+1];if(!i)return this;const k=i.groupId;for(;i.groupId===k&&(d(i,"redo"),s+=1,i=n[s+1],!(!i||!i.groupId)););return a&&a(),this},clear:function(){let i=n.length;n=[],s=-1,a&&i>0&&a()},hasUndo:function(){return s!==-1},hasRedo:function(){return s<n.length-1},getCommands:function(i){return i?n.filter(k=>k.groupId===i):n},getIndex:function(){return s},setLimit:function(i){r=i}}};e.exports?e.exports=o:window.UndoManager=o})()})(Ve);var Pt=Ve.exports;const Lt=Ze.getDefaultExportFromCjs(Pt),Ct=["hover","focus","focus-within","focus-visible","active","visited","target","first","last","only","odd","even","first-of-type","last-of-type","only-of-type","empty","disabled","checked","indeterminate","default","required","valid","invalid","in-range","out-of-range","placeholder-shown","autofill","read-only","open","before","after","first-letter","first-line","marker","selection","file","placeholder","hs-collapse-open","hs-accordion-active"],se={bodyFont:"Inter",headingFont:"Inter",roundedCorners:5,primaryColor:"#570df8",secondaryColor:"#f002b8",bodyBgDarkColor:"#031022",bodyBgLightColor:"#fcfcfc",bodyTextDarkColor:"#ffffff",bodyTextLightColor:"#000000"},It=b.atom(se),Ot=b.atom(null),ae=()=>{const[e,t]=b.useAtom(It);return[u.isObject(e)?{...se,...e}:se,t]},Mt=()=>b.useAtom(Ot),xt=b.atom(null),Ne=()=>({currentPage:b.useAtomValue(xt)});function je(e){return Ce(e)}const de=(e,t)=>u.flatten(e.map(o=>{if(o=t?{...o,_parent:t}:{...o},o.children){const n=[...o.children];return delete o.children,u.flatten([o,...de(n,o._id)])}return o}));function fe(e,t=!1){for(let o=0;o<e.length;o++){const n=e[o];n.global&&!t?e[o]={type:"GlobalBlock",blockId:n.blockId,_parent:u.get(n,"_parent",null),_id:n._id}:n.children&&n.children.length&&fe(n.children)}}function Ge(e){let t=[],o=u.filter(e,{type:"GlobalBlock"});return o.length>0&&(o=u.map(o,Ye),u.each(o,n=>{t=[...t,...Dt(n)]})),t}function Dt(e){let t=[];const o=u.get(u.first(e),"_parent",null);u.set(u.first(e),"_parent",null);const n=[flatToNestedInstance.convert(We(e))];fe(n,!0);let s=de(n,e[0]._id);return s=u.set(s,"0._parent",o),t=[...t,s,...Ge(s)],t}function Ye(e){const t=u.find(re,{_id:e._id});if(!t)return[];const o=[t],n=u.filter(re,{_parent:e._id});return n.length?u.flatten([...o,...u.flatten(u.map(n,Ye))]):u.flatten(o)}const We=e=>JSON.parse(JSON.stringify(e));let re=[];function Ut(e){re=e;const t=je(We(e));fe(t);const o=de(t,null),n=Ge(o),s={};return u.each(n,r=>u.set(s,u.first(r).blockId,r)),[o,s]}const Rt=()=>{const[e]=ae(),{currentPage:t}=Ne(),[o]=q();return P.useCallback(()=>{const n=u.map(o,r=>u.omit(r,["expanded","order","title","siblings","tempClasses"])),[s=[]]=Ut(n);return{currentPage:t,blocks:s}},[e,t,o])},pe=b.atom(null);pe.debugLabel="chaiBuilderPropsAtom";const He=b.atom({});He.debugLabel="chaiExternalDataAtom";const X=(e,t=void 0)=>{const o=b.useAtomValue(pe);return u.get(o,e,t)},ge=b.atom([]);ge.debugLabel="dataProvidersAtom";const Xe=()=>b.useAtom(ge),ee=b.atom("SAVED");ee.debugLabel="builderSaveStateAtom";const Tt=()=>{const[e,t]=b.useAtom(ee),o=X("onSave",async d=>{}),n=X("onSaveStateChange",u.noop),s=Rt(),[r]=Xe(),[c]=ae();return{savePage:$e.useThrottledCallback(async()=>{t("SAVING"),n("SAVING");const d=s();return await o({blocks:d.blocks,providers:r,brandingOptions:c,themeConfiguration:c}),setTimeout(()=>{t("SAVED"),n("SAVED")},100),!0},[s,t,c,o,n],3e3),saveState:e,setSaveState:t}},G=new Lt;G.setLimit(50);const qe=()=>{const[,e]=b.useAtom(ee),t=X("onSaveStateChange",u.noop);return P.useEffect(()=>(G.setCallback(()=>{e("UNSAVED"),t("UNSAVED")}),()=>{G.setCallback(u.noop)}),[]),{add:G.add,undo:G.undo,redo:G.redo,hasRedo:G.hasRedo,hasUndo:G.hasUndo,clear:G.clear}},me=(e,t)=>{const o=[],n=u.filter(e,s=>u.includes(t,s._id)||u.includes(t,s._parent)?(o.push(s._id),!1):!0);return u.isEmpty(o)?n:me(n,o)},Ft=()=>{const[e]=q(),[t,o]=Fe(),{setNewBlocks:n}=W();return P.useCallback(s=>{var c;const r=((c=u.find(e,{_id:s[0]}))==null?void 0:c._parent)||null;n(me(e,s)),setTimeout(()=>o(r?[r]:[]),200)},[e,o,t])};function Vt(e,t,o,n){let s=e.filter(a=>!a._parent);o&&(s=e.filter(a=>a._parent===o));const r=n!==void 0?n:s.length;let c=e.length;for(let a=0,d=0;a<e.length;a++)if(e[a]._parent===o){if(d===r){c=a;break}d++}return!o&&n!==void 0&&n>=s.length&&(c=e.length),[...e.slice(0,c),...t,...e.slice(c)]}function Nt(e){let t=[];return e.walk(o=>(delete o.model.children,t.push(o.model),!0)),t}function _e(e,t){return e.first(o=>o.model._id===t)||null}function jt(e,t,o,n){const s=_e(e,t),r=_e(e,o);if(s&&r){s.drop(),r.children||(r.model.children=[]);try{r.addChildAtIndex(s,n)}catch(c){return console.error("Error adding child to parent:",c),!1}return!0}return!1}function Gt(e,t,o,n){if(!t)return e;o=o||"root";const r=new Ke().parse({_id:"root",children:je(e)});if(jt(r,t,o,n)){const c=Nt(r),a=c.find(d=>d._id===t);return a&&(a._parent=o==="root"?null:o),c.shift(),c}return e}const Yt=()=>{const[,e]=q();return{setNewBlocks:t=>{e(t)},addBlocks:(t,o,n)=>{e(s=>Vt(s,t,o,n))},removeBlocks:t=>{e(o=>me(o,t))},moveBlocks:(t,o,n)=>{e(s=>{let r=s;for(let c=0;c<t.length;c++)r=Gt(r,t[c],o,n);return r})},updateBlocksProps:t=>{e(o=>{const n=t.map(s=>s._id);return o.map(s=>{if(n.includes(s._id)){const r=u.find(t,{_id:s._id});return{...s,...u.omit(r,"_id")}}return s})})}}},q=()=>b.useAtom(Y),W=()=>{const{add:e}=qe(),[t]=q(),{setNewBlocks:o,addBlocks:n,removeBlocks:s,moveBlocks:r,updateBlocksProps:c}=Yt();return{moveBlocks:(v,E,I)=>{const U=u.map(v,w=>{const D=t.find(R=>R._id===w)._parent||null,N=t.filter(R=>D?R._parent===D:!R._parent).map(R=>R._id).indexOf(w);return{_id:w,oldParent:D,oldPosition:N}}),y=U.find(({_id:w})=>w===v[0]);y&&y.oldParent===E&&y.oldPosition===I||(r(v,E,I),e({undo:()=>u.each(U,({_id:w,oldParent:C,oldPosition:D})=>{r([w],C,D)}),redo:()=>r(v,E,I)}))},addBlocks:(v,E,I)=>{n(v,E,I),e({undo:()=>s(u.map(v,"_id")),redo:()=>n(v,E,I)})},removeBlocks:v=>{var y;const E=(y=u.first(v))==null?void 0:y._parent,U=t.filter(w=>E?w._parent===E:!w._parent).indexOf(u.first(v));s(u.map(v,"_id")),e({undo:()=>n(v,E,U),redo:()=>s(u.map(v,"_id"))})},updateBlocks:(v,E,I)=>{let U=[];if(I)U=u.map(v,y=>({_id:y,...I}));else{const y=u.keys(E);U=u.map(v,w=>{const C=t.find(M=>M._id===w),D={_id:w};return u.each(y,M=>D[M]=C[M]),D})}c(u.map(v,y=>({_id:y,...E}))),e({undo:()=>c(U),redo:()=>c(u.map(v,y=>({_id:y,...E})))})},updateBlocksRuntime:(v,E)=>{c(u.map(v,I=>({_id:I,...E})))},setNewBlocks:v=>{o(v),e({undo:()=>o(t),redo:()=>o(v)})},updateMultipleBlocksProps:v=>{let E=[];E=u.map(v,I=>{const U=u.keys(I),y=t.find(C=>C._id===I._id),w={};return u.each(U,C=>w[C]=y[C]),w}),c(v),e({undo:()=>c(E),redo:()=>c(v)})}}},Wt=()=>{const{updateBlocks:e}=W();return P.useCallback((t,o,n)=>{e(t,o,n)},[e])},Ht=()=>{const{updateMultipleBlocksProps:e}=W();return P.useCallback(t=>{e(t)},[e])},Xt=()=>{const{updateBlocksRuntime:e}=W();return P.useCallback(async(t,o,n=30)=>{const s=u.keys(u.omit(o,["_id"]));for(const r of s){const c=o[r];if(u.isString(c)){const a=u.chunk(c.split(""),12);let d="";e([t],{[r]:""});for(let i=0;i<a.length;i++)d+=a[i].join(""),e([t],{[r]:d}),await new Promise(k=>setTimeout(k,n))}}},[e])},qt=()=>{const{updateMultipleBlocksProps:e}=W(),t=Xt();return P.useCallback(async o=>{for(const n of o)await t(n._id,n);e(o)},[e])},zt=()=>{const{updateBlocksRuntime:e}=W();return P.useCallback((t,o)=>{e(t,o)},[e])},ze=T({}),Jt=T({}),Zt=()=>{const[e,t]=J(ze),o=P.useCallback(s=>u.get(e,s==null?void 0:s.globalBlock,[]),[e]),n=P.useCallback(()=>{t({})},[t]);return{getGlobalBlocks:o,reset:n}},$t=()=>{const[e]=q(),[t,o]=J(ze),[n,s]=J(Jt),r=X("getGlobalBlockBlocks",async a=>[]),c=P.useMemo(()=>e.filter(d=>d._type==="GlobalBlock").filter(d=>d._type==="GlobalBlock").map(d=>d.globalBlock),[e]);P.useEffect(()=>{u.forEach(c,a=>{u.has(t,a)||u.get(n,`${a}.loading`,!1)||(s(d=>({...d,[a]:{loading:!0,error:null}})),r(a).then(d=>{o(i=>({...i,[a]:d})),s(i=>({...i,[a]:{loading:!1,error:null}}))}).catch(d=>{s(i=>({...i,[a]:{loading:!1,error:d.message}}))}))})},[r,t,c,n,o,s])},Kt=T({}),Qt=()=>{const[e,t]=P.useState(!1),[o,n]=J(Kt),s=X("getGlobalBlocks",async()=>[]),r=P.useCallback(async()=>{t(!0);const c=await s();n(c),t(!1)},[s,n]);return P.useEffect(()=>{r()},[]),{data:o,isLoading:e,refetch:r}};exports.MODIFIERS=Ct;exports.atom=T;exports.atomWithDefault=ut;exports.atomWithStorage=we;exports.builderSaveStateAtom=ee;exports.chaiBuilderPropsAtom=pe;exports.chaiExternalDataAtom=He;exports.createStore=Se;exports.dataProvidersAtom=ge;exports.getDuplicatedBlocks=kt;exports.pageBlocksAtomsAtom=Me;exports.presentBlocksAtom=Y;exports.selectedBlockAtom=Q;exports.styleBreakpointAtom=Te;exports.styleStateAtom=Re;exports.treeDSBlocks=Oe;exports.useAtom=J;exports.useAtomValue=ye;exports.useBlocksContainer=Mt;exports.useBlocksStore=q;exports.useBlocksStoreUndoableActions=W;exports.useBrandingOptions=ae;exports.useBuilderProp=X;exports.useCurrentPage=Ne;exports.useGlobalBlocksList=Qt;exports.useGlobalBlocksStore=Zt;exports.usePageDataProviders=Xe;exports.useRemoveBlocks=Ft;exports.useSavePage=Tt;exports.useSelectedBlock=Et;exports.useSelectedBlockHierarchy=yt;exports.useSelectedBlockIds=Fe;exports.useSelectedBlocksDisplayChild=St;exports.useSetAtom=Pe;exports.useStore=le;exports.useStreamMultipleBlocksProps=qt;exports.useUndoManager=qe;exports.useUpdateBlocksProps=Wt;exports.useUpdateBlocksPropsRealtime=zt;exports.useUpdateMultipleBlocksProps=Ht;exports.useWatchGlobalBlocks=$t;