import { jsxs as r, Fragment as E, jsx as e } from "react/jsx-runtime";
import { q as ae, X as h, Y as $, Z as q, p, I as b, S as f, r as F, _ as D, s as te, t as ce, $ as m, W as se, L as Z, a0 as re, x as de } from "./index-ZQlxzdt5.js";
import { useState as g } from "react";
import { S as c, A as ue } from "./AppCard-cTGNOAHy.js";
import { u as he } from "./useIsAppEnabled-V8Jl9FX-.js";
var J = /* @__PURE__ */ ((x) => (x.ON_BOOKING = "on_booking", x.ON_CANCEL = "on_cancel", x))(J || {});
const le = ({
  bookingAction: x,
  optionLabel: L,
  optionEnabled: W,
  optionSwitchOnChange: K,
  writeToObjectData: o,
  updateWriteToObjectData: s
}) => {
  const { t: d } = ae(), O = [
    { label: d("text"), value: h.TEXT },
    { label: d("date"), value: h.DATE },
    { label: d("phone").charAt(0).toUpperCase() + d("phone").slice(1), value: h.PHONE },
    { label: d("checkbox"), value: h.CHECKBOX },
    { label: d("picklist"), value: h.PICKLIST },
    { label: d("custom"), value: h.CUSTOM }
  ], T = [
    { label: d("only_if_field_is_empty"), value: $.FIELD_EMPTY },
    ...x === "on_cancel" ? [{ label: d("salesforce_on_every_cancellation"), value: $.EVERY_BOOKING }] : [{ label: d("on_every_booking"), value: $.EVERY_BOOKING }]
  ], C = [
    { label: d("true"), value: !0 },
    { label: d("false"), value: !1 }
  ], k = [
    ...x === "on_cancel" ? [{ label: d("booking_cancel_date"), value: q.BOOKING_CANCEL_DATE }] : [],
    { label: d("booking_start_date"), value: q.BOOKING_START_DATE },
    { label: d("booking_created_date"), value: q.BOOKING_CREATED_DATE }
  ], [I, U] = g(O[0]), [y, G] = g(k[0]), [z, H] = g(
    C[0]
  ), [_, X] = g(T[0]), [A, j] = g({}), [R, S] = g(
    {}
  ), [u, N] = g({
    field: "",
    fieldType: I.value,
    value: "",
    whenToWrite: _.value
  }), M = (n) => {
    Object.keys(A).forEach((a) => {
      A[a] && a !== n && B(a);
    }), j((a) => ({ ...a, [n]: !0 })), S((a) => ({
      ...a,
      [n]: {
        field: n,
        fieldType: o[n].fieldType,
        value: o[n].value,
        whenToWrite: o[n].whenToWrite
      }
    }));
  }, B = (n) => {
    j((a) => ({ ...a, [n]: !1 })), S((a) => {
      const t = { ...a };
      return delete t[n], t;
    });
  }, P = (n) => {
    const a = R[n];
    if (!a)
      return;
    if (!a.field.trim()) {
      D("Field name cannot be empty", "error");
      return;
    }
    if (a.field !== n && Object.keys(o).includes(a.field.trim())) {
      D("Field already exists", "error");
      return;
    }
    const t = { ...o };
    a.field !== n && delete t[n], t[a.field.trim()] = {
      fieldType: a.fieldType,
      value: a.value,
      whenToWrite: a.whenToWrite
    }, s(t), B(n);
  };
  return /* @__PURE__ */ r(E, { children: [
    /* @__PURE__ */ e(c.SubSectionHeader, { icon: "star", labelFor: "write-to-object-settings", title: L, children: /* @__PURE__ */ e(
      p,
      {
        checked: W,
        onCheckedChange: K,
        id: "write-to-object-settings",
        size: "sm"
      }
    ) }),
    W ? /* @__PURE__ */ r(c.SubSectionContent, { children: [
      /* @__PURE__ */ r("div", { className: "text-subtle flex gap-3 px-3 py-[6px] text-sm font-medium", children: [
        /* @__PURE__ */ e("div", { className: "flex-1", children: d("field_name") }),
        /* @__PURE__ */ e("div", { className: "flex-1", children: d("field_type") }),
        /* @__PURE__ */ e("div", { className: "flex-1", children: d("value") }),
        /* @__PURE__ */ e("div", { className: "flex-1", children: d("when_to_write") }),
        /* @__PURE__ */ e("div", { className: "w-20" })
      ] }),
      /* @__PURE__ */ r(c.SubSectionNested, { children: [
        Object.keys(o).map((n) => {
          const a = A[n], t = R[n];
          return /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
            /* @__PURE__ */ e("div", { className: "flex-1", children: a ? /* @__PURE__ */ e(
              b,
              {
                value: (t == null ? void 0 : t.field) || n,
                onChange: (i) => S((v) => ({
                  ...v,
                  [n]: { ...t, field: i.target.value }
                })),
                size: "sm",
                className: "w-full"
              }
            ) : /* @__PURE__ */ e(b, { value: n, readOnly: !0, size: "sm", className: "w-full" }) }),
            /* @__PURE__ */ e("div", { className: "flex-1", children: a ? /* @__PURE__ */ e(
              f,
              {
                size: "sm",
                className: "w-full",
                options: O,
                value: O.find((i) => i.value === (t == null ? void 0 : t.fieldType)),
                onChange: (i) => {
                  i && S((v) => ({
                    ...v,
                    [n]: {
                      ...t,
                      fieldType: i.value,
                      ...i.value === h.DATE && {
                        value: k[0].value
                      },
                      ...i.value === h.CHECKBOX && {
                        value: C[0].value
                      }
                    }
                  }));
                }
              }
            ) : /* @__PURE__ */ e(
              f,
              {
                size: "sm",
                className: "w-full",
                value: O.find(
                  (i) => i.value === o[n].fieldType
                ),
                isDisabled: !0
              }
            ) }),
            /* @__PURE__ */ e("div", { className: "flex-1", children: a ? (t == null ? void 0 : t.fieldType) === h.DATE ? /* @__PURE__ */ e(
              f,
              {
                size: "sm",
                className: "w-full",
                options: k,
                value: k.find((i) => i.value === t.value),
                onChange: (i) => {
                  i && S((v) => ({
                    ...v,
                    [n]: { ...t, value: i.value }
                  }));
                }
              }
            ) : (t == null ? void 0 : t.fieldType) === h.CHECKBOX ? /* @__PURE__ */ e(
              f,
              {
                size: "sm",
                className: "w-full",
                options: C,
                value: C.find((i) => i.value === t.value),
                onChange: (i) => {
                  i && S((v) => ({
                    ...v,
                    [n]: { ...t, value: i.value }
                  }));
                }
              }
            ) : /* @__PURE__ */ e(
              b,
              {
                value: (t == null ? void 0 : t.value) || "",
                onChange: (i) => S((v) => ({
                  ...v,
                  [n]: { ...t, value: i.target.value }
                })),
                size: "sm",
                className: "w-full"
              }
            ) : o[n].fieldType === h.DATE ? /* @__PURE__ */ e(
              f,
              {
                size: "sm",
                className: "w-full",
                value: k.find(
                  (i) => i.value === o[n].value
                ),
                isDisabled: !0
              }
            ) : o[n].fieldType === h.CHECKBOX ? /* @__PURE__ */ e(
              f,
              {
                size: "sm",
                className: "w-full",
                value: C.find(
                  (i) => i.value === o[n].value
                ),
                isDisabled: !0
              }
            ) : /* @__PURE__ */ e(
              b,
              {
                value: o[n].value,
                readOnly: !0,
                size: "sm",
                className: "w-full"
              }
            ) }),
            /* @__PURE__ */ e("div", { className: "flex-1", children: a ? /* @__PURE__ */ e(
              f,
              {
                size: "sm",
                className: "w-full",
                options: T,
                value: T.find(
                  (i) => i.value === (t == null ? void 0 : t.whenToWrite)
                ),
                onChange: (i) => {
                  i && S((v) => ({
                    ...v,
                    [n]: { ...t, whenToWrite: i.value }
                  }));
                }
              }
            ) : /* @__PURE__ */ e(
              f,
              {
                size: "sm",
                className: "w-full",
                value: T.find(
                  (i) => i.value === o[n].whenToWrite
                ),
                isDisabled: !0
              }
            ) }),
            /* @__PURE__ */ e("div", { className: "flex w-20 justify-center gap-1", children: a ? /* @__PURE__ */ r(E, { children: [
              /* @__PURE__ */ e(
                F,
                {
                  size: "sm",
                  StartIcon: "check",
                  variant: "icon",
                  color: "primary",
                  onClick: () => P(n)
                }
              ),
              /* @__PURE__ */ e(
                F,
                {
                  size: "sm",
                  StartIcon: "x",
                  variant: "icon",
                  color: "secondary",
                  onClick: () => B(n)
                }
              )
            ] }) : /* @__PURE__ */ r(E, { children: [
              /* @__PURE__ */ e(
                F,
                {
                  size: "sm",
                  StartIcon: "pencil",
                  variant: "icon",
                  color: "minimal",
                  onClick: () => M(n)
                }
              ),
              /* @__PURE__ */ e(
                F,
                {
                  size: "sm",
                  StartIcon: "x",
                  variant: "icon",
                  color: "minimal",
                  onClick: () => {
                    const i = { ...o };
                    delete i[n], s(i);
                  }
                }
              )
            ] }) })
          ] }, n);
        }),
        /* @__PURE__ */ r("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
            b,
            {
              size: "sm",
              className: "w-full",
              value: u.field,
              onChange: (n) => N({
                ...u,
                field: n.target.value
              })
            }
          ) }),
          /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
            f,
            {
              size: "sm",
              className: "w-full",
              options: O,
              value: I,
              onChange: (n) => {
                n && (U(n), N({
                  ...u,
                  fieldType: n.value,
                  ...n.value === h.DATE && { value: y.value },
                  ...n.value === h.CHECKBOX && {
                    value: z.value
                  }
                }));
              }
            }
          ) }),
          /* @__PURE__ */ e("div", { className: "flex-1", children: u.fieldType === h.DATE ? /* @__PURE__ */ e(
            f,
            {
              size: "sm",
              className: "w-full",
              options: k,
              value: y,
              onChange: (n) => {
                n && (G(n), N({
                  ...u,
                  value: n.value
                }));
              }
            }
          ) : u.fieldType === h.CHECKBOX ? /* @__PURE__ */ e(
            f,
            {
              size: "sm",
              className: "w-full",
              options: C,
              value: z,
              onChange: (n) => {
                n && (H(n), N({
                  ...u,
                  value: n.value
                }));
              }
            }
          ) : /* @__PURE__ */ e(
            b,
            {
              size: "sm",
              className: "w-full",
              value: u.value,
              onChange: (n) => N({
                ...u,
                value: n.target.value
              })
            }
          ) }),
          /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
            f,
            {
              size: "sm",
              className: "w-full",
              options: T,
              value: _,
              onChange: (n) => {
                n && (X(n), N({
                  ...u,
                  whenToWrite: n.value
                }));
              }
            }
          ) }),
          /* @__PURE__ */ e("div", { className: "w-20" })
        ] })
      ] }),
      /* @__PURE__ */ e(
        F,
        {
          className: "text-subtle mt-2 w-fit",
          StartIcon: "plus",
          color: "minimal",
          size: "sm",
          disabled: !(u.field && u.fieldType && u.value !== "" && u.whenToWrite),
          onClick: () => {
            if (Object.keys(o).includes(u.field.trim())) {
              D("Field already exists", "error");
              return;
            }
            s({
              ...o,
              [u.field.trim()]: {
                fieldType: u.fieldType,
                value: u.value,
                whenToWrite: u.whenToWrite
              }
            }), N({
              field: "",
              fieldType: O[0].value,
              value: "",
              whenToWrite: T[0].value
            });
          },
          children: d("add_new_field")
        }
      )
    ] }) : null
  ] });
}, Ce = function({ app: L, eventType: W }) {
  var ne;
  const K = te.usePathname(), { getAppData: o, setAppData: s, disabled: d } = ce(), { enabled: O, updateEnabled: T } = he(L), C = o("roundRobinLeadSkip"), k = o("roundRobinSkipCheckRecordOn") ?? m.CONTACT, I = o("ifFreeEmailDomainSkipOwnerCheck") ?? !1, U = o("skipContactCreation"), y = o("createLeadIfAccountNull"), G = o("createNewContactUnderAccount"), z = o("createEventOn") ?? m.CONTACT, H = o("onBookingWriteToEventObject") ?? !1, _ = o("onBookingWriteToEventObjectMap") ?? {}, X = o("createEventOnLeadCheckForContact") ?? !1, A = o("onBookingChangeRecordOwner") ?? !1, j = o("onBookingChangeRecordOwnerName") ?? [], R = o("sendNoShowAttendeeData") ?? !1, S = o("sendNoShowAttendeeDataField") ?? "", u = o("onBookingWriteToRecord") ?? !1, N = o("onBookingWriteToRecordFields") ?? {}, M = o("ignoreGuests") ?? !1, B = o("roundRobinSkipFallbackToLeadOwner") ?? !1, P = o("onCancelWriteToEventRecord") ?? !1, n = o("onCancelWriteToEventRecordFields") ?? {}, { t: a } = ae(), t = [
    { label: a("contact"), value: m.CONTACT },
    { label: a("salesforce_lead"), value: m.LEAD },
    { label: a("salesforce_contact_under_account"), value: m.ACCOUNT }
  ], [i, v] = g(
    t.find((l) => l.value === z) ?? t[0]
  ), V = [
    { label: a("contact"), value: m.CONTACT },
    { label: a("salesforce_lead"), value: m.LEAD },
    { label: a("account"), value: m.ACCOUNT }
  ], [Q, ie] = g(
    V.find((l) => l.value === k) ?? V[0]
  ), [w, Y] = g({
    field: "",
    value: ""
  }), ee = () => /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
    c.SubSectionHeader,
    {
      icon: "at-sign",
      title: a("salesforce_create_new_contact_under_account"),
      labelFor: "create-new-contact-under-account",
      children: /* @__PURE__ */ e(
        p,
        {
          size: "sm",
          labelOnLeading: !0,
          checked: G,
          onCheckedChange: (l) => {
            s("createNewContactUnderAccount", l);
          }
        }
      )
    }
  ) });
  return /* @__PURE__ */ e(
    ue,
    {
      returnTo: `${se}${K}?tabName=apps`,
      app: L,
      teamId: ((ne = W.team) == null ? void 0 : ne.id) || void 0,
      switchOnClick: (l) => {
        T(l);
      },
      switchChecked: O,
      hideSettingsIcon: !0,
      children: /* @__PURE__ */ r(c.Content, { children: [
        /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
          c.SubSectionHeader,
          {
            icon: "zap",
            title: a("salesforce_add_attendees_as"),
            justify: "start",
            labelFor: "add-attendees-as",
            children: /* @__PURE__ */ e(
              f,
              {
                size: "sm",
                id: "add-attendees-as",
                className: "w-[200px]",
                options: t,
                value: i,
                onChange: (l) => {
                  l && (v(l), s("createEventOn", l.value));
                }
              }
            )
          }
        ) }),
        /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
          c.SubSectionHeader,
          {
            icon: "user-plus",
            title: a("salesforce_ignore_guests"),
            labelFor: "ignore-guests",
            children: /* @__PURE__ */ e(
              p,
              {
                size: "sm",
                labelOnLeading: !0,
                checked: M,
                onCheckedChange: (l) => {
                  s("ignoreGuests", l);
                }
              }
            )
          }
        ) }),
        i.value === m.CONTACT ? /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
          c.SubSectionHeader,
          {
            icon: "user-plus",
            title: a("skip_contact_creation", { appName: "Salesforce" }),
            labelFor: "skip-contact-creation",
            children: /* @__PURE__ */ e(
              p,
              {
                size: "sm",
                labelOnLeading: !0,
                checked: U,
                onCheckedChange: (l) => {
                  s("skipContactCreation", l);
                }
              }
            )
          }
        ) }) : null,
        i.value === m.LEAD ? /* @__PURE__ */ r(E, { children: [
          /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
            c.SubSectionHeader,
            {
              icon: "user-plus",
              title: a("salesforce_create_event_on_contact"),
              labelFor: "create-event-on-contact",
              children: /* @__PURE__ */ e(
                p,
                {
                  size: "sm",
                  labelOnLeading: !0,
                  checked: X,
                  onCheckedChange: (l) => {
                    s("createEventOnLeadCheckForContact", l);
                  }
                }
              )
            }
          ) }),
          /* @__PURE__ */ e(ee, {})
        ] }) : null,
        i.value === m.ACCOUNT ? /* @__PURE__ */ r(E, { children: [
          /* @__PURE__ */ e(ee, {}),
          /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
            c.SubSectionHeader,
            {
              icon: "user-plus",
              title: a("salesforce_if_account_does_not_exist"),
              labelFor: "create-lead-if-account-null",
              children: /* @__PURE__ */ e(
                p,
                {
                  size: "sm",
                  labelOnLeading: !0,
                  checked: y,
                  onCheckedChange: (l) => {
                    s("createLeadIfAccountNull", l);
                  }
                }
              )
            }
          ) })
        ] }) : null,
        /* @__PURE__ */ r(c.SubSection, { children: [
          /* @__PURE__ */ e(c.SubSectionHeader, { icon: "badge-check", title: a("on_booking_write_to_event_object"), children: /* @__PURE__ */ e(
            p,
            {
              size: "sm",
              labelOnLeading: !0,
              checked: H,
              onCheckedChange: (l) => {
                s("onBookingWriteToEventObject", l);
              }
            }
          ) }),
          H ? /* @__PURE__ */ r(c.SubSectionContent, { children: [
            /* @__PURE__ */ r("div", { className: "text-subtle flex gap-3 px-3 py-[6px] text-sm font-medium", children: [
              /* @__PURE__ */ e("div", { className: "flex-1", children: a("field_name") }),
              /* @__PURE__ */ e("div", { className: "flex-1", children: a("value") }),
              /* @__PURE__ */ e("div", { className: "w-10" })
            ] }),
            /* @__PURE__ */ r(c.SubSectionNested, { children: [
              Object.keys(_).map((l) => /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(b, { value: l, readOnly: !0, size: "sm", className: "w-full" }) }),
                /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
                  b,
                  {
                    value: _[l],
                    readOnly: !0,
                    size: "sm",
                    className: "w-full"
                  }
                ) }),
                /* @__PURE__ */ e("div", { className: "flex w-10 justify-center", children: /* @__PURE__ */ e(
                  F,
                  {
                    StartIcon: "x",
                    variant: "icon",
                    size: "sm",
                    color: "minimal",
                    onClick: () => {
                      const oe = _;
                      delete _[l], s("onBookingWriteToEventObjectMap", oe);
                    }
                  }
                ) })
              ] }, l)),
              /* @__PURE__ */ r("div", { className: "mt-2 flex gap-4", children: [
                /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
                  b,
                  {
                    size: "sm",
                    className: "w-full",
                    value: w.field,
                    onChange: (l) => Y({
                      ...w,
                      field: l.target.value
                    })
                  }
                ) }),
                /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
                  b,
                  {
                    size: "sm",
                    className: "w-full",
                    value: w.value,
                    onChange: (l) => Y({
                      ...w,
                      value: l.target.value
                    })
                  }
                ) }),
                /* @__PURE__ */ e("div", { className: "w-10" })
              ] })
            ] }),
            /* @__PURE__ */ e(
              F,
              {
                className: "text-subtle mt-2 w-fit",
                size: "sm",
                color: "secondary",
                disabled: !(w.field && w.value),
                onClick: () => {
                  if (Object.keys(_).includes(
                    w.field.trim()
                  )) {
                    D("Field already exists", "error");
                    return;
                  }
                  s("onBookingWriteToEventObjectMap", {
                    ..._,
                    [w.field.trim()]: w.value.trim()
                  }), Y({ field: "", value: "" });
                },
                children: a("add_new_field")
              }
            )
          ] }) : null
        ] }),
        /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
          le,
          {
            bookingAction: J.ON_BOOKING,
            optionLabel: a("salesforce_on_booking_write_to_record", { record: z }),
            optionEnabled: u,
            writeToObjectData: N,
            optionSwitchOnChange: (l) => {
              s("onBookingWriteToRecord", l);
            },
            updateWriteToObjectData: (l) => s("onBookingWriteToRecordFields", l)
          }
        ) }),
        /* @__PURE__ */ r(c.SubSection, { children: [
          /* @__PURE__ */ e(
            c.SubSectionHeader,
            {
              icon: "user-plus",
              title: a("salesforce_change_record_owner_on_booking"),
              labelFor: "change-record-owner-on-booking",
              children: /* @__PURE__ */ e(
                p,
                {
                  size: "sm",
                  labelOnLeading: !0,
                  checked: A,
                  onCheckedChange: (l) => {
                    s("onBookingChangeRecordOwner", l);
                  }
                }
              )
            }
          ),
          A ? /* @__PURE__ */ e(c.SubSectionContent, { classNames: { container: "p-3" }, children: /* @__PURE__ */ r("div", { children: [
            /* @__PURE__ */ e(
              Z,
              {
                htmlFor: "on-booking-change-record-owner-name",
                className: "text-subtle text-sm font-medium",
                children: a("salesforce_owner_name_to_change")
              }
            ),
            /* @__PURE__ */ e(
              b,
              {
                id: "on-booking-change-record-owner-name",
                size: "sm",
                value: j,
                onChange: (l) => s("onBookingChangeRecordOwnerName", l.target.value)
              }
            )
          ] }) }) : null
        ] }),
        W.schedulingType === re.ROUND_ROBIN ? /* @__PURE__ */ r(E, { children: [
          /* @__PURE__ */ r(c.SubSection, { children: [
            /* @__PURE__ */ e(
              c.SubSectionHeader,
              {
                icon: "users",
                title: a("salesforce_book_directly_with_attendee_owner"),
                labelFor: "book-directly-with-attendee-owner",
                children: /* @__PURE__ */ e(
                  p,
                  {
                    size: "sm",
                    id: "book-directly-witha-attendee-owner",
                    checked: C,
                    onCheckedChange: (l) => {
                      s("roundRobinLeadSkip", l), l && s("enabled", l);
                    }
                  }
                )
              }
            ),
            C ? /* @__PURE__ */ e(c.SubSectionContent, { classNames: { container: "p-3" }, children: /* @__PURE__ */ r("div", { children: [
              /* @__PURE__ */ e(
                Z,
                {
                  htmlFor: "round-robin-skip-check-record-on",
                  className: "text-subtle text-sm font-medium",
                  children: a("salesforce_check_owner_of")
                }
              ),
              /* @__PURE__ */ e(
                f,
                {
                  size: "sm",
                  className: "w-60",
                  options: V,
                  value: Q,
                  onChange: (l) => {
                    l && (ie(l), s("roundRobinSkipCheckRecordOn", l.value));
                  }
                }
              )
            ] }) }) : null
          ] }),
          /* @__PURE__ */ e(E, { children: C ? /* @__PURE__ */ r(E, { children: [
            Q.value === m.CONTACT ? /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
              c.SubSectionHeader,
              {
                icon: "users",
                title: a("salesforce_round_robin_skip_fallback_to_lead_owner"),
                labelFor: "round-robin-skip-fallback-to-lead-owner",
                children: /* @__PURE__ */ e(
                  p,
                  {
                    id: "round-robin-skip-fallback-to-lead-owner",
                    size: "sm",
                    checked: B,
                    onCheckedChange: (l) => {
                      s("roundRobinSkipFallbackToLeadOwner", l);
                    }
                  }
                )
              }
            ) }) : null,
            /* @__PURE__ */ r(c.SubSection, { children: [
              /* @__PURE__ */ e(
                c.SubSectionHeader,
                {
                  icon: "users",
                  title: a("salesforce_if_free_email_domain_skip_owner_check"),
                  labelFor: "if-free-email-domain-skip-owner-check",
                  children: /* @__PURE__ */ e(
                    p,
                    {
                      id: "if-free-email-domain-skip-owner-check",
                      size: "sm",
                      checked: I,
                      onCheckedChange: (l) => {
                        s("ifFreeEmailDomainSkipOwnerCheck", l);
                      }
                    }
                  )
                }
              ),
              /* @__PURE__ */ e(de, { severity: "info", title: a("skip_rr_description") })
            ] })
          ] }) : null })
        ] }) : null,
        /* @__PURE__ */ e(c.SubSection, { children: /* @__PURE__ */ e(
          le,
          {
            bookingAction: J.ON_CANCEL,
            optionLabel: a("salesforce_on_cancel_write_to_event"),
            optionEnabled: P,
            writeToObjectData: n,
            optionSwitchOnChange: (l) => {
              s("onCancelWriteToEventRecord", l);
            },
            updateWriteToObjectData: (l) => s("onCancelWriteToEventRecordFields", l)
          }
        ) }),
        /* @__PURE__ */ r(c.SubSection, { children: [
          /* @__PURE__ */ e(
            c.SubSectionHeader,
            {
              icon: "calendar",
              title: "Send no show attendee data to event object",
              labelFor: "send-no-show-attendee-data",
              children: /* @__PURE__ */ e(
                p,
                {
                  id: "send-no-show-attendee-data",
                  size: "sm",
                  checked: R,
                  onCheckedChange: (l) => {
                    s("sendNoShowAttendeeData", l);
                  }
                }
              )
            }
          ),
          R ? /* @__PURE__ */ r(c.SubSectionContent, { classNames: { container: "p-3" }, children: [
            /* @__PURE__ */ e(
              Z,
              {
                htmlFor: "send-no-show-attendee-data-field-name",
                className: "text-subtle text-sm font-medium",
                children: "Field name to check (must be checkbox data type)"
              }
            ),
            /* @__PURE__ */ e(
              b,
              {
                id: "send-no-show-attendee-data-field-name",
                size: "sm",
                value: S,
                onChange: (l) => s("sendNoShowAttendeeDataField", l.target.value)
              }
            )
          ] }) : null
        ] })
      ] })
    }
  );
};
export {
  Ce as default
};
