@blockbite/ui 2.0.22 → 2.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,256 +1,256 @@
1
- import { Button as C, Dropdown as X, TextControl as B, CheckboxControl as Y, DropdownMenu as J, FocalPointPicker as Q, PanelRow as ee, Popover as te, RangeControl as ae, __experimentalInputControl as O, __experimentalInputControlSuffixWrapper as z, Modal as le, Notice as ne, SelectControl as re, Spinner as ce, TabPanel as se, __experimentalToggleGroupControl as oe, __experimentalToggleGroupControlOptionIcon as ie, __experimentalToggleGroupControlOption as me, ToggleControl as ue } from "@wordpress/components";
2
- import { memo as V, useCallback as j, useState as g, useEffect as R, useRef as y, createPortal as D, forwardRef as de, createContext as A, useContext as P, Children as _, isValidElement as L, useMemo as fe } from "@wordpress/element";
3
- import pe from "@wordpress/api-fetch";
4
- import { __ as w } from "@wordpress/i18n";
5
- import { MediaUploadCheck as T, MediaUpload as $ } from "@wordpress/block-editor";
6
- import { SVG as ge, Path as Re } from "@wordpress/primitives";
7
- import { createBlock as Ee } from "@wordpress/blocks";
8
- function he(e) {
1
+ import { Button as E, Dropdown as ve, TextControl as K, CheckboxControl as Re, DropdownMenu as Ee, FocalPointPicker as he, PanelRow as Ce, Popover as xe, RangeControl as we, __experimentalInputControl as se, __experimentalInputControlSuffixWrapper as oe, Modal as ye, Notice as Ne, __experimentalToggleGroupControl as P, __experimentalToggleGroupControlOptionIcon as O, __experimentalToggleGroupControlOption as H, SelectControl as _e, Spinner as ke, TabPanel as Se, ToggleControl as Me } from "@wordpress/components";
2
+ import { memo as C, useCallback as w, useState as f, useEffect as R, useRef as B, createPortal as ie, forwardRef as $, createContext as y, useContext as q, Children as j, isValidElement as V, useMemo as Te } from "@wordpress/element";
3
+ import Le from "@wordpress/api-fetch";
4
+ import { __ as N } from "@wordpress/i18n";
5
+ import { MediaUploadCheck as F, MediaUpload as Y } from "@wordpress/block-editor";
6
+ import { SVG as Be, Path as Pe } from "@wordpress/primitives";
7
+ import { createBlock as Oe } from "@wordpress/blocks";
8
+ function He(e) {
9
9
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
10
10
  }
11
- var H = { exports: {} };
11
+ var Z = { exports: {} };
12
12
  /*!
13
13
  Copyright (c) 2018 Jed Watson.
14
14
  Licensed under the MIT License (MIT), see
15
15
  http://jedwatson.github.io/classnames
16
16
  */
17
- var I;
18
- function Ce() {
19
- return I || (I = 1, function(e) {
17
+ var J;
18
+ function $e() {
19
+ return J || (J = 1, function(e) {
20
20
  (function() {
21
- var t = {}.hasOwnProperty;
21
+ var a = {}.hasOwnProperty;
22
22
  function l() {
23
- for (var r = "", s = 0; s < arguments.length; s++) {
24
- var c = arguments[s];
25
- c && (r = n(r, a(c)));
23
+ for (var t = "", r = 0; r < arguments.length; r++) {
24
+ var n = arguments[r];
25
+ n && (t = s(t, c(n)));
26
26
  }
27
- return r;
27
+ return t;
28
28
  }
29
- function a(r) {
30
- if (typeof r == "string" || typeof r == "number")
31
- return r;
32
- if (typeof r != "object")
29
+ function c(t) {
30
+ if (typeof t == "string" || typeof t == "number")
31
+ return t;
32
+ if (typeof t != "object")
33
33
  return "";
34
- if (Array.isArray(r))
35
- return l.apply(null, r);
36
- if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
37
- return r.toString();
38
- var s = "";
39
- for (var c in r)
40
- t.call(r, c) && r[c] && (s = n(s, c));
41
- return s;
34
+ if (Array.isArray(t))
35
+ return l.apply(null, t);
36
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
37
+ return t.toString();
38
+ var r = "";
39
+ for (var n in t)
40
+ a.call(t, n) && t[n] && (r = s(r, n));
41
+ return r;
42
42
  }
43
- function n(r, s) {
44
- return s ? r ? r + " " + s : r + s : r;
43
+ function s(t, r) {
44
+ return r ? t ? t + " " + r : t + r : t;
45
45
  }
46
46
  e.exports ? (l.default = l, e.exports = l) : window.classNames = l;
47
47
  })();
48
- }(H)), H.exports;
48
+ }(Z)), Z.exports;
49
49
  }
50
- var be = Ce();
51
- const p = /* @__PURE__ */ he(be), v = ({ icon: e, ...t }) => e ? /* @__PURE__ */ React.createElement("div", { className: "blockbite--icon" }, /* @__PURE__ */ React.createElement(e, { ...t })) : null, xe = V(
50
+ var ze = $e();
51
+ const b = /* @__PURE__ */ He(ze), _ = ({ icon: e, ...a }) => e ? /* @__PURE__ */ React.createElement("div", { className: "blockbite--icon" }, /* @__PURE__ */ React.createElement(e, { ...a })) : null, je = C(
52
52
  ({
53
53
  children: e,
54
- className: t,
54
+ className: a,
55
55
  value: l,
56
- variant: a = "secondary",
57
- pressed: n,
58
- onPressedChange: r,
59
- icon: s,
60
- size: c = "compact",
61
- display: i = "auto",
62
- label: o
56
+ variant: c = "secondary",
57
+ pressed: s,
58
+ onPressedChange: t,
59
+ icon: r,
60
+ size: n = "compact",
61
+ display: u = "auto",
62
+ label: i
63
63
  }) => {
64
- const f = j(() => {
65
- r(l);
66
- }, [r, l]);
64
+ const d = w(() => {
65
+ t(l);
66
+ }, [t, l]);
67
67
  return /* @__PURE__ */ React.createElement(
68
- C,
68
+ E,
69
69
  {
70
- "aria-label": o,
71
- className: p(t, "blockbite-ui__button--default"),
70
+ "aria-label": i,
71
+ className: b(a, "blockbite-ui__button--default"),
72
72
  value: l,
73
- size: c,
74
- label: o,
75
- variant: a,
73
+ size: n,
74
+ label: i,
75
+ variant: c,
76
76
  showTooltip: !0,
77
- isPressed: n,
78
- onClick: f
77
+ isPressed: s,
78
+ onClick: d
79
79
  },
80
- s && /* @__PURE__ */ React.createElement(v, { icon: s }),
81
- i !== "icon" ? e : null,
82
- o && !e && i !== "icon" ? /* @__PURE__ */ React.createElement("span", null, o) : null
80
+ r && /* @__PURE__ */ React.createElement(_, { icon: r }),
81
+ u !== "icon" ? e : null,
82
+ i && !e && u !== "icon" ? /* @__PURE__ */ React.createElement("span", null, i) : null
83
83
  );
84
84
  }
85
- ), we = V(
85
+ ), Ve = C(
86
86
  ({
87
87
  className: e,
88
- value: t,
88
+ value: a,
89
89
  toggle: l = !0,
90
- display: a = "auto",
91
- options: n,
92
- size: r = "compact",
93
- tabs: s = !1,
94
- variant: c = "secondary",
95
- stretch: i = !1,
96
- onPressedChange: o
90
+ display: c = "auto",
91
+ options: s,
92
+ size: t = "compact",
93
+ tabs: r = !1,
94
+ variant: n = "secondary",
95
+ stretch: u = !1,
96
+ onPressedChange: i
97
97
  }) => {
98
- const f = j(
99
- (m) => {
100
- const u = l && t === m ? "" : m;
101
- o == null || o(u);
98
+ const d = w(
99
+ (o) => {
100
+ const m = l && a === o ? "" : o;
101
+ i == null || i(m);
102
102
  },
103
- [o, l, t]
104
- ), d = (m) => a === "icon" && (m != null && m.icon) ? /* @__PURE__ */ React.createElement(v, { icon: m.icon }) : a === "label" ? /* @__PURE__ */ React.createElement("span", null, m.label) : /* @__PURE__ */ React.createElement("span", { className: "flex items-center justify-center gap-1" }, m.icon && /* @__PURE__ */ React.createElement(v, { icon: m.icon }), /* @__PURE__ */ React.createElement("span", null, m.label));
103
+ [i, l, a]
104
+ ), p = (o) => c === "icon" && (o != null && o.icon) ? /* @__PURE__ */ React.createElement(_, { icon: o.icon }) : c === "label" ? /* @__PURE__ */ React.createElement("span", null, o.label) : /* @__PURE__ */ React.createElement("span", { className: "flex items-center justify-center gap-1" }, o.icon && /* @__PURE__ */ React.createElement(_, { icon: o.icon }), /* @__PURE__ */ React.createElement("span", null, o.label));
105
105
  return /* @__PURE__ */ React.createElement(
106
106
  "div",
107
107
  {
108
- className: p(
108
+ className: b(
109
109
  "blockbite-ui__button-group flex flex-wrap gap-1",
110
110
  e,
111
- s ? "blockbite-ui__button-group--tabs" : ""
111
+ r ? "blockbite-ui__button-group--tabs" : ""
112
112
  )
113
113
  },
114
- n.map((m, u) => /* @__PURE__ */ React.createElement(
115
- C,
114
+ s.map((o, m) => /* @__PURE__ */ React.createElement(
115
+ E,
116
116
  {
117
- key: `ButtonToggleGroup__${m.value}__${m.label}__${u}`,
118
- className: p("blockbite-ui__button--default", {
119
- grow: i,
120
- "justify-center": i
117
+ key: `ButtonToggleGroup__${o.value}__${o.label}__${m}`,
118
+ className: b("blockbite-ui__button--default", {
119
+ grow: u,
120
+ "justify-center": u
121
121
  }),
122
- "aria-label": m.label,
122
+ "aria-label": o.label,
123
123
  showTooltip: !0,
124
- value: m.value,
125
- size: r,
126
- label: (m == null ? void 0 : m.tooltip) || m.label,
127
- variant: c,
128
- isPressed: t === m.value,
129
- onClick: () => f(m.value)
124
+ value: o.value,
125
+ size: t,
126
+ label: (o == null ? void 0 : o.tooltip) || o.label,
127
+ variant: n,
128
+ isPressed: a === o.value,
129
+ onClick: () => d(o.value)
130
130
  },
131
- d(m),
132
- m.children && m.children
131
+ p(o),
132
+ o.children && o.children
133
133
  ))
134
134
  );
135
135
  }
136
- ), E = ({
136
+ ), h = ({
137
137
  children: e,
138
- className: t,
138
+ className: a,
139
139
  important: l = !1,
140
- onClick: a
141
- }) => l ? /* @__PURE__ */ React.createElement("div", { onClick: a }, /* @__PURE__ */ React.createElement("div", { className: t }, e)) : /* @__PURE__ */ React.createElement("div", { className: t }, e);
142
- function at({
140
+ onClick: c
141
+ }) => l ? /* @__PURE__ */ React.createElement("div", { onClick: c }, /* @__PURE__ */ React.createElement("div", { className: a }, e)) : /* @__PURE__ */ React.createElement("div", { className: a }, e);
142
+ function jt({
143
143
  value: e,
144
- options: t,
144
+ options: a,
145
145
  swatch: l,
146
- onPressedChange: a
146
+ onPressedChange: c
147
147
  }) {
148
- const [n, r] = g(""), [s, c] = g([]);
148
+ const [s, t] = f(""), [r, n] = f([]);
149
149
  return R(() => {
150
- c(
151
- t.filter(
152
- (i) => i.label.toLowerCase().includes(n.toLowerCase())
150
+ n(
151
+ a.filter(
152
+ (u) => u.label.toLowerCase().includes(s.toLowerCase())
153
153
  )
154
154
  );
155
- }, [n, t]), R(() => {
156
- r(""), c(t);
157
- }, [e, t]), /* @__PURE__ */ React.createElement(
158
- X,
155
+ }, [s, a]), R(() => {
156
+ t(""), n(a);
157
+ }, [e, a]), /* @__PURE__ */ React.createElement(
158
+ ve,
159
159
  {
160
160
  className: "option-panel-dropdown",
161
161
  contentClassName: "option-panel-dropdown-content",
162
162
  popoverProps: { placement: "bottom-start" },
163
- renderToggle: ({ isOpen: i, onToggle: o }) => /* @__PURE__ */ React.createElement(E, { important: !0 }, /* @__PURE__ */ React.createElement(
164
- C,
163
+ renderToggle: ({ isOpen: u, onToggle: i }) => /* @__PURE__ */ React.createElement(h, { important: !0 }, /* @__PURE__ */ React.createElement(
164
+ E,
165
165
  {
166
166
  variant: "secondary",
167
167
  size: "small",
168
- onClick: o,
169
- "aria-expanded": i
168
+ onClick: i,
169
+ "aria-expanded": u
170
170
  },
171
171
  /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-1.5 !bg-transparent !p-0 !text-[11px] !text-current" }, l && !!e && /* @__PURE__ */ React.createElement(
172
172
  "div",
173
173
  {
174
- className: p(`h-3 w-3 rounded-full bg-${e}`)
174
+ className: b(`h-3 w-3 rounded-full bg-${e}`)
175
175
  }
176
176
  ), /* @__PURE__ */ React.createElement("span", null, e || "Select option…"))
177
177
  )),
178
- renderContent: () => /* @__PURE__ */ React.createElement(E, { important: !0 }, /* @__PURE__ */ React.createElement("div", { className: "w-52" }, /* @__PURE__ */ React.createElement(
179
- B,
178
+ renderContent: () => /* @__PURE__ */ React.createElement(h, { important: !0 }, /* @__PURE__ */ React.createElement("div", { className: "w-52" }, /* @__PURE__ */ React.createElement(
179
+ K,
180
180
  {
181
181
  __next40pxDefaultSize: !0,
182
182
  __nextHasNoMarginBottom: !0,
183
183
  label: "Search options",
184
- value: n,
185
- onChange: (i) => r(i),
184
+ value: s,
185
+ onChange: (u) => t(u),
186
186
  autoComplete: "off"
187
187
  }
188
- ), /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-2 gap-1 !bg-transparent p-0 !pt-2" }, s.length === 0 && /* @__PURE__ */ React.createElement("div", { className: "!text-gray-medium col-span-2 pb-2 text-center !text-[11px]" }, "No options found."), s.map((i, o) => /* @__PURE__ */ React.createElement(
189
- xe,
188
+ ), /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-2 gap-1 !bg-transparent p-0 !pt-2" }, r.length === 0 && /* @__PURE__ */ React.createElement("div", { className: "!text-gray-medium col-span-2 pb-2 text-center !text-[11px]" }, "No options found."), r.map((u, i) => /* @__PURE__ */ React.createElement(
189
+ je,
190
190
  {
191
- key: `ButtonToggle__${i.value}___${o}`,
192
- className: p({
193
- "bg-primary": i.value
191
+ key: `ButtonToggle__${u.value}___${i}`,
192
+ className: b({
193
+ "bg-primary": u.value
194
194
  }),
195
195
  size: "small",
196
- value: i.value.toString(),
197
- pressed: e === i.value,
198
- onPressedChange: (f) => {
199
- a(f ? i.value : "");
196
+ value: u.value.toString(),
197
+ pressed: e === u.value,
198
+ onPressedChange: (d) => {
199
+ c(d ? u.value : "");
200
200
  }
201
201
  },
202
202
  l && /* @__PURE__ */ React.createElement(
203
203
  "div",
204
204
  {
205
- className: p(
206
- `mr-3 h-3 w-3 rounded-full bg-${i.value}`
205
+ className: b(
206
+ `mr-3 h-3 w-3 rounded-full bg-${u.value}`
207
207
  )
208
208
  }
209
209
  ),
210
- i.label
210
+ u.label
211
211
  )))))
212
212
  }
213
213
  );
214
214
  }
215
- const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__ */ React.createElement(
215
+ const Ie = ({ children: e, className: a, label: l, onClick: c }) => /* @__PURE__ */ React.createElement(
216
216
  "div",
217
217
  {
218
- onClick: a,
219
- className: p(
220
- t,
218
+ onClick: c,
219
+ className: b(
220
+ a,
221
221
  "inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 text-xs font-medium text-blue-800"
222
222
  )
223
223
  },
224
224
  l && /* @__PURE__ */ React.createElement("span", { className: "mr-1 text-xs font-semibold text-gray-700" }, l),
225
225
  e
226
- ), lt = ({ htmlContent: e, cssContent: t, frontendAssets: l }) => {
227
- const a = y(null), [n, r] = g(null);
226
+ ), Vt = ({ htmlContent: e, cssContent: a, frontendAssets: l }) => {
227
+ const c = B(null), [s, t] = f(null);
228
228
  return R(() => {
229
- const s = a.current;
230
- return s && (s.onload = () => {
231
- const c = s.contentDocument || s.contentWindow.document;
232
- if (c) {
233
- r(c.body);
234
- const i = c.createElement("style");
235
- i.innerHTML = t, c.head.appendChild(i), l.forEach(({ type: o, id: f, url: d }) => {
236
- const m = document.getElementById(f);
237
- if (m) {
238
- const u = document.adoptNode(
239
- m.cloneNode(!0)
229
+ const r = c.current;
230
+ return r && (r.onload = () => {
231
+ const n = r.contentDocument || r.contentWindow.document;
232
+ if (n) {
233
+ t(n.body);
234
+ const u = n.createElement("style");
235
+ u.innerHTML = a, n.head.appendChild(u), l.forEach(({ type: i, id: d, url: p }) => {
236
+ const o = document.getElementById(d);
237
+ if (o) {
238
+ const m = document.adoptNode(
239
+ o.cloneNode(!0)
240
240
  );
241
- c.head.appendChild(u);
241
+ n.head.appendChild(m);
242
242
  } else {
243
- const u = c.createElement(
244
- o === "script" ? "script" : "link"
243
+ const m = n.createElement(
244
+ i === "script" ? "script" : "link"
245
245
  );
246
- u.id = f, o === "script" ? (u.src = d, u.async = !0) : (u.rel = "stylesheet", u.href = d), c.head.appendChild(u);
246
+ m.id = d, i === "script" ? (m.src = p, m.async = !0) : (m.rel = "stylesheet", m.href = p), n.head.appendChild(m);
247
247
  }
248
248
  });
249
249
  }
250
250
  }), () => {
251
- s && (s.onload = null);
251
+ r && (r.onload = null);
252
252
  };
253
- }, [e, t, l]), /* @__PURE__ */ React.createElement(
253
+ }, [e, a, l]), /* @__PURE__ */ React.createElement(
254
254
  "div",
255
255
  {
256
256
  className: "render-preview-container",
@@ -259,14 +259,14 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
259
259
  /* @__PURE__ */ React.createElement(
260
260
  "iframe",
261
261
  {
262
- ref: a,
262
+ ref: c,
263
263
  title: "Preview",
264
264
  className: "editor-styles-wrapper",
265
265
  width: "100%",
266
266
  height: "100%"
267
267
  }
268
268
  ),
269
- n && D(
269
+ s && ie(
270
270
  /* @__PURE__ */ React.createElement("div", { className: "b_" }, /* @__PURE__ */ React.createElement(
271
271
  "div",
272
272
  {
@@ -274,82 +274,81 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
274
274
  dangerouslySetInnerHTML: { __html: e }
275
275
  }
276
276
  )),
277
- n
277
+ s
278
278
  )
279
279
  );
280
- }, nt = ({
280
+ }, It = ({
281
281
  children: e,
282
- size: t = "default",
282
+ size: a = "default",
283
283
  label: l,
284
- className: a,
285
- onClick: n,
286
- variant: r = "primary",
287
- display: s = "auto",
288
- icon: c,
289
- disabled: i = !1
284
+ className: c,
285
+ onClick: s,
286
+ variant: t = "primary",
287
+ display: r = "auto",
288
+ icon: n,
289
+ disabled: u = !1
290
290
  }) => {
291
- const o = s === "icon" || s === "icon-lg";
291
+ const i = r === "icon" || r === "icon-lg";
292
292
  return /* @__PURE__ */ React.createElement(
293
- C,
293
+ E,
294
294
  {
295
- size: t,
296
- variant: r,
295
+ size: a,
296
+ variant: t,
297
297
  label: l,
298
298
  showTooltip: !0,
299
- disabled: i,
300
- className: p(
301
- a,
299
+ disabled: u,
300
+ className: b(
301
+ c,
302
302
  "blockbite-ui__button",
303
303
  "flex items-center justify-center gap-1",
304
- { "is-primary": r === "primary" },
305
- { "is-secondary": r === "secondary" },
306
- { "is-link": r === "link" },
307
- { "is-tertiary": r === "tertiary" },
308
- { "is-icon": s === "icon" }
304
+ { "is-primary": t === "primary" },
305
+ { "is-secondary": t === "secondary" },
306
+ { "is-link": t === "link" },
307
+ { "is-tertiary": t === "tertiary" },
308
+ { "is-icon": r === "icon" }
309
309
  ),
310
- onClick: n
310
+ onClick: s
311
311
  },
312
- c && /* @__PURE__ */ React.createElement(
313
- v,
312
+ n && /* @__PURE__ */ React.createElement(
313
+ _,
314
314
  {
315
- icon: c,
316
- className: p({ "h-4 w-4": s === "icon-lg" })
315
+ icon: n,
316
+ className: b({ "h-4 w-4": r === "icon-lg" })
317
317
  }
318
318
  ),
319
- o ? null : e,
320
- l && !e && !o ? /* @__PURE__ */ React.createElement("span", null, l) : null
319
+ i ? null : e,
320
+ l && !e && !i ? /* @__PURE__ */ React.createElement("span", null, l) : null
321
321
  );
322
- }, rt = ({ children: e, title: t }) => /* @__PURE__ */ React.createElement(
323
- E,
322
+ }, At = ({ children: e, title: a, className: l }) => /* @__PURE__ */ React.createElement(
323
+ h,
324
324
  {
325
- className: p(
325
+ className: b(
326
326
  "text-gray-medium my-2 flex items-center gap-1 text-[12px] font-medium",
327
- p
327
+ l
328
328
  )
329
329
  },
330
- "dwdwwdwd",
331
- t && /* @__PURE__ */ React.createElement(E, { className: "font-medium" }, t),
330
+ a && /* @__PURE__ */ React.createElement(h, { className: "font-medium" }, a),
332
331
  e
333
- ), ct = ({
332
+ ), Ft = ({
334
333
  title: e,
335
- className: t,
334
+ className: a,
336
335
  help: l,
337
- badge: a,
338
- ...n
339
- }) => /* @__PURE__ */ React.createElement("div", { className: p("mb-2", t), ...n }, /* @__PURE__ */ React.createElement("div", { className: "flex w-full flex-wrap items-center gap-2 justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "shrink-1 text-[11px] font-medium uppercase leading-snug" }, e), !!a && /* @__PURE__ */ React.createElement(ve, { className: "text-[10px] py-px px-1" }, a)), l && /* @__PURE__ */ React.createElement("small", { className: "w-full shrink-0 text-[11px]" }, l)), st = ({ label: e, help: t, defaultChecked: l }) => {
340
- const [a, n] = g(l);
336
+ badge: c,
337
+ ...s
338
+ }) => /* @__PURE__ */ React.createElement("div", { className: b("mb-2", a), ...s }, /* @__PURE__ */ React.createElement("div", { className: "flex w-full flex-wrap items-center gap-2 justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "shrink-1 text-[11px] font-medium uppercase leading-snug" }, e), !!c && /* @__PURE__ */ React.createElement(Ie, { className: "text-[10px] py-px px-1" }, c)), l && /* @__PURE__ */ React.createElement("small", { className: "w-full shrink-0 text-[11px]" }, l)), Zt = ({ label: e, help: a, defaultChecked: l }) => {
339
+ const [c, s] = f(l);
341
340
  return R(() => {
342
- n(l);
343
- }, [l]), /* @__PURE__ */ React.createElement(E, { className: "blockbite-ui__checkbox mx-1 flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
344
- Y,
341
+ s(l);
342
+ }, [l]), /* @__PURE__ */ React.createElement(h, { className: "blockbite-ui__checkbox mx-1 flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
343
+ Re,
345
344
  {
346
345
  label: e,
347
- help: t,
348
- checked: a,
349
- onChange: n
346
+ help: a,
347
+ checked: c,
348
+ onChange: s
350
349
  }
351
350
  ));
352
- }, Ne = (e) => /* @__PURE__ */ React.createElement(
351
+ }, Ae = (e) => /* @__PURE__ */ React.createElement(
353
352
  "svg",
354
353
  {
355
354
  width: e.width || "1em",
@@ -367,7 +366,7 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
367
366
  fill: "currentColor"
368
367
  }
369
368
  )
370
- ), ye = (e) => /* @__PURE__ */ React.createElement(
369
+ ), Fe = (e) => /* @__PURE__ */ React.createElement(
371
370
  "svg",
372
371
  {
373
372
  width: e.width || "1em",
@@ -387,7 +386,7 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
387
386
  fill: "currentColor"
388
387
  }
389
388
  )
390
- ), ke = (e) => /* @__PURE__ */ React.createElement(
389
+ ), Ze = (e) => /* @__PURE__ */ React.createElement(
391
390
  "svg",
392
391
  {
393
392
  width: e.width || "1em",
@@ -405,7 +404,7 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
405
404
  fill: "currentColor"
406
405
  }
407
406
  )
408
- ), _e = (e) => /* @__PURE__ */ React.createElement(
407
+ ), De = (e) => /* @__PURE__ */ React.createElement(
409
408
  "svg",
410
409
  {
411
410
  width: e.width || "1em",
@@ -425,7 +424,7 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
425
424
  fill: "currentColor"
426
425
  }
427
426
  )
428
- ), Le = (e) => /* @__PURE__ */ React.createElement(
427
+ ), Ge = (e) => /* @__PURE__ */ React.createElement(
429
428
  "svg",
430
429
  {
431
430
  width: e.width || "1em",
@@ -445,7 +444,7 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
445
444
  fill: "currentColor"
446
445
  }
447
446
  )
448
- ), Me = (e) => /* @__PURE__ */ React.createElement(
447
+ ), Ue = (e) => /* @__PURE__ */ React.createElement(
449
448
  "svg",
450
449
  {
451
450
  width: e.width || "1em",
@@ -465,7 +464,7 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
465
464
  fill: "currentColor"
466
465
  }
467
466
  )
468
- ), Se = (e) => /* @__PURE__ */ React.createElement(
467
+ ), We = (e) => /* @__PURE__ */ React.createElement(
469
468
  "svg",
470
469
  {
471
470
  width: e.width || "1em",
@@ -486,7 +485,7 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
486
485
  strokeLinecap: "round"
487
486
  }
488
487
  )
489
- ), Te = (e) => /* @__PURE__ */ React.createElement(
488
+ ), Ke = (e) => /* @__PURE__ */ React.createElement(
490
489
  "svg",
491
490
  {
492
491
  width: e.width || "1em",
@@ -504,7 +503,7 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
504
503
  fill: "currentColor"
505
504
  }
506
505
  )
507
- ), He = (e) => /* @__PURE__ */ React.createElement(
506
+ ), qe = (e) => /* @__PURE__ */ React.createElement(
508
507
  "svg",
509
508
  {
510
509
  width: e.width || "1em",
@@ -524,7 +523,7 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
524
523
  fill: "currentColor"
525
524
  }
526
525
  )
527
- ), Be = (e) => /* @__PURE__ */ React.createElement(
526
+ ), Xe = (e) => /* @__PURE__ */ React.createElement(
528
527
  "svg",
529
528
  {
530
529
  width: e.width || "1em",
@@ -542,7 +541,7 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
542
541
  fill: "currentColor"
543
542
  }
544
543
  )
545
- ), Ve = (e) => /* @__PURE__ */ React.createElement(
544
+ ), Ye = (e) => /* @__PURE__ */ React.createElement(
546
545
  "svg",
547
546
  {
548
547
  width: e.width || "1em",
@@ -562,92 +561,92 @@ const ve = ({ children: e, className: t, label: l, onClick: a }) => /* @__PURE__
562
561
  fill: "currentColor"
563
562
  }
564
563
  )
565
- ), F = de(
564
+ ), ue = $(
566
565
  ({
567
566
  onClick: e,
568
- onChange: t,
567
+ onChange: a,
569
568
  className: l,
570
- value: a,
571
- children: n,
572
- inputClassName: r,
573
- readOnly: s,
574
- placeholder: c,
575
- onBlur: i,
576
- type: o = "text",
577
- label: f,
578
- helper: d = "",
579
- ...m
580
- }, u) => {
581
- const b = `text-control-${Math.random().toString(36).substring(2, 15)}`;
569
+ value: c,
570
+ children: s,
571
+ inputClassName: t,
572
+ readOnly: r,
573
+ placeholder: n,
574
+ onBlur: u,
575
+ type: i = "text",
576
+ label: d,
577
+ helper: p = "",
578
+ ...o
579
+ }, m) => {
580
+ const v = `text-control-${Math.random().toString(36).substring(2, 15)}`;
582
581
  return /* @__PURE__ */ React.createElement(
583
582
  "div",
584
583
  {
585
- className: p("flex items-center p-0", l),
586
- ...m
584
+ className: b("flex items-center p-0", l),
585
+ ...o
587
586
  },
588
- f ? /* @__PURE__ */ React.createElement("label", { htmlFor: b, className: "text-primary !m-0 !mb-0 !mr-2" }, f) : null,
587
+ d ? /* @__PURE__ */ React.createElement("label", { htmlFor: v, className: "text-primary !m-0 !mb-0 !mr-2" }, d) : null,
589
588
  /* @__PURE__ */ React.createElement(
590
589
  "input",
591
590
  {
592
- id: b,
593
- className: p(
591
+ id: v,
592
+ className: b(
594
593
  "components-text-control__input",
595
- r
594
+ t
596
595
  ),
597
- type: o,
598
- value: a,
599
- placeholder: c,
596
+ type: i,
597
+ value: c,
598
+ placeholder: n,
600
599
  onFocus: () => e && e(),
601
- onBlur: (x) => {
602
- e && e(), i && i(x.target.value);
600
+ onBlur: (g) => {
601
+ e && e(), u && u(g.target.value);
603
602
  },
604
- onChange: (x) => t && t(x.target.value),
605
- readOnly: s,
606
- ref: u
603
+ onChange: (g) => a && a(g.target.value),
604
+ readOnly: r,
605
+ ref: m
607
606
  }
608
607
  ),
609
- n,
610
- d && /* @__PURE__ */ React.createElement("p", { className: "text-primary !m-0 !mb-0 text-xs" }, d)
608
+ s,
609
+ p && /* @__PURE__ */ React.createElement("p", { className: "text-primary !m-0 !mb-0 text-xs" }, p)
611
610
  );
612
611
  }
613
612
  );
614
- F.displayName = "TextControl";
615
- const ot = ({
613
+ ue.displayName = "TextControl";
614
+ const Dt = ({
616
615
  data: e,
617
- active: t,
616
+ active: a,
618
617
  setActive: l,
619
- onCreate: a,
620
- onDelete: n,
621
- onUpdate: r,
622
- onSwitch: s,
623
- renderItemActions: c,
624
- addons: i,
625
- className: o = "",
626
- footerSlot: f,
627
- footerSlotClassName: d = ""
618
+ onCreate: c,
619
+ onDelete: s,
620
+ onUpdate: t,
621
+ onSwitch: r,
622
+ renderItemActions: n,
623
+ addons: u,
624
+ className: i = "",
625
+ footerSlot: d,
626
+ footerSlotClassName: p = ""
628
627
  }) => {
629
- const [m, u] = g({
628
+ const [o, m] = f({
630
629
  id: "",
631
630
  name: ""
632
- }), [b, x] = g(!1), k = y(null), N = () => {
633
- a();
634
- }, W = () => {
635
- if (!t || e.length === 0) return;
636
- const h = e.filter((S) => S.id !== (t == null ? void 0 : t.id)), M = e.findIndex((S) => S.id === (t == null ? void 0 : t.id)), q = h[M] || h[0];
637
- n(t == null ? void 0 : t.id), l(q);
638
- }, K = (h) => {
639
- x(!0), m.id && r(m.id, { name: h }), setTimeout(() => {
640
- u({ id: "", name: "" }), x(!1);
631
+ }), [v, g] = f(!1), z = B(null), L = () => {
632
+ c();
633
+ }, fe = () => {
634
+ if (!a || e.length === 0) return;
635
+ const x = e.filter((A) => A.id !== (a == null ? void 0 : a.id)), I = e.findIndex((A) => A.id === (a == null ? void 0 : a.id)), ge = x[I] || x[0];
636
+ s(a == null ? void 0 : a.id), l(ge);
637
+ }, be = (x) => {
638
+ g(!0), o.id && t(o.id, { name: x }), setTimeout(() => {
639
+ m({ id: "", name: "" }), g(!1);
641
640
  }, 500);
642
641
  };
643
- return /* @__PURE__ */ React.createElement(E, { important: !0, className: o }, /* @__PURE__ */ React.createElement("ul", { className: "h-[calc(100%-80px)] divide-y overflow-auto" }, i, e.length > 0 && /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("ul", { className: "divide-y divide-border border-b border-border" }, e.map((h) => /* @__PURE__ */ React.createElement(
642
+ return /* @__PURE__ */ React.createElement(h, { important: !0, className: i }, /* @__PURE__ */ React.createElement("ul", { className: "h-[calc(100%-80px)] divide-y overflow-auto" }, u, e.length > 0 && /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("ul", { className: "divide-y divide-border border-b border-border" }, e.map((x) => /* @__PURE__ */ React.createElement(
644
643
  "li",
645
644
  {
646
- key: `data__${h.id}`,
647
- className: p(
645
+ key: `data__${x.id}`,
646
+ className: b(
648
647
  "relative !mb-0 flex items-center justify-between gap-1 bg-opacity-50 hover:bg-easy",
649
648
  {
650
- "bg-easy": h.id === (t == null ? void 0 : t.id)
649
+ "bg-easy": x.id === (a == null ? void 0 : a.id)
651
650
  }
652
651
  )
653
652
  },
@@ -656,159 +655,159 @@ const ot = ({
656
655
  {
657
656
  className: "text-gray-medium w-full truncate px-3 py-2 text-left text-sm/6 font-semibold hover:text-wordpress",
658
657
  onClick: () => {
659
- s(t == null ? void 0 : t.id, { ...t }), l(h);
658
+ r(a == null ? void 0 : a.id, { ...a }), l(x);
660
659
  },
661
660
  onDoubleClick: () => {
662
- u({ id: h.id, name: h.name || "" });
661
+ m({ id: x.id, name: x.name || "" });
663
662
  }
664
663
  },
665
- b && m.id === h.id ? /* @__PURE__ */ React.createElement("span", { className: "animate-pulse text-gray-medium" }, m.name) : /* @__PURE__ */ React.createElement("span", { className: "text-gray-medium" }, h.name || "Untitled")
666
- ), m.id === h.id && !b && /* @__PURE__ */ React.createElement(
667
- F,
664
+ v && o.id === x.id ? /* @__PURE__ */ React.createElement("span", { className: "animate-pulse text-gray-medium" }, o.name) : /* @__PURE__ */ React.createElement("span", { className: "text-gray-medium" }, x.name || "Untitled")
665
+ ), o.id === x.id && !v && /* @__PURE__ */ React.createElement(
666
+ ue,
668
667
  {
669
668
  className: "absolute left-1 top-0 w-[calc(100%-.5rem)] h-full",
670
669
  inputClassName: "w-full",
671
- defaultValue: m.name,
672
- onChange: (M) => u({ ...m, name: M }),
673
- ref: k,
674
- onBlur: K
670
+ defaultValue: o.name,
671
+ onChange: (I) => m({ ...o, name: I }),
672
+ ref: z,
673
+ onBlur: be
675
674
  }
676
675
  )),
677
- c && /* @__PURE__ */ React.createElement("div", { className: "flex gap-1 pr-1" }, c(h))
676
+ n && /* @__PURE__ */ React.createElement("div", { className: "flex gap-1 pr-1" }, n(x))
678
677
  ))))), /* @__PURE__ */ React.createElement(
679
678
  "div",
680
679
  {
681
- className: p(
680
+ className: b(
682
681
  "flex flex-wrap justify-center gap-2 p-2",
683
- d
682
+ p
684
683
  )
685
684
  },
686
- f,
685
+ d,
687
686
  /* @__PURE__ */ React.createElement(
688
- C,
687
+ E,
689
688
  {
690
- onClick: N,
691
- icon: /* @__PURE__ */ React.createElement(Te, { className: "h-4 w-4" }),
689
+ onClick: L,
690
+ icon: /* @__PURE__ */ React.createElement(Ke, { className: "h-4 w-4" }),
692
691
  variant: "tertiary",
693
692
  size: "compact"
694
693
  },
695
694
  "Add"
696
695
  ),
697
696
  /* @__PURE__ */ React.createElement(
698
- C,
697
+ E,
699
698
  {
700
- onClick: W,
701
- icon: /* @__PURE__ */ React.createElement(Ve, { className: "h-4 w-4" }),
699
+ onClick: fe,
700
+ icon: /* @__PURE__ */ React.createElement(Ye, { className: "h-4 w-4" }),
702
701
  variant: "tertiary",
703
702
  size: "compact",
704
- disabled: !t || e.length === 0
703
+ disabled: !a || e.length === 0
705
704
  },
706
705
  "Remove"
707
706
  )
708
707
  ));
709
- }, it = ({
708
+ }, Gt = ({
710
709
  duration: e = 3e3,
711
- className: t,
710
+ className: a,
712
711
  children: l,
713
- show: a,
714
- message: n
712
+ show: c,
713
+ message: s
715
714
  }) => {
716
- const [r, s] = g(!1), c = y(!1), i = y(null);
715
+ const [t, r] = f(!1), n = B(!1), u = B(null);
717
716
  return R(() => {
718
- c.current = !0;
717
+ n.current = !0;
719
718
  }, []), R(() => {
720
- if (c.current)
721
- return a && (s(!0), i.current = setTimeout(() => {
722
- s(!1);
719
+ if (n.current)
720
+ return c && (r(!0), u.current = setTimeout(() => {
721
+ r(!1);
723
722
  }, e)), () => {
724
- i.current && clearTimeout(i.current);
723
+ u.current && clearTimeout(u.current);
725
724
  };
726
- }, [a, e]), r ? /* @__PURE__ */ React.createElement(
727
- E,
725
+ }, [c, e]), t ? /* @__PURE__ */ React.createElement(
726
+ h,
728
727
  {
729
728
  important: !0,
730
- className: p("bb-ui__disappearing-message", t)
729
+ className: b("bb-ui__disappearing-message", a)
731
730
  },
732
- /* @__PURE__ */ React.createElement("div", { className: "bb-ui__disappearing-message__content" }, n ?? l)
731
+ /* @__PURE__ */ React.createElement("div", { className: "bb-ui__disappearing-message__content" }, s ?? l)
733
732
  ) : null;
734
- }, Pe = ({
733
+ }, Je = ({
735
734
  label: e,
736
- className: t,
735
+ className: a,
737
736
  value: l,
738
- defaultIcon: a = Ne,
739
- size: n = "medium",
740
- onPressedChange: r,
741
- options: s,
742
- ...c
737
+ defaultIcon: c = Ae,
738
+ size: s = "medium",
739
+ onPressedChange: t,
740
+ options: r,
741
+ ...n
743
742
  }) => {
744
- var m;
745
- const [i, o] = g(null);
743
+ var o;
744
+ const [u, i] = f(null);
746
745
  R(() => {
747
- o(l);
746
+ i(l);
748
747
  }, [l]);
749
- const f = [
750
- ...s.map((u) => ({
751
- icon: u.icon,
752
- label: u.label,
753
- title: u.label,
754
- value: u.value,
748
+ const d = [
749
+ ...r.map((m) => ({
750
+ icon: m.icon,
751
+ label: m.label,
752
+ title: m.label,
753
+ value: m.value,
755
754
  onClick: () => {
756
- o(u.value), r(u.value);
755
+ i(m.value), t(m.value);
757
756
  }
758
757
  })),
759
758
  {
760
- icon: /* @__PURE__ */ React.createElement(v, { icon: a }),
759
+ icon: /* @__PURE__ */ React.createElement(_, { icon: c }),
761
760
  title: "Reset",
762
761
  value: "reset",
763
762
  onClick: () => {
764
- o("reset"), r("reset");
763
+ i("reset"), t("reset");
765
764
  }
766
765
  }
767
766
  ];
768
- let d = "1em";
769
- return n === "medium" ? d = "1.5em" : n === "large" && (d = "2em"), /* @__PURE__ */ React.createElement(
770
- J,
767
+ let p = "1em";
768
+ return s === "medium" ? p = "1.5em" : s === "large" && (p = "2em"), /* @__PURE__ */ React.createElement(
769
+ Ee,
771
770
  {
772
- controls: f,
773
- className: p("blockbite-ui__dropdown-picker", t),
774
- icon: ((m = s.find((u) => u.value === i)) == null ? void 0 : m.icon) || /* @__PURE__ */ React.createElement(v, { width: d, height: d, icon: a }),
771
+ controls: d,
772
+ className: b("blockbite-ui__dropdown-picker", a),
773
+ icon: ((o = r.find((m) => m.value === u)) == null ? void 0 : o.icon) || /* @__PURE__ */ React.createElement(_, { width: p, height: p, icon: c }),
775
774
  label: e || "Select",
776
- ...c
775
+ ...n
777
776
  }
778
777
  );
779
778
  };
780
- function mt({
779
+ function Ut({
781
780
  icon: e,
782
- title: t,
781
+ title: a,
783
782
  description: l,
784
- children: a = null,
785
- ...n
783
+ children: c = null,
784
+ ...s
786
785
  }) {
787
- return /* @__PURE__ */ React.createElement("div", { ...n }, /* @__PURE__ */ React.createElement("div", { className: "flex h-full w-full flex-col items-center justify-center text-center !font-sans" }, /* @__PURE__ */ React.createElement("div", { className: "max-w-sm" }, e && /* @__PURE__ */ React.createElement("div", { className: "mx-auto !text-gray-400" }, e), /* @__PURE__ */ React.createElement("h3", { className: "text-gray-medium mt-2 !font-sans text-sm font-medium" }, t), /* @__PURE__ */ React.createElement("p", { className: "mt-1 !font-sans text-sm !text-gray-500" }, l), a && /* @__PURE__ */ React.createElement("div", { className: "mt-4" }, a))));
786
+ return /* @__PURE__ */ React.createElement("div", { ...s }, /* @__PURE__ */ React.createElement("div", { className: "flex h-full w-full flex-col items-center justify-center text-center !font-sans" }, /* @__PURE__ */ React.createElement("div", { className: "max-w-sm" }, e && /* @__PURE__ */ React.createElement("div", { className: "mx-auto !text-gray-400" }, e), /* @__PURE__ */ React.createElement("h3", { className: "text-gray-medium mt-2 !font-sans text-sm font-medium" }, a), /* @__PURE__ */ React.createElement("p", { className: "mt-1 !font-sans text-sm !text-gray-500" }, l), c && /* @__PURE__ */ React.createElement("div", { className: "mt-4" }, c))));
788
787
  }
789
- function ut({
788
+ function Wt({
790
789
  children: e
791
790
  }) {
792
- const t = y(null), [l, a] = g({ x: 100, y: 100 }), [n, r] = g(!1), [s, c] = g({ x: 0, y: 0 });
791
+ const a = B(null), [l, c] = f({ x: 100, y: 100 }), [s, t] = f(!1), [r, n] = f({ x: 0, y: 0 });
793
792
  R(() => {
794
- const o = (d) => {
795
- n && a({
796
- x: d.clientX - s.x,
797
- y: d.clientY - s.y
793
+ const i = (p) => {
794
+ s && c({
795
+ x: p.clientX - r.x,
796
+ y: p.clientY - r.y
798
797
  });
799
- }, f = () => r(!1);
800
- return window.addEventListener("mousemove", o), window.addEventListener("mouseup", f), () => {
801
- window.removeEventListener("mousemove", o), window.removeEventListener("mouseup", f);
798
+ }, d = () => t(!1);
799
+ return window.addEventListener("mousemove", i), window.addEventListener("mouseup", d), () => {
800
+ window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", d);
802
801
  };
803
- }, [n, s]);
804
- const i = (o) => {
805
- const f = t.current.getBoundingClientRect();
806
- c({ x: o.clientX - f.left, y: o.clientY - f.top }), r(!0);
802
+ }, [s, r]);
803
+ const u = (i) => {
804
+ const d = a.current.getBoundingClientRect();
805
+ n({ x: i.clientX - d.left, y: i.clientY - d.top }), t(!0);
807
806
  };
808
807
  return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
809
808
  "div",
810
809
  {
811
- ref: t,
810
+ ref: a,
812
811
  className: "fixed bg-white shadow-xl rounded-2xl p-4 w-[400px] h-[550px] z-[9999]",
813
812
  style: { left: l.x, top: l.y }
814
813
  },
@@ -817,94 +816,94 @@ function ut({
817
816
  "div",
818
817
  {
819
818
  className: "absolute top-1 right-1 cursor-move w-5 h-5 bg-gray-300 rounded",
820
- onMouseDown: i
819
+ onMouseDown: u
821
820
  }
822
821
  )
823
822
  ));
824
823
  }
825
- const dt = ({
824
+ const Kt = ({
826
825
  value: e,
827
- onValueChange: t,
826
+ onValueChange: a,
828
827
  url: l
829
828
  }) => {
830
- const [a, n] = g({
829
+ const [c, s] = f({
831
830
  x: 0.5,
832
831
  y: 0.5
833
832
  });
834
833
  return R(() => {
835
834
  if (e && e.includes("%")) {
836
- const [r, s] = e.replace("[", "").replace("%]", "").split("_").map((c) => parseFloat(c) / 100);
837
- n({ x: r, y: s });
835
+ const [t, r] = e.replace("[", "").replace("%]", "").split("_").map((n) => parseFloat(n) / 100);
836
+ s({ x: t, y: r });
838
837
  }
839
838
  }, [e]), R(() => {
840
- t(
841
- `[${(a.x * 100).toFixed(2)}%_${(a.y * 100).toFixed(2)}%]`
839
+ a(
840
+ `[${(c.x * 100).toFixed(2)}%_${(c.y * 100).toFixed(2)}%]`
842
841
  );
843
- }, [a]), /* @__PURE__ */ React.createElement(E, { className: "relative flex flex-col" }, /* @__PURE__ */ React.createElement(
844
- Q,
842
+ }, [c]), /* @__PURE__ */ React.createElement(h, { className: "relative flex flex-col" }, /* @__PURE__ */ React.createElement(
843
+ he,
845
844
  {
846
845
  url: l,
847
- value: a,
848
- onDrag: n,
849
- onChange: n
846
+ value: c,
847
+ onDrag: s,
848
+ onChange: s
850
849
  }
851
850
  ));
852
851
  };
853
- function ft(e) {
854
- const [t, l] = g(""), [a, n] = g([]), [r, s] = g({
852
+ function qt(e) {
853
+ const [a, l] = f(""), [c, s] = f([]), [t, r] = f({
855
854
  url: "",
856
855
  title: ""
857
856
  });
858
857
  return R(() => {
859
- t !== "" && (n(null), pe({
860
- path: `/blockbite/v1/block-helpers/get-links/${t}`
858
+ a !== "" && (s(null), Le({
859
+ path: `/blockbite/v1/block-helpers/get-links/${a}`
861
860
  }).then(
862
- (c) => {
863
- c != null && c.length ? n([...c]) : n([]);
861
+ (n) => {
862
+ n != null && n.length ? s([...n]) : s([]);
864
863
  }
865
864
  ));
866
- }, [t]), R(() => {
867
- r.url !== "" && e.parentCallback(r);
868
- }, [r]), /* @__PURE__ */ React.createElement(E, { className: "blockbite--editor-linkwrap" }, /* @__PURE__ */ React.createElement(
869
- B,
865
+ }, [a]), R(() => {
866
+ t.url !== "" && e.parentCallback(t);
867
+ }, [t]), /* @__PURE__ */ React.createElement(h, { className: "blockbite--editor-linkwrap" }, /* @__PURE__ */ React.createElement(
868
+ K,
870
869
  {
871
870
  __next40pxDefaultSize: !0,
872
871
  __nextHasNoMarginBottom: !0,
873
- label: w("Search link", "blockbitelinks"),
874
- value: t,
872
+ label: N("Search link", "blockbitelinks"),
873
+ value: a,
875
874
  placeholder: "Example: About",
876
- onChange: (c) => l(c),
877
- help: w("Type a post, page, title", "blockbitelinks")
875
+ onChange: (n) => l(n),
876
+ help: N("Type a post, page, title", "blockbitelinks")
878
877
  }
879
- ), t ? /* @__PURE__ */ React.createElement("div", { className: "blockbite--editor-linklist" }, /* @__PURE__ */ React.createElement(
880
- Ze,
878
+ ), a ? /* @__PURE__ */ React.createElement("div", { className: "blockbite--editor-linklist" }, /* @__PURE__ */ React.createElement(
879
+ Qe,
881
880
  {
882
- links: a,
883
- onActiveLink: (c) => [
884
- s({ ...c }),
881
+ links: c,
882
+ onActiveLink: (n) => [
883
+ r({ ...n }),
885
884
  l("")
886
885
  ]
887
886
  }
888
887
  )) : null);
889
888
  }
890
- function Ze({ links: e, onActiveLink: t }) {
889
+ function Qe({ links: e, onActiveLink: a }) {
891
890
  if (e === null)
892
891
  return /* @__PURE__ */ React.createElement("p", null, "Loading...");
893
892
  if (e.length === 0)
894
893
  return /* @__PURE__ */ React.createElement("p", null, "No Results");
895
- const l = e.map((a) => /* @__PURE__ */ React.createElement(E, { key: a.id }, /* @__PURE__ */ React.createElement(
894
+ const l = e.map((c) => /* @__PURE__ */ React.createElement(h, { key: c.id }, /* @__PURE__ */ React.createElement(
896
895
  "span",
897
896
  {
898
897
  className: "blockbite--editor-link",
899
- onClick: () => t(a)
898
+ onClick: () => a(c)
900
899
  },
901
- /* @__PURE__ */ React.createElement("span", null, a.title),
902
- /* @__PURE__ */ React.createElement("span", { className: "blockbite--preview-link" }, a.url),
903
- /* @__PURE__ */ React.createElement("span", { className: "blockbite--preview-link" }, a.post_type)
900
+ /* @__PURE__ */ React.createElement("span", null, c.title),
901
+ /* @__PURE__ */ React.createElement("span", { className: "blockbite--preview-link" }, c.url),
902
+ /* @__PURE__ */ React.createElement("span", { className: "blockbite--preview-link" }, c.post_type)
904
903
  )));
905
904
  return /* @__PURE__ */ React.createElement(React.Fragment, null, l);
906
905
  }
907
- function pt({ mediaProps: e, mediaCallback: t }) {
906
+ function Xt({ mediaProps: e, mediaCallback: a }) {
908
907
  const l = [
909
908
  "image",
910
909
  "video",
@@ -912,7 +911,7 @@ function pt({ mediaProps: e, mediaCallback: t }) {
912
911
  "svg",
913
912
  "text/plain",
914
913
  "application/json"
915
- ], [a, n] = g({
914
+ ], [c, s] = f({
916
915
  id: null,
917
916
  url: "",
918
917
  sizes: [],
@@ -922,425 +921,1358 @@ function pt({ mediaProps: e, mediaCallback: t }) {
922
921
  height: 0
923
922
  });
924
923
  R(() => {
925
- e && n({ ...e });
924
+ e && s({ ...e });
926
925
  }, [e]);
927
- const r = () => {
928
- t({ ...{
926
+ const t = () => {
927
+ a({ ...{
929
928
  mediaId: 0,
930
929
  mediaUrl: ""
931
930
  } });
932
- }, s = (c) => {
933
- const i = {
931
+ }, r = (n) => {
932
+ const u = {
934
933
  thumbnail: null,
935
934
  medium: null,
936
935
  large: null
937
936
  };
938
- c != null && c.sizes && Object.keys(c.sizes).map((f) => {
939
- const d = c.sizes[f];
940
- return (f === "thumbnail" || d.width < 768 || d.height < 768) && (i.thumbnail = d.url), (f === "medium" || d.width > 1024 && d.width < 1024 || d.height < 1536 && d.height > 1536) && (i.medium = d.url), (f === "large" || d.width > 1536 || d.height > 1536) && (i.large = d.url), null;
941
- }), c.url.endsWith(".json") && (c.type = "lottie"), c.url.endsWith(".svg") && (c.type = "svg");
942
- const o = {
943
- id: c.id,
944
- url: c.url,
945
- sizes: i,
946
- alt: c.alt,
947
- type: c.type,
948
- width: c.width,
949
- height: c.height
937
+ n != null && n.sizes && Object.keys(n.sizes).map((d) => {
938
+ const p = n.sizes[d];
939
+ return (d === "thumbnail" || p.width < 768 || p.height < 768) && (u.thumbnail = p.url), (d === "medium" || p.width > 1024 && p.width < 1024 || p.height < 1536 && p.height > 1536) && (u.medium = p.url), (d === "large" || p.width > 1536 || p.height > 1536) && (u.large = p.url), null;
940
+ }), n.url.endsWith(".json") && (n.type = "lottie"), n.url.endsWith(".svg") && (n.type = "svg");
941
+ const i = {
942
+ id: n.id,
943
+ url: n.url,
944
+ sizes: u,
945
+ alt: n.alt,
946
+ type: n.type,
947
+ width: n.width,
948
+ height: n.height
950
949
  };
951
- t({ ...o });
950
+ a({ ...i });
952
951
  };
953
- return /* @__PURE__ */ React.createElement(ee, null, a.id !== null && /* @__PURE__ */ React.createElement(T, null, /* @__PURE__ */ React.createElement(
954
- $,
952
+ return /* @__PURE__ */ React.createElement(Ce, null, c.id !== null && /* @__PURE__ */ React.createElement(F, null, /* @__PURE__ */ React.createElement(
953
+ Y,
955
954
  {
956
- onSelect: s,
957
- value: a.id,
955
+ onSelect: r,
956
+ value: c.id,
958
957
  allowedTypes: l,
959
- render: ({ open: c }) => /* @__PURE__ */ React.createElement(
960
- C,
958
+ render: ({ open: n }) => /* @__PURE__ */ React.createElement(
959
+ E,
961
960
  {
962
- className: a.id === 0 ? "editor-post-featured-image__toggle" : "editor-post-featured-image__preview",
963
- onClick: c
961
+ className: c.id === 0 ? "editor-post-featured-image__toggle" : "editor-post-featured-image__preview",
962
+ onClick: n
964
963
  },
965
- a.id === 0 && w("Choose Media", "blockbite"),
966
- a.id && a.type === "image" ? /* @__PURE__ */ React.createElement("div", { className: "blockbite--editor-visual-image" }, /* @__PURE__ */ React.createElement(
964
+ c.id === 0 && N("Choose Media", "blockbite"),
965
+ c.id && c.type === "image" ? /* @__PURE__ */ React.createElement("div", { className: "blockbite--editor-visual-image" }, /* @__PURE__ */ React.createElement(
967
966
  "img",
968
967
  {
969
- alt: a.alt ? a.alt : w("Image", "blockbite"),
970
- src: a.url
968
+ alt: c.alt ? c.alt : N("Image", "blockbite"),
969
+ src: c.url
971
970
  }
972
971
  )) : "Add media"
973
972
  )
974
973
  }
975
- )), a.id !== 0 && /* @__PURE__ */ React.createElement(T, null, /* @__PURE__ */ React.createElement(
976
- $,
974
+ )), c.id !== 0 && /* @__PURE__ */ React.createElement(F, null, /* @__PURE__ */ React.createElement(
975
+ Y,
977
976
  {
978
- title: w("Replace media", "blockbite"),
979
- value: a.id,
980
- onSelect: s,
977
+ title: N("Replace media", "blockbite"),
978
+ value: c.id,
979
+ onSelect: r,
981
980
  allowedTypes: l,
982
- render: ({ open: c }) => /* @__PURE__ */ React.createElement(C, { onClick: c }, w("Replace media", "blockbite"))
981
+ render: ({ open: n }) => /* @__PURE__ */ React.createElement(E, { onClick: n }, N("Replace media", "blockbite"))
983
982
  }
984
- )), a.id !== 0 && /* @__PURE__ */ React.createElement(T, null, /* @__PURE__ */ React.createElement(C, { onClick: () => r(), isDestructive: !0 }, w("Remove media", "blockbite"))));
983
+ )), c.id !== 0 && /* @__PURE__ */ React.createElement(F, null, /* @__PURE__ */ React.createElement(E, { onClick: () => t(), isDestructive: !0 }, N("Remove media", "blockbite"))));
985
984
  }
986
- const $e = ({
985
+ const et = ({
987
986
  children: e,
988
- className: t,
987
+ className: a,
989
988
  position: l,
990
- visible: a,
991
- onClick: n,
992
- onVisibleChange: r
989
+ visible: c,
990
+ onClick: s,
991
+ onVisibleChange: t
993
992
  }) => {
994
- const [s, c] = g(!!a);
993
+ const [r, n] = f(!!c);
995
994
  R(() => {
996
- a !== void 0 && c(a);
997
- }, [a]);
998
- const i = () => {
999
- const o = !s;
1000
- c(o), r && r(o);
995
+ c !== void 0 && n(c);
996
+ }, [c]);
997
+ const u = () => {
998
+ const i = !r;
999
+ n(i), t && t(i);
1001
1000
  };
1002
- return /* @__PURE__ */ React.createElement(React.Fragment, null, s && /* @__PURE__ */ React.createElement(
1003
- te,
1001
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, r && /* @__PURE__ */ React.createElement(
1002
+ xe,
1004
1003
  {
1005
1004
  position: l,
1006
1005
  className: "blockbite-ui__popover",
1007
- onClick: n,
1006
+ onClick: s,
1008
1007
  onFocusOutside: () => {
1009
- c(!1), r && r(!1);
1008
+ n(!1), t && t(!1);
1010
1009
  }
1011
1010
  },
1012
- /* @__PURE__ */ React.createElement("div", { className: t }, /* @__PURE__ */ React.createElement("div", { className: "relative h-full w-full p-4" }, /* @__PURE__ */ React.createElement(
1013
- C,
1011
+ /* @__PURE__ */ React.createElement("div", { className: a }, /* @__PURE__ */ React.createElement("div", { className: "relative h-full w-full p-4" }, /* @__PURE__ */ React.createElement(
1012
+ E,
1014
1013
  {
1015
- onClick: i,
1014
+ onClick: u,
1016
1015
  size: "small",
1017
1016
  className: "close-button absolute right-0 top-0"
1018
1017
  },
1019
- /* @__PURE__ */ React.createElement(ke, null)
1018
+ /* @__PURE__ */ React.createElement(Ze, null)
1020
1019
  ), e))
1021
1020
  ));
1022
- }, Ie = ({
1021
+ }, tt = ({
1023
1022
  value: e,
1024
- label: t,
1023
+ label: a,
1025
1024
  min: l = 0,
1026
- max: a = 2e3,
1027
- withInputField: n = !1,
1028
- onValueChange: r,
1029
- gridMode: s = !1,
1030
- showTooltip: c = !1,
1031
- ...i
1025
+ max: c = 2e3,
1026
+ withInputField: s = !1,
1027
+ onValueChange: t,
1028
+ gridMode: r = !1,
1029
+ showTooltip: n = !1,
1030
+ ...u
1032
1031
  }) => {
1033
- const [o] = g(0), [f, d] = g(0);
1032
+ const [i] = f(0), [d, p] = f(0);
1034
1033
  R(() => {
1035
- d(Math.round(parseInt(e) / (s ? 16 : 1)));
1034
+ p(Math.round(parseInt(e) / (r ? 16 : 1)));
1036
1035
  }, [e]);
1037
- function m(u) {
1038
- const b = u * (s ? 16 : 1);
1039
- r(b.toString());
1036
+ function o(m) {
1037
+ const v = m * (r ? 16 : 1);
1038
+ t(v.toString());
1040
1039
  }
1041
- return /* @__PURE__ */ React.createElement(E, { className: "flex min-w-[240px] flex-col" }, /* @__PURE__ */ React.createElement(
1042
- ae,
1040
+ return /* @__PURE__ */ React.createElement(h, { className: "flex min-w-[240px] flex-col" }, /* @__PURE__ */ React.createElement(
1041
+ we,
1043
1042
  {
1044
1043
  __next40pxDefaultSize: !0,
1045
1044
  __nextHasNoMarginBottom: !0,
1046
- label: t,
1047
- value: f,
1045
+ label: a,
1046
+ value: d,
1048
1047
  min: l,
1049
- max: a,
1050
- showTooltip: c,
1051
- withInputField: n,
1052
- onChange: (u) => {
1053
- d(u), m(u);
1048
+ max: c,
1049
+ showTooltip: n,
1050
+ withInputField: s,
1051
+ onChange: (m) => {
1052
+ p(m), o(m);
1054
1053
  },
1055
- resetFallbackValue: o,
1056
- ...i
1054
+ resetFallbackValue: i,
1055
+ ...u
1057
1056
  }
1058
- ), /* @__PURE__ */ React.createElement("span", null, s ? `${f * 16}px` : null, " "));
1059
- }, gt = ({
1057
+ ), /* @__PURE__ */ React.createElement("span", null, r ? `${d * 16}px` : null, " "));
1058
+ }, Yt = ({
1060
1059
  unit: e,
1061
- value: t,
1060
+ value: a,
1062
1061
  onValueChange: l,
1063
- onUnitChange: a,
1064
- inputClassName: n = ""
1062
+ onUnitChange: c,
1063
+ inputClassName: s = ""
1065
1064
  }) => {
1066
- const [r, s] = g(!1), [c, i] = g([]), [o, f] = g(t);
1065
+ const [t, r] = f(!1), [n, u] = f([]), [i, d] = f(a);
1067
1066
  R(() => {
1068
- !r && e === "arbitrary" && f(t);
1069
- }, [r]);
1070
- const d = (u) => {
1071
- var b, x, k;
1072
- if (u !== "arbitrary" && ((k = (x = (b = bb == null ? void 0 : bb.codex) == null ? void 0 : b.units) == null ? void 0 : x.spacing) != null && k[u])) {
1073
- const N = bb.codex.units.spacing[u];
1074
- i(
1075
- Array.isArray(N) ? N : Object.keys(N)
1067
+ !t && e === "arbitrary" && d(a);
1068
+ }, [t]);
1069
+ const p = (m) => {
1070
+ var v, g, z;
1071
+ if (m !== "arbitrary" && ((z = (g = (v = bb == null ? void 0 : bb.codex) == null ? void 0 : v.units) == null ? void 0 : g.spacing) != null && z[m])) {
1072
+ const L = bb.codex.units.spacing[m];
1073
+ u(
1074
+ Array.isArray(L) ? L : Object.keys(L)
1076
1075
  );
1077
1076
  } else
1078
- i([]);
1079
- s(!0);
1080
- }, m = [
1077
+ u([]);
1078
+ r(!0);
1079
+ }, o = [
1081
1080
  {
1082
- icon: /* @__PURE__ */ React.createElement(Be, null),
1081
+ icon: /* @__PURE__ */ React.createElement(Xe, null),
1083
1082
  label: "Tailwind CSS Units",
1084
1083
  value: "native"
1085
1084
  },
1086
- { icon: /* @__PURE__ */ React.createElement(Se, null), label: "Percentage Units", value: "percent" },
1087
- { icon: /* @__PURE__ */ React.createElement(Le, null), label: "Grid Units", value: "grid" },
1088
- { icon: /* @__PURE__ */ React.createElement(_e, null), label: "Screen Units", value: "screen" },
1089
- { icon: /* @__PURE__ */ React.createElement(He, null), label: "Pixel Units", value: "arbitrary" },
1090
- { icon: /* @__PURE__ */ React.createElement(ye, null), label: "Fluid Units", value: "fluid" }
1085
+ { icon: /* @__PURE__ */ React.createElement(We, null), label: "Percentage Units", value: "percent" },
1086
+ { icon: /* @__PURE__ */ React.createElement(Ge, null), label: "Grid Units", value: "grid" },
1087
+ { icon: /* @__PURE__ */ React.createElement(De, null), label: "Screen Units", value: "screen" },
1088
+ { icon: /* @__PURE__ */ React.createElement(qe, null), label: "Pixel Units", value: "arbitrary" },
1089
+ { icon: /* @__PURE__ */ React.createElement(Fe, null), label: "Fluid Units", value: "fluid" }
1091
1090
  ];
1092
1091
  return /* @__PURE__ */ React.createElement("div", { className: "relative flex flex-col items-baseline" }, /* @__PURE__ */ React.createElement(
1093
- O,
1092
+ se,
1094
1093
  {
1095
1094
  __next40pxDefaultSize: !0,
1096
- className: n,
1097
- value: e === "grid" ? t.replace("b_", "") : t,
1098
- onClick: () => e !== "arbitrary" && d(e),
1095
+ className: s,
1096
+ value: e === "grid" ? a.replace("b_", "") : a,
1097
+ onClick: () => e !== "arbitrary" && p(e),
1099
1098
  onChange: l,
1100
1099
  readOnly: e !== "arbitrary",
1101
1100
  autoComplete: "off",
1102
- suffix: /* @__PURE__ */ React.createElement(z, null, /* @__PURE__ */ React.createElement(
1103
- $e,
1101
+ suffix: /* @__PURE__ */ React.createElement(oe, null, /* @__PURE__ */ React.createElement(
1102
+ et,
1104
1103
  {
1105
- visible: r,
1104
+ visible: t,
1106
1105
  position: "bottom left",
1107
1106
  className: "w-[300px] bg-white shadow-sm",
1108
- onVisibleChange: s
1107
+ onVisibleChange: r
1109
1108
  },
1110
1109
  e === "arbitrary" ? /* @__PURE__ */ React.createElement(
1111
- Ie,
1110
+ tt,
1112
1111
  {
1113
- value: t,
1112
+ value: a,
1114
1113
  label: "Pixel Value",
1115
1114
  min: 0,
1116
1115
  max: 100,
1117
1116
  gridMode: !0,
1118
1117
  showTooltip: !1,
1119
1118
  allowReset: !0,
1120
- resetFallbackValue: isNaN(o.toString()) ? 0 : Number(o) / 16,
1119
+ resetFallbackValue: isNaN(i.toString()) ? 0 : Number(i) / 16,
1121
1120
  onValueChange: l
1122
1121
  }
1123
1122
  ) : /* @__PURE__ */ React.createElement(
1124
- we,
1123
+ Ve,
1125
1124
  {
1126
1125
  className: "mt-4",
1127
- options: c.map((u) => ({
1128
- value: u,
1129
- label: e === "grid" ? u.toString().replace("b_", "") : u,
1126
+ options: n.map((m) => ({
1127
+ value: m,
1128
+ label: e === "grid" ? m.toString().replace("b_", "") : m,
1130
1129
  onClick: () => {
1131
- l(u);
1130
+ l(m);
1132
1131
  }
1133
1132
  })),
1134
1133
  size: "small",
1135
- value: (t == null ? void 0 : t.toString()) || "",
1134
+ value: (a == null ? void 0 : a.toString()) || "",
1136
1135
  onPressedChange: l
1137
1136
  }
1138
1137
  )
1139
1138
  ), /* @__PURE__ */ React.createElement(
1140
- Pe,
1139
+ Je,
1141
1140
  {
1142
1141
  value: e,
1143
- options: m,
1142
+ options: o,
1144
1143
  toggleProps: {
1145
1144
  className: "!p-0 !min-w-0 !h-6 w-6"
1146
1145
  },
1147
- onPressedChange: (u) => {
1148
- u === "reset" ? (l(""), s(!1)) : (a(u), d(u));
1146
+ onPressedChange: (m) => {
1147
+ m === "reset" ? (l(""), r(!1)) : (c(m), p(m));
1149
1148
  }
1150
1149
  }
1151
1150
  ))
1152
1151
  }
1153
1152
  ));
1154
- }, U = A(null), G = () => {
1155
- const e = P(U);
1153
+ }, me = y(null), de = () => {
1154
+ const e = q(me);
1156
1155
  if (!e)
1157
1156
  throw new Error("useModalContext must be used within a ModalProvider");
1158
1157
  return e;
1159
- }, Rt = ({
1158
+ }, Jt = ({
1160
1159
  children: e,
1161
- defaultOpen: t,
1160
+ defaultOpen: a,
1162
1161
  onOpenChange: l,
1163
- title: a,
1164
- className: n
1162
+ title: c,
1163
+ className: s
1165
1164
  }) => {
1166
- const [r, s] = g(!1);
1165
+ const [t, r] = f(!1);
1167
1166
  R(() => {
1168
- s(t);
1169
- }, [t]);
1170
- const c = () => s(!0), i = () => s(!1);
1167
+ r(a);
1168
+ }, [a]);
1169
+ const n = () => r(!0), u = () => r(!1);
1171
1170
  return R(() => {
1172
- l(r);
1173
- }, [r, l]), /* @__PURE__ */ React.createElement(U.Provider, { value: { closeModal: i, openModal: c } }, _.map(e, (o) => L(o) && o.type === De ? o : null), r && /* @__PURE__ */ React.createElement(
1174
- le,
1171
+ l(t);
1172
+ }, [t, l]), /* @__PURE__ */ React.createElement(me.Provider, { value: { closeModal: u, openModal: n } }, j.map(e, (i) => V(i) && i.type === ct ? i : null), t && /* @__PURE__ */ React.createElement(
1173
+ ye,
1175
1174
  {
1176
- className: p("blockbite-ui__modal", n),
1177
- onRequestClose: i,
1178
- title: a
1175
+ className: b("blockbite-ui__modal", s),
1176
+ onRequestClose: u,
1177
+ title: c
1179
1178
  },
1180
- /* @__PURE__ */ React.createElement("div", { className: "relative" }, _.map(e, (o) => L(o) && o.type === Oe ? o : null), _.map(e, (o) => L(o) && o.type === je ? o : null), _.map(e, (o) => L(o) && o.type === ze ? o : null))
1179
+ /* @__PURE__ */ React.createElement("div", { className: "relative" }, j.map(e, (i) => V(i) && i.type === at ? i : null), j.map(e, (i) => V(i) && i.type === nt ? i : null), j.map(e, (i) => V(i) && i.type === lt ? i : null))
1181
1180
  ));
1182
- }, Oe = ({ children: e, className: t = "", ...l }) => /* @__PURE__ */ React.createElement(
1181
+ }, at = ({ children: e, className: a = "", ...l }) => /* @__PURE__ */ React.createElement(
1183
1182
  "div",
1184
1183
  {
1185
- className: p(
1184
+ className: b(
1186
1185
  "flex flex-col space-y-1.5 text-center sm:text-left",
1187
- t
1186
+ a
1188
1187
  ),
1189
1188
  ...l
1190
1189
  },
1191
1190
  e
1192
- ), ze = ({ children: e, className: t = "", ...l }) => /* @__PURE__ */ React.createElement(
1191
+ ), lt = ({ children: e, className: a = "", ...l }) => /* @__PURE__ */ React.createElement(
1193
1192
  "div",
1194
1193
  {
1195
- className: p(
1194
+ className: b(
1196
1195
  "border-border fixed bottom-0 left-0 right-0 flex h-[4rem] flex-row items-center justify-end gap-2 border-t bg-white px-4",
1197
- t
1196
+ a
1198
1197
  ),
1199
1198
  ...l
1200
1199
  },
1201
1200
  e
1202
- ), je = ({ children: e, className: t = "", ...l }) => /* @__PURE__ */ React.createElement(
1201
+ ), nt = ({ children: e, className: a = "", ...l }) => /* @__PURE__ */ React.createElement(
1203
1202
  "div",
1204
1203
  {
1205
- className: p("text-gray-medium px-4 pb-4 text-sm", t),
1204
+ className: b("text-gray-medium px-4 pb-4 text-sm", a),
1206
1205
  ...l
1207
1206
  },
1208
1207
  e
1209
- ), Et = ({ children: e }) => {
1210
- const { closeModal: t } = G();
1211
- return /* @__PURE__ */ React.createElement("div", { onClick: t, className: "cursor-pointer" }, e);
1212
- }, De = ({ children: e }) => {
1213
- const { openModal: t } = G();
1214
- return /* @__PURE__ */ React.createElement("div", { onClick: t, className: "cursor-pointer" }, e);
1208
+ ), Qt = ({ children: e }) => {
1209
+ const { closeModal: a } = de();
1210
+ return /* @__PURE__ */ React.createElement("div", { onClick: a, className: "cursor-pointer" }, e);
1211
+ }, ct = ({ children: e }) => {
1212
+ const { openModal: a } = de();
1213
+ return /* @__PURE__ */ React.createElement("div", { onClick: a, className: "cursor-pointer" }, e);
1215
1214
  };
1216
- function Ae(e, t) {
1215
+ function rt(e, a) {
1217
1216
  Array.from(e.styleSheets).forEach((l) => {
1218
1217
  try {
1219
1218
  if (l.cssRules) {
1220
- const a = t.createElement("style");
1221
- Array.from(l.cssRules).forEach((n) => {
1222
- a.appendChild(t.createTextNode(n.cssText));
1223
- }), t.head.appendChild(a);
1219
+ const c = a.createElement("style");
1220
+ Array.from(l.cssRules).forEach((s) => {
1221
+ c.appendChild(a.createTextNode(s.cssText));
1222
+ }), a.head.appendChild(c);
1224
1223
  } else if (l.href) {
1225
- const a = t.createElement("link");
1226
- a.rel = "stylesheet", a.href = l.href, t.head.appendChild(a);
1224
+ const c = a.createElement("link");
1225
+ c.rel = "stylesheet", c.href = l.href, a.head.appendChild(c);
1227
1226
  }
1228
- } catch (a) {
1227
+ } catch (c) {
1229
1228
  if (l.href) {
1230
- const n = t.createElement("link");
1231
- n.rel = "stylesheet", n.href = l.href, t.head.appendChild(n);
1229
+ const s = a.createElement("link");
1230
+ s.rel = "stylesheet", s.href = l.href, a.head.appendChild(s);
1232
1231
  } else
1233
- console.warn("Error copying styles:", a);
1232
+ console.warn("Error copying styles:", c);
1234
1233
  }
1235
1234
  });
1236
1235
  }
1237
- const ht = ({
1236
+ const ea = ({
1238
1237
  windowInstance: e,
1239
- onClose: t,
1238
+ onClose: a,
1240
1239
  children: l
1241
1240
  }) => {
1242
- const a = fe(() => document.createElement("div"), []);
1241
+ const c = Te(() => document.createElement("div"), []);
1243
1242
  return R(() => {
1244
- const n = e;
1245
- n.document.body.innerHTML = "", n.document.body.appendChild(a), Ae(document, n.document), n.document.title = document.title || "Blockbite Editor";
1246
- const r = () => {
1247
- setTimeout(t, 100);
1243
+ const s = e;
1244
+ s.document.body.innerHTML = "", s.document.body.appendChild(c), rt(document, s.document), s.document.title = document.title || "Blockbite Editor";
1245
+ const t = () => {
1246
+ setTimeout(a, 100);
1248
1247
  };
1249
- return n.addEventListener("beforeunload", r), () => {
1250
- n.removeEventListener("beforeunload", r);
1248
+ return s.addEventListener("beforeunload", t), () => {
1249
+ s.removeEventListener("beforeunload", t);
1251
1250
  };
1252
- }, [e]), D(l, a);
1253
- }, Ct = ({
1251
+ }, [e]), ie(l, c);
1252
+ }, ta = ({
1254
1253
  children: e,
1255
- status: t = "success",
1254
+ status: a = "success",
1256
1255
  className: l
1257
1256
  }) => {
1258
- const [a, n] = g(!0);
1259
- return /* @__PURE__ */ React.createElement(E, { onClick: () => n(!1) }, a && /* @__PURE__ */ React.createElement(
1260
- ne,
1257
+ const [c, s] = f(!0);
1258
+ return /* @__PURE__ */ React.createElement(h, { onClick: () => s(!1) }, c && /* @__PURE__ */ React.createElement(
1259
+ Ne,
1261
1260
  {
1262
- status: t,
1263
- className: p(l),
1264
- onRemove: () => n(!1)
1261
+ status: a,
1262
+ className: b(l),
1263
+ onRemove: () => s(!1)
1265
1264
  },
1266
1265
  e
1267
1266
  ));
1268
- }, bt = ({
1267
+ }, aa = ({
1269
1268
  label: e,
1270
- value: t,
1269
+ value: a,
1271
1270
  onChange: l,
1272
- ...a
1271
+ ...c
1273
1272
  }) => {
1274
- const [n, r] = g(!1);
1273
+ const [s, t] = f(!1);
1275
1274
  return /* @__PURE__ */ React.createElement(
1276
- O,
1275
+ se,
1277
1276
  {
1278
1277
  label: e,
1279
- value: t,
1280
- type: n ? "text" : "password",
1281
- suffix: /* @__PURE__ */ React.createElement(z, { variant: "control" }, /* @__PURE__ */ React.createElement(
1282
- C,
1278
+ value: a,
1279
+ type: s ? "text" : "password",
1280
+ suffix: /* @__PURE__ */ React.createElement(oe, { variant: "control" }, /* @__PURE__ */ React.createElement(
1281
+ E,
1283
1282
  {
1284
- icon: /* @__PURE__ */ React.createElement(ge, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React.createElement(
1285
- Re,
1283
+ icon: /* @__PURE__ */ React.createElement(Be, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React.createElement(
1284
+ Pe,
1286
1285
  {
1287
- d: n ? "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" : "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z"
1286
+ d: s ? "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" : "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z"
1288
1287
  }
1289
1288
  )),
1290
1289
  label: "Show password",
1291
- onClick: () => r((s) => !s),
1290
+ onClick: () => t((r) => !r),
1292
1291
  size: "small"
1293
1292
  }
1294
1293
  )),
1295
1294
  onChange: l,
1296
- ...a
1295
+ ...c
1297
1296
  }
1298
1297
  );
1299
- }, xt = ({
1298
+ };
1299
+ function st(e) {
1300
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1301
+ }
1302
+ var Q = { exports: {} };
1303
+ /*!
1304
+ Copyright (c) 2018 Jed Watson.
1305
+ Licensed under the MIT License (MIT), see
1306
+ http://jedwatson.github.io/classnames
1307
+ */
1308
+ var ee;
1309
+ function ot() {
1310
+ return ee || (ee = 1, function(e) {
1311
+ (function() {
1312
+ var a = {}.hasOwnProperty;
1313
+ function l() {
1314
+ for (var t = "", r = 0; r < arguments.length; r++) {
1315
+ var n = arguments[r];
1316
+ n && (t = s(t, c(n)));
1317
+ }
1318
+ return t;
1319
+ }
1320
+ function c(t) {
1321
+ if (typeof t == "string" || typeof t == "number")
1322
+ return t;
1323
+ if (typeof t != "object")
1324
+ return "";
1325
+ if (Array.isArray(t))
1326
+ return l.apply(null, t);
1327
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
1328
+ return t.toString();
1329
+ var r = "";
1330
+ for (var n in t)
1331
+ a.call(t, n) && t[n] && (r = s(r, n));
1332
+ return r;
1333
+ }
1334
+ function s(t, r) {
1335
+ return r ? t ? t + " " + r : t + r : t;
1336
+ }
1337
+ e.exports ? (l.default = l, e.exports = l) : window.classNames = l;
1338
+ })();
1339
+ }(Q)), Q.exports;
1340
+ }
1341
+ var it = ot();
1342
+ const k = /* @__PURE__ */ st(it), D = ({ icon: e, ...a }) => e ? /* @__PURE__ */ React.createElement("div", { className: "blockbite--icon" }, /* @__PURE__ */ React.createElement(e, { ...a })) : null;
1343
+ C(
1344
+ ({
1345
+ children: e,
1346
+ className: a,
1347
+ value: l,
1348
+ variant: c = "secondary",
1349
+ pressed: s,
1350
+ onPressedChange: t,
1351
+ icon: r,
1352
+ size: n = "compact",
1353
+ display: u = "auto",
1354
+ label: i
1355
+ }) => {
1356
+ const d = w(() => {
1357
+ t(l);
1358
+ }, [t, l]);
1359
+ return /* @__PURE__ */ React.createElement(
1360
+ E,
1361
+ {
1362
+ "aria-label": i,
1363
+ className: k(a, "blockbite-ui__button--default"),
1364
+ value: l,
1365
+ size: n,
1366
+ label: i,
1367
+ variant: c,
1368
+ showTooltip: !0,
1369
+ isPressed: s,
1370
+ onClick: d
1371
+ },
1372
+ r && /* @__PURE__ */ React.createElement(D, { icon: r }),
1373
+ u !== "icon" ? e : null,
1374
+ i && !e && u !== "icon" ? /* @__PURE__ */ React.createElement("span", null, i) : null
1375
+ );
1376
+ }
1377
+ );
1378
+ C(
1379
+ ({
1380
+ className: e,
1381
+ value: a,
1382
+ toggle: l = !0,
1383
+ display: c = "auto",
1384
+ options: s,
1385
+ size: t = "compact",
1386
+ tabs: r = !1,
1387
+ variant: n = "secondary",
1388
+ stretch: u = !1,
1389
+ onPressedChange: i
1390
+ }) => {
1391
+ const d = w(
1392
+ (o) => {
1393
+ const m = l && a === o ? "" : o;
1394
+ i == null || i(m);
1395
+ },
1396
+ [i, l, a]
1397
+ ), p = (o) => c === "icon" && o != null && o.icon ? /* @__PURE__ */ React.createElement(D, { icon: o.icon }) : c === "label" ? /* @__PURE__ */ React.createElement("span", null, o.label) : /* @__PURE__ */ React.createElement("span", { className: "flex items-center justify-center gap-1" }, o.icon && /* @__PURE__ */ React.createElement(D, { icon: o.icon }), /* @__PURE__ */ React.createElement("span", null, o.label));
1398
+ return /* @__PURE__ */ React.createElement(
1399
+ "div",
1400
+ {
1401
+ className: k(
1402
+ "blockbite-ui__button-group flex flex-wrap gap-1",
1403
+ e,
1404
+ r ? "blockbite-ui__button-group--tabs" : ""
1405
+ )
1406
+ },
1407
+ s.map((o, m) => /* @__PURE__ */ React.createElement(
1408
+ E,
1409
+ {
1410
+ key: `ButtonToggleGroup__${o.value}__${o.label}__${m}`,
1411
+ className: k("blockbite-ui__button--default", {
1412
+ grow: u,
1413
+ "justify-center": u
1414
+ }),
1415
+ "aria-label": o.label,
1416
+ showTooltip: !0,
1417
+ value: o.value,
1418
+ size: t,
1419
+ label: (o == null ? void 0 : o.tooltip) || o.label,
1420
+ variant: n,
1421
+ isPressed: a === o.value,
1422
+ onClick: () => d(o.value)
1423
+ },
1424
+ p(o),
1425
+ o.children && o.children
1426
+ ))
1427
+ );
1428
+ }
1429
+ );
1430
+ const pe = ({
1431
+ children: e,
1432
+ className: a,
1433
+ important: l = !1,
1434
+ onClick: c
1435
+ }) => l ? /* @__PURE__ */ React.createElement("div", { onClick: c }, /* @__PURE__ */ React.createElement("div", { className: a }, e)) : /* @__PURE__ */ React.createElement("div", { className: a }, e), ut = $(
1436
+ ({
1437
+ onClick: e,
1438
+ onChange: a,
1439
+ className: l,
1440
+ value: c,
1441
+ children: s,
1442
+ inputClassName: t,
1443
+ readOnly: r,
1444
+ placeholder: n,
1445
+ onBlur: u,
1446
+ type: i = "text",
1447
+ label: d,
1448
+ helper: p = "",
1449
+ ...o
1450
+ }, m) => {
1451
+ const v = `text-control-${Math.random().toString(36).substring(2, 15)}`;
1452
+ return /* @__PURE__ */ React.createElement(
1453
+ "div",
1454
+ {
1455
+ className: k("flex items-center p-0", l),
1456
+ ...o
1457
+ },
1458
+ d ? /* @__PURE__ */ React.createElement("label", { htmlFor: v, className: "text-primary !m-0 !mb-0 !mr-2" }, d) : null,
1459
+ /* @__PURE__ */ React.createElement(
1460
+ "input",
1461
+ {
1462
+ id: v,
1463
+ className: k(
1464
+ "components-text-control__input",
1465
+ t
1466
+ ),
1467
+ type: i,
1468
+ value: c,
1469
+ placeholder: n,
1470
+ onFocus: () => e && e(),
1471
+ onBlur: (g) => {
1472
+ e && e(), u && u(g.target.value);
1473
+ },
1474
+ onChange: (g) => a && a(g.target.value),
1475
+ readOnly: r,
1476
+ ref: m
1477
+ }
1478
+ ),
1479
+ s,
1480
+ p && /* @__PURE__ */ React.createElement("p", { className: "text-primary !m-0 !mb-0 text-xs" }, p)
1481
+ );
1482
+ }
1483
+ );
1484
+ ut.displayName = "TextControl";
1485
+ y(null);
1486
+ function mt(e) {
1487
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1488
+ }
1489
+ var te = { exports: {} };
1490
+ /*!
1491
+ Copyright (c) 2018 Jed Watson.
1492
+ Licensed under the MIT License (MIT), see
1493
+ http://jedwatson.github.io/classnames
1494
+ */
1495
+ var ae;
1496
+ function dt() {
1497
+ return ae || (ae = 1, function(e) {
1498
+ (function() {
1499
+ var a = {}.hasOwnProperty;
1500
+ function l() {
1501
+ for (var t = "", r = 0; r < arguments.length; r++) {
1502
+ var n = arguments[r];
1503
+ n && (t = s(t, c(n)));
1504
+ }
1505
+ return t;
1506
+ }
1507
+ function c(t) {
1508
+ if (typeof t == "string" || typeof t == "number")
1509
+ return t;
1510
+ if (typeof t != "object")
1511
+ return "";
1512
+ if (Array.isArray(t))
1513
+ return l.apply(null, t);
1514
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
1515
+ return t.toString();
1516
+ var r = "";
1517
+ for (var n in t)
1518
+ a.call(t, n) && t[n] && (r = s(r, n));
1519
+ return r;
1520
+ }
1521
+ function s(t, r) {
1522
+ return r ? t ? t + " " + r : t + r : t;
1523
+ }
1524
+ e.exports ? (l.default = l, e.exports = l) : window.classNames = l;
1525
+ })();
1526
+ }(te)), te.exports;
1527
+ }
1528
+ var pt = dt();
1529
+ const S = /* @__PURE__ */ mt(pt), G = ({ icon: e, ...a }) => e ? /* @__PURE__ */ React.createElement("div", { className: "blockbite--icon" }, /* @__PURE__ */ React.createElement(e, { ...a })) : null;
1530
+ C(
1531
+ ({
1532
+ children: e,
1533
+ className: a,
1534
+ value: l,
1535
+ variant: c = "secondary",
1536
+ pressed: s,
1537
+ onPressedChange: t,
1538
+ icon: r,
1539
+ size: n = "compact",
1540
+ display: u = "auto",
1541
+ label: i
1542
+ }) => {
1543
+ const d = w(() => {
1544
+ t(l);
1545
+ }, [t, l]);
1546
+ return /* @__PURE__ */ React.createElement(
1547
+ E,
1548
+ {
1549
+ "aria-label": i,
1550
+ className: S(a, "blockbite-ui__button--default"),
1551
+ value: l,
1552
+ size: n,
1553
+ label: i,
1554
+ variant: c,
1555
+ showTooltip: !0,
1556
+ isPressed: s,
1557
+ onClick: d
1558
+ },
1559
+ r && /* @__PURE__ */ React.createElement(G, { icon: r }),
1560
+ u !== "icon" ? e : null,
1561
+ i && !e && u !== "icon" ? /* @__PURE__ */ React.createElement("span", null, i) : null
1562
+ );
1563
+ }
1564
+ );
1565
+ C(
1566
+ ({
1567
+ className: e,
1568
+ value: a,
1569
+ toggle: l = !0,
1570
+ display: c = "auto",
1571
+ options: s,
1572
+ size: t = "compact",
1573
+ tabs: r = !1,
1574
+ variant: n = "secondary",
1575
+ stretch: u = !1,
1576
+ onPressedChange: i
1577
+ }) => {
1578
+ const d = w(
1579
+ (o) => {
1580
+ const m = l && a === o ? "" : o;
1581
+ i == null || i(m);
1582
+ },
1583
+ [i, l, a]
1584
+ ), p = (o) => c === "icon" && o != null && o.icon ? /* @__PURE__ */ React.createElement(G, { icon: o.icon }) : c === "label" ? /* @__PURE__ */ React.createElement("span", null, o.label) : /* @__PURE__ */ React.createElement("span", { className: "flex items-center justify-center gap-1" }, o.icon && /* @__PURE__ */ React.createElement(G, { icon: o.icon }), /* @__PURE__ */ React.createElement("span", null, o.label));
1585
+ return /* @__PURE__ */ React.createElement(
1586
+ "div",
1587
+ {
1588
+ className: S(
1589
+ "blockbite-ui__button-group flex flex-wrap gap-1",
1590
+ e,
1591
+ r ? "blockbite-ui__button-group--tabs" : ""
1592
+ )
1593
+ },
1594
+ s.map((o, m) => /* @__PURE__ */ React.createElement(
1595
+ E,
1596
+ {
1597
+ key: `ButtonToggleGroup__${o.value}__${o.label}__${m}`,
1598
+ className: S("blockbite-ui__button--default", {
1599
+ grow: u,
1600
+ "justify-center": u
1601
+ }),
1602
+ "aria-label": o.label,
1603
+ showTooltip: !0,
1604
+ value: o.value,
1605
+ size: t,
1606
+ label: (o == null ? void 0 : o.tooltip) || o.label,
1607
+ variant: n,
1608
+ isPressed: a === o.value,
1609
+ onClick: () => d(o.value)
1610
+ },
1611
+ p(o),
1612
+ o.children && o.children
1613
+ ))
1614
+ );
1615
+ }
1616
+ );
1617
+ const ft = ({
1618
+ children: e,
1619
+ className: a,
1620
+ important: l = !1,
1621
+ onClick: c
1622
+ }) => l ? /* @__PURE__ */ React.createElement("div", { onClick: c }, /* @__PURE__ */ React.createElement("div", { className: a }, e)) : /* @__PURE__ */ React.createElement("div", { className: a }, e), bt = $(
1623
+ ({
1624
+ onClick: e,
1625
+ onChange: a,
1626
+ className: l,
1627
+ value: c,
1628
+ children: s,
1629
+ inputClassName: t,
1630
+ readOnly: r,
1631
+ placeholder: n,
1632
+ onBlur: u,
1633
+ type: i = "text",
1634
+ label: d,
1635
+ helper: p = "",
1636
+ ...o
1637
+ }, m) => {
1638
+ const v = `text-control-${Math.random().toString(36).substring(2, 15)}`;
1639
+ return /* @__PURE__ */ React.createElement(
1640
+ "div",
1641
+ {
1642
+ className: S("flex items-center p-0", l),
1643
+ ...o
1644
+ },
1645
+ d ? /* @__PURE__ */ React.createElement("label", { htmlFor: v, className: "text-primary !m-0 !mb-0 !mr-2" }, d) : null,
1646
+ /* @__PURE__ */ React.createElement(
1647
+ "input",
1648
+ {
1649
+ id: v,
1650
+ className: S(
1651
+ "components-text-control__input",
1652
+ t
1653
+ ),
1654
+ type: i,
1655
+ value: c,
1656
+ placeholder: n,
1657
+ onFocus: () => e && e(),
1658
+ onBlur: (g) => {
1659
+ e && e(), u && u(g.target.value);
1660
+ },
1661
+ onChange: (g) => a && a(g.target.value),
1662
+ readOnly: r,
1663
+ ref: m
1664
+ }
1665
+ ),
1666
+ s,
1667
+ p && /* @__PURE__ */ React.createElement("p", { className: "text-primary !m-0 !mb-0 text-xs" }, p)
1668
+ );
1669
+ }
1670
+ );
1671
+ bt.displayName = "TextControl";
1672
+ y(null);
1673
+ function gt(e) {
1674
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1675
+ }
1676
+ var le = { exports: {} };
1677
+ /*!
1678
+ Copyright (c) 2018 Jed Watson.
1679
+ Licensed under the MIT License (MIT), see
1680
+ http://jedwatson.github.io/classnames
1681
+ */
1682
+ var ne;
1683
+ function vt() {
1684
+ return ne || (ne = 1, function(e) {
1685
+ (function() {
1686
+ var a = {}.hasOwnProperty;
1687
+ function l() {
1688
+ for (var t = "", r = 0; r < arguments.length; r++) {
1689
+ var n = arguments[r];
1690
+ n && (t = s(t, c(n)));
1691
+ }
1692
+ return t;
1693
+ }
1694
+ function c(t) {
1695
+ if (typeof t == "string" || typeof t == "number")
1696
+ return t;
1697
+ if (typeof t != "object")
1698
+ return "";
1699
+ if (Array.isArray(t))
1700
+ return l.apply(null, t);
1701
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
1702
+ return t.toString();
1703
+ var r = "";
1704
+ for (var n in t)
1705
+ a.call(t, n) && t[n] && (r = s(r, n));
1706
+ return r;
1707
+ }
1708
+ function s(t, r) {
1709
+ return r ? t ? t + " " + r : t + r : t;
1710
+ }
1711
+ e.exports ? (l.default = l, e.exports = l) : window.classNames = l;
1712
+ })();
1713
+ }(le)), le.exports;
1714
+ }
1715
+ var Rt = vt();
1716
+ const M = /* @__PURE__ */ gt(Rt), U = ({ icon: e, ...a }) => e ? /* @__PURE__ */ React.createElement("div", { className: "blockbite--icon" }, /* @__PURE__ */ React.createElement(e, { ...a })) : null;
1717
+ C(
1718
+ ({
1719
+ children: e,
1720
+ className: a,
1721
+ value: l,
1722
+ variant: c = "secondary",
1723
+ pressed: s,
1724
+ onPressedChange: t,
1725
+ icon: r,
1726
+ size: n = "compact",
1727
+ display: u = "auto",
1728
+ label: i
1729
+ }) => {
1730
+ const d = w(() => {
1731
+ t(l);
1732
+ }, [t, l]);
1733
+ return /* @__PURE__ */ React.createElement(
1734
+ E,
1735
+ {
1736
+ "aria-label": i,
1737
+ className: M(a, "blockbite-ui__button--default"),
1738
+ value: l,
1739
+ size: n,
1740
+ label: i,
1741
+ variant: c,
1742
+ showTooltip: !0,
1743
+ isPressed: s,
1744
+ onClick: d
1745
+ },
1746
+ r && /* @__PURE__ */ React.createElement(U, { icon: r }),
1747
+ u !== "icon" ? e : null,
1748
+ i && !e && u !== "icon" ? /* @__PURE__ */ React.createElement("span", null, i) : null
1749
+ );
1750
+ }
1751
+ );
1752
+ C(
1753
+ ({
1754
+ className: e,
1755
+ value: a,
1756
+ toggle: l = !0,
1757
+ display: c = "auto",
1758
+ options: s,
1759
+ size: t = "compact",
1760
+ tabs: r = !1,
1761
+ variant: n = "secondary",
1762
+ stretch: u = !1,
1763
+ onPressedChange: i
1764
+ }) => {
1765
+ const d = w(
1766
+ (o) => {
1767
+ const m = l && a === o ? "" : o;
1768
+ i == null || i(m);
1769
+ },
1770
+ [i, l, a]
1771
+ ), p = (o) => c === "icon" && o != null && o.icon ? /* @__PURE__ */ React.createElement(U, { icon: o.icon }) : c === "label" ? /* @__PURE__ */ React.createElement("span", null, o.label) : /* @__PURE__ */ React.createElement("span", { className: "flex items-center justify-center gap-1" }, o.icon && /* @__PURE__ */ React.createElement(U, { icon: o.icon }), /* @__PURE__ */ React.createElement("span", null, o.label));
1772
+ return /* @__PURE__ */ React.createElement(
1773
+ "div",
1774
+ {
1775
+ className: M(
1776
+ "blockbite-ui__button-group flex flex-wrap gap-1",
1777
+ e,
1778
+ r ? "blockbite-ui__button-group--tabs" : ""
1779
+ )
1780
+ },
1781
+ s.map((o, m) => /* @__PURE__ */ React.createElement(
1782
+ E,
1783
+ {
1784
+ key: `ButtonToggleGroup__${o.value}__${o.label}__${m}`,
1785
+ className: M("blockbite-ui__button--default", {
1786
+ grow: u,
1787
+ "justify-center": u
1788
+ }),
1789
+ "aria-label": o.label,
1790
+ showTooltip: !0,
1791
+ value: o.value,
1792
+ size: t,
1793
+ label: (o == null ? void 0 : o.tooltip) || o.label,
1794
+ variant: n,
1795
+ isPressed: a === o.value,
1796
+ onClick: () => d(o.value)
1797
+ },
1798
+ p(o),
1799
+ o.children && o.children
1800
+ ))
1801
+ );
1802
+ }
1803
+ );
1804
+ const Et = ({
1805
+ children: e,
1806
+ className: a,
1807
+ important: l = !1,
1808
+ onClick: c
1809
+ }) => l ? /* @__PURE__ */ React.createElement("div", { onClick: c }, /* @__PURE__ */ React.createElement("div", { className: a }, e)) : /* @__PURE__ */ React.createElement("div", { className: a }, e), ht = $(
1810
+ ({
1811
+ onClick: e,
1812
+ onChange: a,
1813
+ className: l,
1814
+ value: c,
1815
+ children: s,
1816
+ inputClassName: t,
1817
+ readOnly: r,
1818
+ placeholder: n,
1819
+ onBlur: u,
1820
+ type: i = "text",
1821
+ label: d,
1822
+ helper: p = "",
1823
+ ...o
1824
+ }, m) => {
1825
+ const v = `text-control-${Math.random().toString(36).substring(2, 15)}`;
1826
+ return /* @__PURE__ */ React.createElement(
1827
+ "div",
1828
+ {
1829
+ className: M("flex items-center p-0", l),
1830
+ ...o
1831
+ },
1832
+ d ? /* @__PURE__ */ React.createElement("label", { htmlFor: v, className: "text-primary !m-0 !mb-0 !mr-2" }, d) : null,
1833
+ /* @__PURE__ */ React.createElement(
1834
+ "input",
1835
+ {
1836
+ id: v,
1837
+ className: M(
1838
+ "components-text-control__input",
1839
+ t
1840
+ ),
1841
+ type: i,
1842
+ value: c,
1843
+ placeholder: n,
1844
+ onFocus: () => e && e(),
1845
+ onBlur: (g) => {
1846
+ e && e(), u && u(g.target.value);
1847
+ },
1848
+ onChange: (g) => a && a(g.target.value),
1849
+ readOnly: r,
1850
+ ref: m
1851
+ }
1852
+ ),
1853
+ s,
1854
+ p && /* @__PURE__ */ React.createElement("p", { className: "text-primary !m-0 !mb-0 text-xs" }, p)
1855
+ );
1856
+ }
1857
+ );
1858
+ ht.displayName = "TextControl";
1859
+ y(null);
1860
+ function Ct(e) {
1861
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1862
+ }
1863
+ var ce = { exports: {} };
1864
+ /*!
1865
+ Copyright (c) 2018 Jed Watson.
1866
+ Licensed under the MIT License (MIT), see
1867
+ http://jedwatson.github.io/classnames
1868
+ */
1869
+ var re;
1870
+ function xt() {
1871
+ return re || (re = 1, function(e) {
1872
+ (function() {
1873
+ var a = {}.hasOwnProperty;
1874
+ function l() {
1875
+ for (var t = "", r = 0; r < arguments.length; r++) {
1876
+ var n = arguments[r];
1877
+ n && (t = s(t, c(n)));
1878
+ }
1879
+ return t;
1880
+ }
1881
+ function c(t) {
1882
+ if (typeof t == "string" || typeof t == "number")
1883
+ return t;
1884
+ if (typeof t != "object")
1885
+ return "";
1886
+ if (Array.isArray(t))
1887
+ return l.apply(null, t);
1888
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
1889
+ return t.toString();
1890
+ var r = "";
1891
+ for (var n in t)
1892
+ a.call(t, n) && t[n] && (r = s(r, n));
1893
+ return r;
1894
+ }
1895
+ function s(t, r) {
1896
+ return r ? t ? t + " " + r : t + r : t;
1897
+ }
1898
+ e.exports ? (l.default = l, e.exports = l) : window.classNames = l;
1899
+ })();
1900
+ }(ce)), ce.exports;
1901
+ }
1902
+ var wt = xt();
1903
+ const T = /* @__PURE__ */ Ct(wt), W = ({ icon: e, ...a }) => e ? /* @__PURE__ */ React.createElement("div", { className: "blockbite--icon" }, /* @__PURE__ */ React.createElement(e, { ...a })) : null;
1904
+ C(
1905
+ ({
1906
+ children: e,
1907
+ className: a,
1908
+ value: l,
1909
+ variant: c = "secondary",
1910
+ pressed: s,
1911
+ onPressedChange: t,
1912
+ icon: r,
1913
+ size: n = "compact",
1914
+ display: u = "auto",
1915
+ label: i
1916
+ }) => {
1917
+ const d = w(() => {
1918
+ t(l);
1919
+ }, [t, l]);
1920
+ return /* @__PURE__ */ React.createElement(
1921
+ E,
1922
+ {
1923
+ "aria-label": i,
1924
+ className: T(a, "blockbite-ui__button--default"),
1925
+ value: l,
1926
+ size: n,
1927
+ label: i,
1928
+ variant: c,
1929
+ showTooltip: !0,
1930
+ isPressed: s,
1931
+ onClick: d
1932
+ },
1933
+ r && /* @__PURE__ */ React.createElement(W, { icon: r }),
1934
+ u !== "icon" ? e : null,
1935
+ i && !e && u !== "icon" ? /* @__PURE__ */ React.createElement("span", null, i) : null
1936
+ );
1937
+ }
1938
+ );
1939
+ C(
1940
+ ({
1941
+ className: e,
1942
+ value: a,
1943
+ toggle: l = !0,
1944
+ display: c = "auto",
1945
+ options: s,
1946
+ size: t = "compact",
1947
+ tabs: r = !1,
1948
+ variant: n = "secondary",
1949
+ stretch: u = !1,
1950
+ onPressedChange: i
1951
+ }) => {
1952
+ const d = w(
1953
+ (o) => {
1954
+ const m = l && a === o ? "" : o;
1955
+ i == null || i(m);
1956
+ },
1957
+ [i, l, a]
1958
+ ), p = (o) => c === "icon" && o != null && o.icon ? /* @__PURE__ */ React.createElement(W, { icon: o.icon }) : c === "label" ? /* @__PURE__ */ React.createElement("span", null, o.label) : /* @__PURE__ */ React.createElement("span", { className: "flex items-center justify-center gap-1" }, o.icon && /* @__PURE__ */ React.createElement(W, { icon: o.icon }), /* @__PURE__ */ React.createElement("span", null, o.label));
1959
+ return /* @__PURE__ */ React.createElement(
1960
+ "div",
1961
+ {
1962
+ className: T(
1963
+ "blockbite-ui__button-group flex flex-wrap gap-1",
1964
+ e,
1965
+ r ? "blockbite-ui__button-group--tabs" : ""
1966
+ )
1967
+ },
1968
+ s.map((o, m) => /* @__PURE__ */ React.createElement(
1969
+ E,
1970
+ {
1971
+ key: `ButtonToggleGroup__${o.value}__${o.label}__${m}`,
1972
+ className: T("blockbite-ui__button--default", {
1973
+ grow: u,
1974
+ "justify-center": u
1975
+ }),
1976
+ "aria-label": o.label,
1977
+ showTooltip: !0,
1978
+ value: o.value,
1979
+ size: t,
1980
+ label: (o == null ? void 0 : o.tooltip) || o.label,
1981
+ variant: n,
1982
+ isPressed: a === o.value,
1983
+ onClick: () => d(o.value)
1984
+ },
1985
+ p(o),
1986
+ o.children && o.children
1987
+ ))
1988
+ );
1989
+ }
1990
+ );
1991
+ const yt = ({
1992
+ children: e,
1993
+ className: a,
1994
+ important: l = !1,
1995
+ onClick: c
1996
+ }) => l ? /* @__PURE__ */ React.createElement("div", { onClick: c }, /* @__PURE__ */ React.createElement("div", { className: a }, e)) : /* @__PURE__ */ React.createElement("div", { className: a }, e), Nt = $(
1997
+ ({
1998
+ onClick: e,
1999
+ onChange: a,
2000
+ className: l,
2001
+ value: c,
2002
+ children: s,
2003
+ inputClassName: t,
2004
+ readOnly: r,
2005
+ placeholder: n,
2006
+ onBlur: u,
2007
+ type: i = "text",
2008
+ label: d,
2009
+ helper: p = "",
2010
+ ...o
2011
+ }, m) => {
2012
+ const v = `text-control-${Math.random().toString(36).substring(2, 15)}`;
2013
+ return /* @__PURE__ */ React.createElement(
2014
+ "div",
2015
+ {
2016
+ className: T("flex items-center p-0", l),
2017
+ ...o
2018
+ },
2019
+ d ? /* @__PURE__ */ React.createElement("label", { htmlFor: v, className: "text-primary !m-0 !mb-0 !mr-2" }, d) : null,
2020
+ /* @__PURE__ */ React.createElement(
2021
+ "input",
2022
+ {
2023
+ id: v,
2024
+ className: T(
2025
+ "components-text-control__input",
2026
+ t
2027
+ ),
2028
+ type: i,
2029
+ value: c,
2030
+ placeholder: n,
2031
+ onFocus: () => e && e(),
2032
+ onBlur: (g) => {
2033
+ e && e(), u && u(g.target.value);
2034
+ },
2035
+ onChange: (g) => a && a(g.target.value),
2036
+ readOnly: r,
2037
+ ref: m
2038
+ }
2039
+ ),
2040
+ s,
2041
+ p && /* @__PURE__ */ React.createElement("p", { className: "text-primary !m-0 !mb-0 text-xs" }, p)
2042
+ );
2043
+ }
2044
+ );
2045
+ Nt.displayName = "TextControl";
2046
+ y(null);
2047
+ const { select: la, dispatch: na } = wp.data;
2048
+ y(null);
2049
+ C(
2050
+ ({
2051
+ className: e,
2052
+ options: a,
2053
+ value: l,
2054
+ display: c = "label",
2055
+ label: s = !1,
2056
+ onPressedChange: t
2057
+ }) => {
2058
+ const r = (n) => {
2059
+ t(n);
2060
+ };
2061
+ return /* @__PURE__ */ React.createElement(yt, { className: T(e) }, /* @__PURE__ */ React.createElement(
2062
+ P,
2063
+ {
2064
+ __next40pxDefaultSize: !0,
2065
+ __nextHasNoMarginBottom: !0,
2066
+ isBlock: !0,
2067
+ value: l,
2068
+ ...s ? { label: s } : {}
2069
+ },
2070
+ a.map(
2071
+ (n) => c === "icon" ? /* @__PURE__ */ React.createElement(
2072
+ O,
2073
+ {
2074
+ icon: n.icon,
2075
+ label: n.label,
2076
+ key: `ToggleGroupControlIcon-${n.value}`,
2077
+ value: n.value,
2078
+ onClick: () => r(n.value)
2079
+ }
2080
+ ) : /* @__PURE__ */ React.createElement(
2081
+ H,
2082
+ {
2083
+ key: `ToggleGroupControlOption-${n.value}`,
2084
+ value: n.value,
2085
+ label: n.label,
2086
+ onClick: () => r(n.value)
2087
+ }
2088
+ )
2089
+ )
2090
+ ));
2091
+ }
2092
+ );
2093
+ const { select: ca, dispatch: ra } = wp.data;
2094
+ y(null);
2095
+ C(
2096
+ ({
2097
+ className: e,
2098
+ options: a,
2099
+ value: l,
2100
+ display: c = "label",
2101
+ label: s = !1,
2102
+ onPressedChange: t
2103
+ }) => {
2104
+ const r = (n) => {
2105
+ t(n);
2106
+ };
2107
+ return /* @__PURE__ */ React.createElement(Et, { className: M(e) }, /* @__PURE__ */ React.createElement(
2108
+ P,
2109
+ {
2110
+ __next40pxDefaultSize: !0,
2111
+ __nextHasNoMarginBottom: !0,
2112
+ isBlock: !0,
2113
+ value: l,
2114
+ ...s ? { label: s } : {}
2115
+ },
2116
+ a.map(
2117
+ (n) => c === "icon" ? /* @__PURE__ */ React.createElement(
2118
+ O,
2119
+ {
2120
+ icon: n.icon,
2121
+ label: n.label,
2122
+ key: `ToggleGroupControlIcon-${n.value}`,
2123
+ value: n.value,
2124
+ onClick: () => r(n.value)
2125
+ }
2126
+ ) : /* @__PURE__ */ React.createElement(
2127
+ H,
2128
+ {
2129
+ key: `ToggleGroupControlOption-${n.value}`,
2130
+ value: n.value,
2131
+ label: n.label,
2132
+ onClick: () => r(n.value)
2133
+ }
2134
+ )
2135
+ )
2136
+ ));
2137
+ }
2138
+ );
2139
+ const { select: sa, dispatch: oa } = wp.data;
2140
+ y(null);
2141
+ C(
2142
+ ({
2143
+ className: e,
2144
+ options: a,
2145
+ value: l,
2146
+ display: c = "label",
2147
+ label: s = !1,
2148
+ onPressedChange: t
2149
+ }) => {
2150
+ const r = (n) => {
2151
+ t(n);
2152
+ };
2153
+ return /* @__PURE__ */ React.createElement(ft, { className: S(e) }, /* @__PURE__ */ React.createElement(
2154
+ P,
2155
+ {
2156
+ __next40pxDefaultSize: !0,
2157
+ __nextHasNoMarginBottom: !0,
2158
+ isBlock: !0,
2159
+ value: l,
2160
+ ...s ? { label: s } : {}
2161
+ },
2162
+ a.map(
2163
+ (n) => c === "icon" ? /* @__PURE__ */ React.createElement(
2164
+ O,
2165
+ {
2166
+ icon: n.icon,
2167
+ label: n.label,
2168
+ key: `ToggleGroupControlIcon-${n.value}`,
2169
+ value: n.value,
2170
+ onClick: () => r(n.value)
2171
+ }
2172
+ ) : /* @__PURE__ */ React.createElement(
2173
+ H,
2174
+ {
2175
+ key: `ToggleGroupControlOption-${n.value}`,
2176
+ value: n.value,
2177
+ label: n.label,
2178
+ onClick: () => r(n.value)
2179
+ }
2180
+ )
2181
+ )
2182
+ ));
2183
+ }
2184
+ );
2185
+ const { select: ia, dispatch: ua } = wp.data;
2186
+ y(null);
2187
+ C(
2188
+ ({
2189
+ className: e,
2190
+ options: a,
2191
+ value: l,
2192
+ display: c = "label",
2193
+ label: s = !1,
2194
+ onPressedChange: t
2195
+ }) => {
2196
+ const r = (n) => {
2197
+ t(n);
2198
+ };
2199
+ return /* @__PURE__ */ React.createElement(pe, { className: k(e) }, /* @__PURE__ */ React.createElement(
2200
+ P,
2201
+ {
2202
+ __next40pxDefaultSize: !0,
2203
+ __nextHasNoMarginBottom: !0,
2204
+ isBlock: !0,
2205
+ value: l,
2206
+ ...s ? { label: s } : {}
2207
+ },
2208
+ a.map(
2209
+ (n) => c === "icon" ? /* @__PURE__ */ React.createElement(
2210
+ O,
2211
+ {
2212
+ icon: n.icon,
2213
+ label: n.label,
2214
+ key: `ToggleGroupControlIcon-${n.value}`,
2215
+ value: n.value,
2216
+ onClick: () => r(n.value)
2217
+ }
2218
+ ) : /* @__PURE__ */ React.createElement(
2219
+ H,
2220
+ {
2221
+ key: `ToggleGroupControlOption-${n.value}`,
2222
+ value: n.value,
2223
+ label: n.label,
2224
+ onClick: () => r(n.value)
2225
+ }
2226
+ )
2227
+ )
2228
+ ));
2229
+ }
2230
+ );
2231
+ const ma = ({
1300
2232
  items: e,
1301
- activeId: t,
2233
+ activeId: a,
1302
2234
  onSelect: l,
1303
- className: a
1304
- }) => /* @__PURE__ */ React.createElement(E, { important: !0, className: a }, /* @__PURE__ */ React.createElement("div", { className: "w-[200px] overflow-y-auto border-r border-border gap-2" }, e.map((n) => /* @__PURE__ */ React.createElement(
2235
+ className: c
2236
+ }) => /* @__PURE__ */ React.createElement(pe, { important: !0, className: c }, /* @__PURE__ */ React.createElement("div", { className: "w-[200px] overflow-y-auto border-r border-border gap-2" }, e.map((s) => /* @__PURE__ */ React.createElement(
1305
2237
  "div",
1306
2238
  {
1307
- key: n.id,
1308
- onClick: () => l(n.id),
1309
- className: `cursor-pointer p-2 border-l-4 flex gap-2 items-center ${t === n.id ? "border-blue-500 bg-gray-100" : "border-transparent"}`
2239
+ key: s.id,
2240
+ onClick: () => l(s.id),
2241
+ className: `cursor-pointer p-2 border-l-4 flex gap-2 items-center ${a === s.id ? "border-blue-500 bg-gray-100" : "border-transparent"}`
1310
2242
  },
1311
- /* @__PURE__ */ React.createElement("span", { className: "rounded bg-slate-300 w-12 h-12 flex items-center justify-center text-2xl font-bold text-white" }, n.name.charAt(0).toUpperCase()),
1312
- /* @__PURE__ */ React.createElement("p", { className: "text-sm text-center mt-1" }, n.name)
2243
+ /* @__PURE__ */ React.createElement("span", { className: "rounded bg-slate-300 w-12 h-12 flex items-center justify-center text-2xl font-bold text-white" }, s.name.charAt(0).toUpperCase()),
2244
+ /* @__PURE__ */ React.createElement("p", { className: "text-sm text-center mt-1" }, s.name)
1313
2245
  ))));
1314
- function wt(e) {
1315
- const { media: t, mediaClass: l } = e, { url: a, alt: n, sizes: r } = t;
1316
- if (r === void 0)
1317
- return /* @__PURE__ */ React.createElement("img", { src: a, alt: n, className: `media ${l}` });
1318
- const { thumbnail: s, medium: c, large: i } = r, o = s || a, f = c || a, d = i || a;
1319
- return /* @__PURE__ */ React.createElement("picture", { className: "responsive-media" }, o ? /* @__PURE__ */ React.createElement(
2246
+ function da(e) {
2247
+ const { media: a, mediaClass: l } = e, { url: c, alt: s, sizes: t } = a;
2248
+ if (t === void 0)
2249
+ return /* @__PURE__ */ React.createElement("img", { src: c, alt: s, className: `media ${l}` });
2250
+ const { thumbnail: r, medium: n, large: u } = t, i = r || c, d = n || c, p = u || c;
2251
+ return /* @__PURE__ */ React.createElement("picture", { className: "b_responsive" }, i ? /* @__PURE__ */ React.createElement(
1320
2252
  "source",
1321
2253
  {
1322
2254
  media: "(max-width: 768px)",
1323
- srcSet: o,
1324
- className: `media ${l}`
2255
+ srcSet: i,
2256
+ className: `b_media ${l}`
1325
2257
  }
1326
- ) : null, f ? /* @__PURE__ */ React.createElement(
2258
+ ) : null, d ? /* @__PURE__ */ React.createElement(
1327
2259
  "source",
1328
2260
  {
1329
2261
  media: "(min-width: 1024px)",
1330
- srcSet: f,
1331
- className: `media ${l}`
2262
+ srcSet: d,
2263
+ className: `b_media ${l}`
1332
2264
  }
1333
- ) : null, d ? /* @__PURE__ */ React.createElement(
2265
+ ) : null, p ? /* @__PURE__ */ React.createElement(
1334
2266
  "source",
1335
2267
  {
1336
2268
  media: "(min-width: 1536px)",
1337
- srcSet: d,
1338
- className: `media ${l}`
2269
+ srcSet: p,
2270
+ className: `b_media ${l}`
1339
2271
  }
1340
- ) : null, f ? /* @__PURE__ */ React.createElement("img", { src: f, alt: n, className: `media ${l}` }) : null);
2272
+ ) : null, d ? /* @__PURE__ */ React.createElement("img", { src: d, alt: s, className: `b_media ${l}` }) : null);
1341
2273
  }
1342
- function vt(e) {
1343
- const { media: t, mediaClass: l } = e, { url: a } = t, n = a;
2274
+ function pa(e) {
2275
+ const { media: a, mediaClass: l } = e, { url: c } = a, s = c;
1344
2276
  return /* @__PURE__ */ React.createElement(
1345
2277
  "video",
1346
2278
  {
@@ -1352,258 +2284,258 @@ function vt(e) {
1352
2284
  muted: !0,
1353
2285
  loop: !0
1354
2286
  },
1355
- /* @__PURE__ */ React.createElement("source", { src: n, type: "video/mp4" })
2287
+ /* @__PURE__ */ React.createElement("source", { src: s, type: "video/mp4" })
1356
2288
  );
1357
2289
  }
1358
- const Nt = ({
2290
+ const fa = ({
1359
2291
  children: e,
1360
- className: t = "",
2292
+ className: a = "",
1361
2293
  height: l = "large"
1362
2294
  }) => /* @__PURE__ */ React.createElement(
1363
- E,
2295
+ h,
1364
2296
  {
1365
- className: p("scrollbar relative overflow-y-scroll", t, {
2297
+ className: b("scrollbar relative overflow-y-scroll", a, {
1366
2298
  "h-[400px]": l === "large",
1367
2299
  "h-[300px]": l === "medium",
1368
2300
  "h-[200px]": l === "small"
1369
2301
  })
1370
2302
  },
1371
2303
  e
1372
- ), yt = ({
2304
+ ), ba = ({
1373
2305
  onChange: e,
1374
- className: t,
2306
+ className: a,
1375
2307
  value: l,
1376
- options: a,
1377
- label: n = "",
1378
- emptyLabel: r = "No options available"
2308
+ options: c,
2309
+ label: s = "",
2310
+ emptyLabel: t = "No options available"
1379
2311
  }) => {
1380
- const s = (c) => {
1381
- e && e(c);
2312
+ const r = (n) => {
2313
+ e && e(n);
1382
2314
  };
1383
- return /* @__PURE__ */ React.createElement("div", { className: t }, a && a.length > 0 && /* @__PURE__ */ React.createElement(
1384
- re,
2315
+ return /* @__PURE__ */ React.createElement("div", { className: a }, c && c.length > 0 && /* @__PURE__ */ React.createElement(
2316
+ _e,
1385
2317
  {
1386
2318
  __next40pxDefaultSize: !0,
1387
2319
  __nextHasNoMarginBottom: !0,
1388
- label: n || "",
2320
+ label: s || "",
1389
2321
  value: l || "",
1390
- onChange: s,
1391
- options: [{ value: "", label: "Select an option" }, ...a]
2322
+ onChange: r,
2323
+ options: [{ value: "", label: "Select an option" }, ...c]
1392
2324
  }
1393
- ), (!a || (a == null ? void 0 : a.length) === 0) && /* @__PURE__ */ React.createElement("p", { className: "mb-2" }, r));
1394
- }, { select: Fe, dispatch: Ue } = wp.data, kt = ({
2325
+ ), (!c || (c == null ? void 0 : c.length) === 0) && /* @__PURE__ */ React.createElement("p", { className: "mb-2" }, t));
2326
+ }, { select: _t, dispatch: kt } = wp.data, ga = ({
1395
2327
  buttonText: e = "Add block"
1396
2328
  }) => {
1397
- const t = () => {
1398
- const l = Fe("core/block-editor").getSelectedBlock(), { clientId: a, innerBlocks: n } = l, r = n[n.length - 1], s = Ee(
1399
- r.name,
1400
- r.attributes,
1401
- r.innerBlocks
2329
+ const a = () => {
2330
+ const l = _t("core/block-editor").getSelectedBlock(), { clientId: c, innerBlocks: s } = l, t = s[s.length - 1], r = Oe(
2331
+ t.name,
2332
+ t.attributes,
2333
+ t.innerBlocks
1402
2334
  );
1403
- Ue("core/block-editor").insertBlocks(s, 0, a);
2335
+ kt("core/block-editor").insertBlocks(r, 0, c);
1404
2336
  };
1405
- return /* @__PURE__ */ React.createElement(C, { variant: "primary", onClick: () => t() }, e);
1406
- }, _t = ({ children: e, watch: t, className: l }) => {
1407
- const [a, n] = g(0);
2337
+ return /* @__PURE__ */ React.createElement(E, { variant: "primary", onClick: () => a() }, e);
2338
+ }, va = ({ children: e, watch: a, className: l }) => {
2339
+ const [c, s] = f(0);
1408
2340
  return R(() => {
1409
2341
  setTimeout(() => {
1410
- n(1);
2342
+ s(1);
1411
2343
  }, 250);
1412
- }, [t]), /* @__PURE__ */ React.createElement(
1413
- E,
2344
+ }, [a]), /* @__PURE__ */ React.createElement(
2345
+ h,
1414
2346
  {
1415
- className: p(
2347
+ className: b(
1416
2348
  l,
1417
2349
  "duration-50 transform transition-all ease-in-out",
1418
2350
  {
1419
- "translate-x-0": a === 1,
1420
- "-translate-x-full": a === 0
2351
+ "translate-x-0": c === 1,
2352
+ "-translate-x-full": c === 0
1421
2353
  }
1422
2354
  )
1423
2355
  },
1424
2356
  e
1425
2357
  );
1426
- }, Lt = ({ className: e, defaultValue: t }) => {
1427
- const [l, a] = g(!1);
2358
+ }, Ra = ({ className: e, defaultValue: a }) => {
2359
+ const [l, c] = f(!1);
1428
2360
  return R(() => {
1429
2361
  setTimeout(() => {
1430
- a(!1);
1431
- }, 500), t && a(!0);
1432
- }, [l, t]), l && /* @__PURE__ */ React.createElement(ce, { className: p(e) });
1433
- }, Z = A(null), Ge = ({
2362
+ c(!1);
2363
+ }, 500), a && c(!0);
2364
+ }, [l, a]), l && /* @__PURE__ */ React.createElement(ke, { className: b(e) });
2365
+ }, X = y(null), St = ({
1434
2366
  children: e,
1435
- defaultValue: t,
2367
+ defaultValue: a,
1436
2368
  value: l,
1437
- onValueChange: a,
1438
- ...n
2369
+ onValueChange: c,
2370
+ ...s
1439
2371
  }) => {
1440
- const r = l !== void 0, [s, c] = g(t || ""), f = {
1441
- activeTab: r ? l : s,
1442
- setActiveTab: (d) => {
1443
- r || c(d), a && a(d);
2372
+ const t = l !== void 0, [r, n] = f(a || ""), d = {
2373
+ activeTab: t ? l : r,
2374
+ setActiveTab: (p) => {
2375
+ t || n(p), c && c(p);
1444
2376
  }
1445
2377
  };
1446
- return /* @__PURE__ */ React.createElement(Z.Provider, { value: f }, /* @__PURE__ */ React.createElement(E, { important: !0, className: n.className }, e));
1447
- }, We = ({
2378
+ return /* @__PURE__ */ React.createElement(X.Provider, { value: d }, /* @__PURE__ */ React.createElement(h, { important: !0, className: s.className }, e));
2379
+ }, Mt = ({
1448
2380
  options: e,
1449
- children: t,
2381
+ children: a,
1450
2382
  className: l,
1451
- onValueChange: a
2383
+ onValueChange: c
1452
2384
  }) => {
1453
- const n = P(Z), r = a || (n == null ? void 0 : n.setActiveTab);
2385
+ const s = q(X), t = c || (s == null ? void 0 : s.setActiveTab);
1454
2386
  return /* @__PURE__ */ React.createElement(
1455
- se,
2387
+ Se,
1456
2388
  {
1457
- className: p("tabs-list", l),
2389
+ className: b("tabs-list", l),
1458
2390
  tabs: e,
1459
- onSelect: (s) => {
1460
- r(s);
2391
+ onSelect: (r) => {
2392
+ t(r);
1461
2393
  }
1462
2394
  },
1463
- () => t
2395
+ () => a
1464
2396
  );
1465
- }, Ke = ({
2397
+ }, Tt = ({
1466
2398
  value: e,
1467
- children: t,
2399
+ children: a,
1468
2400
  className: l
1469
2401
  }) => {
1470
- const a = P(Z);
1471
- return (a == null ? void 0 : a.activeTab) === e ? /* @__PURE__ */ React.createElement(E, { className: l }, t) : null;
1472
- }, Mt = {
1473
- Wrapper: Ge,
1474
- List: We,
1475
- Content: Ke
1476
- }, St = ({
2402
+ const c = q(X);
2403
+ return (c == null ? void 0 : c.activeTab) === e ? /* @__PURE__ */ React.createElement(h, { className: l }, a) : null;
2404
+ }, Ea = {
2405
+ Wrapper: St,
2406
+ List: Mt,
2407
+ Content: Tt
2408
+ }, ha = ({
1477
2409
  children: e,
1478
- onClick: t,
2410
+ onClick: a,
1479
2411
  color: l = "blue",
1480
- className: a
1481
- }) => /* @__PURE__ */ React.createElement("button", { onClick: t }, /* @__PURE__ */ React.createElement("div", { color: l, className: p(a) }, e)), Tt = ({
2412
+ className: c
2413
+ }) => /* @__PURE__ */ React.createElement("button", { onClick: a }, /* @__PURE__ */ React.createElement("div", { color: l, className: b(c) }, e)), Ca = ({
1482
2414
  onChange: e,
1483
- defaultValue: t,
2415
+ defaultValue: a,
1484
2416
  children: l
1485
- }) => /* @__PURE__ */ React.createElement(E, { className: "blockbite-ui__text-control-label flex items-center" }, /* @__PURE__ */ React.createElement("span", { className: "outline-b-2 relative block -outline-offset-2 outline-black" }, /* @__PURE__ */ React.createElement(
1486
- B,
2417
+ }) => /* @__PURE__ */ React.createElement(h, { className: "blockbite-ui__text-control-label flex items-center" }, /* @__PURE__ */ React.createElement("span", { className: "outline-b-2 relative block -outline-offset-2 outline-black" }, /* @__PURE__ */ React.createElement(
2418
+ K,
1487
2419
  {
1488
2420
  __next40pxDefaultSize: !0,
1489
2421
  __nextHasNoMarginBottom: !0,
1490
2422
  type: "text",
1491
- value: t,
2423
+ value: a,
1492
2424
  onChange: e
1493
2425
  }
1494
- ), /* @__PURE__ */ React.createElement(Me, { className: "absolute right-1 top-2" })), " ", l), Ht = V(
2426
+ ), /* @__PURE__ */ React.createElement(Ue, { className: "absolute right-1 top-2" })), " ", l), xa = C(
1495
2427
  ({
1496
2428
  className: e,
1497
- options: t,
2429
+ options: a,
1498
2430
  value: l,
1499
- display: a = "label",
1500
- label: n = !1,
1501
- onPressedChange: r
2431
+ display: c = "label",
2432
+ label: s = !1,
2433
+ onPressedChange: t
1502
2434
  }) => {
1503
- const s = (c) => {
1504
- r(c);
2435
+ const r = (n) => {
2436
+ t(n);
1505
2437
  };
1506
- return /* @__PURE__ */ React.createElement(E, { className: p(e) }, /* @__PURE__ */ React.createElement(
1507
- oe,
2438
+ return /* @__PURE__ */ React.createElement(h, { className: b(e) }, /* @__PURE__ */ React.createElement(
2439
+ P,
1508
2440
  {
1509
2441
  __next40pxDefaultSize: !0,
1510
2442
  __nextHasNoMarginBottom: !0,
1511
2443
  isBlock: !0,
1512
2444
  value: l,
1513
- ...n ? { label: n } : {}
2445
+ ...s ? { label: s } : {}
1514
2446
  },
1515
- t.map(
1516
- (c) => a === "icon" ? /* @__PURE__ */ React.createElement(
1517
- ie,
2447
+ a.map(
2448
+ (n) => c === "icon" ? /* @__PURE__ */ React.createElement(
2449
+ O,
1518
2450
  {
1519
- icon: c.icon,
1520
- label: c.label,
1521
- key: `ToggleGroupControlIcon-${c.value}`,
1522
- value: c.value,
1523
- onClick: () => s(c.value)
2451
+ icon: n.icon,
2452
+ label: n.label,
2453
+ key: `ToggleGroupControlIcon-${n.value}`,
2454
+ value: n.value,
2455
+ onClick: () => r(n.value)
1524
2456
  }
1525
2457
  ) : /* @__PURE__ */ React.createElement(
1526
- me,
2458
+ H,
1527
2459
  {
1528
- key: `ToggleGroupControlOption-${c.value}`,
1529
- value: c.value,
1530
- label: c.label,
1531
- onClick: () => s(c.value)
2460
+ key: `ToggleGroupControlOption-${n.value}`,
2461
+ value: n.value,
2462
+ label: n.label,
2463
+ onClick: () => r(n.value)
1532
2464
  }
1533
2465
  )
1534
2466
  )
1535
2467
  ));
1536
2468
  }
1537
- ), Bt = ({
2469
+ ), wa = ({
1538
2470
  label: e,
1539
- className: t,
2471
+ className: a,
1540
2472
  onChange: l,
1541
- checked: a = !1
2473
+ checked: c = !1
1542
2474
  // Default to false if undefined, so it's always controlled
1543
2475
  }) => {
1544
- const [n, r] = g(a);
2476
+ const [s, t] = f(c);
1545
2477
  return R(() => {
1546
- r(a);
1547
- }, [a]), /* @__PURE__ */ React.createElement(E, { className: p(t, "flex items-center gap-2") }, /* @__PURE__ */ React.createElement(
1548
- ue,
2478
+ t(c);
2479
+ }, [c]), /* @__PURE__ */ React.createElement(h, { className: b(a, "flex items-center gap-2") }, /* @__PURE__ */ React.createElement(
2480
+ Me,
1549
2481
  {
1550
- checked: n,
2482
+ checked: s,
1551
2483
  label: e,
1552
- onChange: (s) => {
1553
- r(s), l && l(s);
2484
+ onChange: (r) => {
2485
+ t(r), l && l(r);
1554
2486
  }
1555
2487
  }
1556
2488
  ));
1557
2489
  };
1558
2490
  export {
1559
- at as AutocompleteDropdown,
1560
- ve as Badge,
1561
- lt as BitePreview,
1562
- nt as Button,
1563
- xe as ButtonToggle,
1564
- we as ButtonToggleGroup,
1565
- rt as Chapter,
1566
- ct as ChapterDivider,
1567
- st as Checkbox,
1568
- ot as DataItemList,
1569
- it as DisappearingMessage,
1570
- Pe as DropdownPicker,
1571
- mt as EmptyState,
1572
- ut as FloatingPanel,
1573
- dt as FocalPointControl,
1574
- v as Icon,
1575
- ft as LinkPicker,
1576
- pt as MediaPicker,
1577
- gt as MetricsControl,
1578
- Rt as Modal,
1579
- Et as ModalClose,
1580
- je as ModalContent,
1581
- ze as ModalFooter,
1582
- Oe as ModalHeader,
1583
- De as ModalTrigger,
1584
- ht as NewWindowPortal,
1585
- Ct as Notice,
1586
- bt as PasswordInput,
1587
- $e as Popover,
1588
- xt as ProjectsNavigation,
1589
- Ie as RangeSlider,
1590
- wt as ResponsiveImage,
1591
- vt as ResponsiveVideo,
1592
- Nt as ScrollList,
1593
- yt as SelectControlWrapper,
1594
- kt as SingleBlockTypeAppender,
1595
- _t as SlideIn,
1596
- Lt as Spinner,
1597
- Mt as Tabs,
1598
- Ke as TabsContent,
1599
- We as TabsList,
1600
- Ge as TabsWrapper,
1601
- St as Tag,
1602
- F as TextControl,
1603
- Tt as TextControlLabel,
1604
- Ht as ToggleGroup,
1605
- Bt as ToggleSwitch,
1606
- E as Wrap,
1607
- G as useModalContext
2491
+ jt as AutocompleteDropdown,
2492
+ Ie as Badge,
2493
+ Vt as BitePreview,
2494
+ It as Button,
2495
+ je as ButtonToggle,
2496
+ Ve as ButtonToggleGroup,
2497
+ At as Chapter,
2498
+ Ft as ChapterDivider,
2499
+ Zt as Checkbox,
2500
+ Dt as DataItemList,
2501
+ Gt as DisappearingMessage,
2502
+ Je as DropdownPicker,
2503
+ Ut as EmptyState,
2504
+ Wt as FloatingPanel,
2505
+ Kt as FocalPointControl,
2506
+ _ as Icon,
2507
+ qt as LinkPicker,
2508
+ Xt as MediaPicker,
2509
+ Yt as MetricsControl,
2510
+ Jt as Modal,
2511
+ Qt as ModalClose,
2512
+ nt as ModalContent,
2513
+ lt as ModalFooter,
2514
+ at as ModalHeader,
2515
+ ct as ModalTrigger,
2516
+ ea as NewWindowPortal,
2517
+ ta as Notice,
2518
+ aa as PasswordInput,
2519
+ et as Popover,
2520
+ ma as ProjectsNavigation,
2521
+ tt as RangeSlider,
2522
+ da as ResponsiveImage,
2523
+ pa as ResponsiveVideo,
2524
+ fa as ScrollList,
2525
+ ba as SelectControlWrapper,
2526
+ ga as SingleBlockTypeAppender,
2527
+ va as SlideIn,
2528
+ Ra as Spinner,
2529
+ Ea as Tabs,
2530
+ Tt as TabsContent,
2531
+ Mt as TabsList,
2532
+ St as TabsWrapper,
2533
+ ha as Tag,
2534
+ ue as TextControl,
2535
+ Ca as TextControlLabel,
2536
+ xa as ToggleGroup,
2537
+ wa as ToggleSwitch,
2538
+ h as Wrap,
2539
+ de as useModalContext
1608
2540
  };
1609
2541
  //# sourceMappingURL=index.js.map