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] = "10e2f988-98a7-458b-938e-8e0c787a3799", e._sentryDebugIdIdentifier = "sentry-dbid-10e2f988-98a7-458b-938e-8e0c787a3799");
} catch (e) {}
import { n as addResourceBundles, r as useTranslation } from "./translation-Br5wIPO-.js";
import { i as stylesheets, n as EmbedShell, t as resolveEnvironment } from "./resolveEnvironment-BcrJH82n.js";
import { r as Loader } from "./Button-BDEdGXnd.js";
import { r as useLegalEntity } from "./useLegalEntity-Dm6g0wmt.js";
import { t as getLegalEntityCountry } from "./getLegalEntityCountry-C6bSV6sB.js";
import { t as _rolldown_dynamic_import_helper_default } from "./_rolldown_dynamic_import_helper-CCXvMgfE.js";
import { t as MaybeModal } from "./MaybeModal-DkRlF_Mg.js";
import { t as emitAdyenSdkEvent } from "./emitEvent-DYC1em5m.js";
import { t as BusinessFinancingDropin } from "./BusinessFinancingDropin-VodFOFP9.js";
import register from "preact-custom-element";
import { useMemo, useRef } from "preact/hooks";
import { jsx } from "preact/jsx-runtime";
//#region src/components/EmbeddedDropins/BusinessFinancingComponent/BusinessFinancingComponent.tsx
function BusinessFinancingComponent({ legalEntityId, onSubmitSuccess, asModal, handleCloseClick }) {
	const { i18n } = useTranslation();
	const { data: rootLegalEntity } = useLegalEntity(legalEntityId);
	const country = useMemo(() => rootLegalEntity ? getLegalEntityCountry(rootLegalEntity) : void 0, [rootLegalEntity]);
	addResourceBundles(i18n, [
		{
			ns: "common",
			importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
				"../../../language/locales/bg-BG.json": () => import("./bg-BG-NwL6SZRu.js"),
				"../../../language/locales/cs-CZ.json": () => import("./cs-CZ-BZkot6xs.js"),
				"../../../language/locales/da-DK.json": () => import("./da-DK-Bc6oX5Ct.js"),
				"../../../language/locales/de-DE.json": () => import("./de-DE-JZBqb8ce.js"),
				"../../../language/locales/el-GR.json": () => import("./el-GR-C8jFvyDg.js"),
				"../../../language/locales/en-US.instructions.json": () => import("./en-US.instructions-DlxMDbRu.js"),
				"../../../language/locales/en-US.json": () => import("./en-US-Cq6Cl6Yl.js"),
				"../../../language/locales/es-ES.json": () => import("./es-ES-mdSA-CIT.js"),
				"../../../language/locales/et-EE.json": () => import("./et-EE-B4ZMHksf.js"),
				"../../../language/locales/fi-FI.json": () => import("./fi-FI-koFpyMaq.js"),
				"../../../language/locales/fr-FR.json": () => import("./fr-FR-B0eVVc8V.js"),
				"../../../language/locales/hr-HR.json": () => import("./hr-HR-D_X-RNUl.js"),
				"../../../language/locales/hu-HU.json": () => import("./hu-HU-3FpAw9b1.js"),
				"../../../language/locales/it-IT.json": () => import("./it-IT-BgULENxX.js"),
				"../../../language/locales/ja-JP.json": () => import("./ja-JP-BT70_5Cd.js"),
				"../../../language/locales/lt-LT.json": () => import("./lt-LT-CKltvr9j.js"),
				"../../../language/locales/lv-LV.json": () => import("./lv-LV-DwsdNJrk.js"),
				"../../../language/locales/nl-NL.json": () => import("./nl-NL-CxlTSECX.js"),
				"../../../language/locales/no-NO.json": () => import("./no-NO-FtH9gIpv.js"),
				"../../../language/locales/pl-PL.json": () => import("./pl-PL-CK40GB3R.js"),
				"../../../language/locales/pt-BR.json": () => import("./pt-BR-zUBVM8_b.js"),
				"../../../language/locales/pt-PT.json": () => import("./pt-PT-CxnB9Jff.js"),
				"../../../language/locales/ro-RO.json": () => import("./ro-RO-Cuw1RmFc.js"),
				"../../../language/locales/sk-SK.json": () => import("./sk-SK-1i0L4zIs.js"),
				"../../../language/locales/sl-SI.json": () => import("./sl-SI-D3zK3MPP.js"),
				"../../../language/locales/sv-SE.json": () => import("./sv-SE-CVRa-6Y0.js")
			}), `../../../language/locales/${lang}.json`, 6)
		},
		{
			ns: "ui",
			importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
				"../../ui/language/bg-BG.json": () => import("./bg-BG-IjNKw0Zu.js"),
				"../../ui/language/cs-CZ.json": () => import("./cs-CZ-B6AZX4nL.js"),
				"../../ui/language/da-DK.json": () => import("./da-DK-B8aHvZ1W.js"),
				"../../ui/language/de-DE.json": () => import("./de-DE-cPL-uSMG.js"),
				"../../ui/language/el-GR.json": () => import("./el-GR-BDXwftjw.js"),
				"../../ui/language/en-US.json": () => import("./en-US-_l9425V1.js"),
				"../../ui/language/es-ES.json": () => import("./es-ES-D67pkLVu.js"),
				"../../ui/language/et-EE.json": () => import("./et-EE-Dg93VJbx.js"),
				"../../ui/language/fi-FI.json": () => import("./fi-FI-BNtrKnDN.js"),
				"../../ui/language/fr-FR.json": () => import("./fr-FR-DYDmBWWT.js"),
				"../../ui/language/hr-HR.json": () => import("./hr-HR-DbebVQF9.js"),
				"../../ui/language/hu-HU.json": () => import("./hu-HU-e9KN8lp6.js"),
				"../../ui/language/it-IT.json": () => import("./it-IT-16IjDttL.js"),
				"../../ui/language/ja-JP.json": () => import("./ja-JP-CJY6uqPb.js"),
				"../../ui/language/lt-LT.json": () => import("./lt-LT-BVVTYN3z.js"),
				"../../ui/language/lv-LV.json": () => import("./lv-LV-BeobSRYx.js"),
				"../../ui/language/nl-NL.json": () => import("./nl-NL-DKpjFbpm.js"),
				"../../ui/language/no-NO.json": () => import("./no-NO-CG5RteG_.js"),
				"../../ui/language/pl-PL.json": () => import("./pl-PL-R6bNjSQB.js"),
				"../../ui/language/pt-BR.json": () => import("./pt-BR-VlNZLr8f.js"),
				"../../ui/language/pt-PT.json": () => import("./pt-PT-Dmor9x6o.js"),
				"../../ui/language/ro-RO.json": () => import("./ro-RO-BRtHlgch.js"),
				"../../ui/language/sk-SK.json": () => import("./sk-SK--ohjuOMW.js"),
				"../../ui/language/sl-SI.json": () => import("./sl-SI-DWJzi8r_.js"),
				"../../ui/language/sv-SE.json": () => import("./sv-SE-DTpqjuJd.js")
			}), `../../ui/language/${lang}.json`, 5)
		},
		{
			ns: "businessFinancing",
			importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
				"../../EFP/tasks/BusinessFinancingDropin/language/bg-BG.json": () => import("./bg-BG-D3gXF-6w2.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/cs-CZ.json": () => import("./cs-CZ-C7QmQ2LT2.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/da-DK.json": () => import("./da-DK-DAHcK0Md2.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/de-DE.json": () => import("./de-DE-DUlvIvvj2.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/el-GR.json": () => import("./el-GR-hquqlbpg2.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/en-US.json": () => import("./en-US-BLuFDCyp2.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/es-ES.json": () => import("./es-ES-DnmrjEd02.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/et-EE.json": () => import("./et-EE-DXoF-AJ72.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/fi-FI.json": () => import("./fi-FI-DIKQFczn2.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/fr-FR.json": () => import("./fr-FR-D96p0pnI2.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/hr-HR.json": () => import("./hr-HR-DNuly_NE2.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/hu-HU.json": () => import("./hu-HU-UzZvIK5j.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/it-IT.json": () => import("./it-IT-JgaaWuPW.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/ja-JP.json": () => import("./ja-JP-CJ3GhLS6.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/lt-LT.json": () => import("./lt-LT-i2HdquzD.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/lv-LV.json": () => import("./lv-LV-ZQOBF-l7.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/nl-NL.json": () => import("./nl-NL-DHNIfmgo.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/no-NO.json": () => import("./no-NO-DkmYSpeK.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/pl-PL.json": () => import("./pl-PL-Bkdj5z2L.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/pt-BR.json": () => import("./pt-BR-DGIHaJzj.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/pt-PT.json": () => import("./pt-PT-Cu2VcZdJ.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/ro-RO.json": () => import("./ro-RO-pGnT9ywa.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/sk-SK.json": () => import("./sk-SK-HLMucQBt.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/sl-SI.json": () => import("./sl-SI-DyC9aHm4.js"),
				"../../EFP/tasks/BusinessFinancingDropin/language/sv-SE.json": () => import("./sv-SE-xHYNkpLd.js")
			}), `../../EFP/tasks/BusinessFinancingDropin/language/${lang}.json`, 7)
		}
	]);
	const handleFinishClick = (data) => {
		handleCloseClick?.();
		onSubmitSuccess?.(data);
	};
	if (!rootLegalEntity || !country) return /* @__PURE__ */ jsx(Loader, {});
	return /* @__PURE__ */ jsx(MaybeModal, {
		inline: !asModal,
		onClose: handleCloseClick,
		inset: true,
		children: /* @__PURE__ */ jsx(BusinessFinancingDropin, {
			country,
			rootLegalEntity,
			externalOnSubmit: handleFinishClick,
			handleHomeClick: handleCloseClick,
			isStandaloneComponent: true
		})
	});
}
//#endregion
//#region src/embeds/business-financing/adyen-business-financing.tsx
var AdyenBusinessFinancing = ({ rootlegalentityid, fetchToken, environment, locale, settings = {}, experiments = {} }) => {
	const eventEmitterRef = useRef(null);
	const handleOnComplete = (data) => {
		emitAdyenSdkEvent(eventEmitterRef, "complete", data);
	};
	const handleOnClose = () => {
		emitAdyenSdkEvent(eventEmitterRef, "close");
	};
	return /* @__PURE__ */ jsx("div", {
		ref: eventEmitterRef,
		style: "width:100%;",
		children: /* @__PURE__ */ jsx(EmbedShell, {
			componentName: "adyen-business-financing",
			rootLegalEntityId: rootlegalentityid,
			settings,
			features: experiments,
			getSdkToken: fetchToken,
			locale,
			baseUrl: resolveEnvironment(environment),
			children: /* @__PURE__ */ jsx(BusinessFinancingComponent, {
				legalEntityId: rootlegalentityid,
				onSubmitSuccess: handleOnComplete,
				handleCloseClick: handleOnClose
			})
		})
	});
};
register(AdyenBusinessFinancing, "adyen-business-financing", [
	"rootlegalentityid",
	"fetchToken",
	"environment",
	"locale",
	"settings",
	"experiments"
], {
	shadow: true,
	adoptedStyleSheets: stylesheets
});
//#endregion
export { AdyenBusinessFinancing };
