dynamic-mui 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/{index-B7i3cvH0.mjs → AIForm-DtRl0WdY.mjs} +4186 -4359
  2. package/dist/AIForm-Dv8ahXyE.js +43 -0
  3. package/dist/accordion-BaiGxDcw.js +1 -0
  4. package/dist/{accordion-Bc3bEKtC.mjs → accordion-xg_TxxYS.mjs} +1 -1
  5. package/dist/{addressfield-bU-3Rnkq.mjs → addressfield-BvQEHdEk.mjs} +1 -1
  6. package/dist/addressfield-vVizrbZP.js +1 -0
  7. package/dist/ai/index.cjs +1 -0
  8. package/dist/ai/index.mjs +14 -0
  9. package/dist/{asyncautocomplete-BojHePYN.mjs → asyncautocomplete-AmSRs7PY.mjs} +19 -19
  10. package/dist/asyncautocomplete-Dtmxh4l1.js +1 -0
  11. package/dist/bar-BiIzbOC3.js +1 -0
  12. package/dist/{bar-DUZXtBln.mjs → bar-DNc7TMKj.mjs} +1 -1
  13. package/dist/{cascadeselect-CMqn7Tql.mjs → cascadeselect-BlznIKS6.mjs} +16 -16
  14. package/dist/cascadeselect-DqLtG-W9.js +1 -0
  15. package/dist/colorpicker-DpLvK1WR.js +1 -0
  16. package/dist/{colorpicker-CXWSUm_s.mjs → colorpicker-hP3b7teC.mjs} +2 -2
  17. package/dist/consentfield-B21l9tGo.js +1 -0
  18. package/dist/{consentfield-DxqzSUsQ.mjs → consentfield-CGT98YbR.mjs} +8 -8
  19. package/dist/{datatable-vq0d5mZg.mjs → datatable-B_6wXh2g.mjs} +1 -1
  20. package/dist/datatable-Bv0Q37Zy.js +1 -0
  21. package/dist/dynamic-mui.cjs +1 -1
  22. package/dist/dynamic-mui.d.ts +2 -0
  23. package/dist/dynamic-mui.mjs +207 -33
  24. package/dist/editabletable-D3c3DJxX.js +1 -0
  25. package/dist/{editabletable-C5eH6sPe.mjs → editabletable-YaFqdLvf.mjs} +13 -13
  26. package/dist/fileupload--KzSGb5a.js +1 -0
  27. package/dist/{fileupload-XnztToJ2.mjs → fileupload-ZBi72f1R.mjs} +11 -11
  28. package/dist/formrepeater-BhUEa4BI.js +1 -0
  29. package/dist/{formrepeater-CDhYRFqz.mjs → formrepeater-Cwgtvz1c.mjs} +8 -8
  30. package/dist/formwizard-BlozHDc_.js +1 -0
  31. package/dist/{formwizard-C2QaC746.mjs → formwizard-CYcgf5jL.mjs} +1 -1
  32. package/dist/geofield-BynrTSVm.js +1 -0
  33. package/dist/{geofield-_dw7uIT2.mjs → geofield-xqZy_DAY.mjs} +12 -12
  34. package/dist/{group-CZgTXmJP.mjs → group-DmLN-b09.mjs} +1 -1
  35. package/dist/group-Dtju1rHQ.js +1 -0
  36. package/dist/intlphone-BeHXAcFi.js +1 -0
  37. package/dist/{intlphone-357BAzba.mjs → intlphone-CXUQP9Gp.mjs} +5 -5
  38. package/dist/{keyvaluefield-BRX83BRS.mjs → keyvaluefield-BJoEbe4I.mjs} +13 -13
  39. package/dist/keyvaluefield-BZQDG0l5.js +1 -0
  40. package/dist/{line-JDUXJ2fy.mjs → line-B3CAbZOo.mjs} +1 -1
  41. package/dist/line-tIm99vYW.js +1 -0
  42. package/dist/{lineitemlist-D84p4ZC5.mjs → lineitemlist-CBSqoC9g.mjs} +7 -7
  43. package/dist/lineitemlist-RqStjYB-.js +1 -0
  44. package/dist/{list-B6gocnmr.mjs → list-C8QMpJOJ.mjs} +2 -2
  45. package/dist/list-D_cawpPI.js +1 -0
  46. package/dist/locationfield-BiLy-c09.js +1 -0
  47. package/dist/{locationfield-En3apdDQ.mjs → locationfield-KBbu-98L.mjs} +39 -39
  48. package/dist/{markdowneditor-B0CYYefE.mjs → markdowneditor-DFOgRmdL.mjs} +1 -1
  49. package/dist/markdowneditor-Dy7Q01FM.js +2 -0
  50. package/dist/{matrixfield-D9IJr1qQ.mjs → matrixfield-0lnuaEks.mjs} +7 -7
  51. package/dist/matrixfield-nWt6Cug5.js +1 -0
  52. package/dist/{multitextbox-CrHH_t_8.mjs → multitextbox-DmAWV163.mjs} +23 -23
  53. package/dist/multitextbox-oEgl2F8-.js +1 -0
  54. package/dist/{npsscale-BS-ooCks.mjs → npsscale-CdTEwERY.mjs} +12 -12
  55. package/dist/npsscale-DW4sxcLz.js +1 -0
  56. package/dist/{numberstepper-Dc7wEzfb.mjs → numberstepper-BwQ5coLc.mjs} +8 -8
  57. package/dist/numberstepper-cDosevJb.js +1 -0
  58. package/dist/{pie-BpGQ6Aor.mjs → pie-CBRckgd4.mjs} +1 -1
  59. package/dist/pie-gAfuDR1F.js +1 -0
  60. package/dist/richtexteditor-DI-h5Efn.js +1 -0
  61. package/dist/{richtexteditor-DHDVUoic.mjs → richtexteditor-xrbv8PXZ.mjs} +1 -1
  62. package/dist/{signature-Twiet_Pp.mjs → signature-CP_lA_Yh.mjs} +1 -1
  63. package/dist/{signature-CDaNiDTO.js → signature-FM6L60nk.js} +2 -2
  64. package/dist/{stepper-PK1xI0po.mjs → stepper-BprezTzX.mjs} +4 -4
  65. package/dist/stepper-CjGNFyBz.js +1 -0
  66. package/dist/{summaryfield-CDDYwbfV.mjs → summaryfield-5mJRwVZ4.mjs} +5 -5
  67. package/dist/summaryfield-C3xmqZQp.js +1 -0
  68. package/dist/tabs-B4P59kHX.js +1 -0
  69. package/dist/{tabs-BJ9HBvyr.mjs → tabs-By-Mm8vm.mjs} +1 -1
  70. package/dist/tagsinput-BwM3NYK_.js +1 -0
  71. package/dist/{tagsinput-B2W--DfP.mjs → tagsinput-Ce4EWy4i.mjs} +10 -10
  72. package/package.json +6 -1
  73. package/dist/accordion-CI-d8sBW.js +0 -1
  74. package/dist/addressfield-BVtAZyuA.js +0 -1
  75. package/dist/asyncautocomplete-CGUaYa8k.js +0 -1
  76. package/dist/bar-D-Mi7Kmk.js +0 -1
  77. package/dist/cascadeselect-Cu_sJIFt.js +0 -1
  78. package/dist/colorpicker-C6X7x0s_.js +0 -1
  79. package/dist/consentfield-BbwsP80E.js +0 -1
  80. package/dist/datatable-BThXDunv.js +0 -1
  81. package/dist/editabletable-Bv2TfEOc.js +0 -1
  82. package/dist/fileupload-CmWZnxyT.js +0 -1
  83. package/dist/formrepeater-COl6gNZi.js +0 -1
  84. package/dist/formwizard-hlQ_NCsd.js +0 -1
  85. package/dist/geofield-wtSTkcE0.js +0 -1
  86. package/dist/group-D95eDbtd.js +0 -1
  87. package/dist/index-DX3lZIKI.js +0 -43
  88. package/dist/intlphone-DR5-jK9f.js +0 -1
  89. package/dist/keyvaluefield-C89E1mqp.js +0 -1
  90. package/dist/line-B_-WceU1.js +0 -1
  91. package/dist/lineitemlist-VAV6uqyg.js +0 -1
  92. package/dist/list-DFdCIA2P.js +0 -1
  93. package/dist/locationfield-DSV_O6aK.js +0 -1
  94. package/dist/markdowneditor-LUCZHsC6.js +0 -2
  95. package/dist/matrixfield-BxngfAiS.js +0 -1
  96. package/dist/multitextbox-DETwPeJY.js +0 -1
  97. package/dist/npsscale-5fQ1nTCy.js +0 -1
  98. package/dist/numberstepper-FRaiyZz0.js +0 -1
  99. package/dist/pie-DvzqIIDM.js +0 -1
  100. package/dist/richtexteditor-B7iljrHN.js +0 -1
  101. package/dist/stepper-Cf2nMTEt.js +0 -1
  102. package/dist/summaryfield-XXHz95hU.js +0 -1
  103. package/dist/tabs-B3s52APG.js +0 -1
  104. package/dist/tagsinput-Dz7D54iz.js +0 -1
@@ -4,17 +4,17 @@ import S from "@mui/material/Table";
4
4
  import I from "@mui/material/TableBody";
5
5
  import s from "@mui/material/TableCell";
6
6
  import W from "@mui/material/TableContainer";
7
- import B from "@mui/material/TableHead";
7
+ import j from "@mui/material/TableHead";
8
8
  import b from "@mui/material/TableRow";
9
- import F from "@mui/material/TextField";
10
- import $ from "@mui/material/IconButton";
11
- import j from "@mui/material/Button";
9
+ import B from "@mui/material/TextField";
10
+ import F from "@mui/material/IconButton";
11
+ import $ from "@mui/material/Button";
12
12
  import E from "@mui/material/FormControl";
13
13
  import L from "@mui/material/FormLabel";
14
14
  import M from "@mui/material/Paper";
15
15
  import P from "@mui/icons-material/Add";
16
16
  import H from "@mui/icons-material/Close";
17
- import { u as U, m as _, a as q } from "./index-B7i3cvH0.mjs";
17
+ import { j as U, m as _, k as q } from "./AIForm-DtRl0WdY.mjs";
18
18
  function x(n) {
19
19
  return Array.isArray(n) ? n.map((d) => ({ ...d || {} })) : [];
20
20
  }
@@ -22,10 +22,10 @@ function lr({ attributes: n = {}, onChange: d }) {
22
22
  const {
23
23
  MuiAttributes: g = {},
24
24
  id: v = "",
25
- columns: u = [],
25
+ columns: p = [],
26
26
  addLabel: y = "Add row",
27
- label: p
28
- } = n, { sx: C, ...k } = g, f = Array.isArray(u) ? u : [], [l, i] = z.useState(() => x(n.value));
27
+ label: u
28
+ } = n, { sx: C, ...k } = g, f = Array.isArray(p) ? p : [], [l, i] = z.useState(() => x(n.value));
29
29
  U(() => {
30
30
  i(x(n.value));
31
31
  }, [n.value]);
@@ -42,7 +42,7 @@ function lr({ attributes: n = {}, onChange: d }) {
42
42
  i(o), c(o);
43
43
  };
44
44
  return /* @__PURE__ */ m(E, { component: "fieldset", fullWidth: !0, children: [
45
- p && /* @__PURE__ */ e(L, { component: "legend", sx: { mb: 1 }, children: p }),
45
+ u && /* @__PURE__ */ e(L, { component: "legend", sx: { mb: 1 }, children: u }),
46
46
  /* @__PURE__ */ e(
47
47
  W,
48
48
  {
@@ -53,7 +53,7 @@ function lr({ attributes: n = {}, onChange: d }) {
53
53
  overflow: "hidden"
54
54
  },
55
55
  children: /* @__PURE__ */ m(S, { size: "small", children: [
56
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ m(b, { sx: { backgroundColor: "action.hover" }, children: [
56
+ /* @__PURE__ */ e(j, { children: /* @__PURE__ */ m(b, { sx: { backgroundColor: "action.hover" }, children: [
57
57
  f.map((r) => /* @__PURE__ */ e(s, { sx: { fontWeight: 600 }, children: r.label }, r.key)),
58
58
  /* @__PURE__ */ e(s, { align: "right", sx: { width: 48 } })
59
59
  ] }) }),
@@ -66,7 +66,7 @@ function lr({ attributes: n = {}, onChange: d }) {
66
66
  },
67
67
  children: [
68
68
  f.map((t) => /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
69
- F,
69
+ B,
70
70
  {
71
71
  ...k,
72
72
  type: t.type === "number" ? "number" : "text",
@@ -82,7 +82,7 @@ function lr({ attributes: n = {}, onChange: d }) {
82
82
  }
83
83
  ) }, t.key)),
84
84
  /* @__PURE__ */ e(s, { align: "right", children: /* @__PURE__ */ e(
85
- $,
85
+ F,
86
86
  {
87
87
  "aria-label": `Remove row ${o + 1}`,
88
88
  onClick: () => R(o),
@@ -103,7 +103,7 @@ function lr({ attributes: n = {}, onChange: d }) {
103
103
  }
104
104
  ),
105
105
  /* @__PURE__ */ e(
106
- j,
106
+ $,
107
107
  {
108
108
  onClick: A,
109
109
  startIcon: /* @__PURE__ */ e(P, {}),
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),i=require("@mui/material/Box"),c=require("@mui/material/Typography"),G=require("@mui/material/IconButton"),_=require("@mui/material/CircularProgress"),H=require("@mui/icons-material/CloudUpload"),J=require("@mui/icons-material/Close"),K=require("@mui/icons-material/InsertDriveFile"),b=require("./AIForm-Dv8ahXyE.js"),N=require("./s3Upload-B0JeoLkS.js"),R=o=>o?Array.isArray(o)?o.filter(Boolean):[o]:[],Q=o=>/^data:image\//i.test(o)||/\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(o),V=o=>new Promise((f,x)=>{const s=new FileReader;s.onload=()=>f(s.result||""),s.onerror=()=>x(s.error),s.readAsDataURL(o)});function W({attributes:o={},rules:f={},onChange:x}){const{id:s="",multiple:d=!1,accept:g="",bucket:A="",region:C="",identityPoolId:F="",path:z="",maxSizeMB:h=0,label:j="Upload file",MuiAttributes:B={}}=o,S=l.useRef(null),[p,m]=l.useState(R(o.value)),[w,v]=l.useState(!1),[P,U]=l.useState(!1),[q,y]=l.useState(""),$=f?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1;b.useUpdateEffect(()=>{m(R(o.value))},[o.value]);const D=(e,t)=>{x?.({id:s,value:d?e:e[0]??"",option:t})},k=async e=>{const t=Array.from(e);if(!t.length)return;y(""),U(!0);const a=[],u=[];try{for(const n of t){if(h&&n.size>h*1024*1024){y(`"${n.name}" exceeds the ${h}MB limit.`);continue}const O=await V(n),E=await N.uploadToS3(O,n.name,A,C,F,z);a.push(E),u.push(n)}}catch(n){console.error("FileUpload failed",n),y("Upload failed. Please try again.")}finally{U(!1)}if(!a.length)return;const I=d?[...p,...a]:a.slice(0,1);m(I),D(I,u)},M=e=>{e.target.files&&k(e.target.files),e.target.value=""},T=e=>{e.preventDefault(),v(!1),e.dataTransfer?.files?.length&&k(e.dataTransfer.files)},L=e=>{const t=p.filter((a,u)=>u!==e);m(t),D(t)};return r.jsxs(i,{sx:{width:"100%",...B.sx},children:[r.jsxs(c,{variant:"subtitle2",gutterBottom:!0,sx:{display:"flex"},children:[j,$&&r.jsx(i,{component:"span",sx:{color:"error.main",ml:.5},children:"*"})]}),r.jsx("input",{ref:S,type:"file",hidden:!0,multiple:d,accept:g||void 0,onChange:M}),r.jsxs(i,{role:"button","aria-label":j,onClick:()=>S.current?.click(),onDragOver:e=>{e.preventDefault(),v(!0)},onDragLeave:()=>v(!1),onDrop:T,sx:{border:"2px dashed",borderColor:w?"primary.main":"divider",borderRadius:"12px",p:3,textAlign:"center",cursor:"pointer",transition:"all .2s",bgcolor:w?"action.hover":"background.paper","&:hover":{borderColor:"primary.main",bgcolor:"action.hover"}},children:[P?r.jsx(_,{size:28}):r.jsx(H,{sx:{fontSize:40,color:"primary.main"}}),r.jsxs(c,{variant:"body2",sx:{mt:1},children:["Drag & drop ",d?"files":"a file"," here, or click to browse"]}),g&&r.jsxs(c,{variant:"caption",color:"text.secondary",children:["Accepted: ",g]})]}),q&&r.jsx(c,{variant:"caption",color:"error.main",sx:{display:"block",mt:1},children:q}),p.length>0&&r.jsx(i,{sx:b.mergeSx(b.premiumSurfaceSx,{mt:1.5,p:1}),children:p.map((e,t)=>r.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:1.5,p:1,borderRadius:"8px",transition:"background-color .18s","&:hover":{bgcolor:"action.hover"}},children:[Q(e)?r.jsx(i,{component:"img",src:e,alt:`upload-${t}`,sx:{width:40,height:40,objectFit:"cover",borderRadius:"8px",flexShrink:0}}):r.jsx(K,{color:"action",sx:{flexShrink:0}}),r.jsx(c,{variant:"body2",sx:{flexGrow:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.split("/").pop()?.split("?")[0]||e}),r.jsx(G,{size:"small","aria-label":"remove",onClick:a=>{a.stopPropagation(),L(t)},children:r.jsx(J,{fontSize:"small"})})]},`${e}-${t}`))})]})}exports.default=W;
@@ -7,7 +7,7 @@ import H from "@mui/material/CircularProgress";
7
7
  import J from "@mui/icons-material/CloudUpload";
8
8
  import K from "@mui/icons-material/Close";
9
9
  import N from "@mui/icons-material/InsertDriveFile";
10
- import { u as Q, m as V, b as W } from "./index-B7i3cvH0.mjs";
10
+ import { j as Q, m as V, l as W } from "./AIForm-DtRl0WdY.mjs";
11
11
  import { u as X } from "./s3Upload-dpioZ2c8.mjs";
12
12
  const R = (r) => r ? Array.isArray(r) ? r.filter(Boolean) : [r] : [], Y = (r) => /^data:image\//i.test(r) || /\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(r), Z = (r) => new Promise((u, g) => {
13
13
  const a = new FileReader();
@@ -24,8 +24,8 @@ function de({ attributes: r = {}, rules: u = {}, onChange: g }) {
24
24
  path: $ = "",
25
25
  maxSizeMB: x = 0,
26
26
  label: w = "Upload file",
27
- MuiAttributes: P = {}
28
- } = r, D = _(null), [d, v] = m(R(r.value)), [S, b] = m(!1), [j, U] = m(!1), [k, y] = m(""), L = u?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1;
27
+ MuiAttributes: j = {}
28
+ } = r, D = _(null), [d, v] = m(R(r.value)), [S, y] = m(!1), [P, U] = m(!1), [k, b] = m(""), L = u?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1;
29
29
  Q(() => {
30
30
  v(R(r.value));
31
31
  }, [r.value]);
@@ -34,19 +34,19 @@ function de({ attributes: r = {}, rules: u = {}, onChange: g }) {
34
34
  }, I = async (e) => {
35
35
  const o = Array.from(e);
36
36
  if (!o.length) return;
37
- y(""), U(!0);
37
+ b(""), U(!0);
38
38
  const i = [], f = [];
39
39
  try {
40
40
  for (const n of o) {
41
41
  if (x && n.size > x * 1024 * 1024) {
42
- y(`"${n.name}" exceeds the ${x}MB limit.`);
42
+ b(`"${n.name}" exceeds the ${x}MB limit.`);
43
43
  continue;
44
44
  }
45
45
  const O = await Z(n), G = await X(O, n.name, z, B, F, $);
46
46
  i.push(G), f.push(n);
47
47
  }
48
48
  } catch (n) {
49
- console.error("FileUpload failed", n), y("Upload failed. Please try again.");
49
+ console.error("FileUpload failed", n), b("Upload failed. Please try again.");
50
50
  } finally {
51
51
  U(!1);
52
52
  }
@@ -56,12 +56,12 @@ function de({ attributes: r = {}, rules: u = {}, onChange: g }) {
56
56
  }, M = (e) => {
57
57
  e.target.files && I(e.target.files), e.target.value = "";
58
58
  }, T = (e) => {
59
- e.preventDefault(), b(!1), e.dataTransfer?.files?.length && I(e.dataTransfer.files);
59
+ e.preventDefault(), y(!1), e.dataTransfer?.files?.length && I(e.dataTransfer.files);
60
60
  }, E = (e) => {
61
61
  const o = d.filter((i, f) => f !== e);
62
62
  v(o), C(o);
63
63
  };
64
- return /* @__PURE__ */ l(s, { sx: { width: "100%", ...P.sx }, children: [
64
+ return /* @__PURE__ */ l(s, { sx: { width: "100%", ...j.sx }, children: [
65
65
  /* @__PURE__ */ l(c, { variant: "subtitle2", gutterBottom: !0, sx: { display: "flex" }, children: [
66
66
  w,
67
67
  L && /* @__PURE__ */ t(s, { component: "span", sx: { color: "error.main", ml: 0.5 }, children: "*" })
@@ -84,9 +84,9 @@ function de({ attributes: r = {}, rules: u = {}, onChange: g }) {
84
84
  "aria-label": w,
85
85
  onClick: () => D.current?.click(),
86
86
  onDragOver: (e) => {
87
- e.preventDefault(), b(!0);
87
+ e.preventDefault(), y(!0);
88
88
  },
89
- onDragLeave: () => b(!1),
89
+ onDragLeave: () => y(!1),
90
90
  onDrop: T,
91
91
  sx: {
92
92
  border: "2px dashed",
@@ -100,7 +100,7 @@ function de({ attributes: r = {}, rules: u = {}, onChange: g }) {
100
100
  "&:hover": { borderColor: "primary.main", bgcolor: "action.hover" }
101
101
  },
102
102
  children: [
103
- j ? /* @__PURE__ */ t(H, { size: 28 }) : /* @__PURE__ */ t(J, { sx: { fontSize: 40, color: "primary.main" } }),
103
+ P ? /* @__PURE__ */ t(H, { size: 28 }) : /* @__PURE__ */ t(J, { sx: { fontSize: 40, color: "primary.main" } }),
104
104
  /* @__PURE__ */ l(c, { variant: "body2", sx: { mt: 1 }, children: [
105
105
  "Drag & drop ",
106
106
  p ? "files" : "a file",
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),n=require("@mui/material"),b=require("./AIForm-Dv8ahXyE.js"),C=require("./v4-CqdK_b8Y.js");function N({attributes:f={},rules:j={},onChange:o}){const{id:c="",label:g="Group",min:s=1,max:u,subFields:A=[],value:a}=f,v=j?.validation?.some(e=>e.rule==="mandatory")||!1,F=i.useMemo(()=>{if(Array.isArray(a)&&a.length>0)return a.length;const e=Number(f.count);return!isNaN(e)&&e>=s?e:s},[]),[l,I]=i.useState(F),d=i.useRef([]),m=i.useCallback(e=>(d.current[e]||(d.current[e]=C.v4()),d.current[e]),[]),y=i.useCallback(e=>{if(!o)return;const r=Array.from({length:e},(p,x)=>{const h=`${c}-group-${m(x)}`;return b.FormData(h)??{}});o({id:c,value:r})},[c,m,o]),q=e=>{let r=parseInt(e,10);(isNaN(r)||r<s)&&(r=s),u!==void 0&&r>u&&(r=u),I(r),setTimeout(()=>y(r),0)};return t.jsxs(n.Box,{sx:{width:"100%"},children:[t.jsx(n.TextField,{type:"number",size:"small",label:`Number of ${g}s`,value:l,onChange:e=>q(e.target.value),required:v,inputProps:{min:s,...u!==void 0?{max:u}:{}},InputProps:{startAdornment:t.jsx(n.InputAdornment,{position:"start",children:t.jsx(n.Icon,{fontSize:"small",children:"format_list_numbered"})})},sx:{mb:2,minWidth:200}}),Array.from({length:l},(e,r)=>{const p=`${c}-group-${m(r)}`,x=Array.isArray(a)?a[r]:void 0;return t.jsxs(n.Accordion,{defaultExpanded:r===0,sx:{mb:1},children:[t.jsx(n.AccordionSummary,{expandIcon:t.jsx(n.Icon,{children:"expand_more"}),children:t.jsxs(n.Typography,{fontWeight:600,children:[g," ",r+1]})}),t.jsx(n.AccordionDetails,{children:t.jsx(b.FormGenerator,{guid:p,data:A,patch:x??{},onChange:h=>{y(l),o&&o(h)}})})]},p)})]})}exports.default=N;
@@ -1,8 +1,8 @@
1
1
  import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
2
  import { useMemo as _, useState as $, useRef as G, useCallback as y } from "react";
3
- import { Box as P, TextField as R, InputAdornment as S, Icon as A, Accordion as T, AccordionSummary as j, Typography as z, AccordionDetails as D } from "@mui/material";
4
- import { e as M, F as W } from "./index-B7i3cvH0.mjs";
5
- import { v as k } from "./v4-BysszJq8.mjs";
3
+ import { Box as P, TextField as R, InputAdornment as S, Icon as A, Accordion as T, AccordionSummary as j, Typography as q, AccordionDetails as z } from "@mui/material";
4
+ import { q as D, F as M } from "./AIForm-DtRl0WdY.mjs";
5
+ import { v as W } from "./v4-BysszJq8.mjs";
6
6
  function H({ attributes: h = {}, rules: v = {}, onChange: o }) {
7
7
  const {
8
8
  id: s = "",
@@ -15,11 +15,11 @@ function H({ attributes: h = {}, rules: v = {}, onChange: o }) {
15
15
  if (Array.isArray(i) && i.length > 0) return i.length;
16
16
  const r = Number(h.count);
17
17
  return !isNaN(r) && r >= n ? r : n;
18
- }, []), [u, C] = $(N), c = G([]), d = y((r) => (c.current[r] || (c.current[r] = k()), c.current[r]), []), x = y((r) => {
18
+ }, []), [u, C] = $(N), c = G([]), d = y((r) => (c.current[r] || (c.current[r] = W()), c.current[r]), []), x = y((r) => {
19
19
  if (!o) return;
20
20
  const t = Array.from({ length: r }, (l, m) => {
21
21
  const p = `${s}-group-${d(m)}`;
22
- return M(p) ?? {};
22
+ return D(p) ?? {};
23
23
  });
24
24
  o({ id: s, value: t });
25
25
  }, [s, d, o]), I = (r) => {
@@ -46,13 +46,13 @@ function H({ attributes: h = {}, rules: v = {}, onChange: o }) {
46
46
  Array.from({ length: u }, (r, t) => {
47
47
  const l = `${s}-group-${d(t)}`, m = Array.isArray(i) ? i[t] : void 0;
48
48
  return /* @__PURE__ */ f(T, { defaultExpanded: t === 0, sx: { mb: 1 }, children: [
49
- /* @__PURE__ */ e(j, { expandIcon: /* @__PURE__ */ e(A, { children: "expand_more" }), children: /* @__PURE__ */ f(z, { fontWeight: 600, children: [
49
+ /* @__PURE__ */ e(j, { expandIcon: /* @__PURE__ */ e(A, { children: "expand_more" }), children: /* @__PURE__ */ f(q, { fontWeight: 600, children: [
50
50
  g,
51
51
  " ",
52
52
  t + 1
53
53
  ] }) }),
54
- /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
55
- W,
54
+ /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(
55
+ M,
56
56
  {
57
57
  guid: l,
58
58
  data: b,
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),n=require("@mui/material"),i=require("./AIForm-Dv8ahXyE.js"),y=require("./v4-CqdK_b8Y.js");function B({attributes:f={},onChange:l}){const{id:c="",guid:M,steps:x=[],patch:v={},finishLabel:j="Finish",validateSteps:d=!1,MuiAttributes:$={}}=f,[e,p]=a.useState(0),u=a.useRef(null),h=a.useMemo(()=>M||`${c}-${y.v4()}`,[]),r=Array.isArray(x)?x:[],o=Math.max(r.length-1,0),I=e>=o,R=e<=0,m=`${h}-step-${e}`,A=a.useCallback(()=>{p(t=>Math.max(t-1,0))},[]),g=a.useCallback(()=>{if(!(d&&u.current&&!u.current.validate())){if(e>=o){l?.({id:c,value:"complete",option:e});return}p(t=>Math.min(t+1,o))}},[e,o,c,l,d]),b=(t=>({borderRadius:`${i.PREMIUM_RADIUS+8}px`,textTransform:"none",fontWeight:600,px:3,transition:`box-shadow .18s ${i.PREMIUM_EASING}, transform .18s ${i.PREMIUM_EASING}`,"&:hover":{transform:"translateY(-1px)",boxShadow:`0 4px 12px ${t.palette.primary.main}22`}}));return s.jsxs(n.Box,{sx:{width:"100%"},...$,children:[s.jsx(n.Stepper,{activeStep:e,alternativeLabel:!0,sx:{mb:3,"& .MuiStepLabel-label":{fontWeight:500},"& .MuiStepIcon-root.Mui-active":{transition:`color .2s ${i.PREMIUM_EASING}`}},children:r.map((t,S)=>s.jsx(n.Step,{children:s.jsx(n.StepLabel,{children:t?.label??`Step ${S+1}`})},`${h}-label-${S}`))}),s.jsx(n.Box,{sx:{mb:3},children:r[e]&&s.jsx(i.FormGenerator,{guid:m,data:r[e].fields??[],patch:v,persistOnUnmount:!0,apiRef:u,onChange:t=>{l?.(t)}},m)}),s.jsxs(n.Box,{sx:{display:"flex",justifyContent:"space-between",gap:2},children:[s.jsx(n.Button,{variant:"outlined",onClick:A,disabled:R,sx:i.mergeSx(b),children:"Back"}),s.jsx(n.Button,{variant:"contained",onClick:g,sx:i.mergeSx(b),children:I?j:"Next"})]})]})}exports.default=B;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as b, jsx as a } from "react/jsx-runtime";
2
2
  import { useState as G, useRef as w, useMemo as B, useCallback as S } from "react";
3
3
  import { Box as l, Stepper as U, Step as j, StepLabel as C, Button as v } from "@mui/material";
4
- import { P as c, F as E, m as M, d as N } from "./index-B7i3cvH0.mjs";
4
+ import { P as c, F as E, m as M, o as N } from "./AIForm-DtRl0WdY.mjs";
5
5
  import { v as P } from "./v4-BysszJq8.mjs";
6
6
  function T({ attributes: $ = {}, onChange: n }) {
7
7
  const {
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),S=require("react"),i=require("@mui/material/Box"),$=require("@mui/material/Link"),m=require("@mui/material/TextField"),w=require("@mui/material/Typography"),o=require("./AIForm-Dv8ahXyE.js"),b=t=>{if(t&&typeof t=="object")return{lat:t.lat!==void 0&&t.lat!==null?String(t.lat):"",lng:t.lng!==void 0&&t.lng!==null?String(t.lng):""};if(typeof t=="string"&&t.includes(",")){const[c="",a=""]=t.split(",");return{lat:c.trim(),lng:a.trim()}}return{lat:"",lng:""}};function q({attributes:t={},onChange:c}){const{id:a="",label:g="",showMap:h=!1,MuiAttributes:p={}}=t,[n,u]=S.useState(()=>b(t.value));o.useUpdateEffect(()=>{u(b(t.value))},[t.value]);const f=e=>{c?.({id:a,value:{lat:e.lat,lng:e.lng},option:`${e.lat},${e.lng}`})},d=e=>s=>{const r={...n,[e]:s.target.value};u(r),f(r)},y=n.lat!==""&&n.lng!=="",x=o.mergeSx(o.premiumInputSx,p.sx),j=()=>{const e=parseFloat(n.lat),s=parseFloat(n.lng),r=.01;return`https://www.openstreetmap.org/export/embed.html?bbox=${`${s-r},${e-r},${s+r},${e+r}`}&marker=${e},${s}`};return l.jsxs(i,{id:a,children:[g?l.jsx(w,{variant:"body2",sx:{mb:.75,fontWeight:500},children:g}):null,l.jsxs(i,{sx:{display:"flex",gap:1.5,flexWrap:"wrap"},children:[l.jsx(m,{type:"number",...p,label:"Latitude",value:n.lat,onChange:d("lat"),inputProps:{"aria-label":"Latitude",step:"any"},sx:x}),l.jsx(m,{type:"number",...p,label:"Longitude",value:n.lng,onChange:d("lng"),inputProps:{"aria-label":"Longitude",step:"any"},sx:x})]}),l.jsx(i,{sx:{mt:1},children:l.jsx($,{href:`https://www.google.com/maps?q=${n.lat},${n.lng}`,target:"_blank",rel:"noreferrer",variant:"body2",children:"Open in Maps"})}),h&&y?l.jsx(i,{sx:o.mergeSx(e=>({...o.premiumSurfaceSx(e),mt:1.5})),children:l.jsx("iframe",{title:"map",width:"100%",height:"240",style:{border:0,display:"block"},src:j()})}):null]})}exports.default=q;
@@ -1,11 +1,11 @@
1
1
  import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
2
  import S from "react";
3
3
  import s from "@mui/material/Box";
4
- import L from "@mui/material/Link";
4
+ import k from "@mui/material/Link";
5
5
  import f from "@mui/material/TextField";
6
- import k from "@mui/material/Typography";
7
- import { u as C, m as b, a as F, b as j } from "./index-B7i3cvH0.mjs";
8
- const h = (t) => {
6
+ import L from "@mui/material/Typography";
7
+ import { j, m as h, k as C, l as F } from "./AIForm-DtRl0WdY.mjs";
8
+ const b = (t) => {
9
9
  if (t && typeof t == "object")
10
10
  return {
11
11
  lat: t.lat !== void 0 && t.lat !== null ? String(t.lat) : "",
@@ -23,9 +23,9 @@ function A({ attributes: t = {}, onChange: i }) {
23
23
  label: m = "",
24
24
  showMap: x = !1,
25
25
  MuiAttributes: p = {}
26
- } = t, [l, g] = S.useState(() => h(t.value));
27
- C(() => {
28
- g(h(t.value));
26
+ } = t, [l, g] = S.useState(() => b(t.value));
27
+ j(() => {
28
+ g(b(t.value));
29
29
  }, [t.value]);
30
30
  const y = (e) => {
31
31
  i?.({
@@ -36,12 +36,12 @@ function A({ attributes: t = {}, onChange: i }) {
36
36
  }, c = (e) => (o) => {
37
37
  const n = { ...l, [e]: o.target.value };
38
38
  g(n), y(n);
39
- }, $ = l.lat !== "" && l.lng !== "", d = b(F, p.sx), w = () => {
39
+ }, $ = l.lat !== "" && l.lng !== "", d = h(C, p.sx), w = () => {
40
40
  const e = parseFloat(l.lat), o = parseFloat(l.lng), n = 0.01;
41
41
  return `https://www.openstreetmap.org/export/embed.html?bbox=${`${o - n},${e - n},${o + n},${e + n}`}&marker=${e},${o}`;
42
42
  };
43
43
  return /* @__PURE__ */ u(s, { id: a, children: [
44
- m ? /* @__PURE__ */ r(k, { variant: "body2", sx: { mb: 0.75, fontWeight: 500 }, children: m }) : null,
44
+ m ? /* @__PURE__ */ r(L, { variant: "body2", sx: { mb: 0.75, fontWeight: 500 }, children: m }) : null,
45
45
  /* @__PURE__ */ u(s, { sx: { display: "flex", gap: 1.5, flexWrap: "wrap" }, children: [
46
46
  /* @__PURE__ */ r(
47
47
  f,
@@ -69,7 +69,7 @@ function A({ attributes: t = {}, onChange: i }) {
69
69
  )
70
70
  ] }),
71
71
  /* @__PURE__ */ r(s, { sx: { mt: 1 }, children: /* @__PURE__ */ r(
72
- L,
72
+ k,
73
73
  {
74
74
  href: `https://www.google.com/maps?q=${l.lat},${l.lng}`,
75
75
  target: "_blank",
@@ -81,8 +81,8 @@ function A({ attributes: t = {}, onChange: i }) {
81
81
  x && $ ? /* @__PURE__ */ r(
82
82
  s,
83
83
  {
84
- sx: b((e) => ({
85
- ...j(e),
84
+ sx: h((e) => ({
85
+ ...F(e),
86
86
  mt: 1.5
87
87
  })),
88
88
  children: /* @__PURE__ */ r(
@@ -1,7 +1,7 @@
1
1
  import { jsxs as u, jsx as t } from "react/jsx-runtime";
2
2
  import n from "react";
3
3
  import { Paper as p, Typography as l, Box as f } from "@mui/material";
4
- import { F as c } from "./index-B7i3cvH0.mjs";
4
+ import { F as c } from "./AIForm-DtRl0WdY.mjs";
5
5
  import { v as d } from "./v4-BysszJq8.mjs";
6
6
  function F({ attributes: o = {}, patch: e, onChange: i }) {
7
7
  const { MuiAttributes: r = {}, label: s = "Group", subFields: a = [] } = o, m = n.useMemo(() => d(), []);
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),t=require("@mui/material"),l=require("./AIForm-Dv8ahXyE.js"),d=require("./v4-CqdK_b8Y.js");function x({attributes:o={},patch:s,onChange:i}){const{MuiAttributes:r={},label:u="Group",subFields:n=[]}=o,a=c.useMemo(()=>d.v4(),[]);return e.jsxs(t.Paper,{elevation:1,sx:{p:2,mb:2,...r.sx},...r,children:[e.jsx(t.Typography,{variant:"subtitle1",gutterBottom:!0,sx:{fontWeight:600},children:u}),e.jsx(t.Box,{children:e.jsx(l.FormGenerator,{guid:a,data:n,patch:s,onChange:i})})]})}exports.default=x;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),C=require("react"),t=require("./AIForm-Dv8ahXyE.js"),U=require("@mui/material/Stack"),I=require("@mui/material/TextField"),M=require("@mui/material/MenuItem"),T=require("@mui/material/FormControl"),j=require("@mui/material/FormLabel"),n=[{code:"US",name:"United States",dial:"+1",flag:"🇺🇸"},{code:"GB",name:"United Kingdom",dial:"+44",flag:"🇬🇧"},{code:"IN",name:"India",dial:"+91",flag:"🇮🇳"},{code:"CA",name:"Canada",dial:"+1",flag:"🇨🇦"},{code:"AU",name:"Australia",dial:"+61",flag:"🇦🇺"},{code:"DE",name:"Germany",dial:"+49",flag:"🇩🇪"},{code:"FR",name:"France",dial:"+33",flag:"🇫🇷"},{code:"IT",name:"Italy",dial:"+39",flag:"🇮🇹"},{code:"ES",name:"Spain",dial:"+34",flag:"🇪🇸"},{code:"BR",name:"Brazil",dial:"+55",flag:"🇧🇷"},{code:"MX",name:"Mexico",dial:"+52",flag:"🇲🇽"},{code:"JP",name:"Japan",dial:"+81",flag:"🇯🇵"},{code:"CN",name:"China",dial:"+86",flag:"🇨🇳"},{code:"RU",name:"Russia",dial:"+7",flag:"🇷🇺"},{code:"ZA",name:"South Africa",dial:"+27",flag:"🇿🇦"},{code:"NG",name:"Nigeria",dial:"+234",flag:"🇳🇬"},{code:"KE",name:"Kenya",dial:"+254",flag:"🇰🇪"},{code:"AE",name:"United Arab Emirates",dial:"+971",flag:"🇦🇪"},{code:"SA",name:"Saudi Arabia",dial:"+966",flag:"🇸🇦"},{code:"SG",name:"Singapore",dial:"+65",flag:"🇸🇬"},{code:"MY",name:"Malaysia",dial:"+60",flag:"🇲🇾"},{code:"ID",name:"Indonesia",dial:"+62",flag:"🇮🇩"},{code:"PH",name:"Philippines",dial:"+63",flag:"🇵🇭"},{code:"TH",name:"Thailand",dial:"+66",flag:"🇹🇭"},{code:"VN",name:"Vietnam",dial:"+84",flag:"🇻🇳"},{code:"KR",name:"South Korea",dial:"+82",flag:"🇰🇷"},{code:"NZ",name:"New Zealand",dial:"+64",flag:"🇳🇿"},{code:"IE",name:"Ireland",dial:"+353",flag:"🇮🇪"},{code:"NL",name:"Netherlands",dial:"+31",flag:"🇳🇱"},{code:"SE",name:"Sweden",dial:"+46",flag:"🇸🇪"},{code:"NO",name:"Norway",dial:"+47",flag:"🇳🇴"},{code:"DK",name:"Denmark",dial:"+45",flag:"🇩🇰"},{code:"CH",name:"Switzerland",dial:"+41",flag:"🇨🇭"},{code:"PL",name:"Poland",dial:"+48",flag:"🇵🇱"},{code:"PT",name:"Portugal",dial:"+351",flag:"🇵🇹"},{code:"GR",name:"Greece",dial:"+30",flag:"🇬🇷"},{code:"TR",name:"Turkey",dial:"+90",flag:"🇹🇷"},{code:"EG",name:"Egypt",dial:"+20",flag:"🇪🇬"},{code:"AR",name:"Argentina",dial:"+54",flag:"🇦🇷"},{code:"CL",name:"Chile",dial:"+56",flag:"🇨🇱"}];function A(a,m){if(typeof a=="string"&&a.trim()){const d=[...n].sort((i,c)=>c.dial.length-i.dial.length).find(i=>a.startsWith(i.dial));if(d)return{code:d.code,number:a.slice(d.dial.length).trim()}}return{code:m,number:""}}function v({attributes:a={},rules:m={},onChange:s}){const{id:d="",defaultCountry:i="US",label:c,MuiAttributes:N={}}=a,{sx:u,...P}=N,f=n.some(e=>e.code===i)?i:"US",g=A(a.value,f),[h,S]=C.useState(g.code),[p,x]=C.useState(g.number);t.useUpdateEffect(()=>{const e=A(a.value,f);S(e.code),x(e.number)},[a.value]);const b=m?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1,y=(e,l)=>{const r=n.find(q=>q.code===e)||n[0];s?.({id:d,value:`${r.dial} ${l}`.trim(),option:{country:r.code,dial:r.dial,number:l}})},E=e=>{const l=e.target.value;S(l),y(l,p)},R=e=>{x(e.value),y(h,e.value)};return o.jsxs(T,{component:"fieldset",fullWidth:!0,children:[c&&o.jsx(j,{component:"legend",required:b,sx:{mb:1},children:c}),o.jsxs(U,{direction:"row",spacing:1,alignItems:"flex-start",children:[o.jsx(I,{select:!0,value:h,onChange:E,size:"small",label:"Country","aria-label":"Country dial code",SelectProps:{renderValue:e=>{const l=n.find(r=>r.code===e)||n[0];return`${l.flag} ${l.dial}`}},sx:t.mergeSx(t.premiumInputSx,{minWidth:120,flexShrink:0,...u}),children:n.map(e=>o.jsxs(M,{value:e.code,children:[e.flag," ",e.name," (",e.dial,")"]},e.code))}),o.jsx(t.PatternFormat,{customInput:I,format:"### ### ####",mask:"_",value:p,onValueChange:R,fullWidth:!0,required:b,label:"Phone number",id:d,name:"intlphone",...P,sx:t.mergeSx(t.premiumInputSx,u)})]})]})}exports.default=v;
@@ -1,6 +1,6 @@
1
1
  import { jsxs as m, jsx as c } from "react/jsx-runtime";
2
2
  import x from "react";
3
- import { u as G, m as I, a as A, f as k } from "./index-B7i3cvH0.mjs";
3
+ import { j as k, m as I, k as A, r as G } from "./AIForm-DtRl0WdY.mjs";
4
4
  import v from "@mui/material/Stack";
5
5
  import N from "@mui/material/TextField";
6
6
  import F from "@mui/material/MenuItem";
@@ -56,14 +56,14 @@ function E(e, r) {
56
56
  }
57
57
  return { code: r, number: "" };
58
58
  }
59
- function Z({ attributes: e = {}, rules: r = {}, onChange: f }) {
59
+ function H({ attributes: e = {}, rules: r = {}, onChange: f }) {
60
60
  const {
61
61
  id: d = "",
62
62
  defaultCountry: o = "US",
63
63
  label: t,
64
64
  MuiAttributes: P = {}
65
65
  } = e, { sx: s, ...R } = P, g = n.some((a) => a.code === o) ? o : "US", u = E(e.value, g), [p, h] = x.useState(u.code), [S, b] = x.useState(u.number);
66
- G(() => {
66
+ k(() => {
67
67
  const a = E(e.value, g);
68
68
  h(a.code), b(a.number);
69
69
  }, [e.value]);
@@ -116,7 +116,7 @@ function Z({ attributes: e = {}, rules: r = {}, onChange: f }) {
116
116
  }
117
117
  ),
118
118
  /* @__PURE__ */ c(
119
- k,
119
+ G,
120
120
  {
121
121
  customInput: N,
122
122
  format: "### ### ####",
@@ -136,5 +136,5 @@ function Z({ attributes: e = {}, rules: r = {}, onChange: f }) {
136
136
  ] });
137
137
  }
138
138
  export {
139
- Z as default
139
+ H as default
140
140
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as g, jsx as a } from "react/jsx-runtime";
2
2
  import W from "react";
3
- import v from "@mui/material/Stack";
4
- import k from "@mui/material/TextField";
3
+ import k from "@mui/material/Stack";
4
+ import v from "@mui/material/TextField";
5
5
  import E from "@mui/material/IconButton";
6
6
  import L from "@mui/material/Button";
7
7
  import T from "@mui/material/FormControl";
@@ -9,7 +9,7 @@ import q from "@mui/material/FormLabel";
9
9
  import w from "@mui/material/FormHelperText";
10
10
  import B from "@mui/icons-material/Add";
11
11
  import K from "@mui/icons-material/Close";
12
- import { u as V, m as b, a as A } from "./index-B7i3cvH0.mjs";
12
+ import { j as V, m as b, k as A } from "./AIForm-DtRl0WdY.mjs";
13
13
  function C(t) {
14
14
  return Array.isArray(t) ? t.map((r) => ({
15
15
  key: r?.key ?? "",
@@ -27,7 +27,7 @@ function Z({ attributes: t = {}, rules: r = {}, onChange: n }) {
27
27
  MuiAttributes: S = {},
28
28
  id: I = "",
29
29
  keyLabel: R = "Key",
30
- valueLabel: z = "Value",
30
+ valueLabel: j = "Value",
31
31
  label: u
32
32
  } = t, { sx: d, ...f } = S, [i, s] = W.useState(() => C(t.value)), p = r?.validation?.some(
33
33
  (e) => e.rule === "mandatory" || e.rule === "mandatoryselect"
@@ -40,24 +40,24 @@ function Z({ attributes: t = {}, rules: r = {}, onChange: n }) {
40
40
  }, y = (e, o, l) => {
41
41
  const m = i.map((x, M) => M === e ? { ...x, [o]: l } : x);
42
42
  s(m), c(m);
43
- }, F = () => {
43
+ }, z = () => {
44
44
  const e = [...i, { key: "", value: "" }];
45
45
  s(e), c(e);
46
- }, j = (e) => {
46
+ }, F = (e) => {
47
47
  const o = i.filter((l, m) => m !== e);
48
48
  s(o), c(o);
49
49
  }, h = p && i.filter((e) => e.key !== "").length === 0;
50
50
  return /* @__PURE__ */ g(T, { component: "fieldset", error: h, fullWidth: !0, children: [
51
51
  u && /* @__PURE__ */ a(q, { component: "legend", required: p, sx: { mb: 1 }, children: u }),
52
- /* @__PURE__ */ a(v, { spacing: 1.25, children: i.map((e, o) => /* @__PURE__ */ g(
53
- v,
52
+ /* @__PURE__ */ a(k, { spacing: 1.25, children: i.map((e, o) => /* @__PURE__ */ g(
53
+ k,
54
54
  {
55
55
  direction: "row",
56
56
  spacing: 1,
57
57
  alignItems: "center",
58
58
  children: [
59
59
  /* @__PURE__ */ a(
60
- k,
60
+ v,
61
61
  {
62
62
  ...f,
63
63
  label: R,
@@ -69,10 +69,10 @@ function Z({ attributes: t = {}, rules: r = {}, onChange: n }) {
69
69
  }
70
70
  ),
71
71
  /* @__PURE__ */ a(
72
- k,
72
+ v,
73
73
  {
74
74
  ...f,
75
- label: z,
75
+ label: j,
76
76
  value: e.value,
77
77
  onChange: (l) => y(o, "value", l.target.value),
78
78
  size: "small",
@@ -84,7 +84,7 @@ function Z({ attributes: t = {}, rules: r = {}, onChange: n }) {
84
84
  E,
85
85
  {
86
86
  "aria-label": `Remove ${e.key || "row"}`,
87
- onClick: () => j(o),
87
+ onClick: () => F(o),
88
88
  size: "small",
89
89
  sx: {
90
90
  borderRadius: 2,
@@ -101,7 +101,7 @@ function Z({ attributes: t = {}, rules: r = {}, onChange: n }) {
101
101
  /* @__PURE__ */ a(
102
102
  L,
103
103
  {
104
- onClick: F,
104
+ onClick: z,
105
105
  startIcon: /* @__PURE__ */ a(B, {}),
106
106
  size: "small",
107
107
  variant: "text",
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),F=require("react"),v=require("@mui/material/Stack"),j=require("@mui/material/TextField"),z=require("@mui/material/IconButton"),M=require("@mui/material/Button"),T=require("@mui/material/FormControl"),W=require("@mui/material/FormLabel"),E=require("@mui/material/FormHelperText"),L=require("@mui/icons-material/Add"),w=require("@mui/icons-material/Close"),i=require("./AIForm-Dv8ahXyE.js");function k(t){return Array.isArray(t)?t.map(r=>({key:r?.key??"",value:r?.value??""})):t&&typeof t=="object"?Object.keys(t).map(r=>({key:r,value:String(t[r]??"")})):[]}function B(t){const r={};return t.forEach(l=>{l.key!==""&&(r[l.key]=l.value)}),r}function K({attributes:t={},rules:r={},onChange:l}){const{MuiAttributes:q={},id:b="",keyLabel:S="Key",valueLabel:A="Value",label:m}=t,{sx:x,...y}=q,[a,u]=F.useState(()=>k(t.value)),f=r?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1;i.useUpdateEffect(()=>{u(k(t.value))},[t.value]);const d=e=>{l?.({id:b,value:B(e),option:e})},h=(e,o,s)=>{const c=a.map((g,R)=>R===e?{...g,[o]:s}:g);u(c),d(c)},C=()=>{const e=[...a,{key:"",value:""}];u(e),d(e)},I=e=>{const o=a.filter((s,c)=>c!==e);u(o),d(o)},p=f&&a.filter(e=>e.key!=="").length===0;return n.jsxs(T,{component:"fieldset",error:p,fullWidth:!0,children:[m&&n.jsx(W,{component:"legend",required:f,sx:{mb:1},children:m}),n.jsx(v,{spacing:1.25,children:a.map((e,o)=>n.jsxs(v,{direction:"row",spacing:1,alignItems:"center",children:[n.jsx(j,{...y,label:S,value:e.key,onChange:s=>h(o,"key",s.target.value),size:"small",fullWidth:!0,sx:i.mergeSx(i.premiumInputSx,x)}),n.jsx(j,{...y,label:A,value:e.value,onChange:s=>h(o,"value",s.target.value),size:"small",fullWidth:!0,sx:i.mergeSx(i.premiumInputSx,x)}),n.jsx(z,{"aria-label":`Remove ${e.key||"row"}`,onClick:()=>I(o),size:"small",sx:{borderRadius:2,color:"text.secondary","&:hover":{color:"error.main"}},children:n.jsx(w,{fontSize:"small"})})]},o))}),n.jsx(M,{onClick:C,startIcon:n.jsx(L,{}),size:"small",variant:"text",sx:{alignSelf:"flex-start",mt:1,borderRadius:2,textTransform:"none",fontWeight:600},children:"Add"}),p&&n.jsx(E,{children:r?.validation?.find(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")?.message||"At least one entry is required"})]})}exports.default=K;
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import n, { Suspense as a } from "react";
3
3
  import s from "@mui/material/Box";
4
4
  import f from "@mui/material/CircularProgress";
5
- import { g as m } from "./index-B7i3cvH0.mjs";
5
+ import { i as m } from "./AIForm-DtRl0WdY.mjs";
6
6
  const c = n.lazy(
7
7
  () => import("@mui/x-charts/LineChart").then((r) => ({ default: r.LineChart }))
8
8
  );
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.create;var u=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var x=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of l(t))!d.call(e,i)&&i!==r&&u(e,i,{get:()=>t[i],enumerable:!(n=a(t,i))||n.enumerable});return e};var f=(e,t,r)=>(r=e!=null?c(h(e)):{},x(t||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),j=require("@mui/material/Box"),C=require("@mui/material/CircularProgress"),y=require("./AIForm-Dv8ahXyE.js"),g=o.lazy(()=>import("@mui/x-charts/LineChart").then(e=>({default:e.LineChart})));function p({attributes:e={}}){const{MuiChartAttributes:t={},id:r=""}=e,n=y.getMuiX("LineChart")||g;return s.jsx(o.Suspense,{fallback:s.jsx(j,{sx:{display:"flex",justifyContent:"center",p:2},children:s.jsx(C,{})}),children:s.jsx(n,{height:300,...t},r)})}exports.default=p;
@@ -1,7 +1,7 @@
1
1
  import { jsx as s, jsxs as O } from "react/jsx-runtime";
2
2
  import { useState as N, useEffect as T } from "react";
3
3
  import { Stack as q, Box as z, Typography as E, TextField as g, InputAdornment as F, Button as D, Icon as x, IconButton as J } from "@mui/material";
4
- import { u as L } from "./index-B7i3cvH0.mjs";
4
+ import { j as L } from "./AIForm-DtRl0WdY.mjs";
5
5
  function k(r, o) {
6
6
  if (Array.isArray(r) && r.length > 0) {
7
7
  const c = r[0], a = Object.keys(c).find((d) => d !== "fee");
@@ -51,13 +51,13 @@ function H({ attributes: r = {}, rules: o = {}, onChange: c }) {
51
51
  }, [r.value]), T(() => {
52
52
  c && c({ id: a, value: M(i) });
53
53
  }, [i, a]);
54
- const R = () => {
54
+ const j = () => {
55
55
  const e = i.length + 1;
56
56
  p([...i, { key: `${h}${e}`, description: "", fee: 0 }]);
57
- }, W = (e) => {
57
+ }, R = (e) => {
58
58
  const t = i.filter((y, m) => m !== e).map((y, m) => ({ ...y, key: `${h}${m + 1}` }));
59
59
  p(t);
60
- }, j = (e, n) => {
60
+ }, W = (e, n) => {
61
61
  const t = [...i];
62
62
  t[e] = { ...t[e], description: n }, p(t);
63
63
  }, K = (e, n) => {
@@ -110,7 +110,7 @@ function H({ attributes: r = {}, rules: o = {}, onChange: c }) {
110
110
  error: u && !e.description,
111
111
  helperText: u && !e.description ? "Required" : "",
112
112
  value: e.description,
113
- onChange: (t) => j(n, t.target.value),
113
+ onChange: (t) => W(n, t.target.value),
114
114
  InputProps: { readOnly: l },
115
115
  ...B
116
116
  }
@@ -139,7 +139,7 @@ function H({ attributes: r = {}, rules: o = {}, onChange: c }) {
139
139
  {
140
140
  variant: "contained",
141
141
  color: "primary",
142
- onClick: R,
142
+ onClick: j,
143
143
  sx: { minWidth: 40, px: 1, height: 40, flexShrink: 0 },
144
144
  title: "Add row",
145
145
  ...$,
@@ -149,7 +149,7 @@ function H({ attributes: r = {}, rules: o = {}, onChange: c }) {
149
149
  J,
150
150
  {
151
151
  color: "error",
152
- onClick: () => W(n),
152
+ onClick: () => R(n),
153
153
  sx: { height: 40, flexShrink: 0 },
154
154
  title: "Remove row",
155
155
  ...S,
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),g=require("react"),a=require("@mui/material"),T=require("./AIForm-Dv8ahXyE.js");function k(r,o){if(Array.isArray(r)&&r.length>0){const d=r[0],c=Object.keys(d).find(l=>l!=="fee");if(c)return c.replace(/\d+$/,"")}return o}function I(r,o){return Array.isArray(r)&&r.length>0?r.map((d,c)=>{const{fee:l=0,...f}=d,u=Object.keys(f)[0]||`${o}${c+1}`;return{key:u,description:String(f[u]??""),fee:Number(l)||0}}):[{key:`${o}1`,description:"",fee:0}]}function W(r){return r.map(o=>({fee:o.fee,[o.key]:o.description}))}function F({attributes:r={},rules:o={},onChange:d}){const{id:c="",keyPrefix:l="item",showRowBadge:f=!0,readOnly:u=!1,showActions:v=!0,MuiAttributes:j={}}=r,w=v&&!u,{row:P={},rowBadge:b={},description:A={},fee:B={},addButton:S={},removeButton:C={}}=j,h=o?.validation?.some(e=>e.rule==="mandatory")||!1,m=k(r.value,l),[s,p]=g.useState(()=>I(r.value,m));T.useUpdateEffect(()=>{const e=k(r.value,l),n=I(r.value,e);JSON.stringify(n)!==JSON.stringify(s)&&p(n)},[r.value]),g.useEffect(()=>{d&&d({id:c,value:W(s)})},[s,c]);const $=()=>{const e=s.length+1;p([...s,{key:`${m}${e}`,description:"",fee:0}])},R=e=>{const t=s.filter((x,y)=>y!==e).map((x,y)=>({...x,key:`${m}${y+1}`}));p(t)},q=(e,n)=>{const t=[...s];t[e]={...t[e],description:n},p(t)},O=(e,n)=>{const t=[...s];t[e]={...t[e],fee:Number(n)||0},p(t)};return i.jsx(a.Stack,{spacing:1.5,sx:{width:"100%"},children:s.map((e,n)=>i.jsxs(a.Box,{sx:{display:"flex",gap:1,alignItems:"flex-start",p:1.5,border:"1px solid",borderColor:"divider",borderRadius:1,backgroundColor:"background.paper"},...P,children:[f&&i.jsx(a.Typography,{variant:"caption",sx:{minWidth:24,height:24,borderRadius:"50%",backgroundColor:"primary.main",color:"primary.contrastText",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,flexShrink:0,mt:.75},...b,children:n+1}),i.jsx(a.TextField,{fullWidth:!0,size:"small",label:"Description",required:h,error:h&&!e.description,helperText:h&&!e.description?"Required":"",value:e.description,onChange:t=>q(n,t.target.value),InputProps:{readOnly:u},...A}),i.jsx(a.TextField,{size:"small",label:"Fee",type:"number",sx:{minWidth:120},required:h,value:e.fee,onChange:t=>O(n,t.target.value),InputProps:{readOnly:u,startAdornment:i.jsx(a.InputAdornment,{position:"start",children:"$"})},inputProps:{min:0,step:.01},onWheel:t=>t.target.blur(),...B}),w&&(n===s.length-1?i.jsx(a.Button,{variant:"contained",color:"primary",onClick:$,sx:{minWidth:40,px:1,height:40,flexShrink:0},title:"Add row",...S,children:i.jsx(a.Icon,{children:"add"})}):i.jsx(a.IconButton,{color:"error",onClick:()=>R(n),sx:{height:40,flexShrink:0},title:"Remove row",...C,children:i.jsx(a.Icon,{children:"delete"})}))]},e.key))})}exports.default=F;
@@ -1,9 +1,9 @@
1
1
  import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
2
  import { List as a, ListItem as u, ListItemIcon as x, Icon as L, ListItemText as p } from "@mui/material";
3
- import { m as d, b as I } from "./index-B7i3cvH0.mjs";
3
+ import { m as d, l } from "./AIForm-DtRl0WdY.mjs";
4
4
  function A({ attributes: i = {} }) {
5
5
  const { MuiAttributes: e = {}, items: s = [] } = i, { sx: o, ...n } = e;
6
- return /* @__PURE__ */ r(a, { ...n, sx: d(I, o), children: (Array.isArray(s) ? s : []).map((t, c) => /* @__PURE__ */ m(u, { ...t.MuiListItemAttributes, children: [
6
+ return /* @__PURE__ */ r(a, { ...n, sx: d(l, o), children: (Array.isArray(s) ? s : []).map((t, c) => /* @__PURE__ */ m(u, { ...t.MuiListItemAttributes, children: [
7
7
  t.icon && /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(L, { children: t.icon }) }),
8
8
  /* @__PURE__ */ r(
9
9
  p,
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("@mui/material"),i=require("./AIForm-Dv8ahXyE.js");function x({attributes:n={}}){const{MuiAttributes:c={},items:s=[]}=n,{sx:u,...o}=c;return r.jsx(e.List,{...o,sx:i.mergeSx(i.premiumSurfaceSx,u),children:(Array.isArray(s)?s:[]).map((t,a)=>r.jsxs(e.ListItem,{...t.MuiListItemAttributes,children:[t.icon&&r.jsx(e.ListItemIcon,{children:r.jsx(e.Icon,{children:t.icon})}),r.jsx(e.ListItemText,{primary:t.primary,secondary:t.secondary,...t.MuiListItemTextAttributes})]},a))})}exports.default=x;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),B=require("react"),c=require("./AIForm-Dv8ahXyE.js"),C=require("@mui/material/TextField"),L=require("@mui/material/Button"),v=require("@mui/material/Box"),R=require("@mui/material");function U({attributes:l={},rules:m={},onChange:a,submitTick:h,messages:S}){const{id:d="",MuiAttributes:n={},InputProps:F={},format:g="",buttonText:P="Update Location",buttonIcon:b="location_on",buttonDisplay:w="both",MuiButtonAttributes:q={},disabled:y=!1}=l,[i,u]=B.useState({value:l.value!==void 0?l.value:"",helperText:n.helperText||"",error:!1});B.useEffect(()=>{l.value!==void 0&&l.value!==i.value&&u(e=>({...e,value:l.value}))},[l.value]);const A=e=>g?c.numeral(e).format(g):e,p=e=>{const{validation:t}=m;if(t)for(let o=0;o<t.length;o+=1){const r=t[o],j=c.Validation[r.rule];if(!(typeof j=="function"?j(e,r.value):!0)){const _=r.rule==="mandatory"?S?.required||"This field is required":"";return{isValid:!1,message:r.message||_}}}return{isValid:!0,message:""}};c.useUpdateEffect(()=>{if(h){const e=p(i.value);u(t=>({...t,helperText:e.message,error:!e.isValid}))}},[h]);const M=e=>{const{value:t}=e.target,o=p(t);u({value:t,helperText:o.message,error:!o.isValid})},k=e=>{const{value:t}=e.target,o=A(t),r=p(o);u({value:o,helperText:r.message,error:!r.isValid}),typeof a=="function"&&a({id:d,value:o})},z=()=>{a&&a({id:d,value:i.value,option:"location_update_request"})},D=()=>{const e=w,t=s.jsx(R.Icon,{children:b});switch(e){case"icon":return t;case"text":return s.jsx(s.Fragment,{children:P});default:return s.jsxs(s.Fragment,{children:[t,s.jsx(v,{component:"span",sx:{ml:.5},children:P})]})}},E=m?.validation?.some(e=>e.rule==="mandatory")||!1,f=!!n?.slotProps,x={...n};let I,T;if(f){const e=n.slotProps&&n.slotProps.input||{};T={...n.slotProps||{},input:{...e}},delete x.slotProps}else I={...n.inputProps||{}},delete x.inputProps;const O=n.variant||"outlined",V=n.size||"medium",W=V==="small"?O==="outlined"?40:48:56;return s.jsxs(v,{sx:{display:"flex",gap:1,alignItems:"flex-start",width:"100%"},children:[s.jsx(v,{sx:{flex:1,minWidth:0},children:s.jsx(C,{fullWidth:!0,...x,id:d,required:E,inputProps:f?void 0:I,slotProps:f?T:void 0,InputProps:c.getInputProps(F),onChange:M,onBlur:k,value:i.value,error:i.error,helperText:i.helperText,disabled:y})}),s.jsx(L,{variant:"outlined",color:"primary",size:V==="small"?"small":"medium",onClick:z,disabled:y,...q,sx:{whiteSpace:"nowrap",minWidth:"auto",height:W,flexShrink:0,...q?.sx},children:D()})]})}exports.default=U;