import { jsx as a, jsxs as m } from "react/jsx-runtime";
import { J as h, k as n } from "./index-_1f6rhg6.js";
import { A as I } from "./AppCard-vvom7JzI.js";
import { u as C } from "./useIsAppEnabled-EWMW2qIQ.js";
const R = function({ app: s, eventType: o }) {
  var i;
  const { getAppData: p, setAppData: r, disabled: t } = h(), c = p("SITE_ID"), d = p("SCRIPT_URL"), { enabled: l, updateEnabled: u } = C(s);
  return /* @__PURE__ */ a(
    I,
    {
      app: s,
      switchOnClick: (e) => {
        u(e);
      },
      switchChecked: l,
      teamId: ((i = o.team) == null ? void 0 : i.id) || void 0,
      children: /* @__PURE__ */ m("fieldset", { className: "space-y-2", disabled: t, children: [
        /* @__PURE__ */ a(
          n,
          {
            disabled: t,
            name: "Script URL",
            value: d,
            defaultValue: "https://us.umami.is/script.js",
            placeholder: "Enter the script source URL",
            onChange: (e) => {
              r("SCRIPT_URL", e.target.value);
            }
          }
        ),
        /* @__PURE__ */ a(
          n,
          {
            disabled: t,
            name: "Site ID",
            value: c,
            placeholder: "Enter your Site ID",
            onChange: (e) => {
              r("SITE_ID", e.target.value);
            }
          }
        )
      ] })
    }
  );
};
export {
  R as default
};
