@nice2dev/ui-3d 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/cjs/core/i18n.js +3 -3
  2. package/dist/cjs/dance/DanceBridge.js +13 -13
  3. package/dist/cjs/dance/DanceScoreEngine.js +8 -8
  4. package/dist/cjs/dance/PoseDetector.js +20 -20
  5. package/dist/cjs/material/NiceMaterialEditor.js +19 -19
  6. package/dist/cjs/model/ModelEditorLeftPanel.js +5 -5
  7. package/dist/cjs/model/ModelEditorLeftPanel.js.map +1 -1
  8. package/dist/cjs/model/ModelEditorMenuBar.js +6 -5
  9. package/dist/cjs/model/ModelEditorMenuBar.js.map +1 -1
  10. package/dist/cjs/model/ModelEditorRightPanel.js +19 -17
  11. package/dist/cjs/model/ModelEditorRightPanel.js.map +1 -1
  12. package/dist/cjs/model/ModelEditorSubComponents.js +10 -9
  13. package/dist/cjs/model/ModelEditorSubComponents.js.map +1 -1
  14. package/dist/cjs/model/ModelEditorTimeline.js +6 -5
  15. package/dist/cjs/model/ModelEditorTimeline.js.map +1 -1
  16. package/dist/cjs/model/ModelEditorToolbar.js +4 -4
  17. package/dist/cjs/model/ModelEditorToolbar.js.map +1 -1
  18. package/dist/cjs/model/ModelEditorViewport.js +2 -2
  19. package/dist/cjs/model/ModelViewer.js +14 -13
  20. package/dist/cjs/model/ModelViewer.js.map +1 -1
  21. package/dist/cjs/model/NiceArmatureEditor.js +18 -18
  22. package/dist/cjs/model/NiceMorphTargetEditor.js +18 -18
  23. package/dist/cjs/model/NiceOctree.js +16 -16
  24. package/dist/cjs/model/NicePhysicsSimulation.js +24 -24
  25. package/dist/cjs/model/NiceProceduralGeometry.js +8 -8
  26. package/dist/cjs/model/NiceTerrainEditor.js +19 -19
  27. package/dist/cjs/model/NiceWeightPainter.js +14 -14
  28. package/dist/cjs/model/NiceXRPreview.js +18 -18
  29. package/dist/cjs/model/useModelEditor.js +127 -127
  30. package/dist/cjs/model/useModelViewer.js +61 -61
  31. package/dist/cjs/particle/NiceParticleEditor.js +11 -11
  32. package/dist/cjs/rendering/NiceCascadedShadows.js +12 -12
  33. package/dist/cjs/rendering/NiceRenderExport.js +5 -5
  34. package/dist/cjs/rendering/NiceSSAO.js +18 -18
  35. package/dist/cjs/rendering/NiceSSR.js +14 -14
  36. package/dist/cjs/rendering/NiceWebGPURenderer.js +21 -21
  37. package/dist/cjs/ui/dist/NiceButton-DmTHNHet.js +453 -0
  38. package/dist/cjs/ui/dist/NiceButton-DmTHNHet.js.map +1 -0
  39. package/dist/cjs/ui/dist/NiceErrorBoundary-D1hh5GGe.js +543 -0
  40. package/dist/cjs/ui/dist/NiceErrorBoundary-D1hh5GGe.js.map +1 -0
  41. package/dist/cjs/ui/dist/NiceModuleLifecyclePanel-BapdidD6.js +4772 -0
  42. package/dist/cjs/ui/dist/NiceModuleLifecyclePanel-BapdidD6.js.map +1 -0
  43. package/dist/cjs/ui/dist/NicePinCodeInput-4q8yULuo.js +11329 -0
  44. package/dist/cjs/ui/dist/NicePinCodeInput-4q8yULuo.js.map +1 -0
  45. package/dist/cjs/ui/dist/NiceSavedQueryPanel-DUw8plYP.js +5544 -0
  46. package/dist/cjs/ui/dist/NiceSavedQueryPanel-DUw8plYP.js.map +1 -0
  47. package/dist/cjs/ui/dist/NiceStockChart-Cpmv9_Cc.js +2244 -0
  48. package/dist/cjs/ui/dist/NiceStockChart-Cpmv9_Cc.js.map +1 -0
  49. package/dist/cjs/ui/dist/NiceToggle-C1UKGXmJ.js +212 -0
  50. package/dist/cjs/ui/dist/NiceToggle-C1UKGXmJ.js.map +1 -0
  51. package/dist/cjs/ui/dist/NiceWindow-D1awkyFl.js +697 -0
  52. package/dist/cjs/ui/dist/NiceWindow-D1awkyFl.js.map +1 -0
  53. package/dist/cjs/ui/dist/core-CfXsl755.js +9597 -0
  54. package/dist/cjs/ui/dist/core-CfXsl755.js.map +1 -0
  55. package/dist/cjs/ui/dist/index-CNwVELPJ.js +31214 -0
  56. package/dist/cjs/ui/dist/index-CNwVELPJ.js.map +1 -0
  57. package/dist/cjs/ui/dist/index-x8mRM4Jc.js +20 -0
  58. package/dist/cjs/ui/dist/index-x8mRM4Jc.js.map +1 -0
  59. package/dist/cjs/uv/NiceUVEditor.js +24 -24
  60. package/dist/esm/model/ModelEditorLeftPanel.js +5 -5
  61. package/dist/esm/model/ModelEditorMenuBar.js +6 -5
  62. package/dist/esm/model/ModelEditorMenuBar.js.map +1 -1
  63. package/dist/esm/model/ModelEditorRightPanel.js +19 -17
  64. package/dist/esm/model/ModelEditorRightPanel.js.map +1 -1
  65. package/dist/esm/model/ModelEditorSubComponents.js +7 -6
  66. package/dist/esm/model/ModelEditorSubComponents.js.map +1 -1
  67. package/dist/esm/model/ModelEditorTimeline.js +6 -5
  68. package/dist/esm/model/ModelEditorTimeline.js.map +1 -1
  69. package/dist/esm/model/ModelEditorToolbar.js +4 -4
  70. package/dist/esm/model/ModelEditorViewport.js +2 -2
  71. package/dist/esm/model/ModelViewer.js +6 -5
  72. package/dist/esm/model/ModelViewer.js.map +1 -1
  73. package/dist/esm/ui/dist/NiceButton-DmTHNHet.js +448 -0
  74. package/dist/esm/ui/dist/NiceButton-DmTHNHet.js.map +1 -0
  75. package/dist/esm/ui/dist/NiceErrorBoundary-D1hh5GGe.js +533 -0
  76. package/dist/esm/ui/dist/NiceErrorBoundary-D1hh5GGe.js.map +1 -0
  77. package/dist/esm/ui/dist/NiceModuleLifecyclePanel-BapdidD6.js +4731 -0
  78. package/dist/esm/ui/dist/NiceModuleLifecyclePanel-BapdidD6.js.map +1 -0
  79. package/dist/esm/ui/dist/NicePinCodeInput-4q8yULuo.js +11259 -0
  80. package/dist/esm/ui/dist/NicePinCodeInput-4q8yULuo.js.map +1 -0
  81. package/dist/esm/ui/dist/NiceSavedQueryPanel-DUw8plYP.js +5527 -0
  82. package/dist/esm/ui/dist/NiceSavedQueryPanel-DUw8plYP.js.map +1 -0
  83. package/dist/esm/ui/dist/NiceStockChart-Cpmv9_Cc.js +2222 -0
  84. package/dist/esm/ui/dist/NiceStockChart-Cpmv9_Cc.js.map +1 -0
  85. package/dist/esm/ui/dist/NiceToggle-C1UKGXmJ.js +208 -0
  86. package/dist/esm/ui/dist/NiceToggle-C1UKGXmJ.js.map +1 -0
  87. package/dist/esm/ui/dist/NiceWindow-D1awkyFl.js +686 -0
  88. package/dist/esm/ui/dist/NiceWindow-D1awkyFl.js.map +1 -0
  89. package/dist/esm/ui/dist/core-CfXsl755.js +9419 -0
  90. package/dist/esm/ui/dist/core-CfXsl755.js.map +1 -0
  91. package/dist/esm/ui/dist/index-CNwVELPJ.js +31110 -0
  92. package/dist/esm/ui/dist/index-CNwVELPJ.js.map +1 -0
  93. package/dist/esm/ui/dist/index-x8mRM4Jc.js +18 -0
  94. package/dist/esm/ui/dist/index-x8mRM4Jc.js.map +1 -0
  95. package/package.json +1 -1
@@ -0,0 +1,543 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var coreCfXsl755 = require('./core-CfXsl755.js');
5
+ var we = require('react');
6
+
7
+ const Q = {
8
+ info: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z", clipRule: "evenodd" }) }),
9
+ success: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z", clipRule: "evenodd" }) }),
10
+ warning: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
11
+ error: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z", clipRule: "evenodd" }) })
12
+ }, he = ({
13
+ variant: n = "info",
14
+ title: t,
15
+ children: s,
16
+ closable: r,
17
+ onClose: i,
18
+ icon: c,
19
+ size: l = "md",
20
+ className: u,
21
+ style: d,
22
+ displayStyle: p
23
+ }) => {
24
+ const m = coreCfXsl755.d("card", p);
25
+ return /* @__PURE__ */ jsxRuntime.jsxs(
26
+ "div",
27
+ {
28
+ className: `nice-alert nice-alert--${n} nice-alert--${l} nice-alert--ds-${m} ${u || ""}`,
29
+ style: d,
30
+ role: "alert",
31
+ children: [
32
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `nice-alert__icon nice-alert__icon--${n}`, children: c || Q[n] }),
33
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-alert__content", children: [
34
+ t && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-alert__title", children: t }),
35
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: s })
36
+ ] }),
37
+ r && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-alert__close", onClick: i, "aria-label": "Close", children: "✕" })
38
+ ]
39
+ }
40
+ );
41
+ }, fe = ({
42
+ open: n,
43
+ onClose: t,
44
+ title: s,
45
+ size: r = "md",
46
+ children: i,
47
+ footer: c,
48
+ closeOnOverlay: l = true,
49
+ closeOnEscape: u = true,
50
+ fullscreenable: d,
51
+ zIndex: p,
52
+ className: m,
53
+ style: y,
54
+ displayStyle: v
55
+ }) => {
56
+ const { t: _ } = coreCfXsl755.b(), g = we.useRef(null), [h, o] = we.useState(false), $ = coreCfXsl755.c("modal", v), w = coreCfXsl755.d("modal", v);
57
+ return coreCfXsl755.h(g, n), we.useEffect(() => {
58
+ if (!n || !u) return;
59
+ const f = (C) => {
60
+ C.key === "Escape" && t();
61
+ };
62
+ return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
63
+ }, [n, u, t]), we.useEffect(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
64
+ document.body.style.overflow = "";
65
+ }), [n]), n ? /* @__PURE__ */ jsxRuntime.jsx(
66
+ "div",
67
+ {
68
+ className: "nice-modal-overlay",
69
+ style: p ? { zIndex: p } : void 0,
70
+ onClick: l ? t : void 0,
71
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
72
+ "div",
73
+ {
74
+ ref: g,
75
+ className: `nice-modal nice-modal--${h ? "full" : r} nice-modal--ds-${w} ${m || ""}`,
76
+ style: { ...$, ...y },
77
+ role: "dialog",
78
+ "aria-modal": "true",
79
+ "aria-label": s,
80
+ onClick: (f) => f.stopPropagation(),
81
+ children: [
82
+ s && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-modal__header", children: [
83
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "nice-modal__title", children: s }),
84
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-modal__header-actions", children: [
85
+ d && /* @__PURE__ */ jsxRuntime.jsx(
86
+ "button",
87
+ {
88
+ type: "button",
89
+ className: "nice-modal__fullscreen",
90
+ onClick: () => o((f) => !f),
91
+ "aria-label": h ? "Exit fullscreen" : "Fullscreen",
92
+ children: h ? "⇲" : "⇱"
93
+ }
94
+ ),
95
+ /* @__PURE__ */ jsxRuntime.jsx(
96
+ "button",
97
+ {
98
+ type: "button",
99
+ className: "nice-modal__close",
100
+ onClick: t,
101
+ "aria-label": _("controls.close", "Close"),
102
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
103
+ }
104
+ )
105
+ ] })
106
+ ] }),
107
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-modal__body", children: i }),
108
+ c && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-modal__footer", children: c })
109
+ ]
110
+ }
111
+ )
112
+ }
113
+ ) : null;
114
+ }, _e = ({
115
+ open: n,
116
+ onClose: t,
117
+ title: s,
118
+ position: r = "right",
119
+ size: i = "md",
120
+ children: c,
121
+ footer: l,
122
+ transitionDuration: u,
123
+ className: d,
124
+ style: p,
125
+ displayStyle: m
126
+ }) => {
127
+ const y = coreCfXsl755.c("modal", m), v = coreCfXsl755.d("modal", m), { t: _ } = coreCfXsl755.b(), g = we.useRef(null);
128
+ return coreCfXsl755.h(g, n), we.useEffect(() => {
129
+ if (!n) return;
130
+ const h = (o) => {
131
+ o.key === "Escape" && t();
132
+ };
133
+ return document.addEventListener("keydown", h), document.body.style.overflow = "hidden", () => {
134
+ document.removeEventListener("keydown", h), document.body.style.overflow = "";
135
+ };
136
+ }, [n, t]), n ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
137
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-drawer-overlay", onClick: t }),
138
+ /* @__PURE__ */ jsxRuntime.jsxs(
139
+ "div",
140
+ {
141
+ ref: g,
142
+ className: `nice-drawer nice-drawer--${r} nice-drawer--${i} nice-drawer--ds-${v} ${d || ""}`,
143
+ style: {
144
+ ...y,
145
+ ...p,
146
+ ...u != null ? { transitionDuration: `${u}ms` } : {}
147
+ },
148
+ role: "dialog",
149
+ "aria-modal": "true",
150
+ "aria-label": s,
151
+ children: [
152
+ s && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-drawer__header", children: [
153
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "nice-drawer__title", children: s }),
154
+ /* @__PURE__ */ jsxRuntime.jsx(
155
+ "button",
156
+ {
157
+ type: "button",
158
+ className: "nice-drawer__close",
159
+ onClick: t,
160
+ "aria-label": _("controls.close", "Close"),
161
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
162
+ }
163
+ )
164
+ ] }),
165
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-drawer__body", children: c }),
166
+ l && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-drawer__footer", children: l })
167
+ ]
168
+ }
169
+ )
170
+ ] }) : null;
171
+ }, be = ({
172
+ toasts: n,
173
+ onDismiss: t,
174
+ position: s = "top-right"
175
+ }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `nice-toast-container nice-toast-container--${s}`, children: n.map((r) => /* @__PURE__ */ jsxRuntime.jsx(ne, { toast: r, onDismiss: t }, r.id)) }), ne = ({ toast: n, onDismiss: t }) => {
176
+ const [s, r] = we.useState(false);
177
+ return we.useEffect(() => {
178
+ if (!n.duration && n.duration !== 0) {
179
+ const i = setTimeout(() => r(true), 4e3);
180
+ return () => clearTimeout(i);
181
+ }
182
+ if (n.duration > 0) {
183
+ const i = setTimeout(() => r(true), n.duration);
184
+ return () => clearTimeout(i);
185
+ }
186
+ }, [n.duration]), we.useEffect(() => {
187
+ if (s) {
188
+ const i = setTimeout(() => t(n.id), 200);
189
+ return () => clearTimeout(i);
190
+ }
191
+ }, [s, n.id, t]), /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-toast nice-toast--${n.variant} ${s ? "nice-toast--exiting" : ""}`, role: "alert", style: { position: "relative" }, children: [
192
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-toast__icon", children: Q[n.variant] }),
193
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-toast__content", children: [
194
+ n.title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-toast__title", children: n.title }),
195
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-toast__message", children: n.message })
196
+ ] }),
197
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-toast__close", onClick: () => r(true), children: "✕" })
198
+ ] });
199
+ };
200
+ let ie = 0;
201
+ function pe() {
202
+ const [n, t] = we.useState([]), s = we.useCallback((i, c, l) => {
203
+ const u = `toast-${++ie}`;
204
+ return t((d) => [...d, { id: u, variant: i, message: c, title: l?.title, duration: l?.duration }]), u;
205
+ }, []), r = we.useCallback((i) => {
206
+ t((c) => c.filter((l) => l.id !== i));
207
+ }, []);
208
+ return {
209
+ toasts: n,
210
+ dismiss: r,
211
+ info: (i, c) => s("info", i, c),
212
+ success: (i, c) => s("success", i, c),
213
+ warning: (i, c) => s("warning", i, c),
214
+ error: (i, c) => s("error", i, c)
215
+ };
216
+ }
217
+ const te = {
218
+ info: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }),
219
+ warning: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }) }),
220
+ error: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }) }),
221
+ success: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) })
222
+ }, ve = ({
223
+ visible: n,
224
+ message: t,
225
+ header: s,
226
+ icon: r,
227
+ variant: i = "warning",
228
+ acceptLabel: c,
229
+ rejectLabel: l,
230
+ onAccept: u,
231
+ onReject: d,
232
+ closeOnOverlay: p = false,
233
+ closeOnEscape: m = true,
234
+ size: y = "md",
235
+ className: v,
236
+ style: _
237
+ }) => {
238
+ const { t: g } = coreCfXsl755.b();
239
+ if (we.useEffect(() => {
240
+ if (!n || !m) return;
241
+ const w = (f) => {
242
+ f.key === "Escape" && d();
243
+ };
244
+ return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
245
+ }, [n, m, d]), we.useEffect(() => (n ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
246
+ document.body.style.overflow = "";
247
+ }), [n]), !n) return null;
248
+ const h = r ?? te[i], o = c ?? g("confirm.accept", "Yes"), $ = l ?? g("confirm.reject", "No");
249
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-modal-overlay", onClick: p ? d : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
250
+ "div",
251
+ {
252
+ className: `nice-confirm nice-confirm--${i} nice-confirm--${y} ${v || ""}`,
253
+ style: _,
254
+ role: "alertdialog",
255
+ "aria-modal": "true",
256
+ "aria-label": s,
257
+ "aria-describedby": "nice-confirm-message",
258
+ onClick: (w) => w.stopPropagation(),
259
+ children: [
260
+ s && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-confirm__header", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "nice-confirm__title", children: s }) }),
261
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-confirm__body", children: [
262
+ h && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `nice-confirm__icon nice-confirm__icon--${i}`, children: h }),
263
+ /* @__PURE__ */ jsxRuntime.jsx("div", { id: "nice-confirm-message", className: "nice-confirm__message", children: t })
264
+ ] }),
265
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-confirm__footer", children: [
266
+ /* @__PURE__ */ jsxRuntime.jsx(
267
+ "button",
268
+ {
269
+ type: "button",
270
+ className: "nice-btn nice-btn--ghost nice-btn--md",
271
+ onClick: d,
272
+ children: $
273
+ }
274
+ ),
275
+ /* @__PURE__ */ jsxRuntime.jsx(
276
+ "button",
277
+ {
278
+ type: "button",
279
+ className: `nice-btn nice-btn--${i === "error" ? "error" : "primary"} nice-btn--md`,
280
+ onClick: u,
281
+ autoFocus: true,
282
+ children: o
283
+ }
284
+ )
285
+ ] })
286
+ ]
287
+ }
288
+ ) });
289
+ };
290
+ const oe = we.forwardRef(
291
+ ({
292
+ visible: n,
293
+ onAcceptAll: t,
294
+ onRejectAll: s,
295
+ onSave: r,
296
+ categories: i = ["necessary", "analytics", "marketing", "preferences"],
297
+ defaults: c,
298
+ position: l = "bottom",
299
+ size: u = "md",
300
+ policyUrl: d,
301
+ showDetails: p = false,
302
+ className: m,
303
+ style: y,
304
+ id: v,
305
+ ..._
306
+ }, g) => {
307
+ const h = coreCfXsl755.u(v), { t: o } = coreCfXsl755.b(), [$, w] = we.useState(true), f = n ?? $, [C, z] = we.useState(p), [b, T] = we.useState(() => {
308
+ const N = { necessary: true, analytics: false, marketing: false, preferences: false };
309
+ return c && Object.assign(N, c), N.necessary = true, N;
310
+ }), M = {
311
+ necessary: o("cookie.necessary", "Necessary"),
312
+ analytics: o("cookie.analytics", "Analytics"),
313
+ marketing: o("cookie.marketing", "Marketing"),
314
+ preferences: o("cookie.preferences", "Preferences")
315
+ }, D = {
316
+ necessary: o("cookie.necessaryDesc", "Required for the website to function. Cannot be disabled."),
317
+ analytics: o("cookie.analyticsDesc", "Help us understand how visitors interact with the website."),
318
+ marketing: o("cookie.marketingDesc", "Used to deliver relevant advertisements."),
319
+ preferences: o("cookie.preferencesDesc", "Allow the website to remember your choices.")
320
+ }, R = we.useCallback(() => {
321
+ const N = { necessary: true, analytics: true, marketing: true, preferences: true };
322
+ t?.(), r?.(N), w(false);
323
+ }, [t, r]), S = we.useCallback(() => {
324
+ const N = { necessary: true, analytics: false, marketing: false, preferences: false };
325
+ s?.(), r?.(N), w(false);
326
+ }, [s, r]), A = we.useCallback(() => {
327
+ r?.({ ...b, necessary: true }), w(false);
328
+ }, [b, r]);
329
+ return f ? /* @__PURE__ */ jsxRuntime.jsx(
330
+ "div",
331
+ {
332
+ ref: g,
333
+ id: h,
334
+ className: `nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${u} ${m ?? ""}`,
335
+ style: y,
336
+ role: "dialog",
337
+ "aria-label": o("cookie.label", "Cookie Consent"),
338
+ "aria-modal": "true",
339
+ ..._,
340
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-cookie-consent__content", children: [
341
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "nice-cookie-consent__message", children: [
342
+ o("cookie.message", "We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."),
343
+ d && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
344
+ " ",
345
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: d, className: "nice-cookie-consent__link", target: "_blank", rel: "noopener noreferrer", children: o("cookie.learnMore", "Learn more") })
346
+ ] })
347
+ ] }),
348
+ C && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-cookie-consent__details", children: i.map((N) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "nice-cookie-consent__category", children: [
349
+ /* @__PURE__ */ jsxRuntime.jsx(
350
+ "input",
351
+ {
352
+ type: "checkbox",
353
+ checked: b[N],
354
+ disabled: N === "necessary",
355
+ onChange: (B) => T((F) => ({ ...F, [N]: B.target.checked })),
356
+ className: "nice-cookie-consent__checkbox"
357
+ }
358
+ ),
359
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-cookie-consent__cat-info", children: [
360
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: M[N] }),
361
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "nice-cookie-consent__cat-desc", children: D[N] })
362
+ ] })
363
+ ] }, N)) }),
364
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-cookie-consent__actions", children: [
365
+ !C && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-cookie-consent__btn nice-cookie-consent__btn--details", onClick: () => z(true), children: o("cookie.customize", "Customize") }),
366
+ C && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-cookie-consent__btn nice-cookie-consent__btn--save", onClick: A, children: o("cookie.savePreferences", "Save preferences") }),
367
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-cookie-consent__btn nice-cookie-consent__btn--reject", onClick: S, children: o("cookie.rejectAll", "Reject all") }),
368
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-cookie-consent__btn nice-cookie-consent__btn--accept", onClick: R, children: o("cookie.acceptAll", "Accept all") })
369
+ ] })
370
+ ] })
371
+ }
372
+ ) : null;
373
+ }
374
+ );
375
+ oe.displayName = "NiceCookieConsent";
376
+ const le = we.forwardRef(
377
+ ({
378
+ onSubmit: n,
379
+ onForgotPassword: t,
380
+ onRegister: s,
381
+ loading: r = false,
382
+ error: i,
383
+ variant: c = "primary",
384
+ size: l = "md",
385
+ showRememberMe: u = true,
386
+ showForgotPassword: d = true,
387
+ showRegister: p = false,
388
+ title: m,
389
+ logo: y,
390
+ usernameLabel: v,
391
+ passwordLabel: _,
392
+ usernamePlaceholder: g,
393
+ passwordPlaceholder: h,
394
+ className: o,
395
+ style: $,
396
+ id: w,
397
+ ...f
398
+ }, C) => {
399
+ const z = coreCfXsl755.u(w), { t: b } = coreCfXsl755.b(), [T, M] = we.useState(""), [D, R] = we.useState(""), [S, A] = we.useState(false), [N, B] = we.useState(false), F = `${z}-user`, H = `${z}-pass`, V = `${z}-remember`, X = we.useCallback(
400
+ (E) => {
401
+ E.preventDefault(), !r && n?.({ username: T, password: D, rememberMe: S });
402
+ },
403
+ [r, T, D, S, n]
404
+ );
405
+ return /* @__PURE__ */ jsxRuntime.jsxs(
406
+ "form",
407
+ {
408
+ ref: C,
409
+ id: z,
410
+ className: `nice-login nice-login--${c} nice-login--${l} ${o ?? ""}`,
411
+ style: $,
412
+ onSubmit: X,
413
+ noValidate: true,
414
+ ...f,
415
+ children: [
416
+ y && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-login__logo", children: y }),
417
+ m && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "nice-login__title", children: m ?? b("login.title", "Sign In") }),
418
+ i && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-login__error", role: "alert", children: i }),
419
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-login__field", children: [
420
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: F, className: "nice-login__label", children: v ?? b("login.username", "Username") }),
421
+ /* @__PURE__ */ jsxRuntime.jsx(
422
+ "input",
423
+ {
424
+ id: F,
425
+ className: "nice-login__input",
426
+ type: "text",
427
+ value: T,
428
+ onChange: (E) => M(E.target.value),
429
+ placeholder: g ?? b("login.usernamePlaceholder", "Enter your username"),
430
+ autoComplete: "username",
431
+ required: true,
432
+ disabled: r,
433
+ "aria-required": "true"
434
+ }
435
+ )
436
+ ] }),
437
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-login__field", children: [
438
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: H, className: "nice-login__label", children: _ ?? b("login.password", "Password") }),
439
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-login__password-wrap", children: [
440
+ /* @__PURE__ */ jsxRuntime.jsx(
441
+ "input",
442
+ {
443
+ id: H,
444
+ className: "nice-login__input",
445
+ type: N ? "text" : "password",
446
+ value: D,
447
+ onChange: (E) => R(E.target.value),
448
+ placeholder: h ?? b("login.passwordPlaceholder", "Enter your password"),
449
+ autoComplete: "current-password",
450
+ required: true,
451
+ disabled: r,
452
+ "aria-required": "true"
453
+ }
454
+ ),
455
+ /* @__PURE__ */ jsxRuntime.jsx(
456
+ "button",
457
+ {
458
+ type: "button",
459
+ className: "nice-login__toggle-password",
460
+ onClick: () => B(!N),
461
+ "aria-label": N ? b("login.hidePassword", "Hide password") : b("login.showPassword", "Show password"),
462
+ tabIndex: -1,
463
+ children: N ? "🙈" : "👁"
464
+ }
465
+ )
466
+ ] })
467
+ ] }),
468
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-login__options", children: [
469
+ u && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "nice-login__remember", htmlFor: V, children: [
470
+ /* @__PURE__ */ jsxRuntime.jsx(
471
+ "input",
472
+ {
473
+ id: V,
474
+ type: "checkbox",
475
+ checked: S,
476
+ onChange: (E) => A(E.target.checked),
477
+ disabled: r
478
+ }
479
+ ),
480
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: b("login.rememberMe", "Remember me") })
481
+ ] }),
482
+ d && t && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-login__forgot", onClick: t, disabled: r, children: b("login.forgotPassword", "Forgot password?") })
483
+ ] }),
484
+ /* @__PURE__ */ jsxRuntime.jsx(
485
+ "button",
486
+ {
487
+ type: "submit",
488
+ className: `nice-login__submit nice-login__submit--${c}`,
489
+ disabled: r || !T || !D,
490
+ children: r ? b("login.loading", "Signing in...") : b("login.submit", "Sign In")
491
+ }
492
+ ),
493
+ p && s && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "nice-login__register", children: [
494
+ b("login.noAccount", "Don't have an account?"),
495
+ " ",
496
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-login__register-link", onClick: s, disabled: r, children: b("login.register", "Register") })
497
+ ] })
498
+ ]
499
+ }
500
+ );
501
+ }
502
+ );
503
+ le.displayName = "NiceLoginForm";
504
+ const q = class q extends we.Component {
505
+ constructor() {
506
+ super(...arguments), this.state = {
507
+ hasError: false,
508
+ error: null
509
+ }, this.handleReset = () => {
510
+ this.setState({ hasError: false, error: null });
511
+ };
512
+ }
513
+ static getDerivedStateFromError(t) {
514
+ return { hasError: true, error: t };
515
+ }
516
+ componentDidCatch(t, s) {
517
+ this.props.onError?.(t, s);
518
+ }
519
+ render() {
520
+ if (this.state.hasError && this.state.error) {
521
+ const { fallback: t, showRetry: s = true, retryLabel: r = "Retry", title: i = "Something went wrong" } = this.props;
522
+ return typeof t == "function" ? t(this.state.error, this.handleReset) : t || /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "nice-error-boundary", role: "alert", children: [
523
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "nice-error-boundary__icon", children: "⚠️" }),
524
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "nice-error-boundary__title", children: i }),
525
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "nice-error-boundary__message", children: this.state.error.message }),
526
+ s && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "nice-btn nice-btn--primary", onClick: this.handleReset, children: r })
527
+ ] });
528
+ }
529
+ return this.props.children;
530
+ }
531
+ };
532
+ q.displayName = "NiceErrorBoundary";
533
+
534
+ exports.N = he;
535
+ exports.a = ve;
536
+ exports.b = oe;
537
+ exports.c = _e;
538
+ exports.e = le;
539
+ exports.f = fe;
540
+ exports.j = be;
541
+ exports.k = Q;
542
+ exports.u = pe;
543
+ //# sourceMappingURL=NiceErrorBoundary-D1hh5GGe.js.map