@hiver/connector-admin 4.11.0-oneClickAuto-beta.7 → 4.11.0-oneClickAuto-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.es.js CHANGED
@@ -28805,17 +28805,18 @@ const Zd = (e) => !!e && typeof e == "object" && "value" in e && "label" in e, $
28805
28805
  ...fM,
28806
28806
  backgroundColor: e ? "#F6F8FC" : "transparent",
28807
28807
  cursor: "pointer",
28808
+ fontWeight: 400,
28808
28809
  "&:hover": { backgroundColor: "#F6F8FC" }
28809
28810
  }), BM = {
28810
28811
  display: "grid",
28811
28812
  gridTemplateColumns: "1fr 1fr",
28812
28813
  alignItems: "center",
28813
28814
  backgroundColor: "#ECEFF6",
28814
- borderRadius: "999px",
28815
+ borderRadius: "8px",
28815
28816
  padding: "3px"
28816
28817
  }, XB = (e) => ({
28817
28818
  border: "none",
28818
- borderRadius: "999px",
28819
+ borderRadius: "8px",
28819
28820
  backgroundColor: e ? "#FFFFFF" : "transparent",
28820
28821
  color: e ? "#2066D7" : "#343C45",
28821
28822
  lineHeight: "24px",
@@ -28832,6 +28833,7 @@ const Zd = (e) => !!e && typeof e == "object" && "value" in e && "label" in e, $
28832
28833
  py: 0
28833
28834
  }, QM = (e) => ({
28834
28835
  fontSize: 14,
28836
+ fontWeight: 400,
28835
28837
  lineHeight: "18px",
28836
28838
  minHeight: 36,
28837
28839
  py: 0.75,
@@ -28876,6 +28878,12 @@ const Zd = (e) => !!e && typeof e == "object" && "value" in e && "label" in e, $
28876
28878
  open: n,
28877
28879
  anchorEl: r,
28878
28880
  placement: "left-end",
28881
+ modifiers: [
28882
+ {
28883
+ name: "offset",
28884
+ options: { offset: [0, 2] }
28885
+ }
28886
+ ],
28879
28887
  sx: { zIndex: A + 10 },
28880
28888
  children: /* @__PURE__ */ c.jsx(
28881
28889
  pb,
@@ -29142,34 +29150,34 @@ const Zd = (e) => !!e && typeof e == "object" && "value" in e && "label" in e, $
29142
29150
  onChange: u,
29143
29151
  setError: g
29144
29152
  }) => {
29145
- const { onBlur: E, inputRef: B, focusInput: f, insertVariable: d } = FM(), C = Mm((p) => {
29146
- let Q = Wk(p);
29147
- t === "date" && (Q = zk(p)), l && !p && (Q = `${r} is required`), g(Q);
29148
- }, 1e3), h = (p) => {
29149
- u(p), C(p);
29150
- }, I = ({ value: p }) => {
29151
- const Q = d(n, p);
29152
- h(Q), f(p == null ? void 0 : p.length);
29153
+ const { onBlur: E, inputRef: B, focusInput: f, insertVariable: d } = FM(), C = t === "date" ? A.filter((Q) => Q.isDate) : A, h = Mm((Q) => {
29154
+ let m = Wk(Q);
29155
+ t === "date" && (m = zk(Q)), l && !Q && (m = `${r} is required`), g(m);
29156
+ }, 1e3), I = (Q) => {
29157
+ u(Q), h(Q);
29158
+ }, p = ({ value: Q }) => {
29159
+ const m = d(n, Q);
29160
+ I(m), f(Q == null ? void 0 : Q.length);
29153
29161
  };
29154
29162
  return /* @__PURE__ */ c.jsx(
29155
29163
  cM,
29156
29164
  {
29157
29165
  inputRef: B,
29158
29166
  value: n,
29159
- onChange: h,
29167
+ onChange: I,
29160
29168
  onBlur: E,
29161
29169
  placeholder: "Value",
29162
29170
  hasError: o,
29163
29171
  limit: i,
29164
29172
  multiline: a,
29165
29173
  InputProps: {
29166
- endAdornment: A.length > 0 ? /* @__PURE__ */ c.jsx(SM, { style: { justifyContent: a ? "flex-end" : "center", padding: "10px" }, children: /* @__PURE__ */ c.jsx(
29174
+ endAdornment: C.length > 0 ? /* @__PURE__ */ c.jsx(SM, { style: { justifyContent: a ? "flex-end" : "center", padding: "10px" }, children: /* @__PURE__ */ c.jsx(
29167
29175
  LM,
29168
29176
  {
29169
29177
  name: e,
29170
- variables: A,
29178
+ variables: C,
29171
29179
  customFields: s,
29172
- onOptionClick: I
29180
+ onOptionClick: p
29173
29181
  }
29174
29182
  ) }) : null
29175
29183
  }
@@ -29524,7 +29532,7 @@ const Zd = (e) => !!e && typeof e == "object" && "value" in e && "label" in e, $
29524
29532
  margin: 0
29525
29533
  };
29526
29534
  function $M(e) {
29527
- return e.rowId ?? e.name;
29535
+ return e.name ?? e.rowId;
29528
29536
  }
29529
29537
  const i2 = ({
29530
29538
  open: e,
@@ -29534,7 +29542,7 @@ const i2 = ({
29534
29542
  variables: A,
29535
29543
  connectorLogo: o,
29536
29544
  isSaving: i,
29537
- title: a = "Map fields",
29545
+ title: a = "Pre-fill fields",
29538
29546
  isLoading: s = !1,
29539
29547
  defaultValues: l,
29540
29548
  customFields: u,
@@ -29582,7 +29590,10 @@ const i2 = ({
29582
29590
  /* @__PURE__ */ c.jsxs(H, { direction: "row", alignItems: "center", gap: 2, children: [
29583
29591
  /* @__PURE__ */ c.jsx(jM, {}),
29584
29592
  /* @__PURE__ */ c.jsx(H, { gap: 0.5, flex: 1, minWidth: 0, children: /* @__PURE__ */ c.jsxs(H, { direction: "row", alignItems: "center", gap: 0.5, children: [
29585
- /* @__PURE__ */ c.jsx(re, { variant: "h6", fontSize: 18, fontWeight: 600, color: se.palette.gray.gray1, children: a }),
29593
+ /* @__PURE__ */ c.jsxs(re, { variant: "h6", fontSize: 18, fontWeight: 600, color: se.palette.gray.gray1, children: [
29594
+ "Pre-fill fields for ",
29595
+ a
29596
+ ] }),
29586
29597
  /* @__PURE__ */ c.jsx(It, { title: "Assign default values to create fields", placement: "top", children: /* @__PURE__ */ c.jsx(Gn, { size: "small", "aria-label": "About mapping fields", sx: { padding: "4px" }, children: /* @__PURE__ */ c.jsx(Ct.InfoOutlined, { sx: { fontSize: 18, color: se.palette.gray.gray3 } }) }) })
29587
29598
  ] }) })
29588
29599
  ] }),
@@ -32693,7 +32704,7 @@ const Ja = {
32693
32704
  border: 1px solid ${se.palette.gray.gray6};
32694
32705
  border-radius: 8px;
32695
32706
  box-sizing: border-box;
32696
- `, Xa = () => /* @__PURE__ */ c.jsx(H, { marginTop: "28px", gap: "12px", "data-testid": "loading", flexDirection: "row", flexWrap: "wrap", children: Array(6).fill(0).map((e, t) => /* @__PURE__ */ c.jsx(PG, { justifyContent: "center", children: /* @__PURE__ */ c.jsx(NG, { variant: "rounded", maxWidth: "260px", height: "60px", animation: "wave" }) }, t)) }), R2 = (e) => e.connectorLirary.connectorList, vA = (e) => e.connectorLirary.connectors, DE = (e) => e.connectorLirary.connectorsApiStatus, D2 = (e) => e.connectorLirary.currentUpdatingConnectors, zs = (e) => e.connectorLirary.connectorDetailApiStatus, Ys = (e) => e.connectorLirary.rolesAndPermissions ?? [], OE = (e) => e.connectorLirary.updateEnableConnectorsApiStatus, LE = (e) => e.connectorLirary.cardCustomFields, kG = (e) => e.connectorLirary.cardCustomFieldsApiStatus, MG = (e) => e.connectorLirary.notAuthenticatedConnectors, jG = (e) => e.connectorLirary.requireUpgradeConnectors, UG = (e) => e.connectorLirary.enableCustomCardApiStatus, VG = (e) => e.connectorLirary.updateConnectorByIdApiStatus, gh = "Visibility not set", FE = "Configure visibility settings", GG = "Set the card visibility across shared mailboxes and roles to enable ${{connector}}", O2 = "Configure fields", HG = "Choose which fields your team can view in Hiver and which can be filled in when creating new ${{connector}} records.", dh = "Contact your admin to configure visibility", WG = "Select inbox(es)", zG = "Select the inbox(es)", YG = "Select the role", JG = "Select role", Ch = "inbox", XG = "roles", NE = "Close", Mc = "${{connector}}", L2 = "Visibility settings saved", KG = "Field visibility settings saved", PE = "Some error occured. Please contact support@hiverhq.com", qG = "Selecting any lower role will automatically select the roles above it", ZG = "Loading custom fields...", kE = "Save", Zi = "enabled", $i = "disabled", F2 = "Select atleast one field to save", _u = "New", $G = "Upgrade now", eH = "Authentication failed", tH = "More info about the current updates that will be there in this app", nH = "App's visibility & access", rH = "Set the card & field visibility across shared mailboxes and roles to enable the connector", AH = "Customer identity mapping", oH = "Choose how Hiver should identify customers when fetching data from connected apps.", iH = "Edit", aH = "Save", sH = "Matches with %s's", lH = "Customer identity mapping saved", cH = "Failed to save. Please try again.", uH = "Map fields", ME = T(Ee)`
32707
+ `, Xa = () => /* @__PURE__ */ c.jsx(H, { marginTop: "28px", gap: "12px", "data-testid": "loading", flexDirection: "row", flexWrap: "wrap", children: Array(6).fill(0).map((e, t) => /* @__PURE__ */ c.jsx(PG, { justifyContent: "center", children: /* @__PURE__ */ c.jsx(NG, { variant: "rounded", maxWidth: "260px", height: "60px", animation: "wave" }) }, t)) }), R2 = (e) => e.connectorLirary.connectorList, vA = (e) => e.connectorLirary.connectors, DE = (e) => e.connectorLirary.connectorsApiStatus, D2 = (e) => e.connectorLirary.currentUpdatingConnectors, zs = (e) => e.connectorLirary.connectorDetailApiStatus, Ys = (e) => e.connectorLirary.rolesAndPermissions ?? [], OE = (e) => e.connectorLirary.updateEnableConnectorsApiStatus, LE = (e) => e.connectorLirary.cardCustomFields, kG = (e) => e.connectorLirary.cardCustomFieldsApiStatus, MG = (e) => e.connectorLirary.notAuthenticatedConnectors, jG = (e) => e.connectorLirary.requireUpgradeConnectors, UG = (e) => e.connectorLirary.enableCustomCardApiStatus, VG = (e) => e.connectorLirary.updateConnectorByIdApiStatus, gh = "Visibility not set", FE = "Configure visibility settings", GG = "Set the card visibility across shared mailboxes and roles to enable ${{connector}}", O2 = "Configure fields", HG = "Choose which fields your team can view in Hiver and which can be filled in when creating new ${{connector}} records.", dh = "Contact your admin to configure visibility", WG = "Select inbox(es)", zG = "Select the inbox(es)", YG = "Select the role", JG = "Select role", Ch = "inbox", XG = "roles", NE = "Close", Mc = "${{connector}}", L2 = "Visibility settings saved", KG = "Field visibility settings saved", PE = "Some error occured. Please contact support@hiverhq.com", qG = "Selecting any lower role will automatically select the roles above it", ZG = "Loading custom fields...", kE = "Save", Zi = "enabled", $i = "disabled", F2 = "Select atleast one field to save", _u = "New", $G = "Upgrade now", eH = "Authentication failed", tH = "More info about the current updates that will be there in this app", nH = "App's visibility & access", rH = "Set the card & field visibility across shared mailboxes and roles to enable the connector", AH = "Customer identity mapping", oH = "Choose how Hiver should identify customers when fetching data from connected apps.", iH = "Edit", aH = "Save", sH = "Matches with %s's", lH = "Customer identity mapping saved", cH = "Failed to save. Please try again.", uH = "Pre-fill fields", ME = T(Ee)`
32697
32708
  min-height: 506px;
32698
32709
  width: 462px;
32699
32710
  padding: 32px;
@@ -33710,7 +33721,7 @@ const Ja = {
33710
33721
  variables: A,
33711
33722
  customFormArgsEnabled: o,
33712
33723
  customFormArgsMap: i,
33713
- title: a = "Map fields",
33724
+ title: a = "Pre-fill fields",
33714
33725
  isLoading: s = !1,
33715
33726
  onSuccess: l,
33716
33727
  onClose: u
@@ -38176,7 +38187,7 @@ const rX = "data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%20
38176
38187
  },
38177
38188
  method: t ? An.PUT : An.POST
38178
38189
  }), i = o == null ? void 0 : o.data;
38179
- if (!i.entityId)
38190
+ if (!t && !i.entityId)
38180
38191
  throw console.error("Entity ID not present in the response", i), new Error("Entity ID not present in the response");
38181
38192
  return i;
38182
38193
  } catch (r) {
package/index.umd.js CHANGED
@@ -1460,7 +1460,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1460
1460
  overflow: hidden;
1461
1461
  text-overflow: ellipsis;
1462
1462
  padding-top: 2px;
1463
- `,lP=e=>{const t=n=>{var o;const r=n.target;r&&((o=e.onChange)==null||o.call(e,r.value))};return c.jsx(aP,{...e,variant:"outlined",onChange:t,...e.multiline?{rows:4}:null})},um=()=>{const[e,t]=m.useState(null),[n,r]=m.useState(null),o=m.useRef(null);return{activeField:e,anchorEl:n,onEnter:a=>{o.current&&clearTimeout(o.current),a&&(t(a.field),r(a.currentTarget))},onLeave:()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{t(null),r(null)},100)}}},cP={borderRadius:"8px",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",mt:.5,backgroundColor:"#FFFFFF",minWidth:337},uP={maxHeight:280,overflow:"auto",paddingTop:0,paddingBottom:1},gP={lineHeight:1,padding:"12px",backgroundColor:"#FFFFFF",position:"sticky",top:0,zIndex:2},dP={m:0,minWidth:0,width:"100%"},CP={fontSize:"14px",width:"100%",minWidth:200,height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:500,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"& .MuiSelect-select":{display:"flex",alignItems:"center",paddingLeft:"12px",paddingRight:"8px"},"& .MuiSelect-icon":{color:"#97A3B7"}},EP={fontSize:14,lineHeight:"18px",minHeight:36,py:.75,pl:2,pr:1.5,color:"#343C45",display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,boxSizing:"border-box"},fP=e=>({...EP,backgroundColor:e?"#F6F8FC":"transparent",cursor:"pointer","&:hover":{backgroundColor:"#F6F8FC"}}),IP={display:"grid",gridTemplateColumns:"1fr 1fr",alignItems:"center",backgroundColor:"#ECEFF6",borderRadius:"999px",padding:"3px"},gm=e=>({border:"none",borderRadius:"999px",backgroundColor:e?"#FFFFFF":"transparent",color:e?"#2066D7":"#343C45",lineHeight:"24px",padding:"4px 12px",cursor:"pointer"}),BP={fontSize:12,color:"#6F7C90",flexShrink:0},pP={display:"flex",flexDirection:"column",alignItems:"stretch",py:0},hP=e=>({fontSize:14,lineHeight:"18px",minHeight:36,py:.75,px:1.5,pl:2,pr:1.5,color:"#343C45",textTransform:"none",justifyContent:"flex-start",backgroundColor:e?"#F6F8FC":"transparent","&:hover":{backgroundColor:"#F6F8FC"}}),QP={color:"#97A3B7",fontSize:13,px:2,py:1.5},mP=g.styled(g.Stack)`
1463
+ `,lP=e=>{const t=n=>{var o;const r=n.target;r&&((o=e.onChange)==null||o.call(e,r.value))};return c.jsx(aP,{...e,variant:"outlined",onChange:t,...e.multiline?{rows:4}:null})},um=()=>{const[e,t]=m.useState(null),[n,r]=m.useState(null),o=m.useRef(null);return{activeField:e,anchorEl:n,onEnter:a=>{o.current&&clearTimeout(o.current),a&&(t(a.field),r(a.currentTarget))},onLeave:()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{t(null),r(null)},100)}}},cP={borderRadius:"8px",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",mt:.5,backgroundColor:"#FFFFFF",minWidth:337},uP={maxHeight:280,overflow:"auto",paddingTop:0,paddingBottom:1},gP={lineHeight:1,padding:"12px",backgroundColor:"#FFFFFF",position:"sticky",top:0,zIndex:2},dP={m:0,minWidth:0,width:"100%"},CP={fontSize:"14px",width:"100%",minWidth:200,height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:500,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"& .MuiSelect-select":{display:"flex",alignItems:"center",paddingLeft:"12px",paddingRight:"8px"},"& .MuiSelect-icon":{color:"#97A3B7"}},EP={fontSize:14,lineHeight:"18px",minHeight:36,py:.75,pl:2,pr:1.5,color:"#343C45",display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,boxSizing:"border-box"},fP=e=>({...EP,backgroundColor:e?"#F6F8FC":"transparent",cursor:"pointer",fontWeight:400,"&:hover":{backgroundColor:"#F6F8FC"}}),IP={display:"grid",gridTemplateColumns:"1fr 1fr",alignItems:"center",backgroundColor:"#ECEFF6",borderRadius:"8px",padding:"3px"},gm=e=>({border:"none",borderRadius:"8px",backgroundColor:e?"#FFFFFF":"transparent",color:e?"#2066D7":"#343C45",lineHeight:"24px",padding:"4px 12px",cursor:"pointer"}),BP={fontSize:12,color:"#6F7C90",flexShrink:0},pP={display:"flex",flexDirection:"column",alignItems:"stretch",py:0},hP=e=>({fontSize:14,fontWeight:400,lineHeight:"18px",minHeight:36,py:.75,px:1.5,pl:2,pr:1.5,color:"#343C45",textTransform:"none",justifyContent:"flex-start",backgroundColor:e?"#F6F8FC":"transparent","&:hover":{backgroundColor:"#F6F8FC"}}),QP={color:"#97A3B7",fontSize:13,px:2,py:1.5},mP=g.styled(g.Stack)`
1464
1464
  flex-flow: row nowrap;
1465
1465
  align-items: center;
1466
1466
  color: #343c45;
@@ -1471,7 +1471,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1471
1471
  line-height: 36px;
1472
1472
  min-height: 36px;
1473
1473
  text-align: center;
1474
- `,yP=g.Popper,dm=({name:e,customValue:t,popperOpen:n,anchorEl:r,zIndex:o,activeField:A,onEnter:s,onLeave:a,onChange:i})=>c.jsx(yP,{id:`${e}-popper`,open:n,anchorEl:r,placement:"left-end",sx:{zIndex:o+10},children:c.jsx(g.Paper,{elevation:3,sx:{width:200,maxHeight:"200px",overflow:"auto",borderRadius:"4px"},onPointerEnter:()=>s(),onPointerLeave:()=>a(),children:A&&A.options.length>0?c.jsx(g.Box,{role:"list",sx:pP,children:A.options.map(l=>{var d;const u=(t==null?void 0:t.name)===A.name&&((d=t==null?void 0:t.option)==null?void 0:d.value)===l.value;return c.jsx(g.Button,{size:"small",fullWidth:!0,variant:"text",sx:hP(u),onClick:()=>i({name:A.name,id:A.id,option:l}),children:l.label},l.value)})}):A&&A.options.length===0?c.jsx(g.Box,{sx:QP,children:"No options"}):null})}),bP=1600,xP={POPPER:3e3},vP=g.styled(g.Stack)`
1474
+ `,yP=g.Popper,dm=({name:e,customValue:t,popperOpen:n,anchorEl:r,zIndex:o,activeField:A,onEnter:s,onLeave:a,onChange:i})=>c.jsx(yP,{id:`${e}-popper`,open:n,anchorEl:r,placement:"left-end",modifiers:[{name:"offset",options:{offset:[0,2]}}],sx:{zIndex:o+10},children:c.jsx(g.Paper,{elevation:3,sx:{width:200,maxHeight:"200px",overflow:"auto",borderRadius:"4px"},onPointerEnter:()=>s(),onPointerLeave:()=>a(),children:A&&A.options.length>0?c.jsx(g.Box,{role:"list",sx:pP,children:A.options.map(l=>{var d;const u=(t==null?void 0:t.name)===A.name&&((d=t==null?void 0:t.option)==null?void 0:d.value)===l.value;return c.jsx(g.Button,{size:"small",fullWidth:!0,variant:"text",sx:hP(u),onClick:()=>i({name:A.name,id:A.id,option:l}),children:l.label},l.value)})}):A&&A.options.length===0?c.jsx(g.Box,{sx:QP,children:"No options"}):null})}),bP=1600,xP={POPPER:3e3},vP=g.styled(g.Stack)`
1475
1475
  flex-direction: column;
1476
1476
  align-items: flex-start;
1477
1477
  box-shadow: 0px 3px 15px 0px #00000040;
@@ -1560,7 +1560,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1560
1560
  font-size: 13px;
1561
1561
  font-weight: 600;
1562
1562
  line-height: 14px;
1563
- `,DP=({name:e,variables:t,customFields:n,onOptionClick:r})=>{const[o,A]=m.useState(""),s=m.useMemo(()=>t.filter(C=>C.title.toLowerCase().includes(o.toLowerCase())),[t,o]),{activeField:a,anchorEl:i,onEnter:l,onLeave:u}=um(),d=C=>{var E;A(((E=C==null?void 0:C.target)==null?void 0:E.value)||"")},f=C=>{if(!C)return;const E=am(C);r({title:(E==null?void 0:E.label)||"",value:E==null?void 0:E.value})},p=n&&n.length>0,I=!!a&&Array.isArray(a==null?void 0:a.options)&&a.options.length>0;return c.jsxs(vP,{children:[c.jsx(SP,{value:o,onChange:d,InputProps:{startAdornment:c.jsx(_P,{children:c.jsx(g.icons.Search,{sx:{fontSize:18,color:g.theme.palette.gray.gray3,flexShrink:0}})})},placeholder:"Search variables",variant:"outlined"}),p&&c.jsx(c.Fragment,{children:c.jsx(fm,{variant:"body2_medium",children:"Variables"})}),s.map(({value:C,title:E},h)=>c.jsx(g.Tooltip,{title:E,placement:"top",arrow:!0,children:c.jsx(Cm,{onClick:()=>r({title:E,value:C}),children:c.jsx(Em,{variant:"body2",children:E})})},`${E}-${C}-${h}`)),p&&c.jsxs(c.Fragment,{children:[c.jsx(fm,{variant:"h2",children:"Custom Objects"}),n==null?void 0:n.map(({id:C,name:E,options:h})=>c.jsx(g.Tooltip,{title:E,placement:"top",arrow:!0,children:c.jsx(Cm,{onPointerEnter:B=>{B.pointerType==="touch"||!h.length||l({field:{id:C,name:E,options:h},currentTarget:B.currentTarget})},onPointerLeave:B=>{B.pointerType==="touch"||!h.length||u()},sx:{cursor:h.length?"pointer":"default"},children:c.jsx(Em,{variant:"body2",children:E})})},C))]}),c.jsx(dm,{name:e,customValue:null,popperOpen:I,anchorEl:i,zIndex:xP.POPPER,activeField:a,onEnter:l,onLeave:u,onChange:f})]})},OP=({setOpen:e})=>{const t=()=>{e(n=>!n)};return c.jsx(wP,{onClick:t,tabIndex:0,children:c.jsx(g.icons.Add,{sx:{fontSize:"12px",color:"#4d596c"}})})},LP=({name:e,variables:t,customFields:n,onOptionClick:r})=>{const[o,A]=m.useState(!1),s=a=>{A(!1),r(a)};return c.jsx(g.ClickAwayListener,{onClickAway:()=>{A(!1)},children:c.jsx(g.Box,{children:c.jsx(g.Tooltip,{title:c.jsx(DP,{name:e,variables:t,customFields:n,onOptionClick:s}),placement:"bottom-end",arrow:!1,open:o,PopperProps:{sx:{"& .MuiTooltip-popper":{zIndex:2e3},"& .MuiTooltip-tooltip":{backgroundColor:"transparent",color:"inherit",padding:0,boxShadow:"none",fontSize:"inherit"}}},children:c.jsx(g.Box,{children:c.jsx(OP,{setOpen:A})})})})})},FP=()=>{const e=m.useRef(0),t=m.useRef(null);return{onBlur:A=>{var a;const s=((a=A==null?void 0:A.target)==null?void 0:a.selectionStart)??0;e.current=s},inputRef:t,focusInput:(A=0)=>{var l;const s=t.current;if(!s)return;const a=e.current+A;(l=s.focus)==null||l.call(s),(window.requestAnimationFrame??window.setTimeout)(()=>{var u;(u=s.setSelectionRange)==null||u.call(s,a,a)})},insertVariable:(A,s)=>{const a=e.current;return A.slice(0,a)+s+A.slice(a)}}},NP=({name:e,type:t,value:n,label:r,variables:o,hasError:A,limit:s,multiline:a=!1,customFields:i,isRequired:l=!1,onChange:u,setError:d})=>{const{onBlur:f,inputRef:p,focusInput:I,insertVariable:C}=FP(),E=VQ(Q=>{let y=Wk(Q);t==="date"&&(y=zk(Q)),l&&!Q&&(y=`${r} is required`),d(y)},1e3),h=Q=>{u(Q),E(Q)},B=({value:Q})=>{const y=C(n,Q);h(y),I(Q==null?void 0:Q.length)};return c.jsx(lP,{inputRef:p,value:n,onChange:h,onBlur:f,placeholder:"Value",hasError:A,limit:s,multiline:a,InputProps:{endAdornment:o.length>0?c.jsx(TP,{style:{justifyContent:a?"flex-end":"center",padding:"10px"},children:c.jsx(LP,{name:e,variables:o,customFields:i,onOptionClick:B})}):null}})},RP=({name:e,value:t,placeholder:n,searchPlaceholder:r="Search",formData:o,interfaceDetails:A,customFields:s=[],className:a,hasApiSearch:i=!1,zIndex:l=3e3,fetchOptions:u,onChange:d})=>{const[f,p]=m.useState(!1),[I,C]=m.useState("options"),{activeField:E,anchorEl:h,onEnter:B,onLeave:Q}=um(),y=jk(t),{selectedValue:b,search:v,optionsProps:w,observerProps:x,filteredOptions:T,paginationEnabled:V,labelsMap:D,setSearch:N}=im({value:y?void 0:t,interfaceDetails:A,formData:o,fieldKey:e,hasApiSearch:i,fetchOptions:u}),{parentRef:H}=x,L=U=>{const P=am(U);P&&(d(P),Q(),p(!1))},q=U=>{const P=String(U.target.value);if(P===lm)return;const F=D[P];d({value:P,label:F}),Q(),p(!1)},ne=U=>P=>{P.preventDefault(),P.stopPropagation(),C(U),Q()},le=I==="custom"&&Array.isArray(E==null?void 0:E.options)&&E.options.length>0,fe=()=>{if(!t)return c.jsx(_c,{children:n});const[U,P]=t.label.split(" > ");return y?c.jsxs(mP,{children:[c.jsx(_c,{children:U}),c.jsx(g.icons.ChevronRightOutlined,{sx:{fontSize:"18px"}}),c.jsx(_c,{children:P})]}):c.jsx(_c,{children:t.label})};return m.useEffect(()=>{if(!(t!=null&&t.value)||!f)return;const U=sm(t.value)?"custom":"options";C(U)},[t,f]),c.jsxs(g.FormControl,{fullWidth:!0,sx:dP,className:a,children:[c.jsxs(g.Select,{id:e,displayEmpty:!0,value:b,variant:"outlined",size:"small",sx:CP,open:f,onOpen:()=>{p(!0),C("options")},onClose:()=>{p(!1),Q()},renderValue:fe,MenuProps:{autoFocus:!1,sx:{zIndex:l},PaperProps:{sx:cP},MenuListProps:{sx:uP,ref:H}},onChange:q,children:[c.jsx(g.ListSubheader,{sx:gP,children:c.jsxs(g.Box,{sx:IP,children:[c.jsx(g.Box,{component:"button",type:"button",sx:gm(I==="options"),onClick:ne("options"),children:c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:500,color:I==="options"?g.theme.palette.gray.gray1:g.theme.palette.gray.gray3,children:"Options"})}),c.jsx(g.Box,{component:"button",type:"button",sx:gm(I==="custom"),onClick:ne("custom"),children:c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:500,color:I==="custom"?g.theme.palette.gray.gray1:g.theme.palette.gray.gray3,children:"Custom Object"})})]})}),I==="options"?cm({selectedValue:b,search:v,searchPlaceholder:r,paginationEnabled:V,filteredOptions:T,observerProps:x,optionsProps:w,setSearch:N,searchOffset:62}):s.map(U=>{const P=U.options.length>0;return c.jsxs(g.ListSubheader,{onPointerEnter:F=>{F.pointerType==="touch"||!P||B({field:U,currentTarget:F.currentTarget})},onPointerLeave:F=>{F.pointerType==="touch"||!P||Q()},sx:fP(P&&(E==null?void 0:E.id)===U.id),"data-field-id":U.id,children:[c.jsx("span",{style:{minWidth:0,flex:1,textAlign:"left"},children:U.name}),P?c.jsx(g.icons.PlayArrow,{sx:BP}):null]},U.id)})]}),c.jsx(dm,{name:e,customValue:y,popperOpen:le,anchorEl:h,zIndex:l,activeField:E,onEnter:B,onLeave:Q,onChange:L})]})},kP=({field:e,formId:t,value:n,formValues:r,variables:o,customFields:A,errors:s,checkMandatory:a,setError:i,fetchOptions:l,setFormValues:u,onFieldChange:d})=>{var Q,y;const f=m.useMemo(()=>UQ(500),[]),p=b=>{u(v=>({...v,[e.name]:b})),f(()=>{d==null||d({name:e.name,value:b,type:e.type})})},I=s[e.name],C=I?c.jsx(g.Tooltip,{title:I,placement:"bottom",children:c.jsx(iP,{variant:"body2",fontSize:"13px",color:g.theme.palette.error.main,children:I})}):null,h=Array.isArray(A)&&A.length>0?c.jsx(RP,{customFields:A??[],interfaceDetails:e.interfaceDetails??e.searchInterfaceDetails,formData:r,fetchOptions:b=>l(b,{formId:t,fieldName:e.name}),name:e.name,value:n,placeholder:"Select object",hasApiSearch:!!e.searchInterfaceDetails,onChange:p}):c.jsx(sP,{fieldKey:`${t}-${e.name}`,interfaceDetails:e.interfaceDetails??e.searchInterfaceDetails,value:n,fetchOptions:b=>l(b,{formId:t,fieldName:e.name}),disabled:e.disabled,placeholder:e.placeholder??"Select",menuZIndex:bP,formData:r,hasApiSearch:!!e.searchInterfaceDetails,onChange:p}),B=Mk(e)?h:c.jsx(NP,{name:e.name,label:e.label,type:e.type,variables:o,value:r[e.name]??"",isRequired:a&&!!((Q=e.validations)!=null&&Q.isRequired),onChange:p,hasError:!!I,limit:(y=e.validations)==null?void 0:y.maxCharacters,multiline:e.type==="multiline",setError:b=>i({name:e.name,value:b}),customFields:A});return c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:"4px",position:"relative",children:[B,C]})},PP=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},_.createElement("g",{clipPath:"url(#clip0_833_38792)"},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4 2.52266C11.4 2.86744 11.537 3.1981 11.7808 3.4419C12.0246 3.68569 12.3552 3.82266 12.7 3.82266C13.0448 3.82266 13.3754 3.68569 13.6192 3.4419C13.863 3.1981 14 2.86744 14 2.52266C14 2.17788 13.863 1.84722 13.6192 1.60342C13.3754 1.35962 13.0448 1.22266 12.7 1.22266C12.3552 1.22266 12.0246 1.35962 11.7808 1.60342C11.537 1.84722 11.4 2.17788 11.4 2.52266ZM1 2.52266C1 2.86744 1.13696 3.1981 1.38076 3.44189C1.62456 3.68569 1.95522 3.82266 2.3 3.82266C2.64478 3.82266 2.97544 3.68569 3.21924 3.44189C3.46304 3.1981 3.6 2.86744 3.6 2.52266C3.6 2.17788 3.46304 1.84721 3.21924 1.60342C2.97544 1.35962 2.64478 1.22266 2.3 1.22266C1.95522 1.22266 1.62456 1.35962 1.38076 1.60342C1.13696 1.84721 1 2.17787 1 2.52266Z",fill:"#7853FF",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4 12.3449C11.4 12.6897 11.537 13.0204 11.7808 13.2642C12.0246 13.508 12.3552 13.6449 12.7 13.6449C13.0448 13.6449 13.3754 13.508 13.6192 13.2642C13.863 13.0204 14 12.6897 14 12.3449C14 12.0001 13.863 11.6695 13.6192 11.4257C13.3754 11.1819 13.0448 11.0449 12.7 11.0449C12.3552 11.0449 12.0246 11.1819 11.7808 11.4257C11.537 11.6695 11.4 12.0001 11.4 12.3449ZM1 12.3449C1 12.6897 1.13696 13.0204 1.38076 13.2642C1.62456 13.508 1.95522 13.6449 2.3 13.6449C2.64478 13.6449 2.97544 13.508 3.21924 13.2642C3.46304 13.0204 3.6 12.6897 3.6 12.3449C3.6 12.0001 3.46304 11.6695 3.21924 11.4257C2.97544 11.1819 2.64478 11.0449 2.3 11.0449C1.95522 11.0449 1.62456 11.1819 1.38076 11.4257C1.13696 11.6695 1 12.0001 1 12.3449Z",fill:"#7853FF",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{d:"M11.3984 2.52344L3.59844 2.52344L5.77656 2.52344",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{d:"M11.3984 12.3457L3.59844 12.3457L5.77656 12.3457",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_833_38792"},_.createElement("rect",{width:15,height:15,fill:"white",transform:"translate(15) rotate(90)"})))),hC={outer:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,bgcolor:"#f3ebff",p:"6px",borderRadius:"8px"},frame:{width:24,height:24,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},rotate:{display:"flex",alignItems:"center",justifyContent:"center",transform:"rotate(180deg)",transformOrigin:"center","& svg":{width:15,height:15,display:"block"}}},MP=()=>c.jsx(g.Box,{"aria-hidden":!0,component:"span",sx:hC.outer,children:c.jsx(g.Box,{component:"span",sx:hC.frame,children:c.jsx(g.Box,{component:"span",sx:hC.rotate,children:c.jsx(PP,{})})})}),jP=g.styled("img")`
1563
+ `,DP=({name:e,variables:t,customFields:n,onOptionClick:r})=>{const[o,A]=m.useState(""),s=m.useMemo(()=>t.filter(C=>C.title.toLowerCase().includes(o.toLowerCase())),[t,o]),{activeField:a,anchorEl:i,onEnter:l,onLeave:u}=um(),d=C=>{var E;A(((E=C==null?void 0:C.target)==null?void 0:E.value)||"")},f=C=>{if(!C)return;const E=am(C);r({title:(E==null?void 0:E.label)||"",value:E==null?void 0:E.value})},p=n&&n.length>0,I=!!a&&Array.isArray(a==null?void 0:a.options)&&a.options.length>0;return c.jsxs(vP,{children:[c.jsx(SP,{value:o,onChange:d,InputProps:{startAdornment:c.jsx(_P,{children:c.jsx(g.icons.Search,{sx:{fontSize:18,color:g.theme.palette.gray.gray3,flexShrink:0}})})},placeholder:"Search variables",variant:"outlined"}),p&&c.jsx(c.Fragment,{children:c.jsx(fm,{variant:"body2_medium",children:"Variables"})}),s.map(({value:C,title:E},h)=>c.jsx(g.Tooltip,{title:E,placement:"top",arrow:!0,children:c.jsx(Cm,{onClick:()=>r({title:E,value:C}),children:c.jsx(Em,{variant:"body2",children:E})})},`${E}-${C}-${h}`)),p&&c.jsxs(c.Fragment,{children:[c.jsx(fm,{variant:"h2",children:"Custom Objects"}),n==null?void 0:n.map(({id:C,name:E,options:h})=>c.jsx(g.Tooltip,{title:E,placement:"top",arrow:!0,children:c.jsx(Cm,{onPointerEnter:B=>{B.pointerType==="touch"||!h.length||l({field:{id:C,name:E,options:h},currentTarget:B.currentTarget})},onPointerLeave:B=>{B.pointerType==="touch"||!h.length||u()},sx:{cursor:h.length?"pointer":"default"},children:c.jsx(Em,{variant:"body2",children:E})})},C))]}),c.jsx(dm,{name:e,customValue:null,popperOpen:I,anchorEl:i,zIndex:xP.POPPER,activeField:a,onEnter:l,onLeave:u,onChange:f})]})},OP=({setOpen:e})=>{const t=()=>{e(n=>!n)};return c.jsx(wP,{onClick:t,tabIndex:0,children:c.jsx(g.icons.Add,{sx:{fontSize:"12px",color:"#4d596c"}})})},LP=({name:e,variables:t,customFields:n,onOptionClick:r})=>{const[o,A]=m.useState(!1),s=a=>{A(!1),r(a)};return c.jsx(g.ClickAwayListener,{onClickAway:()=>{A(!1)},children:c.jsx(g.Box,{children:c.jsx(g.Tooltip,{title:c.jsx(DP,{name:e,variables:t,customFields:n,onOptionClick:s}),placement:"bottom-end",arrow:!1,open:o,PopperProps:{sx:{"& .MuiTooltip-popper":{zIndex:2e3},"& .MuiTooltip-tooltip":{backgroundColor:"transparent",color:"inherit",padding:0,boxShadow:"none",fontSize:"inherit"}}},children:c.jsx(g.Box,{children:c.jsx(OP,{setOpen:A})})})})})},FP=()=>{const e=m.useRef(0),t=m.useRef(null);return{onBlur:A=>{var a;const s=((a=A==null?void 0:A.target)==null?void 0:a.selectionStart)??0;e.current=s},inputRef:t,focusInput:(A=0)=>{var l;const s=t.current;if(!s)return;const a=e.current+A;(l=s.focus)==null||l.call(s),(window.requestAnimationFrame??window.setTimeout)(()=>{var u;(u=s.setSelectionRange)==null||u.call(s,a,a)})},insertVariable:(A,s)=>{const a=e.current;return A.slice(0,a)+s+A.slice(a)}}},NP=({name:e,type:t,value:n,label:r,variables:o,hasError:A,limit:s,multiline:a=!1,customFields:i,isRequired:l=!1,onChange:u,setError:d})=>{const{onBlur:f,inputRef:p,focusInput:I,insertVariable:C}=FP(),E=t==="date"?o.filter(y=>y.isDate):o,h=VQ(y=>{let b=Wk(y);t==="date"&&(b=zk(y)),l&&!y&&(b=`${r} is required`),d(b)},1e3),B=y=>{u(y),h(y)},Q=({value:y})=>{const b=C(n,y);B(b),I(y==null?void 0:y.length)};return c.jsx(lP,{inputRef:p,value:n,onChange:B,onBlur:f,placeholder:"Value",hasError:A,limit:s,multiline:a,InputProps:{endAdornment:E.length>0?c.jsx(TP,{style:{justifyContent:a?"flex-end":"center",padding:"10px"},children:c.jsx(LP,{name:e,variables:E,customFields:i,onOptionClick:Q})}):null}})},RP=({name:e,value:t,placeholder:n,searchPlaceholder:r="Search",formData:o,interfaceDetails:A,customFields:s=[],className:a,hasApiSearch:i=!1,zIndex:l=3e3,fetchOptions:u,onChange:d})=>{const[f,p]=m.useState(!1),[I,C]=m.useState("options"),{activeField:E,anchorEl:h,onEnter:B,onLeave:Q}=um(),y=jk(t),{selectedValue:b,search:v,optionsProps:w,observerProps:x,filteredOptions:T,paginationEnabled:V,labelsMap:D,setSearch:N}=im({value:y?void 0:t,interfaceDetails:A,formData:o,fieldKey:e,hasApiSearch:i,fetchOptions:u}),{parentRef:H}=x,L=U=>{const P=am(U);P&&(d(P),Q(),p(!1))},q=U=>{const P=String(U.target.value);if(P===lm)return;const F=D[P];d({value:P,label:F}),Q(),p(!1)},ne=U=>P=>{P.preventDefault(),P.stopPropagation(),C(U),Q()},le=I==="custom"&&Array.isArray(E==null?void 0:E.options)&&E.options.length>0,fe=()=>{if(!t)return c.jsx(_c,{children:n});const[U,P]=t.label.split(" > ");return y?c.jsxs(mP,{children:[c.jsx(_c,{children:U}),c.jsx(g.icons.ChevronRightOutlined,{sx:{fontSize:"18px"}}),c.jsx(_c,{children:P})]}):c.jsx(_c,{children:t.label})};return m.useEffect(()=>{if(!(t!=null&&t.value)||!f)return;const U=sm(t.value)?"custom":"options";C(U)},[t,f]),c.jsxs(g.FormControl,{fullWidth:!0,sx:dP,className:a,children:[c.jsxs(g.Select,{id:e,displayEmpty:!0,value:b,variant:"outlined",size:"small",sx:CP,open:f,onOpen:()=>{p(!0),C("options")},onClose:()=>{p(!1),Q()},renderValue:fe,MenuProps:{autoFocus:!1,sx:{zIndex:l},PaperProps:{sx:cP},MenuListProps:{sx:uP,ref:H}},onChange:q,children:[c.jsx(g.ListSubheader,{sx:gP,children:c.jsxs(g.Box,{sx:IP,children:[c.jsx(g.Box,{component:"button",type:"button",sx:gm(I==="options"),onClick:ne("options"),children:c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:500,color:I==="options"?g.theme.palette.gray.gray1:g.theme.palette.gray.gray3,children:"Options"})}),c.jsx(g.Box,{component:"button",type:"button",sx:gm(I==="custom"),onClick:ne("custom"),children:c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:500,color:I==="custom"?g.theme.palette.gray.gray1:g.theme.palette.gray.gray3,children:"Custom Object"})})]})}),I==="options"?cm({selectedValue:b,search:v,searchPlaceholder:r,paginationEnabled:V,filteredOptions:T,observerProps:x,optionsProps:w,setSearch:N,searchOffset:62}):s.map(U=>{const P=U.options.length>0;return c.jsxs(g.ListSubheader,{onPointerEnter:F=>{F.pointerType==="touch"||!P||B({field:U,currentTarget:F.currentTarget})},onPointerLeave:F=>{F.pointerType==="touch"||!P||Q()},sx:fP(P&&(E==null?void 0:E.id)===U.id),"data-field-id":U.id,children:[c.jsx("span",{style:{minWidth:0,flex:1,textAlign:"left"},children:U.name}),P?c.jsx(g.icons.PlayArrow,{sx:BP}):null]},U.id)})]}),c.jsx(dm,{name:e,customValue:y,popperOpen:le,anchorEl:h,zIndex:l,activeField:E,onEnter:B,onLeave:Q,onChange:L})]})},kP=({field:e,formId:t,value:n,formValues:r,variables:o,customFields:A,errors:s,checkMandatory:a,setError:i,fetchOptions:l,setFormValues:u,onFieldChange:d})=>{var Q,y;const f=m.useMemo(()=>UQ(500),[]),p=b=>{u(v=>({...v,[e.name]:b})),f(()=>{d==null||d({name:e.name,value:b,type:e.type})})},I=s[e.name],C=I?c.jsx(g.Tooltip,{title:I,placement:"bottom",children:c.jsx(iP,{variant:"body2",fontSize:"13px",color:g.theme.palette.error.main,children:I})}):null,h=Array.isArray(A)&&A.length>0?c.jsx(RP,{customFields:A??[],interfaceDetails:e.interfaceDetails??e.searchInterfaceDetails,formData:r,fetchOptions:b=>l(b,{formId:t,fieldName:e.name}),name:e.name,value:n,placeholder:"Select object",hasApiSearch:!!e.searchInterfaceDetails,onChange:p}):c.jsx(sP,{fieldKey:`${t}-${e.name}`,interfaceDetails:e.interfaceDetails??e.searchInterfaceDetails,value:n,fetchOptions:b=>l(b,{formId:t,fieldName:e.name}),disabled:e.disabled,placeholder:e.placeholder??"Select",menuZIndex:bP,formData:r,hasApiSearch:!!e.searchInterfaceDetails,onChange:p}),B=Mk(e)?h:c.jsx(NP,{name:e.name,label:e.label,type:e.type,variables:o,value:r[e.name]??"",isRequired:a&&!!((Q=e.validations)!=null&&Q.isRequired),onChange:p,hasError:!!I,limit:(y=e.validations)==null?void 0:y.maxCharacters,multiline:e.type==="multiline",setError:b=>i({name:e.name,value:b}),customFields:A});return c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:"4px",position:"relative",children:[B,C]})},PP=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},_.createElement("g",{clipPath:"url(#clip0_833_38792)"},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4 2.52266C11.4 2.86744 11.537 3.1981 11.7808 3.4419C12.0246 3.68569 12.3552 3.82266 12.7 3.82266C13.0448 3.82266 13.3754 3.68569 13.6192 3.4419C13.863 3.1981 14 2.86744 14 2.52266C14 2.17788 13.863 1.84722 13.6192 1.60342C13.3754 1.35962 13.0448 1.22266 12.7 1.22266C12.3552 1.22266 12.0246 1.35962 11.7808 1.60342C11.537 1.84722 11.4 2.17788 11.4 2.52266ZM1 2.52266C1 2.86744 1.13696 3.1981 1.38076 3.44189C1.62456 3.68569 1.95522 3.82266 2.3 3.82266C2.64478 3.82266 2.97544 3.68569 3.21924 3.44189C3.46304 3.1981 3.6 2.86744 3.6 2.52266C3.6 2.17788 3.46304 1.84721 3.21924 1.60342C2.97544 1.35962 2.64478 1.22266 2.3 1.22266C1.95522 1.22266 1.62456 1.35962 1.38076 1.60342C1.13696 1.84721 1 2.17787 1 2.52266Z",fill:"#7853FF",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4 12.3449C11.4 12.6897 11.537 13.0204 11.7808 13.2642C12.0246 13.508 12.3552 13.6449 12.7 13.6449C13.0448 13.6449 13.3754 13.508 13.6192 13.2642C13.863 13.0204 14 12.6897 14 12.3449C14 12.0001 13.863 11.6695 13.6192 11.4257C13.3754 11.1819 13.0448 11.0449 12.7 11.0449C12.3552 11.0449 12.0246 11.1819 11.7808 11.4257C11.537 11.6695 11.4 12.0001 11.4 12.3449ZM1 12.3449C1 12.6897 1.13696 13.0204 1.38076 13.2642C1.62456 13.508 1.95522 13.6449 2.3 13.6449C2.64478 13.6449 2.97544 13.508 3.21924 13.2642C3.46304 13.0204 3.6 12.6897 3.6 12.3449C3.6 12.0001 3.46304 11.6695 3.21924 11.4257C2.97544 11.1819 2.64478 11.0449 2.3 11.0449C1.95522 11.0449 1.62456 11.1819 1.38076 11.4257C1.13696 11.6695 1 12.0001 1 12.3449Z",fill:"#7853FF",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{d:"M11.3984 2.52344L3.59844 2.52344L5.77656 2.52344",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{d:"M11.3984 12.3457L3.59844 12.3457L5.77656 12.3457",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_833_38792"},_.createElement("rect",{width:15,height:15,fill:"white",transform:"translate(15) rotate(90)"})))),hC={outer:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,bgcolor:"#f3ebff",p:"6px",borderRadius:"8px"},frame:{width:24,height:24,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},rotate:{display:"flex",alignItems:"center",justifyContent:"center",transform:"rotate(180deg)",transformOrigin:"center","& svg":{width:15,height:15,display:"block"}}},MP=()=>c.jsx(g.Box,{"aria-hidden":!0,component:"span",sx:hC.outer,children:c.jsx(g.Box,{component:"span",sx:hC.frame,children:c.jsx(g.Box,{component:"span",sx:hC.rotate,children:c.jsx(PP,{})})})}),jP=g.styled("img")`
1564
1564
  width: 16px;
1565
1565
  height: auto;
1566
1566
  object-fit: cover;
@@ -1620,7 +1620,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1620
1620
  display: inline-block;
1621
1621
  color: inherit;
1622
1622
  }
1623
- `,UP={borderRadius:"0 !important",padding:"0 !important",width:"max-content !important",maxWidth:"max-content !important",height:"100% !important",maxHeight:"100% !important",position:"fixed",boxSizing:"border-box !important",top:0,bottom:0,right:0,margin:0};function $P(e){return e.rowId??e.name}const Im=({open:e,onClose:t,formId:n,fields:r,variables:o,connectorLogo:A,isSaving:s,title:a="Map fields",isLoading:i=!1,defaultValues:l,customFields:u,checkMandatory:d=!1,fetchOptions:f,onSave:p,onCancel:I,onFieldChange:C})=>{const[E,h]=m.useState({}),[B,Q]=m.useState({}),[y,b]=m.useState(!1),v=m.useMemo(()=>UQ(500),[]),w=m.useMemo(()=>{if(!Array.isArray(r)||!r.length)return[];const H=new Set;return r.filter(q=>H.has(q.name)?!1:(H.add(q.name),!0)).sort((q,ne)=>q.priority-ne.priority)},[r]),x=({name:H,value:L})=>{Q(q=>{const ne={...q};return L?ne[H]=L:delete ne[H],ne})};m.useEffect(()=>{l&&e&&h({...l})},[l,e]),m.useEffect(()=>()=>{e||(h({}),Q({}))},[e]),m.useEffect(()=>{d&&v(()=>{const L=r.filter(q=>{var ne;return!!((ne=q.validations)!=null&&ne.isRequired)}).filter(q=>!E[q.name]);b(L.length>0)})},[v,E,r,d]);const T=()=>{t(),h({})},V=()=>{I==null||I(),h({}),t()},D=()=>{const H={...E};for(const L in H)H[L]||delete H[L];p(H)},N=Object.keys(B).length>0||y;return c.jsx(g.Dialog,{open:e,onClose:T,PaperProps:{sx:UP},maxWidth:!1,children:i?c.jsx(g.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"615px"},children:c.jsx(g.CircularProgress,{})}):c.jsxs(HP,{children:[c.jsxs(WP,{children:[c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:2,children:[c.jsx(MP,{}),c.jsx(g.Stack,{gap:.5,flex:1,minWidth:0,children:c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:.5,children:[c.jsx(g.Typography,{variant:"h6",fontSize:18,fontWeight:600,color:g.theme.palette.gray.gray1,children:a}),c.jsx(g.Tooltip,{title:"Assign default values to create fields",placement:"top",children:c.jsx(g.IconButton,{size:"small","aria-label":"About mapping fields",sx:{padding:"4px"},children:c.jsx(g.icons.InfoOutlined,{sx:{fontSize:18,color:g.theme.palette.gray.gray3}})})})]})})]}),c.jsx(g.Tooltip,{title:"Close",placement:"bottom",children:c.jsx(g.IconButton,{onClick:T,size:"small","aria-label":"Close",children:c.jsx(g.icons.Close,{sx:{fontSize:20}})})})]}),c.jsx(zP,{children:c.jsxs(YP,{children:[c.jsxs(g.Stack,{direction:"row",padding:"16px 24px",sx:{backgroundColor:g.theme.palette.gray.gray6a,borderBottom:"1px solid #ECEFF6",borderRadius:"8px 8px 0 0"},children:[c.jsx(VP,{src:A,alt:"Connector"}),c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:g.theme.palette.gray.gray3,flex:1,children:"Field"}),c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:g.theme.palette.gray.gray3,width:320,children:"Map to"})]}),w.map((H,L)=>{var le;const q=$P(H),ne=E[q]??"";return c.jsxs(g.Stack,{direction:"row",alignItems:"center",padding:"24px",gap:2,sx:{borderBottom:L<w.length-1?"1px solid #F6F8FC":void 0,"&:last-child":{borderBottom:"none"}},children:[c.jsx(qP,{children:c.jsxs(g.Typography,{variant:"body2",fontSize:14,color:g.theme.palette.gray.gray2,children:[H.label,d&&((le=H.validations)!=null&&le.isRequired)?c.jsx(ZP,{}):null]})}),c.jsx(GP,{width:20,height:20}),c.jsx(XP,{children:c.jsx(kP,{field:H,formId:String(n),value:ne,formValues:E,variables:o,customFields:u,errors:B,checkMandatory:d,setError:x,fetchOptions:f,setFormValues:h,onFieldChange:C})})]},q)})]})}),c.jsxs(JP,{children:[c.jsx(g.Button,{variant:"contained",onClick:D,sx:{textTransform:"none",padding:"3px 32px !important"},disabled:s||N,children:"Save"}),c.jsx(g.Button,{variant:"outlined",color:"inherit",onClick:V,disabled:s,sx:{textTransform:"none",padding:"3px 12px !important",borderColor:g.theme.palette.gray.gray5},children:"Cancel"})]})]})})};g.styled(g.Box)`
1623
+ `,UP={borderRadius:"0 !important",padding:"0 !important",width:"max-content !important",maxWidth:"max-content !important",height:"100% !important",maxHeight:"100% !important",position:"fixed",boxSizing:"border-box !important",top:0,bottom:0,right:0,margin:0};function $P(e){return e.name??e.rowId}const Im=({open:e,onClose:t,formId:n,fields:r,variables:o,connectorLogo:A,isSaving:s,title:a="Pre-fill fields",isLoading:i=!1,defaultValues:l,customFields:u,checkMandatory:d=!1,fetchOptions:f,onSave:p,onCancel:I,onFieldChange:C})=>{const[E,h]=m.useState({}),[B,Q]=m.useState({}),[y,b]=m.useState(!1),v=m.useMemo(()=>UQ(500),[]),w=m.useMemo(()=>{if(!Array.isArray(r)||!r.length)return[];const H=new Set;return r.filter(q=>H.has(q.name)?!1:(H.add(q.name),!0)).sort((q,ne)=>q.priority-ne.priority)},[r]),x=({name:H,value:L})=>{Q(q=>{const ne={...q};return L?ne[H]=L:delete ne[H],ne})};m.useEffect(()=>{l&&e&&h({...l})},[l,e]),m.useEffect(()=>()=>{e||(h({}),Q({}))},[e]),m.useEffect(()=>{d&&v(()=>{const L=r.filter(q=>{var ne;return!!((ne=q.validations)!=null&&ne.isRequired)}).filter(q=>!E[q.name]);b(L.length>0)})},[v,E,r,d]);const T=()=>{t(),h({})},V=()=>{I==null||I(),h({}),t()},D=()=>{const H={...E};for(const L in H)H[L]||delete H[L];p(H)},N=Object.keys(B).length>0||y;return c.jsx(g.Dialog,{open:e,onClose:T,PaperProps:{sx:UP},maxWidth:!1,children:i?c.jsx(g.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"615px"},children:c.jsx(g.CircularProgress,{})}):c.jsxs(HP,{children:[c.jsxs(WP,{children:[c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:2,children:[c.jsx(MP,{}),c.jsx(g.Stack,{gap:.5,flex:1,minWidth:0,children:c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:.5,children:[c.jsxs(g.Typography,{variant:"h6",fontSize:18,fontWeight:600,color:g.theme.palette.gray.gray1,children:["Pre-fill fields for ",a]}),c.jsx(g.Tooltip,{title:"Assign default values to create fields",placement:"top",children:c.jsx(g.IconButton,{size:"small","aria-label":"About mapping fields",sx:{padding:"4px"},children:c.jsx(g.icons.InfoOutlined,{sx:{fontSize:18,color:g.theme.palette.gray.gray3}})})})]})})]}),c.jsx(g.Tooltip,{title:"Close",placement:"bottom",children:c.jsx(g.IconButton,{onClick:T,size:"small","aria-label":"Close",children:c.jsx(g.icons.Close,{sx:{fontSize:20}})})})]}),c.jsx(zP,{children:c.jsxs(YP,{children:[c.jsxs(g.Stack,{direction:"row",padding:"16px 24px",sx:{backgroundColor:g.theme.palette.gray.gray6a,borderBottom:"1px solid #ECEFF6",borderRadius:"8px 8px 0 0"},children:[c.jsx(VP,{src:A,alt:"Connector"}),c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:g.theme.palette.gray.gray3,flex:1,children:"Field"}),c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:g.theme.palette.gray.gray3,width:320,children:"Map to"})]}),w.map((H,L)=>{var le;const q=$P(H),ne=E[q]??"";return c.jsxs(g.Stack,{direction:"row",alignItems:"center",padding:"24px",gap:2,sx:{borderBottom:L<w.length-1?"1px solid #F6F8FC":void 0,"&:last-child":{borderBottom:"none"}},children:[c.jsx(qP,{children:c.jsxs(g.Typography,{variant:"body2",fontSize:14,color:g.theme.palette.gray.gray2,children:[H.label,d&&((le=H.validations)!=null&&le.isRequired)?c.jsx(ZP,{}):null]})}),c.jsx(GP,{width:20,height:20}),c.jsx(XP,{children:c.jsx(kP,{field:H,formId:String(n),value:ne,formValues:E,variables:o,customFields:u,errors:B,checkMandatory:d,setError:x,fetchOptions:f,setFormValues:h,onFieldChange:C})})]},q)})]})}),c.jsxs(JP,{children:[c.jsx(g.Button,{variant:"contained",onClick:D,sx:{textTransform:"none",padding:"3px 32px !important"},disabled:s||N,children:"Save"}),c.jsx(g.Button,{variant:"outlined",color:"inherit",onClick:V,disabled:s,sx:{textTransform:"none",padding:"3px 12px !important",borderColor:g.theme.palette.gray.gray5},children:"Cancel"})]})]})})};g.styled(g.Box)`
1624
1624
  position: fixed;
1625
1625
  inset: 0;
1626
1626
  z-index: ${({zIndex:e})=>e};
@@ -2687,7 +2687,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2687
2687
  border: 1px solid ${g.theme.palette.gray.gray6};
2688
2688
  border-radius: 8px;
2689
2689
  box-sizing: border-box;
2690
- `,li=()=>c.jsx(g.Stack,{marginTop:"28px",gap:"12px","data-testid":"loading",flexDirection:"row",flexWrap:"wrap",children:Array(6).fill(0).map((e,t)=>c.jsx(RG,{justifyContent:"center",children:c.jsx(NG,{variant:"rounded",maxWidth:"260px",height:"60px",animation:"wave"})},t))}),t1=e=>e.connectorLirary.connectorList,eo=e=>e.connectorLirary.connectors,SC=e=>e.connectorLirary.connectorsApiStatus,n1=e=>e.connectorLirary.currentUpdatingConnectors,ci=e=>e.connectorLirary.connectorDetailApiStatus,ui=e=>e.connectorLirary.rolesAndPermissions??[],_C=e=>e.connectorLirary.updateEnableConnectorsApiStatus,DC=e=>e.connectorLirary.cardCustomFields,kG=e=>e.connectorLirary.cardCustomFieldsApiStatus,PG=e=>e.connectorLirary.notAuthenticatedConnectors,MG=e=>e.connectorLirary.requireUpgradeConnectors,jG=e=>e.connectorLirary.enableCustomCardApiStatus,VG=e=>e.connectorLirary.updateConnectorByIdApiStatus,r1="Visibility not set",OC="Configure visibility settings",GG="Set the card visibility across shared mailboxes and roles to enable ${{connector}}",o1="Configure fields",HG="Choose which fields your team can view in Hiver and which can be filled in when creating new ${{connector}} records.",A1="Contact your admin to configure visibility",WG="Select inbox(es)",zG="Select the inbox(es)",YG="Select the role",JG="Select role",s1="inbox",XG="roles",LC="Close",Xc="${{connector}}",a1="Visibility settings saved",qG="Field visibility settings saved",FC="Some error occured. Please contact support@hiverhq.com",ZG="Selecting any lower role will automatically select the roles above it",UG="Loading custom fields...",NC="Save",Ss="enabled",_s="disabled",i1="Select atleast one field to save",qc="New",$G="Upgrade now",KG="Authentication failed",eH="More info about the current updates that will be there in this app",tH="App's visibility & access",nH="Set the card & field visibility across shared mailboxes and roles to enable the connector",rH="Customer identity mapping",oH="Choose how Hiver should identify customers when fetching data from connected apps.",AH="Edit",sH="Save",aH="Matches with %s's",iH="Customer identity mapping saved",lH="Failed to save. Please try again.",cH="Map fields",RC=g.styled(g.Box)`
2690
+ `,li=()=>c.jsx(g.Stack,{marginTop:"28px",gap:"12px","data-testid":"loading",flexDirection:"row",flexWrap:"wrap",children:Array(6).fill(0).map((e,t)=>c.jsx(RG,{justifyContent:"center",children:c.jsx(NG,{variant:"rounded",maxWidth:"260px",height:"60px",animation:"wave"})},t))}),t1=e=>e.connectorLirary.connectorList,eo=e=>e.connectorLirary.connectors,SC=e=>e.connectorLirary.connectorsApiStatus,n1=e=>e.connectorLirary.currentUpdatingConnectors,ci=e=>e.connectorLirary.connectorDetailApiStatus,ui=e=>e.connectorLirary.rolesAndPermissions??[],_C=e=>e.connectorLirary.updateEnableConnectorsApiStatus,DC=e=>e.connectorLirary.cardCustomFields,kG=e=>e.connectorLirary.cardCustomFieldsApiStatus,PG=e=>e.connectorLirary.notAuthenticatedConnectors,MG=e=>e.connectorLirary.requireUpgradeConnectors,jG=e=>e.connectorLirary.enableCustomCardApiStatus,VG=e=>e.connectorLirary.updateConnectorByIdApiStatus,r1="Visibility not set",OC="Configure visibility settings",GG="Set the card visibility across shared mailboxes and roles to enable ${{connector}}",o1="Configure fields",HG="Choose which fields your team can view in Hiver and which can be filled in when creating new ${{connector}} records.",A1="Contact your admin to configure visibility",WG="Select inbox(es)",zG="Select the inbox(es)",YG="Select the role",JG="Select role",s1="inbox",XG="roles",LC="Close",Xc="${{connector}}",a1="Visibility settings saved",qG="Field visibility settings saved",FC="Some error occured. Please contact support@hiverhq.com",ZG="Selecting any lower role will automatically select the roles above it",UG="Loading custom fields...",NC="Save",Ss="enabled",_s="disabled",i1="Select atleast one field to save",qc="New",$G="Upgrade now",KG="Authentication failed",eH="More info about the current updates that will be there in this app",tH="App's visibility & access",nH="Set the card & field visibility across shared mailboxes and roles to enable the connector",rH="Customer identity mapping",oH="Choose how Hiver should identify customers when fetching data from connected apps.",AH="Edit",sH="Save",aH="Matches with %s's",iH="Customer identity mapping saved",lH="Failed to save. Please try again.",cH="Pre-fill fields",RC=g.styled(g.Box)`
2691
2691
  min-height: 506px;
2692
2692
  width: 462px;
2693
2693
  padding: 32px;
@@ -2948,7 +2948,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2948
2948
  `,XC=({shown:e,connectorName:t,setShown:n,onClose:r})=>{const o=C1,A=()=>{n(!1),r==null||r()},s=`${t} ${hW}`;return c.jsxs(Os,{shown:e,setShown:n,onClose:A,showCloseButton:!0,children:[c.jsxs("div",{className:"flex flex-col gap-[14px] p-[30px] w-[378px] justify-center ",children:[c.jsx("img",{src:d1,alt:"checkmark",width:92,height:92}),c.jsxs("div",{children:[c.jsx(g.Typography,{className:"pb-1",variant:"h2",children:s}),c.jsx(g.Typography,{variant:"body2",children:QW})]}),c.jsx("div",{className:"items-start",children:c.jsx(g.Button,{onClick:A,children:mW})})]}),c.jsx(yW,{children:c.jsx("img",{className:"connector-enabled-img",src:o,alt:"App enabled"})})]})},bW="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_10035_17637'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='21'%20height='20'%3e%3crect%20x='20.6951'%20width='20'%20height='20'%20transform='rotate(90%2020.6951%200)'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_10035_17637)'%3e%3cpath%20d='M10.6951%2010.4974L14.5284%206.66406L15.6951%207.83073L10.6951%2012.8307L5.69507%207.83073L6.86174%206.66406L10.6951%2010.4974Z'%20fill='%236F7C90'/%3e%3c/g%3e%3c/svg%3e",xW=g.styled("img")`
2949
2949
  transition: transform 0.3s;
2950
2950
  transform: rotate(${e=>e.transformAngle}deg);
2951
- `,vW=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_3297_163628)"},_.createElement("path",{d:"M9.99967 5.41667C13.158 5.41667 15.9747 7.19167 17.3497 10C15.9747 12.8083 13.1663 14.5833 9.99967 14.5833C6.83301 14.5833 4.02467 12.8083 2.64967 10C4.02467 7.19167 6.84134 5.41667 9.99967 5.41667ZM9.99967 3.75C5.83301 3.75 2.27467 6.34167 0.833008 10C2.27467 13.6583 5.83301 16.25 9.99967 16.25C14.1663 16.25 17.7247 13.6583 19.1663 10C17.7247 6.34167 14.1663 3.75 9.99967 3.75ZM9.99967 7.91667C11.1497 7.91667 12.083 8.85 12.083 10C12.083 11.15 11.1497 12.0833 9.99967 12.0833C8.84967 12.0833 7.91634 11.15 7.91634 10C7.91634 8.85 8.84967 7.91667 9.99967 7.91667ZM9.99967 6.25C7.93301 6.25 6.24967 7.93333 6.24967 10C6.24967 12.0667 7.93301 13.75 9.99967 13.75C12.0663 13.75 13.7497 12.0667 13.7497 10C13.7497 7.93333 12.0663 6.25 9.99967 6.25Z",fill:"#3E4C5A"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_3297_163628"},_.createElement("rect",{width:20,height:20,fill:"white"})))),wW=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("mask",{id:"mask0_3354_177768",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:20},_.createElement("rect",{width:20,height:20,fill:"#D9D9D9"})),_.createElement("g",{mask:"url(#mask0_3354_177768)"},_.createElement("path",{d:"M13.2708 11.1462L11.9792 9.85449C12.0347 9.32671 11.875 8.87185 11.5 8.48991C11.125 8.10796 10.6736 7.94477 10.1458 8.00033L8.85417 6.70866C9.03472 6.63921 9.22222 6.58713 9.41667 6.55241C9.61111 6.51769 9.80556 6.50033 10 6.50033C10.9722 6.50033 11.7986 6.8406 12.4792 7.52116C13.1597 8.20171 13.5 9.0281 13.5 10.0003C13.5 10.1948 13.4826 10.3892 13.4479 10.5837C13.4132 10.7781 13.3542 10.9656 13.2708 11.1462ZM16.0417 13.917L14.9583 12.8337C15.4583 12.4448 15.9132 12.0177 16.3229 11.5524C16.7326 11.0871 17.0764 10.5698 17.3542 10.0003C16.6736 8.59755 15.6701 7.49685 14.3438 6.69824C13.0174 5.89963 11.5694 5.50033 10 5.50033C9.63889 5.50033 9.28472 5.52116 8.9375 5.56283C8.59028 5.60449 8.25 5.67394 7.91667 5.77116L6.70833 4.56283C7.23611 4.35449 7.77431 4.20866 8.32292 4.12533C8.87153 4.04199 9.43056 4.00033 10 4.00033C11.9861 4.00033 13.8021 4.53852 15.4479 5.61491C17.0938 6.6913 18.2778 8.1531 19 10.0003C18.6944 10.792 18.2882 11.5107 17.7812 12.1566C17.2743 12.8024 16.6944 13.3892 16.0417 13.917ZM16 18.1253L13.2917 15.417C12.7639 15.6114 12.2257 15.7573 11.6771 15.8545C11.1285 15.9517 10.5694 16.0003 10 16.0003C8.01389 16.0003 6.19792 15.4621 4.55208 14.3857C2.90625 13.3094 1.72222 11.8475 1 10.0003C1.30556 9.20866 1.70833 8.48644 2.20833 7.83366C2.70833 7.18088 3.29167 6.5906 3.95833 6.06283L1.875 3.97949L2.9375 2.91699L17.0625 17.0628L16 18.1253ZM5.02083 7.14616C4.53472 7.53505 4.08333 7.96213 3.66667 8.42741C3.25 8.89269 2.90972 9.41699 2.64583 10.0003C3.32639 11.4031 4.32986 12.5038 5.65625 13.3024C6.98264 14.101 8.43056 14.5003 10 14.5003C10.3611 14.5003 10.7153 14.476 11.0625 14.4274C11.4097 14.3788 11.7569 14.3128 12.1042 14.2295L11.1667 13.292C10.9722 13.3614 10.7778 13.4135 10.5833 13.4482C10.3889 13.483 10.1944 13.5003 10 13.5003C9.02778 13.5003 8.20139 13.16 7.52083 12.4795C6.84028 11.7989 6.5 10.9725 6.5 10.0003C6.5 9.80588 6.52431 9.61144 6.57292 9.41699C6.62153 9.22255 6.66667 9.0281 6.70833 8.83366L5.02083 7.14616Z",fill:"#6F7C90"}))),TW=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"#97A3B7",...e},_.createElement("path",{d:"M11.06 6.02L11.98 6.94L2.92 16H2V15.08L11.06 6.02ZM14.66 0C14.41 0 14.15 0.1 13.96 0.29L12.13 2.12L15.88 5.87L17.71 4.04C18.1 3.65 18.1 3.02 17.71 2.63L15.37 0.29C15.17 0.09 14.92 0 14.66 0ZM11.06 3.19L0 14.25V18H3.75L14.81 6.94L11.06 3.19Z",fill:"currentColor"})),SW=async({cardId:e,formType:t})=>{const n=new URLSearchParams;n.append("form_type",t);const r=await Me({url:cr(`${bV}?${n.toString()}`,{cardId:e}),method:Gt.GET});return(r==null?void 0:r.data).formsList.find(s=>s.type===t)},_W=({cardId:e,formType:t,enabled:n})=>go({queryKey:["fetchFormData",e,t],queryFn:()=>SW({cardId:e,formType:t}),enabled:!!e&&!!t&&n}),B1=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Me({url:cr(`${yV}?${r.toString()}`,e),method:Gt.POST,data:t})},DW=async({formId:e})=>{try{const t=await Me({url:cr(zm,{formId:e}),method:Gt.GET}),n=t==null?void 0:t.data;return n.enabled?$Q(n.defaults):{}}catch(t){throw console.error(t),t}},p1=({formId:e})=>["Global","WriteForm","FormDefaults",e],OW=({formId:e,enabled:t})=>{const n=m.useRef(!0),r=go({queryKey:p1({formId:e}),queryFn:async()=>{const o=await DW({formId:e});return n.current=!1,o},refetchOnMount:!0,enabled:n.current&&!!e&&t,staleTime:0});return{enabledRef:n,...r}},LW=async({formId:e,data:t})=>{try{return await Me({url:cr(zm,{formId:e}),data:{defaults:t},method:Gt.PUT}),{formId:e,data:t}}catch(n){throw console.error(n),n}},FW=({formId:e,onSuccess:t,onError:n})=>{const r=Do();return ZA({mutationFn:o=>LW({formId:e,data:o}),onSuccess:o=>{r.invalidateQueries({queryKey:p1({formId:e})}),Vn({message:"Form defaults updated successfully",type:es}),t==null||t(o)},onError:()=>{n==null||n(),Vn({message:"Failed to update form defaults",type:Co})}})},NW=({open:e,formId:t,fields:n,connectorLogo:r,variables:o,customFormArgsEnabled:A,customFormArgsMap:s,title:a="Map fields",isLoading:i=!1,onSuccess:l,onClose:u})=>{const[d,f]=m.useState({}),{data:p}=ZQ({formId:t,formData:d,argsMap:s??{},enabled:A,delay:500}),{data:I,enabledRef:C,isLoading:E}=OW({formId:t,enabled:!!e&&!!t}),{mutate:h,isPending:B}=FW({formId:t,onSuccess:x=>{l==null||l(x),C.current=!0}}),Q=m.useMemo(()=>p!=null&&p.length?[...n,...p]:n,[n,p]);m.useEffect(()=>{I&&f(I)},[I]);const y=x=>{const T=KQ(x,Q??[]);h(T)},b=async({args:x,pagination:T},{formId:V,fieldName:D})=>{const N=await B1({formId:V,fieldName:D},{pagination:T,args:x}),H=Array.isArray(N==null?void 0:N.data.data)?N.data.data:[];return{options:H,hasMore:!!H.length}},v=()=>{u==null||u(),C.current=!0},w=x=>{const T=fC(x.value)?x.value.value:x.value,V=T&&x.type==="multi-select"?[T]:T;f(D=>({...D,[x.name]:V}))};return c.jsx(Im,{open:e,defaultValues:I,formId:t,fields:Q,connectorLogo:r,variables:o,title:a,isLoading:i||E,isSaving:B,fetchOptions:b,onSave:y,onClose:v,onCancel:v,onFieldChange:w})},RW=g.styled(g.Stack)`
2951
+ `,vW=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_3297_163628)"},_.createElement("path",{d:"M9.99967 5.41667C13.158 5.41667 15.9747 7.19167 17.3497 10C15.9747 12.8083 13.1663 14.5833 9.99967 14.5833C6.83301 14.5833 4.02467 12.8083 2.64967 10C4.02467 7.19167 6.84134 5.41667 9.99967 5.41667ZM9.99967 3.75C5.83301 3.75 2.27467 6.34167 0.833008 10C2.27467 13.6583 5.83301 16.25 9.99967 16.25C14.1663 16.25 17.7247 13.6583 19.1663 10C17.7247 6.34167 14.1663 3.75 9.99967 3.75ZM9.99967 7.91667C11.1497 7.91667 12.083 8.85 12.083 10C12.083 11.15 11.1497 12.0833 9.99967 12.0833C8.84967 12.0833 7.91634 11.15 7.91634 10C7.91634 8.85 8.84967 7.91667 9.99967 7.91667ZM9.99967 6.25C7.93301 6.25 6.24967 7.93333 6.24967 10C6.24967 12.0667 7.93301 13.75 9.99967 13.75C12.0663 13.75 13.7497 12.0667 13.7497 10C13.7497 7.93333 12.0663 6.25 9.99967 6.25Z",fill:"#3E4C5A"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_3297_163628"},_.createElement("rect",{width:20,height:20,fill:"white"})))),wW=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("mask",{id:"mask0_3354_177768",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:20},_.createElement("rect",{width:20,height:20,fill:"#D9D9D9"})),_.createElement("g",{mask:"url(#mask0_3354_177768)"},_.createElement("path",{d:"M13.2708 11.1462L11.9792 9.85449C12.0347 9.32671 11.875 8.87185 11.5 8.48991C11.125 8.10796 10.6736 7.94477 10.1458 8.00033L8.85417 6.70866C9.03472 6.63921 9.22222 6.58713 9.41667 6.55241C9.61111 6.51769 9.80556 6.50033 10 6.50033C10.9722 6.50033 11.7986 6.8406 12.4792 7.52116C13.1597 8.20171 13.5 9.0281 13.5 10.0003C13.5 10.1948 13.4826 10.3892 13.4479 10.5837C13.4132 10.7781 13.3542 10.9656 13.2708 11.1462ZM16.0417 13.917L14.9583 12.8337C15.4583 12.4448 15.9132 12.0177 16.3229 11.5524C16.7326 11.0871 17.0764 10.5698 17.3542 10.0003C16.6736 8.59755 15.6701 7.49685 14.3438 6.69824C13.0174 5.89963 11.5694 5.50033 10 5.50033C9.63889 5.50033 9.28472 5.52116 8.9375 5.56283C8.59028 5.60449 8.25 5.67394 7.91667 5.77116L6.70833 4.56283C7.23611 4.35449 7.77431 4.20866 8.32292 4.12533C8.87153 4.04199 9.43056 4.00033 10 4.00033C11.9861 4.00033 13.8021 4.53852 15.4479 5.61491C17.0938 6.6913 18.2778 8.1531 19 10.0003C18.6944 10.792 18.2882 11.5107 17.7812 12.1566C17.2743 12.8024 16.6944 13.3892 16.0417 13.917ZM16 18.1253L13.2917 15.417C12.7639 15.6114 12.2257 15.7573 11.6771 15.8545C11.1285 15.9517 10.5694 16.0003 10 16.0003C8.01389 16.0003 6.19792 15.4621 4.55208 14.3857C2.90625 13.3094 1.72222 11.8475 1 10.0003C1.30556 9.20866 1.70833 8.48644 2.20833 7.83366C2.70833 7.18088 3.29167 6.5906 3.95833 6.06283L1.875 3.97949L2.9375 2.91699L17.0625 17.0628L16 18.1253ZM5.02083 7.14616C4.53472 7.53505 4.08333 7.96213 3.66667 8.42741C3.25 8.89269 2.90972 9.41699 2.64583 10.0003C3.32639 11.4031 4.32986 12.5038 5.65625 13.3024C6.98264 14.101 8.43056 14.5003 10 14.5003C10.3611 14.5003 10.7153 14.476 11.0625 14.4274C11.4097 14.3788 11.7569 14.3128 12.1042 14.2295L11.1667 13.292C10.9722 13.3614 10.7778 13.4135 10.5833 13.4482C10.3889 13.483 10.1944 13.5003 10 13.5003C9.02778 13.5003 8.20139 13.16 7.52083 12.4795C6.84028 11.7989 6.5 10.9725 6.5 10.0003C6.5 9.80588 6.52431 9.61144 6.57292 9.41699C6.62153 9.22255 6.66667 9.0281 6.70833 8.83366L5.02083 7.14616Z",fill:"#6F7C90"}))),TW=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"#97A3B7",...e},_.createElement("path",{d:"M11.06 6.02L11.98 6.94L2.92 16H2V15.08L11.06 6.02ZM14.66 0C14.41 0 14.15 0.1 13.96 0.29L12.13 2.12L15.88 5.87L17.71 4.04C18.1 3.65 18.1 3.02 17.71 2.63L15.37 0.29C15.17 0.09 14.92 0 14.66 0ZM11.06 3.19L0 14.25V18H3.75L14.81 6.94L11.06 3.19Z",fill:"currentColor"})),SW=async({cardId:e,formType:t})=>{const n=new URLSearchParams;n.append("form_type",t);const r=await Me({url:cr(`${bV}?${n.toString()}`,{cardId:e}),method:Gt.GET});return(r==null?void 0:r.data).formsList.find(s=>s.type===t)},_W=({cardId:e,formType:t,enabled:n})=>go({queryKey:["fetchFormData",e,t],queryFn:()=>SW({cardId:e,formType:t}),enabled:!!e&&!!t&&n}),B1=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Me({url:cr(`${yV}?${r.toString()}`,e),method:Gt.POST,data:t})},DW=async({formId:e})=>{try{const t=await Me({url:cr(zm,{formId:e}),method:Gt.GET}),n=t==null?void 0:t.data;return n.enabled?$Q(n.defaults):{}}catch(t){throw console.error(t),t}},p1=({formId:e})=>["Global","WriteForm","FormDefaults",e],OW=({formId:e,enabled:t})=>{const n=m.useRef(!0),r=go({queryKey:p1({formId:e}),queryFn:async()=>{const o=await DW({formId:e});return n.current=!1,o},refetchOnMount:!0,enabled:n.current&&!!e&&t,staleTime:0});return{enabledRef:n,...r}},LW=async({formId:e,data:t})=>{try{return await Me({url:cr(zm,{formId:e}),data:{defaults:t},method:Gt.PUT}),{formId:e,data:t}}catch(n){throw console.error(n),n}},FW=({formId:e,onSuccess:t,onError:n})=>{const r=Do();return ZA({mutationFn:o=>LW({formId:e,data:o}),onSuccess:o=>{r.invalidateQueries({queryKey:p1({formId:e})}),Vn({message:"Form defaults updated successfully",type:es}),t==null||t(o)},onError:()=>{n==null||n(),Vn({message:"Failed to update form defaults",type:Co})}})},NW=({open:e,formId:t,fields:n,connectorLogo:r,variables:o,customFormArgsEnabled:A,customFormArgsMap:s,title:a="Pre-fill fields",isLoading:i=!1,onSuccess:l,onClose:u})=>{const[d,f]=m.useState({}),{data:p}=ZQ({formId:t,formData:d,argsMap:s??{},enabled:A,delay:500}),{data:I,enabledRef:C,isLoading:E}=OW({formId:t,enabled:!!e&&!!t}),{mutate:h,isPending:B}=FW({formId:t,onSuccess:x=>{l==null||l(x),C.current=!0}}),Q=m.useMemo(()=>p!=null&&p.length?[...n,...p]:n,[n,p]);m.useEffect(()=>{I&&f(I)},[I]);const y=x=>{const T=KQ(x,Q??[]);h(T)},b=async({args:x,pagination:T},{formId:V,fieldName:D})=>{const N=await B1({formId:V,fieldName:D},{pagination:T,args:x}),H=Array.isArray(N==null?void 0:N.data.data)?N.data.data:[];return{options:H,hasMore:!!H.length}},v=()=>{u==null||u(),C.current=!0},w=x=>{const T=fC(x.value)?x.value.value:x.value,V=T&&x.type==="multi-select"?[T]:T;f(D=>({...D,[x.name]:V}))};return c.jsx(Im,{open:e,defaultValues:I,formId:t,fields:Q,connectorLogo:r,variables:o,title:a,isLoading:i||E,isSaving:B,fetchOptions:b,onSave:y,onClose:v,onCancel:v,onFieldChange:w})},RW=g.styled(g.Stack)`
2952
2952
  flex-direction: row;
2953
2953
  white-space: nowrap;
2954
2954
  align-items: center;
@@ -4374,4 +4374,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
4374
4374
  align-self: auto !important;
4375
4375
  margin-left: 12px;
4376
4376
  }
4377
- `,sX=({basename:e,baseUrls:t,extraParams:n={},availableFeatures:r={},connectorFunctions:o,nativeIntegrations:A=[],suggestedAppsMap:s={}})=>{const{userId:a}=yr()||{};return c.jsx("div",{className:"connectorsAdmin-v2",children:c.jsx(IG,{baseUrls:t,availableFeatures:r,extraParams:n,connectorFunctions:o,nativeIntegrations:A,suggestedAppsMap:s,children:Uj(r)?c.jsx(rX,{availableFeatures:r}):c.jsxs(c.Fragment,{children:[c.jsx(HJ,{basename:e,metaData:n.metaData,userId:a}),ot.createPortal(c.jsx(AX,{id:"toast-message",children:c.jsx(yE,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})})})},aX=e=>e.isUnifiedView?c.jsx(sX,{...e}):c.jsx(hj,{...e}),iX=async({formId:e})=>{const t=await Me({url:cr(xV,{formId:e}),method:Gt.GET}),n=t==null?void 0:t.data;if(!n.fieldList.length)throw new Error("Form has no fields");return n},lX=({formId:e,enabled:t})=>go({queryKey:["fetchFormById",e],queryFn:()=>iX({formId:e}),enabled:!!e&&t}),cX=async({entityId:e})=>{try{const t=new URLSearchParams;t.append("entity_type","step_automation");const n=cr(Wm,{entityId:e})+"?"+t.toString(),r=await Me({url:n,method:Gt.GET}),o=r==null?void 0:r.data;return o.enabled?$Q(o.defaults):{}}catch(t){throw console.error(t),t}},n2=({entityId:e})=>["Global","ConnectorLibrary","FormDefaultsById",e],uX=({entityId:e,enabled:t})=>{const n=m.useRef(!0),r=go({queryKey:n2({entityId:e}),queryFn:async()=>{const o=await cX({entityId:e});return n.current=!1,o},refetchOnMount:!0,enabled:n.current&&!!e&&t,staleTime:0});return{enabledRef:n,...r}},gX=async({formId:e,entityId:t,data:n})=>{try{let r;t?r=cr(Wm,{entityId:t}):(console.log("formID",e),r=vV);const o=new URLSearchParams;o.append("entity_type","step_automation"),r+="?"+o.toString();const A=await Me({url:r,data:{defaults:n},method:t?Gt.PUT:Gt.POST}),s=A==null?void 0:A.data;if(!s.entityId)throw console.error("Entity ID not present in the response",s),new Error("Entity ID not present in the response");return s}catch(r){throw console.error(r),r}},dX=({formId:e,entityId:t,onSuccess:n,onError:r})=>{const o=Do();return ZA({mutationFn:A=>gX({formId:e,entityId:t,data:A}),onSuccess:A=>{t&&o.invalidateQueries({queryKey:n2({entityId:t})}),Vn({message:"Form defaults updated successfully",type:es}),n==null||n(A)},onError:()=>{r==null||r(),Vn({message:"Failed to update form defaults",type:Co})}})},CX=({open:e,formId:t,entityId:n,variables:r,customFields:o,onSuccess:A,onClose:s})=>{const[a,i]=m.useState({}),{data:l,isLoading:u,isError:d}=lX({formId:t,enabled:e&&!!t}),{fieldList:f=[],logoUrl:p,name:I,customFieldsArgs:C,hasCustomFields:E}=l??{},{data:h}=ZQ({formId:t,formData:a,argsMap:C??{},enabled:E||!1,delay:500}),{data:B,enabledRef:Q,isLoading:y}=uX({entityId:n,enabled:!!e&&!!n}),{mutate:b,isPending:v}=dX({formId:t,entityId:n,onSuccess:N=>{A==null||A({...N,entityName:`Default values for ${(l==null?void 0:l.name)||"this form"}`}),Q.current=!0}}),w=m.useMemo(()=>h!=null&&h.length?[...f,...h]:f,[f,h]);m.useEffect(()=>{i(B)},[B]),m.useEffect(()=>{d&&(s==null||s())},[d,s]);const x=N=>{const H=KQ(N,f??[]);b(H)},T=async({args:N,pagination:H},{formId:L,fieldName:q})=>{const ne=await B1({formId:L,fieldName:q},{pagination:H,args:N}),le=Array.isArray(ne==null?void 0:ne.data.data)?ne.data.data:[];return{options:le,hasMore:!!le.length}},V=()=>{s==null||s(),Q.current=!0},D=N=>{const H=fC(N.value)?N.value.value:N.value,L=H&&N.type==="multi-select"?[H]:H;i(q=>({...q,[N.name]:L}))};return c.jsx(Im,{open:e,defaultValues:B,formId:t,fields:w,connectorLogo:p,variables:r,customFields:o,title:I,isLoading:u||y,isSaving:v,checkMandatory:!0,fetchOptions:T,onSave:x,onClose:V,onCancel:V,onFieldChange:D})},EX=({children:e})=>c.jsx(g.HiverProvider,{inter:!0,children:c.jsx(m.Suspense,{fallback:c.jsx(c.Fragment,{}),children:c.jsx(eB,{children:e})})}),fX=e=>c.jsx(EX,{children:c.jsx(CX,{...e})});ze.AutomationMapDefaults=fX,ze.ConnectorsApp=aX,ze.HiverConnectorBifrostAuth=Me,ze.getConnectorDynamicFieldOptions=Ck,ze.getConnectorFieldDropdownOptions=gk,ze.getConnectorStaticFieldOptions=dk,ze.getConnectorsBifrostConfigs=yr,ze.getEnabledAuthenticatedConnectors=ck,ze.getMetaData=ik,ze.initConnectorsBifrost=ow,Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"})});
4377
+ `,sX=({basename:e,baseUrls:t,extraParams:n={},availableFeatures:r={},connectorFunctions:o,nativeIntegrations:A=[],suggestedAppsMap:s={}})=>{const{userId:a}=yr()||{};return c.jsx("div",{className:"connectorsAdmin-v2",children:c.jsx(IG,{baseUrls:t,availableFeatures:r,extraParams:n,connectorFunctions:o,nativeIntegrations:A,suggestedAppsMap:s,children:Uj(r)?c.jsx(rX,{availableFeatures:r}):c.jsxs(c.Fragment,{children:[c.jsx(HJ,{basename:e,metaData:n.metaData,userId:a}),ot.createPortal(c.jsx(AX,{id:"toast-message",children:c.jsx(yE,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})})})},aX=e=>e.isUnifiedView?c.jsx(sX,{...e}):c.jsx(hj,{...e}),iX=async({formId:e})=>{const t=await Me({url:cr(xV,{formId:e}),method:Gt.GET}),n=t==null?void 0:t.data;if(!n.fieldList.length)throw new Error("Form has no fields");return n},lX=({formId:e,enabled:t})=>go({queryKey:["fetchFormById",e],queryFn:()=>iX({formId:e}),enabled:!!e&&t}),cX=async({entityId:e})=>{try{const t=new URLSearchParams;t.append("entity_type","step_automation");const n=cr(Wm,{entityId:e})+"?"+t.toString(),r=await Me({url:n,method:Gt.GET}),o=r==null?void 0:r.data;return o.enabled?$Q(o.defaults):{}}catch(t){throw console.error(t),t}},n2=({entityId:e})=>["Global","ConnectorLibrary","FormDefaultsById",e],uX=({entityId:e,enabled:t})=>{const n=m.useRef(!0),r=go({queryKey:n2({entityId:e}),queryFn:async()=>{const o=await cX({entityId:e});return n.current=!1,o},refetchOnMount:!0,enabled:n.current&&!!e&&t,staleTime:0});return{enabledRef:n,...r}},gX=async({formId:e,entityId:t,data:n})=>{try{let r;t?r=cr(Wm,{entityId:t}):(console.log("formID",e),r=vV);const o=new URLSearchParams;o.append("entity_type","step_automation"),r+="?"+o.toString();const A=await Me({url:r,data:{defaults:n},method:t?Gt.PUT:Gt.POST}),s=A==null?void 0:A.data;if(!t&&!s.entityId)throw console.error("Entity ID not present in the response",s),new Error("Entity ID not present in the response");return s}catch(r){throw console.error(r),r}},dX=({formId:e,entityId:t,onSuccess:n,onError:r})=>{const o=Do();return ZA({mutationFn:A=>gX({formId:e,entityId:t,data:A}),onSuccess:A=>{t&&o.invalidateQueries({queryKey:n2({entityId:t})}),Vn({message:"Form defaults updated successfully",type:es}),n==null||n(A)},onError:()=>{r==null||r(),Vn({message:"Failed to update form defaults",type:Co})}})},CX=({open:e,formId:t,entityId:n,variables:r,customFields:o,onSuccess:A,onClose:s})=>{const[a,i]=m.useState({}),{data:l,isLoading:u,isError:d}=lX({formId:t,enabled:e&&!!t}),{fieldList:f=[],logoUrl:p,name:I,customFieldsArgs:C,hasCustomFields:E}=l??{},{data:h}=ZQ({formId:t,formData:a,argsMap:C??{},enabled:E||!1,delay:500}),{data:B,enabledRef:Q,isLoading:y}=uX({entityId:n,enabled:!!e&&!!n}),{mutate:b,isPending:v}=dX({formId:t,entityId:n,onSuccess:N=>{A==null||A({...N,entityName:`Default values for ${(l==null?void 0:l.name)||"this form"}`}),Q.current=!0}}),w=m.useMemo(()=>h!=null&&h.length?[...f,...h]:f,[f,h]);m.useEffect(()=>{i(B)},[B]),m.useEffect(()=>{d&&(s==null||s())},[d,s]);const x=N=>{const H=KQ(N,f??[]);b(H)},T=async({args:N,pagination:H},{formId:L,fieldName:q})=>{const ne=await B1({formId:L,fieldName:q},{pagination:H,args:N}),le=Array.isArray(ne==null?void 0:ne.data.data)?ne.data.data:[];return{options:le,hasMore:!!le.length}},V=()=>{s==null||s(),Q.current=!0},D=N=>{const H=fC(N.value)?N.value.value:N.value,L=H&&N.type==="multi-select"?[H]:H;i(q=>({...q,[N.name]:L}))};return c.jsx(Im,{open:e,defaultValues:B,formId:t,fields:w,connectorLogo:p,variables:r,customFields:o,title:I,isLoading:u||y,isSaving:v,checkMandatory:!0,fetchOptions:T,onSave:x,onClose:V,onCancel:V,onFieldChange:D})},EX=({children:e})=>c.jsx(g.HiverProvider,{inter:!0,children:c.jsx(m.Suspense,{fallback:c.jsx(c.Fragment,{}),children:c.jsx(eB,{children:e})})}),fX=e=>c.jsx(EX,{children:c.jsx(CX,{...e})});ze.AutomationMapDefaults=fX,ze.ConnectorsApp=aX,ze.HiverConnectorBifrostAuth=Me,ze.getConnectorDynamicFieldOptions=Ck,ze.getConnectorFieldDropdownOptions=gk,ze.getConnectorStaticFieldOptions=dk,ze.getConnectorsBifrostConfigs=yr,ze.getEnabledAuthenticatedConnectors=ck,ze.getMetaData=ik,ze.initConnectorsBifrost=ow,Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-admin",
3
- "version": "4.11.0-oneClickAuto-beta.7",
3
+ "version": "4.11.0-oneClickAuto-beta.9",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",
@@ -38,5 +38,5 @@ export declare const CUSTOMER_IDENTITY_MAPPING_CANCEL = "Cancel";
38
38
  export declare const CUSTOMER_IDENTITY_MAPPING_MATCHES = "Matches with %s's";
39
39
  export declare const LOOKUP_SAVE_SUCCESS = "Customer identity mapping saved";
40
40
  export declare const LOOKUP_SAVE_FAIL = "Failed to save. Please try again.";
41
- export declare const FIELD_MAP_BUTTON_LABEL = "Map fields";
41
+ export declare const FIELD_MAP_BUTTON_LABEL = "Pre-fill fields";
42
42
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/connector-library/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,EAAE,MAA6B,CAAC;AAC9D,eAAO,MAAM,uBAAuB,EAAE,MAAwC,CAAC;AAC/E,eAAO,MAAM,+BAA+B,EAAE,MACwC,CAAC;AACvF,eAAO,MAAM,6BAA6B,EAAE,MAA2B,CAAC;AACxE,eAAO,MAAM,qCAAqC,EAAE,MACoE,CAAC;AACzH,eAAO,MAAM,sBAAsB,EAAE,MAAqD,CAAC;AAC3F,eAAO,MAAM,uBAAuB,EAAE,MAAsC,CAAC;AAC7E,eAAO,MAAM,wBAAwB,EAAE,MAA2B,CAAC;AACnE,eAAO,MAAM,kBAAkB,EAAE,MAA+B,CAAC;AACjE,eAAO,MAAM,kBAAkB,EAAE,MAA0B,CAAC;AAC5D,eAAO,MAAM,uBAAuB,EAAE,MAAsB,CAAC;AAC7D,eAAO,MAAM,UAAU,EAAE,MAAgB,CAAC;AAC1C,eAAO,MAAM,UAAU,EAAE,MAAgB,CAAC;AAC1C,eAAO,MAAM,gBAAgB,EAAE,MAAqB,CAAC;AACrD,eAAO,MAAM,KAAK,EAAE,MAAgB,CAAC;AACrC,eAAO,MAAM,2BAA2B,EAAE,MAAsE,CAAC;AACjH,eAAO,MAAM,0BAA0B,EAAE,MAAyB,CAAC;AACnE,eAAO,MAAM,wBAAwB,EAAE,MAAoC,CAAC;AAC5E,eAAO,MAAM,6BAA6B,EAAE,MAA0C,CAAC;AACvF,eAAO,MAAM,qBAAqB,EAAE,MAAiE,CAAC;AACtG,eAAO,MAAM,mBAAmB,EAAE,MAAgF,CAAC;AACnH,eAAO,MAAM,qBAAqB,EAAE,MAAmC,CAAC;AACxE,eAAO,MAAM,eAAe,EAAE,MAAe,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAE,MAAkB,CAAC;AAChD,eAAO,MAAM,eAAe,EAAE,MAAmB,CAAC;AAClD,eAAO,MAAM,mBAAmB,EAAE,MAA2C,CAAC;AAC9E,eAAO,MAAM,QAAQ,EAAE,MAAc,CAAC;AACtC,eAAO,MAAM,WAAW,EAAE,MAAsB,CAAC;AACjD,eAAO,MAAM,qBAAqB,EAAE,MAAgC,CAAC;AACrE,eAAO,MAAM,eAAe,EAAE,MAA6E,CAAC;AAC5G,eAAO,MAAM,gBAAgB,EAAE,MAAoC,CAAC;AACpE,eAAO,MAAM,mBAAmB,EAAE,MAC2D,CAAC;AAE9F,eAAO,MAAM,+BAA+B,8BAA8B,CAAC;AAC3E,eAAO,MAAM,kCAAkC,uFACuC,CAAC;AACvF,eAAO,MAAM,8BAA8B,SAAS,CAAC;AACrD,eAAO,MAAM,8BAA8B,SAAS,CAAC;AACrD,eAAO,MAAM,gCAAgC,WAAW,CAAC;AACzD,eAAO,MAAM,iCAAiC,sBAAsB,CAAC;AACrE,eAAO,MAAM,mBAAmB,oCAAoC,CAAC;AACrE,eAAO,MAAM,gBAAgB,sCAAsC,CAAC;AACpE,eAAO,MAAM,sBAAsB,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/connector-library/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,EAAE,MAA6B,CAAC;AAC9D,eAAO,MAAM,uBAAuB,EAAE,MAAwC,CAAC;AAC/E,eAAO,MAAM,+BAA+B,EAAE,MACwC,CAAC;AACvF,eAAO,MAAM,6BAA6B,EAAE,MAA2B,CAAC;AACxE,eAAO,MAAM,qCAAqC,EAAE,MACoE,CAAC;AACzH,eAAO,MAAM,sBAAsB,EAAE,MAAqD,CAAC;AAC3F,eAAO,MAAM,uBAAuB,EAAE,MAAsC,CAAC;AAC7E,eAAO,MAAM,wBAAwB,EAAE,MAA2B,CAAC;AACnE,eAAO,MAAM,kBAAkB,EAAE,MAA+B,CAAC;AACjE,eAAO,MAAM,kBAAkB,EAAE,MAA0B,CAAC;AAC5D,eAAO,MAAM,uBAAuB,EAAE,MAAsB,CAAC;AAC7D,eAAO,MAAM,UAAU,EAAE,MAAgB,CAAC;AAC1C,eAAO,MAAM,UAAU,EAAE,MAAgB,CAAC;AAC1C,eAAO,MAAM,gBAAgB,EAAE,MAAqB,CAAC;AACrD,eAAO,MAAM,KAAK,EAAE,MAAgB,CAAC;AACrC,eAAO,MAAM,2BAA2B,EAAE,MAAsE,CAAC;AACjH,eAAO,MAAM,0BAA0B,EAAE,MAAyB,CAAC;AACnE,eAAO,MAAM,wBAAwB,EAAE,MAAoC,CAAC;AAC5E,eAAO,MAAM,6BAA6B,EAAE,MAA0C,CAAC;AACvF,eAAO,MAAM,qBAAqB,EAAE,MAAiE,CAAC;AACtG,eAAO,MAAM,mBAAmB,EAAE,MAAgF,CAAC;AACnH,eAAO,MAAM,qBAAqB,EAAE,MAAmC,CAAC;AACxE,eAAO,MAAM,eAAe,EAAE,MAAe,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAE,MAAkB,CAAC;AAChD,eAAO,MAAM,eAAe,EAAE,MAAmB,CAAC;AAClD,eAAO,MAAM,mBAAmB,EAAE,MAA2C,CAAC;AAC9E,eAAO,MAAM,QAAQ,EAAE,MAAc,CAAC;AACtC,eAAO,MAAM,WAAW,EAAE,MAAsB,CAAC;AACjD,eAAO,MAAM,qBAAqB,EAAE,MAAgC,CAAC;AACrE,eAAO,MAAM,eAAe,EAAE,MAA6E,CAAC;AAC5G,eAAO,MAAM,gBAAgB,EAAE,MAAoC,CAAC;AACpE,eAAO,MAAM,mBAAmB,EAAE,MAC2D,CAAC;AAE9F,eAAO,MAAM,+BAA+B,8BAA8B,CAAC;AAC3E,eAAO,MAAM,kCAAkC,uFACuC,CAAC;AACvF,eAAO,MAAM,8BAA8B,SAAS,CAAC;AACrD,eAAO,MAAM,8BAA8B,SAAS,CAAC;AACrD,eAAO,MAAM,gCAAgC,WAAW,CAAC;AACzD,eAAO,MAAM,iCAAiC,sBAAsB,CAAC;AACrE,eAAO,MAAM,mBAAmB,oCAAoC,CAAC;AACrE,eAAO,MAAM,gBAAgB,sCAAsC,CAAC;AACpE,eAAO,MAAM,sBAAsB,oBAAoB,CAAC"}