import { aY as p, aZ as P, a_ as g, aX as x, aW as e, a$ as f } from "./index-6jcTChn4.js";
import { useMemo as S, useState as b } from "react";
import { A as v } from "./AppCard-YGWCah1h.js";
import C from "./EventTypeAppSettingsInterface-u4r6Yml0.js";
const $ = function({
  app: a,
  eventType: i,
  eventTypeFormMetadata: c
}) {
  const t = p.useSearchParams(), s = p.usePathname(), m = S(
    () => `${s}${t ? `?${t.toString()}` : ""}`,
    [s, t]
  ), { getAppData: n, setAppData: h, disabled: d } = P(), [o, l] = b(n("enabled")), u = g(c), { t: A } = x(), r = !o && u;
  return /* @__PURE__ */ e.jsx(
    v,
    {
      returnTo: f + m,
      app: a,
      switchChecked: o,
      switchOnClick: (y) => {
        l(y);
      },
      description: /* @__PURE__ */ e.jsx(e.Fragment, { children: "Add Paypal payment to your events" }),
      disableSwitch: r,
      switchTooltip: r ? A("other_payment_app_enabled") : void 0,
      children: /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
        C,
        {
          eventType: i,
          slug: a.slug,
          disabled: d,
          getAppData: n,
          setAppData: h
        }
      ) })
    }
  );
};
export {
  $ as default
};
