import { r as b, t as f, v as E, w as v, q as p, W as w } from "./index-jYYVpIDL.js";
import { useState as x } from "react";
import { A as y } from "./AppCard-pSUVQRE0.js";
import { u as C } from "./useIsAppEnabled-Tvqt7uu5.js";
import P from "./EventTypeAppSettingsInterface-VtTR4Nvc.js";
const D = function({
  app: t,
  eventType: e,
  eventTypeFormMetadata: o
}) {
  var n;
  const { t: i } = b(), r = f.usePathname(), { getAppData: a, setAppData: c, disabled: d } = E(), { enabled: m, updateEnabled: l } = C(t), u = v(o), [h] = x(a("enabled")), s = !h && u;
  return /* @__PURE__ */ p.jsx(
    y,
    {
      returnTo: `${w}${r}?tabName=apps`,
      app: t,
      switchChecked: m,
      switchOnClick: (A) => {
        l(A);
      },
      teamId: ((n = e.team) == null ? void 0 : n.id) || void 0,
      disableSwitch: s,
      switchTooltip: s ? i("other_payment_app_enabled") : void 0,
      children: /* @__PURE__ */ p.jsx(
        P,
        {
          eventType: e,
          slug: t.slug,
          disabled: d,
          getAppData: a,
          setAppData: c
        }
      )
    }
  );
};
export {
  D as default
};
