import { aL as p, aM as P, aN as g, aK as x, aJ as e, aO as f } from "./index-THhC4TET.js";
import { useMemo as S, useState as b } from "react";
import { A as v } from "./AppCard-1cD7do0L.js";
import C from "./EventTypeAppSettingsInterface-6_B9HFLU.js";
const k = 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 {
  k as default
};
