;
{
  try {
    let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
    n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9a4f5620-ab40-434b-bfde-868a61fc8c2d", e._sentryDebugIdIdentifier = "sentry-dbid-9a4f5620-ab40-434b-bfde-868a61fc8c2d");
  } catch (e) {
  }
}
;
import { jsx } from "preact/jsx-runtime";
import { useRef } from "preact/hooks";
import register from "preact-custom-element";
import { s as stylesheets, E as EmbedShell, r as resolveEnvironment } from "./resolveEnvironment-cyRWc5YB.js";
import { AcceptTermsOfServiceComponent } from "./AcceptTermsOfServiceComponent-Cj2GqvSw.js";
import { e as emitAdyenSdkEvent } from "./emitEvent-CzZf80Am.js";
const AdyenTermsOfService = ({
  rootlegalentityid,
  fetchToken,
  environment,
  locale,
  settings = {},
  experiments = {},
  view
}) => {
  const eventEmitterRef = useRef(null);
  const handleOnComplete = (data) => {
    emitAdyenSdkEvent(eventEmitterRef, "complete", data);
  };
  const handleOnAccept = (data) => {
    emitAdyenSdkEvent(eventEmitterRef, "accept", data);
  };
  const handleOnClose = () => {
    emitAdyenSdkEvent(eventEmitterRef, "close");
  };
  return /* @__PURE__ */ jsx("div", { ref: eventEmitterRef, style: "width:100%;", children: /* @__PURE__ */ jsx(
    EmbedShell,
    {
      componentName: "adyen-terms-of-service-management",
      rootLegalEntityId: rootlegalentityid,
      settings,
      experiments,
      getSdkToken: fetchToken,
      locale,
      baseUrl: resolveEnvironment(environment),
      children: /* @__PURE__ */ jsx(
        AcceptTermsOfServiceComponent,
        {
          legalEntityId: rootlegalentityid,
          onAccept: handleOnAccept,
          onComplete: handleOnComplete,
          modalView: view === "modal",
          onClose: handleOnClose
        }
      )
    }
  ) });
};
register(
  AdyenTermsOfService,
  "adyen-terms-of-service-management",
  ["rootlegalentityid", "fetchToken", "environment", "locale", "settings", "experiments", "view"],
  { shadow: true, adoptedStyleSheets: stylesheets }
);
export {
  AdyenTermsOfService
};
