@arkyn/components 3.0.1-beta.147 → 3.0.1-beta.149

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js DELETED
@@ -1,4351 +0,0 @@
1
- import { Children as e, cloneElement as t, createContext as n, forwardRef as r, useCallback as i, useContext as a, useEffect as o, useId as s, useMemo as c, useRef as l, useState as u, useSyncExternalStore as d } from "react";
2
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
3
- import { AlertTriangle as h, AlignCenter as g, AlignJustify as _, AlignLeft as v, AlignRight as y, Bold as b, Check as x, CheckCircle2 as S, ChevronDown as C, ChevronLeft as w, ChevronRight as T, Code as E, Ellipsis as D, File as O, FileArchive as k, FileAudio as A, FileImage as j, Heading1 as M, Heading2 as N, Image as P, Info as F, Italic as I, Loader2 as L, MapPinned as R, Pause as z, Play as B, Quote as V, RefreshCw as H, Search as U, Underline as W, Video as G, X as K, XCircle as q } from "lucide-react";
4
- import { findCountryMask as ee, formatToCapitalizeFirstWordLetter as J, formatToCurrency as te, formatToPhone as ne, removeNonNumeric as re } from "@arkyn/shared";
5
- import { AnimatePresence as ie, motion as Y } from "framer-motion";
6
- import ae from "mapbox-gl";
7
- import { createRoot as oe } from "react-dom/client";
8
- import { InputMask as se } from "@react-input/mask";
9
- import { countries as ce } from "@arkyn/templates";
10
- import le from "is-hotkey";
11
- import { Editor as ue, Element as de, Node as fe, Text as pe, Transforms as me, createEditor as he } from "slate";
12
- import { withHistory as ge } from "slate-history";
13
- import { Editable as _e, Slate as ve, useSlate as ye, withReact as be } from "slate-react";
14
- import { StandaloneSearchBox as xe, useLoadScript as Se } from "@react-google-maps/api";
15
- import { scroller as Ce } from "react-scroll";
16
- import we, { Toaster as Te } from "react-hot-toast";
17
- import Ee from "html-react-parser";
18
- //#region src/components/alert/alertTitle/index.tsx
19
- function De(e) {
20
- let { className: t, ...n } = e;
21
- return /* @__PURE__ */ p("div", {
22
- className: `arkynAlertTitle ${t}`.trim(),
23
- ...n
24
- });
25
- }
26
- //#endregion
27
- //#region src/components/alert/alertContainer/index.tsx
28
- var Oe = n({});
29
- function ke() {
30
- return a(Oe);
31
- }
32
- function Ae(e) {
33
- let { schema: t, children: n, className: r, ...i } = e, a = `arkynAlertContainer ${t} ${((e) => {
34
- let t = !1, n = (e) => {
35
- Array.isArray(e) ? e.forEach(n) : e && typeof e == "object" && "type" in e && (e.type === De ? t = !0 : e.props && typeof e.props == "object" && e.props !== null && "children" in e.props && n(e.props.children));
36
- };
37
- return n(e), t;
38
- })(n) ? "existsAlertTitle" : "nonExistsAlertTitle"} ${r}`;
39
- return /* @__PURE__ */ p(Oe.Provider, {
40
- value: e,
41
- children: /* @__PURE__ */ p("div", {
42
- className: a.trim(),
43
- ...i,
44
- children: n
45
- })
46
- });
47
- }
48
- //#endregion
49
- //#region src/components/alert/alertContent/index.tsx
50
- function je(e) {
51
- let { className: t, ...n } = e;
52
- return /* @__PURE__ */ p("div", {
53
- className: `arkynAlertContent ${t}`.trim(),
54
- ...n
55
- });
56
- }
57
- //#endregion
58
- //#region src/components/alert/alertDescription/index.tsx
59
- function Me(e) {
60
- let { className: t, ...n } = e;
61
- return /* @__PURE__ */ p("div", {
62
- className: `arkynAlertDescription ${t}`.trim(),
63
- ...n
64
- });
65
- }
66
- //#endregion
67
- //#region src/components/alert/alertIcon/index.tsx
68
- function Ne(e) {
69
- let { className: t, ...n } = e, { schema: r } = ke(), i = `arkynAlertIcon ${r} ${t}`;
70
- switch (r) {
71
- case "success": return /* @__PURE__ */ p(S, {
72
- className: i,
73
- ...n
74
- });
75
- case "danger": return /* @__PURE__ */ p(q, {
76
- className: i,
77
- ...n
78
- });
79
- case "warning": return /* @__PURE__ */ p(h, {
80
- className: i,
81
- ...n
82
- });
83
- case "info": return /* @__PURE__ */ p(F, {
84
- className: i,
85
- ...n
86
- });
87
- }
88
- }
89
- //#endregion
90
- //#region src/hooks/useSlider.ts
91
- function Pe(e) {
92
- function t() {
93
- return !e || e <= 0 ? 0 : e >= 100 ? 100 : e;
94
- }
95
- let [n, r] = u(t());
96
- function i(e) {
97
- return r(e <= 0 ? 0 : e >= 100 ? 100 : e);
98
- }
99
- return [n, i];
100
- }
101
- //#endregion
102
- //#region src/components/slider/index.tsx
103
- function Fe(e) {
104
- let { onChange: t, value: n, disabled: r = !1, onDragging: i, className: a = "", ...s } = e, [c, d] = u(!1), f = l(null), h = () => d(!0), g = () => d(!1), _ = (e) => {
105
- if (r || !c || !f.current) return;
106
- let n = f.current.getBoundingClientRect(), i = e.clientX - n.left;
107
- t(Math.min(Math.max(i / n.width * 100, 0), 100));
108
- }, v = (e) => {
109
- if (r || !f.current) return;
110
- let n = f.current.getBoundingClientRect(), i = e.clientX - n.left;
111
- t(Math.min(Math.max(i / n.width * 100, 0), 100));
112
- };
113
- o(() => (c ? (i && i(!0), document.addEventListener("mousemove", _), document.addEventListener("mouseup", g)) : (i && i(!1), document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", g)), () => {
114
- document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", g);
115
- }), [c]);
116
- let y = `arkynSliderTrack ${c ? "isDragging" : "isNotDragging"} ${r ? "isDisabled" : "isEnabled"} ${a}`;
117
- return /* @__PURE__ */ m("div", {
118
- ...s,
119
- className: y,
120
- onMouseDown: h,
121
- onClick: v,
122
- ref: f,
123
- children: [/* @__PURE__ */ p("div", {
124
- className: "arkynSliderFill",
125
- style: { width: `${n}%` }
126
- }), /* @__PURE__ */ p("div", {
127
- className: "arkynSliderThumb",
128
- style: { left: `${n}%` }
129
- })]
130
- });
131
- }
132
- //#endregion
133
- //#region src/components/audioPlayer/index.tsx
134
- function Ie(e) {
135
- let { onPlayAudio: t, onPauseAudio: n, disabled: r, style: i, ...a } = e, [s, c] = Pe(0), [d, f] = u(!1), [h, g] = u(!1), _ = l(null), v = _.current?.currentTime || 0, y = _.current?.duration || 0, b = C(v), x = C(y), S = {
136
- totalTime: y,
137
- currentTime: v,
138
- formattedCurrentTime: b,
139
- formattedTotalTime: x
140
- };
141
- function C(e) {
142
- if (!e) return "00:00";
143
- let t = Math.floor(e / 60), n = Math.floor(e % 60);
144
- return `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
145
- }
146
- function w() {
147
- let t = _.current;
148
- t && (e.onPlayAudio && e.onPlayAudio(S), t.play(), f(!0));
149
- }
150
- function T() {
151
- let t = _.current;
152
- t && (e.onPauseAudio && e.onPauseAudio(S), t.pause(), f(!1));
153
- }
154
- function E() {
155
- d ? T() : w();
156
- }
157
- function D(e) {
158
- let t = _.current;
159
- if (!t) return;
160
- let n = t.duration;
161
- t.currentTime = e / 100 * n;
162
- }
163
- return h || !d ? _.current?.pause() : d && _.current?.play(), o(() => {
164
- let e = _.current;
165
- if (!e) return;
166
- let t = () => {
167
- let t = e.duration;
168
- c(e.currentTime / t * 100);
169
- };
170
- return e.addEventListener("timeupdate", t), () => {
171
- e.removeEventListener("timeupdate", t);
172
- };
173
- }, []), /* @__PURE__ */ m("div", {
174
- className: "arkynAudioPlayer",
175
- style: i,
176
- children: [
177
- /* @__PURE__ */ p("audio", {
178
- ...a,
179
- ref: _,
180
- src: e.src,
181
- onEnded: T
182
- }),
183
- /* @__PURE__ */ m("button", {
184
- type: "button",
185
- disabled: r,
186
- onClick: E,
187
- children: [d && /* @__PURE__ */ p(z, {}), !d && /* @__PURE__ */ p(B, {})]
188
- }),
189
- /* @__PURE__ */ p("p", { children: b }),
190
- /* @__PURE__ */ p(Fe, {
191
- value: s,
192
- onChange: D,
193
- onDragging: g,
194
- disabled: r
195
- }),
196
- /* @__PURE__ */ p("p", { children: x })
197
- ]
198
- });
199
- }
200
- //#endregion
201
- //#region src/providers/formProvider.tsx
202
- var Le = n({});
203
- function Re(e) {
204
- let { children: n, fieldErrors: r, form: i } = e;
205
- return /* @__PURE__ */ m(Le.Provider, {
206
- value: { fieldErrors: r },
207
- children: [!i && n, i && t(i, i.props, n)]
208
- });
209
- }
210
- //#endregion
211
- //#region src/hooks/useForm.ts
212
- function X() {
213
- return a(Le);
214
- }
215
- //#endregion
216
- //#region src/components/fieldError/index.tsx
217
- function ze(e) {
218
- let { children: t, className: n, ...r } = e, i = `arkynFieldError ${n}`;
219
- return t ? /* @__PURE__ */ p("strong", {
220
- className: i.trim(),
221
- ...r,
222
- children: t
223
- }) : /* @__PURE__ */ p(f, {});
224
- }
225
- //#endregion
226
- //#region src/components/fieldLabel/index.tsx
227
- function Be(e) {
228
- let { showAsterisk: t = !1, className: n = "", ...r } = e;
229
- return /* @__PURE__ */ p("label", {
230
- className: `arkynFieldLabel ${t ? "asteriskTrue" : "asteriskFalse"} ${n}`.trim(),
231
- ...r
232
- });
233
- }
234
- //#endregion
235
- //#region src/components/fieldWrapper/index.tsx
236
- function Ve(e) {
237
- let { children: t, className: n, orientation: r = "vertical", ...i } = e;
238
- return /* @__PURE__ */ p("section", {
239
- className: `arkynFieldWrapper ${n} ${r}`.trim(),
240
- ...i,
241
- children: t
242
- });
243
- }
244
- //#endregion
245
- //#region src/services/iconRenderer.tsx
246
- function Z(e) {
247
- let { iconSize: t, icon: n, className: r, show: i = !0 } = e;
248
- return !i || !n ? /* @__PURE__ */ p(f, {}) : typeof n == "string" ? /* @__PURE__ */ p("p", {
249
- className: r,
250
- children: n
251
- }) : /* @__PURE__ */ p(n, {
252
- size: t,
253
- strokeWidth: 2.5,
254
- className: r
255
- });
256
- }
257
- //#endregion
258
- //#region src/components/button/index.tsx
259
- function Q(e) {
260
- let { isLoading: t = !1, scheme: n = "primary", variant: r = "solid", loadingText: i, size: a = "md", leftIcon: o, rightIcon: s, disabled: c, className: l = "", children: u, ...d } = e, f = {
261
- xs: 12,
262
- sm: 16,
263
- md: 20,
264
- lg: 24
265
- }[a];
266
- return /* @__PURE__ */ m("button", {
267
- className: `arkynButton ${t ? "loadingTrue" : "loadingFalse"} ${r} ${n} ${a} ${i ? "loadingTextTrue" : "loadingTextFalse"} ${l}`,
268
- disabled: c || t,
269
- ...d,
270
- children: [/* @__PURE__ */ m("div", {
271
- className: "arkynButtonSpinner",
272
- children: [/* @__PURE__ */ p(L, {
273
- size: f,
274
- strokeWidth: 2.5
275
- }), i && i]
276
- }), /* @__PURE__ */ m("div", {
277
- className: "arkynButtonContent",
278
- children: [
279
- /* @__PURE__ */ p(Z, {
280
- iconSize: f,
281
- icon: o
282
- }),
283
- u,
284
- /* @__PURE__ */ p(Z, {
285
- iconSize: f,
286
- icon: s
287
- })
288
- ]
289
- })]
290
- });
291
- }
292
- //#endregion
293
- //#region src/components/divider/index.tsx
294
- function He(e) {
295
- let { className: t, orientation: n = "horizontal", ...r } = e;
296
- return /* @__PURE__ */ p("div", {
297
- className: `arkynDivider ${n} ${t}`.trim(),
298
- ...r
299
- });
300
- }
301
- //#endregion
302
- //#region src/components/iconButton/index.tsx
303
- function Ue(e) {
304
- let { isLoading: t = !1, scheme: n = "primary", variant: r = "solid", size: i = "md", icon: a, disabled: o, className: s = "", ...c } = e, l = {
305
- xs: 12,
306
- sm: 16,
307
- md: 20,
308
- lg: 24
309
- }, u = `arkynIconButton ${r} ${n} ${i} ${t ? "loadingTrue" : "loadingFalse"} ${s}`;
310
- return /* @__PURE__ */ m("button", {
311
- disabled: o || t,
312
- className: u.trim(),
313
- ...c,
314
- children: [/* @__PURE__ */ p("div", {
315
- className: "arkynIconButtonSpinner",
316
- children: /* @__PURE__ */ p(L, {
317
- size: l[i],
318
- strokeWidth: 2.5
319
- })
320
- }), /* @__PURE__ */ p("div", {
321
- className: "arkynIconButtonContent",
322
- children: /* @__PURE__ */ p(a, {
323
- size: l[i],
324
- strokeWidth: 2.5
325
- })
326
- })]
327
- });
328
- }
329
- //#endregion
330
- //#region src/components/tooltip/index.tsx
331
- function We(e) {
332
- let { text: t, size: n = "lg", children: r, orientation: i = "top", className: a = "", ...c } = e, d = s(), f = l(null), [h, g] = u(i);
333
- return o(() => {
334
- let e = () => {
335
- if (!f.current) return;
336
- let e = document.getElementById(d);
337
- e && (g(i), requestAnimationFrame(() => {
338
- let t = e.getBoundingClientRect(), n = window.innerWidth, r = window.innerHeight, a = i;
339
- i === "left" && t.left < 0 ? a = "right" : i === "right" && t.right > n ? a = "left" : i === "top" && t.top < 0 ? a = "bottom" : i === "bottom" && t.bottom > r && (a = "top"), a === "right" && t.right > n ? a = "left" : a === "left" && t.left < 0 ? a = "right" : a === "bottom" && t.bottom > r ? a = "top" : a === "top" && t.top < 0 && (a = "bottom"), g(a);
340
- }));
341
- }, t = f.current;
342
- if (!t) return;
343
- let n = () => {
344
- setTimeout(e, 1);
345
- };
346
- return t.addEventListener("mouseenter", n), window.addEventListener("resize", e), () => {
347
- t.removeEventListener("mouseenter", n), window.removeEventListener("resize", e);
348
- };
349
- }, [i, d]), /* @__PURE__ */ m("div", {
350
- className: `arkynTooltip ${n} ${h} ${a}`.trim(),
351
- ...c,
352
- ref: f,
353
- children: [r, /* @__PURE__ */ p("div", {
354
- className: "arkynTooltipText",
355
- id: d,
356
- dangerouslySetInnerHTML: { __html: t }
357
- })]
358
- });
359
- }
360
- //#endregion
361
- //#region src/components/audioUpload/hasFileContent/index.tsx
362
- function Ge(e) {
363
- let { filePath: t, disabled: n, acceptAudio: r, handleSelectFile: i, isLoading: a, reSendAudio: o, changeAudioButtonText: s } = e;
364
- function c() {
365
- if (n) return;
366
- let e = document.createElement("input");
367
- e.type = "file", e.accept = r, e.onchange = (e) => {
368
- let t = e.target.files?.[0];
369
- t && i(t);
370
- }, e.click();
371
- }
372
- return /* @__PURE__ */ m("div", {
373
- className: "arkynAudioUploadHasFileContentContainer",
374
- children: [
375
- /* @__PURE__ */ p(Ie, { src: t }),
376
- /* @__PURE__ */ p(He, {}),
377
- /* @__PURE__ */ m("div", {
378
- className: "arkynAudioUploadButtonsContainer",
379
- children: [!!o && /* @__PURE__ */ p(We, {
380
- orientation: "bottom",
381
- text: "Reenviar áudio",
382
- children: /* @__PURE__ */ p(Ue, {
383
- type: "button",
384
- "aria-label": "resend image",
385
- variant: "outline",
386
- scheme: "danger",
387
- size: "sm",
388
- isLoading: a,
389
- onClick: o,
390
- icon: H,
391
- disabled: n
392
- })
393
- }), /* @__PURE__ */ p(Q, {
394
- isLoading: a,
395
- onClick: c,
396
- variant: "outline",
397
- size: "sm",
398
- type: "button",
399
- disabled: n,
400
- children: s
401
- })]
402
- })
403
- ]
404
- });
405
- }
406
- //#endregion
407
- //#region src/components/audioUpload/noFileContent/index.tsx
408
- function Ke(e) {
409
- let { dropAudioText: t, isLoading: n, acceptAudio: r, handleSelectFile: i, selectAudioButtonText: a, disabled: o } = e;
410
- function s(e) {
411
- if (o) return;
412
- e.preventDefault();
413
- let t = e.dataTransfer.files[0];
414
- t && i(t);
415
- }
416
- function c() {
417
- if (o) return;
418
- let e = document.createElement("input");
419
- e.type = "file", e.accept = r, e.onchange = (e) => {
420
- let t = e.target.files?.[0];
421
- t && i(t);
422
- }, e.click();
423
- }
424
- return /* @__PURE__ */ m("div", {
425
- onDrop: s,
426
- className: "arkynAudioUploadNoFileContent",
427
- children: [/* @__PURE__ */ p(Q, {
428
- isLoading: n,
429
- onClick: c,
430
- variant: "ghost",
431
- size: "sm",
432
- type: "button",
433
- disabled: o,
434
- children: a
435
- }), /* @__PURE__ */ p("p", { children: t })]
436
- });
437
- }
438
- //#endregion
439
- //#region src/components/audioUpload/index.tsx
440
- function qe(e) {
441
- let { name: t, label: n, fileName: r = "file", method: i = "POST", onChange: a, fileResponseName: o = "url", selectAudioButtonText: s = "Selecionar arquivo de áudio", dropAudioText: c = "Ou arraste e solte um arquivo de áudio aqui", changeAudioButtonText: l = "Trocar arquivo de áudio", acceptAudio: d = "audio/*", action: f, defaultValue: h = "", showAsterisk: g = !1, disabled: _ = !1 } = e, { fieldErrors: v } = X(), y = v?.[t], [b, x] = u(h), [S, C] = u(""), [w, T] = u(null), [E, D] = u(h), [O, k] = u(!1);
442
- async function A(e) {
443
- if (_) return;
444
- k(!0), T(e), C("");
445
- let t = new FormData();
446
- t.append(r, e), await fetch(f, {
447
- method: i,
448
- body: t
449
- }).then(async (e) => await e.json()).then((e) => {
450
- e?.error ? C(e.error) : x(e?.[o]), a && a(e?.[o]);
451
- }).catch((e) => {
452
- console.error(e), C("Erro ao enviar audio");
453
- }).finally(() => k(!1));
454
- }
455
- function j(e) {
456
- if (!_) {
457
- if (e.type.indexOf("audio") === -1) {
458
- C("O arquivo selecionado não é um arquivo de áudio");
459
- return;
460
- }
461
- D(URL.createObjectURL(e)), A(e);
462
- }
463
- }
464
- let M = y || S;
465
- return /* @__PURE__ */ m(Ve, { children: [
466
- n && /* @__PURE__ */ p(Be, {
467
- showAsterisk: g,
468
- children: n
469
- }),
470
- /* @__PURE__ */ m("div", {
471
- className: `arkynAudioUpload ${M ? "hasError" : "noHasError"} ${E ? "hasAudio" : "noHasAudio"}`,
472
- children: [
473
- /* @__PURE__ */ p("input", {
474
- type: "hidden",
475
- name: t,
476
- value: b || ""
477
- }),
478
- !E && /* @__PURE__ */ p(Ke, {
479
- disabled: _,
480
- isLoading: O,
481
- acceptAudio: d,
482
- dropAudioText: c,
483
- handleSelectFile: j,
484
- selectAudioButtonText: s
485
- }),
486
- E && /* @__PURE__ */ p(Ge, {
487
- filePath: E,
488
- acceptAudio: d,
489
- changeAudioButtonText: l,
490
- disabled: _,
491
- handleSelectFile: j,
492
- isLoading: O,
493
- reSendAudio: M && w ? () => A(w) : void 0
494
- })
495
- ]
496
- }),
497
- M && /* @__PURE__ */ p(ze, { children: M })
498
- ] });
499
- }
500
- //#endregion
501
- //#region src/components/badge/index.tsx
502
- function Je(e) {
503
- let { variant: t = "ghost", scheme: n = "primary", size: r = "lg", leftIcon: i, rightIcon: a, className: o = "", children: s, ...c } = e, l = {
504
- md: 12,
505
- lg: 14
506
- }[r];
507
- return /* @__PURE__ */ m("div", {
508
- className: `arkynBadge ${t} ${n} ${r} ${o}`.trim(),
509
- ...c,
510
- children: [
511
- /* @__PURE__ */ p(Z, {
512
- iconSize: l,
513
- icon: i
514
- }),
515
- /* @__PURE__ */ p("p", { children: s }),
516
- /* @__PURE__ */ p(Z, {
517
- iconSize: l,
518
- icon: a
519
- })
520
- ]
521
- });
522
- }
523
- //#endregion
524
- //#region src/components/calendar/_viewService.ts
525
- var Ye = class {
526
- currentDay(e) {
527
- return String(e.getDate()).padStart(2, "0");
528
- }
529
- currentMonth(e) {
530
- return String(e.getMonth() + 1).padStart(2, "0");
531
- }
532
- currentYear(e) {
533
- return String(e.getFullYear());
534
- }
535
- capitalize(e) {
536
- return J(e);
537
- }
538
- parseDayType(e, t, n, r) {
539
- let i = r[0].getDate(), a = r[0].getMonth(), o = r[0].getFullYear(), s = r[1].getDate(), c = r[1].getMonth(), l = r[1].getFullYear(), u = new Date(o, a, i), d = new Date(l, c, s), f = new Date(n, t, e);
540
- return u.getTime() === f.getTime() || d.getTime() === f.getTime() ? "checkedDay" : f > u && f < d ? "middleDay" : "uncheckedDay";
541
- }
542
- listWeek(e) {
543
- let t = [], n = new Date(Date.UTC(2023, 0, 1));
544
- for (let r = 0; r < 7; r++) {
545
- let i = new Date(n);
546
- i.setUTCDate(n.getUTCDate() + r);
547
- let a = i.toLocaleDateString(e, {
548
- weekday: "short",
549
- timeZone: "UTC"
550
- });
551
- t.push(a);
552
- }
553
- return t;
554
- }
555
- listMonths(e, t) {
556
- let n = new Intl.DateTimeFormat(t, { month: "long" });
557
- return Array.from({ length: 12 }, (t, r) => {
558
- let i = new Date(e.getFullYear(), r, 1), a = n.format(i);
559
- return {
560
- label: this.capitalize(a),
561
- value: String(r).padStart(2, "0")
562
- };
563
- });
564
- }
565
- listYears(e) {
566
- let t = (/* @__PURE__ */ new Date()).getFullYear();
567
- return Array.from({ length: e + 1 }, (n, r) => {
568
- let i = t - e + r;
569
- return {
570
- label: String(i),
571
- value: String(i)
572
- };
573
- }).reverse();
574
- }
575
- listMatrix(e, t) {
576
- let n = e.getFullYear(), r = e.getMonth(), i = new Date(n, r, 1).getDay(), a = new Date(n, r + 1, 0).getDate(), o = new Date(n, r, 0).getDate(), s = Math.ceil((i + a) / 7) * 7, c = [], l = 1, u = 1;
577
- for (let e = 0; e < s; e++) {
578
- let s = Math.floor(e / 7);
579
- if (c[s] || (c[s] = []), e < i) {
580
- let a = o - (i - e - 1), l = r === 0 ? 11 : r - 1, u = r === 0 ? n - 1 : n;
581
- c[s].push({
582
- day: a,
583
- month: l,
584
- year: u,
585
- dayOwner: "previous",
586
- dayType: this.parseDayType(a, l, u, t)
587
- });
588
- } else if (l <= a) c[s].push({
589
- day: l,
590
- month: r,
591
- year: n,
592
- dayOwner: "current",
593
- dayType: this.parseDayType(l, r, n, t)
594
- }), l++;
595
- else {
596
- let e = r === 11 ? 0 : r + 1, i = r === 11 ? n + 1 : n;
597
- c[s].push({
598
- day: u,
599
- month: e,
600
- year: i,
601
- dayOwner: "next",
602
- dayType: this.parseDayType(u, e, i, t)
603
- }), u++;
604
- }
605
- }
606
- return c;
607
- }
608
- changeDay(e, t, n, r, i, a, o) {
609
- let s = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), c = s(new Date(n, t, e));
610
- if (o(c), r === "single") {
611
- a([c, c]);
612
- return;
613
- }
614
- let l = s(i[0]), u = s(i[1]), d = c.getTime(), f = l.getTime(), p = u.getTime();
615
- if (d === f) {
616
- a([c, c]);
617
- return;
618
- }
619
- if (d === p) {
620
- a([c, c]);
621
- return;
622
- }
623
- if (c < l) {
624
- a([c, u]);
625
- return;
626
- }
627
- if (c > u) {
628
- a([l, c]);
629
- return;
630
- }
631
- if (Math.abs(d - f) <= Math.abs(p - d)) {
632
- a([c, u]);
633
- return;
634
- }
635
- a([l, c]);
636
- }
637
- changeMonth(e, t, n) {
638
- let r = new Date(t);
639
- r.setMonth(e), n(r);
640
- }
641
- changeYear(e, t, n) {
642
- let r = new Date(t);
643
- r.setFullYear(e), n(r);
644
- }
645
- nextMonth(e, t) {
646
- let n = new Date(e);
647
- n.setDate(1), n.setMonth(n.getMonth() + 1), t(n);
648
- }
649
- previousMonth(e, t) {
650
- let n = new Date(e);
651
- n.setDate(1), n.setMonth(n.getMonth() - 1), t(n);
652
- }
653
- }, Xe = n({});
654
- function Ze() {
655
- return a(Xe);
656
- }
657
- function Qe(e) {
658
- let t = e.language || "pt-BR", n = e.calendarType === "single" ? [e.defaultValue || /* @__PURE__ */ new Date(), e.defaultValue || /* @__PURE__ */ new Date()] : e.defaultValue || [/* @__PURE__ */ new Date(), /* @__PURE__ */ new Date()], [r, i] = u(/* @__PURE__ */ new Date()), [a, o] = u(n), s = new Ye();
659
- function c(t) {
660
- let n = [new Date(t[0]), new Date(t[1])];
661
- e.onChange && e.calendarType === "range" && e.onChange(n), e.onChange && e.calendarType === "single" && e.onChange(n[0]), o(n);
662
- }
663
- function l(t) {
664
- e.onChangeView && e.onChangeView(t), i(t);
665
- }
666
- return /* @__PURE__ */ p(Xe.Provider, {
667
- value: {
668
- valueDate: a,
669
- viewDate: r,
670
- currentDate: r.toLocaleDateString(t).slice(3),
671
- currentDay: s.currentDay(r),
672
- currentMonth: s.currentMonth(r),
673
- currentYear: s.currentYear(r),
674
- listWeek: s.listWeek(t),
675
- listMonths: s.listMonths(r, t),
676
- listYears: s.listYears(100),
677
- listMatrix: s.listMatrix(r, a),
678
- changeDay: (t, n, r) => s.changeDay(t, n, r, e.calendarType, a, c, l),
679
- changeMonth: (e) => s.changeMonth(e, r, l),
680
- changeYear: (e) => s.changeYear(e, r, l),
681
- nextMonth: () => s.nextMonth(r, l),
682
- previousMonth: () => s.previousMonth(r, l)
683
- },
684
- children: e.children
685
- });
686
- }
687
- //#endregion
688
- //#region src/components/calendar/calendarContainer/index.tsx
689
- function $e({ children: e }) {
690
- return /* @__PURE__ */ p("div", {
691
- className: "arkynCalendarContainer",
692
- children: e
693
- });
694
- }
695
- //#endregion
696
- //#region src/services/fieldTemplate.tsx
697
- function et(e) {
698
- let { name: t, label: n, showAsterisk: r, className: i, unShowFieldTemplate: a, errorMessage: o, children: s, orientation: c } = e;
699
- return a ? s : /* @__PURE__ */ m(Ve, {
700
- id: t,
701
- className: i,
702
- orientation: c,
703
- children: [
704
- n && /* @__PURE__ */ p(Be, {
705
- showAsterisk: r,
706
- children: n
707
- }),
708
- s,
709
- o && /* @__PURE__ */ p(ze, { children: o })
710
- ]
711
- });
712
- }
713
- //#endregion
714
- //#region src/components/select/selectChevron/index.tsx
715
- function tt(e) {
716
- let { iconSize: t, isLoading: n, disabled: r, readOnly: i, isFocused: a } = e;
717
- return n ? /* @__PURE__ */ p(f, {}) : /* @__PURE__ */ p(C, {
718
- className: `arkynSelectChevron ${r || i ? "notAnimate" : ""} ${a ? "focused" : ""}`,
719
- strokeWidth: 2.5,
720
- style: {
721
- minWidth: t,
722
- minHeight: t,
723
- maxWidth: t,
724
- maxHeight: t
725
- }
726
- });
727
- }
728
- //#endregion
729
- //#region src/components/select/selectContainer/index.tsx
730
- function nt(e) {
731
- let { children: t, handleContainerFocus: n, disabled: r, isError: i, isLoading: a, isFocused: o, className: s, readOnly: c, variant: l, size: u, id: d, prefixExists: f } = e;
732
- return /* @__PURE__ */ p("section", {
733
- id: d,
734
- className: `arkynSelectContainer ${f ? "hasPrefix" : ""} ${l} ${u} ${r || c || a ? "opacity" : ""} ${i ? "errored" : ""} ${o ? "focused" : ""} ${s}`,
735
- onClick: n,
736
- children: t
737
- });
738
- }
739
- //#endregion
740
- //#region src/components/select/selectContent/index.tsx
741
- function rt(e) {
742
- let { children: t, size: n } = e;
743
- return /* @__PURE__ */ p("div", {
744
- className: `arkynSelectContent ${n}`,
745
- children: t
746
- });
747
- }
748
- //#endregion
749
- //#region src/components/select/selectOption/index.tsx
750
- function it(e) {
751
- let { label: t, optionHasSelected: n, handleChangeValue: r, value: i, size: a } = e;
752
- return /* @__PURE__ */ m("div", {
753
- onClick: () => r(i),
754
- className: `arkynSelectOption ${a} ${n(i) ? "active" : ""}`,
755
- children: [
756
- t,
757
- " ",
758
- /* @__PURE__ */ p(x, {})
759
- ]
760
- });
761
- }
762
- //#endregion
763
- //#region src/hooks/useScrollLock.ts
764
- function at() {
765
- return typeof window > "u" ? 0 : window.innerWidth - document.documentElement.clientWidth;
766
- }
767
- function ot(e) {
768
- o(() => {
769
- if (e) {
770
- let e = document.body.style.overflow, t = document.body.style.paddingRight, n = at();
771
- if (n > 0) {
772
- let e = window.getComputedStyle(document.body), t = parseInt(e.paddingRight) || 0;
773
- document.body.style.paddingRight = `${t + n}px`;
774
- }
775
- return document.body.style.overflow = "hidden", () => {
776
- document.body.style.overflow = e, document.body.style.paddingRight = t;
777
- };
778
- }
779
- }, [e]);
780
- }
781
- //#endregion
782
- //#region src/components/input/index.tsx
783
- function st(e) {
784
- let { name: t, disabled: n, title: r, style: i, variant: a = "solid", label: o, className: c = "", prefix: d, suffix: f, isLoading: h = !1, leftIcon: g, readOnly: _, onFocus: v, onBlur: y, unShowFieldTemplate: b = !1, errorMessage: x, showAsterisk: S, rightIcon: C, type: w = "text", size: T = "md", id: E, value: D, placeholder: O, orientation: k, ...A } = e, { fieldErrors: j } = X(), [M, N] = u(!1), P = l(null), F = E || s(), I = x || j?.[t], R = !!I, z = n || h, B = {
785
- md: 20,
786
- lg: 20
787
- }[T], V = C ? "right" : "left", H = V === "left" && h, U = V === "right" && h;
788
- function W() {
789
- z || !P?.current || (N(!0), P.current.focus());
790
- }
791
- function G(e) {
792
- N(!0), v && v(e);
793
- }
794
- function K(e) {
795
- N(!1), y && y(e);
796
- }
797
- return w === "hidden" ? /* @__PURE__ */ p("input", {
798
- style: { display: "none" },
799
- readOnly: !0,
800
- type: "text",
801
- ref: P,
802
- ...A
803
- }) : /* @__PURE__ */ p(et, {
804
- name: t,
805
- label: o,
806
- showAsterisk: S,
807
- className: c,
808
- errorMessage: I,
809
- unShowFieldTemplate: b,
810
- orientation: k,
811
- children: /* @__PURE__ */ m("section", {
812
- title: r,
813
- style: i,
814
- onClick: W,
815
- className: `arkynInput ${d ? "hasPrefix" : ""} ${n ? "disabled" : ""} ${f ? "hasSuffix" : ""} ${a} ${T} ${z || _ || h ? "opacity" : ""} ${R ? "errored" : ""} ${M ? "focused" : ""}`,
816
- children: [
817
- /* @__PURE__ */ p(Z, {
818
- iconSize: B,
819
- icon: d,
820
- className: "prefix"
821
- }),
822
- /* @__PURE__ */ p(Z, {
823
- show: H,
824
- iconSize: B,
825
- className: "spinner",
826
- icon: L
827
- }),
828
- /* @__PURE__ */ p(Z, {
829
- show: !h,
830
- icon: g,
831
- iconSize: B
832
- }),
833
- /* @__PURE__ */ p("input", {
834
- disabled: z,
835
- readOnly: _,
836
- ref: P,
837
- onFocus: G,
838
- onBlur: K,
839
- type: w,
840
- id: F,
841
- name: t,
842
- placeholder: z && D || O,
843
- value: z ? void 0 : D,
844
- ...A
845
- }),
846
- /* @__PURE__ */ p(Z, {
847
- show: !h,
848
- icon: C,
849
- iconSize: B
850
- }),
851
- /* @__PURE__ */ p(Z, {
852
- show: U,
853
- iconSize: B,
854
- className: "spinner",
855
- icon: L
856
- }),
857
- /* @__PURE__ */ p(Z, {
858
- iconSize: B,
859
- icon: f,
860
- className: "suffix"
861
- })
862
- ]
863
- })
864
- });
865
- }
866
- //#endregion
867
- //#region src/components/select/selectOptionsContainer/index.tsx
868
- function ct(e) {
869
- let { children: t, isFocused: n, isSearchable: r, search: i, onSearch: a } = e, s = l(null), [c, d] = u("bottom");
870
- ot(n), o(() => {
871
- n && (() => {
872
- if (!s.current) return;
873
- let e = s.current.parentElement;
874
- if (!e) return;
875
- let t = e.getBoundingClientRect();
876
- window.innerHeight - t.bottom < 300 && t.top > 300 ? d("top") : d("bottom");
877
- })();
878
- }, [n]);
879
- function h(e) {
880
- r && a(e.target.value);
881
- }
882
- return n ? /* @__PURE__ */ m("div", {
883
- ref: s,
884
- className: `arkynSelectOptionsContainer ${c}`,
885
- children: [r && /* @__PURE__ */ p(st, {
886
- type: "search",
887
- name: "search-select",
888
- variant: "underline",
889
- leftIcon: U,
890
- value: i,
891
- onChange: h
892
- }), t]
893
- }) : /* @__PURE__ */ p(f, {});
894
- }
895
- //#endregion
896
- //#region src/components/select/selectOverlay/index.tsx
897
- function lt(e) {
898
- let { isFocused: t, handleBlur: n } = e;
899
- return t ? /* @__PURE__ */ p("aside", {
900
- className: "arkynSelectOverlay",
901
- onClick: n
902
- }) : /* @__PURE__ */ p(f, {});
903
- }
904
- //#endregion
905
- //#region src/components/select/selectSpinner/index.tsx
906
- function ut(e) {
907
- let { iconSize: t, isLoading: n } = e;
908
- return n ? /* @__PURE__ */ p(L, {
909
- className: "arkynSelectSpinner",
910
- size: t,
911
- strokeWidth: 2.5
912
- }) : /* @__PURE__ */ p(f, {});
913
- }
914
- //#endregion
915
- //#region src/components/select/index.tsx
916
- function dt(e) {
917
- let { name: t, options: n, className: r = "", placeholder: i = "Selecione...", closeOnSelect: a = !0, defaultValue: o = "", errorMessage: c, isLoading: d = !1, readOnly: f = !1, isSearchable: h = !1, id: g, label: _, optionMaxHeight: v, showAsterisk: y, leftIcon: b, onSearch: x, onChange: S, onBlur: C, notFoundText: w = "Sem opções disponíveis", onFocus: T, disabled: E = !1, prefix: D, size: O = "md", value: k, variant: A = "solid", orientation: j = "vertical", unShowFieldTemplate: M = !1 } = e, { fieldErrors: N } = X(), P = l(null), F = g || s(), I = c || N?.[t], L = !!I, R = E || d || f, z = {
918
- md: 20,
919
- lg: 20
920
- }[O], [B, V] = u(""), [H, U] = u(!1), [W, G] = u(o), K = k || W;
921
- function q(e) {
922
- return K === e;
923
- }
924
- function ee(e) {
925
- return n.find((t) => t.value === e)?.label || "";
926
- }
927
- function J() {
928
- R || !P?.current || H || (U(!0), P.current.focus(), T && T());
929
- }
930
- function te() {
931
- U(!1), C && P.current && P.current.blur();
932
- }
933
- function ne(e) {
934
- V(e), x && x(e);
935
- }
936
- function re(e) {
937
- q(e) ? (G(""), S && S("")) : (G(e), S && S(e)), a && te();
938
- }
939
- let ie = n.filter((t) => !!(e.onSearch || !e.isSearchable || t.label.toLowerCase().includes(B.toLowerCase())));
940
- return /* @__PURE__ */ p(et, {
941
- name: t,
942
- label: _,
943
- showAsterisk: y,
944
- className: r,
945
- errorMessage: I,
946
- unShowFieldTemplate: M,
947
- orientation: j,
948
- children: /* @__PURE__ */ m(nt, {
949
- handleContainerFocus: J,
950
- disabled: R,
951
- isError: L,
952
- isFocused: H,
953
- isLoading: d,
954
- readOnly: f,
955
- size: O,
956
- variant: A,
957
- prefixExists: !!D,
958
- id: F,
959
- children: [
960
- /* @__PURE__ */ p("input", {
961
- ref: P,
962
- name: t,
963
- value: K,
964
- type: "hidden"
965
- }),
966
- /* @__PURE__ */ p(Z, {
967
- iconSize: z,
968
- icon: D,
969
- className: "prefix"
970
- }),
971
- b && /* @__PURE__ */ p(b, {
972
- size: z,
973
- strokeWidth: 2.5
974
- }),
975
- /* @__PURE__ */ m(rt, {
976
- size: O,
977
- children: [K !== "" && /* @__PURE__ */ p("p", {
978
- className: "hasValue",
979
- children: ee(K)
980
- }), K === "" && /* @__PURE__ */ p("p", { children: i })]
981
- }),
982
- /* @__PURE__ */ m(ct, {
983
- isFocused: H,
984
- isSearchable: h,
985
- search: B,
986
- onSearch: ne,
987
- children: [ie.map(({ label: e, value: t }) => /* @__PURE__ */ p(it, {
988
- label: e,
989
- value: t,
990
- size: O,
991
- handleChangeValue: re,
992
- optionHasSelected: q
993
- }, t)), ie.length <= 0 && /* @__PURE__ */ p("p", { children: w })]
994
- }),
995
- /* @__PURE__ */ p(tt, {
996
- disabled: R,
997
- isFocused: H,
998
- readOnly: f,
999
- iconSize: z,
1000
- isLoading: d
1001
- }),
1002
- /* @__PURE__ */ p(ut, {
1003
- iconSize: z,
1004
- isLoading: d
1005
- }),
1006
- /* @__PURE__ */ p(lt, {
1007
- handleBlur: te,
1008
- isFocused: H
1009
- })
1010
- ]
1011
- })
1012
- });
1013
- }
1014
- //#endregion
1015
- //#region src/components/calendar/calendarHeader/index.tsx
1016
- function ft({ basicMode: e }) {
1017
- let t = Ze();
1018
- return e ? /* @__PURE__ */ m("div", {
1019
- className: "arkynCalendarHeader",
1020
- children: [
1021
- /* @__PURE__ */ p("button", {
1022
- className: "arkynCalendarButton",
1023
- onClick: () => t.previousMonth(),
1024
- children: /* @__PURE__ */ p(w, {})
1025
- }),
1026
- /* @__PURE__ */ p("p", { children: t.currentDate }),
1027
- /* @__PURE__ */ p("button", {
1028
- className: "arkynCalendarButton",
1029
- onClick: () => t.nextMonth(),
1030
- children: /* @__PURE__ */ p(T, {})
1031
- })
1032
- ]
1033
- }) : /* @__PURE__ */ m("div", {
1034
- className: "arkynCalendarHeader",
1035
- children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("button", {
1036
- className: "arkynCalendarButton",
1037
- onClick: () => t.previousMonth(),
1038
- children: /* @__PURE__ */ p(w, {})
1039
- }), /* @__PURE__ */ p("button", {
1040
- className: "arkynCalendarButton",
1041
- onClick: () => t.nextMonth(),
1042
- children: /* @__PURE__ */ p(T, {})
1043
- })] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p(dt, {
1044
- name: "calendarMonth",
1045
- variant: "underline",
1046
- className: "calendarMonthSelect",
1047
- value: t.currentMonth,
1048
- options: t.listMonths,
1049
- onChange: (e) => t.changeMonth(+e)
1050
- }), /* @__PURE__ */ p(dt, {
1051
- name: "calendarYear",
1052
- variant: "underline",
1053
- className: "calendarYearSelect",
1054
- value: t.currentYear,
1055
- options: t.listYears,
1056
- onChange: (e) => t.changeYear(+e)
1057
- })] })]
1058
- });
1059
- }
1060
- //#endregion
1061
- //#region src/components/calendar/calendarTableTd/index.tsx
1062
- function pt(e) {
1063
- let { day: t, month: n, year: r, dayOwner: i, dayType: a } = e, { changeDay: o } = Ze();
1064
- function s() {
1065
- let e = /* @__PURE__ */ new Date();
1066
- return t === e.getDate() && n === e.getMonth() && r === e.getFullYear();
1067
- }
1068
- return /* @__PURE__ */ p("td", {
1069
- onClick: () => o(t, n, r),
1070
- className: `arkynCalendarTableTd ${i} ${a} ${s() ? "today" : ""}`,
1071
- children: /* @__PURE__ */ m("div", {
1072
- className: "textGroup",
1073
- children: [/* @__PURE__ */ p("span", {}), /* @__PURE__ */ p("p", { children: t })]
1074
- })
1075
- });
1076
- }
1077
- //#endregion
1078
- //#region src/components/calendar/calendarTableBody/index.tsx
1079
- function mt() {
1080
- return /* @__PURE__ */ p("tbody", {
1081
- className: "arkynCalendarTableBody",
1082
- children: Ze().listMatrix.map((e, t) => /* @__PURE__ */ p("tr", { children: e.map((e, t) => /* @__PURE__ */ p(pt, { ...e }, t)) }, t))
1083
- });
1084
- }
1085
- //#endregion
1086
- //#region src/components/calendar/calendarTableContainer/index.tsx
1087
- function ht({ children: e }) {
1088
- return /* @__PURE__ */ p("table", {
1089
- className: "arkynCalendarTableContainer",
1090
- children: e
1091
- });
1092
- }
1093
- //#endregion
1094
- //#region src/components/calendar/calendarTableHeader/index.tsx
1095
- function gt() {
1096
- let { listWeek: e } = Ze();
1097
- return /* @__PURE__ */ p("thead", {
1098
- className: "arkynCalendarTableHeader",
1099
- children: /* @__PURE__ */ p("tr", { children: e.map((e, t) => /* @__PURE__ */ p("th", { children: J(e) }, t)) })
1100
- });
1101
- }
1102
- //#endregion
1103
- //#region src/components/calendar/index.tsx
1104
- function _t(e) {
1105
- let t = e.variant || "complete";
1106
- return e.type === "range" ? /* @__PURE__ */ p(Qe, {
1107
- defaultValue: e.defaultValue,
1108
- calendarType: "range",
1109
- onChange: e.onChange,
1110
- onChangeView: e.onChangeView,
1111
- children: /* @__PURE__ */ m($e, { children: [/* @__PURE__ */ p(ft, { basicMode: t.includes("basic") }), /* @__PURE__ */ m(ht, { children: [/* @__PURE__ */ p(gt, {}), /* @__PURE__ */ p(mt, {})] })] })
1112
- }) : /* @__PURE__ */ p(Qe, {
1113
- defaultValue: e.defaultValue,
1114
- calendarType: "single",
1115
- onChange: e.onChange,
1116
- onChangeView: e.onChangeView,
1117
- children: /* @__PURE__ */ m($e, { children: [/* @__PURE__ */ p(ft, { basicMode: t.includes("basic") }), /* @__PURE__ */ m(ht, { children: [/* @__PURE__ */ p(gt, {}), /* @__PURE__ */ p(mt, {})] })] })
1118
- });
1119
- }
1120
- //#endregion
1121
- //#region src/components/cardTab/cardTabContext.tsx
1122
- var vt = n({});
1123
- function yt() {
1124
- return a(vt);
1125
- }
1126
- function bt(e) {
1127
- return /* @__PURE__ */ p(vt.Provider, {
1128
- value: e,
1129
- children: e.children
1130
- });
1131
- }
1132
- //#endregion
1133
- //#region src/components/cardTab/cardTabButton/index.tsx
1134
- function xt(e) {
1135
- let { children: t, disabled: n = !1, className: r = "", onClick: i, value: a, ...o } = e, { disabled: s, currentTab: c, changeCurrentTab: l } = yt(), u = s || n, d = `arkynCardTabButton ${u ? "isDisabled" : ""} ${c === a && a ? "isActive" : ""} ${r}`;
1136
- function f(e) {
1137
- l(a), i && i(e);
1138
- }
1139
- return /* @__PURE__ */ p("button", {
1140
- onClick: f,
1141
- className: d.trim(),
1142
- ...o,
1143
- disabled: u,
1144
- type: "button",
1145
- children: t
1146
- });
1147
- }
1148
- //#endregion
1149
- //#region src/components/cardTab/cardTabContainer/index.tsx
1150
- function St(e) {
1151
- let { children: t, onChange: n, defaultValue: r, disabled: i = !1, className: a, ...o } = e, [s, c] = u(r || ""), l = `arkynCardTabContainer ${a || ""}`;
1152
- function d(e) {
1153
- c(e), n && n(e);
1154
- }
1155
- return /* @__PURE__ */ p(bt, {
1156
- disabled: i,
1157
- currentTab: s,
1158
- changeCurrentTab: d,
1159
- children: /* @__PURE__ */ p("nav", {
1160
- className: l.trim(),
1161
- ...o,
1162
- children: t
1163
- })
1164
- });
1165
- }
1166
- //#endregion
1167
- //#region src/components/checkbox/index.tsx
1168
- function Ct(e) {
1169
- let { id: t, name: n, className: r = "", size: i = "md", errorMessage: a, defaultChecked: o = !1, label: c, checked: d = null, onCheck: f, orientation: h = "horizontalReverse", showAsterisk: g, unShowFieldTemplate: _, value: v, ...y } = e, { fieldErrors: b } = X(), S = l(null), C = t || s(), w = a || b?.[n], T = !!w, [E, D] = u(o || !1), O = typeof d == "boolean" ? d : E, k = `arkynCheckbox ${i} ${T ? "errorTrue" : "errorFalse"} ${O ? "checkedTrue" : "checkedFalse"}`;
1170
- function A() {
1171
- let e = E;
1172
- D(!e), f && f(e ? "" : v || "checked");
1173
- }
1174
- return /* @__PURE__ */ p(et, {
1175
- name: n,
1176
- label: c,
1177
- showAsterisk: g,
1178
- className: r,
1179
- errorMessage: w,
1180
- unShowFieldTemplate: _,
1181
- orientation: h,
1182
- children: /* @__PURE__ */ m("button", {
1183
- id: C,
1184
- type: "button",
1185
- className: k,
1186
- onClick: A,
1187
- ...y,
1188
- children: [/* @__PURE__ */ p("input", {
1189
- type: "hidden",
1190
- name: n,
1191
- ref: S,
1192
- value: O ? v || "checked" : ""
1193
- }), /* @__PURE__ */ p(x, {})]
1194
- })
1195
- });
1196
- }
1197
- //#endregion
1198
- //#region src/hooks/useHydrated.ts
1199
- function wt() {
1200
- return () => {};
1201
- }
1202
- function Tt() {
1203
- return d(wt, () => !0, () => !1);
1204
- }
1205
- //#endregion
1206
- //#region src/components/clientOnly.tsx
1207
- function Et(e) {
1208
- let { children: t, fallback: n = null } = e;
1209
- return Tt() ? /* @__PURE__ */ p(f, { children: t() }) : /* @__PURE__ */ p(f, { children: n });
1210
- }
1211
- //#endregion
1212
- //#region src/services/maskCurrencyValues.ts
1213
- function Dt(e) {
1214
- let t = e;
1215
- return typeof e == "string" ? (t = +re(e), t % 1 != 0 && (t = t.toFixed(2))) : t = Number.isInteger(e) ? Number(e) * 10 ** 2 : e.toFixed(2), re(String(t)) / 10 ** 2;
1216
- }
1217
- function Ot(e, t) {
1218
- if (!e) return [0, te(0, t)];
1219
- let n = Dt(e);
1220
- return [n, te(n, t)];
1221
- }
1222
- //#endregion
1223
- //#region src/components/currencyInput/index.tsx
1224
- function kt(e) {
1225
- let { name: t, disabled: n, title: r, style: i, variant: a = "solid", label: c, className: d = "", value: f, defaultValue: h, max: g = 1e9, locale: _, onChange: v, prefix: y, suffix: b, isLoading: x = !1, leftIcon: S, readOnly: C, onFocus: w, onBlur: T, errorMessage: E, unShowFieldTemplate: D, orientation: O, showAsterisk: k, rightIcon: A, size: j = "md", id: M, ...N } = e, { fieldErrors: P } = X(), [F, I] = u(!1), [R, z] = u("0"), B = l(null), V = M || s(), H = E || P?.[t], U = !!H, W = n || x, G = {
1226
- md: 20,
1227
- lg: 20
1228
- }[j], K = A ? "right" : "left", q = K === "left" && x, ee = K === "right" && x;
1229
- function J() {
1230
- W || !B?.current || (I(!0), B.current.focus());
1231
- }
1232
- function te(e) {
1233
- I(!0), w && w(e);
1234
- }
1235
- function ne(e) {
1236
- I(!1), T && T(e);
1237
- }
1238
- let re = (e) => {
1239
- let [t, n] = Ot(e, _);
1240
- return !g || t <= g ? (z(n), [t, n]) : Ot(e, _);
1241
- };
1242
- return o(() => {
1243
- function e() {
1244
- if (typeof f == "number") return f;
1245
- if (typeof h == "number") return h;
1246
- }
1247
- let [, t] = Ot(e(), _);
1248
- z(t);
1249
- }, [
1250
- _,
1251
- h,
1252
- f
1253
- ]), /* @__PURE__ */ p(et, {
1254
- name: t,
1255
- label: c,
1256
- showAsterisk: k,
1257
- className: d,
1258
- errorMessage: H,
1259
- unShowFieldTemplate: D,
1260
- orientation: O,
1261
- children: /* @__PURE__ */ m("section", {
1262
- title: r,
1263
- style: i,
1264
- className: `arkynCurrencyInput ${y ? "hasPrefix" : ""} ${b ? "hasSuffix" : ""} ${a} ${j} ${W || C || x ? "opacity" : ""} ${U ? "errored" : ""} ${F ? "focused" : ""}`,
1265
- onClick: J,
1266
- children: [
1267
- /* @__PURE__ */ p(Z, {
1268
- iconSize: G,
1269
- icon: y,
1270
- className: "prefix"
1271
- }),
1272
- /* @__PURE__ */ p(Z, {
1273
- show: q,
1274
- iconSize: G,
1275
- className: "spinner",
1276
- icon: L
1277
- }),
1278
- /* @__PURE__ */ p(Z, {
1279
- show: !x,
1280
- icon: S,
1281
- iconSize: G
1282
- }),
1283
- /* @__PURE__ */ p("input", {
1284
- disabled: W,
1285
- readOnly: C,
1286
- ref: B,
1287
- onFocus: te,
1288
- onBlur: ne,
1289
- onChange: (e) => {
1290
- e.preventDefault();
1291
- let [t, n] = re(e.target.value);
1292
- v && v(e, String(t), String(n));
1293
- },
1294
- id: V,
1295
- placeholder: W ? R : void 0,
1296
- value: W ? void 0 : R,
1297
- ...N
1298
- }),
1299
- /* @__PURE__ */ p("input", {
1300
- type: "hidden",
1301
- name: t,
1302
- value: Dt(R),
1303
- readOnly: !0
1304
- }),
1305
- /* @__PURE__ */ p(Z, {
1306
- show: !x,
1307
- icon: A,
1308
- iconSize: G
1309
- }),
1310
- /* @__PURE__ */ p(Z, {
1311
- show: ee,
1312
- iconSize: G,
1313
- className: "spinner",
1314
- icon: L
1315
- }),
1316
- /* @__PURE__ */ p(Z, {
1317
- iconSize: G,
1318
- icon: b,
1319
- className: "suffix"
1320
- })
1321
- ]
1322
- })
1323
- });
1324
- }
1325
- //#endregion
1326
- //#region src/components/drawer/drawerContext.tsx
1327
- var At = n({});
1328
- function jt(e) {
1329
- return /* @__PURE__ */ p(At.Provider, {
1330
- value: { makeInvisible: e.makeInvisible },
1331
- children: e.children
1332
- });
1333
- }
1334
- function Mt() {
1335
- return a(At);
1336
- }
1337
- //#endregion
1338
- //#region src/components/drawer/drawerContainer/index.tsx
1339
- function Nt(e) {
1340
- let { isVisible: t, makeInvisible: n, orientation: r = "left", children: i, className: a, ...o } = e;
1341
- ot(t);
1342
- let s = r === "left" ? "-100%" : "100%", c = `arkynDrawerContainer ${r} ${t ? "visibleTrue" : "visibleFalse"} ${a}`;
1343
- return /* @__PURE__ */ p(jt, {
1344
- makeInvisible: n,
1345
- children: /* @__PURE__ */ p(ie, { children: t && /* @__PURE__ */ m("aside", {
1346
- className: c.trim(),
1347
- ...o,
1348
- children: [/* @__PURE__ */ p(Y.div, {
1349
- className: "arkynDrawerContainerOverlay",
1350
- transition: {
1351
- duration: .15,
1352
- ease: "easeOut"
1353
- },
1354
- initial: { opacity: 0 },
1355
- animate: { opacity: 1 },
1356
- exit: { opacity: 0 },
1357
- onClick: n
1358
- }), /* @__PURE__ */ p(Y.div, {
1359
- className: "arkynDrawerContainerContent",
1360
- transition: {
1361
- ease: "easeOut",
1362
- duration: .15
1363
- },
1364
- initial: { transform: `translateX(${s})` },
1365
- animate: { transform: "translateX(0px)" },
1366
- exit: { transform: `translateX(${s})` },
1367
- children: i
1368
- })]
1369
- }) })
1370
- });
1371
- }
1372
- //#endregion
1373
- //#region src/components/drawer/drawerHeader/index.tsx
1374
- function Pt(e) {
1375
- let { showCloseButton: t = !0, className: n, children: r, ...i } = e, { makeInvisible: a } = Mt();
1376
- return /* @__PURE__ */ m("header", {
1377
- className: `arkynDrawerHeader ${n}`.trim(),
1378
- ...i,
1379
- children: [r, t && /* @__PURE__ */ p("button", {
1380
- className: "arkynDrawerHeaderCloseButton",
1381
- type: "button",
1382
- onClick: a,
1383
- "aria-label": "Close drawer",
1384
- children: /* @__PURE__ */ p(K, { size: 24 })
1385
- })]
1386
- });
1387
- }
1388
- //#endregion
1389
- //#region src/components/facebookPixel/pixel.ts
1390
- var Ft = class {
1391
- pixelId;
1392
- autoConfig;
1393
- initialized;
1394
- constructor(e, t) {
1395
- this.pixelId = e, this.autoConfig = t?.autoConfig || !0, this.initialized = !1;
1396
- }
1397
- loadFacebookPixel() {
1398
- if (window.fbq) return;
1399
- let e = function(...t) {
1400
- e.callMethod ? e.callMethod.apply(e, t) : e.queue.push(t);
1401
- };
1402
- window._fbq || (window._fbq = e), e.push = e, e.loaded = !0, e.version = "2.0", e.queue = [];
1403
- let t = document.createElement("script");
1404
- t.async = !0, t.src = "https://connect.facebook.net/en_US/fbevents.js";
1405
- let n = document.getElementsByTagName("script")[0];
1406
- if (!n.parentNode) throw Error("No script tag found in the document");
1407
- n.parentNode.insertBefore(t, n), window.fbq = e;
1408
- }
1409
- init(e = {}) {
1410
- if (this.initialized = typeof window < "u" && !!window.fbq, this.loadFacebookPixel(), !window.fbq) throw Error("window.fbq is not defined");
1411
- this.autoConfig === !1 ? window.fbq("set", "autoConfig", !1, this.pixelId) : window.fbq("init", this.pixelId, e), this.initialized = !0;
1412
- }
1413
- pageView() {
1414
- this.initialized && window.fbq && window.fbq("track", "PageView");
1415
- }
1416
- track(e, t) {
1417
- this.initialized && window.fbq && window.fbq("track", e, t);
1418
- }
1419
- trackSingle(e, t, n) {
1420
- this.initialized && window.fbq && window.fbq("trackSingle", e, t, n);
1421
- }
1422
- trackCustom(e, t) {
1423
- this.initialized && window.fbq && window.fbq("trackCustom", e, t);
1424
- }
1425
- trackSingleCustom(e, t, n) {
1426
- this.initialized && window.fbq && window.fbq("trackSingle", e, t, n);
1427
- }
1428
- grantConsent() {
1429
- this.initialized && window.fbq && window.fbq("consent", "grant");
1430
- }
1431
- revokeConsent() {
1432
- this.initialized && window.fbq && window.fbq("consent", "revoke");
1433
- }
1434
- };
1435
- //#endregion
1436
- //#region src/components/facebookPixel/facebookPixel.client.tsx
1437
- function It(e) {
1438
- let { pixelId: t, options: n, pageView: r, track: i, trackCustom: a, trackSingle: o, trackSingleCustom: s, grantConsent: c, revokeConsent: l } = e, u = new Ft(t, n);
1439
- return u.init(), r && u.pageView(), c && u.grantConsent(), l && u.revokeConsent(), i && u.track(...i), a && u.trackCustom(...a), o && u.trackSingle(t, ...o), s && u.trackSingleCustom(t, ...s), /* @__PURE__ */ p(f, {});
1440
- }
1441
- //#endregion
1442
- //#region src/components/facebookPixel/index.tsx
1443
- function Lt(e) {
1444
- return process.env.NODE_ENV !== "production" && !e.showInDevMode ? /* @__PURE__ */ p(f, {}) : /* @__PURE__ */ p(Et, { children: () => /* @__PURE__ */ p(It, { ...e }) });
1445
- }
1446
- //#endregion
1447
- //#region src/components/fileUpload/hasFileContent/index.tsx
1448
- function Rt(e) {
1449
- let { disabled: t, file: n, isLoading: r, acceptFile: i, changeFileButtonText: a, handleSelectFile: o, reSendFile: s } = e;
1450
- function c() {
1451
- if (t) return;
1452
- let e = document.createElement("input");
1453
- e.type = "file", e.accept = i, e.onchange = (e) => {
1454
- let t = e.target.files?.[0];
1455
- t && o(t);
1456
- }, e.click();
1457
- }
1458
- function l() {
1459
- return n.type.startsWith("image/") ? /* @__PURE__ */ p(j, {}) : n.type.startsWith("audio/") ? /* @__PURE__ */ p(A, {}) : n.type.startsWith("application/zip") ? /* @__PURE__ */ p(k, {}) : /* @__PURE__ */ p(O, {});
1460
- }
1461
- return /* @__PURE__ */ m("div", {
1462
- className: "arkynFileUploadHasFileContent",
1463
- children: [
1464
- /* @__PURE__ */ m("section", {
1465
- className: "arkynFileUploadFileContainer",
1466
- children: [/* @__PURE__ */ p(l, {}), /* @__PURE__ */ p("p", { children: n.name })]
1467
- }),
1468
- /* @__PURE__ */ p(He, {}),
1469
- /* @__PURE__ */ m("div", {
1470
- className: "arkynFileUploadButtonsContainer",
1471
- children: [!!s && /* @__PURE__ */ p(We, {
1472
- orientation: "bottom",
1473
- text: "Reenviar arquivo",
1474
- children: /* @__PURE__ */ p(Ue, {
1475
- type: "button",
1476
- "aria-label": "resend file",
1477
- variant: "outline",
1478
- scheme: "danger",
1479
- size: "sm",
1480
- isLoading: r,
1481
- onClick: s,
1482
- icon: H,
1483
- disabled: t
1484
- })
1485
- }), /* @__PURE__ */ p(Q, {
1486
- isLoading: r,
1487
- onClick: c,
1488
- variant: "outline",
1489
- size: "sm",
1490
- type: "button",
1491
- disabled: t,
1492
- children: a
1493
- })]
1494
- })
1495
- ]
1496
- });
1497
- }
1498
- //#endregion
1499
- //#region src/components/fileUpload/noFileContent/index.tsx
1500
- function zt(e) {
1501
- let { dropFileText: t, isLoading: n, acceptFile: r, handleSelectFile: i, selectFileButtonText: a, disabled: o } = e;
1502
- function s(e) {
1503
- if (o) return;
1504
- e.preventDefault();
1505
- let t = e.dataTransfer.files[0];
1506
- t && i(t);
1507
- }
1508
- function c() {
1509
- if (o) return;
1510
- let e = document.createElement("input");
1511
- e.type = "file", e.accept = r, e.onchange = (e) => {
1512
- let t = e.target.files?.[0];
1513
- t && i(t);
1514
- }, e.click();
1515
- }
1516
- return /* @__PURE__ */ m("div", {
1517
- onDrop: s,
1518
- className: "arkynFileUploadNoFileContent",
1519
- children: [/* @__PURE__ */ p(Q, {
1520
- isLoading: n,
1521
- onClick: c,
1522
- variant: "ghost",
1523
- size: "sm",
1524
- type: "button",
1525
- disabled: o,
1526
- children: a
1527
- }), /* @__PURE__ */ p("p", { children: t })]
1528
- });
1529
- }
1530
- //#endregion
1531
- //#region src/components/fileUpload/index.tsx
1532
- function Bt(e) {
1533
- let { name: t, label: n, showAsterisk: r = !1, action: i, fileName: a = "file", method: o = "POST", acceptFile: s = "*", fileResponseName: c = "url", changeFileButtonText: l = "Alterar arquivo", selectFileButtonText: d = "Selecionar arquivo", dropFileText: f = "Ou arraste e solte o arquivo aqui", onChange: h, disabled: g = !1 } = e, { fieldErrors: _ } = X(), v = _?.[t], [y, b] = u(""), [x, S] = u(""), [C, w] = u(null), [T, E] = u(!1);
1534
- async function D(e) {
1535
- if (g) return;
1536
- E(!0), w(e), S("");
1537
- let t = new FormData();
1538
- t.append(a, e), await fetch(i, {
1539
- method: o,
1540
- body: t
1541
- }).then(async (e) => await e.json()).then((e) => {
1542
- e?.error ? S(e.error) : b(e?.[c]), h && h(e?.[c]);
1543
- }).catch((e) => {
1544
- console.error(e), S("Erro ao enviar o arquivo");
1545
- }).finally(() => E(!1));
1546
- }
1547
- function O(e) {
1548
- g || D(e);
1549
- }
1550
- let k = v || x;
1551
- return /* @__PURE__ */ m(Ve, { children: [
1552
- n && /* @__PURE__ */ p(Be, {
1553
- showAsterisk: r,
1554
- children: n
1555
- }),
1556
- /* @__PURE__ */ m("div", {
1557
- className: `arkynFileUpload ${k ? "hasError" : "noHasError"} ${C ? "hasFile" : "noHasFile"}`,
1558
- children: [
1559
- /* @__PURE__ */ p("input", {
1560
- type: "hidden",
1561
- name: t,
1562
- value: y || ""
1563
- }),
1564
- !C && /* @__PURE__ */ p(zt, {
1565
- disabled: g,
1566
- isLoading: T,
1567
- acceptFile: s,
1568
- dropFileText: f,
1569
- handleSelectFile: O,
1570
- selectFileButtonText: d
1571
- }),
1572
- C && /* @__PURE__ */ p(Rt, {
1573
- disabled: g,
1574
- isLoading: T,
1575
- acceptFile: s,
1576
- file: C,
1577
- handleSelectFile: O,
1578
- changeFileButtonText: l,
1579
- reSendFile: k && C ? () => D(C) : void 0
1580
- })
1581
- ]
1582
- }),
1583
- k && /* @__PURE__ */ p(ze, { children: k })
1584
- ] });
1585
- }
1586
- //#endregion
1587
- //#region src/components/fullCalendar/_viewService.ts
1588
- var Vt = class {
1589
- capitalize(e) {
1590
- return J(e);
1591
- }
1592
- listHours(e) {
1593
- let [t, n] = e, r = [];
1594
- for (let e = t * 60; e <= n * 60; e += 30) r.push(e);
1595
- return r;
1596
- }
1597
- formatHourLabel(e) {
1598
- let t = Math.floor(e / 60), n = e % 60;
1599
- return `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
1600
- }
1601
- getStartOfWeek(e) {
1602
- let t = new Date(e);
1603
- return t.setHours(0, 0, 0, 0), t.setDate(t.getDate() - t.getDay()), t;
1604
- }
1605
- listWeek(e, t) {
1606
- let n = [], r = this.getStartOfWeek(e);
1607
- for (let e = 0; e < 7; e++) {
1608
- let i = new Date(r);
1609
- i.setDate(r.getDate() + e);
1610
- let a = i.toLocaleDateString(t, { weekday: "short" });
1611
- n.push(a);
1612
- }
1613
- return n;
1614
- }
1615
- listWeeklyMatrix(e, t) {
1616
- let n = this.getStartOfWeek(e), r = e.getMonth();
1617
- return t.map((t) => Array.from({ length: 7 }, (i, a) => {
1618
- let o = new Date(n);
1619
- o.setDate(n.getDate() + a);
1620
- let s = "current";
1621
- return (o.getMonth() < r || o.getFullYear() < e.getFullYear()) && (s = "previous"), (o.getMonth() > r || o.getFullYear() > e.getFullYear()) && (s = "next"), {
1622
- day: o.getDate(),
1623
- month: o.getMonth(),
1624
- year: o.getFullYear(),
1625
- dayOwner: s,
1626
- timeInMinutes: t
1627
- };
1628
- }));
1629
- }
1630
- listMonthlyMatrix(e) {
1631
- let t = e.getFullYear(), n = e.getMonth(), r = new Date(t, n, 1).getDay(), i = new Date(t, n + 1, 0).getDate(), a = new Date(t, n, 0).getDate(), o = Math.ceil((r + i) / 7) * 7, s = [], c = 1, l = 1;
1632
- for (let e = 0; e < o; e++) {
1633
- let o = Math.floor(e / 7);
1634
- if (s[o] || (s[o] = []), e < r) {
1635
- let i = a - (r - e - 1), c = n === 0 ? 11 : n - 1, l = n === 0 ? t - 1 : t;
1636
- s[o].push({
1637
- day: i,
1638
- month: c,
1639
- year: l,
1640
- dayOwner: "previous"
1641
- });
1642
- } else if (c <= i) s[o].push({
1643
- day: c,
1644
- month: n,
1645
- year: t,
1646
- dayOwner: "current"
1647
- }), c++;
1648
- else {
1649
- let e = n === 11 ? 0 : n + 1, r = n === 11 ? t + 1 : t;
1650
- s[o].push({
1651
- day: l,
1652
- month: e,
1653
- year: r,
1654
- dayOwner: "next"
1655
- }), l++;
1656
- }
1657
- }
1658
- return s;
1659
- }
1660
- nextMonth(e, t) {
1661
- let n = new Date(e);
1662
- n.setMonth(n.getMonth() + 1), t(n);
1663
- }
1664
- nextWeek(e, t) {
1665
- let n = new Date(e);
1666
- n.setDate(n.getDate() + 7), t(n);
1667
- }
1668
- nextDay(e, t) {
1669
- let n = new Date(e);
1670
- n.setDate(n.getDate() + 1), t(n);
1671
- }
1672
- previousMonth(e, t) {
1673
- let n = new Date(e);
1674
- n.setMonth(n.getMonth() - 1), t(n);
1675
- }
1676
- previousWeek(e, t) {
1677
- let n = new Date(e);
1678
- n.setDate(n.getDate() - 7), t(n);
1679
- }
1680
- previousDay(e, t) {
1681
- let n = new Date(e);
1682
- n.setDate(n.getDate() - 1), t(n);
1683
- }
1684
- }, Ht = n({});
1685
- function $() {
1686
- return a(Ht);
1687
- }
1688
- function Ut(e) {
1689
- let t = e.language || "pt-BR", n = new Vt(), r = n.listHours([8, 18]), [i, a] = u(e.defaultValue || /* @__PURE__ */ new Date());
1690
- function o(t) {
1691
- e.onChangeView && e.onChangeView(t), a(t);
1692
- }
1693
- return /* @__PURE__ */ p(Ht.Provider, {
1694
- value: {
1695
- events: e.events,
1696
- blockedTimestamps: e.blockedTimestamps,
1697
- viewDate: i,
1698
- listHours: r,
1699
- listWeek: n.listWeek(i, t),
1700
- listMonthlyMatrix: n.listMonthlyMatrix(i),
1701
- listWeeklyMatrix: n.listWeeklyMatrix(i, r),
1702
- nextMonth: () => n.nextMonth(i, o),
1703
- nextWeek: () => n.nextWeek(i, o),
1704
- nextDay: () => n.nextDay(i, o),
1705
- previousMonth: () => n.previousMonth(i, o),
1706
- previousWeek: () => n.previousWeek(i, o),
1707
- previousDay: () => n.previousDay(i, o),
1708
- onClickDate: e.onClickDate
1709
- },
1710
- children: e.children
1711
- });
1712
- }
1713
- //#endregion
1714
- //#region src/components/fullCalendar/dayCalendar/dayCalendarContainer/index.tsx
1715
- function Wt({ children: e }) {
1716
- return /* @__PURE__ */ p("div", {
1717
- className: "arkynDayCalendarContainer",
1718
- children: e
1719
- });
1720
- }
1721
- //#endregion
1722
- //#region src/components/fullCalendar/dayCalendar/dayCalendarEvent/index.tsx
1723
- var Gt = 30, Kt = 205;
1724
- function qt(e) {
1725
- let { events: t, viewDate: n } = $(), r = n.getDate(), i = n.getMonth(), a = n.getFullYear(), o = t.map((e, t) => ({
1726
- event: e,
1727
- sourceIndex: t
1728
- })).filter(({ event: e }) => e.initialDate.getDate() === r && e.initialDate.getMonth() === i && e.initialDate.getFullYear() === a).sort((e, t) => {
1729
- let n = e.event.initialDate.getTime(), r = t.event.initialDate.getTime();
1730
- if (n !== r) return n - r;
1731
- let i = e.event.endDate?.getTime() ?? n + Gt * 6e4, a = t.event.endDate?.getTime() ?? r + Gt * 6e4;
1732
- return i === a ? e.sourceIndex - t.sourceIndex : i - a;
1733
- }), s = new Map(o.map((e, t) => [e.sourceIndex, t])), c = o.filter(({ event: t }) => {
1734
- let n = Math.floor(e.timeInMinutes / 60), o = e.timeInMinutes % 60;
1735
- function s() {
1736
- let e = t.initialDate.getHours(), r = t.initialDate.getMinutes();
1737
- if (e !== n) return !1;
1738
- if (o === 0) return r < 30 && r >= 0;
1739
- if (o === 30) return r >= 30 && r < 60;
1740
- }
1741
- return s() && t.initialDate.getDate() === r && t.initialDate.getMonth() === i && t.initialDate.getFullYear() === a;
1742
- });
1743
- if (c.length === 0) return /* @__PURE__ */ p(f, {});
1744
- function l(e, t) {
1745
- return `${r}-${i}-${a}-${t}-${e}`;
1746
- }
1747
- function u(e) {
1748
- let t = e.getHours(), n = e.getMinutes();
1749
- return n === 0 ? `${t}h` : `${t}h${n}`;
1750
- }
1751
- function d(e) {
1752
- let t = e.initialDate.getHours() * 60 + e.initialDate.getMinutes(), n = e.endDate ? e.endDate.getHours() * 60 + e.endDate.getMinutes() : t + Gt;
1753
- return {
1754
- startMinutes: t,
1755
- endMinutes: Math.max(n, t + 1)
1756
- };
1757
- }
1758
- function h(e, t) {
1759
- let n = d(e), r = s.get(t);
1760
- return r == null ? 0 : o.reduce((e, t, i) => {
1761
- if (i >= r) return e;
1762
- let a = d(t.event);
1763
- return a.startMinutes < n.endMinutes && a.endMinutes > n.startMinutes ? e + 1 : e;
1764
- }, 0);
1765
- }
1766
- function g(t, n) {
1767
- let { startMinutes: r, endMinutes: i } = d(t), a = r - e.timeInMinutes, o = Math.max(i - r, 1), s = a / Gt * 100, c = o / Gt * 100, l = h(t, n) * Kt;
1768
- return {
1769
- top: `${s}%`,
1770
- height: `${c}%`,
1771
- left: `${l}px`
1772
- };
1773
- }
1774
- function _(e, t) {
1775
- e.stopPropagation(), t.onClick?.(t.data);
1776
- }
1777
- return c.map(({ event: e, sourceIndex: t }, n) => /* @__PURE__ */ m("div", {
1778
- className: `arkynDayCalendarEvent ${e?.scheme || "primary"}`,
1779
- style: g(e, t),
1780
- onClick: (t) => _(t, e),
1781
- children: [/* @__PURE__ */ m("strong", { children: [
1782
- u(e.initialDate),
1783
- " ",
1784
- e?.endDate && `- ${u(e.endDate)}`
1785
- ] }), /* @__PURE__ */ p("p", { children: e.title })]
1786
- }, l(n, t)));
1787
- }
1788
- //#endregion
1789
- //#region src/components/fullCalendar/dayCalendar/dayCalendarRow/index.tsx
1790
- function Jt({ hour: e, timeInMinutes: t }) {
1791
- let n = new Vt(), { blockedTimestamps: r, viewDate: i, onClickDate: a } = $();
1792
- function o() {
1793
- return r.some((e) => i >= e.initialDate && i <= e.endDate);
1794
- }
1795
- function s(e) {
1796
- if (e.stopPropagation(), !o() && a) {
1797
- let e = new Date(i);
1798
- e.setHours(0, t, 0, 0), a(e);
1799
- }
1800
- }
1801
- return /* @__PURE__ */ m("div", {
1802
- className: `arkynDayCalendarRow ${o() ? "blocked" : ""}`,
1803
- "data-time": t,
1804
- onClick: s,
1805
- children: [/* @__PURE__ */ p("p", { children: n.formatHourLabel(e) }), /* @__PURE__ */ p("div", {
1806
- className: "arkynDayCalendarRowContent",
1807
- children: /* @__PURE__ */ p(qt, { timeInMinutes: t })
1808
- })]
1809
- });
1810
- }
1811
- //#endregion
1812
- //#region src/components/fullCalendar/dayCalendar/index.tsx
1813
- function Yt() {
1814
- let { listHours: e } = $();
1815
- return /* @__PURE__ */ p(Wt, { children: e.map((e) => /* @__PURE__ */ p(Jt, {
1816
- hour: e,
1817
- timeInMinutes: e
1818
- })) });
1819
- }
1820
- //#endregion
1821
- //#region src/components/fullCalendar/fullCalendarContainer/index.tsx
1822
- function Xt({ children: e }) {
1823
- return /* @__PURE__ */ p("div", {
1824
- className: "arkynFullCalendarContainer",
1825
- children: e
1826
- });
1827
- }
1828
- //#endregion
1829
- //#region src/components/fullCalendar/fullCalendarHeader/index.tsx
1830
- function Zt(e) {
1831
- let { setViewType: t, viewType: n } = e, r = $();
1832
- function i() {
1833
- switch (n) {
1834
- case "day": return r.previousDay();
1835
- case "week": return r.previousWeek();
1836
- case "month": return r.previousMonth();
1837
- }
1838
- }
1839
- function a() {
1840
- switch (n) {
1841
- case "day": return r.nextDay();
1842
- case "week": return r.nextWeek();
1843
- case "month": return r.nextMonth();
1844
- }
1845
- }
1846
- return /* @__PURE__ */ m("div", {
1847
- className: "arkynFullCalendarHeader",
1848
- children: [/* @__PURE__ */ m(St, {
1849
- defaultValue: n,
1850
- onChange: (e) => t(e),
1851
- children: [
1852
- /* @__PURE__ */ p(xt, {
1853
- value: "day",
1854
- children: "Dia"
1855
- }),
1856
- /* @__PURE__ */ p(xt, {
1857
- value: "week",
1858
- children: "Semana"
1859
- }),
1860
- /* @__PURE__ */ p(xt, {
1861
- value: "month",
1862
- children: "Mês"
1863
- })
1864
- ]
1865
- }), /* @__PURE__ */ m("div", {
1866
- className: "arkynFullCalendarHeaderActions",
1867
- children: [
1868
- /* @__PURE__ */ p(Ue, {
1869
- variant: "outline",
1870
- icon: w,
1871
- "aria-label": "Handle previous",
1872
- onClick: () => i()
1873
- }),
1874
- /* @__PURE__ */ p("p", { children: r.viewDate.toLocaleDateString("pt-BR", {
1875
- day: "2-digit",
1876
- month: "long",
1877
- year: "numeric"
1878
- }) }),
1879
- /* @__PURE__ */ p(Ue, {
1880
- variant: "outline",
1881
- icon: T,
1882
- "aria-label": "Handle next",
1883
- onClick: () => a()
1884
- })
1885
- ]
1886
- })]
1887
- });
1888
- }
1889
- //#endregion
1890
- //#region src/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.tsx
1891
- function Qt(e) {
1892
- let { events: t } = $(), n = t.filter((t) => t.initialDate.getDate() === e.day && t.initialDate.getMonth() === e.month && t.initialDate.getFullYear() === e.year);
1893
- if (n.length === 0) return /* @__PURE__ */ p(f, {});
1894
- function r(t) {
1895
- return `${e.day}-${e.month}-${e.year}-${t}`;
1896
- }
1897
- function i(e) {
1898
- let t = e.getHours(), n = e.getMinutes();
1899
- return n === 0 ? `${t}h` : `${t}h${n}`;
1900
- }
1901
- function a(e, t) {
1902
- e.stopPropagation(), t.onClick?.(t.data);
1903
- }
1904
- return n.map((e, t) => /* @__PURE__ */ m("div", {
1905
- className: `arkynMonthlyCalendarEvent ${e?.scheme || "primary"}`,
1906
- onClick: (t) => a(t, e),
1907
- children: [/* @__PURE__ */ m("strong", { children: [
1908
- i(e.initialDate),
1909
- " ",
1910
- e?.endDate && `- ${i(e.endDate)}`
1911
- ] }), /* @__PURE__ */ p("p", { children: e.title })]
1912
- }, r(t)));
1913
- }
1914
- //#endregion
1915
- //#region src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.tsx
1916
- function $t(e) {
1917
- let { day: t, month: n, year: r, dayOwner: i } = e, { blockedTimestamps: a, onClickDate: o } = $();
1918
- function s() {
1919
- let e = /* @__PURE__ */ new Date();
1920
- return t === e.getDate() && n === e.getMonth() && r === e.getFullYear();
1921
- }
1922
- function c() {
1923
- let e = new Date(r, n, t);
1924
- return a.some((t) => e >= t.initialDate && e <= t.endDate);
1925
- }
1926
- function l(e) {
1927
- e.stopPropagation(), !c() && o && o(new Date(r, n, t));
1928
- }
1929
- return /* @__PURE__ */ m("td", {
1930
- className: `arkynMonthlyCalendarTableTd ${i} ${c() ? "blocked" : ""}`,
1931
- onClick: l,
1932
- children: [/* @__PURE__ */ p("p", {
1933
- className: s() ? "today" : "",
1934
- children: t
1935
- }), /* @__PURE__ */ p("div", {
1936
- className: "arkynMonthlyCalendarEventContainer",
1937
- children: /* @__PURE__ */ p(Qt, {
1938
- day: t,
1939
- month: n,
1940
- year: r
1941
- })
1942
- })]
1943
- });
1944
- }
1945
- //#endregion
1946
- //#region src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.tsx
1947
- function en() {
1948
- return /* @__PURE__ */ p("tbody", {
1949
- className: "arkynMonthlyCalendarTableBody",
1950
- children: $().listMonthlyMatrix.map((e, t) => /* @__PURE__ */ p("tr", { children: e.map((e, t) => /* @__PURE__ */ p($t, { ...e }, t)) }, t))
1951
- });
1952
- }
1953
- //#endregion
1954
- //#region src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.tsx
1955
- function tn({ children: e }) {
1956
- return /* @__PURE__ */ p("div", {
1957
- className: "arkynMonthlyCalendarTableContainer",
1958
- children: /* @__PURE__ */ p("table", { children: e })
1959
- });
1960
- }
1961
- //#endregion
1962
- //#region src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.tsx
1963
- function nn() {
1964
- let { listWeek: e } = $();
1965
- return /* @__PURE__ */ p("thead", {
1966
- className: "arkynMonthlyCalendarTableHeader",
1967
- children: /* @__PURE__ */ p("tr", { children: e.map((e, t) => /* @__PURE__ */ p("th", { children: J(e) }, t)) })
1968
- });
1969
- }
1970
- //#endregion
1971
- //#region src/components/fullCalendar/monthlyCalendar/index.tsx
1972
- function rn() {
1973
- return /* @__PURE__ */ m(tn, { children: [/* @__PURE__ */ p(nn, {}), /* @__PURE__ */ p(en, {})] });
1974
- }
1975
- //#endregion
1976
- //#region src/components/fullCalendar/weekCalendar/weekCalendarEvent/index.tsx
1977
- var an = 30, on = 40;
1978
- function sn(e) {
1979
- let { events: t } = $(), n = t.map((e, t) => ({
1980
- event: e,
1981
- sourceIndex: t
1982
- })).filter(({ event: t }) => t.initialDate.getDate() === e.day && t.initialDate.getMonth() === e.month && t.initialDate.getFullYear() === e.year).sort((e, t) => {
1983
- let n = e.event.initialDate.getTime(), r = t.event.initialDate.getTime();
1984
- if (n !== r) return n - r;
1985
- let i = e.event.endDate?.getTime() ?? n + an * 6e4, a = t.event.endDate?.getTime() ?? r + an * 6e4;
1986
- return i === a ? e.sourceIndex - t.sourceIndex : i - a;
1987
- }), r = new Map(n.map((e, t) => [e.sourceIndex, t])), i = n.filter(({ event: t }) => {
1988
- let n = Math.floor(e.timeInMinutes / 60), r = e.timeInMinutes % 60;
1989
- function i() {
1990
- let e = t.initialDate.getHours(), i = t.initialDate.getMinutes();
1991
- if (e !== n) return !1;
1992
- if (r === 0) return i < 30 && i >= 0;
1993
- if (r === 30) return i >= 30 && i < 60;
1994
- }
1995
- return i() && t.initialDate.getDate() === e.day && t.initialDate.getMonth() === e.month && t.initialDate.getFullYear() === e.year;
1996
- });
1997
- if (i.length === 0) return /* @__PURE__ */ p(f, {});
1998
- function a(t, n) {
1999
- return `${e.day}-${e.month}-${e.year}-${n}-${t}`;
2000
- }
2001
- function o(e) {
2002
- let t = e.getHours(), n = e.getMinutes();
2003
- return n === 0 ? `${t}h` : `${t}h${n}`;
2004
- }
2005
- function s(e) {
2006
- let t = e.initialDate.getHours() * 60 + e.initialDate.getMinutes(), n = e.endDate ? e.endDate.getHours() * 60 + e.endDate.getMinutes() : t + an;
2007
- return {
2008
- startMinutes: t,
2009
- endMinutes: Math.max(n, t + 1)
2010
- };
2011
- }
2012
- function c(e, t) {
2013
- let i = s(e), a = r.get(t);
2014
- return a == null ? 0 : n.reduce((e, t, n) => {
2015
- if (n >= a) return e;
2016
- let r = s(t.event);
2017
- return r.startMinutes < i.endMinutes && r.endMinutes > i.startMinutes ? e + 1 : e;
2018
- }, 0);
2019
- }
2020
- function l(t, n) {
2021
- let { startMinutes: r, endMinutes: i } = s(t), a = r - e.timeInMinutes, o = Math.max(i - r, 1), l = a / an * 100, u = o / an * 100, d = c(t, n) * on;
2022
- return {
2023
- top: `${l}%`,
2024
- height: `${u}%`,
2025
- left: `${d}px`
2026
- };
2027
- }
2028
- function u(e, t) {
2029
- e.stopPropagation(), t.onClick?.(t.data);
2030
- }
2031
- return i.map(({ event: e, sourceIndex: t }, n) => /* @__PURE__ */ m("div", {
2032
- className: `arkynWeekCalendarEvent ${e?.scheme || "primary"}`,
2033
- style: l(e, t),
2034
- onClick: (t) => u(t, e),
2035
- children: [/* @__PURE__ */ m("strong", { children: [
2036
- o(e.initialDate),
2037
- " ",
2038
- e?.endDate && `- ${o(e.endDate)}`
2039
- ] }), /* @__PURE__ */ p("p", { children: e.title })]
2040
- }, a(n, t)));
2041
- }
2042
- //#endregion
2043
- //#region src/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.tsx
2044
- function cn(e) {
2045
- let { day: t, month: n, year: r, dayOwner: i, timeInMinutes: a } = e, { blockedTimestamps: o, onClickDate: s } = $();
2046
- function c() {
2047
- let e = new Date(r, n, t);
2048
- return o.some((t) => e >= t.initialDate && e <= t.endDate);
2049
- }
2050
- function l(e) {
2051
- if (e.stopPropagation(), !c() && s) {
2052
- let e = new Date(r, n, t);
2053
- e.setHours(0, a, 0, 0), s(e);
2054
- }
2055
- }
2056
- return /* @__PURE__ */ p("td", {
2057
- className: `arkynWeekCalendarTableTd ${i} ${c() ? "blocked" : ""}`,
2058
- "data-day": t,
2059
- "data-time": a,
2060
- onClick: l,
2061
- children: /* @__PURE__ */ p("div", {
2062
- className: "arkynWeekCalendarTableTdContent",
2063
- children: /* @__PURE__ */ p(sn, {
2064
- day: t,
2065
- month: n,
2066
- year: r,
2067
- timeInMinutes: a
2068
- })
2069
- })
2070
- });
2071
- }
2072
- //#endregion
2073
- //#region src/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.tsx
2074
- function ln() {
2075
- let e = $(), t = new Vt();
2076
- return /* @__PURE__ */ p("tbody", {
2077
- className: "arkynWeekCalendarTableBody",
2078
- children: e.listWeeklyMatrix.map((e) => /* @__PURE__ */ m("tr", { children: [/* @__PURE__ */ p("td", {
2079
- className: "hourTd",
2080
- children: /* @__PURE__ */ p("p", { children: t.formatHourLabel(e[0].timeInMinutes) })
2081
- }), e.map((e, t) => /* @__PURE__ */ p(cn, { ...e }, `${e.year}-${e.month}-${e.day}-${e.timeInMinutes}-${t}`))] }, e[0].timeInMinutes))
2082
- });
2083
- }
2084
- //#endregion
2085
- //#region src/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.tsx
2086
- function un({ children: e }) {
2087
- return /* @__PURE__ */ p("div", {
2088
- className: "arkynWeekCalendarTableContainer",
2089
- children: /* @__PURE__ */ p("table", { children: e })
2090
- });
2091
- }
2092
- //#endregion
2093
- //#region src/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.tsx
2094
- function dn() {
2095
- let { listWeek: e, listWeeklyMatrix: t } = $(), n = t[0] || [];
2096
- return /* @__PURE__ */ p("thead", {
2097
- className: "arkynWeekCalendarTableHeader",
2098
- children: /* @__PURE__ */ m("tr", { children: [/* @__PURE__ */ p("th", {}), e.map((e, t) => /* @__PURE__ */ p("th", { children: /* @__PURE__ */ m("div", {
2099
- className: "arkynWeekCalendarTableHeaderContent",
2100
- children: [/* @__PURE__ */ p("span", { children: J(e) }), /* @__PURE__ */ p("strong", { children: n[t]?.day })]
2101
- }) }, t))] })
2102
- });
2103
- }
2104
- //#endregion
2105
- //#region src/components/fullCalendar/weekCalendar/index.tsx
2106
- function fn() {
2107
- return /* @__PURE__ */ m(un, { children: [/* @__PURE__ */ p(dn, {}), /* @__PURE__ */ p(ln, {})] });
2108
- }
2109
- //#endregion
2110
- //#region src/components/fullCalendar/index.tsx
2111
- function pn(e) {
2112
- let [t, n] = u("month");
2113
- return /* @__PURE__ */ p(Ut, {
2114
- events: e.events || [],
2115
- defaultValue: e.defaultValue,
2116
- onChangeView: e.onChangeView,
2117
- blockedTimestamps: e.blockedTimestamps || [],
2118
- onClickDate: e.onClickDate,
2119
- children: /* @__PURE__ */ m(Xt, { children: [
2120
- /* @__PURE__ */ p(Zt, {
2121
- viewType: t,
2122
- setViewType: n
2123
- }),
2124
- t === "day" && /* @__PURE__ */ p(Yt, {}),
2125
- t === "month" && /* @__PURE__ */ p(rn, {}),
2126
- t === "week" && /* @__PURE__ */ p(fn, {})
2127
- ] })
2128
- });
2129
- }
2130
- //#endregion
2131
- //#region src/components/googleAnalytics/snippets/generateGAElements.ts
2132
- function mn(e) {
2133
- let { measurementId: t } = e;
2134
- return t || console.warn("Google Analytics Measurement ID is required"), {
2135
- src: `https://www.googletagmanager.com/gtag/js?id=${t}`,
2136
- script: `
2137
- window.dataLayer = window.dataLayer || [];
2138
- function gtag(){dataLayer.push(arguments);}
2139
- gtag('js', new Date());
2140
- gtag('config', '${t}');`
2141
- };
2142
- }
2143
- //#endregion
2144
- //#region src/components/googleAnalytics/googleAnalytics.tsx
2145
- var hn = class {
2146
- initializeAsyncScript(e) {
2147
- let t = document.createElement("script");
2148
- return t.async = !0, t.src = e, t;
2149
- }
2150
- initializeInlineScript(e) {
2151
- let t = document.createElement("script");
2152
- return t.innerHTML = e, t;
2153
- }
2154
- initialize(e) {
2155
- let { measurementId: t } = e, n = mn({ measurementId: t }), r = this.initializeAsyncScript(n.src), i = this.initializeInlineScript(n.script);
2156
- document.head.appendChild(r), document.head.appendChild(i);
2157
- }
2158
- };
2159
- //#endregion
2160
- //#region src/components/googleAnalytics/googleAnalytics.client.tsx
2161
- function gn(e) {
2162
- return new hn().initialize(e), /* @__PURE__ */ p(f, {});
2163
- }
2164
- //#endregion
2165
- //#region src/components/googleAnalytics/index.tsx
2166
- function _n(e) {
2167
- let { measurementId: t, showInDevMode: n = !1 } = e;
2168
- return process.env.NODE_ENV !== "production" && !n ? /* @__PURE__ */ p(f, {}) : /* @__PURE__ */ p(Et, { children: () => /* @__PURE__ */ p(gn, { measurementId: t }) });
2169
- }
2170
- //#endregion
2171
- //#region src/components/googleTagManager/snippets/appendToDataLayer.ts
2172
- function vn(e) {
2173
- let { dataLayer: t, dataLayerName: n } = e;
2174
- return `
2175
- window.${n} = window.${n} || [];
2176
- window.${n}.push(${JSON.stringify(t)})`;
2177
- }
2178
- //#endregion
2179
- //#region src/components/googleTagManager/snippets/generateGTMElements.ts
2180
- function yn(e) {
2181
- let { id: t, events: n, dataLayer: r, dataLayerName: i, preview: a, auth: o } = e, s = `&gtm_auth=${o}`, c = `&gtm_preview=${a}`;
2182
- return t || console.warn("GTM Id is required"), {
2183
- iframe: `
2184
- <iframe src="https://www.googletagmanager.com/ns.html?id=${t}${s}${c}&gtm_cookies_win=x"
2185
- height="0" width="0" style="display:none;visibility:hidden" id="tag-manager"></iframe>`,
2186
- script: `
2187
- (function(w,d,s,l,i){w[l]=w[l]||[];
2188
- w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js', ${JSON.stringify(n).slice(1, -1)}});
2189
- var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
2190
- j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+'${s}${c}&gtm_cookies_win=x';
2191
- f.parentNode.insertBefore(j,f);
2192
- })(window,document,'script','${i}','${t}');`,
2193
- dataLayerVar: vn({
2194
- dataLayer: r,
2195
- dataLayerName: i
2196
- })
2197
- };
2198
- }
2199
- //#endregion
2200
- //#region src/components/googleTagManager/googleTagManager.tsx
2201
- var bn = class {
2202
- initializeDataScript(e) {
2203
- let t = document.createElement("script");
2204
- return t.innerHTML = e, t;
2205
- }
2206
- initializeGTMElements(e) {
2207
- let t = yn(e);
2208
- return {
2209
- noScript: () => {
2210
- let e = document.createElement("noscript");
2211
- return e.innerHTML = t.iframe, e;
2212
- },
2213
- script: () => {
2214
- let e = document.createElement("script");
2215
- return e.innerHTML = t.script, e;
2216
- },
2217
- dataScript: this.initializeDataScript(t.dataLayerVar)
2218
- };
2219
- }
2220
- initializeDataLayer(e) {
2221
- let { dataLayer: t, dataLayerName: n } = e;
2222
- if (window[n]) return window[n].push(t);
2223
- let r = vn({
2224
- dataLayer: t,
2225
- dataLayerName: n
2226
- }), i = this.initializeDataScript(r);
2227
- document.head.insertBefore(i, document.head.childNodes[0]);
2228
- }
2229
- initialize(e) {
2230
- let { events: t, gtmId: n, dataLayer: r, auth: i = "", preview: a = "", dataLayerName: o = "dataLayer" } = e, s = this.initializeGTMElements({
2231
- id: n,
2232
- events: t,
2233
- dataLayer: r || void 0,
2234
- dataLayerName: o,
2235
- auth: i,
2236
- preview: a
2237
- });
2238
- r && document.head.appendChild(s.dataScript), document.head.insertBefore(s.script(), document.head.childNodes[0]), document.body.insertBefore(s.noScript(), document.body.childNodes[0]);
2239
- }
2240
- };
2241
- //#endregion
2242
- //#region src/components/googleTagManager/googleTagManager.client.tsx
2243
- function xn(e) {
2244
- return new bn().initialize(e), /* @__PURE__ */ p(f, {});
2245
- }
2246
- //#endregion
2247
- //#region src/components/googleTagManager/index.tsx
2248
- function Sn(e) {
2249
- let { gtmId: t, auth: n = "", preview: r = "", dataLayerName: i = "dataLayer", events: a = {}, dataLayer: o = {}, showInDevMode: s = !1 } = e;
2250
- return process.env.NODE_ENV !== "production" && !s ? /* @__PURE__ */ p(f, {}) : /* @__PURE__ */ p(Et, { children: () => /* @__PURE__ */ p(xn, {
2251
- auth: n,
2252
- dataLayer: o,
2253
- dataLayerName: i,
2254
- events: a,
2255
- gtmId: t,
2256
- preview: r
2257
- }) });
2258
- }
2259
- //#endregion
2260
- //#region src/components/imageUpload/hasFileContent/index.tsx
2261
- function Cn(e) {
2262
- let { disabled: t, filePath: n, isLoading: r, acceptImage: i, changeImageButtonText: a, handleSelectFile: o, reSendImage: s } = e;
2263
- function c() {
2264
- if (t) return;
2265
- let e = document.createElement("input");
2266
- e.type = "file", e.accept = i, e.onchange = (e) => {
2267
- let t = e.target.files?.[0];
2268
- t && o(t);
2269
- }, e.click();
2270
- }
2271
- return /* @__PURE__ */ m("div", {
2272
- className: "arkynImageUploadHasFileContent",
2273
- style: { backgroundImage: `url("${n}")` },
2274
- children: [s && /* @__PURE__ */ p(We, {
2275
- orientation: "bottom",
2276
- text: "Reenviar imagem",
2277
- children: /* @__PURE__ */ p(Ue, {
2278
- type: "button",
2279
- "aria-label": "resend image",
2280
- variant: "outline",
2281
- scheme: "danger",
2282
- size: "sm",
2283
- isLoading: r,
2284
- onClick: s,
2285
- icon: H,
2286
- disabled: t
2287
- })
2288
- }), /* @__PURE__ */ p(Q, {
2289
- isLoading: r,
2290
- onClick: c,
2291
- variant: "outline",
2292
- size: "sm",
2293
- type: "button",
2294
- disabled: t,
2295
- children: a
2296
- })]
2297
- });
2298
- }
2299
- //#endregion
2300
- //#region src/components/imageUpload/noFileContent/index.tsx
2301
- function wn(e) {
2302
- let { dropImageText: t, isLoading: n, acceptImage: r, handleSelectFile: i, selectImageButtonText: a, disabled: o } = e;
2303
- function s(e) {
2304
- if (o) return;
2305
- e.preventDefault();
2306
- let t = e.dataTransfer.files[0];
2307
- t && i(t);
2308
- }
2309
- function c() {
2310
- if (o) return;
2311
- let e = document.createElement("input");
2312
- e.type = "file", e.accept = r, e.onchange = (e) => {
2313
- let t = e.target.files?.[0];
2314
- t && i(t);
2315
- }, e.click();
2316
- }
2317
- return /* @__PURE__ */ m("div", {
2318
- onDrop: s,
2319
- className: "arkynImageUploadNoFileContent",
2320
- children: [/* @__PURE__ */ p(Q, {
2321
- isLoading: n,
2322
- onClick: c,
2323
- variant: "ghost",
2324
- size: "sm",
2325
- type: "button",
2326
- disabled: o,
2327
- children: a
2328
- }), /* @__PURE__ */ p("p", { children: t })]
2329
- });
2330
- }
2331
- //#endregion
2332
- //#region src/components/imageUpload/index.tsx
2333
- function Tn(e) {
2334
- let { name: t, defaultValue: n = "", label: r, showAsterisk: i = !1, action: a, fileName: o = "file", className: s = "", method: c = "POST", acceptImage: l = "image/*", fileResponseName: d = "url", changeImageButtonText: f = "Alterar imagem", selectImageButtonText: h = "Selecionar imagem", dropImageText: g = "Ou arraste e solte a imagem aqui", onChange: _, disabled: v = !1, unShowFieldTemplate: y = !1, orientation: b = "vertical" } = e, { fieldErrors: x } = X(), S = x?.[t], [C, w] = u(n), [T, E] = u(""), [D, O] = u(null), [k, A] = u(n), [j, M] = u(!1);
2335
- async function N(e) {
2336
- if (v) return;
2337
- M(!0), O(e), E("");
2338
- let t = new FormData();
2339
- t.append(o, e), await fetch(a, {
2340
- method: c,
2341
- body: t
2342
- }).then(async (e) => await e.json()).then((e) => {
2343
- e?.error ? E(e.error) : w(e?.[d]), _ && _(e?.[d]);
2344
- }).catch((e) => {
2345
- console.error(e), E("Erro ao enviar imagem");
2346
- }).finally(() => M(!1));
2347
- }
2348
- function P(e) {
2349
- v || (A(URL.createObjectURL(e)), N(e));
2350
- }
2351
- let F = S || T;
2352
- return /* @__PURE__ */ p(et, {
2353
- name: t,
2354
- label: r,
2355
- showAsterisk: i,
2356
- className: s,
2357
- errorMessage: F,
2358
- unShowFieldTemplate: y,
2359
- orientation: b,
2360
- children: /* @__PURE__ */ m("div", {
2361
- className: `arkynImageUpload ${F ? "hasError" : "noHasError"} ${k ? "hasImage" : "noHasImage"}`,
2362
- children: [
2363
- /* @__PURE__ */ p("input", {
2364
- type: "hidden",
2365
- name: t,
2366
- value: C || ""
2367
- }),
2368
- !k && /* @__PURE__ */ p(wn, {
2369
- disabled: v,
2370
- isLoading: j,
2371
- acceptImage: l,
2372
- dropImageText: g,
2373
- handleSelectFile: P,
2374
- selectImageButtonText: h
2375
- }),
2376
- k && /* @__PURE__ */ p(Cn, {
2377
- disabled: v,
2378
- isLoading: j,
2379
- acceptImage: l,
2380
- filePath: k,
2381
- handleSelectFile: P,
2382
- changeImageButtonText: f,
2383
- reSendImage: F && D ? () => N(D) : void 0
2384
- })
2385
- ]
2386
- })
2387
- });
2388
- }
2389
- //#endregion
2390
- //#region src/components/mapView/mapView.client.tsx
2391
- function En({ center: e, coordinates: t, onMarkerClick: n, accessToken: r, ...i }) {
2392
- let a = l(null), s = l(null), c = e || t[0];
2393
- return o(() => (ae.accessToken = r, a.current = new ae.Map({
2394
- container: s.current,
2395
- style: "mapbox://styles/mapbox/light-v11",
2396
- center: [c.lng, c.lat],
2397
- zoom: 13,
2398
- language: "pt-BR"
2399
- }), t.forEach((e) => {
2400
- let { lat: t, lng: r, popUp: i } = e, o = document.createElement("img");
2401
- o.className = "arkynMarker", o.src = "https://i.postimg.cc/mgKggjk7/Pin.png";
2402
- let s = new ae.Marker(o).setLngLat([r, t]).addTo(a.current);
2403
- if (i) {
2404
- let e = document.createElement("div");
2405
- oe(e).render(i);
2406
- let t = new ae.Popup({
2407
- offset: 25,
2408
- closeButton: !1,
2409
- className: "arkynMapViewPopup"
2410
- }).setDOMContent(e);
2411
- s.setPopup(t);
2412
- }
2413
- o.addEventListener("click", () => {
2414
- n && n(e), a.current.flyTo({
2415
- center: [r, t],
2416
- zoom: 15,
2417
- duration: 1200
2418
- }), s.togglePopup();
2419
- });
2420
- }), () => {
2421
- a.current?.remove();
2422
- }), []), /* @__PURE__ */ p("div", {
2423
- id: "map-container",
2424
- ref: s,
2425
- style: {
2426
- height: "100%",
2427
- width: "100%",
2428
- borderRadius: "8px"
2429
- },
2430
- ...i
2431
- });
2432
- }
2433
- //#endregion
2434
- //#region src/components/mapView/index.tsx
2435
- function Dn({ className: e }) {
2436
- return /* @__PURE__ */ p("div", {
2437
- className: "arkynMapViewPinnedEmpty " + e,
2438
- children: /* @__PURE__ */ p(R, {})
2439
- });
2440
- }
2441
- function On(e) {
2442
- let { coordinates: t, zoom: n = 18, accessToken: r, className: i, onMarkerClick: a, ...o } = e;
2443
- if (!t) return /* @__PURE__ */ p(Dn, { className: i });
2444
- let s = Array.isArray(t) ? t : [t];
2445
- return s.length === 0 ? /* @__PURE__ */ p(Dn, { className: i }) : /* @__PURE__ */ p(Et, {
2446
- fallback: /* @__PURE__ */ p(Dn, { className: i }),
2447
- children: () => /* @__PURE__ */ p(En, {
2448
- accessToken: r,
2449
- coordinates: s,
2450
- center: s[0],
2451
- onMarkerClick: a,
2452
- ...o
2453
- })
2454
- });
2455
- }
2456
- //#endregion
2457
- //#region src/components/maskedInput/index.tsx
2458
- var kn = r((e, t) => /* @__PURE__ */ p("input", {
2459
- ref: t,
2460
- ...e
2461
- }));
2462
- function An(e) {
2463
- let { name: t, disabled: n, title: r, style: i, variant: a = "solid", separate: o, mask: c, showMask: d, replacement: f, label: h, className: g = "", prefix: _, suffix: v, isLoading: y = !1, leftIcon: b, readOnly: x, onFocus: S, onBlur: C, errorMessage: w, defaultValue: T, showAsterisk: E, rightIcon: D, size: O = "md", id: k, value: A, placeholder: j, ...M } = e, { fieldErrors: N } = X(), [P, F] = u(!1), I = l(null), R = k || s(), z = w || N?.[t], B = !!z, V = n || y, H = {
2464
- md: 20,
2465
- lg: 20
2466
- }[O], U = D ? "right" : "left", W = U === "left" && y, G = U === "right" && y;
2467
- function K() {
2468
- V || !I?.current || (F(!0), I.current.focus());
2469
- }
2470
- function q(e) {
2471
- F(!0), S && S(e);
2472
- }
2473
- function ee(e) {
2474
- F(!1), C && C(e);
2475
- }
2476
- let J = `arkynMaskedInput ${_ ? "hasPrefix" : ""} ${v ? "hasSuffix" : ""} ${a} ${O} ${V || x || y ? "opacity" : ""} ${B ? "errored" : ""} ${P ? "focused" : ""}`;
2477
- return /* @__PURE__ */ m(Ve, {
2478
- className: g,
2479
- children: [
2480
- h && /* @__PURE__ */ p(Be, {
2481
- showAsterisk: E,
2482
- htmlFor: R,
2483
- children: h
2484
- }),
2485
- /* @__PURE__ */ m("section", {
2486
- title: r,
2487
- style: i,
2488
- onClick: K,
2489
- className: J,
2490
- children: [
2491
- /* @__PURE__ */ p(Z, {
2492
- iconSize: H,
2493
- icon: _,
2494
- className: "prefix"
2495
- }),
2496
- /* @__PURE__ */ p(Z, {
2497
- show: W,
2498
- iconSize: H,
2499
- className: "spinner",
2500
- icon: L
2501
- }),
2502
- /* @__PURE__ */ p(Z, {
2503
- show: !y,
2504
- icon: b,
2505
- iconSize: H
2506
- }),
2507
- /* @__PURE__ */ p(se, {
2508
- component: kn,
2509
- mask: c,
2510
- replacement: f,
2511
- separate: o,
2512
- showMask: d,
2513
- ref: I,
2514
- onFocus: q,
2515
- onBlur: ee,
2516
- disabled: V,
2517
- readOnly: x,
2518
- id: R,
2519
- name: t,
2520
- defaultValue: T || void 0,
2521
- placeholder: V && A || j,
2522
- value: V ? void 0 : A,
2523
- ...M
2524
- }),
2525
- /* @__PURE__ */ p(Z, {
2526
- show: !y,
2527
- icon: D,
2528
- iconSize: H
2529
- }),
2530
- /* @__PURE__ */ p(Z, {
2531
- show: G,
2532
- iconSize: H,
2533
- className: "spinner",
2534
- icon: L
2535
- }),
2536
- /* @__PURE__ */ p(Z, {
2537
- iconSize: H,
2538
- icon: v,
2539
- className: "suffix"
2540
- })
2541
- ]
2542
- }),
2543
- z && /* @__PURE__ */ p(ze, { children: z })
2544
- ]
2545
- });
2546
- }
2547
- //#endregion
2548
- //#region src/components/modal/modalContext.tsx
2549
- var jn = n({});
2550
- function Mn(e) {
2551
- return /* @__PURE__ */ p(jn.Provider, {
2552
- value: { makeInvisible: e.makeInvisible },
2553
- children: e.children
2554
- });
2555
- }
2556
- function Nn() {
2557
- return a(jn);
2558
- }
2559
- //#endregion
2560
- //#region src/components/modal/modalContainer/index.tsx
2561
- function Pn(e) {
2562
- let { isVisible: t, makeInvisible: n, children: r, className: i = "", ...a } = e;
2563
- ot(t);
2564
- let o = `arkynModalContainer ${t ? "visibleTrue" : "visibleFalse"} ${i}`;
2565
- return /* @__PURE__ */ p(Mn, {
2566
- makeInvisible: n,
2567
- children: /* @__PURE__ */ p(ie, { children: t && /* @__PURE__ */ m("aside", {
2568
- className: o.trim(),
2569
- ...a,
2570
- children: [/* @__PURE__ */ p(Y.div, {
2571
- className: "arkynModalContainerOverlay",
2572
- transition: {
2573
- duration: .15,
2574
- ease: "easeOut"
2575
- },
2576
- initial: { opacity: 0 },
2577
- animate: { opacity: 1 },
2578
- exit: { opacity: 0 },
2579
- onClick: n
2580
- }), /* @__PURE__ */ p(Y.div, {
2581
- className: "arkynModalContainerContent",
2582
- transition: {
2583
- duration: .15,
2584
- ease: "easeOut"
2585
- },
2586
- initial: {
2587
- opacity: 0,
2588
- scale: .75
2589
- },
2590
- animate: {
2591
- opacity: 1,
2592
- scale: 1
2593
- },
2594
- exit: {
2595
- opacity: 0,
2596
- scale: 0
2597
- },
2598
- children: r
2599
- })]
2600
- }) })
2601
- });
2602
- }
2603
- //#endregion
2604
- //#region src/components/modal/modalFooter/index.tsx
2605
- function Fn(e) {
2606
- let { alignment: t = "right", className: n, ...r } = e;
2607
- return /* @__PURE__ */ p("footer", {
2608
- className: `arkynModalFooter ${t} ${n}`.trim(),
2609
- ...r
2610
- });
2611
- }
2612
- //#endregion
2613
- //#region src/components/modal/modalHeader/index.tsx
2614
- function In(e) {
2615
- let { showCloseButton: t = !0, className: n, children: r, ...i } = e, { makeInvisible: a } = Nn();
2616
- return /* @__PURE__ */ m("header", {
2617
- className: `arkynModalHeader ${n}`.trim(),
2618
- ...i,
2619
- children: [r, t && /* @__PURE__ */ p("button", {
2620
- type: "button",
2621
- onClick: a,
2622
- "aria-label": "Close modal button",
2623
- className: "arkynModalHeaderCloseButton",
2624
- children: /* @__PURE__ */ p(K, { size: 24 })
2625
- })]
2626
- });
2627
- }
2628
- //#endregion
2629
- //#region src/components/multiSelect/multiSelectChevron/index.tsx
2630
- function Ln(e) {
2631
- let { iconSize: t, isLoading: n, disabled: r, readOnly: i, isFocused: a } = e;
2632
- return n ? /* @__PURE__ */ p(f, {}) : /* @__PURE__ */ p(C, {
2633
- className: `arkynMultiSelectChevron ${r || i ? "notAnimate" : ""} ${a ? "focused" : ""}`,
2634
- strokeWidth: 2.5,
2635
- style: {
2636
- minWidth: t,
2637
- minHeight: t,
2638
- maxWidth: t,
2639
- maxHeight: t
2640
- }
2641
- });
2642
- }
2643
- //#endregion
2644
- //#region src/components/multiSelect/multiSelectContainer/index.tsx
2645
- function Rn(e) {
2646
- let { children: t, handleContainerFocus: n, disabled: r, isError: i, isLoading: a, isFocused: o, className: s, readOnly: c, variant: l, size: u, id: d, prefixExists: f } = e;
2647
- return /* @__PURE__ */ p("section", {
2648
- id: d,
2649
- className: `arkynMultiSelectContainer ${f ? "hasPrefix" : ""} ${l} ${u} ${r || c || a ? "opacity" : ""} ${i ? "errored" : ""} ${o ? "focused" : ""} ${s}`,
2650
- onClick: n,
2651
- children: t
2652
- });
2653
- }
2654
- //#endregion
2655
- //#region src/components/multiSelect/multiSelectContent/index.tsx
2656
- function zn(e) {
2657
- let { children: t, size: n } = e;
2658
- return /* @__PURE__ */ p("div", {
2659
- className: `arkynMultiSelectContent ${n}`,
2660
- children: t
2661
- });
2662
- }
2663
- //#endregion
2664
- //#region src/components/multiSelect/multiSelectMark/index.tsx
2665
- function Bn(e) {
2666
- let { label: t, value: n, disabled: r, handleChangeValue: i } = e;
2667
- return /* @__PURE__ */ m("div", {
2668
- className: "arkynMultiSelectMark",
2669
- children: [t, /* @__PURE__ */ p("button", {
2670
- disabled: r,
2671
- type: "button",
2672
- onClick: (e) => {
2673
- e.stopPropagation(), i(n);
2674
- },
2675
- children: /* @__PURE__ */ p(K, {})
2676
- })]
2677
- });
2678
- }
2679
- //#endregion
2680
- //#region src/components/multiSelect/multiSelectOption/index.tsx
2681
- function Vn(e) {
2682
- let { label: t, optionHasSelected: n, handleChangeValue: r, value: i, size: a } = e;
2683
- return /* @__PURE__ */ m("div", {
2684
- onClick: () => r(i),
2685
- className: `arkynMultiSelectOption ${a} ${n(i) ? "active" : ""}`,
2686
- children: [
2687
- t,
2688
- " ",
2689
- /* @__PURE__ */ p(x, {})
2690
- ]
2691
- });
2692
- }
2693
- //#endregion
2694
- //#region src/components/multiSelect/multiSelectOptionsContainer/index.tsx
2695
- function Hn(e) {
2696
- let { children: t, isFocused: n, isSearchable: r, search: i, onSearch: a } = e, s = l(null), [c, d] = u("bottom");
2697
- ot(n), o(() => {
2698
- n && (() => {
2699
- if (!s.current) return;
2700
- let e = s.current.parentElement;
2701
- if (!e) return;
2702
- let t = e.getBoundingClientRect();
2703
- window.innerHeight - t.bottom < 300 && t.top > 300 ? d("top") : d("bottom");
2704
- })();
2705
- }, [n]);
2706
- function h(e) {
2707
- r && a(e.target.value);
2708
- }
2709
- return n ? /* @__PURE__ */ m("div", {
2710
- ref: s,
2711
- className: `arkynMultiSelectOptionsContainer ${c}`,
2712
- children: [r && /* @__PURE__ */ p(st, {
2713
- type: "search",
2714
- name: "search-select",
2715
- variant: "underline",
2716
- leftIcon: U,
2717
- value: i,
2718
- onChange: h
2719
- }), t]
2720
- }) : /* @__PURE__ */ p(f, {});
2721
- }
2722
- //#endregion
2723
- //#region src/components/multiSelect/multiSelectOverlay/index.tsx
2724
- function Un(e) {
2725
- let { isFocused: t, handleBlur: n } = e;
2726
- return t ? /* @__PURE__ */ p("aside", {
2727
- className: "arkynMultiSelectOverlay",
2728
- onClick: n
2729
- }) : /* @__PURE__ */ p(f, {});
2730
- }
2731
- //#endregion
2732
- //#region src/components/multiSelect/multiSelectSpinner/index.tsx
2733
- function Wn(e) {
2734
- let { iconSize: t, isLoading: n } = e;
2735
- return n ? /* @__PURE__ */ p(L, {
2736
- className: "arkynMultiSelectSpinner",
2737
- size: t,
2738
- strokeWidth: 2.5
2739
- }) : /* @__PURE__ */ p(f, {});
2740
- }
2741
- //#endregion
2742
- //#region src/components/multiSelect/index.tsx
2743
- function Gn(e) {
2744
- let { name: t, options: n, className: r = "", placeholder: i = "Selecione...", closeOnSelect: a = !1, defaultValue: o = [], errorMessage: c, isLoading: d = !1, readOnly: f = !1, isSearchable: h = !1, id: g, label: _, optionMaxHeight: v, showAsterisk: y, leftIcon: b, onSearch: x, onChange: S, onBlur: C, notFoundText: w = "Sem opções disponíveis", onFocus: T, disabled: E = !1, prefix: D, size: O = "md", value: k, variant: A = "solid", unShowFieldTemplate: j = !1, orientation: M = "vertical" } = e, { fieldErrors: N } = X(), P = l(null), F = g || s(), I = c || N?.[t], L = !!I, R = E || d || f, z = {
2745
- md: 20,
2746
- lg: 20
2747
- }[O], [B, V] = u(""), [H, U] = u(!1), [W, G] = u(o), K = k || W;
2748
- function q(e) {
2749
- return K.includes(e);
2750
- }
2751
- function ee(e) {
2752
- return n.find((t) => t.value === e)?.label || "";
2753
- }
2754
- function J() {
2755
- R || !P?.current || H || (U(!0), P.current.focus(), T && T());
2756
- }
2757
- function te() {
2758
- U(!1), C && P.current && P.current.blur();
2759
- }
2760
- function ne(e) {
2761
- V(e), x && x(e);
2762
- }
2763
- function re(e) {
2764
- q(e) ? (G(W.filter((t) => t !== e)), S && S(W.filter((t) => t !== e))) : (G([...W, e]), S && S([...W, e])), a && te();
2765
- }
2766
- let ie = n.filter((t) => !!(e.onSearch || !e.isSearchable || t.label.toLowerCase().includes(B.toLowerCase())));
2767
- return /* @__PURE__ */ p(et, {
2768
- name: t,
2769
- label: _,
2770
- showAsterisk: y,
2771
- className: r,
2772
- errorMessage: I,
2773
- unShowFieldTemplate: j,
2774
- orientation: M,
2775
- children: /* @__PURE__ */ m(Rn, {
2776
- handleContainerFocus: J,
2777
- disabled: R,
2778
- isError: L,
2779
- isFocused: H,
2780
- isLoading: d,
2781
- readOnly: f,
2782
- size: O,
2783
- variant: A,
2784
- prefixExists: !!D,
2785
- id: F,
2786
- children: [
2787
- /* @__PURE__ */ p("input", {
2788
- ref: P,
2789
- name: t,
2790
- value: JSON.stringify(K),
2791
- type: "hidden"
2792
- }),
2793
- /* @__PURE__ */ p(Z, {
2794
- iconSize: z,
2795
- icon: D,
2796
- className: "prefix"
2797
- }),
2798
- b && /* @__PURE__ */ p(b, {
2799
- size: z,
2800
- strokeWidth: 2.5
2801
- }),
2802
- /* @__PURE__ */ m(zn, {
2803
- size: O,
2804
- children: [K.map((e) => /* @__PURE__ */ p(Bn, {
2805
- label: ee(e),
2806
- value: e,
2807
- handleChangeValue: re,
2808
- disabled: R
2809
- }, e)), K.length <= 0 && /* @__PURE__ */ p("p", { children: i })]
2810
- }),
2811
- /* @__PURE__ */ m(Hn, {
2812
- isFocused: H,
2813
- isSearchable: h,
2814
- search: B,
2815
- onSearch: ne,
2816
- children: [ie.map(({ label: e, value: t }) => /* @__PURE__ */ p(Vn, {
2817
- label: e,
2818
- value: t,
2819
- size: O,
2820
- handleChangeValue: re,
2821
- optionHasSelected: q
2822
- }, t)), ie.length <= 0 && /* @__PURE__ */ p("p", { children: w })]
2823
- }),
2824
- /* @__PURE__ */ p(Ln, {
2825
- disabled: R,
2826
- isFocused: H,
2827
- readOnly: f,
2828
- iconSize: z,
2829
- isLoading: d
2830
- }),
2831
- /* @__PURE__ */ p(Wn, {
2832
- iconSize: z,
2833
- isLoading: d
2834
- }),
2835
- /* @__PURE__ */ p(Un, {
2836
- handleBlur: te,
2837
- isFocused: H
2838
- })
2839
- ]
2840
- })
2841
- });
2842
- }
2843
- //#endregion
2844
- //#region src/components/pagination/chevronButton/index.tsx
2845
- function Kn(e) {
2846
- let { orientation: t, handlePageChange: n, disabled: r } = e;
2847
- return /* @__PURE__ */ p("button", {
2848
- className: "arkynChevronPageButton",
2849
- disabled: r,
2850
- onClick: n,
2851
- children: {
2852
- left: /* @__PURE__ */ p(w, {}),
2853
- right: /* @__PURE__ */ p(T, {})
2854
- }[t]
2855
- });
2856
- }
2857
- //#endregion
2858
- //#region src/components/pagination/currentButton/index.tsx
2859
- function qn({ currentPage: e }) {
2860
- return /* @__PURE__ */ p("button", {
2861
- className: "arkynPaginationCurrentButton",
2862
- disabled: !0,
2863
- children: e
2864
- });
2865
- }
2866
- //#endregion
2867
- //#region src/components/pagination/pageButton/index.tsx
2868
- function Jn(e) {
2869
- let { page: t, handlePageChange: n } = e;
2870
- return /* @__PURE__ */ p("button", {
2871
- className: "arkynPaginationPageButton",
2872
- onClick: n,
2873
- children: t
2874
- });
2875
- }
2876
- //#endregion
2877
- //#region src/components/pagination/paginationService.ts
2878
- var Yn = class {
2879
- currentPage;
2880
- totalCountRegisters;
2881
- registerPerPage;
2882
- siblingsCount;
2883
- lastPage;
2884
- onChange;
2885
- previousPages;
2886
- nextPages;
2887
- generatePagesArray(e, t) {
2888
- return [...Array(t - e)].map((t, n) => e + n + 1).filter((e) => e > 0);
2889
- }
2890
- generatePreviousPages(e, t) {
2891
- return e > 1 ? this.generatePagesArray(e - 1 - t, e - 1) : [];
2892
- }
2893
- generateNextPages(e, t) {
2894
- return e < this.lastPage ? this.generatePagesArray(e, Math.min(e + t, this.lastPage)) : [];
2895
- }
2896
- constructor(e) {
2897
- this.totalCountRegisters = e.totalCountRegisters, this.currentPage = e.currentPage, this.registerPerPage = e?.registerPerPage || 20, this.siblingsCount = e?.siblingsCount || 2, this.lastPage = Math.ceil(this.totalCountRegisters / this.registerPerPage), this.onChange = e?.onChange, this.previousPages = this.generatePreviousPages(this.currentPage, this.siblingsCount), this.nextPages = this.generateNextPages(this.currentPage, this.siblingsCount);
2898
- }
2899
- handlePageChange = (e) => {
2900
- e < 1 || e > this.lastPage || this.onChange && (this.currentPage = e, this.onChange(this.currentPage));
2901
- };
2902
- handlePlusChange = () => {
2903
- this.currentPage >= this.lastPage || this.onChange && (this.currentPage += 1, this.onChange(this.currentPage));
2904
- };
2905
- handleMinusChange = () => {
2906
- this.currentPage <= 1 || this.onChange && (--this.currentPage, this.onChange(this.currentPage));
2907
- };
2908
- };
2909
- //#endregion
2910
- //#region src/components/pagination/spread/index.tsx
2911
- function Xn() {
2912
- return /* @__PURE__ */ p("p", {
2913
- className: "arkynPaginationSpread",
2914
- children: /* @__PURE__ */ p(D, {})
2915
- });
2916
- }
2917
- //#endregion
2918
- //#region src/components/pagination/index.tsx
2919
- function Zn(e) {
2920
- let { totalCountRegisters: t, siblingsCount: n, currentPage: r, registerPerPage: i, onChange: a, ...o } = e, { currentPage: s, siblingsCount: c, previousPages: l, nextPages: u, lastPage: d, handlePageChange: h, handleMinusChange: g, handlePlusChange: _ } = new Yn({
2921
- totalCountRegisters: t,
2922
- currentPage: r,
2923
- registerPerPage: i,
2924
- siblingsCount: n,
2925
- onChange: a
2926
- });
2927
- return /* @__PURE__ */ m("div", {
2928
- className: "arkynPagination",
2929
- ...o,
2930
- children: [
2931
- /* @__PURE__ */ p(Kn, {
2932
- orientation: "left",
2933
- handlePageChange: g,
2934
- disabled: s <= 1
2935
- }),
2936
- s > 1 + c && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Jn, {
2937
- page: 1,
2938
- handlePageChange: () => h(1)
2939
- }), s > 2 + c && /* @__PURE__ */ p(Xn, {})] }),
2940
- l.map((e, t) => /* @__PURE__ */ p(Jn, {
2941
- page: e,
2942
- handlePageChange: g
2943
- }, t)),
2944
- /* @__PURE__ */ p(qn, { currentPage: s }),
2945
- u.map((e, t) => /* @__PURE__ */ p(Jn, {
2946
- page: e,
2947
- handlePageChange: _
2948
- }, t)),
2949
- s + c < d && /* @__PURE__ */ m(f, { children: [s + 1 + c < d && /* @__PURE__ */ p(Xn, {}), /* @__PURE__ */ p(Jn, {
2950
- page: d,
2951
- handlePageChange: () => h(d)
2952
- })] }),
2953
- /* @__PURE__ */ p(Kn, {
2954
- orientation: "right",
2955
- handlePageChange: _,
2956
- disabled: s >= d
2957
- })
2958
- ]
2959
- });
2960
- }
2961
- //#endregion
2962
- //#region src/components/phoneInput/phoneInputContainer/index.tsx
2963
- function Qn(e) {
2964
- let { children: t, onFocus: n, disabled: r, isError: i, isLoading: a, isFocused: o, className: s = "", readOnly: c, variant: l, size: u } = e;
2965
- return /* @__PURE__ */ p("section", {
2966
- className: `arkynPhoneInputContainer ${l} ${u} ${r || c || a ? "opacity" : ""} ${i ? "errored" : ""} ${o ? "focused" : ""} ${s}`.trim(),
2967
- onClick: n,
2968
- children: t
2969
- });
2970
- }
2971
- //#endregion
2972
- //#region src/components/phoneInput/phoneInputCountriesOverlay/index.tsx
2973
- function $n(e) {
2974
- let { isOpen: t, onClick: n } = e;
2975
- return t ? /* @__PURE__ */ p("aside", {
2976
- className: "arkynPhoneInputCountriesOverlay",
2977
- onClick: n
2978
- }) : /* @__PURE__ */ p(f, {});
2979
- }
2980
- //#endregion
2981
- //#region src/components/phoneInput/phoneInputCountryOption/index.tsx
2982
- function er(e) {
2983
- let { country: t, isActive: n, handleChangeValue: r, size: i } = e;
2984
- return /* @__PURE__ */ m("div", {
2985
- onClick: () => r(t),
2986
- className: `arkynPhoneInputCountryOption ${i} ${n ? "active" : ""}`,
2987
- children: [
2988
- /* @__PURE__ */ p("img", {
2989
- src: t.flag,
2990
- alt: t.name,
2991
- className: "flag"
2992
- }),
2993
- t.name,
2994
- " ",
2995
- /* @__PURE__ */ p("span", { children: t.code }),
2996
- /* @__PURE__ */ p(x, { className: "check" })
2997
- ]
2998
- });
2999
- }
3000
- //#endregion
3001
- //#region src/components/phoneInput/phoneInputCountryOptionsContainer/index.tsx
3002
- function tr(e) {
3003
- let { children: t, isOpen: n, onSearch: r, search: i, placeholder: a } = e, s = l(null), [c, d] = u("bottom");
3004
- function h(e) {
3005
- r(e.target.value);
3006
- }
3007
- return ot(n), o(() => {
3008
- n && (() => {
3009
- if (!s.current) return;
3010
- let e = s.current.parentElement;
3011
- if (!e) return;
3012
- let t = e.getBoundingClientRect();
3013
- window.innerHeight - t.bottom < 300 && t.top > 300 ? d("top") : d("bottom");
3014
- })();
3015
- }, [n]), n ? /* @__PURE__ */ m("div", {
3016
- className: `arkynPhoneInputCountryOptionsContainer ${c}`,
3017
- ref: s,
3018
- children: [/* @__PURE__ */ p("input", {
3019
- type: "search",
3020
- name: "search-select",
3021
- className: "arkynPhoneInputCountryOptionsContainerSearchSelect",
3022
- value: i,
3023
- id: "input-search",
3024
- placeholder: a,
3025
- onChange: h
3026
- }), t]
3027
- }) : /* @__PURE__ */ p(f, {});
3028
- }
3029
- //#endregion
3030
- //#region src/components/phoneInput/phoneInputCountrySelector/index.tsx
3031
- function nr(e) {
3032
- let { currentCountry: t, onClick: n } = e;
3033
- return /* @__PURE__ */ m("div", {
3034
- className: "phoneInputSelectCountry",
3035
- onClick: n,
3036
- children: [
3037
- /* @__PURE__ */ p("img", {
3038
- className: "flag",
3039
- src: t.flag,
3040
- alt: t.name
3041
- }),
3042
- /* @__PURE__ */ p(C, {
3043
- className: "chevronDown",
3044
- strokeWidth: 2.5
3045
- }),
3046
- /* @__PURE__ */ p(He, { orientation: "vertical" })
3047
- ]
3048
- });
3049
- }
3050
- //#endregion
3051
- //#region src/utils/phoneInputUtilities.ts
3052
- function rr(e) {
3053
- return e && e.replace(/[^0-9]/g, "");
3054
- }
3055
- var ir = {
3056
- EIGHT: "(99) 9999-9999",
3057
- NINE: "(99) 99999-9999"
3058
- };
3059
- function ar(e, t) {
3060
- let n = "", r = 0;
3061
- for (let i = 0; i < t.length; i++) if (t[i] === "9") if (r < e.length) n += e[r], r++;
3062
- else break;
3063
- else if (r < e.length) n += t[i];
3064
- else break;
3065
- return n;
3066
- }
3067
- function or(e) {
3068
- return e.length > 10 ? "NINE" : "EIGHT";
3069
- }
3070
- var sr = rr(ir.NINE).length, cr = r((e, t) => /* @__PURE__ */ p("input", {
3071
- ref: t,
3072
- ...e
3073
- })), lr = r((e, t) => {
3074
- let { onFocus: n, readonly: r, onBlur: i, size: a, onChange: s, value: c, currentCountry: l, disabled: d, id: f } = e, [m, h] = u(!1), g = typeof l.mask == "string" ? l.mask : l.mask[0];
3075
- o(() => {
3076
- m ? s(g) : h(!0);
3077
- }, [l]);
3078
- let _ = `phoneInputMask ${a}`;
3079
- function v(e) {
3080
- let t = rr(e.target.value), n = or(t);
3081
- t.length > sr || (t = ar(t, ir[n]), e.target.value = t, s(t));
3082
- }
3083
- return l.code === "+55" ? /* @__PURE__ */ p("input", {
3084
- id: f,
3085
- value: c,
3086
- onChange: v,
3087
- className: _,
3088
- onFocus: n,
3089
- onBlur: i,
3090
- disabled: d,
3091
- ref: t
3092
- }) : /* @__PURE__ */ p(se, {
3093
- id: f,
3094
- value: c,
3095
- readOnly: r,
3096
- onChange: (e) => s(e.target.value),
3097
- className: _,
3098
- component: cr,
3099
- onFocus: n,
3100
- onBlur: i,
3101
- disabled: d,
3102
- mask: g,
3103
- showMask: !0,
3104
- replacement: { _: /\d/ },
3105
- ref: t
3106
- });
3107
- });
3108
- //#endregion
3109
- //#region src/components/phoneInput/index.tsx
3110
- function ur(e) {
3111
- let { defaultCountryIso: t, value: n, label: r, className: i = "", disabled: a = !1, errorMessage: o, isLoading: c = !1, readOnly: d = !1, size: f = "md", defaultValue: h = "", variant: g = "solid", showAsterisk: _, name: v, onChange: y, searchCountryPlaceholder: b = "Pesquisar país", notFoundCountryText: x = "Nenhum país encontrado", id: S, unShowFieldTemplate: C = !1, orientation: w = "vertical" } = e, T = ce.find((e) => e.iso === "BR"), E = h ? ne(h) : "", D = h ? ee(h)[1] : T, [O, k] = u(!1), [A, j] = u(""), [M, N] = u(!1), [P, F] = u(E), I = n === void 0 ? P : n, [L, R] = u(D), { fieldErrors: z } = X(), B = l(null), V = S || s(), H = o || z?.[v], U = !!H, W = a || c, G = l(null);
3112
- function K() {
3113
- W || O || M || (k(!0), G.current && G.current.focus());
3114
- }
3115
- function q() {
3116
- N(!0), k(!0);
3117
- }
3118
- function J() {
3119
- N(!1), k(!1);
3120
- }
3121
- function te() {
3122
- k(!0);
3123
- }
3124
- function ie() {
3125
- k(!1);
3126
- }
3127
- function Y(e) {
3128
- return e.name.toLowerCase().includes(A.toLowerCase());
3129
- }
3130
- function ae(e) {
3131
- let t = L.code;
3132
- return t += re(e || I), t;
3133
- }
3134
- return /* @__PURE__ */ p(et, {
3135
- name: v,
3136
- label: r,
3137
- showAsterisk: _,
3138
- className: i,
3139
- errorMessage: H,
3140
- unShowFieldTemplate: C,
3141
- orientation: w,
3142
- children: /* @__PURE__ */ m(Qn, {
3143
- disabled: W,
3144
- isError: U,
3145
- isLoading: c,
3146
- isFocused: O,
3147
- readOnly: d,
3148
- size: f,
3149
- variant: g,
3150
- onFocus: K,
3151
- children: [
3152
- /* @__PURE__ */ p(nr, {
3153
- currentCountry: L,
3154
- onClick: q,
3155
- size: f
3156
- }),
3157
- /* @__PURE__ */ m(tr, {
3158
- isOpen: W || d ? !1 : M,
3159
- search: A,
3160
- placeholder: b,
3161
- onSearch: j,
3162
- children: [ce.filter((e) => Y(e)).map((e) => /* @__PURE__ */ p(er, {
3163
- country: e,
3164
- handleChangeValue: () => {
3165
- R(e), N(!1), F("");
3166
- },
3167
- isActive: e.iso === L.iso,
3168
- size: f
3169
- }, e.iso)), ce.filter((e) => Y(e)).length === 0 && /* @__PURE__ */ p("p", { children: x })]
3170
- }),
3171
- /* @__PURE__ */ p($n, {
3172
- isOpen: W || d ? !1 : M,
3173
- onClick: J
3174
- }),
3175
- /* @__PURE__ */ p(lr, {
3176
- id: V,
3177
- ref: G,
3178
- readonly: d,
3179
- currentCountry: L,
3180
- value: I,
3181
- disabled: W,
3182
- onBlur: ie,
3183
- onFocus: te,
3184
- size: f,
3185
- onChange: (e) => {
3186
- F(e), y && y(ae(e));
3187
- }
3188
- }),
3189
- /* @__PURE__ */ p("input", {
3190
- ref: B,
3191
- type: "hidden",
3192
- name: v,
3193
- value: ae()
3194
- })
3195
- ]
3196
- })
3197
- });
3198
- }
3199
- //#endregion
3200
- //#region src/components/popover/index.tsx
3201
- function dr(e) {
3202
- let { children: t, button: n, closeOnClick: r, className: i = "", orientation: a = "bottomLeft" } = e, [o, s] = u(!1), c = `arkynPopover ${a} ${o ? "visibleTrue" : "visibleFalse"} ${i}`;
3203
- function l() {
3204
- o || s(!0);
3205
- }
3206
- return ot(o), /* @__PURE__ */ m("div", {
3207
- className: c,
3208
- onClick: l,
3209
- children: [
3210
- n,
3211
- /* @__PURE__ */ p(Y.div, {
3212
- style: { visibility: o ? "visible" : "hidden" },
3213
- transition: {
3214
- ease: "easeOut",
3215
- duration: 0
3216
- },
3217
- initial: { opacity: 0 },
3218
- animate: { opacity: +!!o },
3219
- exit: { opacity: 0 },
3220
- onClick: () => r && s(!1),
3221
- className: "arkynPopoverContent",
3222
- children: t
3223
- }),
3224
- o && /* @__PURE__ */ p("div", {
3225
- onClick: () => s(!1),
3226
- className: "arkynPopoverOverlay"
3227
- })
3228
- ]
3229
- });
3230
- }
3231
- //#endregion
3232
- //#region src/components/radio/radioContext.tsx
3233
- var fr = n({});
3234
- function pr(e) {
3235
- let { children: t, size: n, isError: r, handleChange: i, value: a, disabled: o } = e;
3236
- return /* @__PURE__ */ p(fr.Provider, {
3237
- value: {
3238
- handleChange: i,
3239
- value: a,
3240
- size: n,
3241
- isError: r,
3242
- disabled: o
3243
- },
3244
- children: t
3245
- });
3246
- }
3247
- function mr() {
3248
- return a(fr);
3249
- }
3250
- //#endregion
3251
- //#region src/components/radio/radioBox/index.tsx
3252
- function hr(e) {
3253
- let { value: t, size: n, disabled: r, children: i, className: a = "", onClick: o, onFocus: s, ...c } = e, { handleChange: l, size: u, value: d, isError: f, disabled: h } = mr(), g = d === t, _ = n || u, v = r || h, y = `arkynRadioBox ${_} ${g ? "checkedTrue" : "checkedFalse"} ${f ? "errorTrue" : "errorFalse"} ${v ? "disabledTrue" : "disabledFalse"} ${a}`;
3254
- function b(e) {
3255
- o && o(e), l(t);
3256
- }
3257
- function x(e) {
3258
- s && s(e), l(t);
3259
- }
3260
- return /* @__PURE__ */ m("label", {
3261
- className: y.trim(),
3262
- children: [/* @__PURE__ */ p("button", {
3263
- type: "button",
3264
- disabled: v,
3265
- onClick: b,
3266
- onFocus: x,
3267
- ...c
3268
- }), i]
3269
- });
3270
- }
3271
- //#endregion
3272
- //#region src/components/radio/radioGroup/index.tsx
3273
- function gr(e) {
3274
- let { defaultValue: t = "", name: n, label: r, showAsterisk: i, errorMessage: a, value: o, onChange: s, size: c = "md", className: l = "", disabled: d = !1, unShowFieldTemplate: f = !1, orientation: h = "vertical", ...g } = e, [_, v] = u(t), { fieldErrors: y } = X();
3275
- function b(e) {
3276
- v(e), s && s(e);
3277
- }
3278
- let x = a || y?.[n], S = !!x, C = `arkynRadioGroup ${c}`;
3279
- return /* @__PURE__ */ p(et, {
3280
- name: n,
3281
- label: r,
3282
- showAsterisk: i,
3283
- className: l,
3284
- errorMessage: x,
3285
- unShowFieldTemplate: f,
3286
- orientation: h,
3287
- children: /* @__PURE__ */ m(pr, {
3288
- isError: S,
3289
- size: c,
3290
- value: o || _,
3291
- handleChange: b,
3292
- disabled: d,
3293
- children: [/* @__PURE__ */ p("input", {
3294
- style: { display: "none" },
3295
- type: "text",
3296
- readOnly: !0,
3297
- name: n,
3298
- value: o || _
3299
- }), /* @__PURE__ */ p("div", {
3300
- className: C.trim(),
3301
- ...g
3302
- })]
3303
- })
3304
- });
3305
- }
3306
- //#endregion
3307
- //#region src/services/isBlockActive.ts
3308
- function _r(e, t, n = "type") {
3309
- let { selection: r } = e;
3310
- if (!r) return !1;
3311
- let [i] = Array.from(ue.nodes(e, {
3312
- at: ue.unhangRange(e, r),
3313
- match: (e) => !ue.isEditor(e) && de.isElement(e) && e[n] === t
3314
- }));
3315
- return !!i;
3316
- }
3317
- //#endregion
3318
- //#region src/templates/richTextTemplates.ts
3319
- var vr = {
3320
- "mod+b": "bold",
3321
- "mod+i": "italic",
3322
- "mod+u": "underline",
3323
- "mod+`": "code"
3324
- }, yr = [{
3325
- type: "paragraph",
3326
- children: [{ text: "" }]
3327
- }], br = ["listItem", "numberedList"], xr = [
3328
- "left",
3329
- "center",
3330
- "right",
3331
- "justify"
3332
- ];
3333
- //#endregion
3334
- //#region src/services/toggleBlock.ts
3335
- function Sr(e, t) {
3336
- let n = _r(e, t, xr.includes(t) ? "align" : "type"), r = br.includes(t);
3337
- me.unwrapNodes(e, {
3338
- match: (e) => !ue.isEditor(e) && de.isElement(e) && br.includes(e.type) && !xr.includes(t),
3339
- split: !0
3340
- });
3341
- let i;
3342
- if (i = xr.includes(t) ? { align: n ? void 0 : t } : { type: n ? "paragraph" : r ? "listItem" : t }, me.setNodes(e, i), !n && r) {
3343
- let n = {
3344
- type: t,
3345
- children: []
3346
- };
3347
- me.wrapNodes(e, n);
3348
- }
3349
- }
3350
- //#endregion
3351
- //#region src/components/richText/blockButton/index.tsx
3352
- function Cr({ format: e, icon: t }) {
3353
- let n = ye(), r = _r(n, e, xr.includes(e) ? "align" : "type") ? "activeTrue" : "activeFalse";
3354
- function i(t) {
3355
- t.preventDefault(), Sr(n, e);
3356
- }
3357
- return /* @__PURE__ */ p("button", {
3358
- type: "button",
3359
- className: "arkynRichTextBlockButton " + r,
3360
- onMouseDown: i,
3361
- children: /* @__PURE__ */ p(t, {})
3362
- });
3363
- }
3364
- //#endregion
3365
- //#region src/components/richText/element/index.tsx
3366
- function wr({ attributes: e, children: t, element: n }) {
3367
- let r = { textAlign: n.align };
3368
- switch (n.type) {
3369
- case "blockQuote": return /* @__PURE__ */ p("blockquote", {
3370
- className: "arkynElementBlockquote",
3371
- style: r,
3372
- ...e,
3373
- children: t
3374
- });
3375
- case "bulletedList": return /* @__PURE__ */ p("ul", {
3376
- className: "arkynElementBulletList",
3377
- style: r,
3378
- ...e,
3379
- children: t
3380
- });
3381
- case "headingOne": return /* @__PURE__ */ p("h1", {
3382
- className: "arkynElementHeadingOne",
3383
- style: r,
3384
- ...e,
3385
- children: t
3386
- });
3387
- case "headingTwo": return /* @__PURE__ */ p("h2", {
3388
- className: "arkynElementHeadingTwo",
3389
- style: r,
3390
- ...e,
3391
- children: t
3392
- });
3393
- case "listItem": return /* @__PURE__ */ p("li", {
3394
- className: "arkynElementListItem",
3395
- style: r,
3396
- ...e,
3397
- children: t
3398
- });
3399
- case "numberedList": return /* @__PURE__ */ p("ol", {
3400
- className: "arkynElementNumberedList",
3401
- style: r,
3402
- ...e,
3403
- children: t
3404
- });
3405
- case "image": return /* @__PURE__ */ m("div", {
3406
- style: r,
3407
- ...e,
3408
- children: [/* @__PURE__ */ p("img", {
3409
- className: "arkynElementImage",
3410
- alt: "arkynElementImage",
3411
- src: n?.src || ""
3412
- }), t]
3413
- });
3414
- case "video": return /* @__PURE__ */ m("div", {
3415
- style: r,
3416
- ...e,
3417
- children: [/* @__PURE__ */ p("iframe", {
3418
- className: "arkynElementVideo",
3419
- src: n?.src || "",
3420
- title: "YouTube video player",
3421
- allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
3422
- referrerPolicy: "strict-origin-when-cross-origin",
3423
- allowFullScreen: !0
3424
- }), t]
3425
- });
3426
- default: return /* @__PURE__ */ p("p", {
3427
- className: "arkynElementParagraph",
3428
- style: r,
3429
- ...e,
3430
- children: t
3431
- });
3432
- }
3433
- }
3434
- //#endregion
3435
- //#region src/components/tab/tabContext.tsx
3436
- var Tr = n({});
3437
- function Er() {
3438
- return a(Tr);
3439
- }
3440
- function Dr(e) {
3441
- return /* @__PURE__ */ p(Tr.Provider, {
3442
- value: e,
3443
- children: e.children
3444
- });
3445
- }
3446
- //#endregion
3447
- //#region src/components/tab/tabButton/index.tsx
3448
- function Or(e) {
3449
- let { children: t, disabled: n = !1, className: r = "", onClick: i, value: a, ...o } = e, { disabled: s, currentTab: c, changeCurrentTab: l } = Er(), u = s || n, d = `arkynTabButton ${u ? "isDisabled" : ""} ${c === a && a ? "isActive" : ""} ${r}`;
3450
- function f(e) {
3451
- l(a), i && i(e);
3452
- }
3453
- return /* @__PURE__ */ p("button", {
3454
- onClick: f,
3455
- className: d.trim(),
3456
- ...o,
3457
- disabled: u,
3458
- type: "button",
3459
- children: t
3460
- });
3461
- }
3462
- //#endregion
3463
- //#region src/components/tab/tabContainer/index.tsx
3464
- function kr(e) {
3465
- let { children: t, onChange: n, defaultValue: r, disabled: i = !1, className: a, ...o } = e, [s, c] = u(r || ""), l = `arkynTabContainer ${a || ""}`;
3466
- function d(e) {
3467
- c(e), n && n(e);
3468
- }
3469
- return /* @__PURE__ */ p(Dr, {
3470
- disabled: i,
3471
- currentTab: s,
3472
- changeCurrentTab: d,
3473
- children: /* @__PURE__ */ p("nav", {
3474
- className: l.trim(),
3475
- ...o,
3476
- children: t
3477
- })
3478
- });
3479
- }
3480
- //#endregion
3481
- //#region src/components/richText/insertImage/index.tsx
3482
- function Ar(e) {
3483
- let { action: t, tabLabels: n = ["Adicionar URL", "Upload de arquivo"], modalCancelButton: r = "Cancelar", modalConfirmButton: i = "Confirmar", modalInputImageLabel: a = "Imagem:", modalInputUrlLabel: o = "URL da imagem:", modalTitle: s = "Inserir imagem" } = e, c = ye(), [l, d] = u(!1), [h, g] = u(""), [_, v] = u("url");
3484
- function y(e) {
3485
- e.preventDefault(), !(!h || h === "") && (c.insertNodes([
3486
- {
3487
- type: "paragraph",
3488
- children: [{ text: "" }]
3489
- },
3490
- {
3491
- type: "image",
3492
- src: h,
3493
- children: [{ text: "" }]
3494
- },
3495
- {
3496
- type: "paragraph",
3497
- children: [{ text: "" }]
3498
- }
3499
- ]), d(!1));
3500
- }
3501
- return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("button", {
3502
- type: "button",
3503
- className: "arkynRichTextInsertImage",
3504
- onMouseDown: () => d(!0),
3505
- children: /* @__PURE__ */ p(P, {})
3506
- }), /* @__PURE__ */ m(Pn, {
3507
- isVisible: l,
3508
- makeInvisible: () => d(!1),
3509
- children: [
3510
- /* @__PURE__ */ p(In, { children: s }),
3511
- /* @__PURE__ */ m("div", {
3512
- className: "arkynRichTextInsertImageModalContent",
3513
- children: [
3514
- /* @__PURE__ */ m(kr, {
3515
- defaultValue: _,
3516
- onChange: v,
3517
- children: [/* @__PURE__ */ p(Or, {
3518
- value: "url",
3519
- children: n[0]
3520
- }), /* @__PURE__ */ p(Or, {
3521
- value: "file",
3522
- children: n[1]
3523
- })]
3524
- }),
3525
- _ === "url" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(st, {
3526
- type: "text",
3527
- name: "richTextImageURL",
3528
- label: o,
3529
- showAsterisk: !0,
3530
- defaultValue: h,
3531
- onChange: (e) => g(e.target.value)
3532
- }), h && /* @__PURE__ */ p("img", {
3533
- className: "arkynRichTextInsertImageModalPreviewImage",
3534
- src: h,
3535
- alt: "preview"
3536
- })] }),
3537
- _ === "file" && /* @__PURE__ */ p(Tn, {
3538
- name: "richTextImageURL",
3539
- action: t,
3540
- label: a,
3541
- showAsterisk: !0,
3542
- defaultValue: h,
3543
- onChange: (e) => g(e)
3544
- })
3545
- ]
3546
- }),
3547
- /* @__PURE__ */ m(Fn, { children: [/* @__PURE__ */ p(Q, {
3548
- type: "button",
3549
- scheme: "danger",
3550
- variant: "outline",
3551
- onClick: () => d(!1),
3552
- children: r
3553
- }), /* @__PURE__ */ p(Q, {
3554
- type: "button",
3555
- onClick: y,
3556
- children: i
3557
- })] })
3558
- ]
3559
- })] });
3560
- }
3561
- //#endregion
3562
- //#region src/components/richText/insertVideo/index.tsx
3563
- function jr(e) {
3564
- let { modalCancelButton: t = "Cancelar", modalConfirmButton: n = "Confirmar", modalInputUrlLabel: r = "URL do vídeo:", modalTitle: i = "Inserir vídeo", invalidUrlMessage: a = "URL inválida" } = e, s = ye(), [c, l] = u(!1), [d, h] = u(""), [g, _] = u(""), [v, y] = u("");
3565
- function b(e) {
3566
- if (e.preventDefault(), !d || d === "") return;
3567
- let t = `https://www.youtube.com/embed/${d}`;
3568
- s.insertNodes([
3569
- {
3570
- type: "paragraph",
3571
- children: [{ text: "" }]
3572
- },
3573
- {
3574
- type: "video",
3575
- src: t,
3576
- children: [{ text: "" }]
3577
- },
3578
- {
3579
- type: "paragraph",
3580
- children: [{ text: "" }]
3581
- }
3582
- ]), l(!1);
3583
- }
3584
- return o(() => {
3585
- if (!g || g === "") return;
3586
- h(""), y("");
3587
- let e = new URLSearchParams(g.split("?")[1]).get("v");
3588
- e ? h(e) : y(a);
3589
- }, [g]), o(() => {
3590
- c || (h(""), _(""), y(""));
3591
- }, [c]), /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("button", {
3592
- type: "button",
3593
- className: "arkynRichTextInsertVideo",
3594
- onMouseDown: () => l(!0),
3595
- children: /* @__PURE__ */ p(G, {})
3596
- }), /* @__PURE__ */ m(Pn, {
3597
- isVisible: c,
3598
- makeInvisible: () => l(!1),
3599
- children: [
3600
- /* @__PURE__ */ p(In, { children: i }),
3601
- /* @__PURE__ */ m("div", {
3602
- className: "arkynRichTextInsertVideoModalContent",
3603
- children: [/* @__PURE__ */ p(st, {
3604
- type: "text",
3605
- name: "richTextVideoURL",
3606
- label: r,
3607
- showAsterisk: !0,
3608
- defaultValue: g,
3609
- onChange: (e) => _(e.target.value),
3610
- errorMessage: v
3611
- }), d && /* @__PURE__ */ p("iframe", {
3612
- width: "auto",
3613
- height: "315",
3614
- src: `https://www.youtube.com/embed/${d}`,
3615
- title: "YouTube video player",
3616
- allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
3617
- referrerPolicy: "strict-origin-when-cross-origin",
3618
- allowFullScreen: !0
3619
- })]
3620
- }),
3621
- /* @__PURE__ */ m(Fn, { children: [/* @__PURE__ */ p(Q, {
3622
- type: "button",
3623
- scheme: "danger",
3624
- variant: "outline",
3625
- onClick: () => l(!1),
3626
- children: t
3627
- }), /* @__PURE__ */ p(Q, {
3628
- disabled: !d,
3629
- type: "button",
3630
- onClick: b,
3631
- children: n
3632
- })] })
3633
- ]
3634
- })] });
3635
- }
3636
- //#endregion
3637
- //#region src/components/richText/leaf/index.tsx
3638
- function Mr({ attributes: e, children: t, leaf: n }) {
3639
- return n.bold && (t = /* @__PURE__ */ p("strong", { children: t })), n.code && (t = /* @__PURE__ */ p("code", { children: t })), n.italic && (t = /* @__PURE__ */ p("em", { children: t })), n.underline && (t = /* @__PURE__ */ p("u", { children: t })), /* @__PURE__ */ p("span", {
3640
- ...e,
3641
- children: t
3642
- });
3643
- }
3644
- //#endregion
3645
- //#region src/services/isMarkActive.ts
3646
- function Nr(e, t) {
3647
- let n = ue.marks(e);
3648
- return n ? n[t] === !0 : !1;
3649
- }
3650
- //#endregion
3651
- //#region src/services/toggleMark.ts
3652
- function Pr(e, t) {
3653
- Nr(e, t) ? ue.removeMark(e, t) : ue.addMark(e, t, !0);
3654
- }
3655
- //#endregion
3656
- //#region src/components/richText/markButton/index.tsx
3657
- function Fr({ format: e, icon: t }) {
3658
- let n = ye(), r = Nr(n, e) ? "activeTrue" : "activeFalse";
3659
- function i(t) {
3660
- t.preventDefault(), Pr(n, e);
3661
- }
3662
- return /* @__PURE__ */ p("button", {
3663
- type: "button",
3664
- className: "arkynRichTextMarkButton " + r,
3665
- onMouseDown: i,
3666
- children: /* @__PURE__ */ p(t, {})
3667
- });
3668
- }
3669
- //#endregion
3670
- //#region src/components/richText/toolbar/index.tsx
3671
- function Ir({ children: e }) {
3672
- return /* @__PURE__ */ p("div", {
3673
- className: "arkynRichTextToolbar",
3674
- children: e
3675
- });
3676
- }
3677
- //#endregion
3678
- //#region src/services/extractTextFromNode.ts
3679
- function Lr(e) {
3680
- return e.map((e) => fe.string(e)).join("");
3681
- }
3682
- //#endregion
3683
- //#region src/components/richText/index.tsx
3684
- function Rr(e) {
3685
- let { name: t, hiddenButtons: n, imageConfig: r, videoConfig: a, className: o = "", defaultValue: d = "[]", enforceCharacterLimit: f = !1, onChangeCharactersCount: h, baseErrorMessage: x, maxLimit: S = 1e4, onChange: C, isError: w, label: T, showAsterisk: D, id: O, orientation: k = "vertical", unShowFieldTemplate: A = !1 } = e, j = c(() => ge(be(he())), []), { fieldErrors: P } = X();
3686
- function F() {
3687
- try {
3688
- let e = JSON.parse(d);
3689
- return !Array.isArray(e) || e.length <= 0 ? yr : e.every((e) => typeof e == "object" && !!e && "type" in e && "children" in e) ? e : yr;
3690
- } catch {
3691
- return yr;
3692
- }
3693
- }
3694
- let [L, R] = u(Lr(F()).length), [z, B] = u(JSON.stringify(F()) || "[]"), [H, U] = u(!1), G = l(null), K = O || s(), q = x || P?.[t], ee = w || !!q, J = i(Mr, []), te = i(wr, []);
3695
- function ne(e) {
3696
- let t = Lr(e);
3697
- R(t.length), h && h(t.length), !(f && t.length >= S) && (B(JSON.stringify(e)), C && C(e), j.children = e, me.setNodes(j, { children: e }));
3698
- }
3699
- let re = `arkynRichText ${ee || S < L ? "errorTrue" : "errorFalse"} ${H ? "focusTrue" : "focusFalse"}`, ie = S - L;
3700
- function Y(e) {
3701
- return !n?.includes(e);
3702
- }
3703
- return /* @__PURE__ */ p(et, {
3704
- name: t,
3705
- label: T,
3706
- showAsterisk: D,
3707
- className: o,
3708
- errorMessage: q,
3709
- unShowFieldTemplate: A,
3710
- orientation: k,
3711
- children: /* @__PURE__ */ m(ve, {
3712
- editor: j,
3713
- initialValue: F(),
3714
- onChange: ne,
3715
- onValueChange: ne,
3716
- children: [
3717
- /* @__PURE__ */ m("div", {
3718
- className: re,
3719
- children: [
3720
- /* @__PURE__ */ m(Ir, { children: [
3721
- Y("headingOne") && /* @__PURE__ */ p(Cr, {
3722
- format: "headingOne",
3723
- icon: M
3724
- }),
3725
- Y("headingTwo") && /* @__PURE__ */ p(Cr, {
3726
- format: "headingTwo",
3727
- icon: N
3728
- }),
3729
- Y("blockQuote") && /* @__PURE__ */ p(Cr, {
3730
- format: "blockQuote",
3731
- icon: V
3732
- }),
3733
- Y("bold") && /* @__PURE__ */ p(Fr, {
3734
- format: "bold",
3735
- icon: b
3736
- }),
3737
- Y("italic") && /* @__PURE__ */ p(Fr, {
3738
- format: "italic",
3739
- icon: I
3740
- }),
3741
- Y("underline") && /* @__PURE__ */ p(Fr, {
3742
- format: "underline",
3743
- icon: W
3744
- }),
3745
- Y("code") && /* @__PURE__ */ p(Fr, {
3746
- format: "code",
3747
- icon: E
3748
- }),
3749
- Y("left") && /* @__PURE__ */ p(Cr, {
3750
- format: "left",
3751
- icon: v
3752
- }),
3753
- Y("right") && /* @__PURE__ */ p(Cr, {
3754
- format: "right",
3755
- icon: y
3756
- }),
3757
- Y("center") && /* @__PURE__ */ p(Cr, {
3758
- format: "center",
3759
- icon: g
3760
- }),
3761
- Y("justify") && /* @__PURE__ */ p(Cr, {
3762
- format: "justify",
3763
- icon: _
3764
- }),
3765
- r && Y("image") && /* @__PURE__ */ p(Ar, { ...r }),
3766
- Y("video") && /* @__PURE__ */ p(jr, { ...a })
3767
- ] }),
3768
- /* @__PURE__ */ p(_e, {
3769
- className: "editorContainer",
3770
- renderElement: te,
3771
- renderLeaf: J,
3772
- spellCheck: !0,
3773
- ref: G,
3774
- id: K,
3775
- onFocus: () => U(!0),
3776
- onBlur: () => U(!1),
3777
- onKeyDown: (e) => {
3778
- for (let t in vr) if (le(t, e)) {
3779
- e.preventDefault();
3780
- let n = vr[t];
3781
- Pr(j, n);
3782
- }
3783
- }
3784
- }),
3785
- ie < 0 && /* @__PURE__ */ p("div", {
3786
- className: "restatesCharacters",
3787
- children: ie
3788
- })
3789
- ]
3790
- }),
3791
- /* @__PURE__ */ p("input", {
3792
- type: "hidden",
3793
- name: t,
3794
- value: z.slice(0, S)
3795
- }),
3796
- /* @__PURE__ */ p("input", {
3797
- type: "hidden",
3798
- name: `${t}Count`,
3799
- value: L
3800
- })
3801
- ]
3802
- })
3803
- });
3804
- }
3805
- //#endregion
3806
- //#region src/components/searchPlaces.tsx
3807
- function zr(e) {
3808
- let { onChange: t, onPlaceChanged: n, options: r, ...i } = e, [a, o] = u(null);
3809
- return /* @__PURE__ */ p(xe, {
3810
- onLoad: (e) => o(e),
3811
- onPlacesChanged: () => {
3812
- let e = a?.getPlaces(), t = e ? e[0] : null, r = t?.address_components;
3813
- function i(e) {
3814
- let t = r.find((t) => t.types[0] === e);
3815
- return t ? t.long_name : "";
3816
- }
3817
- function o(e) {
3818
- let t = r.find((t) => t.types[0] === e);
3819
- return t ? t.short_name : "";
3820
- }
3821
- function s(e) {
3822
- for (let t of e) {
3823
- let e = r.find((e) => e.types.includes(t));
3824
- if (e) return e.long_name;
3825
- }
3826
- return "";
3827
- }
3828
- if (t) {
3829
- let e = i("route"), r = i("street_number"), a = s([
3830
- "sublocality_level_1",
3831
- "sublocality",
3832
- "neighborhood"
3833
- ]), c = i("administrative_area_level_2"), l = i("administrative_area_level_1"), u = o("administrative_area_level_1"), d = {
3834
- street: e,
3835
- city: c,
3836
- state: l,
3837
- neighborhood: a,
3838
- postalCode: s(["postal_code", "postal_code_prefix"]),
3839
- streetNumber: r,
3840
- stateShortName: u,
3841
- coordinates: {
3842
- lat: t.geometry?.location?.lat(),
3843
- lng: t.geometry?.location?.lng()
3844
- }
3845
- };
3846
- n && n(d);
3847
- }
3848
- },
3849
- options: r,
3850
- children: /* @__PURE__ */ p(st, {
3851
- type: "text",
3852
- autoComplete: "off",
3853
- onChange: (e) => t && t(e.target.value),
3854
- ...i
3855
- })
3856
- });
3857
- }
3858
- //#endregion
3859
- //#region src/components/switch/index.tsx
3860
- function Br(e) {
3861
- let { label: t, size: n = "lg", defaultChecked: r = !1, checked: i = null, value: a, unCheckedValue: o = "", name: c, className: d = "", onCheck: f, id: m, orientation: h = "horizontalReverse", className: g = "", showAsterisk: _, errorMessage: v, unShowFieldTemplate: y = !1, ...b } = e, x = l(null), S = m || s(), [C, w] = u(r), T = typeof i == "boolean" ? i : C;
3862
- function E() {
3863
- w(!C), f && f(T ? o : a || "checked");
3864
- }
3865
- return /* @__PURE__ */ p(et, {
3866
- name: c,
3867
- label: t,
3868
- showAsterisk: _,
3869
- className: g,
3870
- errorMessage: v,
3871
- unShowFieldTemplate: y,
3872
- orientation: h,
3873
- children: /* @__PURE__ */ p("button", {
3874
- type: "button",
3875
- onClick: E,
3876
- className: `arkynSwitch ${T ? "checkedTrue" : "checkedFalse"} ${n} ${d}`,
3877
- ...b,
3878
- children: /* @__PURE__ */ p("input", {
3879
- id: S,
3880
- type: "hidden",
3881
- name: c,
3882
- ref: x,
3883
- onClick: E,
3884
- value: T ? a || "checked" : o
3885
- })
3886
- })
3887
- });
3888
- }
3889
- //#endregion
3890
- //#region src/components/table/tableBody/index.tsx
3891
- function Vr(t) {
3892
- let { emptyMessage: n = "Nenhum dado adicionado.", className: r, children: i, ...a } = t, o = `arkynTableBody ${r}`, s = e.count(i) === 0;
3893
- return /* @__PURE__ */ p("tbody", {
3894
- className: o.trim(),
3895
- ...a,
3896
- children: s ? /* @__PURE__ */ p("tr", {
3897
- className: "arkynTableBodyEmptyLine",
3898
- children: /* @__PURE__ */ p("td", {
3899
- colSpan: 100,
3900
- children: /* @__PURE__ */ p("div", { children: n })
3901
- })
3902
- }) : i
3903
- });
3904
- }
3905
- //#endregion
3906
- //#region src/components/table/tableCaption/index.tsx
3907
- function Hr(e) {
3908
- let { className: t, children: n, ...r } = e;
3909
- return /* @__PURE__ */ p("caption", {
3910
- className: `arkynTableCaption ${t}`.trim(),
3911
- ...r,
3912
- children: /* @__PURE__ */ p("div", {
3913
- className: "arkynTableCaptionContent",
3914
- children: n
3915
- })
3916
- });
3917
- }
3918
- //#endregion
3919
- //#region src/components/table/tableContainer/index.tsx
3920
- function Ur(e) {
3921
- let { children: t, className: n, ...r } = e;
3922
- return /* @__PURE__ */ p("div", {
3923
- className: `arkynTableContainer ${n}`.trim(),
3924
- ...r,
3925
- children: /* @__PURE__ */ p("table", { children: t })
3926
- });
3927
- }
3928
- //#endregion
3929
- //#region src/components/table/tableFooter/index.tsx
3930
- function Wr(e) {
3931
- let { className: t, children: n, ...r } = e;
3932
- return /* @__PURE__ */ m("tfoot", {
3933
- className: `arkynTableFooter ${t}`.trim(),
3934
- ...r,
3935
- children: [/* @__PURE__ */ p("tr", { className: "spacingRow" }), /* @__PURE__ */ p("tr", { children: /* @__PURE__ */ p("th", {
3936
- colSpan: 100,
3937
- children: /* @__PURE__ */ p("div", {
3938
- className: "arkynTableFooterContent",
3939
- children: n
3940
- })
3941
- }) })]
3942
- });
3943
- }
3944
- //#endregion
3945
- //#region src/components/table/tableHeader/index.tsx
3946
- function Gr(e) {
3947
- let { className: t, children: n, ...r } = e;
3948
- return /* @__PURE__ */ m("thead", {
3949
- className: `arkynTableHeader ${t}`.trim(),
3950
- ...r,
3951
- children: [/* @__PURE__ */ p("tr", { children: n }), /* @__PURE__ */ p("tr", { className: "spacingRow" })]
3952
- });
3953
- }
3954
- //#endregion
3955
- //#region src/components/textarea/index.tsx
3956
- function Kr(e) {
3957
- let { variant: t = "solid", size: n = "md", className: r, errorMessage: i, disabled: a = !1, readOnly: o = !1, label: c, showAsterisk: d, name: f, onFocus: h, onBlur: g, title: _, style: v, value: y, defaultValue: b, placeholder: x, id: S, ...C } = e, { fieldErrors: w } = X(), [T, E] = u(!1), D = l(null), O = S || s(), k = i || w?.[f], A = `arkynTextarea ${t} ${n} ${a || o ? "opacityTrue" : "opacityFalse"} ${k ? "errorTrue" : "errorFalse"} ${T ? "focusedTrue" : "focusedFalse"}`;
3958
- function j() {
3959
- a || !D?.current || (E(!0), D.current.focus());
3960
- }
3961
- function M(e) {
3962
- E(!0), h && h(e);
3963
- }
3964
- function N(e) {
3965
- E(!1), g && g(e);
3966
- }
3967
- return /* @__PURE__ */ m(Ve, {
3968
- className: r,
3969
- children: [
3970
- c && /* @__PURE__ */ p(Be, {
3971
- htmlFor: O,
3972
- showAsterisk: d,
3973
- children: c
3974
- }),
3975
- /* @__PURE__ */ p("section", {
3976
- title: _,
3977
- style: v,
3978
- onClick: j,
3979
- className: A,
3980
- children: /* @__PURE__ */ p("textarea", {
3981
- id: O,
3982
- disabled: a,
3983
- readOnly: o,
3984
- ref: D,
3985
- name: f,
3986
- onFocus: M,
3987
- onBlur: N,
3988
- defaultValue: b || "",
3989
- placeholder: a && y || x,
3990
- value: a ? void 0 : y,
3991
- ...C
3992
- })
3993
- }),
3994
- k && /* @__PURE__ */ p(ze, { children: k })
3995
- ]
3996
- });
3997
- }
3998
- //#endregion
3999
- //#region src/providers/modalProvider.tsx
4000
- var qr = n({});
4001
- function Jr(e) {
4002
- let { children: t = !1 } = e, [n, r] = u([]);
4003
- function i(e) {
4004
- return !!n.some((t) => t.key === e);
4005
- }
4006
- function a(e) {
4007
- return n.find((t) => t.key === e)?.data;
4008
- }
4009
- function o(e, t) {
4010
- i(e) ? r((n) => [...n.filter((t) => t.key !== e), {
4011
- key: e,
4012
- data: t
4013
- }]) : r([...n, {
4014
- key: e,
4015
- data: t
4016
- }]);
4017
- }
4018
- function s(e) {
4019
- r(n.filter((t) => t.key !== e));
4020
- }
4021
- function c() {
4022
- r([]);
4023
- }
4024
- return /* @__PURE__ */ p(qr.Provider, {
4025
- value: {
4026
- modalIsOpen: i,
4027
- modalData: a,
4028
- openModal: o,
4029
- closeModal: s,
4030
- closeAll: c
4031
- },
4032
- children: t
4033
- });
4034
- }
4035
- //#endregion
4036
- //#region src/hooks/useModal.ts
4037
- function Yr(e) {
4038
- let t = a(qr);
4039
- if (Object.entries(t).length === 0) throw Error("useModal must be used within a Provider");
4040
- if (e) {
4041
- let { modalData: n, modalIsOpen: r, openModal: i, closeModal: a } = t;
4042
- return {
4043
- modalIsOpen: r(e),
4044
- modalData: n(e),
4045
- openModal: (t) => i(e, t),
4046
- closeModal: () => a(e)
4047
- };
4048
- } else return t;
4049
- }
4050
- //#endregion
4051
- //#region src/providers/toastProvider.tsx
4052
- var Xr = n({});
4053
- function Zr({ children: e }) {
4054
- function t(e) {
4055
- switch (e.type) {
4056
- case "success": return we.success(e.message, {
4057
- style: {
4058
- background: "#10B981",
4059
- color: "#ffffff",
4060
- padding: "12px 16px",
4061
- fontSize: "14px",
4062
- fontWeight: 600
4063
- },
4064
- iconTheme: {
4065
- primary: "#059669",
4066
- secondary: "#ffffff"
4067
- }
4068
- });
4069
- case "danger": return we.error(e.message, {
4070
- style: {
4071
- background: "#E11D48",
4072
- color: "#ffffff",
4073
- padding: "12px 16px",
4074
- fontSize: "14px",
4075
- fontWeight: 600
4076
- },
4077
- iconTheme: {
4078
- primary: "#BE123C",
4079
- secondary: "#ffffff"
4080
- }
4081
- });
4082
- }
4083
- }
4084
- return /* @__PURE__ */ m(Xr.Provider, {
4085
- value: { showToast: t },
4086
- children: [/* @__PURE__ */ p(Te, {
4087
- position: "top-right",
4088
- containerStyle: { zIndex: 999999999999999 }
4089
- }), e]
4090
- });
4091
- }
4092
- //#endregion
4093
- //#region src/hooks/useToast.ts
4094
- function Qr() {
4095
- let e = a(Xr);
4096
- if (Object.entries(e).length === 0) throw Error("useToast must be used within a Provider");
4097
- return e;
4098
- }
4099
- //#endregion
4100
- //#region src/templates/badResponses.ts
4101
- var $r = [
4102
- "BadGateway",
4103
- "BadRequest",
4104
- "Conflict",
4105
- "Forbidden",
4106
- "NotFound",
4107
- "NotImplemented",
4108
- "ServerError",
4109
- "Unauthorized",
4110
- "UnprocessableEntity"
4111
- ], ei = [
4112
- "Created",
4113
- "Found",
4114
- "Success",
4115
- "Updated"
4116
- ];
4117
- //#endregion
4118
- //#region src/hooks/useAutomation.ts
4119
- function ti(e) {
4120
- let { closeAll: t } = Yr(), { showToast: n } = Qr(), r = e?.closeModal, i = e?.message, a = e?.name, s = e?.cause?.data?.scrollTo, c = e?.cause?.fieldErrors ? Object.values(e?.cause?.fieldErrors)[0] : null;
4121
- function l() {
4122
- if (!(!i && !c)) {
4123
- if (ei.includes(a)) return n({
4124
- message: i,
4125
- type: "success"
4126
- });
4127
- if ($r.includes(a)) {
4128
- if (c) return n({
4129
- message: c,
4130
- type: "danger"
4131
- });
4132
- if (i !== "Unprocessable entity") return n({
4133
- message: i,
4134
- type: "danger"
4135
- });
4136
- }
4137
- }
4138
- }
4139
- o(() => {
4140
- r && t(), s && Ce.scrollTo(s, {
4141
- smooth: !0,
4142
- offset: 20
4143
- }), l();
4144
- }, [e]);
4145
- }
4146
- //#endregion
4147
- //#region src/providers/drawerProvider.tsx
4148
- var ni = n({});
4149
- function ri(e) {
4150
- let { children: t = !1 } = e, [n, r] = u([]);
4151
- function i(e) {
4152
- return !!n.some((t) => t.key === e);
4153
- }
4154
- function a(e) {
4155
- return n.find((t) => t.key === e)?.data;
4156
- }
4157
- function o(e, t) {
4158
- i(e) ? r((n) => [...n.filter((t) => t.key !== e), {
4159
- key: e,
4160
- data: t
4161
- }]) : r([...n, {
4162
- key: e,
4163
- data: t
4164
- }]);
4165
- }
4166
- function s(e) {
4167
- r(n.filter((t) => t.key !== e));
4168
- }
4169
- return /* @__PURE__ */ p(ni.Provider, {
4170
- value: {
4171
- drawerIsOpen: i,
4172
- drawerData: a,
4173
- openDrawer: o,
4174
- closeDrawer: s
4175
- },
4176
- children: t
4177
- });
4178
- }
4179
- //#endregion
4180
- //#region src/hooks/useDrawer.ts
4181
- function ii(e) {
4182
- let t = a(ni);
4183
- if (Object.entries(t).length === 0) throw Error("useDrawer must be used within a Provider");
4184
- if (e) {
4185
- let { drawerData: n, drawerIsOpen: r, openDrawer: i, closeDrawer: a } = t;
4186
- return {
4187
- drawerIsOpen: r(e),
4188
- drawerData: n(e),
4189
- openDrawer: (t) => i(e, t),
4190
- closeDrawer: () => a(e)
4191
- };
4192
- } else return t;
4193
- }
4194
- //#endregion
4195
- //#region src/hooks/useScopedParams.ts
4196
- function ai(e, t = "") {
4197
- let n = new URLSearchParams(e), r = t ? `${t}:` : "", i = (e) => {
4198
- Object.entries(e).forEach(([e, t]) => {
4199
- t === void 0 ? n.delete(`${r}${e}`) : n.set(`${r}${e}`, String(t));
4200
- });
4201
- };
4202
- return {
4203
- getParam: (e) => n.get(`${r}${e}`),
4204
- getScopedSearch: (e) => {
4205
- i(e);
4206
- let t = n.toString();
4207
- return t &&= "?" + t, t;
4208
- }
4209
- };
4210
- }
4211
- //#endregion
4212
- //#region src/hooks/useSearchAutomation.ts
4213
- function oi(e, t = "") {
4214
- let { closeAll: n } = Yr(), { showToast: r } = Qr(), { getParam: i } = ai(e, t), a = i("closeModal") === "true", s = i("message"), c = i("name"), l = i("type");
4215
- o(() => {
4216
- a && n(), s && (l === "success" && r({
4217
- message: s,
4218
- type: "success"
4219
- }), l === "danger" && r({
4220
- message: s,
4221
- type: "danger"
4222
- }), c && $r.includes(c) && !$r.includes(s) && r({
4223
- message: s,
4224
- type: "danger"
4225
- }), c && ei.includes(c) && !ei.includes(s) && r({
4226
- message: s,
4227
- type: "success"
4228
- }));
4229
- }, [
4230
- a,
4231
- s,
4232
- c,
4233
- l
4234
- ]);
4235
- }
4236
- //#endregion
4237
- //#region src/providers/placesProvider.tsx
4238
- var si = [
4239
- "places",
4240
- "marker",
4241
- "maps"
4242
- ];
4243
- function ci(e) {
4244
- let { apiKey: t, children: n, preventFontsLoading: r = !0 } = e, { isLoaded: i } = Se({
4245
- googleMapsApiKey: t,
4246
- libraries: si,
4247
- preventGoogleFontsLoading: r
4248
- });
4249
- return /* @__PURE__ */ p(f, { children: n(i) });
4250
- }
4251
- //#endregion
4252
- //#region src/utils/richTextUtilities.ts
4253
- function li(e) {
4254
- if (pe.isText(e)) {
4255
- let t = e?.text;
4256
- return e?.bold && (t = `<strong>${t}</strong>`), e?.code && (t = `<code>${t}</code>`), e?.italic && (t = `<em>${t}</em>`), e?.underline && (t = `<u>${t}</u>`), t;
4257
- }
4258
- if (de.isElement(e)) {
4259
- let t = e.children?.map((e) => li(e)).join(""), n = e.align || "left";
4260
- switch (e.type) {
4261
- case "video": return `<iframe src="${e.src}" class="align_${n}" />`;
4262
- case "image": return `<img src="${e.src}" class="align_${n}" />`;
4263
- case "paragraph": return `<p class="align_${n}">${t}</p>`;
4264
- case "blockQuote": return `<blockquote class="align_${n}">${t}</blockquote>`;
4265
- case "bulletedList": return `<ul class="align_${n}">${t}</ul>`;
4266
- case "headingOne": return `<h1 class="align_${n}">${t}</h1>`;
4267
- case "headingTwo": return `<h2 class="align_${n}">${t}</h2>`;
4268
- case "listItem": return `<li class="align_${n}">${t}</li>`;
4269
- case "numberedList": return `<ol class="align_${n}">${t}</ol>`;
4270
- default: return "";
4271
- }
4272
- }
4273
- return "";
4274
- }
4275
- function ui(e) {
4276
- if (typeof e == "string") return { text: e };
4277
- let t = Array.isArray(e.props.children) ? e.props.children.map((e) => ui(e)) : [{ text: e.props.children || "" }], n = e.props.className?.replace("align_", "");
4278
- switch (e.type) {
4279
- case "img": return {
4280
- type: "image",
4281
- align: n,
4282
- src: e.props.src,
4283
- children: [{ text: "" }]
4284
- };
4285
- case "p": return {
4286
- type: "paragraph",
4287
- align: n,
4288
- children: t
4289
- };
4290
- case "blockquote": return {
4291
- type: "blockQuote",
4292
- align: n,
4293
- children: t
4294
- };
4295
- case "ul": return {
4296
- type: "bulletedList",
4297
- align: n,
4298
- children: t
4299
- };
4300
- case "ol": return {
4301
- type: "numberedList",
4302
- align: n,
4303
- children: t
4304
- };
4305
- case "li": return {
4306
- type: "listItem",
4307
- align: n,
4308
- children: t
4309
- };
4310
- case "h1": return {
4311
- type: "headingOne",
4312
- align: n,
4313
- children: t
4314
- };
4315
- case "h2": return {
4316
- type: "headingTwo",
4317
- align: n,
4318
- children: t
4319
- };
4320
- case "strong": return {
4321
- text: e.props.children,
4322
- bold: !0
4323
- };
4324
- case "code": return {
4325
- text: e.props.children,
4326
- code: !0
4327
- };
4328
- case "em": return {
4329
- text: e.props.children,
4330
- italic: !0
4331
- };
4332
- case "u": return {
4333
- text: e.props.children,
4334
- underline: !0
4335
- };
4336
- default: return { text: e.props.children || "" };
4337
- }
4338
- }
4339
- //#endregion
4340
- //#region src/services/toHtml.ts
4341
- function di(e) {
4342
- return e.map((e) => li(e)).join("");
4343
- }
4344
- //#endregion
4345
- //#region src/services/toRichTextValue.ts
4346
- function fi(e) {
4347
- let t = Ee(e);
4348
- return Array.isArray(t) ? t.map((e) => typeof e == "string" ? { text: e } : ui(e)) : typeof t == "string" ? [{ text: t }] : [ui(t)];
4349
- }
4350
- //#endregion
4351
- export { Ae as AlertContainer, je as AlertContent, Me as AlertDescription, Ne as AlertIcon, De as AlertTitle, Ie as AudioPlayer, qe as AudioUpload, Je as Badge, Q as Button, _t as Calendar, xt as CardTabButton, St as CardTabContainer, Ct as Checkbox, Et as ClientOnly, kt as CurrencyInput, He as Divider, Nt as DrawerContainer, Pt as DrawerHeader, ri as DrawerProvider, Lt as FacebookPixel, ze as FieldError, Be as FieldLabel, Ve as FieldWrapper, Bt as FileUpload, Re as FormProvider, pn as FullCalendar, _n as GoogleAnalytics, Sn as GoogleTagManager, Ue as IconButton, Tn as ImageUpload, st as Input, On as MapView, An as MaskedInput, Pn as ModalContainer, Fn as ModalFooter, In as ModalHeader, Jr as ModalProvider, Gn as MultiSelect, Zn as Pagination, ur as PhoneInput, ci as PlacesProvider, dr as Popover, hr as RadioBox, gr as RadioGroup, Rr as RichText, zr as SearchPlaces, dt as Select, Fe as Slider, Br as Switch, Or as TabButton, kr as TabContainer, Vr as TableBody, Hr as TableCaption, Ur as TableContainer, Wr as TableFooter, Gr as TableHeader, Kr as Textarea, Zr as ToastProvider, We as Tooltip, di as toHtml, fi as toRichTextValue, ti as useAutomation, ii as useDrawer, X as useForm, Tt as useHydrated, Yr as useModal, ai as useScopedParams, ot as useScrollLock, oi as useSearchAutomation, Pe as useSlider, Qr as useToast };