import { _ as _sfc_main$2 } from './chunk-aff50618.js'; import { _ as _sfc_main$1 } from './chunk-ab9bd3df.js'; import { a as __unplugin_components_1 } from './chunk-8109fd17.js'; import { defineComponent, ref, computed, unref, isRef, withCtx, createVNode, openBlock, createBlock, Fragment, renderList, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderComponent, ssrRenderList } from 'vue/server-renderer'; import { _ as __unplugin_components_3 } from './chunk-4e7a6a8d.js'; import { ValidationErrorsIBAN, validateIBAN, extractIBAN, isQRIBAN, friendlyFormatIBAN } from 'ibantools'; import './chunk-95ec8cf7.js'; import './chunk-77c5cc16.js'; import '@vueuse/core'; import 'naive-ui'; import 'lodash'; import './chunk-6003391e.js'; import 'pinia'; import './chunk-11f44f81.js'; import './chunk-35c3d701.js'; const ibanErrorToMessage = { [ValidationErrorsIBAN.NoIBANProvided]: "No IBAN provided", [ValidationErrorsIBAN.NoIBANCountry]: "No IBAN country", [ValidationErrorsIBAN.WrongBBANLength]: "Wrong BBAN length", [ValidationErrorsIBAN.WrongBBANFormat]: "Wrong BBAN format", [ValidationErrorsIBAN.ChecksumNotNumber]: "Checksum is not a number", [ValidationErrorsIBAN.WrongIBANChecksum]: "Wrong IBAN checksum", [ValidationErrorsIBAN.WrongAccountBankBranchChecksum]: "Wrong account bank branch checksum", [ValidationErrorsIBAN.QRIBANNotAllowed]: "QR-IBAN not allowed" }; function getFriendlyErrors(errorCodes) { return errorCodes.map((errorCode) => ibanErrorToMessage[errorCode]).filter(Boolean); } const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "iban-validator-and-parser", __ssrInlineRender: true, setup(__props) { const rawIban = ref(""); const ibanInfo = computed(() => { const iban = rawIban.value.toUpperCase().replace(/\s/g, "").replace(/-/g, ""); if (iban === "") { return []; } const { valid: isIbanValid, errorCodes } = validateIBAN(iban); const { countryCode, bban } = extractIBAN(iban); const errors = getFriendlyErrors(errorCodes); return [ { label: "Is IBAN valid ?", value: isIbanValid, showCopyButton: false }, { label: "IBAN errors", value: errors.length === 0 ? void 0 : errors, hideOnNil: true, showCopyButton: false }, { label: "Is IBAN a QR-IBAN ?", value: isQRIBAN(iban), showCopyButton: false }, { label: "Country code", value: countryCode }, { label: "BBAN", value: bban }, { label: "IBAN friendly format", value: friendlyFormatIBAN(iban) } ]; }); const ibanExamples = [ "FR7630006000011234567890189", "DE89370400440532013000", "GB29NWBK60161331926819" ]; return (_ctx, _push, _parent, _attrs) => { const _component_c_card = __unplugin_components_1; const _component_c_key_value_list = _sfc_main$1; const _component_c_text_copyable = _sfc_main$2; _push(`