arxatec-ui 0.1.34 → 0.1.36

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.
@@ -0,0 +1,1284 @@
1
+ import { _ as e, d as t, f as n, g as r, l as i, u as a, y as o } from "./sheet-ZTEGzLWO.js";
2
+ import * as s from "react";
3
+ import c, { useEffect as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
4
+ import "@tiptap/core";
5
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
6
+ import { BoldIcon as g, CheckIcon as _, ChevronDown as v, ChevronDownIcon as y, ChevronRightIcon as b, CircleIcon as x, ItalicIcon as S, List as C, ListOrdered as w, UnderlineIcon as ee, XIcon as te } from "lucide-react";
7
+ import * as T from "@radix-ui/react-dialog";
8
+ import * as E from "@radix-ui/react-scroll-area";
9
+ import * as ne from "@radix-ui/react-label";
10
+ import { Slot as re } from "@radix-ui/react-slot";
11
+ import { cva as ie } from "class-variance-authority";
12
+ import * as D from "@radix-ui/react-popover";
13
+ import { Drawer as O } from "vaul";
14
+ import * as k from "@radix-ui/react-dropdown-menu";
15
+ import * as A from "@radix-ui/react-slider";
16
+ import * as j from "@radix-ui/react-tabs";
17
+ import { autoUpdate as ae, flip as oe, limitShift as se, offset as ce, shift as le, useFloating as ue } from "@floating-ui/react";
18
+ import { createPortal as de } from "react-dom";
19
+ import { NodeSelection as fe } from "@tiptap/pm/state";
20
+ import { Color as pe } from "@tiptap/extension-color";
21
+ import me from "@tiptap/extension-highlight";
22
+ import { FontFamily as he, FontSize as ge, TextStyle as _e } from "@tiptap/extension-text-style";
23
+ import ve from "@tiptap/extension-underline";
24
+ import ye from "@tiptap/starter-kit";
25
+ import be from "@tiptap/extension-placeholder";
26
+ //#region src/hooks/use_media_query/index.ts
27
+ function M(e) {
28
+ let [t, n] = f(!1);
29
+ return l(() => {
30
+ let r = window.matchMedia(e);
31
+ r.matches !== t && n(r.matches);
32
+ let i = () => n(r.matches);
33
+ return window.addEventListener("resize", i), () => window.removeEventListener("resize", i);
34
+ }, [t, e]), t;
35
+ }
36
+ //#endregion
37
+ //#region src/components/dialog/index.tsx
38
+ function xe({ ...e }) {
39
+ return /* @__PURE__ */ m(T.Root, {
40
+ "data-slot": "dialog",
41
+ ...e
42
+ });
43
+ }
44
+ function Se({ ...e }) {
45
+ return /* @__PURE__ */ m(T.Trigger, {
46
+ "data-slot": "dialog-trigger",
47
+ ...e
48
+ });
49
+ }
50
+ function N({ ...e }) {
51
+ return /* @__PURE__ */ m(T.Portal, {
52
+ "data-slot": "dialog-portal",
53
+ ...e
54
+ });
55
+ }
56
+ function Ce({ ...e }) {
57
+ return /* @__PURE__ */ m(T.Close, {
58
+ "data-slot": "dialog-close",
59
+ ...e
60
+ });
61
+ }
62
+ function P({ className: e, onContextMenu: t, ...n }) {
63
+ return /* @__PURE__ */ m(T.Overlay, {
64
+ "data-slot": "dialog-overlay",
65
+ className: o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", e),
66
+ onContextMenu: (e) => {
67
+ e.stopPropagation(), t?.(e);
68
+ },
69
+ ...n
70
+ });
71
+ }
72
+ function we({ className: e, children: t, showCloseButton: n = !0, onContextMenu: r, ...i }) {
73
+ return /* @__PURE__ */ h(N, {
74
+ "data-slot": "dialog-portal",
75
+ children: [/* @__PURE__ */ m(P, {}), /* @__PURE__ */ h(T.Content, {
76
+ "data-slot": "dialog-content",
77
+ className: o("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-md border p-4 shadow-lg duration-200 sm:max-w-lg", e),
78
+ onContextMenu: (e) => {
79
+ e.stopPropagation(), r?.(e);
80
+ },
81
+ ...i,
82
+ children: [t, n && /* @__PURE__ */ h(T.Close, {
83
+ "data-slot": "dialog-close",
84
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
85
+ children: [/* @__PURE__ */ m(te, {}), /* @__PURE__ */ m("span", {
86
+ className: "sr-only",
87
+ children: "Close"
88
+ })]
89
+ })]
90
+ })]
91
+ });
92
+ }
93
+ function Te({ className: e, ...t }) {
94
+ return /* @__PURE__ */ m("div", {
95
+ "data-slot": "dialog-header",
96
+ className: o("flex flex-col gap-2 text-center sm:text-left", e),
97
+ ...t
98
+ });
99
+ }
100
+ function Ee({ className: e, ...t }) {
101
+ return /* @__PURE__ */ m("div", {
102
+ "data-slot": "dialog-footer",
103
+ className: o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
104
+ ...t
105
+ });
106
+ }
107
+ function De({ className: e, ...t }) {
108
+ return /* @__PURE__ */ m(T.Title, {
109
+ "data-slot": "dialog-title",
110
+ className: o("text-base font-normal text-primary leading-none", e),
111
+ ...t
112
+ });
113
+ }
114
+ function Oe({ className: e, ...t }) {
115
+ return /* @__PURE__ */ m(T.Description, {
116
+ "data-slot": "dialog-description",
117
+ className: o("text-muted-foreground text-sm", e),
118
+ ...t
119
+ });
120
+ }
121
+ //#endregion
122
+ //#region src/components/scroll_area/index.tsx
123
+ function F({ className: e, children: t, viewportRef: n, ...r }) {
124
+ let i = s.useRef(null);
125
+ return s.useLayoutEffect(() => {
126
+ if (!n || !i.current) return;
127
+ let e = i.current.closest("[data-slot=\"scroll-area-viewport\"]");
128
+ return typeof n == "function" ? (n(e), () => {
129
+ n(null);
130
+ }) : (n.current = e, () => {
131
+ n.current = null;
132
+ });
133
+ }, [n]), /* @__PURE__ */ h(E.Root, {
134
+ "data-slot": "scroll-area",
135
+ className: o("relative", e),
136
+ ...r,
137
+ children: [
138
+ /* @__PURE__ */ h(E.Viewport, {
139
+ "data-slot": "scroll-area-viewport",
140
+ className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
141
+ children: [/* @__PURE__ */ m("div", {
142
+ ref: i,
143
+ "aria-hidden": !0,
144
+ style: { display: "none" }
145
+ }), t]
146
+ }),
147
+ /* @__PURE__ */ m(I, {}),
148
+ /* @__PURE__ */ m(E.Corner, {})
149
+ ]
150
+ });
151
+ }
152
+ function I({ className: e, orientation: t = "vertical", ...n }) {
153
+ return /* @__PURE__ */ m(E.ScrollAreaScrollbar, {
154
+ "data-slot": "scroll-area-scrollbar",
155
+ orientation: t,
156
+ className: o("flex touch-none p-px transition-colors select-none", t === "vertical" && "h-full w-2.5 border-l border-l-transparent", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", e),
157
+ ...n,
158
+ children: /* @__PURE__ */ m(E.ScrollAreaThumb, {
159
+ "data-slot": "scroll-area-thumb",
160
+ className: "bg-border relative flex-1 rounded-sm"
161
+ })
162
+ });
163
+ }
164
+ //#endregion
165
+ //#region src/components/label/index.tsx
166
+ function ke({ className: e, ...t }) {
167
+ return /* @__PURE__ */ m(ne.Root, {
168
+ "data-slot": "label",
169
+ className: o("flex items-center gap-2 text-sm leading-none font-normal select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", e),
170
+ ...t
171
+ });
172
+ }
173
+ //#endregion
174
+ //#region src/components/badge/index.tsx
175
+ var L = ie("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
176
+ variants: { variant: {
177
+ default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
178
+ secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
179
+ destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
180
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
181
+ } },
182
+ defaultVariants: { variant: "default" }
183
+ });
184
+ function Ae({ className: e, variant: t, asChild: n = !1, ...r }) {
185
+ return /* @__PURE__ */ m(n ? re : "span", {
186
+ "data-slot": "badge",
187
+ className: o(L({ variant: t }), e),
188
+ ...r
189
+ });
190
+ }
191
+ //#endregion
192
+ //#region src/components/popover/index.tsx
193
+ function R({ ...e }) {
194
+ return /* @__PURE__ */ m(D.Root, {
195
+ "data-slot": "popover",
196
+ ...e
197
+ });
198
+ }
199
+ function z({ ...e }) {
200
+ return /* @__PURE__ */ m(D.Trigger, {
201
+ "data-slot": "popover-trigger",
202
+ ...e
203
+ });
204
+ }
205
+ function B({ className: e, align: t = "center", sideOffset: n = 4, ...r }) {
206
+ return /* @__PURE__ */ m(D.Portal, { children: /* @__PURE__ */ m(D.Content, {
207
+ "data-slot": "popover-content",
208
+ align: t,
209
+ sideOffset: n,
210
+ className: o("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", e),
211
+ ...r
212
+ }) });
213
+ }
214
+ function je({ ...e }) {
215
+ return /* @__PURE__ */ m(D.Anchor, {
216
+ "data-slot": "popover-anchor",
217
+ ...e
218
+ });
219
+ }
220
+ //#endregion
221
+ //#region src/components/drawer/index.tsx
222
+ function Me({ ...e }) {
223
+ return /* @__PURE__ */ m(O.Root, {
224
+ "data-slot": "drawer",
225
+ ...e
226
+ });
227
+ }
228
+ function Ne({ ...e }) {
229
+ return /* @__PURE__ */ m(O.Trigger, {
230
+ "data-slot": "drawer-trigger",
231
+ ...e
232
+ });
233
+ }
234
+ function Pe({ ...e }) {
235
+ return /* @__PURE__ */ m(O.Portal, {
236
+ "data-slot": "drawer-portal",
237
+ ...e
238
+ });
239
+ }
240
+ function Fe({ ...e }) {
241
+ return /* @__PURE__ */ m(O.Close, {
242
+ "data-slot": "drawer-close",
243
+ ...e
244
+ });
245
+ }
246
+ function Ie({ className: e, ...t }) {
247
+ return /* @__PURE__ */ m(O.Overlay, {
248
+ "data-slot": "drawer-overlay",
249
+ className: o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", e),
250
+ ...t
251
+ });
252
+ }
253
+ function Le({ className: e, children: t, ...n }) {
254
+ return /* @__PURE__ */ h(Pe, {
255
+ "data-slot": "drawer-portal",
256
+ children: [/* @__PURE__ */ m(Ie, {}), /* @__PURE__ */ h(O.Content, {
257
+ "data-slot": "drawer-content",
258
+ className: o("group/drawer-content bg-background fixed z-50 flex h-auto flex-col", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", e),
259
+ ...n,
260
+ children: [/* @__PURE__ */ m("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), t]
261
+ })]
262
+ });
263
+ }
264
+ function Re({ className: e, ...t }) {
265
+ return /* @__PURE__ */ m("div", {
266
+ "data-slot": "drawer-header",
267
+ className: o("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", e),
268
+ ...t
269
+ });
270
+ }
271
+ function ze({ className: e, ...t }) {
272
+ return /* @__PURE__ */ m("div", {
273
+ "data-slot": "drawer-footer",
274
+ className: o("mt-auto flex flex-col gap-2 p-4", e),
275
+ ...t
276
+ });
277
+ }
278
+ function Be({ className: e, ...t }) {
279
+ return /* @__PURE__ */ m(O.Title, {
280
+ "data-slot": "drawer-title",
281
+ className: o("text-foreground font-semibold", e),
282
+ ...t
283
+ });
284
+ }
285
+ function Ve({ className: e, ...t }) {
286
+ return /* @__PURE__ */ m(O.Description, {
287
+ "data-slot": "drawer-description",
288
+ className: o("text-muted-foreground text-sm", e),
289
+ ...t
290
+ });
291
+ }
292
+ //#endregion
293
+ //#region src/components/dropdown_menu/index.tsx
294
+ var He = ie("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive! [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center rounded-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
295
+ variants: { size: {
296
+ default: "gap-2 px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4",
297
+ sm: "gap-1.5 px-1.5 py-1 text-sm [&_svg:not([class*='size-'])]:size-3.5"
298
+ } },
299
+ defaultVariants: { size: "default" }
300
+ });
301
+ function Ue({ ...e }) {
302
+ return /* @__PURE__ */ m(k.Root, {
303
+ "data-slot": "dropdown-menu",
304
+ ...e
305
+ });
306
+ }
307
+ function We({ ...e }) {
308
+ return /* @__PURE__ */ m(k.Portal, {
309
+ "data-slot": "dropdown-menu-portal",
310
+ ...e
311
+ });
312
+ }
313
+ function Ge({ ...e }) {
314
+ return /* @__PURE__ */ m(k.Trigger, {
315
+ "data-slot": "dropdown-menu-trigger",
316
+ ...e
317
+ });
318
+ }
319
+ function Ke({ className: e, sideOffset: t = 4, ...n }) {
320
+ return /* @__PURE__ */ m(k.Portal, { children: /* @__PURE__ */ m(k.Content, {
321
+ "data-slot": "dropdown-menu-content",
322
+ sideOffset: t,
323
+ className: o("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", e),
324
+ ...n
325
+ }) });
326
+ }
327
+ function qe({ ...e }) {
328
+ return /* @__PURE__ */ m(k.Group, {
329
+ "data-slot": "dropdown-menu-group",
330
+ ...e
331
+ });
332
+ }
333
+ function V({ className: e, inset: t, variant: n = "default", size: r = "default", ...i }) {
334
+ return /* @__PURE__ */ m(k.Item, {
335
+ "data-slot": "dropdown-menu-item",
336
+ "data-inset": t,
337
+ "data-variant": n,
338
+ "data-size": r,
339
+ className: o(He({ size: r }), e),
340
+ ...i
341
+ });
342
+ }
343
+ function Je({ className: e, children: t, checked: n, ...r }) {
344
+ return /* @__PURE__ */ h(k.CheckboxItem, {
345
+ "data-slot": "dropdown-menu-checkbox-item",
346
+ className: o("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", e),
347
+ checked: n,
348
+ ...r,
349
+ children: [/* @__PURE__ */ m("span", {
350
+ className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
351
+ children: /* @__PURE__ */ m(k.ItemIndicator, { children: /* @__PURE__ */ m(_, { className: "size-4" }) })
352
+ }), t]
353
+ });
354
+ }
355
+ function Ye({ ...e }) {
356
+ return /* @__PURE__ */ m(k.RadioGroup, {
357
+ "data-slot": "dropdown-menu-radio-group",
358
+ ...e
359
+ });
360
+ }
361
+ function Xe({ className: e, children: t, ...n }) {
362
+ return /* @__PURE__ */ h(k.RadioItem, {
363
+ "data-slot": "dropdown-menu-radio-item",
364
+ className: o("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", e),
365
+ ...n,
366
+ children: [/* @__PURE__ */ m("span", {
367
+ className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
368
+ children: /* @__PURE__ */ m(k.ItemIndicator, { children: /* @__PURE__ */ m(x, { className: "size-2 fill-current" }) })
369
+ }), t]
370
+ });
371
+ }
372
+ function Ze({ className: e, inset: t, ...n }) {
373
+ return /* @__PURE__ */ m(k.Label, {
374
+ "data-slot": "dropdown-menu-label",
375
+ "data-inset": t,
376
+ className: o("px-2 py-1.5 text-sm font-normal data-inset:pl-8", e),
377
+ ...n
378
+ });
379
+ }
380
+ function Qe({ className: e, ...t }) {
381
+ return /* @__PURE__ */ m(k.Separator, {
382
+ "data-slot": "dropdown-menu-separator",
383
+ className: o("bg-border -mx-1 my-1 h-px", e),
384
+ ...t
385
+ });
386
+ }
387
+ function $e({ className: e, ...t }) {
388
+ return /* @__PURE__ */ m("span", {
389
+ "data-slot": "dropdown-menu-shortcut",
390
+ className: o("text-muted-foreground ml-auto text-xs tracking-widest", e),
391
+ ...t
392
+ });
393
+ }
394
+ function et({ ...e }) {
395
+ return /* @__PURE__ */ m(k.Sub, {
396
+ "data-slot": "dropdown-menu-sub",
397
+ ...e
398
+ });
399
+ }
400
+ function tt({ className: e, inset: t, children: n, ...r }) {
401
+ return /* @__PURE__ */ h(k.SubTrigger, {
402
+ "data-slot": "dropdown-menu-sub-trigger",
403
+ "data-inset": t,
404
+ className: o("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-inset:pl-8", e),
405
+ ...r,
406
+ children: [n, /* @__PURE__ */ m(b, { className: "ml-auto size-4" })]
407
+ });
408
+ }
409
+ function nt({ className: e, ...t }) {
410
+ return /* @__PURE__ */ m(k.SubContent, {
411
+ "data-slot": "dropdown-menu-sub-content",
412
+ className: o("bg-popover text-popover-foreground 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 z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", e),
413
+ ...t
414
+ });
415
+ }
416
+ //#endregion
417
+ //#region src/components/slider/index.tsx
418
+ function rt({ className: e, defaultValue: t, value: n, min: r = 0, max: i = 100, ...a }) {
419
+ let c = s.useMemo(() => Array.isArray(n) ? n : Array.isArray(t) ? t : [r, i], [
420
+ n,
421
+ t,
422
+ r,
423
+ i
424
+ ]);
425
+ return /* @__PURE__ */ h(A.Root, {
426
+ "data-slot": "slider",
427
+ defaultValue: t,
428
+ value: n,
429
+ min: r,
430
+ max: i,
431
+ className: o("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", e),
432
+ ...a,
433
+ children: [/* @__PURE__ */ m(A.Track, {
434
+ "data-slot": "slider-track",
435
+ className: o("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),
436
+ children: /* @__PURE__ */ m(A.Range, {
437
+ "data-slot": "slider-range",
438
+ className: o("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")
439
+ })
440
+ }), Array.from({ length: c.length }, (e, t) => /* @__PURE__ */ m(A.Thumb, {
441
+ "data-slot": "slider-thumb",
442
+ className: "border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
443
+ }, t))]
444
+ });
445
+ }
446
+ //#endregion
447
+ //#region src/components/status_message/index.tsx
448
+ var H = {
449
+ rose: {
450
+ background: "bg-status-card-background-error",
451
+ backgroundCardIcon: "bg-status-card-background-icon-error",
452
+ textPrimary: "text-status-card-foreground-error",
453
+ textSecondary: "text-status-card-foreground-error opacity-60"
454
+ },
455
+ white: {
456
+ background: "bg-status-card-background-empty",
457
+ backgroundCardIcon: "bg-status-card-background-icon-empty",
458
+ textPrimary: "text-status-card-foreground-empty",
459
+ textSecondary: "text-status-card-foreground-emtpy opacity-60"
460
+ }
461
+ }, it = ({ title: e, description: t, color: n = "rose", icon: r, size: i = "md", classNameCard: a, classNameDescription: s, classNameIconCard: c, classNameTitle: l }) => /* @__PURE__ */ h("div", {
462
+ className: o(" rounded-md flex items-center flex-wrap", i === "sm" ? "p-4 gap-2" : "p-6 gap-4", a, H[n].background),
463
+ children: [r && /* @__PURE__ */ m("div", {
464
+ className: o("rounded-md flex items-center justify-center ", i === "sm" ? "size-8" : "size-12", c, H[n].backgroundCardIcon),
465
+ children: /* @__PURE__ */ m(r, { className: o(H[n].textPrimary, i === "sm" ? "size-4" : "size-6") })
466
+ }), /* @__PURE__ */ h("div", {
467
+ className: o("flex flex-col"),
468
+ children: [/* @__PURE__ */ m("h2", {
469
+ className: o("font-normal", i === "sm" ? "text-sm" : "text-base", H[n].textPrimary, l),
470
+ children: e
471
+ }), /* @__PURE__ */ m("p", {
472
+ className: o(i === "sm" ? "text-sm" : "text-sm max-w-md", H[n].textSecondary, s),
473
+ children: t
474
+ })]
475
+ })]
476
+ });
477
+ //#endregion
478
+ //#region src/components/tabs/index.tsx
479
+ function at({ className: e, ...t }) {
480
+ return /* @__PURE__ */ m(j.Root, {
481
+ "data-slot": "tabs",
482
+ className: o("flex flex-col gap-2", e),
483
+ ...t
484
+ });
485
+ }
486
+ function ot({ className: e, ...t }) {
487
+ return /* @__PURE__ */ m(j.List, {
488
+ "data-slot": "tabs-list",
489
+ className: o("bg-muted text-muted-foreground inline-flex h-8 w-fit items-center justify-center rounded-md p-[3px]", e),
490
+ ...t
491
+ });
492
+ }
493
+ function st({ className: e, ...t }) {
494
+ return /* @__PURE__ */ m(j.Trigger, {
495
+ "data-slot": "tabs-trigger",
496
+ className: o("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", e),
497
+ ...t
498
+ });
499
+ }
500
+ function ct({ className: e, ...t }) {
501
+ return /* @__PURE__ */ m(j.Content, {
502
+ "data-slot": "tabs-content",
503
+ className: o("flex-1 outline-none", e),
504
+ ...t
505
+ });
506
+ }
507
+ //#endregion
508
+ //#region src/components/text_area/index.tsx
509
+ function lt({ className: e, ...t }) {
510
+ return /* @__PURE__ */ m("textarea", {
511
+ "data-slot": "textarea",
512
+ className: o("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-card px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", e),
513
+ ...t
514
+ });
515
+ }
516
+ //#endregion
517
+ //#region src/components/rich_text_editor/lib/tiptap-utils.ts
518
+ var ut = (e) => {
519
+ try {
520
+ let t = window.getSelection(), { view: n, state: r } = e;
521
+ if (!t || t.rangeCount === 0) {
522
+ let { from: e } = r.selection, t = n.coordsAtPos(e);
523
+ return new DOMRect(t.left, t.top, 0, t.bottom - t.top);
524
+ }
525
+ let i = t.getRangeAt(0);
526
+ if (!n.dom.contains(i.commonAncestorContainer)) {
527
+ let { from: e } = r.selection, t = n.coordsAtPos(e);
528
+ return new DOMRect(t.left, t.top, 0, t.bottom - t.top);
529
+ }
530
+ let a = i.getBoundingClientRect();
531
+ if (a.width === 0 && a.height === 0) {
532
+ let { from: e } = r.selection, t = n.coordsAtPos(e);
533
+ return new DOMRect(t.left, t.top, 0, t.bottom - t.top);
534
+ }
535
+ return a;
536
+ } catch {
537
+ return null;
538
+ }
539
+ }, dt = (e, t, n = ["imageUpload", "horizontalRule"]) => {
540
+ let r = t || e.state.selection;
541
+ if (!r || r.empty || r instanceof fe) return !1;
542
+ let { $from: i, $to: a } = r, o = [];
543
+ return e.state.doc.nodesBetween(i.pos, a.pos, (e) => {
544
+ o.push(e.type.name);
545
+ }), !(o.some((e) => n.includes(e)) || o.includes("codeBlock"));
546
+ }, ft = ({ editor: e, shouldShow: t, floatingOptions: n = {}, zIndex: r = 50, onOpenChange: i, referenceElement: a, getBoundingClientRect: o = ut, closeOnEscape: c = !0, children: l, style: u, className: d }) => {
547
+ let [f, p] = s.useState(!1), { refs: h, floatingStyles: g, update: _ } = ue({
548
+ open: t ?? f,
549
+ onOpenChange: (e) => {
550
+ p(e), i?.(e);
551
+ },
552
+ strategy: "fixed",
553
+ middleware: [
554
+ ce(10),
555
+ oe({ fallbackAxisSideDirection: "end" }),
556
+ le({ limiter: se() }),
557
+ ...n.middleware || []
558
+ ],
559
+ whileElementsMounted: ae,
560
+ ...n
561
+ });
562
+ return s.useEffect(() => {
563
+ if (!e || !(t ?? f)) return;
564
+ let n = () => {
565
+ if (a) {
566
+ h.setReference(a);
567
+ return;
568
+ }
569
+ let t = o(e);
570
+ t && h.setReference({ getBoundingClientRect: () => t });
571
+ };
572
+ return n(), e.on("selectionUpdate", n), e.on("transaction", n), e.on("focus", n), e.on("blur", n), window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), () => {
573
+ e.off("selectionUpdate", n), e.off("transaction", n), e.off("focus", n), e.off("blur", n), window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
574
+ };
575
+ }, [
576
+ e,
577
+ a,
578
+ h,
579
+ o,
580
+ t,
581
+ f
582
+ ]), s.useEffect(() => {
583
+ (t ?? f) && _();
584
+ }, [
585
+ t,
586
+ f,
587
+ _
588
+ ]), s.useEffect(() => {
589
+ if (c && (t ?? f)) {
590
+ let e = (e) => {
591
+ e.key === "Escape" && (p(!1), i?.(!1));
592
+ };
593
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
594
+ }
595
+ }, [
596
+ c,
597
+ f,
598
+ t,
599
+ i
600
+ ]), !(t ?? f) || !e ? null : de(/* @__PURE__ */ m("div", {
601
+ ref: h.setFloating,
602
+ className: d,
603
+ style: {
604
+ ...g,
605
+ zIndex: r,
606
+ pointerEvents: "none",
607
+ ...u
608
+ },
609
+ children: /* @__PURE__ */ m("div", {
610
+ style: { pointerEvents: "auto" },
611
+ children: l
612
+ })
613
+ }), document.body);
614
+ }, U = ({ label: t, children: n, className: r }) => {
615
+ let [i, a] = f(!1), s = () => a(!1);
616
+ return /* @__PURE__ */ h(Me, {
617
+ open: i,
618
+ onOpenChange: a,
619
+ children: [/* @__PURE__ */ m(Ne, {
620
+ asChild: !0,
621
+ children: /* @__PURE__ */ h(e, {
622
+ variant: "ghost",
623
+ size: "sm",
624
+ className: o("h-8 w-max gap-1 px-3 font-normal", r),
625
+ children: [t, /* @__PURE__ */ m(v, { className: "h-4 w-4" })]
626
+ })
627
+ }), /* @__PURE__ */ h(Le, { children: [/* @__PURE__ */ m(Re, { children: /* @__PURE__ */ m(Be, {
628
+ className: "text-start",
629
+ children: t
630
+ }) }), /* @__PURE__ */ m("div", {
631
+ className: "flex flex-col p-4",
632
+ children: c.Children.map(n, (e) => c.isValidElement(e) ? c.cloneElement(e, { closeDrawer: s }) : e)
633
+ })] })]
634
+ });
635
+ }, W = ({ children: e, active: t, onClick: n, closeDrawer: r, ...i }) => /* @__PURE__ */ m("button", {
636
+ className: o("flex w-full items-center rounded-md px-4 py-2 text-sm transition-colors hover:bg-accent", t && "bg-accent"),
637
+ onClick: (e) => {
638
+ n?.(e), setTimeout(() => {
639
+ r?.();
640
+ }, 100);
641
+ },
642
+ ...i,
643
+ children: e
644
+ }), pt = c.createContext(null), G = () => {
645
+ let e = c.useContext(pt);
646
+ if (!e) throw Error("useToolbar must be used within a ToolbarProvider");
647
+ return e;
648
+ }, K = ({ editor: e, children: t }) => {
649
+ let [, n] = c.useReducer((e) => e + 1, 0);
650
+ return c.useEffect(() => {
651
+ if (!e) return;
652
+ let t = () => n();
653
+ return e.on("transaction", t), () => {
654
+ e.off("transaction", t);
655
+ };
656
+ }, [e]), /* @__PURE__ */ m(pt.Provider, {
657
+ value: { editor: e },
658
+ children: t
659
+ });
660
+ }, mt = c.forwardRef(({ className: t, onClick: r, children: s, ...c }, l) => {
661
+ let { editor: u } = G();
662
+ return /* @__PURE__ */ h(i, { children: [/* @__PURE__ */ m(n, {
663
+ asChild: !0,
664
+ children: /* @__PURE__ */ m(e, {
665
+ variant: "ghost",
666
+ size: "icon",
667
+ className: o("size-7", u?.isActive("bold") && "bg-accent", t),
668
+ onClick: (e) => {
669
+ u?.chain().focus().toggleBold().run(), r?.(e);
670
+ },
671
+ disabled: !u?.can().toggleBold(),
672
+ ref: l,
673
+ ...c,
674
+ children: s ?? /* @__PURE__ */ m(g, { className: "h-4 w-4" })
675
+ })
676
+ }), /* @__PURE__ */ h(a, { children: [/* @__PURE__ */ m("span", { children: "Negrita" }), /* @__PURE__ */ m("span", {
677
+ className: "ml-1 text-xs text-gray-11",
678
+ children: "(cmd + b)"
679
+ })] })] });
680
+ });
681
+ mt.displayName = "BoldToolbar";
682
+ //#endregion
683
+ //#region src/components/rich_text_editor/toolbars/bullet_list/index.tsx
684
+ var q = c.forwardRef(({ className: t, onClick: r, children: s, ...c }, l) => {
685
+ let { editor: u } = G();
686
+ return /* @__PURE__ */ h(i, { children: [/* @__PURE__ */ m(n, {
687
+ asChild: !0,
688
+ children: /* @__PURE__ */ m(e, {
689
+ variant: "ghost",
690
+ size: "icon",
691
+ className: o("size-7", u?.isActive("bulletList") && "bg-accent", t),
692
+ onClick: (e) => {
693
+ e.preventDefault(), u?.chain().focus().toggleBulletList().run(), r?.(e);
694
+ },
695
+ ref: l,
696
+ ...c,
697
+ children: s ?? /* @__PURE__ */ m(C, { className: "h-4 w-4" })
698
+ })
699
+ }), /* @__PURE__ */ m(a, { children: /* @__PURE__ */ m("span", { children: "Lista de viñetas" }) })] });
700
+ });
701
+ q.displayName = "BulletListToolbar";
702
+ //#endregion
703
+ //#region src/components/rich_text_editor/toolbars/color_and_highlight/index.tsx
704
+ var ht = [
705
+ {
706
+ name: "Predeterminado",
707
+ color: "var(--editor-text-default)"
708
+ },
709
+ {
710
+ name: "Gris",
711
+ color: "var(--editor-text-gray)"
712
+ },
713
+ {
714
+ name: "Marrón",
715
+ color: "var(--editor-text-brown)"
716
+ },
717
+ {
718
+ name: "Naranja",
719
+ color: "var(--editor-text-orange)"
720
+ },
721
+ {
722
+ name: "Amarillo",
723
+ color: "var(--editor-text-yellow)"
724
+ },
725
+ {
726
+ name: "Verde",
727
+ color: "var(--editor-text-green)"
728
+ },
729
+ {
730
+ name: "Azul",
731
+ color: "var(--editor-text-blue)"
732
+ },
733
+ {
734
+ name: "Púrpura",
735
+ color: "var(--editor-text-purple)"
736
+ },
737
+ {
738
+ name: "Rosa",
739
+ color: "var(--editor-text-pink)"
740
+ },
741
+ {
742
+ name: "Rojo",
743
+ color: "var(--editor-text-red)"
744
+ }
745
+ ], gt = [
746
+ {
747
+ name: "Predeterminado",
748
+ color: "var(--editor-highlight-default)"
749
+ },
750
+ {
751
+ name: "Gris",
752
+ color: "var(--editor-highlight-gray)"
753
+ },
754
+ {
755
+ name: "Marrón",
756
+ color: "var(--editor-highlight-brown)"
757
+ },
758
+ {
759
+ name: "Naranja",
760
+ color: "var(--editor-highlight-orange)"
761
+ },
762
+ {
763
+ name: "Amarillo",
764
+ color: "var(--editor-highlight-yellow)"
765
+ },
766
+ {
767
+ name: "Verde",
768
+ color: "var(--editor-highlight-green)"
769
+ },
770
+ {
771
+ name: "Azul",
772
+ color: "var(--editor-highlight-blue)"
773
+ },
774
+ {
775
+ name: "Púrpura",
776
+ color: "var(--editor-highlight-purple)"
777
+ },
778
+ {
779
+ name: "Rosa",
780
+ color: "var(--editor-highlight-pink)"
781
+ },
782
+ {
783
+ name: "Rojo",
784
+ color: "var(--editor-highlight-red)"
785
+ }
786
+ ], _t = ({ name: e, color: t, isActive: n, onClick: r, isHighlight: i }) => /* @__PURE__ */ h("button", {
787
+ onClick: r,
788
+ className: "flex w-full items-center justify-between rounded-sm px-2 py-1 text-sm hover:bg-muted cursor-pointer",
789
+ type: "button",
790
+ children: [/* @__PURE__ */ h("div", {
791
+ className: "flex items-center space-x-2 ",
792
+ children: [/* @__PURE__ */ m("div", {
793
+ className: "rounded-sm border size-5 font-medium",
794
+ style: i ? { backgroundColor: t } : { color: t },
795
+ children: "A"
796
+ }), /* @__PURE__ */ m("span", { children: e })]
797
+ }), n && /* @__PURE__ */ m(_, { className: "h-4 w-4" })]
798
+ }), J = () => {
799
+ let { editor: t } = G(), s = M("(max-width: 640px)"), c = t?.getAttributes("textStyle").color, l = t?.getAttributes("highlight").color, u = (e) => {
800
+ t?.chain().focus().setColor(e === c ? "" : e).run();
801
+ }, d = (e) => {
802
+ t?.chain().focus().setHighlight(e === l ? { color: "" } : { color: e }).run();
803
+ }, f = !t?.can().chain().setHighlight().run() || !t?.can().chain().setColor("").run();
804
+ return s ? /* @__PURE__ */ h("div", {
805
+ className: "flex gap-1",
806
+ children: [/* @__PURE__ */ m(U, {
807
+ label: "Color",
808
+ children: ht.map(({ name: e, color: t }) => /* @__PURE__ */ m(W, {
809
+ onClick: () => u(t),
810
+ active: c === t,
811
+ children: /* @__PURE__ */ h("div", {
812
+ className: "flex items-center gap-2",
813
+ children: [/* @__PURE__ */ m("div", {
814
+ className: "rounded-sm border px-2",
815
+ style: { color: t },
816
+ children: "A"
817
+ }), /* @__PURE__ */ m("span", { children: e })]
818
+ })
819
+ }, e))
820
+ }), /* @__PURE__ */ m(U, {
821
+ label: "Resaltado",
822
+ children: gt.map(({ name: e, color: t }) => /* @__PURE__ */ m(W, {
823
+ onClick: () => d(t),
824
+ active: l === t,
825
+ children: /* @__PURE__ */ h("div", {
826
+ className: "flex items-center gap-2",
827
+ children: [/* @__PURE__ */ m("div", {
828
+ className: "rounded-sm border px-2",
829
+ style: { backgroundColor: t },
830
+ children: "A"
831
+ }), /* @__PURE__ */ m("span", { children: e })]
832
+ })
833
+ }, e))
834
+ })]
835
+ }) : /* @__PURE__ */ m(R, { children: /* @__PURE__ */ h("div", {
836
+ className: "relative h-full",
837
+ children: [/* @__PURE__ */ h(i, { children: [/* @__PURE__ */ m(n, {
838
+ asChild: !0,
839
+ children: /* @__PURE__ */ m(z, {
840
+ disabled: f,
841
+ asChild: !0,
842
+ children: /* @__PURE__ */ h(e, {
843
+ variant: "ghost",
844
+ size: "sm",
845
+ style: { color: c },
846
+ className: o("h-8 w-14 p-0 font-normal"),
847
+ children: [/* @__PURE__ */ m("span", {
848
+ className: "text-md",
849
+ children: "A"
850
+ }), /* @__PURE__ */ m(y, { className: "ml-2 h-4 w-4" })]
851
+ })
852
+ })
853
+ }), /* @__PURE__ */ m(a, { children: "Color de Texto y Resaltado" })] }), /* @__PURE__ */ m(B, {
854
+ align: "start",
855
+ className: "w-56 p-0! dark:bg-gray-2",
856
+ onWheel: (e) => e.stopPropagation(),
857
+ onTouchMove: (e) => e.stopPropagation(),
858
+ children: /* @__PURE__ */ h(F, {
859
+ className: "h-80 pb-2",
860
+ children: [
861
+ /* @__PURE__ */ m("div", {
862
+ className: "mb-1 mt-2 px-2 text-xs text-muted-foreground uppercase",
863
+ children: "Color"
864
+ }),
865
+ /* @__PURE__ */ m("div", {
866
+ className: "px-2",
867
+ children: ht.map(({ name: e, color: t }) => /* @__PURE__ */ m(_t, {
868
+ name: e,
869
+ color: t,
870
+ isActive: c === t,
871
+ onClick: () => u(t)
872
+ }, e))
873
+ }),
874
+ /* @__PURE__ */ m(r, { className: "my-3" }),
875
+ /* @__PURE__ */ m("div", {
876
+ className: "mb-1 w-full px-2 text-xs text-muted-foreground uppercase",
877
+ children: "Fondo (Resaltado)"
878
+ }),
879
+ /* @__PURE__ */ m("div", {
880
+ className: "px-2",
881
+ children: gt.map(({ name: e, color: t }) => /* @__PURE__ */ m(_t, {
882
+ name: e,
883
+ color: t,
884
+ isActive: l === t,
885
+ onClick: () => d(t),
886
+ isHighlight: !0
887
+ }, e))
888
+ })
889
+ ]
890
+ })
891
+ })]
892
+ }) });
893
+ }, Y = [
894
+ {
895
+ name: "Predeterminado",
896
+ value: ""
897
+ },
898
+ {
899
+ name: "Arial",
900
+ value: "Arial, sans-serif"
901
+ },
902
+ {
903
+ name: "Helvetica",
904
+ value: "Helvetica, Arial, sans-serif"
905
+ },
906
+ {
907
+ name: "Times New Roman",
908
+ value: "Times New Roman, Times, serif"
909
+ },
910
+ {
911
+ name: "Courier New",
912
+ value: "Courier New, Courier, monospace"
913
+ },
914
+ {
915
+ name: "Georgia",
916
+ value: "Georgia, serif"
917
+ },
918
+ {
919
+ name: "Verdana",
920
+ value: "Verdana, Geneva, sans-serif"
921
+ }
922
+ ], vt = () => {
923
+ let { editor: t } = G(), r = M("(max-width: 640px)"), s = t?.getAttributes("textStyle").fontFamily ?? "", c = Y.find((e) => e.value === s)?.name ?? "Fuente";
924
+ return r ? /* @__PURE__ */ m(U, {
925
+ label: c,
926
+ children: Y.map(({ name: e, value: n }) => /* @__PURE__ */ m(W, {
927
+ onClick: () => {
928
+ n ? t?.chain().focus().setFontFamily(n).run() : t?.chain().focus().unsetFontFamily().run();
929
+ },
930
+ active: s === n,
931
+ children: /* @__PURE__ */ m("span", {
932
+ style: n ? { fontFamily: n } : void 0,
933
+ children: e
934
+ })
935
+ }, e))
936
+ }) : /* @__PURE__ */ m(R, { children: /* @__PURE__ */ h("div", {
937
+ className: "relative h-full",
938
+ children: [/* @__PURE__ */ h(i, { children: [/* @__PURE__ */ m(n, {
939
+ asChild: !0,
940
+ children: /* @__PURE__ */ m(z, {
941
+ asChild: !0,
942
+ children: /* @__PURE__ */ h(e, {
943
+ type: "button",
944
+ variant: "ghost",
945
+ size: "sm",
946
+ className: o("h-8 max-w-36 gap-1 px-2 font-normal"),
947
+ children: [/* @__PURE__ */ m("span", {
948
+ className: "truncate text-xs",
949
+ children: c
950
+ }), /* @__PURE__ */ m(y, { className: "h-4 w-4 shrink-0 opacity-50" })]
951
+ })
952
+ })
953
+ }), /* @__PURE__ */ m(a, { children: "Fuente" })] }), /* @__PURE__ */ m(B, {
954
+ align: "start",
955
+ className: "w-56 p-1",
956
+ onWheel: (e) => e.stopPropagation(),
957
+ onTouchMove: (e) => e.stopPropagation(),
958
+ children: /* @__PURE__ */ h(F, {
959
+ className: "max-h-72 pr-2",
960
+ children: [/* @__PURE__ */ m("div", {
961
+ className: "mb-2 mt-2 px-2 text-xs text-muted-foreground",
962
+ children: "Fuente"
963
+ }), Y.map(({ name: e, value: n }) => /* @__PURE__ */ h("button", {
964
+ type: "button",
965
+ onClick: () => {
966
+ n ? t?.chain().focus().setFontFamily(n).run() : t?.chain().focus().unsetFontFamily().run();
967
+ },
968
+ className: o("flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm hover:bg-accent", s === n && "bg-accent"),
969
+ children: [/* @__PURE__ */ m("span", {
970
+ style: n ? { fontFamily: n } : void 0,
971
+ children: e
972
+ }), s === n ? /* @__PURE__ */ m(_, { className: "h-4 w-4 shrink-0" }) : null]
973
+ }, e))]
974
+ })
975
+ })]
976
+ }) });
977
+ }, yt = [
978
+ "10px",
979
+ "11px",
980
+ "12px",
981
+ "14px",
982
+ "16px",
983
+ "18px",
984
+ "20px",
985
+ "22px",
986
+ "24px",
987
+ "28px",
988
+ "32px",
989
+ "36px",
990
+ "40px",
991
+ "48px",
992
+ "56px",
993
+ "64px",
994
+ "72px"
995
+ ], bt = () => {
996
+ let { editor: t } = G(), r = M("(max-width: 640px)"), s = t?.getAttributes("textStyle").fontSize ?? "";
997
+ return r ? /* @__PURE__ */ h(U, {
998
+ label: s || "Tamaño",
999
+ children: [/* @__PURE__ */ m(W, {
1000
+ onClick: () => t?.chain().focus().unsetFontSize().run(),
1001
+ active: !s,
1002
+ children: "Predeterminado"
1003
+ }), yt.map((e) => /* @__PURE__ */ m(W, {
1004
+ onClick: () => t?.chain().focus().setFontSize(e).run(),
1005
+ active: s === e,
1006
+ children: e.replace("px", " pt")
1007
+ }, e))]
1008
+ }) : /* @__PURE__ */ m(R, { children: /* @__PURE__ */ h("div", {
1009
+ className: "relative h-full",
1010
+ children: [/* @__PURE__ */ h(i, { children: [/* @__PURE__ */ m(n, {
1011
+ asChild: !0,
1012
+ children: /* @__PURE__ */ m(z, {
1013
+ asChild: !0,
1014
+ children: /* @__PURE__ */ h(e, {
1015
+ type: "button",
1016
+ variant: "ghost",
1017
+ size: "sm",
1018
+ className: o("h-8 w-14 gap-1 px-2 font-normal"),
1019
+ children: [/* @__PURE__ */ m("span", {
1020
+ className: "text-xs",
1021
+ children: s || "—"
1022
+ }), /* @__PURE__ */ m(y, { className: "h-4 w-4 shrink-0 opacity-50" })]
1023
+ })
1024
+ })
1025
+ }), /* @__PURE__ */ m(a, { children: "Tamaño de fuente" })] }), /* @__PURE__ */ m(B, {
1026
+ align: "start",
1027
+ className: "w-48 p-0",
1028
+ onWheel: (e) => e.stopPropagation(),
1029
+ onTouchMove: (e) => e.stopPropagation(),
1030
+ children: /* @__PURE__ */ h("div", {
1031
+ className: "max-h-[min(70vh,22rem)] overflow-y-auto overflow-x-hidden p-1",
1032
+ children: [
1033
+ /* @__PURE__ */ m("div", {
1034
+ className: "mb-2 mt-2 px-2 text-xs text-muted-foreground",
1035
+ children: "Tamaño"
1036
+ }),
1037
+ /* @__PURE__ */ h("button", {
1038
+ type: "button",
1039
+ onClick: () => t?.chain().focus().unsetFontSize().run(),
1040
+ className: o("flex w-full min-h-9 items-center justify-between rounded-sm px-2 py-1.5 text-sm hover:bg-accent", !s && "bg-accent"),
1041
+ children: ["Predeterminado", s ? null : /* @__PURE__ */ m(_, { className: "h-4 w-4 shrink-0" })]
1042
+ }),
1043
+ yt.map((e) => /* @__PURE__ */ h("button", {
1044
+ type: "button",
1045
+ onClick: () => t?.chain().focus().setFontSize(e).run(),
1046
+ className: o("flex w-full min-h-9 items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent", s === e && "bg-accent"),
1047
+ children: [/* @__PURE__ */ m("span", {
1048
+ className: "tabular-nums",
1049
+ children: e
1050
+ }), s === e ? /* @__PURE__ */ m(_, { className: "h-4 w-4 shrink-0" }) : null]
1051
+ }, e))
1052
+ ]
1053
+ })
1054
+ })]
1055
+ }) });
1056
+ }, X = [
1057
+ 1,
1058
+ 2,
1059
+ 3,
1060
+ 4
1061
+ ], Z = c.forwardRef(({ className: t, ...n }, r) => {
1062
+ let { editor: i } = G(), a = M("(max-width: 640px)"), s = X.find((e) => i?.isActive("heading", { level: e }));
1063
+ return a ? /* @__PURE__ */ h(U, {
1064
+ label: s ? `T${s}` : "Normal",
1065
+ children: [/* @__PURE__ */ m(W, {
1066
+ onClick: () => i?.chain().focus().setParagraph().run(),
1067
+ active: !i?.isActive("heading"),
1068
+ children: "Normal"
1069
+ }), X.map((e) => /* @__PURE__ */ h(W, {
1070
+ onClick: () => i?.chain().focus().toggleHeading({ level: e }).run(),
1071
+ active: i?.isActive("heading", { level: e }),
1072
+ children: ["Título ", e]
1073
+ }, e))]
1074
+ }) : /* @__PURE__ */ h(Ue, { children: [/* @__PURE__ */ m(Ge, {
1075
+ asChild: !0,
1076
+ children: /* @__PURE__ */ h(e, {
1077
+ variant: "ghost",
1078
+ size: "sm",
1079
+ type: "button",
1080
+ title: "Encabezados",
1081
+ className: o("h-8 w-max gap-1 px-3 font-normal", i?.isActive("heading") && "bg-accent", t),
1082
+ ref: r,
1083
+ ...n,
1084
+ children: [s ? `Título ${s}` : "Normal", /* @__PURE__ */ m(v, { className: "h-4 w-4" })]
1085
+ })
1086
+ }), /* @__PURE__ */ h(Ke, {
1087
+ align: "start",
1088
+ children: [/* @__PURE__ */ m(V, {
1089
+ onClick: () => i?.chain().focus().setParagraph().run(),
1090
+ className: o("flex items-center gap-2 h-fit", !i?.isActive("heading") && "bg-accent"),
1091
+ children: "Normal"
1092
+ }), X.map((e) => /* @__PURE__ */ h(V, {
1093
+ onClick: () => i?.chain().focus().toggleHeading({ level: e }).run(),
1094
+ className: o("flex items-center gap-2", i?.isActive("heading", { level: e }) && "bg-accent"),
1095
+ children: ["Título ", e]
1096
+ }, e))]
1097
+ })] });
1098
+ });
1099
+ Z.displayName = "HeadingsToolbar";
1100
+ //#endregion
1101
+ //#region src/components/rich_text_editor/toolbars/italic/index.tsx
1102
+ var xt = c.forwardRef(({ className: t, onClick: r, children: s, ...c }, l) => {
1103
+ let { editor: u } = G();
1104
+ return /* @__PURE__ */ h(i, { children: [/* @__PURE__ */ m(n, {
1105
+ asChild: !0,
1106
+ children: /* @__PURE__ */ m(e, {
1107
+ variant: "ghost",
1108
+ size: "icon",
1109
+ className: o("size-7", u?.isActive("italic") && "bg-accent", t),
1110
+ onClick: (e) => {
1111
+ u?.chain().focus().toggleItalic().run(), r?.(e);
1112
+ },
1113
+ disabled: !u?.can().toggleItalic(),
1114
+ ref: l,
1115
+ ...c,
1116
+ children: s ?? /* @__PURE__ */ m(S, { className: "h-4 w-4" })
1117
+ })
1118
+ }), /* @__PURE__ */ m(a, { children: /* @__PURE__ */ m("span", { children: "Cursiva" }) })] });
1119
+ });
1120
+ xt.displayName = "ItalicToolbar";
1121
+ //#endregion
1122
+ //#region src/components/rich_text_editor/toolbars/ordered_list/index.tsx
1123
+ var Q = c.forwardRef(({ className: t, onClick: r, children: s, ...c }, l) => {
1124
+ let { editor: u } = G();
1125
+ return /* @__PURE__ */ h(i, { children: [/* @__PURE__ */ m(n, {
1126
+ asChild: !0,
1127
+ children: /* @__PURE__ */ m(e, {
1128
+ variant: "ghost",
1129
+ size: "icon",
1130
+ className: o("size-7", u?.isActive("orderedList") && "bg-accent", t),
1131
+ onClick: (e) => {
1132
+ e.preventDefault(), u?.chain().focus().toggleOrderedList().run(), r?.(e);
1133
+ },
1134
+ ref: l,
1135
+ ...c,
1136
+ children: s ?? /* @__PURE__ */ m(w, { className: "h-4 w-4" })
1137
+ })
1138
+ }), /* @__PURE__ */ m(a, { children: /* @__PURE__ */ m("span", { children: "Lista numerada" }) })] });
1139
+ });
1140
+ Q.displayName = "OrderedListToolbar";
1141
+ //#endregion
1142
+ //#region src/components/rich_text_editor/toolbars/underline/index.tsx
1143
+ var $ = c.forwardRef(({ className: t, onClick: r, children: s, ...c }, l) => {
1144
+ let { editor: u } = G();
1145
+ return /* @__PURE__ */ h(i, { children: [/* @__PURE__ */ m(n, {
1146
+ asChild: !0,
1147
+ children: /* @__PURE__ */ m(e, {
1148
+ variant: "ghost",
1149
+ size: "icon",
1150
+ className: o("size-7", u?.isActive("underline") && "bg-accent", t),
1151
+ onClick: (e) => {
1152
+ u?.chain().focus().toggleUnderline().run(), r?.(e);
1153
+ },
1154
+ disabled: !u?.can().toggleUnderline(),
1155
+ ref: l,
1156
+ ...c,
1157
+ children: s ?? /* @__PURE__ */ m(ee, { className: "h-4 w-4" })
1158
+ })
1159
+ }), /* @__PURE__ */ m(a, { children: /* @__PURE__ */ m("span", { children: "Subrayado" }) })] });
1160
+ });
1161
+ $.displayName = "UnderlineToolbar";
1162
+ //#endregion
1163
+ //#region src/components/rich_text_editor/extensions/floating_toolbar/index.tsx
1164
+ function St({ editor: e, extraActions: n, compact: r = !1, showWhenCaretCollapsed: i = !1, dismissOnBlurStrict: a = !1, presentation: s = "floating", panelClassName: c }) {
1165
+ let g = M("(max-width: 640px)"), [_, v] = f(!1), y = d(null), [b, x] = f(!1), S = d(!1);
1166
+ if (u(() => {
1167
+ S.current = b;
1168
+ }), l(() => {
1169
+ if (!e?.options.element || !g) return;
1170
+ let t = (e) => {
1171
+ e.preventDefault();
1172
+ }, n = e.options.element;
1173
+ return n.addEventListener("contextmenu", t), () => n.removeEventListener("contextmenu", t);
1174
+ }, [e, g]), l(() => {
1175
+ if (!e || s === "dock") return;
1176
+ let t = () => {
1177
+ let t = e.state.selection, n = dt(e), r = i && t.empty && e.isEditable && t.$from.parent.isTextblock;
1178
+ v((e.isFocused || b) && (n || r));
1179
+ };
1180
+ e.on("selectionUpdate", t), e.on("focus", t);
1181
+ let n = () => {
1182
+ y.current && clearTimeout(y.current), y.current = setTimeout(() => {
1183
+ y.current = null;
1184
+ let t = e.state.selection, n = dt(e), r = i && t.empty && e.isEditable && t.$from.parent.isTextblock, o = n || r, s = S.current;
1185
+ if (a) {
1186
+ v((e.isFocused || s) && o);
1187
+ return;
1188
+ }
1189
+ let c = document.querySelector("[data-radix-popper-content-wrapper], [role=\"dialog\"]");
1190
+ v((e.isFocused || s || !!c) && o);
1191
+ }, 150);
1192
+ };
1193
+ return e.on("blur", n), () => {
1194
+ y.current && clearTimeout(y.current), y.current = null, e.off("selectionUpdate", t), e.off("focus", t), e.off("blur", n);
1195
+ };
1196
+ }, [
1197
+ e,
1198
+ b,
1199
+ i,
1200
+ a,
1201
+ s
1202
+ ]), !e) return null;
1203
+ let C = /* @__PURE__ */ h("div", {
1204
+ className: "flex items-center gap-0.5 p-1",
1205
+ children: [
1206
+ /* @__PURE__ */ m(mt, {}),
1207
+ /* @__PURE__ */ m(xt, {}),
1208
+ /* @__PURE__ */ m($, {}),
1209
+ !r && /* @__PURE__ */ m(Z, {}),
1210
+ !r && !g && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(q, {}), /* @__PURE__ */ m(Q, {})] }),
1211
+ /* @__PURE__ */ m(vt, {}),
1212
+ /* @__PURE__ */ m(bt, {}),
1213
+ /* @__PURE__ */ m(J, {}),
1214
+ n ? /* @__PURE__ */ m("div", {
1215
+ className: "flex shrink-0 items-center gap-0.5",
1216
+ children: n
1217
+ }) : null
1218
+ ]
1219
+ }), w = s === "dock" ? /* @__PURE__ */ m("div", {
1220
+ className: o("tiptap-floating-toolbar flex w-fit max-w-[min(100vw-10rem,48rem)] items-center overflow-x-auto rounded-md border border-border bg-card shadow-sm", c),
1221
+ onWheel: (e) => e.stopPropagation(),
1222
+ onTouchMove: (e) => e.stopPropagation(),
1223
+ onFocus: () => x(!0),
1224
+ onBlur: () => x(!1),
1225
+ children: /* @__PURE__ */ m(K, {
1226
+ editor: e,
1227
+ children: /* @__PURE__ */ m(t, { children: C })
1228
+ })
1229
+ }) : /* @__PURE__ */ m("div", {
1230
+ className: o("tiptap-floating-toolbar overflow-hidden shadow-lg border rounded-lg bg-card", g ? "w-[calc(100vw-2rem)] mx-4" : "w-fit", c),
1231
+ onWheel: (e) => e.stopPropagation(),
1232
+ onTouchMove: (e) => e.stopPropagation(),
1233
+ onFocus: () => x(!0),
1234
+ onBlur: () => x(!1),
1235
+ children: /* @__PURE__ */ m(K, {
1236
+ editor: e,
1237
+ children: /* @__PURE__ */ m(t, { children: /* @__PURE__ */ h(F, {
1238
+ className: "h-fit",
1239
+ children: [C, /* @__PURE__ */ m(I, {
1240
+ className: "hidden",
1241
+ orientation: "horizontal"
1242
+ })]
1243
+ }) })
1244
+ })
1245
+ });
1246
+ return s === "dock" ? w : /* @__PURE__ */ m(ft, {
1247
+ editor: e,
1248
+ shouldShow: _,
1249
+ zIndex: 50,
1250
+ floatingOptions: { placement: "top" },
1251
+ children: w
1252
+ });
1253
+ }
1254
+ //#endregion
1255
+ //#region src/components/rich_text_editor/lib/annotation_editor_extensions.ts
1256
+ function Ct(e = "Escribe aquí…") {
1257
+ return [
1258
+ ye.configure({
1259
+ heading: !1,
1260
+ blockquote: !1,
1261
+ horizontalRule: !1,
1262
+ codeBlock: !1,
1263
+ code: !1,
1264
+ strike: !1,
1265
+ link: !1,
1266
+ underline: !1
1267
+ }),
1268
+ be.configure({
1269
+ placeholder: e,
1270
+ emptyNodeClass: "is-editor-empty",
1271
+ includeChildren: !1
1272
+ }),
1273
+ _e,
1274
+ he,
1275
+ ge,
1276
+ ve,
1277
+ pe,
1278
+ me.configure({ multicolor: !0 })
1279
+ ];
1280
+ }
1281
+ //#endregion
1282
+ export { I as $, et as A, Re as B, V as C, Xe as D, Ye as E, Me as F, R as G, Pe as H, Fe as I, z as J, je as K, Le as L, tt as M, Ge as N, Qe as O, He as P, F as Q, Ve as R, qe as S, We as T, Be as U, Ie as V, Ne as W, L as X, Ae as Y, ke as Z, it as _, J as a, Te as at, Je as b, G as c, De as ct, ft as d, xe as et, lt as f, st as g, ot as h, Z as i, Ee as it, nt as j, $e as k, U as l, Se as lt, ct as m, St as n, we as nt, q as o, P as ot, at as p, B as q, Q as r, Oe as rt, K as s, N as st, Ct as t, Ce as tt, W as u, M as ut, rt as v, Ze as w, Ke as x, Ue as y, ze as z };
1283
+
1284
+ //# sourceMappingURL=annotation_editor_extensions-BAw3S2bg.js.map