import { jsx as m } from "../../../../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { useWizardFormContext as f } from "../../../../../../../../hooks/form/wizard/WizardFormContext.js";
import { useCallback as u } from "../../../../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { FormTextInput as p } from "../../../../../../../internal/FormWrappers/FormTextInput.js";
import { PAYMENT_LINK_CREATION_FIELD_LENGTHS as g } from "../../../../../constants.js";
import c from "../../../../../../../../core/Context/preact/useCoreContext.js";
const C = ({
  isSameAddress: e,
  isAddressFieldRequired: l,
  showBillingFirst: t = !1,
  isSameAddressCopyEnabled: r = !1
}) => {
  const { i18n: s } = c(), { setValue: i, fieldsConfig: n } = f(), o = u(
    (d) => {
      t && r && e && i("deliveryAddress.street", d.currentTarget.value);
    },
    [e, i, t, r]
  ), a = n["billingAddress.street"]?.required || l("billingAddress.street");
  return /* @__PURE__ */ m(
    p,
    {
      maxLength: g.billingAddress.street.max,
      fieldName: "billingAddress.street",
      label: s.get("payByLink.creation.fields.billingAddress.street.label"),
      onInput: o,
      className: "adyen-pe-payment-link-creation-form__billing-address-field--large",
      hideOptionalLabel: !0,
      isRequired: a
    }
  );
};
export {
  C as BillingStreetField
};
