@redapollos/storm-form 0.2.1 → 0.2.2

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.
@@ -1,18 +1,28 @@
1
1
  import { jsxs as x, Fragment as H, jsx as i } from "react/jsx-runtime";
2
2
  import * as B from "react";
3
- import Ne, { useState as v, useEffect as Y, createContext as dt, useContext as ht, forwardRef as mt, useImperativeHandle as gt, createElement as E } from "react";
4
- import { Form as T, Select as K, Checkbox as pe, Space as ft, Radio as X, InputNumber as pt, TimePicker as yt, DatePicker as bt, Switch as St, Input as V, notification as Ee, Upload as wt, Tabs as vt, Row as Ve, Col as Q, Button as G, Table as ae, Tag as R, Popconfirm as Be, Drawer as Ue } from "antd";
5
- import W from "axios";
3
+ import Ne, { useState as v, useEffect as Y, createContext as dt, useContext as ht, forwardRef as mt, useImperativeHandle as gt, createElement as A } from "react";
4
+ import { Form as _, Select as K, Checkbox as pe, Space as ft, Radio as X, InputNumber as pt, TimePicker as yt, DatePicker as bt, Switch as St, Input as V, notification as Ae, Upload as wt, Tabs as vt, Row as Ve, Col as Q, Button as W, Table as ae, Tag as R, Popconfirm as Be, Drawer as Ue } from "antd";
5
+ import G from "axios";
6
6
  import de from "dayjs";
7
- W.defaults.baseURL = void 0;
8
- W.defaults.timeout = 1e3 * 60 * 10;
9
- const k = W.create({
7
+ const xt = {}, _t = "https://storm-api.azurewebsites.net";
8
+ function Tt() {
9
+ return (typeof globalThis < "u" ? globalThis.process?.env : void 0)?.STORM_FORM_API_URL;
10
+ }
11
+ function It() {
12
+ return xt?.VITE_WEBAPI_URL;
13
+ }
14
+ function Ct() {
15
+ return Tt() || It() || _t;
16
+ }
17
+ G.defaults.baseURL = Ct();
18
+ G.defaults.timeout = 1e3 * 60 * 10;
19
+ const k = G.create({
10
20
  responseType: "json"
11
21
  });
12
22
  k.getData = (e, t) => {
13
23
  const n = { headers: oe(t) };
14
24
  return new Promise((r, a) => {
15
- W.get(e, n).then((s) => {
25
+ G.get(e, n).then((s) => {
16
26
  r(s.data);
17
27
  }).catch((s) => {
18
28
  a(se(s));
@@ -23,7 +33,7 @@ k.upsertData = (e, t, n, r) => e == null || e === 0 || e === "" ? k.postData(t,
23
33
  k.postData = (e, t, n) => {
24
34
  const r = { headers: oe(n) };
25
35
  return new Promise((a, s) => {
26
- W.post(e, t, r).then((l) => {
36
+ G.post(e, t, r).then((l) => {
27
37
  a(l.data);
28
38
  }).catch((l) => {
29
39
  s(se(l));
@@ -33,7 +43,7 @@ k.postData = (e, t, n) => {
33
43
  k.putData = (e, t, n) => {
34
44
  const r = { headers: oe(n) };
35
45
  return new Promise((a, s) => {
36
- W.put(e, t, r).then((l) => {
46
+ G.put(e, t, r).then((l) => {
37
47
  a(l.data);
38
48
  }).catch((l) => {
39
49
  s(se(l));
@@ -43,7 +53,7 @@ k.putData = (e, t, n) => {
43
53
  k.deleteData = (e, t) => {
44
54
  const n = { headers: oe(!0) };
45
55
  return t && (n.data = { ...t }), new Promise((r, a) => {
46
- W.delete(e, n).then((s) => {
56
+ G.delete(e, n).then((s) => {
47
57
  r(s.data);
48
58
  }).catch((s) => {
49
59
  a(se(s));
@@ -57,7 +67,7 @@ k.deleteMultipleData = (e, t) => {
57
67
  data: { ids: t }
58
68
  };
59
69
  return new Promise((r, a) => {
60
- W.delete(e, n).then((s) => {
70
+ G.delete(e, n).then((s) => {
61
71
  r(s.data);
62
72
  }).catch((s) => {
63
73
  a(se(s));
@@ -81,13 +91,13 @@ function oe(e) {
81
91
  "Content-Type": "application/json"
82
92
  };
83
93
  }
84
- const xt = {
85
- getSystemList: Tt
94
+ const kt = {
95
+ getSystemList: Nt
86
96
  };
87
- function Tt(e) {
97
+ function Nt(e) {
88
98
  return k.getData(`/api/system/list/${e}`, !0);
89
99
  }
90
- const It = ({
100
+ const Rt = ({
91
101
  slug: e,
92
102
  value: t,
93
103
  label: n,
@@ -98,27 +108,27 @@ const It = ({
98
108
  errors: d,
99
109
  placeholder: g
100
110
  }) => {
101
- const [h, u] = v([]), [f, y] = v(!1);
111
+ const [h, u] = v([]), [f, S] = v(!1);
102
112
  if (!e)
103
113
  throw Error("ListInput property: slug required");
104
114
  return !t && s && s[e] && (t = s[e]), !l && d && d[e] && (l = d[e]), Y(() => {
105
115
  if (r.listSource === "static list")
106
- u(r.listOptions), y(!0);
116
+ u(r.listOptions), S(!0);
107
117
  else if (r.listSource.indexOf("list_") > -1) {
108
- let w = r.listSource.split("_")[1];
109
- xt.getSystemList(w).then((z) => {
110
- let N = z.items.map((c) => ({ label: c.label, value: c.value }));
111
- u(N), y(!0);
118
+ let p = r.listSource.split("_")[1];
119
+ kt.getSystemList(p).then((M) => {
120
+ let N = M.items.map((c) => ({ label: c.label, value: c.value }));
121
+ u(N), S(!0);
112
122
  }).catch(() => {
113
123
  });
114
124
  }
115
125
  }, [r.listSource]), /* @__PURE__ */ x(H, { children: [
116
- r.fieldStyle === "select" && /* @__PURE__ */ i(T.Item, { label: n, name: e, initialValue: t, rules: [{ required: a, message: "Required" }], children: /* @__PURE__ */ x(K, { showSearch: !0, optionFilterProp: "children", filterOption: (w, z) => z.children && z.children.toLowerCase().indexOf(w.toLowerCase()) >= 0, children: [
126
+ r.fieldStyle === "select" && /* @__PURE__ */ i(_.Item, { label: n, name: e, initialValue: t, rules: [{ required: a, message: "Required" }], children: /* @__PURE__ */ x(K, { showSearch: !0, optionFilterProp: "children", filterOption: (p, M) => M.children && M.children.toLowerCase().indexOf(p.toLowerCase()) >= 0, children: [
117
127
  /* @__PURE__ */ i(K.Option, { value: "", children: g }),
118
- h.map((w, z) => /* @__PURE__ */ i(K.Option, { children: w.label }, w.value))
128
+ h.map((p, M) => /* @__PURE__ */ i(K.Option, { children: p.label }, p.value))
119
129
  ] }) }),
120
- f && r.fieldStyle === "checkboxes" && /* @__PURE__ */ i(T.Item, { label: n, name: e, initialValue: t, rules: [{ required: a, message: "Required" }], children: /* @__PURE__ */ i(pe.Group, { children: /* @__PURE__ */ i(ft, { direction: "vertical", children: h.map((w, z) => /* @__PURE__ */ i(pe, { value: w.value, children: w.label }, w.value)) }) }) }),
121
- f && r.fieldStyle === "radios" && /* @__PURE__ */ i(T.Item, { label: n, name: e, initialValue: t, className: "column-vertical", rules: [{ required: a, message: "Required" }], children: /* @__PURE__ */ i(X.Group, { options: h }) })
130
+ f && r.fieldStyle === "checkboxes" && /* @__PURE__ */ i(_.Item, { label: n, name: e, initialValue: t, rules: [{ required: a, message: "Required" }], children: /* @__PURE__ */ i(pe.Group, { children: /* @__PURE__ */ i(ft, { direction: "vertical", children: h.map((p, M) => /* @__PURE__ */ i(pe, { value: p.value, children: p.label }, p.value)) }) }) }),
131
+ f && r.fieldStyle === "radios" && /* @__PURE__ */ i(_.Item, { label: n, name: e, initialValue: t, className: "column-vertical", rules: [{ required: a, message: "Required" }], children: /* @__PURE__ */ i(X.Group, { options: h }) })
122
132
  ] });
123
133
  }, Re = (e) => {
124
134
  let {
@@ -135,7 +145,7 @@ const It = ({
135
145
  if (!t)
136
146
  throw Error("NumberInput property: slug required");
137
147
  return /* @__PURE__ */ i(
138
- T.Item,
148
+ _.Item,
139
149
  {
140
150
  validateStatus: d ? "error" : "",
141
151
  name: t,
@@ -173,9 +183,9 @@ function ge(e) {
173
183
  } = e;
174
184
  if (!t)
175
185
  throw Error("DatePickerInput property: slug required");
176
- return /* @__PURE__ */ x(T.Item, { label: a, children: [
177
- r === 9 && /* @__PURE__ */ i(T.Item, { name: t, initialValue: n, children: /* @__PURE__ */ i(yt, { name: t, use12Hours: !0, rules: [{ required: o.isRequired, message: "Required" }] }) }),
178
- r !== 9 && /* @__PURE__ */ i(T.Item, { name: t, initialValue: n, help: Intl.DateTimeFormat().resolvedOptions().timeZone, rules: [{ required: o.isRequired, message: "Required" }], children: /* @__PURE__ */ i(
186
+ return /* @__PURE__ */ x(_.Item, { label: a, children: [
187
+ r === 9 && /* @__PURE__ */ i(_.Item, { name: t, initialValue: n, children: /* @__PURE__ */ i(yt, { name: t, use12Hours: !0, rules: [{ required: o.isRequired, message: "Required" }] }) }),
188
+ r !== 9 && /* @__PURE__ */ i(_.Item, { name: t, initialValue: n, help: Intl.DateTimeFormat().resolvedOptions().timeZone, rules: [{ required: o.isRequired, message: "Required" }], children: /* @__PURE__ */ i(
179
189
  bt,
180
190
  {
181
191
  name: t,
@@ -189,7 +199,7 @@ function ge(e) {
189
199
  ) })
190
200
  ] });
191
201
  }
192
- const _t = (e) => {
202
+ const Mt = (e) => {
193
203
  let {
194
204
  slug: t,
195
205
  value: n,
@@ -204,21 +214,21 @@ const _t = (e) => {
204
214
  { label: "Yes", value: !0 },
205
215
  { label: "No", value: !1 }
206
216
  ];
207
- return /* @__PURE__ */ x(T.Item, { validateStatus: s ? "error" : "", name: t, help: s || "", label: r, className: l, initialValue: n, children: [
208
- a.fieldStyle === "switch" && /* @__PURE__ */ i(T.Item, { name: t, initialValue: n, children: /* @__PURE__ */ i(St, {}) }),
209
- a.fieldStyle === "radio" && /* @__PURE__ */ i(T.Item, { name: t, initialValue: n, rules: [{ required: o.isRequired, message: "Required" }], children: /* @__PURE__ */ i(X.Group, { options: d }) })
217
+ return /* @__PURE__ */ x(_.Item, { validateStatus: s ? "error" : "", name: t, help: s || "", label: r, className: l, initialValue: n, children: [
218
+ a.fieldStyle === "switch" && /* @__PURE__ */ i(_.Item, { name: t, initialValue: n, children: /* @__PURE__ */ i(St, {}) }),
219
+ a.fieldStyle === "radio" && /* @__PURE__ */ i(_.Item, { name: t, initialValue: n, rules: [{ required: o.isRequired, message: "Required" }], children: /* @__PURE__ */ i(X.Group, { options: d }) })
210
220
  ] });
211
221
  };
212
- function Ct(e) {
222
+ function zt(e) {
213
223
  let { slug: t, value: n, label: r, debug: a, className: s } = e;
214
- return a ? /* @__PURE__ */ i(T.Item, { name: t, label: r, className: s, children: /* @__PURE__ */ i(V, { value: n }) }) : /* @__PURE__ */ i(T.Item, { label: r, className: s, children: n });
224
+ return a ? /* @__PURE__ */ i(_.Item, { name: t, label: r, className: s, children: /* @__PURE__ */ i(V, { value: n }) }) : /* @__PURE__ */ i(_.Item, { label: r, className: s, children: n });
215
225
  }
216
- const kt = (e) => {
226
+ const qt = (e) => {
217
227
  let { slug: t, value: n, label: r, className: a } = e;
218
228
  if (!t)
219
229
  throw Error("OptInInput property: slug required");
220
230
  return /* @__PURE__ */ i(
221
- T.Item,
231
+ _.Item,
222
232
  {
223
233
  name: t,
224
234
  initialValue: n,
@@ -246,11 +256,11 @@ function Ye(e) {
246
256
  } else for (n in e) e[n] && (r && (r += " "), r += n);
247
257
  return r;
248
258
  }
249
- function Nt() {
259
+ function $t() {
250
260
  for (var e, t, n = 0, r = "", a = arguments.length; n < a; n++) (e = arguments[n]) && (t = Ye(e)) && (r && (r += " "), r += t);
251
261
  return r;
252
262
  }
253
- const Rt = {
263
+ const Ot = {
254
264
  aliceblue: "9ehhb",
255
265
  antiquewhite: "9sgk7",
256
266
  aqua: "1ekf",
@@ -406,7 +416,7 @@ function fe(e, t) {
406
416
  r[a] = t(r[a] || 0, n[a] || "", a);
407
417
  return n[3] ? r[3] = n[3].includes("%") ? r[3] / 100 : r[3] : r[3] = 1, r;
408
418
  }
409
- const ze = (e, t, n) => n === 0 ? e : e / 100;
419
+ const Me = (e, t, n) => n === 0 ? e : e / 100;
410
420
  function re(e, t) {
411
421
  const n = t || 255;
412
422
  return e > n ? n : e < 0 ? 0 : e;
@@ -460,7 +470,7 @@ class ee {
460
470
  else if (a("hsv") || a("hsb"))
461
471
  this.fromHsvString(r);
462
472
  else {
463
- const s = Rt[r.toLowerCase()];
473
+ const s = Ot[r.toLowerCase()];
464
474
  s && this.fromHexString(
465
475
  // Convert 36 hex to 16 hex
466
476
  parseInt(s, 36).toString(16).padStart(6, "0")
@@ -715,15 +725,15 @@ class ee {
715
725
  }) {
716
726
  const s = (t % 360 + 360) % 360;
717
727
  if (this._h = s, this._hsl_s = n, this._l = r, this.a = typeof a == "number" ? a : 1, n <= 0) {
718
- const w = $(r * 255);
719
- this.r = w, this.g = w, this.b = w;
728
+ const p = $(r * 255);
729
+ this.r = p, this.g = p, this.b = p;
720
730
  return;
721
731
  }
722
732
  let l = 0, d = 0, g = 0;
723
733
  const h = s / 60, u = (1 - Math.abs(2 * r - 1)) * n, f = u * (1 - Math.abs(h % 2 - 1));
724
734
  h >= 0 && h < 1 ? (l = u, d = f) : h >= 1 && h < 2 ? (l = f, d = u) : h >= 2 && h < 3 ? (d = u, g = f) : h >= 3 && h < 4 ? (d = f, g = u) : h >= 4 && h < 5 ? (l = f, g = u) : h >= 5 && h < 6 && (l = u, g = f);
725
- const y = r - u / 2;
726
- this.r = $((l + y) * 255), this.g = $((d + y) * 255), this.b = $((g + y) * 255);
735
+ const S = r - u / 2;
736
+ this.r = $((l + S) * 255), this.g = $((d + S) * 255), this.b = $((g + S) * 255);
727
737
  }
728
738
  fromHsv({
729
739
  h: t,
@@ -736,22 +746,22 @@ class ee {
736
746
  const l = $(r * 255);
737
747
  if (this.r = l, this.g = l, this.b = l, n <= 0)
738
748
  return;
739
- const d = s / 60, g = Math.floor(d), h = d - g, u = $(r * (1 - n) * 255), f = $(r * (1 - n * h) * 255), y = $(r * (1 - n * (1 - h)) * 255);
749
+ const d = s / 60, g = Math.floor(d), h = d - g, u = $(r * (1 - n) * 255), f = $(r * (1 - n * h) * 255), S = $(r * (1 - n * (1 - h)) * 255);
740
750
  switch (g) {
741
751
  case 0:
742
- this.g = y, this.b = u;
752
+ this.g = S, this.b = u;
743
753
  break;
744
754
  case 1:
745
755
  this.r = f, this.b = u;
746
756
  break;
747
757
  case 2:
748
- this.r = u, this.b = y;
758
+ this.r = u, this.b = S;
749
759
  break;
750
760
  case 3:
751
761
  this.r = u, this.g = f;
752
762
  break;
753
763
  case 4:
754
- this.r = y, this.g = u;
764
+ this.r = S, this.g = u;
755
765
  break;
756
766
  default:
757
767
  this.g = u, this.b = f;
@@ -759,7 +769,7 @@ class ee {
759
769
  }
760
770
  }
761
771
  fromHsvString(t) {
762
- const n = fe(t, ze);
772
+ const n = fe(t, Me);
763
773
  this.fromHsv({
764
774
  h: n[0],
765
775
  s: n[1],
@@ -768,7 +778,7 @@ class ee {
768
778
  });
769
779
  }
770
780
  fromHslString(t) {
771
- const n = fe(t, ze);
781
+ const n = fe(t, Me);
772
782
  this.fromHsl({
773
783
  h: n[0],
774
784
  s: n[1],
@@ -784,7 +794,7 @@ class ee {
784
794
  this.r = n[0], this.g = n[1], this.b = n[2], this.a = n[3];
785
795
  }
786
796
  }
787
- const ue = 2, Me = 0.16, zt = 0.05, Mt = 0.05, qt = 0.15, Je = 5, Ge = 4, $t = [{
797
+ const ue = 2, ze = 0.16, Dt = 0.05, Ft = 0.05, Ht = 0.15, Je = 5, We = 4, Lt = [{
788
798
  index: 7,
789
799
  amount: 15
790
800
  }, {
@@ -823,13 +833,13 @@ function $e(e, t, n) {
823
833
  if (e.h === 0 && e.s === 0)
824
834
  return e.s;
825
835
  let r;
826
- return n ? r = e.s - Me * t : t === Ge ? r = e.s + Me : r = e.s + zt * t, r > 1 && (r = 1), n && t === Je && r > 0.1 && (r = 0.1), r < 0.06 && (r = 0.06), Math.round(r * 100) / 100;
836
+ return n ? r = e.s - ze * t : t === We ? r = e.s + ze : r = e.s + Dt * t, r > 1 && (r = 1), n && t === Je && r > 0.1 && (r = 0.1), r < 0.06 && (r = 0.06), Math.round(r * 100) / 100;
827
837
  }
828
838
  function Oe(e, t, n) {
829
839
  let r;
830
- return n ? r = e.v + Mt * t : r = e.v - qt * t, r = Math.max(0, Math.min(1, r)), Math.round(r * 100) / 100;
840
+ return n ? r = e.v + Ft * t : r = e.v - Ht * t, r = Math.max(0, Math.min(1, r)), Math.round(r * 100) / 100;
831
841
  }
832
- function Ot(e, t = {}) {
842
+ function jt(e, t = {}) {
833
843
  const n = [], r = new ee(e), a = r.toHsv();
834
844
  for (let s = Je; s > 0; s -= 1) {
835
845
  const l = new ee({
@@ -840,7 +850,7 @@ function Ot(e, t = {}) {
840
850
  n.push(l);
841
851
  }
842
852
  n.push(r);
843
- for (let s = 1; s <= Ge; s += 1) {
853
+ for (let s = 1; s <= We; s += 1) {
844
854
  const l = new ee({
845
855
  h: qe(a, s),
846
856
  s: $e(a, s),
@@ -848,17 +858,17 @@ function Ot(e, t = {}) {
848
858
  });
849
859
  n.push(l);
850
860
  }
851
- return t.theme === "dark" ? $t.map(({
861
+ return t.theme === "dark" ? Lt.map(({
852
862
  index: s,
853
863
  amount: l
854
864
  }) => new ee(t.backgroundColor || "#141414").mix(n[s], l).toHexString()) : n.map((s) => s.toHexString());
855
865
  }
856
866
  const ye = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
857
867
  ye.primary = ye[5];
858
- function Dt() {
868
+ function Pt() {
859
869
  return !!(typeof window < "u" && window.document && window.document.createElement);
860
870
  }
861
- function Ft(e, t) {
871
+ function Et(e, t) {
862
872
  if (!e)
863
873
  return !1;
864
874
  if (e.contains)
@@ -871,29 +881,29 @@ function Ft(e, t) {
871
881
  }
872
882
  return !1;
873
883
  }
874
- const De = "data-rc-order", Fe = "data-rc-priority", Ht = "rc-util-key", be = /* @__PURE__ */ new Map();
875
- function We({
884
+ const De = "data-rc-order", Fe = "data-rc-priority", At = "rc-util-key", be = /* @__PURE__ */ new Map();
885
+ function Ge({
876
886
  mark: e
877
887
  } = {}) {
878
- return e ? e.startsWith("data-") ? e : `data-${e}` : Ht;
888
+ return e ? e.startsWith("data-") ? e : `data-${e}` : At;
879
889
  }
880
890
  function Ce(e) {
881
891
  return e.attachTo ? e.attachTo : document.querySelector("head") || document.body;
882
892
  }
883
- function jt(e) {
893
+ function Vt(e) {
884
894
  return e === "queue" ? "prependQueue" : e ? "prepend" : "append";
885
895
  }
886
896
  function ke(e) {
887
897
  return Array.from((be.get(e) || e).children).filter((t) => t.tagName === "STYLE");
888
898
  }
889
899
  function Ze(e, t = {}) {
890
- if (!Dt())
900
+ if (!Pt())
891
901
  return null;
892
902
  const {
893
903
  csp: n,
894
904
  prepend: r,
895
905
  priority: a = 0
896
- } = t, s = jt(r), l = s === "prependQueue", d = document.createElement("style");
906
+ } = t, s = Vt(r), l = s === "prependQueue", d = document.createElement("style");
897
907
  d.setAttribute(De, s), l && a && d.setAttribute(Fe, `${a}`), n?.nonce && (d.nonce = n?.nonce), d.innerHTML = e;
898
908
  const g = Ce(t), {
899
909
  firstChild: h
@@ -903,8 +913,8 @@ function Ze(e, t = {}) {
903
913
  const u = (t.styles || ke(g)).filter((f) => {
904
914
  if (!["prepend", "prependQueue"].includes(f.getAttribute(De)))
905
915
  return !1;
906
- const y = Number(f.getAttribute(Fe) || 0);
907
- return a >= y;
916
+ const S = Number(f.getAttribute(Fe) || 0);
917
+ return a >= S;
908
918
  });
909
919
  if (u.length)
910
920
  return g.insertBefore(d, u[u.length - 1].nextSibling), d;
@@ -914,96 +924,96 @@ function Ze(e, t = {}) {
914
924
  g.appendChild(d);
915
925
  return d;
916
926
  }
917
- function Lt(e, t = {}) {
927
+ function Bt(e, t = {}) {
918
928
  let {
919
929
  styles: n
920
930
  } = t;
921
- return n ||= ke(Ce(t)), n.find((r) => r.getAttribute(We(t)) === e);
931
+ return n ||= ke(Ce(t)), n.find((r) => r.getAttribute(Ge(t)) === e);
922
932
  }
923
- function Pt(e, t) {
933
+ function Ut(e, t) {
924
934
  const n = be.get(e);
925
- if (!n || !Ft(document, n)) {
935
+ if (!n || !Et(document, n)) {
926
936
  const r = Ze("", t), {
927
937
  parentNode: a
928
938
  } = r;
929
939
  be.set(e, a), e.removeChild(r);
930
940
  }
931
941
  }
932
- function At(e, t, n = {}) {
942
+ function Kt(e, t, n = {}) {
933
943
  const r = Ce(n), a = ke(r), s = {
934
944
  ...n,
935
945
  styles: a
936
946
  };
937
- Pt(r, s);
938
- const l = Lt(t, s);
947
+ Ut(r, s);
948
+ const l = Bt(t, s);
939
949
  if (l)
940
950
  return s.csp?.nonce && l.nonce !== s.csp?.nonce && (l.nonce = s.csp?.nonce), l.innerHTML !== e && (l.innerHTML = e), l;
941
951
  const d = Ze(e, s);
942
- return d.setAttribute(We(s), t), d;
952
+ return d.setAttribute(Ge(s), t), d;
943
953
  }
944
954
  function Qe(e) {
945
955
  return e?.getRootNode?.();
946
956
  }
947
- function Et(e) {
957
+ function Yt(e) {
948
958
  return Qe(e) instanceof ShadowRoot;
949
959
  }
950
- function Vt(e) {
951
- return Et(e) ? Qe(e) : null;
960
+ function Jt(e) {
961
+ return Yt(e) ? Qe(e) : null;
952
962
  }
953
963
  let Se = {};
954
- const Bt = (e) => {
964
+ const Wt = (e) => {
955
965
  };
956
- function Ut(e, t) {
966
+ function Gt(e, t) {
957
967
  }
958
- function Kt(e, t) {
968
+ function Zt(e, t) {
959
969
  }
960
- function Yt() {
970
+ function Qt() {
961
971
  Se = {};
962
972
  }
963
973
  function Xe(e, t, n) {
964
974
  !t && !Se[n] && (e(!1, n), Se[n] = !0);
965
975
  }
966
976
  function he(e, t) {
967
- Xe(Ut, e, t);
977
+ Xe(Gt, e, t);
968
978
  }
969
- function Jt(e, t) {
970
- Xe(Kt, e, t);
979
+ function Xt(e, t) {
980
+ Xe(Zt, e, t);
971
981
  }
972
- he.preMessage = Bt;
973
- he.resetWarned = Yt;
974
- he.noteOnce = Jt;
975
- function Gt(e) {
982
+ he.preMessage = Wt;
983
+ he.resetWarned = Qt;
984
+ he.noteOnce = Xt;
985
+ function en(e) {
976
986
  return e.replace(/-(.)/g, (t, n) => n.toUpperCase());
977
987
  }
978
- function Wt(e, t) {
988
+ function tn(e, t) {
979
989
  he(e, `[@ant-design/icons] ${t}`);
980
990
  }
981
991
  function He(e) {
982
992
  return typeof e == "object" && typeof e.name == "string" && typeof e.theme == "string" && (typeof e.icon == "object" || typeof e.icon == "function");
983
993
  }
984
- function je(e = {}) {
994
+ function Le(e = {}) {
985
995
  return Object.keys(e).reduce((t, n) => {
986
996
  const r = e[n];
987
- return n === "class" ? (t.className = r, delete t.class) : (delete t[n], t[Gt(n)] = r), t;
997
+ return n === "class" ? (t.className = r, delete t.class) : (delete t[n], t[en(n)] = r), t;
988
998
  }, {});
989
999
  }
990
1000
  function we(e, t, n) {
991
1001
  return n ? /* @__PURE__ */ Ne.createElement(e.tag, {
992
1002
  key: t,
993
- ...je(e.attrs),
1003
+ ...Le(e.attrs),
994
1004
  ...n
995
1005
  }, (e.children || []).map((r, a) => we(r, `${t}-${e.tag}-${a}`))) : /* @__PURE__ */ Ne.createElement(e.tag, {
996
1006
  key: t,
997
- ...je(e.attrs)
1007
+ ...Le(e.attrs)
998
1008
  }, (e.children || []).map((r, a) => we(r, `${t}-${e.tag}-${a}`)));
999
1009
  }
1000
1010
  function et(e) {
1001
- return Ot(e)[0];
1011
+ return jt(e)[0];
1002
1012
  }
1003
1013
  function tt(e) {
1004
1014
  return e ? Array.isArray(e) ? e : [e] : [];
1005
1015
  }
1006
- const Zt = `
1016
+ const nn = `
1007
1017
  .anticon {
1008
1018
  display: inline-flex;
1009
1019
  align-items: center;
@@ -1059,18 +1069,18 @@ const Zt = `
1059
1069
  transform: rotate(360deg);
1060
1070
  }
1061
1071
  }
1062
- `, Qt = (e) => {
1072
+ `, rn = (e) => {
1063
1073
  const {
1064
1074
  csp: t,
1065
1075
  prefixCls: n,
1066
1076
  layer: r
1067
1077
  } = ht(Ke);
1068
- let a = Zt;
1078
+ let a = nn;
1069
1079
  n && (a = a.replace(/anticon/g, n)), r && (a = `@layer ${r} {
1070
1080
  ${a}
1071
1081
  }`), Y(() => {
1072
- const s = e.current, l = Vt(s);
1073
- At(a, "@ant-design-icons", {
1082
+ const s = e.current, l = Jt(s);
1083
+ Kt(a, "@ant-design-icons", {
1074
1084
  prepend: !r,
1075
1085
  csp: t,
1076
1086
  attachTo: l
@@ -1081,13 +1091,13 @@ ${a}
1081
1091
  secondaryColor: "#E6E6E6",
1082
1092
  calculated: !1
1083
1093
  };
1084
- function Xt({
1094
+ function an({
1085
1095
  primaryColor: e,
1086
1096
  secondaryColor: t
1087
1097
  }) {
1088
1098
  ie.primaryColor = e, ie.secondaryColor = t || et(e), ie.calculated = !!t;
1089
1099
  }
1090
- function en() {
1100
+ function sn() {
1091
1101
  return {
1092
1102
  ...ie
1093
1103
  };
@@ -1106,7 +1116,7 @@ const te = (e) => {
1106
1116
  if (s && (h = {
1107
1117
  primaryColor: s,
1108
1118
  secondaryColor: l || et(s)
1109
- }), Qt(g), Wt(He(t), `icon should be icon definiton, but got ${t}`), !He(t))
1119
+ }), rn(g), tn(He(t), `icon should be icon definiton, but got ${t}`), !He(t))
1110
1120
  return null;
1111
1121
  let u = t;
1112
1122
  return u && typeof u.icon == "function" && (u = {
@@ -1126,8 +1136,8 @@ const te = (e) => {
1126
1136
  });
1127
1137
  };
1128
1138
  te.displayName = "IconReact";
1129
- te.getTwoToneColors = en;
1130
- te.setTwoToneColors = Xt;
1139
+ te.getTwoToneColors = sn;
1140
+ te.setTwoToneColors = an;
1131
1141
  function nt(e) {
1132
1142
  const [t, n] = tt(e);
1133
1143
  return te.setTwoToneColors({
@@ -1135,7 +1145,7 @@ function nt(e) {
1135
1145
  secondaryColor: n
1136
1146
  });
1137
1147
  }
1138
- function tn() {
1148
+ function on() {
1139
1149
  const e = te.getTwoToneColors();
1140
1150
  return e.calculated ? [e.primaryColor, e.secondaryColor] : e.primaryColor;
1141
1151
  }
@@ -1166,13 +1176,13 @@ const le = /* @__PURE__ */ B.forwardRef((e, t) => {
1166
1176
  } = e, {
1167
1177
  prefixCls: u = "anticon",
1168
1178
  rootClassName: f
1169
- } = B.useContext(Ke), y = Nt(f, u, {
1179
+ } = B.useContext(Ke), S = $t(f, u, {
1170
1180
  [`${u}-${r.name}`]: !!r.name,
1171
1181
  [`${u}-spin`]: !!a || r.name === "loading"
1172
1182
  }, n);
1173
- let w = l;
1174
- w === void 0 && d && (w = -1);
1175
- const z = s ? {
1183
+ let p = l;
1184
+ p === void 0 && d && (p = -1);
1185
+ const M = s ? {
1176
1186
  msTransform: `rotate(${s}deg)`,
1177
1187
  transform: `rotate(${s}deg)`
1178
1188
  } : void 0, [N, c] = tt(g);
@@ -1181,19 +1191,19 @@ const le = /* @__PURE__ */ B.forwardRef((e, t) => {
1181
1191
  "aria-label": r.name
1182
1192
  }, h, {
1183
1193
  ref: t,
1184
- tabIndex: w,
1194
+ tabIndex: p,
1185
1195
  onClick: d,
1186
- className: y
1196
+ className: S
1187
1197
  }), /* @__PURE__ */ B.createElement(te, {
1188
1198
  icon: r,
1189
1199
  primaryColor: N,
1190
1200
  secondaryColor: c,
1191
- style: z
1201
+ style: M
1192
1202
  }));
1193
1203
  });
1194
- le.getTwoToneColor = tn;
1204
+ le.getTwoToneColor = on;
1195
1205
  le.setTwoToneColor = nt;
1196
- var nn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z" } }] }, name: "delete", theme: "outlined" };
1206
+ var ln = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z" } }] }, name: "delete", theme: "outlined" };
1197
1207
  function xe() {
1198
1208
  return xe = Object.assign ? Object.assign.bind() : function(e) {
1199
1209
  for (var t = 1; t < arguments.length; t++) {
@@ -1204,135 +1214,135 @@ function xe() {
1204
1214
  return e;
1205
1215
  }, xe.apply(this, arguments);
1206
1216
  }
1207
- const rn = (e, t) => /* @__PURE__ */ B.createElement(le, xe({}, e, {
1217
+ const cn = (e, t) => /* @__PURE__ */ B.createElement(le, xe({}, e, {
1208
1218
  ref: t,
1209
- icon: nn
1210
- })), rt = /* @__PURE__ */ B.forwardRef(rn);
1211
- var an = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z" } }] }, name: "file-add", theme: "outlined" };
1212
- function Te() {
1213
- return Te = Object.assign ? Object.assign.bind() : function(e) {
1219
+ icon: ln
1220
+ })), rt = /* @__PURE__ */ B.forwardRef(cn);
1221
+ var un = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM544 472c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v108H372c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h108v108c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h108c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V472z" } }] }, name: "file-add", theme: "outlined" };
1222
+ function _e() {
1223
+ return _e = Object.assign ? Object.assign.bind() : function(e) {
1214
1224
  for (var t = 1; t < arguments.length; t++) {
1215
1225
  var n = arguments[t];
1216
1226
  for (var r in n)
1217
1227
  Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
1218
1228
  }
1219
1229
  return e;
1220
- }, Te.apply(this, arguments);
1230
+ }, _e.apply(this, arguments);
1221
1231
  }
1222
- const sn = (e, t) => /* @__PURE__ */ B.createElement(le, Te({}, e, {
1232
+ const dn = (e, t) => /* @__PURE__ */ B.createElement(le, _e({}, e, {
1223
1233
  ref: t,
1224
- icon: an
1225
- })), on = /* @__PURE__ */ B.forwardRef(sn);
1226
- var ln = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" } }] }, name: "info-circle", theme: "outlined" };
1227
- function Ie() {
1228
- return Ie = Object.assign ? Object.assign.bind() : function(e) {
1234
+ icon: un
1235
+ })), hn = /* @__PURE__ */ B.forwardRef(dn);
1236
+ var mn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" } }] }, name: "info-circle", theme: "outlined" };
1237
+ function Te() {
1238
+ return Te = Object.assign ? Object.assign.bind() : function(e) {
1229
1239
  for (var t = 1; t < arguments.length; t++) {
1230
1240
  var n = arguments[t];
1231
1241
  for (var r in n)
1232
1242
  Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
1233
1243
  }
1234
1244
  return e;
1235
- }, Ie.apply(this, arguments);
1245
+ }, Te.apply(this, arguments);
1236
1246
  }
1237
- const cn = (e, t) => /* @__PURE__ */ B.createElement(le, Ie({}, e, {
1247
+ const gn = (e, t) => /* @__PURE__ */ B.createElement(le, Te({}, e, {
1238
1248
  ref: t,
1239
- icon: ln
1240
- })), un = /* @__PURE__ */ B.forwardRef(cn), it = {
1241
- get: dn,
1242
- getByIdOrSlug: hn,
1243
- getMedias: mn,
1244
- download: gn,
1245
- downloadFromUrl: fn
1249
+ icon: mn
1250
+ })), fn = /* @__PURE__ */ B.forwardRef(gn), it = {
1251
+ get: pn,
1252
+ getByIdOrSlug: yn,
1253
+ getMedias: bn,
1254
+ download: Sn,
1255
+ downloadFromUrl: wn
1246
1256
  };
1247
- function dn(e) {
1257
+ function pn(e) {
1248
1258
  return k.postData("/api/media/search", e, !0);
1249
1259
  }
1250
- function hn(e) {
1260
+ function yn(e) {
1251
1261
  return k.getData(`/api/media/${e}`, !0);
1252
1262
  }
1253
- function mn(e) {
1263
+ function bn(e) {
1254
1264
  return k.postData("/api/media/medias", e, !0);
1255
1265
  }
1256
- function gn(e) {
1266
+ function Sn(e) {
1257
1267
  return k.postData("/api/media/download", e);
1258
1268
  }
1259
- function fn(e) {
1269
+ function wn(e) {
1260
1270
  return k.postData("/api/media/download/url", e, !0);
1261
1271
  }
1262
1272
  const at = {
1263
- success: pn,
1264
- error: yn
1273
+ success: vn,
1274
+ error: xn
1265
1275
  };
1266
- function pn(e) {
1267
- Ee.success({
1268
- message: Le[Math.floor(Math.random() * Le.length)],
1276
+ function vn(e) {
1277
+ Ae.success({
1278
+ message: je[Math.floor(Math.random() * je.length)],
1269
1279
  description: e,
1270
1280
  duration: 3
1271
1281
  });
1272
1282
  }
1273
- function yn(e) {
1274
- Ee.error({
1283
+ function xn(e) {
1284
+ Ae.error({
1275
1285
  message: Pe[Math.floor(Math.random() * Pe.length)],
1276
1286
  description: e,
1277
1287
  duration: 3
1278
1288
  });
1279
1289
  }
1280
- let Le = ["Success", "Good Job", "Excellent", "Way to go!", "Nice!", "That'll do!", "That worked!", "Ok", "Bingo"], Pe = ["Bummer", "Something didn't work", "Error", "Nope", "Shucks"];
1281
- const { Dragger: bn } = wt;
1282
- function Sn(e) {
1290
+ let je = ["Success", "Good Job", "Excellent", "Way to go!", "Nice!", "That'll do!", "That worked!", "Ok", "Bingo"], Pe = ["Bummer", "Something didn't work", "Error", "Nope", "Shucks"];
1291
+ const { Dragger: _n } = wt;
1292
+ function Tn(e) {
1283
1293
  const t = e.size / 1024 / 1024 < 200;
1284
1294
  return t || at.error("File must smaller than 200MB"), t;
1285
1295
  }
1286
- function wn({ onUploaded: e, accept: t, addToMediaLibrary: n, contentId: r, showUploadList: a = !0, multiple: s = !1 }) {
1287
- const l = typeof window < "u", d = l && typeof localStorage < "u" ? localStorage.getItem("gatsbyUser") : null, g = d !== null && l ? JSON.parse(window.atob(d)) : null, h = (y) => {
1288
- y.file.status !== "uploading" && (y.file.status === "done" ? e && e(y.file.response) : y.file.status === "error" && at.error(`${y.file.name} file upload failed.`));
1289
- }, u = {
1290
- Authorization: g?.token ? "Bearer " + g.token : "",
1291
- AppKey: process.env.STORM_APPKEY
1296
+ function In({ onUploaded: e, accept: t, addToMediaLibrary: n, contentId: r, showUploadList: a = !0, multiple: s = !1 }) {
1297
+ const l = typeof globalThis < "u" ? globalThis.process?.env : void 0, d = typeof window < "u", g = d && typeof localStorage < "u" ? localStorage.getItem("gatsbyUser") : null, h = g !== null && d ? JSON.parse(window.atob(g)) : null, u = (p) => {
1298
+ p.file.status !== "uploading" && (p.file.status === "done" ? e && e(p.file.response) : p.file.status === "error" && at.error(`${p.file.name} file upload failed.`));
1299
+ }, f = {
1300
+ Authorization: h?.token ? "Bearer " + h.token : "",
1301
+ AppKey: l?.STORM_APPKEY
1292
1302
  };
1293
- let f = `https://${process.env.REACT_APP_WEBAPI_URL_FULL_ACCESS}/api/media/files`;
1294
- return n && (f += "?addToMediaLibrary=true", r && (f += `&contentId=${r}`)), /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(bn, { name: "files", accept: t, multiple: s, beforeUpload: Sn, action: f, headers: u, showUploadList: a, onChange: h, children: /* @__PURE__ */ x("div", { className: "p-5 m-5", children: [
1295
- /* @__PURE__ */ i("p", { className: "ant-upload-drag-icon", children: /* @__PURE__ */ i(on, {}) }),
1303
+ let S = `https://${l?.REACT_APP_WEBAPI_URL_FULL_ACCESS}/api/media/files`;
1304
+ return n && (S += "?addToMediaLibrary=true", r && (S += `&contentId=${r}`)), /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(_n, { name: "files", accept: t, multiple: s, beforeUpload: Tn, action: S, headers: f, showUploadList: a, onChange: u, children: /* @__PURE__ */ x("div", { className: "p-5 m-5", children: [
1305
+ /* @__PURE__ */ i("p", { className: "ant-upload-drag-icon", children: /* @__PURE__ */ i(hn, {}) }),
1296
1306
  /* @__PURE__ */ i("p", { className: "ant-upload-text", children: "Click or drag files to this area to upload" }),
1297
1307
  t !== void 0 && /* @__PURE__ */ i("p", { className: "ant-upload-hint", children: `must be only ${t} files` })
1298
1308
  ] }) }) });
1299
1309
  }
1300
- const _e = {
1301
- image: vn,
1302
- currency: xn,
1303
- numWithComma: Tn,
1304
- phone: In,
1305
- timeToRead: _n,
1306
- timeDiffMinutes: Cn,
1307
- startEndDateTime: kn,
1308
- dateFormat: Nn,
1309
- getDateFromString: Rn
1310
+ const Ie = {
1311
+ image: Cn,
1312
+ currency: kn,
1313
+ numWithComma: Nn,
1314
+ phone: Rn,
1315
+ timeToRead: Mn,
1316
+ timeDiffMinutes: zn,
1317
+ startEndDateTime: qn,
1318
+ dateFormat: $n,
1319
+ getDateFromString: On
1310
1320
  };
1311
- function vn(e, t) {
1321
+ function Cn(e, t) {
1312
1322
  return e ? e.indexOf("?") > -1 ? `${e}&${t}` : `${e}?${t}` : "";
1313
1323
  }
1314
- function xn(e) {
1324
+ function kn(e) {
1315
1325
  var t = new Intl.NumberFormat("en-US", {
1316
1326
  style: "currency",
1317
1327
  currency: "USD"
1318
1328
  });
1319
1329
  return t.format(e);
1320
1330
  }
1321
- function Tn(e) {
1331
+ function Nn(e) {
1322
1332
  return e.toLocaleString();
1323
1333
  }
1324
- function In(e) {
1334
+ function Rn(e) {
1325
1335
  return e = e.toString().replace(/[^0-9]/g, ""), e.length === 10 ? e.substring(0, 3) + "." + e.substring(3, 6) + "." + e.substring(6) : e;
1326
1336
  }
1327
- function _n(e) {
1337
+ function Mn(e) {
1328
1338
  return e ? Math.ceil(e.split(" ").length / 210) : 0;
1329
1339
  }
1330
- function Cn(e, t) {
1340
+ function zn(e, t) {
1331
1341
  console.log(e, t);
1332
1342
  const n = e && typeof e == "object" ? e : Date.parse(e.replace(" ", "T")), r = t && typeof t == "object" ? t : Date.parse(t.replace(" ", "T")), a = Math.abs(r - n);
1333
1343
  return Math.floor(a / 1e3 / 60);
1334
1344
  }
1335
- function kn(e, t = "", n = !0) {
1345
+ function qn(e, t = "", n = !0) {
1336
1346
  const r = { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric" }, a = { hour: "numeric", minute: "numeric", timeZoneName: "short" }, s = { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", timeZoneName: "short" }, l = new Intl.DateTimeFormat("en", r), d = new Intl.DateTimeFormat("en", a), g = new Intl.DateTimeFormat("en", s);
1337
1347
  if (!e) return "";
1338
1348
  const h = e && typeof e == "object" ? e : Date.parse(e.replace(" ", "T")), u = t && typeof t == "object" ? t : Date.parse(t.replace(" ", "T"));
@@ -1351,69 +1361,69 @@ function kn(e, t = "", n = !0) {
1351
1361
  n && /* @__PURE__ */ i("br", {})
1352
1362
  ] });
1353
1363
  }
1354
- function Nn(e, t = "medium", n = !1) {
1355
- const r = { weekday: "long", year: "numeric", month: "long", day: "numeric" }, a = { year: "numeric", month: "long", day: "numeric" }, s = { year: "numeric", month: "short", day: "numeric" }, l = { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", timeZoneName: "short" }, d = { hour: "numeric", minute: "numeric", timeZoneName: "short" }, g = new Intl.DateTimeFormat("en", r), h = new Intl.DateTimeFormat("en", s), u = new Intl.DateTimeFormat("en", l), f = new Intl.DateTimeFormat("en", a), y = new Intl.DateTimeFormat("en", d);
1364
+ function $n(e, t = "medium", n = !1) {
1365
+ const r = { weekday: "long", year: "numeric", month: "long", day: "numeric" }, a = { year: "numeric", month: "long", day: "numeric" }, s = { year: "numeric", month: "short", day: "numeric" }, l = { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", timeZoneName: "short" }, d = { hour: "numeric", minute: "numeric", timeZoneName: "short" }, g = new Intl.DateTimeFormat("en", r), h = new Intl.DateTimeFormat("en", s), u = new Intl.DateTimeFormat("en", l), f = new Intl.DateTimeFormat("en", a), S = new Intl.DateTimeFormat("en", d);
1356
1366
  if (!e) return "";
1357
- const w = e && typeof e == "object" ? e : Date.parse(e.replace(" ", "T"));
1358
- return Number.isNaN(w) ? "" : /* @__PURE__ */ x(H, { children: [
1359
- t === "long" && g.format(w),
1360
- t === "short" && h.format(w),
1361
- t === "medium" && f.format(w),
1362
- t === "datetime" && u.format(w),
1363
- t === "time" && y.format(w),
1367
+ const p = e && typeof e == "object" ? e : Date.parse(e.replace(" ", "T"));
1368
+ return Number.isNaN(p) ? "" : /* @__PURE__ */ x(H, { children: [
1369
+ t === "long" && g.format(p),
1370
+ t === "short" && h.format(p),
1371
+ t === "medium" && f.format(p),
1372
+ t === "datetime" && u.format(p),
1373
+ t === "time" && S.format(p),
1364
1374
  n && /* @__PURE__ */ i("br", {})
1365
1375
  ] });
1366
1376
  }
1367
- function Rn(e) {
1377
+ function On(e) {
1368
1378
  if (!e) return null;
1369
1379
  const t = Date.parse(e.replace(" ", "T"));
1370
1380
  return Number.isNaN(t) ? null : t;
1371
1381
  }
1372
- const { Search: zn } = V;
1373
- function Mn({ fileTypes: e, contentId: t, isMany: n, onSuccess: r, hideScopeFilter: a = !0, showResizer: s = !1 }) {
1374
- const [l, d] = v(!1), [g, h] = v([]), [u, f] = v([]), [y, w] = v(0), [z, N] = v([]), [c, m] = v(""), [M, C] = v("content"), [b, D] = v(a ? 1 : 0), [J, ne] = v({ id: "createdOn", desc: !0 }), [A, F] = v({ current: 1, pageSize: 20, total: 0, position: ["topRight", "bottomRight"], showSizeChanger: !0 }), [q, O] = v([]), [I, _] = v(null), [L, j] = v(null);
1382
+ const { Search: Dn } = V;
1383
+ function Fn({ fileTypes: e, contentId: t, isMany: n, onSuccess: r, hideScopeFilter: a = !0, showResizer: s = !1 }) {
1384
+ const [l, d] = v(!1), [g, h] = v([]), [u, f] = v([]), [S, p] = v(0), [M, N] = v([]), [c, m] = v(""), [z, C] = v("content"), [b, D] = v(a ? 1 : 0), [J, ne] = v({ id: "createdOn", desc: !0 }), [E, F] = v({ current: 1, pageSize: 20, total: 0, position: ["topRight", "bottomRight"], showSizeChanger: !0 }), [q, O] = v([]), [T, I] = v(null), [j, L] = v(null);
1375
1385
  Y(() => {
1376
1386
  d(!1);
1377
- let S = {
1387
+ let w = {
1378
1388
  keyword: c,
1379
- mediaTypes: z,
1389
+ mediaTypes: M,
1380
1390
  orderBy: J,
1381
1391
  pagination: {
1382
- pageNum: A.current,
1383
- pageSize: A.pageSize
1392
+ pageNum: E.current,
1393
+ pageSize: E.pageSize
1384
1394
  }
1385
1395
  };
1386
- S.mediaPurposes = [1], S.contentId = t, it.get(S).then((p) => {
1387
- const P = { ...A };
1388
- P.total = p.totalRecords, h(p.media), F(P);
1389
- }).catch((p) => console.log(p)).finally(() => {
1396
+ w.mediaPurposes = [1], w.contentId = t, it.get(w).then((y) => {
1397
+ const P = { ...E };
1398
+ P.total = y.totalRecords, h(y.media), F(P);
1399
+ }).catch((y) => console.log(y)).finally(() => {
1390
1400
  d(!1);
1391
1401
  });
1392
- }, [y, z, M]);
1393
- const U = (S, p, P) => {
1402
+ }, [S, M, z]);
1403
+ const U = (w, y, P) => {
1394
1404
  let ce = { ...J };
1395
- const Z = { ...A };
1396
- Z.pageSize !== S.pageSize ? (Z.pageSize = S.pageSize, Z.current = 1) : Z.current = S.current, P.field && (ce = { id: P.field, desc: P.order === "descend" }), F(Z), ne(ce), w(y + 1);
1397
- }, ot = (S, p) => {
1398
- let P = S.filter((ce) => g.find((Z) => Z.id === ce));
1405
+ const Z = { ...E };
1406
+ Z.pageSize !== w.pageSize ? (Z.pageSize = w.pageSize, Z.current = 1) : Z.current = w.current, P.field && (ce = { id: P.field, desc: P.order === "descend" }), F(Z), ne(ce), p(S + 1);
1407
+ }, ot = (w, y) => {
1408
+ let P = w.filter((ce) => g.find((Z) => Z.id === ce));
1399
1409
  O(P);
1400
- }, lt = (S) => {
1401
- const p = { ...A };
1402
- p.current = 1, F(p), N(S);
1403
- }, ct = (S) => {
1404
- const p = { ...A };
1405
- p.current = 1, F(p), C(S.target.value);
1406
- }, me = (S) => {
1410
+ }, lt = (w) => {
1411
+ const y = { ...E };
1412
+ y.current = 1, F(y), N(w);
1413
+ }, ct = (w) => {
1414
+ const y = { ...E };
1415
+ y.current = 1, F(y), C(w.target.value);
1416
+ }, me = (w) => {
1407
1417
  if (r) {
1408
- if (S) {
1409
- s && S.mediaType === 0 ? _(S) : r([S]);
1418
+ if (w) {
1419
+ s && w.mediaType === 0 ? I(w) : r([w]);
1410
1420
  return;
1411
1421
  }
1412
- r(g.filter((p) => q.find((P) => P === p.id))), O([]);
1422
+ r(g.filter((y) => q.find((P) => P === y.id))), O([]);
1413
1423
  }
1414
- }, ut = (S) => {
1415
- let p = u.concat(S);
1416
- f(p);
1424
+ }, ut = (w) => {
1425
+ let y = u.concat(w);
1426
+ f(y);
1417
1427
  };
1418
1428
  return /* @__PURE__ */ i(
1419
1429
  vt,
@@ -1424,39 +1434,39 @@ function Mn({ fileTypes: e, contentId: t, isMany: n, onSuccess: r, hideScopeFilt
1424
1434
  key: "1",
1425
1435
  children: /* @__PURE__ */ x(H, { children: [
1426
1436
  /* @__PURE__ */ x(Ve, { gutter: [16, 16], className: "mb-3", children: [
1427
- /* @__PURE__ */ i(Q, { xs: 6, children: /* @__PURE__ */ x(K, { mode: "multiple", placeholder: "Select Type", value: z, onChange: lt, className: "mr-2 w-100", children: [
1437
+ /* @__PURE__ */ i(Q, { xs: 6, children: /* @__PURE__ */ x(K, { mode: "multiple", placeholder: "Select Type", value: M, onChange: lt, className: "mr-2 w-100", children: [
1428
1438
  /* @__PURE__ */ i(K.Option, { value: 0, children: "Image" }),
1429
1439
  /* @__PURE__ */ i(K.Option, { value: 1, children: "File" }),
1430
1440
  /* @__PURE__ */ i(K.Option, { value: 2, children: "Video" }),
1431
1441
  /* @__PURE__ */ i(K.Option, { value: 3, children: "Audio" }),
1432
1442
  /* @__PURE__ */ i(K.Option, { value: 4, children: "Embedded" })
1433
1443
  ] }) }),
1434
- /* @__PURE__ */ i(Q, { xs: 6, children: !a && /* @__PURE__ */ x(X.Group, { buttonStyle: "solid", value: M, onChange: ct, children: [
1444
+ /* @__PURE__ */ i(Q, { xs: 6, children: !a && /* @__PURE__ */ x(X.Group, { buttonStyle: "solid", value: z, onChange: ct, children: [
1435
1445
  /* @__PURE__ */ i(X.Button, { value: "global", children: "Global" }),
1436
1446
  /* @__PURE__ */ i(X.Button, { value: "both", children: "Both" }),
1437
1447
  /* @__PURE__ */ i(X.Button, { value: "content", children: "Content" })
1438
1448
  ] }) }),
1439
1449
  /* @__PURE__ */ i(Q, { xs: 12, children: /* @__PURE__ */ i(
1440
- zn,
1450
+ Dn,
1441
1451
  {
1442
1452
  id: "keyword",
1443
1453
  placeholder: "search",
1444
- onSearch: () => w(y + 1),
1454
+ onSearch: () => p(S + 1),
1445
1455
  enterButton: !0,
1446
1456
  className: "w-100",
1447
1457
  value: c,
1448
- onChange: (S) => m(S.target.value),
1458
+ onChange: (w) => m(w.target.value),
1449
1459
  loading: l
1450
1460
  }
1451
1461
  ) }),
1452
- n && /* @__PURE__ */ i(Q, { xs: 24, children: /* @__PURE__ */ i(G, { type: "primary", className: "mr-2", disabled: q.length === 0, onClick: () => me(), children: "Select" }) })
1462
+ n && /* @__PURE__ */ i(Q, { xs: 24, children: /* @__PURE__ */ i(W, { type: "primary", className: "mr-2", disabled: q.length === 0, onClick: () => me(), children: "Select" }) })
1453
1463
  ] }),
1454
1464
  /* @__PURE__ */ i(
1455
1465
  ae,
1456
1466
  {
1457
1467
  dataSource: g,
1458
- rowKey: (S) => S.id,
1459
- pagination: A,
1468
+ rowKey: (w) => w.id,
1469
+ pagination: E,
1460
1470
  loading: l,
1461
1471
  size: "middle",
1462
1472
  className: "clear-both pointer",
@@ -1467,9 +1477,9 @@ function Mn({ fileTypes: e, contentId: t, isMany: n, onSuccess: r, hideScopeFilt
1467
1477
  selectedRowKeys: q,
1468
1478
  hideSelectAll: !0
1469
1479
  },
1470
- onRow: (S, p) => ({
1480
+ onRow: (w, y) => ({
1471
1481
  onClick: (P) => {
1472
- !n && me(S);
1482
+ !n && me(w);
1473
1483
  }
1474
1484
  }),
1475
1485
  columns: [
@@ -1478,19 +1488,19 @@ function Mn({ fileTypes: e, contentId: t, isMany: n, onSuccess: r, hideScopeFilt
1478
1488
  dataIndex: "thumbnail",
1479
1489
  width: "6%",
1480
1490
  responsive: ["lg"],
1481
- render: (S, p) => /* @__PURE__ */ i("img", { src: p.thumbnail, alt: "Thumbnail", className: "img-fluid avatar-50" })
1491
+ render: (w, y) => /* @__PURE__ */ i("img", { src: y.thumbnail, alt: "Thumbnail", className: "img-fluid avatar-50" })
1482
1492
  },
1483
1493
  { title: "Title", dataIndex: "title", sorter: !0 },
1484
1494
  {
1485
1495
  title: "Type",
1486
1496
  dataIndex: "lastName",
1487
1497
  sorter: !0,
1488
- render: (S, p) => /* @__PURE__ */ x("span", { children: [
1489
- p.mediaType === 0 && /* @__PURE__ */ i(R, { color: "blue", children: "Image" }),
1490
- p.mediaType === 1 && /* @__PURE__ */ i(R, { color: "gold", children: "File" }),
1491
- p.mediaType === 2 && /* @__PURE__ */ i(R, { color: "cyan", children: "Video" }),
1492
- p.mediaType === 3 && /* @__PURE__ */ i(R, { color: "magenta", children: "Audio" }),
1493
- p.mediaType === 4 && /* @__PURE__ */ i(R, { color: "volcano", children: "Embedded" })
1498
+ render: (w, y) => /* @__PURE__ */ x("span", { children: [
1499
+ y.mediaType === 0 && /* @__PURE__ */ i(R, { color: "blue", children: "Image" }),
1500
+ y.mediaType === 1 && /* @__PURE__ */ i(R, { color: "gold", children: "File" }),
1501
+ y.mediaType === 2 && /* @__PURE__ */ i(R, { color: "cyan", children: "Video" }),
1502
+ y.mediaType === 3 && /* @__PURE__ */ i(R, { color: "magenta", children: "Audio" }),
1503
+ y.mediaType === 4 && /* @__PURE__ */ i(R, { color: "volcano", children: "Embedded" })
1494
1504
  ] })
1495
1505
  },
1496
1506
  {
@@ -1498,20 +1508,20 @@ function Mn({ fileTypes: e, contentId: t, isMany: n, onSuccess: r, hideScopeFilt
1498
1508
  dataIndex: "createdOn",
1499
1509
  sorter: !0,
1500
1510
  responsive: ["xl"],
1501
- render: (S, p) => /* @__PURE__ */ i("span", { children: _e.dateFormat(p.createdOn) })
1511
+ render: (w, y) => /* @__PURE__ */ i("span", { children: Ie.dateFormat(y.createdOn) })
1502
1512
  },
1503
1513
  {
1504
1514
  title: "Info",
1505
1515
  responsive: ["lg"],
1506
1516
  align: "center",
1507
- render: (S, p) => /* @__PURE__ */ i(
1508
- G,
1517
+ render: (w, y) => /* @__PURE__ */ i(
1518
+ W,
1509
1519
  {
1510
1520
  type: "secondary",
1511
1521
  onClick: (P) => {
1512
- P.stopPropagation(), j(p);
1522
+ P.stopPropagation(), L(y);
1513
1523
  },
1514
- children: /* @__PURE__ */ i(un, {})
1524
+ children: /* @__PURE__ */ i(fn, {})
1515
1525
  }
1516
1526
  )
1517
1527
  }
@@ -1524,19 +1534,19 @@ function Mn({ fileTypes: e, contentId: t, isMany: n, onSuccess: r, hideScopeFilt
1524
1534
  label: "Upload",
1525
1535
  key: "2",
1526
1536
  children: /* @__PURE__ */ x(H, { children: [
1527
- /* @__PURE__ */ i(wn, { onUploaded: ut, multiple: !0, showUploadList: !1, addToMediaLibrary: !0, contentId: b === 1 ? t : 0 }),
1537
+ /* @__PURE__ */ i(In, { onUploaded: ut, multiple: !0, showUploadList: !1, addToMediaLibrary: !0, contentId: b === 1 ? t : 0 }),
1528
1538
  /* @__PURE__ */ i(
1529
1539
  ae,
1530
1540
  {
1531
1541
  dataSource: u,
1532
- rowKey: (S) => S.id,
1542
+ rowKey: (w) => w.id,
1533
1543
  pagination: !1,
1534
1544
  loading: l,
1535
1545
  size: "middle",
1536
1546
  className: "clear-both pointer",
1537
- onRow: (S, p) => ({
1547
+ onRow: (w, y) => ({
1538
1548
  onClick: (P) => {
1539
- me(S);
1549
+ me(w);
1540
1550
  }
1541
1551
  }),
1542
1552
  columns: [
@@ -1545,19 +1555,19 @@ function Mn({ fileTypes: e, contentId: t, isMany: n, onSuccess: r, hideScopeFilt
1545
1555
  dataIndex: "thumbnail",
1546
1556
  width: "6%",
1547
1557
  responsive: ["md"],
1548
- render: (S, p) => /* @__PURE__ */ i("img", { src: p.url, alt: "Thumbnail", className: "img-fluid" })
1558
+ render: (w, y) => /* @__PURE__ */ i("img", { src: y.url, alt: "Thumbnail", className: "img-fluid" })
1549
1559
  },
1550
1560
  { title: "Title", dataIndex: "title", sorter: !0 },
1551
1561
  {
1552
1562
  title: "Type",
1553
1563
  dataIndex: "lastName",
1554
1564
  sorter: !0,
1555
- render: (S, p) => /* @__PURE__ */ x("span", { children: [
1556
- p.mediaType === 0 && /* @__PURE__ */ i(R, { color: "blue", children: "Image" }),
1557
- p.mediaType === 1 && /* @__PURE__ */ i(R, { color: "gold", children: "File" }),
1558
- p.mediaType === 2 && /* @__PURE__ */ i(R, { color: "cyan", children: "Video" }),
1559
- p.mediaType === 3 && /* @__PURE__ */ i(R, { color: "magenta", children: "Audio" }),
1560
- p.mediaType === 4 && /* @__PURE__ */ i(R, { color: "volcano", children: "Embedded" })
1565
+ render: (w, y) => /* @__PURE__ */ x("span", { children: [
1566
+ y.mediaType === 0 && /* @__PURE__ */ i(R, { color: "blue", children: "Image" }),
1567
+ y.mediaType === 1 && /* @__PURE__ */ i(R, { color: "gold", children: "File" }),
1568
+ y.mediaType === 2 && /* @__PURE__ */ i(R, { color: "cyan", children: "Video" }),
1569
+ y.mediaType === 3 && /* @__PURE__ */ i(R, { color: "magenta", children: "Audio" }),
1570
+ y.mediaType === 4 && /* @__PURE__ */ i(R, { color: "volcano", children: "Embedded" })
1561
1571
  ] })
1562
1572
  },
1563
1573
  {
@@ -1565,7 +1575,7 @@ function Mn({ fileTypes: e, contentId: t, isMany: n, onSuccess: r, hideScopeFilt
1565
1575
  dataIndex: "createdOn",
1566
1576
  sorter: !0,
1567
1577
  responsive: ["xl"],
1568
- render: (S, p) => /* @__PURE__ */ i("span", { children: _e.dateFormat(p.createdOn) })
1578
+ render: (w, y) => /* @__PURE__ */ i("span", { children: Ie.dateFormat(y.createdOn) })
1569
1579
  }
1570
1580
  ]
1571
1581
  }
@@ -1576,7 +1586,7 @@ function Mn({ fileTypes: e, contentId: t, isMany: n, onSuccess: r, hideScopeFilt
1576
1586
  }
1577
1587
  );
1578
1588
  }
1579
- const qn = ({
1589
+ const Hn = ({
1580
1590
  slug: e,
1581
1591
  value: t,
1582
1592
  label: n,
@@ -1591,33 +1601,33 @@ const qn = ({
1591
1601
  className: u
1592
1602
  }) => {
1593
1603
  r = r || { uploadLimit: "1", fileTypes: null };
1594
- const [f, y] = v(l || []), [w, z] = v(!1), N = r.uploadLimit !== "1";
1604
+ const [f, S] = v(l || []), [p, M] = v(!1), N = r.uploadLimit !== "1";
1595
1605
  if (!e)
1596
1606
  throw Error("MediaInput property: slug required");
1597
1607
  Y(() => {
1598
- if (l?.length > 0 ? y(l) : y([]), t && !l) {
1608
+ if (l?.length > 0 ? S(l) : S([]), t && !l) {
1599
1609
  const C = t.split(",").filter((b) => !isNaN(b)).map((b) => parseInt(b, 10));
1600
1610
  it.getMedias({ ids: C }).then((b) => {
1601
- y(b);
1611
+ S(b);
1602
1612
  });
1603
1613
  }
1604
1614
  }, [l]);
1605
1615
  const c = (C) => {
1606
1616
  const b = f.concat(C);
1607
- y(b), M(b), z(!1);
1617
+ S(b), z(b), M(!1);
1608
1618
  }, m = (C) => {
1609
1619
  var b = f.findIndex((D) => D.id === C.id);
1610
1620
  if (b > -1) {
1611
1621
  let D = [...f];
1612
- D.splice(b, 1), y(D), M(D);
1622
+ D.splice(b, 1), S(D), z(D);
1613
1623
  }
1614
- }, M = (C) => {
1624
+ }, z = (C) => {
1615
1625
  const b = C.map((D, J) => D.id).join(",");
1616
1626
  a.setFieldsValue({ [e]: b }), s && s(e, b);
1617
1627
  };
1618
- return /* @__PURE__ */ x(T.Item, { label: n, className: u, children: [
1628
+ return /* @__PURE__ */ x(_.Item, { label: n, className: u, children: [
1619
1629
  /* @__PURE__ */ x("div", { className: "text-center", children: [
1620
- (N || !N && f.length === 0) && /* @__PURE__ */ i(G, { type: "primary", className: "my-2", onClick: () => z(!0), children: "Select" }),
1630
+ (N || !N && f.length === 0) && /* @__PURE__ */ i(W, { type: "primary", className: "my-2", onClick: () => M(!0), children: "Select" }),
1621
1631
  f.length > 0 && /* @__PURE__ */ i(
1622
1632
  ae,
1623
1633
  {
@@ -1661,53 +1671,53 @@ const qn = ({
1661
1671
  {
1662
1672
  title: "",
1663
1673
  width: "50px",
1664
- render: (C, b) => /* @__PURE__ */ i(Be, { title: "Are you sure you want to delete this?", onConfirm: () => m(b), okText: "Yes", cancelText: "No", children: /* @__PURE__ */ i(G, { type: "primary", danger: !0, children: /* @__PURE__ */ i(rt, {}) }) })
1674
+ render: (C, b) => /* @__PURE__ */ i(Be, { title: "Are you sure you want to delete this?", onConfirm: () => m(b), okText: "Yes", cancelText: "No", children: /* @__PURE__ */ i(W, { type: "primary", danger: !0, children: /* @__PURE__ */ i(rt, {}) }) })
1665
1675
  }
1666
1676
  ]
1667
1677
  }
1668
1678
  )
1669
1679
  ] }),
1670
- /* @__PURE__ */ i(T.Item, { name: e, initialValue: t, hidden: !d, rules: [{ required: g, message: "Required" }], children: /* @__PURE__ */ i(V, {}) }),
1671
- /* @__PURE__ */ i(Ue, { open: w, title: "Search Media", height: "85%", placement: "bottom", onClose: () => z(!1), children: /* @__PURE__ */ i(Mn, { mediaTypes: r.referenceTypes, isMany: N, onSuccess: c, hideScopeFilter: !0, contentId: h }) })
1680
+ /* @__PURE__ */ i(_.Item, { name: e, initialValue: t, hidden: !d, rules: [{ required: g, message: "Required" }], children: /* @__PURE__ */ i(V, {}) }),
1681
+ /* @__PURE__ */ i(Ue, { open: p, title: "Search Media", height: "85%", placement: "bottom", onClose: () => M(!1), children: /* @__PURE__ */ i(Fn, { mediaTypes: r.referenceTypes, isMany: N, onSuccess: c, hideScopeFilter: !0, contentId: h }) })
1672
1682
  ] });
1673
- }, $n = {
1674
- siteSearch: On,
1675
- get: Dn,
1676
- search: Fn,
1677
- getForm: Hn,
1678
- getUserContent: jn,
1679
- getByIdOrSlug: Ln,
1680
- getContentTypeById: Pn
1683
+ }, Ln = {
1684
+ siteSearch: jn,
1685
+ get: Pn,
1686
+ search: En,
1687
+ getForm: An,
1688
+ getUserContent: Vn,
1689
+ getByIdOrSlug: Bn,
1690
+ getContentTypeById: Un
1681
1691
  };
1682
- function On(e) {
1692
+ function jn(e) {
1683
1693
  return k.postData("/api/content/sitesearch", e, !1);
1684
1694
  }
1685
- function Dn(e) {
1695
+ function Pn(e) {
1686
1696
  return k.getData(`/api/content/${e}`, !1);
1687
1697
  }
1688
- function Fn(e) {
1698
+ function En(e) {
1689
1699
  return k.postData("/api/content/search", e, !0);
1690
1700
  }
1691
- function Hn(e, t) {
1701
+ function An(e, t) {
1692
1702
  return k.getData(`/api/content/form/${e}/${t}`, !1);
1693
1703
  }
1694
- function jn(e, t) {
1704
+ function Vn(e, t) {
1695
1705
  return k.getData(`/api/content/usercontent/?status=${t}&page=${e}`, !0);
1696
1706
  }
1697
- function Ln(e) {
1707
+ function Bn(e) {
1698
1708
  return k.getData(`/api/content/${e}`, !0);
1699
1709
  }
1700
- function Pn(e, t) {
1710
+ function Un(e, t) {
1701
1711
  let n = `/api/content/contenttype/${e}`;
1702
1712
  return t && (n += `/${t}`), k.getData(n, !0);
1703
1713
  }
1704
- const { Search: An } = V;
1705
- function En({ contentTypes: e, isMany: t, isEcommerce: n, onSuccess: r, showDetails: a = !0, isPreviewable: s = !1, initialStatus: l = [0] }) {
1706
- const [d, g] = v(!1), [h, u] = v([]), [f, y] = v(0), [w, z] = v(""), [N, c] = v({ id: "title", desc: !1 }), [m, M] = v({ current: 1, pageSize: 20, total: 0, position: ["topRight", "bottomRight"], showSizeChanger: !0 }), [C, b] = v(l), [D, J] = v([]);
1714
+ const { Search: Kn } = V;
1715
+ function Yn({ contentTypes: e, isMany: t, isEcommerce: n, onSuccess: r, showDetails: a = !0, isPreviewable: s = !1, initialStatus: l = [0] }) {
1716
+ const [d, g] = v(!1), [h, u] = v([]), [f, S] = v(0), [p, M] = v(""), [N, c] = v({ id: "title", desc: !1 }), [m, z] = v({ current: 1, pageSize: 20, total: 0, position: ["topRight", "bottomRight"], showSizeChanger: !0 }), [C, b] = v(l), [D, J] = v([]);
1707
1717
  Y(() => {
1708
1718
  g(!1);
1709
- let I = {
1710
- keyword: w,
1719
+ let T = {
1720
+ keyword: p,
1711
1721
  contentType: e || [],
1712
1722
  isPreviewable: s,
1713
1723
  status: C,
@@ -1718,64 +1728,64 @@ function En({ contentTypes: e, isMany: t, isEcommerce: n, onSuccess: r, showDeta
1718
1728
  },
1719
1729
  isEcommerce: n
1720
1730
  };
1721
- $n.search(I).then((_) => {
1722
- const L = { ...m };
1723
- L.total = _.totalRecords, u(_.content), M(L);
1724
- }).catch((_) => console.log(_)).finally(() => {
1731
+ Ln.search(T).then((I) => {
1732
+ const j = { ...m };
1733
+ j.total = I.totalRecords, u(I.content), z(j);
1734
+ }).catch((I) => console.log(I)).finally(() => {
1725
1735
  g(!1);
1726
1736
  });
1727
1737
  }, [f]);
1728
- const ne = (I, _, L) => {
1729
- let j = { ...N };
1738
+ const ne = (T, I, j) => {
1739
+ let L = { ...N };
1730
1740
  const U = { ...m };
1731
- U.pageSize !== I.pageSize ? (U.pageSize = I.pageSize, U.current = 1) : U.current = I.current, L.field && (j = { id: L.field, desc: L.order === "descend" }), M(U), c(j), y(f + 1);
1732
- }, A = () => {
1733
- const I = { ...m };
1734
- I.current = 1, M(I), y(f + 1);
1735
- }, F = (I, _) => {
1736
- let L = I.filter((j) => h.find((U) => U.id === j));
1737
- J(L);
1738
- }, q = (I) => {
1741
+ U.pageSize !== T.pageSize ? (U.pageSize = T.pageSize, U.current = 1) : U.current = T.current, j.field && (L = { id: j.field, desc: j.order === "descend" }), z(U), c(L), S(f + 1);
1742
+ }, E = () => {
1743
+ const T = { ...m };
1744
+ T.current = 1, z(T), S(f + 1);
1745
+ }, F = (T, I) => {
1746
+ let j = T.filter((L) => h.find((U) => U.id === L));
1747
+ J(j);
1748
+ }, q = (T) => {
1739
1749
  if (r) {
1740
- if (I) {
1741
- r([I]);
1750
+ if (T) {
1751
+ r([T]);
1742
1752
  return;
1743
1753
  }
1744
- r(h.filter((_) => D.find((L) => L === _.id))), J([]);
1754
+ r(h.filter((I) => D.find((j) => j === I.id))), J([]);
1745
1755
  }
1746
1756
  };
1747
1757
  let O = [{ title: "Title", dataIndex: "title", sorter: !0 }];
1748
1758
  return a && (O.push({ title: "Type", dataIndex: "contentType", sorter: !0 }), O.push({
1749
1759
  title: "Status",
1750
- render: (I, _) => /* @__PURE__ */ x("span", { children: [
1751
- _.status === 0 && /* @__PURE__ */ i(R, { color: "blue", children: "Published" }),
1752
- _.status === 1 && /* @__PURE__ */ i(R, { color: "gold", children: "Draft" }),
1753
- _.status === 2 && /* @__PURE__ */ i(R, { color: "magenta", children: "Trashed" }),
1754
- _.status === 3 && /* @__PURE__ */ i(R, { color: "purple", children: "Published with Pending Updates" })
1760
+ render: (T, I) => /* @__PURE__ */ x("span", { children: [
1761
+ I.status === 0 && /* @__PURE__ */ i(R, { color: "blue", children: "Published" }),
1762
+ I.status === 1 && /* @__PURE__ */ i(R, { color: "gold", children: "Draft" }),
1763
+ I.status === 2 && /* @__PURE__ */ i(R, { color: "magenta", children: "Trashed" }),
1764
+ I.status === 3 && /* @__PURE__ */ i(R, { color: "purple", children: "Published with Pending Updates" })
1755
1765
  ] })
1756
1766
  })), /* @__PURE__ */ x("div", { children: [
1757
1767
  /* @__PURE__ */ x(Ve, { gutter: [16, 16], className: "mb-3", children: [
1758
1768
  /* @__PURE__ */ i(Q, { xs: 12 }),
1759
- /* @__PURE__ */ i(Q, { xs: 12, children: /* @__PURE__ */ i(An, { id: "keyword", placeholder: "search", onSearch: A, enterButton: !0, className: "w-100", value: w, onChange: (I) => z(I.target.value), loading: d }) }),
1760
- t && /* @__PURE__ */ i(Q, { xs: 24, children: /* @__PURE__ */ i(G, { type: "primary", className: "mr-2", disabled: D.length === 0, onClick: () => q(), children: "Select" }) })
1769
+ /* @__PURE__ */ i(Q, { xs: 12, children: /* @__PURE__ */ i(Kn, { id: "keyword", placeholder: "search", onSearch: E, enterButton: !0, className: "w-100", value: p, onChange: (T) => M(T.target.value), loading: d }) }),
1770
+ t && /* @__PURE__ */ i(Q, { xs: 24, children: /* @__PURE__ */ i(W, { type: "primary", className: "mr-2", disabled: D.length === 0, onClick: () => q(), children: "Select" }) })
1761
1771
  ] }),
1762
1772
  /* @__PURE__ */ i(
1763
1773
  ae,
1764
1774
  {
1765
1775
  dataSource: h,
1766
- rowKey: (I) => I.id,
1776
+ rowKey: (T) => T.id,
1767
1777
  pagination: m,
1768
1778
  loading: d,
1769
1779
  size: "middle",
1770
1780
  className: "clear-both pointer",
1771
1781
  onChange: ne,
1772
1782
  expandable: {
1773
- expandedRowRender: (I) => /* @__PURE__ */ i("table", { children: /* @__PURE__ */ i("tbody", { children: I.meta.values.filter((_) => _.label.toLowerCase().indexOf("url") > -1).map((_, L) => {
1774
- let j = _.fullValue ?? _.value;
1775
- return j = j?.indexOf("Z") > -1 && de(j).isValid() ? _e.dateFormat(j) : j, j = j?.replace(/(<([^>]+)>)/gi, "", ""), /* @__PURE__ */ x("tr", { children: [
1776
- /* @__PURE__ */ i("td", { style: { verticalAlign: "top", minWidth: 150 }, children: _.label }),
1777
- /* @__PURE__ */ i("td", { children: /* @__PURE__ */ i("span", { children: j || "" }) })
1778
- ] }, L);
1783
+ expandedRowRender: (T) => /* @__PURE__ */ i("table", { children: /* @__PURE__ */ i("tbody", { children: T.meta.values.filter((I) => I.label.toLowerCase().indexOf("url") > -1).map((I, j) => {
1784
+ let L = I.fullValue ?? I.value;
1785
+ return L = L?.indexOf("Z") > -1 && de(L).isValid() ? Ie.dateFormat(L) : L, L = L?.replace(/(<([^>]+)>)/gi, "", ""), /* @__PURE__ */ x("tr", { children: [
1786
+ /* @__PURE__ */ i("td", { style: { verticalAlign: "top", minWidth: 150 }, children: I.label }),
1787
+ /* @__PURE__ */ i("td", { children: /* @__PURE__ */ i("span", { children: L || "" }) })
1788
+ ] }, j);
1779
1789
  }) }) })
1780
1790
  },
1781
1791
  rowSelection: t && {
@@ -1784,9 +1794,9 @@ function En({ contentTypes: e, isMany: t, isEcommerce: n, onSuccess: r, showDeta
1784
1794
  selectedRowKeys: D,
1785
1795
  hideSelectAll: !0
1786
1796
  },
1787
- onRow: (I, _) => ({
1788
- onClick: (L) => {
1789
- !t && q(I);
1797
+ onRow: (T, I) => ({
1798
+ onClick: (j) => {
1799
+ !t && q(T);
1790
1800
  }
1791
1801
  }),
1792
1802
  columns: O
@@ -1794,7 +1804,7 @@ function En({ contentTypes: e, isMany: t, isEcommerce: n, onSuccess: r, showDeta
1794
1804
  )
1795
1805
  ] });
1796
1806
  }
1797
- const Vn = ({
1807
+ const Jn = ({
1798
1808
  slug: e,
1799
1809
  value: t,
1800
1810
  label: n,
@@ -1808,34 +1818,34 @@ const Vn = ({
1808
1818
  values: h,
1809
1819
  error: u,
1810
1820
  errors: f,
1811
- className: y,
1812
- placeholder: w,
1813
- disabled: z
1821
+ className: S,
1822
+ placeholder: p,
1823
+ disabled: M
1814
1824
  }) => {
1815
- const [N, c] = v(l || []), [m, M] = v(!1), [C, b] = v(null), D = r.referenceAmount !== "1";
1825
+ const [N, c] = v(l || []), [m, z] = v(!1), [C, b] = v(null), D = r.referenceAmount !== "1";
1816
1826
  if (!e)
1817
1827
  throw Error("ReferenceInput property: slug required");
1818
1828
  !t && h && h[e] && (t = h[e]), !u && f && f[e] && (u = f[e]);
1819
1829
  const J = (F) => {
1820
- const q = F.filter((I) => !N.some((_) => I.id === _.id)), O = N.concat(q);
1821
- c(O), A(O), M(!1);
1830
+ const q = F.filter((T) => !N.some((I) => T.id === I.id)), O = N.concat(q);
1831
+ c(O), E(O), z(!1);
1822
1832
  }, ne = (F) => {
1823
1833
  var q = N.findIndex((O) => O.id === F.id);
1824
1834
  if (q > -1) {
1825
1835
  let O = [...N];
1826
- O.splice(q, 1), c(O), A(O);
1836
+ O.splice(q, 1), c(O), E(O);
1827
1837
  }
1828
- }, A = (F) => {
1829
- const q = F.map((O, I) => O.id).join(",");
1838
+ }, E = (F) => {
1839
+ const q = F.map((O, T) => O.id).join(",");
1830
1840
  a.setFieldsValue({ [e]: q }), s && s(e, q);
1831
1841
  };
1832
1842
  return Y(() => {
1833
1843
  c(l || []);
1834
1844
  }, [l]), Y(() => {
1835
1845
  C && setShowEdit(!0);
1836
- }, [C]), /* @__PURE__ */ x(T.Item, { label: n, className: y, children: [
1846
+ }, [C]), /* @__PURE__ */ x(_.Item, { label: n, className: S, children: [
1837
1847
  /* @__PURE__ */ x("div", { className: "text-center", children: [
1838
- (D || !D && N.length === 0) && /* @__PURE__ */ i(H, { children: /* @__PURE__ */ i(G, { type: "primary", className: "my-2", onClick: () => M(!0), children: "Select" }) }),
1848
+ (D || !D && N.length === 0) && /* @__PURE__ */ i(H, { children: /* @__PURE__ */ i(W, { type: "primary", className: "my-2", onClick: () => z(!0), children: "Select" }) }),
1839
1849
  N.length > 0 && /* @__PURE__ */ i(
1840
1850
  ae,
1841
1851
  {
@@ -1858,18 +1868,18 @@ const Vn = ({
1858
1868
  {
1859
1869
  title: "",
1860
1870
  width: "50px",
1861
- render: (F, q) => /* @__PURE__ */ i(Be, { title: "Are you sure you want to delete this?", onConfirm: () => ne(q), okText: "Yes", cancelText: "No", children: /* @__PURE__ */ i(G, { type: "primary", danger: !0, children: /* @__PURE__ */ i(rt, {}) }) })
1871
+ render: (F, q) => /* @__PURE__ */ i(Be, { title: "Are you sure you want to delete this?", onConfirm: () => ne(q), okText: "Yes", cancelText: "No", children: /* @__PURE__ */ i(W, { type: "primary", danger: !0, children: /* @__PURE__ */ i(rt, {}) }) })
1862
1872
  }
1863
1873
  ]
1864
1874
  }
1865
1875
  )
1866
1876
  ] }),
1867
- /* @__PURE__ */ i(T.Item, { name: e, initialValue: t, hidden: !d, rules: [{ required: g, message: "Required" }], children: /* @__PURE__ */ i(V, {}) }),
1868
- /* @__PURE__ */ i(Ue, { open: m, title: "Search References", height: "90%", placement: "bottom", onClose: () => M(!1), children: /* @__PURE__ */ i(En, { contentTypes: r.referenceTypes, isMany: D, onSuccess: J }) })
1877
+ /* @__PURE__ */ i(_.Item, { name: e, initialValue: t, hidden: !d, rules: [{ required: g, message: "Required" }], children: /* @__PURE__ */ i(V, {}) }),
1878
+ /* @__PURE__ */ i(Ue, { open: m, title: "Search References", height: "90%", placement: "bottom", onClose: () => z(!1), children: /* @__PURE__ */ i(Yn, { contentTypes: r.referenceTypes, isMany: D, onSuccess: J }) })
1869
1879
  ] });
1870
- }, Bn = {
1880
+ }, Wn = {
1871
1881
  hasJsonStructure: st,
1872
- parseJson: Un
1882
+ parseJson: Gn
1873
1883
  };
1874
1884
  function st(e) {
1875
1885
  if (typeof e != "string") return !1;
@@ -1880,12 +1890,12 @@ function st(e) {
1880
1890
  return !1;
1881
1891
  }
1882
1892
  }
1883
- function Un(e) {
1893
+ function Gn(e) {
1884
1894
  return st(e) ? JSON.parse(e) : JSON.parse("{}");
1885
1895
  }
1886
- const Kn = (e, t) => {
1896
+ const Zn = (e, t) => {
1887
1897
  let { properties: n, loading: r, onSubmit: a, hideSubmit: s, onFieldsChange: l, layout: d, entityId: g, debug: h = !1 } = e;
1888
- const [u] = T.useForm(), f = d === "vertical" ? 24 : 4, y = d === "vertical" ? 24 : 20, w = d === "vertical" ? 0 : 4;
1898
+ const [u] = _.useForm(), f = d === "vertical" ? 24 : 4, S = d === "vertical" ? 24 : 20, p = d === "vertical" ? 0 : 4;
1889
1899
  gt(t, () => ({
1890
1900
  validate(c) {
1891
1901
  u.validateFields().then((m) => {
@@ -1895,25 +1905,25 @@ const Kn = (e, t) => {
1895
1905
  });
1896
1906
  }
1897
1907
  })), Y(() => {
1898
- let c = n.reduce((M, C) => ({ ...M, [C.slug]: C.value }), {});
1908
+ let c = n.reduce((z, C) => ({ ...z, [C.slug]: C.value }), {});
1899
1909
  u.setFieldsValue({ ...c });
1900
1910
  const m = new URLSearchParams(window.location.search);
1901
1911
  m.get("utm_source") && localStorage.setItem("utm_source", m.get("utm_source")), m.get("utm_medium") && localStorage.setItem("utm_medium", m.get("utm_medium")), m.get("utm_campaign") && localStorage.setItem("utm_campaign", m.get("utm_campaign")), m.get("utm_term") && localStorage.setItem("utm_term", m.get("utm_term")), m.get("utm_content") && localStorage.setItem("utm_content", m.get("utm_content"));
1902
1912
  }, [n]);
1903
- const z = (c) => {
1904
- for (let M in c)
1905
- c[M] = Array.isArray(c[M]) ? JSON.stringify(c[M]) : c[M];
1913
+ const M = (c) => {
1914
+ for (let z in c)
1915
+ c[z] = Array.isArray(c[z]) ? JSON.stringify(c[z]) : c[z];
1906
1916
  let m = {};
1907
1917
  localStorage.getItem("utm_source") && (m.source = localStorage.getItem("utm_source")), localStorage.getItem("utm_medium") && (m.medium = localStorage.getItem("utm_medium")), localStorage.getItem("utm_campaign") && (m.campaign = localStorage.getItem("utm_campaign")), localStorage.getItem("utm_term") && (m.term = localStorage.getItem("utm_term")), localStorage.getItem("utm_content") && (m.content = localStorage.getItem("utm_content")), a(c, m);
1908
1918
  }, N = (c) => {
1909
1919
  l && l(c[0].name[0], c[0].value);
1910
1920
  };
1911
- return n.length === 0 ? s ? /* @__PURE__ */ i(H, {}) : /* @__PURE__ */ i("div", { children: "There are no properties at this time." }) : /* @__PURE__ */ i("div", { children: /* @__PURE__ */ x(T, { form: u, labelCol: { span: f }, wrapperCol: { span: y }, onFinish: z, onFieldsChange: N, layout: d, children: [
1921
+ return n.length === 0 ? s ? /* @__PURE__ */ i(H, {}) : /* @__PURE__ */ i("div", { children: "There are no properties at this time." }) : /* @__PURE__ */ i("div", { children: /* @__PURE__ */ x(_, { form: u, labelCol: { span: f }, wrapperCol: { span: S }, onFinish: M, onFieldsChange: N, layout: d, children: [
1912
1922
  n.map((c, m) => {
1913
- switch (c.opts = Bn.parseJson(c.options), c.fieldType) {
1923
+ switch (c.opts = Wn.parseJson(c.options), c.fieldType) {
1914
1924
  case 1:
1915
1925
  return /* @__PURE__ */ i(
1916
- T.Item,
1926
+ _.Item,
1917
1927
  {
1918
1928
  label: c.label,
1919
1929
  name: c.slug,
@@ -1929,7 +1939,7 @@ const Kn = (e, t) => {
1929
1939
  );
1930
1940
  case 2:
1931
1941
  return /* @__PURE__ */ i(
1932
- T.Item,
1942
+ _.Item,
1933
1943
  {
1934
1944
  label: c.label,
1935
1945
  name: c.slug,
@@ -1944,7 +1954,7 @@ const Kn = (e, t) => {
1944
1954
  );
1945
1955
  case 3:
1946
1956
  return /* @__PURE__ */ i(
1947
- T.Item,
1957
+ _.Item,
1948
1958
  {
1949
1959
  label: c.label,
1950
1960
  name: c.slug,
@@ -1961,39 +1971,39 @@ const Kn = (e, t) => {
1961
1971
  m
1962
1972
  );
1963
1973
  case 4:
1964
- return /* @__PURE__ */ i(T.Item, { label: c.label, name: c.slug, initialValue: c.value, rules: [{ required: c.isRequired, message: "Required" }], children: /* @__PURE__ */ i(V.Password, { placeholder: c.opts?.placeholder || "" }) }, m);
1974
+ return /* @__PURE__ */ i(_.Item, { label: c.label, name: c.slug, initialValue: c.value, rules: [{ required: c.isRequired, message: "Required" }], children: /* @__PURE__ */ i(V.Password, { placeholder: c.opts?.placeholder || "" }) }, m);
1965
1975
  case 5:
1966
1976
  // basic paragraph
1967
1977
  case 6:
1968
- return /* @__PURE__ */ i(T.Item, { label: c.label, name: c.slug, initialValue: c.value, rules: [{ required: c.isRequired, message: "Required" }], children: /* @__PURE__ */ i(V.TextArea, { placeholder: c.opts?.placeholder || "" }) }, m);
1978
+ return /* @__PURE__ */ i(_.Item, { label: c.label, name: c.slug, initialValue: c.value, rules: [{ required: c.isRequired, message: "Required" }], children: /* @__PURE__ */ i(V.TextArea, { placeholder: c.opts?.placeholder || "" }) }, m);
1969
1979
  //case 6: // wysiwyg
1970
1980
  //return <WysiwygInput {...o} form={form} onChange={onFieldsChange} key={i} debug={debug} />;
1971
1981
  case 7:
1972
- return c.value = c.value ? de(c.value) : "", /* @__PURE__ */ E(ge, { ...c, key: m, showTime: !0 });
1982
+ return c.value = c.value ? de(c.value) : "", /* @__PURE__ */ A(ge, { ...c, key: m, showTime: !0 });
1973
1983
  case 8:
1974
- return c.value = c.value ? de(c.value) : "", /* @__PURE__ */ E(ge, { ...c, key: m });
1984
+ return c.value = c.value ? de(c.value) : "", /* @__PURE__ */ A(ge, { ...c, key: m });
1975
1985
  case 9:
1976
- return c.value = c.value ? de(c.value) : "", /* @__PURE__ */ E(ge, { ...c, key: m });
1986
+ return c.value = c.value ? de(c.value) : "", /* @__PURE__ */ A(ge, { ...c, key: m });
1977
1987
  case 10:
1978
- return /* @__PURE__ */ E(Re, { ...c, key: m });
1988
+ return /* @__PURE__ */ A(Re, { ...c, key: m });
1979
1989
  case 11:
1980
- return /* @__PURE__ */ E(Re, { ...c, key: m, type: "currency" });
1990
+ return /* @__PURE__ */ A(Re, { ...c, key: m, type: "currency" });
1981
1991
  case 12:
1982
- return /* @__PURE__ */ E(qn, { ...c, form: u, onChange: l, key: m, debug: h, contentId: g });
1992
+ return /* @__PURE__ */ A(Hn, { ...c, form: u, onChange: l, key: m, debug: h, contentId: g });
1983
1993
  case 13:
1984
- return /* @__PURE__ */ E(Vn, { ...c, form: u, onChange: l, key: m, debug: h });
1994
+ return /* @__PURE__ */ A(Jn, { ...c, form: u, onChange: l, key: m, debug: h });
1985
1995
  case 14:
1986
1996
  return /* @__PURE__ */ i(H, {});
1987
1997
  case 15:
1988
- return /* @__PURE__ */ E(_t, { ...c, key: m });
1998
+ return /* @__PURE__ */ A(Mt, { ...c, key: m });
1989
1999
  case 16:
1990
- return /* @__PURE__ */ E(It, { ...c, key: m });
2000
+ return /* @__PURE__ */ A(Rt, { ...c, key: m });
1991
2001
  case 17:
1992
2002
  return /* @__PURE__ */ i(H, {});
1993
2003
  case 18:
1994
- return /* @__PURE__ */ i(T.Item, { children: /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: c.label } }) }, m);
2004
+ return /* @__PURE__ */ i(_.Item, { children: /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: c.label } }) }, m);
1995
2005
  case 19:
1996
- return /* @__PURE__ */ E(kt, { ...c, key: m, debug: h });
2006
+ return /* @__PURE__ */ A(qt, { ...c, key: m, debug: h });
1997
2007
  case 20:
1998
2008
  return /* @__PURE__ */ i(H, {});
1999
2009
  case 21:
@@ -2001,26 +2011,26 @@ const Kn = (e, t) => {
2001
2011
  case 22:
2002
2012
  return /* @__PURE__ */ i(H, {});
2003
2013
  case 23:
2004
- return /* @__PURE__ */ E(Ct, { ...c, key: m, debug: h });
2014
+ return /* @__PURE__ */ A(zt, { ...c, key: m, debug: h });
2005
2015
  case 24:
2006
- return /* @__PURE__ */ i(T.Item, { label: /* @__PURE__ */ i("strong", { className: "mt-3", children: c.label }), name: c.slug, children: /* @__PURE__ */ i("hr", {}) }, m);
2016
+ return /* @__PURE__ */ i(_.Item, { label: /* @__PURE__ */ i("strong", { className: "mt-3", children: c.label }), name: c.slug, children: /* @__PURE__ */ i("hr", {}) }, m);
2007
2017
  default:
2008
- return /* @__PURE__ */ i(T.Item, { label: c.label, name: c.slug, initialValue: c.value, rules: [{ required: c.isRequired, message: "Required" }], children: /* @__PURE__ */ i(V, { placeholder: c.opts?.placeholder || "" }) }, m);
2018
+ return /* @__PURE__ */ i(_.Item, { label: c.label, name: c.slug, initialValue: c.value, rules: [{ required: c.isRequired, message: "Required" }], children: /* @__PURE__ */ i(V, { placeholder: c.opts?.placeholder || "" }) }, m);
2009
2019
  }
2010
2020
  }),
2011
- !s && /* @__PURE__ */ i(T.Item, { wrapperCol: { span: f, offset: w }, children: /* @__PURE__ */ i(G, { type: "primary", htmlType: "submit", loading: r, children: "Submit" }) })
2021
+ !s && /* @__PURE__ */ i(_.Item, { wrapperCol: { span: f, offset: p }, children: /* @__PURE__ */ i(W, { type: "primary", htmlType: "submit", loading: r, children: "Submit" }) })
2012
2022
  ] }) });
2013
- }, Yn = mt(Kn), Ae = {
2014
- getForm: Jn,
2015
- submitForm: Gn
2023
+ }, Qn = mt(Zn), Ee = {
2024
+ getForm: Xn,
2025
+ submitForm: er
2016
2026
  };
2017
- function Jn(e) {
2027
+ function Xn(e) {
2018
2028
  return k.getData(`/v1/form/${e}`, !1);
2019
2029
  }
2020
- function Gn(e, t = !1) {
2030
+ function er(e, t = !1) {
2021
2031
  return k.postData("/v1/form/submission", e, t);
2022
2032
  }
2023
- const tr = ({ formId: e, appKey: t }) => {
2033
+ const sr = ({ formId: e, appKey: t }) => {
2024
2034
  const [n, r] = v(null), [a, s] = v("");
2025
2035
  Y(() => {
2026
2036
  if (!e) {
@@ -2031,7 +2041,7 @@ const tr = ({ formId: e, appKey: t }) => {
2031
2041
  console.log("appKey is required to use the StormForm component");
2032
2042
  return;
2033
2043
  }
2034
- localStorage.setItem("appKey", t), Ae.getForm(e).then((d) => {
2044
+ localStorage.setItem("appKey", t), Ee.getForm(e).then((d) => {
2035
2045
  r(d);
2036
2046
  }).catch((d) => {
2037
2047
  console.error(d);
@@ -2043,17 +2053,17 @@ const tr = ({ formId: e, appKey: t }) => {
2043
2053
  props: d,
2044
2054
  utmValues: g
2045
2055
  };
2046
- Ae.submitForm(h).then((u) => {
2056
+ Ee.submitForm(h).then((u) => {
2047
2057
  u.type === "redirect" ? window.location.href = u.value : s(u.value);
2048
2058
  }).catch((u) => {
2049
2059
  console.error(u);
2050
2060
  });
2051
2061
  };
2052
2062
  return n ? /* @__PURE__ */ x(H, { children: [
2053
- !a && /* @__PURE__ */ i(Yn, { properties: n.properties, onSubmit: l }),
2063
+ !a && /* @__PURE__ */ i(Qn, { properties: n.properties, onSubmit: l }),
2054
2064
  a && /* @__PURE__ */ i("div", { className: "text-center", children: /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: a } }) })
2055
2065
  ] }) : /* @__PURE__ */ i(H, {});
2056
2066
  };
2057
2067
  export {
2058
- tr as default
2068
+ sr as default
2059
2069
  };