"use strict";(()=>{var rr=Object.create;var Ve=Object.defineProperty,or=Object.defineProperties,ir=Object.getOwnPropertyDescriptor,ar=Object.getOwnPropertyDescriptors,ur=Object.getOwnPropertyNames,Nt=Object.getOwnPropertySymbols,sr=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty,cr=Object.prototype.propertyIsEnumerable;var qe=Math.pow,wt=(e,t,n)=>t in e?Ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tt=(e,t)=>{for(var n in t||(t={}))St.call(t,n)&&wt(e,n,t[n]);if(Nt)for(var n of Nt(t))cr.call(t,n)&&wt(e,n,t[n]);return e},At=(e,t)=>or(e,ar(t));var _t=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var lr=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of ur(t))!St.call(e,u)&&u!==n&&Ve(e,u,{get:()=>t[u],enumerable:!(o=ir(t,u))||o.enumerable});return e};var P=(e,t,n)=>(n=e!=null?rr(sr(e)):{},lr(t||!e||!e.__esModule?Ve(n,"default",{value:e,enumerable:!0}):n,e));var W=(e,t,n)=>new Promise((o,u)=>{var s=d=>{try{f(n.next(d))}catch(p){u(p)}},l=d=>{try{f(n.throw(d))}catch(p){u(p)}},f=d=>d.done?o(d.value):Promise.resolve(d.value).then(s,l);f((n=n.apply(e,t)).next())});var F=_t((si,Bt)=>{"use strict";var je=Object.defineProperty,fr=Object.getOwnPropertyDescriptor,dr=Object.getOwnPropertyNames,pr=Object.prototype.hasOwnProperty,mr=(e,t)=>{for(var n in t)je(e,n,{get:t[n],enumerable:!0})},gr=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of dr(t))!pr.call(e,u)&&u!==n&&je(e,u,{get:()=>t[u],enumerable:!(o=fr(t,u))||o.enumerable});return e},hr=e=>gr(je({},"__esModule",{value:!0}),e),It={};mr(It,{$:()=>Cr,getJQuery:()=>We,getProjektId:()=>Tr,getUrlParameter:()=>Ar,getXUtil:()=>Sr,getXfcMetaData:()=>xr,getXmFormDynValues:()=>Ct,getXmFormDynValuesParsed:()=>Mr,getXmFormI18n:()=>yr,getXmFormModel:()=>Er,getXmFormPluginValidationRules:()=>Nr,getXmFormValidationRules:()=>vr,getXmValidator:()=>wr,gotoPage:()=>_r,setValidate:()=>Ir});Bt.exports=hr(It);var Mt=()=>typeof globalThis=="object"?globalThis:window,br=e=>Mt()[e],Y=e=>()=>Mt()[e],pe=e=>(...t)=>br(e)(...t),Xe,xr=Y("XFC_METADATA"),yr=Y("XM_FORM_I18N"),Ct=Y("XM_FORM_DYNVALUES"),vr=Y("XM_FORM_VRULES"),Er=Y("XM_FORM_MODEL"),Nr=Y("XM_FORM_PLUGIN_VRULES"),wr=Y("xm_validator"),Sr=()=>We().xutil,Tr=pe("getProjektId"),Ar=pe("getURLParameter"),_r=pe("gotoPage"),Ir=pe("setValidate"),We=pe("xm_jq");function Mr(){var e,t;if(Xe!==void 0)return Xe;let n={formItems:{},repetitions:{}},o=(e=Ct())!=null?e:{};for(let u of Object.keys(o!=null?o:{})){let s=o[u];if(s!==void 0)if(Array.isArray(s)){let l=u.endsWith("_dyn_size")?u.substring(0,u.length-9):u;n.repetitions[l]=s}else for(let l of Object.keys(s)){let f=s[l],d=(t=n.formItems[u])!=null?t:{size:0,value:{}};if(n.formItems[u]=d,f!==void 0)if(typeof f=="number")d.size=f;else{let p=l.startsWith("_")?l.substring(1):l;d.value[p]=f}}}return Xe=n,n}if(typeof XFC_METADATA!="object")throw new Error(["fc-form-renderer is not available","This module only contains type declaration files and no implementation.","The declared types are available only within a web form context of the XIMA formcycle application."].join(`
`));var Cr=We()});var jn=_t((He,Et)=>{(function(e,t){if(typeof He=="object"&&typeof Et=="object")Et.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var n=t();for(var o in n)(typeof He=="object"?He:e)[o]=n[o]}})(self,()=>(()=>{"use strict";var e={d:(N,_)=>{for(var w in _)e.o(_,w)&&!e.o(N,w)&&Object.defineProperty(N,w,{enumerable:!0,get:_[w]})},o:(N,_)=>Object.prototype.hasOwnProperty.call(N,_),r:N=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{$:()=>M,getJQuery:()=>v,getProjektId:()=>y,getUrlParameter:()=>O,getXUtil:()=>x,getXfcMetaData:()=>l,getXmFormDynValues:()=>d,getXmFormDynValuesParsed:()=>I,getXmFormI18n:()=>f,getXmFormModel:()=>g,getXmFormPluginValidationRules:()=>b,getXmFormValidationRules:()=>p,getXmValidator:()=>E,gotoPage:()=>L,setValidate:()=>C});let n=()=>typeof globalThis=="object"?globalThis:window,o=N=>()=>n()[N],u=N=>(..._)=>(w=>n()[w])(N)(..._),s,l=o("XFC_METADATA"),f=o("XM_FORM_I18N"),d=o("XM_FORM_DYNVALUES"),p=o("XM_FORM_VRULES"),g=o("XM_FORM_MODEL"),b=o("XM_FORM_PLUGIN_VRULES"),E=o("xm_validator"),x=()=>v().xutil,y=u("getProjektId"),O=u("getURLParameter"),L=u("gotoPage"),C=u("setValidate"),v=u("xm_jq");function I(){var N,_;if(s!==void 0)return s;let w={formItems:{},repetitions:{}},B=(N=d())!==null&&N!==void 0?N:{};for(let G of Object.keys(B!=null?B:{})){let de=B[G];if(de!==void 0)if(Array.isArray(de)){let ne=G.endsWith("_dyn_size")?G.substring(0,G.length-9):G;w.repetitions[ne]=de}else for(let ne of Object.keys(de)){let we=de[ne],Ke=(_=w.formItems[G])!==null&&_!==void 0?_:{size:0,value:{}};if(w.formItems[G]=Ke,we!==void 0)if(typeof we=="number")Ke.size=we;else{let nr=ne.startsWith("_")?ne.substring(1):ne;Ke.value[nr]=we}}}return s=w,w}if(typeof XFC_METADATA!="object")throw new Error(["fc-form-renderer is not available","This module only contains type declaration files and no implementation.","The declared types are available only within a web form context of the XIMA formcycle application."].join(`
`));let M=v();return t})())});var Je=P(F());var Be=P(F());var Br=e=>{e(1)};function re(){return Br}function oe(e){return e==null}function me(e){return e!==void 0}function $(e,t){return typeof t=="function"&&e instanceof t}function Ye(e){return t=>$(t,e)}var $e=class extends Error{};function Se(e,t,n){if(!$(e,t))throw new $e(n!=null?n:`Expected an instance of ${t.name}, but got ${String(e)}`)}function R(e){return e!=null&&e.length>0}function ze(e){return e==null||e.length===0}function Lt(e){return e==null||e.trim().length===0}function Qe(e){return e!=null&&e.trim().length>0}function k(e,t){return R(e)?e:t}function K(...e){for(let t of e)if(R(t))return t;return""}function kt(e,t){let n=e!=null?e:"",o=t!=null?t:"";return n.endsWith(o)?n.substring(0,n.length-o.length):n}function ge(){if(typeof globalThis!="undefined")return globalThis;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;if(typeof self!="undefined")return self;if(typeof frames!="undefined")return frames;throw new Error("Unable to locate global object")}var Ut={"":e=>e==="",0:e=>e===0,NaN:e=>typeof e=="number"&&Number.isNaN(e),emptyArray:e=>Array.isArray(e)&&e.length===0,emptyObject:e=>typeof e=="object"&&e!==null&&Object.keys(e).length===0,false:e=>e===!1,null:e=>e===null,undefined:e=>e===void 0};var Te={any:["false","0","","null","undefined","NaN","emptyArray","emptyObject"],falsy:["false","0","","null","undefined","NaN"],nullish:["null","undefined"],nullishOrEmptyString:["null","undefined",""],nullishOrNaN:["null","undefined","NaN"]};function Pt(e,t,n,o){for(let s of o!=null?o:Te.nullishOrNaN)if(Ut[s](e))return n;let u=t(e);for(let s of o!=null?o:Te.nullishOrNaN)if(Ut[s](u))return n;return u}function Ft(e,t=0){return Pt(e,Or,t,Te.nullishOrNaN)}function Gt(e,t=""){return Pt(e,V,t,Te.nullishOrEmptyString)}function V(e){return e==null?"":String(e)}function Or(e){if(typeof e=="number")return e;if(e===!1)return 0;if(e===!0)return 1;if(e!=null){let t=Number.parseFloat(String(e));return Number.isNaN(t)?Number.NaN:t}else return Number.NaN}function he(e){return e!==null&&typeof e=="object"?e:{}}function Ht(e){return typeof e=="boolean"?e:e==null?!1:typeof e=="string"?e===""?!1:e!=="false"&&e!=="0":typeof e=="number"?Number.isNaN(e)?!1:e!==0:!!e}function be(e,t,n,o){function u(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function f(g){try{p(o.next(g))}catch(b){l(b)}}function d(g){try{p(o.throw(g))}catch(b){l(b)}}function p(g){g.done?s(g.value):u(g.value).then(f,d)}p((o=o.apply(e,t||[])).next())})}var Rr="";function Ae(e,t){return{[Symbol.iterator]:()=>{let n=e[Symbol.iterator]();return{next:()=>{let o;do{let u=n.next();if(u.done===!0)return u;o=u.value}while(!t(o));return{done:!1,value:o}}}}}}function Ze(e,t){return{[Symbol.iterator]:()=>{let n=e[Symbol.iterator](),o=0;return{next:()=>{let u=n.next();return u.done===!0?u:{done:!1,value:t(u.value,o++)}}}}}}function Jt(e){return{[Symbol.iterator]:()=>{let t=e[Symbol.iterator](),n=0;return{next:()=>{let o=t.next();return o.done===!0?o:{done:!1,value:[o.value,n++]}}}}}}function Kt(e,t){return{[Symbol.iterator]:()=>{let n=e,o=!1;return{next:()=>{if(!o)return o=!0,{done:!1,value:e};if(n==null)return{done:!0,value:void 0};let u=t(n);return n=u,u==null?{done:!0,value:void 0}:{done:!1,value:u}}}}}}function Vt(){return Rr}function ie(e){if(Array.isArray(e))return e[0];for(let t of e)return t}function Lr(e,t){return{[Symbol.iterator]:()=>{let n=t.getLength(e),o=0;return{next:()=>{let u;for(;o<n;)if(u=t.getItem(e,o),o+=1,u!==void 0)return{done:!1,value:u};return{done:!0,value:void 0}}}}}}function qt(e,t){return be(this,void 0,void 0,function*(){return Promise.all(Ze(e,t))})}function et(e,t){return Array.isArray(e)?e:[...Xt(e,t)]}function Xt(e,t){return Array.isArray(e)?e:Lr(e,t)}var Vi=Symbol("Void");var ra=Symbol("CurryPlaceholder");function xe(e){return e}function jt(e,t){return e}function Wt(e,t){return t}function tt(...e){return e}function _e(...e){}function z(e,t,n){return t>n||Number.isNaN(e)||Number.isNaN(t)||Number.isNaN(n)?Number.NaN:e<t?t:e>n?n:e}function nt(e){return be(this,void 0,void 0,function*(){return qt(e,t=>be(this,void 0,void 0,function*(){try{return{status:"fulfilled",value:yield t}}catch(n){return{reason:n,status:"rejected"}}}))})}var Yt,$t;function rt(e,t){let n=e.values(),o={next:()=>{for(let u=n.next();u.done!==!0;u=n.next()){let l=u.value.deref();if(l!==void 0)return{done:!1,value:t(l)}}return{done:!0,value:void 0}},[Symbol.iterator]:()=>o};return o}function Ie(e,t,n){let o=e.values(),u={next:()=>{for(let s=o.next();s.done!==!0;s=o.next()){let l=s.value.deref();if(l!==void 0){let f=t.get(l);if(f!==void 0)return{done:!1,value:n(l,f.value)}}}return{done:!0,value:void 0}},[Symbol.iterator]:()=>u};return u}var zt=class{constructor(){this[Yt]="IterableWeakSet",this._id=Number.MIN_SAFE_INTEGER,this._map=new WeakMap,this._refs=new Map,this._finalizer=new FinalizationRegistry(t=>this._refs.delete(t))}[(Yt=Symbol.toStringTag,Symbol.iterator)](){return rt(this._refs,xe)}get size(){return this._refs.size}add(t){if(!this._map.has(t)){let n=this._id++;this._map.set(t,n),this._refs.set(n,new WeakRef(t)),this._finalizer.register(t,n,t)}return this}clear(){for(let t=this._refs.values(),n=t.next();n.done!==!0;n=t.next()){let o=n.value.deref();o!==void 0&&(this._map.delete(o),this._finalizer.unregister(o))}this._refs.clear()}delete(t){let n=this._map.get(t);return n===void 0?!1:(this._refs.delete(n),this._map.delete(t),this._finalizer.unregister(t),!0)}entries(){return rt(this._refs,t=>[t,t])}forEach(t,n){for(let o of this._refs.values()){let u=o.deref();u!==void 0&&t.call(n,u,u,this)}}has(t){return this._map.has(t)}keys(){return this.values()}values(){return rt(this._refs,xe)}},Qt=class{constructor(){this[$t]="IterableWeakMap",this._id=Number.MIN_SAFE_INTEGER,this._map=new WeakMap,this._refs=new Map,this._finalizer=new FinalizationRegistry(t=>this._refs.delete(t))}[($t=Symbol.toStringTag,Symbol.iterator)](){return Ie(this._refs,this._map,tt)}get size(){return this._refs.size}clear(){for(let t=this._refs.values(),n=t.next();n.done!==!0;n=t.next()){let o=n.value.deref();o!==void 0&&(this._map.delete(o),this._finalizer.unregister(o))}this._refs.clear()}delete(t){let n=this._map.get(t);return n===void 0?!1:(this._refs.delete(n.id),this._map.delete(t),this._finalizer.unregister(t),!0)}entries(){return Ie(this._refs,this._map,tt)}forEach(t,n){for(let o of this._refs.values()){let u=o.deref();if(u!==void 0){let s=this._map.get(u);s!==void 0&&t.call(n,s.value,u,this)}}}get(t){var n;return(n=this._map.get(t))===null||n===void 0?void 0:n.value}has(t){return this._map.has(t)}keys(){return Ie(this._refs,this._map,jt)}set(t,n){if(this._map.has(t)){let o=this._map.get(t);o!==void 0&&(o.value=n)}else{let o=this._id++;this._map.set(t,{id:o,value:n}),this._refs.set(o,new WeakRef(t)),this._finalizer.register(t,o,t)}return this}values(){return Ie(this._refs,this._map,Wt)}};var q=P(F());function kr(e,t){return e.getContainer(t)}function Ur(e,t){var o;let n=(o=(0,q.getXmFormModel)().validation.fields[t])!=null?o:{};return{fileext:K(e.attr("vfex"),e.attr("data-vfex"),n.vfex),maxfilesize:K(e.attr("vfmx"),e.attr("data-vfmx"),n.vfmx)}}var X={$:()=>q.$,getContainer:kr,getFormI18n:()=>(0,q.getXmFormI18n)(),readUploadProps:Ur,printMode:()=>(0,q.getXfcMetaData)().requestType==="print"};var S=P(F());function Zt(e,t,...n){for(let o of n){let u=t.find(o);if(u.length>0)return u}return e()}function Me(e,t){return e instanceof t?e:void 0}function Q(e){let t=e.getFormI18n();return{button:k(t.leitfadenUploadButtonSelect,"Datei ausw\xE4hlen"),buttonChange:k(t.leitfadenUploadButtonChange,"Datei \xE4ndern"),empty:k(t.leitfadenUploadNone,"keine Datei ausgew\xE4hlt"),format:k(t.leitfadenUploadFormat,"Erlaubte Formate:"),formatAnd:k(t.leitfadenUploadAnd,"und"),maxFileSize:k(t.leitfadenUploadMax,"Maximal m\xF6gliche Dateigr\xF6\xDFe:"),summaryHeader:k(t.summary_header,"Bitte \xFCberpr\xFCfen Sie Ihre Angaben"),uploaded:k(t.leitfadenUploaded,"Hochgeladene Datei"),xmSummaryGotoPageLink:k(t.xm_summary_goto_page_link,"Angaben \xE4ndern")}}function Pr(e){var n,o,u,s;if(K(e.attr("data-x-type"),e.attr("type"),(n=e[0])==null?void 0:n.nodeName)==="file"&&typeof File=="function"&&typeof FileReader=="function"&&typeof FileList=="function"&&typeof Blob=="function"){let l=e[0];return l!==void 0&&(s=(u=(o=Me(l,HTMLInputElement))==null?void 0:o.files)==null?void 0:u.item(0))!=null?s:void 0}}function Fr(e,t){var l,f;let n=(l=e.attr("id"))!=null?l:"",o=k(e.attr("data-org-id"),n),u=(f=e.attr("data-idx"))!=null?f:"";o=R(o)&&R(u)?o.replace(`_${u}`,""):o,Qe(u)&&R(n)&&(n=n.replace(/_\d+(_c_\d+)?$/,"$1"));let s=K(o,n);return t.readUploadProps(e,s)}function en(e,t){let n=e.get(0);if(!(n instanceof HTMLInputElement)||n.dataset.xUploadModernEnabled!=="true")return;let o=e.closest(".xm-item-div,.dynamic-row");if(o.length===0)return;n.dataset.xUploadModernEnabled="false",e.prop("tabindex",0),e.removeAttr("tabindex"),o.removeClass("XUpload-Old XUpload-Modern");let u=o.find(".xm-upl-wrapper"),s=o.find(".xm-upl-input-wrapper"),l=o.find(".img-uploaded-preview"),f=o.find(".ajax-progress"),d=o.find(".XUploadLink"),p=o.find(".XUploadAjaxUUID");for(let g=0;g<d.length;g+=1)l.eq(g).children().first().before(d.eq(g));t.printMode()&&d.show(),o.find(".xm-error-container").first().before(p),o.find(".xm-del-button-container,.XUploadAjaxUUID,.xm-error-container").first().before(f),o.find(".ajax-progress,.xm-del-button-container,.XUploadAjaxUUID,.xm-error-container").first().before(l),o.find(".img-uploaded-preview,.ajax-progress,.xm-del-button-container,.XUploadAjaxUUID,.xm-error-container").first().before(e),s.remove(),u.remove()}function ot(e,t){var O,L,C,v,I;let n=e.get(0);if(!(n instanceof HTMLInputElement)||n.dataset.xUploadModernEnabled==="true")return;n.dataset.xUploadModernEnabled="true";let o=t.getContainer(e,!0),u=Q(t),s=Fr(e,t),l=s.maxfilesize,f=s.fileext;e.prop("tabindex",-1),o.addClass("XUpload-Old XUpload-Modern");let d=t.$()("<div>",{class:"xm-upl-wrapper"}),p=t.$()(document.createElement("span"));p.addClass("xm-upl-label");let g=o.find(".img-uploaded-preview"),b=Zt(t.$(),o,".XUploadLink",".img-upload-preview-none");if(g.length>0){let M=g.find(".XUploadName"),N=o.find(".XImagePreview"),_=g.find(".img-upload-preview-none");if(p.text(`${u.uploaded}: `),t.printMode()){let w=t.$()(document.createElement("span"));if(w.text(M.length>0?(O=M.attr("value"))!=null?O:u.empty:b.text()),p.append(w),p.append(N),_.length>0){let B=document.createElement("span");B.classList.add("img-upload-preview-none","XRadius"),p.append(document.createElement("br")),p.append(B)}b.hide()}else(b.hasClass("img-upload-preview-none")||b.find(".XImagePreview").length>0)&&p.append(document.createElement("br")),p.append(b);d.append(p)}else p.text((C=(L=Pr(e))==null?void 0:L.name)!=null?C:u.empty),d.append(p);if(Qe(f)){let M=t.$()("<div>",{class:"xm-upl-format-wrapper"}),N=t.$()("<span>",{class:"xm-upl-format-label",text:u.format}),_=f.split(","),w=t.$()("<div>",{class:"xm-upl-format-value-wrapper"});for(let B=0;B<_.length;B+=1)t.$()("<span>",{class:"xm-upl-format-value",text:(I=(v=_[B])==null?void 0:v.toUpperCase())!=null?I:""}).appendTo(w),B===_.length-2&&_.length>=2?t.$()("<span>",{class:"xm-upl-format-value-text",text:` ${u.formatAnd} `}).appendTo(w):B!==_.length-1&&t.$()("<span>",{class:"xm-upl-format-value-text",text:","}).appendTo(w);M.append(N).append(w).appendTo(d)}if(R(l)&&l!=="0"){let M=t.$()("<div>",{class:"xm-upl-size-wrapper"}),N=t.$()("<span>",{class:"xm-upl-size-label",text:u.maxFileSize}),_=(Number.parseFloat(l)/1024).toFixed(2),w=t.$()("<span>",{class:"xm-upl-size-value",text:`${_} MB`});M.append(N).append(w).appendTo(d)}t.$()(".xm-upl-wrapper",e.parent()).remove();let E=e.nextAll(".ajax-progress").first();E.length>0?E.after(d):e.after(d);let x=t.$()(document.createElement("div"));x.addClass("xm-upl-input-wrapper"),x.attr("tabindex","0"),(n.disabled||n.readOnly)&&x.addClass("xm-upl-wrapper-disabled"),e.wrap(x);let y=t.$()(document.createElement("div"));y.addClass("xm-upl-input-label"),y.text(u.button),e.before(y),o.find(".ajax-progress").appendTo(e.parent()),o.find(".XUploadAjaxUUID").appendTo(e.parent()),o.find(".img-uploaded-preview").appendTo(e.parent())}function it(e){for(let t of e.find(".xm-del-button-icon")){let n=t.getAttribute("title");R(n)&&t.setAttribute("data-del-btn-name",n)}}function ut(e){var u,s;let t=Q(X),n=e.find("input[type='file']")[0];if(n===void 0)return;Se(n,HTMLInputElement);let o=(s=(0,S.getXUtil)().ajaxUploadManager.getUpload(n))!=null?s:ie((u=n.files)!=null?u:[]);e.find(".xm-upl-wrapper .xm-upl-label").text(Gt(o==null?void 0:o.name,t.empty)),e.find(".xm-upl-input-wrapper .xm-upl-input-label").text(o!==void 0?t.buttonChange:t.button)}function Gr(e){var o;let t=e.id,n=(0,S.getJQuery)()((o=document.getElementById(t))!=null?o:document.createElement("input")).closest(".xm-upl-input-wrapper").addBack(".xm-upl-input-wrapper").parent();ut(n)}function at(e){if(!e.is(".xm-upl-input-wrapper .XUpload"))return;let t=e.closest(".xm-upl-input-wrapper").addBack(".xm-upl-input-wrapper").parent(),n=t.find(".xm-upl-input-wrapper"),o=t.find(".XUpload").get(0);o instanceof HTMLInputElement&&(o.disabled||o.readOnly)?n.addClass("xm-upl-wrapper-disabled"):n.removeClass("xm-upl-wrapper-disabled")}function Hr(e){for(let t of e.container.find(".XUpload"))ot((0,S.getJQuery)()(t),X)}function Jr(e){for(let t of e.container.find(".XUpload"))en((0,S.getJQuery)()(t),X)}function tn(){(0,S.getXUtil)().on("fileChange",e=>Gr(e)),(0,S.getXUtil)().on("readOnly",e=>at(e.element)),(0,S.getXUtil)().on("disable",e=>at(e.element)),(0,S.getXUtil)().on("enable",e=>at(e.element)),(0,S.getXUtil)().on("addRow",e=>Hr(e)),(0,S.getXUtil)().on("beforeAddRow",e=>Jr(e)),(0,S.getJQuery)()(".xm-form").on("click",".CXUpload label",e=>{(0,S.getJQuery)()(e.target).closest(".CXPage").hasClass("xm-summary")&&e.preventDefault()}),(0,S.getJQuery)()(".xm-form").on("keydown",".xm-upl-input-wrapper",e=>{e.originalEvent instanceof KeyboardEvent&&(e.originalEvent.key==="Enter"||e.originalEvent.key===" ")&&(0,S.getJQuery)()(e.currentTarget).find("input").trigger("click")}),(0,S.getJQuery)()(".xm-form").on("dragover",".xm-upl-input-wrapper .XUpload",e=>{(0,S.getJQuery)()(e.target).closest(".xm-upl-input-wrapper").addBack(".xm-upl-input-wrapper").addClass("xm-upl-dragover")}),(0,S.getJQuery)()(".xm-form").on("dragleave drop dragend",".xm-upl-input-wrapper .XUpload",e=>{(0,S.getJQuery)()(e.target).closest(".xm-upl-input-wrapper").addBack(".xm-upl-input-wrapper").removeClass("xm-upl-dragover"),(0,S.getJQuery)()(e.target).closest(".xm-upl-input-wrapper").addBack(".xm-upl-input-wrapper").removeClass("xm-upl-hover")}),(0,S.getJQuery)()(".xm-form").on("mouseenter",".xm-upl-input-wrapper .XUpload",e=>{(0,S.getJQuery)()(e.target).closest(".xm-upl-input-wrapper").addBack(".xm-upl-input-wrapper").addClass("xm-upl-hover")}),(0,S.getJQuery)()(".xm-form").on("mouseleave",".xm-upl-input-wrapper .XUpload",e=>{(0,S.getJQuery)()(e.target).closest(".xm-upl-input-wrapper").addBack(".xm-upl-input-wrapper").removeClass("xm-upl-hover")});for(let e of(0,S.getJQuery)()(".XUpload"))ot((0,S.getJQuery)()(e),X)}var Ce=P(F());function nn(){(0,Ce.getXUtil)().on("addRow",e=>it(e.container)),it((0,Ce.getJQuery)()(document.documentElement))}function rn(){let e=he((0,Be.getXfcMetaData)().pluginResults["de.xima.fc.plugin.leitfaden.form_lifecycle.ProvidePluginSettingsPreRenderer"]);tn(),nn(),(e==null?void 0:e["disable.hint_on_focus"])!==!0&&(0,Be.$)(".xm-help-container").prop("tabindex",-1)}var m=P(F());var De=1e6;function Kr(){return{requestAnimationFrame:e=>requestAnimationFrame(e),cancelAnimationFrame:e=>cancelAnimationFrame(e)}}function Vr(){return{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)}}function on(e,t){var n,o,u,s;if(Number.isNaN(e))throw new TypeError("Duration must be a number");if(Number.POSITIVE_INFINITY===e)throw new TypeError("Duration must not be positive infinity");if(e<=0)return re();let l=e*De,f=t!=null?t:{},d=typeof f.frameDuration=="number"&&!Number.isNaN(f.frameDuration)?f.frameDuration*De:void 0,p=(n=f.clock)!==null&&n!==void 0?n:()=>Date.now()*De,g=(o=f.interpolator)!==null&&o!==void 0?o:xe,b=(u=f.animationFrameScheduler)!==null&&u!==void 0?u:Kr(),E=(s=f.timeoutScheduler)!==null&&s!==void 0?s:Vr();return(x,y)=>new Promise((O,L)=>{let C,v,I=y!==void 0?()=>{C!==void 0&&(b.cancelAnimationFrame(C),C=void 0),v!==void 0&&(E.clearTimeout(v),v=void 0),L(y.reason)}:_e;y==null||y.addEventListener("abort",I);let M=p(),N=()=>{if(d===void 0)C=b.requestAnimationFrame(_);else{let w=Math.max(0,l-(p()-M)),B=z(d,0,w)/De;B<=0?C=b.requestAnimationFrame(_):v=E.setTimeout(()=>{v=void 0,C=b.requestAnimationFrame(_)},B)}},_=()=>{C=void 0;let w=Math.min((p()-M)/l,1),B;try{B=g(w)}catch(G){y==null||y.removeEventListener("abort",I),L(G);return}x(B),w<1?N():(y==null||y.removeEventListener("abort",I),O())};C=b.requestAnimationFrame(_)})}function st(e){let t=e.parentElement;return t!==null?Kt(t,n=>n.parentElement):Vt()}function un(e,t){let n=(t!=null?t:ge().document).querySelector(e);return n!=null?n:void 0}function ae(e){var t,n;return"ownerDocument"in e?(n=((t=e.ownerDocument)!==null&&t!==void 0?t:e).defaultView)!==null&&n!==void 0?n:void 0:e}var Wr={getItem:(e,t)=>e.item(t),getLength:e=>e.length};function cn(){return Wr}function ue(e){return et(e,cn())}function ct(e){return Yr(e)}function Yr(e){return et(e,cn())}function H(e){if(oe(e))return[];if(typeof e=="string")try{let t=document.querySelectorAll(e);return ue(t)}catch(t){return[]}return e instanceof Element?[e]:Array.isArray(e)?e:e instanceof NodeList?ue(e):e instanceof HTMLCollection?ct(e):typeof e.toArray=="function"?e.toArray():[]}function $r(e,t){return H(e).filter(Ye(t))}function lt(e){return zr(e,HTMLElement)}function zr(e,t){return $r(e,t)}function ln(e,t,n){let o=t.split(/\s+/);for(let u of H(e))for(let s of o)R(s)&&((n===void 0?!u.classList.contains(s):n)?u.classList.add(s):u.classList.remove(s))}function U(e){return Ft(kt(e,"px"),0)}function Zr(e){return e===void 0?{top:0,right:0,bottom:0,left:0}:{top:U(e.marginTop),right:U(e.marginRight),bottom:U(e.marginBottom),left:U(e.marginLeft)}}function eo(e){return e===void 0?{top:0,right:0,bottom:0,left:0}:{top:U(e.borderTopWidth),right:U(e.borderRightWidth),bottom:U(e.borderBottomWidth),left:U(e.borderLeftWidth)}}function to(e){return e===void 0?{top:0,right:0,bottom:0,left:0}:{top:U(e.paddingTop),right:U(e.paddingRight),bottom:U(e.paddingBottom),left:U(e.paddingLeft)}}function fn(e){let t=e.getBoundingClientRect(),n=ae(e),o=n==null?void 0:n.getComputedStyle(e),u=eo(o),s=to(o),l=Zr(o),f=new DOMRect(t.left-l.left,t.top-l.top,t.width+l.left+l.right,t.height+l.top+l.bottom),d=new DOMRect(t.left+u.left,t.top+u.top,t.width-u.left-u.right,t.height-u.top-u.bottom),p=new DOMRect(d.x-e.scrollLeft,d.y-e.scrollTop,e.scrollWidth>0?e.scrollWidth:d.width,e.scrollHeight>0?e.scrollHeight:d.height),g=new DOMRect(d.left+s.left,d.top+s.top,e.clientWidth>0?e.clientWidth-s.left-s.right:d.width-s.left-s.right,e.clientHeight>0?e.clientHeight-s.top-s.bottom:d.height-s.top-s.bottom);return{border:u,borderBox:t,contentBox:g,margin:l,marginBox:f,padding:s,paddingBox:d,scrollBox:p}}var hn=["scroll","auto"];function bn(e){let t=ae(e);return t===void 0?void 0:{type:"win",value:t}}function xn(e){let t=H(e)[0];return t===void 0?void 0:{type:"el",value:t}}function Oe(e,t){let n=fn(e);switch(t){case"margin":return n.marginBox;case"border":return n.borderBox;case"padding":return n.paddingBox;case"content":return n.contentBox;case"scroll":return n.scrollBox}}function ft(e,t,n,o){var u;let s=e[o];if(s===void 0)return;if(!((u=n.signal)===null||u===void 0)&&u.aborted)throw n.signal.reason;let f=o===e.length-1?mn(s.element,s.scrollParent,Object.assign({animator:t(e.length,o)},n)):mn(s.element,s.scrollParent,{animator:t(e.length,o),containerRatio:0,elementContent:"padding",elementRatio:0,signal:n.signal});return f!==void 0?f.then(()=>ft(e,t,n,o+1)):ft(e,t,n,o+1)}function dt(e,t,n,o){var u;let s=e[o];if(s===void 0)return;if(!((u=n.signal)===null||u===void 0)&&u.aborted)throw n.signal.reason;let f=o===e.length-1?gn(s.element,s.scrollParent,Object.assign({animator:t(e.length,o)},n)):gn(s.element,s.scrollParent,{animator:t(e.length,o),containerRatio:0,elementContent:"padding",elementRatio:0,signal:n.signal});return f!==void 0?f.then(()=>dt(e,t,n,o+1)):dt(e,t,n,o+1)}function no(e){let t=ae(e),n=t==null?void 0:t.getComputedStyle(e);return n!==void 0&&hn.indexOf(n.overflowY)>=0}function ro(e){let t=ae(e),n=t==null?void 0:t.getComputedStyle(e);return n!==void 0&&hn.indexOf(n.overflowX)>=0}function dn(e){return ie(Ae(st(e),no))}function pn(e){return ie(Ae(st(e),ro))}function oo(e){let t=[],n=e,o=dn(n);for(;o!==void 0;)t.push({element:n,scrollParent:o}),n=o,o=dn(n);return t.push({element:n,scrollParent:o}),t.reverse(),t}function io(e){let t=[],n=e,o=pn(n);for(;o!==void 0;)t.push({element:n,scrollParent:o}),n=o,o=pn(n);return t.push({element:n,scrollParent:o}),t.reverse(),t}function mn(e,t,n){var o,u,s,l;let f=n!=null?n:{},d=(o=f.containerRatio)!==null&&o!==void 0?o:0,p=(u=f.elementRatio)!==null&&u!==void 0?u:d,g=(s=f.animator)!==null&&s!==void 0?s:re(),b=f.signal,E=H(e)[0];if(E===void 0)return;let x=t!==void 0?xn(t):bn(E);if(x===void 0)return;if(!(x.type==="win"?x.value.document.contains(E):x.value.contains(E)))throw new Error("Scroll container must be a parent of the element to scroll");let O=x.type==="win"?{top:0,height:x.value.innerHeight}:Oe(x.value,"padding"),L=Oe(E,(l=f.elementContent)!==null&&l!==void 0?l:"padding"),C=+L.top-O.top-d*O.height+p*L.height;if(x.type==="win"){let v=x.value.document.documentElement,I=v.scrollTop,M=Math.round(z(v.scrollTop+C,0,v.scrollHeight));return I===M?void 0:g(N=>{v.scrollTop=I+N*(M-I)},b)}else{let v=x.value.scrollTop,I=Math.round(z(x.value.scrollTop+C,0,x.value.scrollHeight));return v===I?void 0:g(M=>{x.value.scrollTop=v+M*(I-v)},b)}}function gn(e,t,n){var o,u,s,l;let f=n!=null?n:{},d=(o=f.containerRatio)!==null&&o!==void 0?o:0,p=(u=f.elementRatio)!==null&&u!==void 0?u:d,g=(s=f.animator)!==null&&s!==void 0?s:re(),b=f.signal,E=H(e)[0];if(E===void 0)return;let x=t!==void 0?xn(t):bn(E);if(x===void 0)return;if(!(x.type==="win"?x.value.document.contains(E):x.value.contains(E)))throw new Error("Scroll container must be a parent of the element to scroll");let O=x.type==="win"?{left:0,width:x.value.innerWidth}:Oe(x.value,"padding"),L=Oe(E,(l=f.elementContent)!==null&&l!==void 0?l:"padding"),C=+L.left-O.left-d*O.width+p*L.width;if(x.type==="win"){let v=x.value.document.documentElement,I=v.scrollLeft,M=Math.round(z(v.scrollLeft+C,0,v.scrollWidth));return I===M?void 0:g(N=>{v.scrollLeft=I+N*(M-I)},b)}else{let v=x.value.scrollLeft,I=Math.round(z(x.value.scrollLeft+C,0,x.value.scrollWidth));return v===I?void 0:g(M=>{x.value.scrollLeft=v+M*(I-v)},b)}}function yn(e,t){var n,o,u;let s=t!=null?t:{},l=(n=s.scrollVertically)!==null&&n!==void 0?n:!0,f=(o=s.scrollHorizontally)!==null&&o!==void 0?o:!0,d=(u=s.animator)!==null&&u!==void 0?u:()=>re(),p=H(e)[0];if(p===void 0)return;let g=l?oo(p):[],b=f?io(p):[],E={containerRatio:s.containerRatio,elementContent:s.elementContent,elementRatio:s.elementRatio,signal:s.signal},x=ft(g,d,E,0),y=dt(b,d,E,0),O=[x,y].filter(me);return O.length>0?Promise.all(O).then(_e):void 0}var vn="de.xima.fc.plugin/fc-plugin-bundle-leitfaden",ao=e=>3*qe(e,2)-2*qe(e,3),uo=e=>()=>on(e,{interpolator:ao}),so="xfc-summary-create",co="xfc-summary-finalize",lo="xfc-summary-hide",fo="xfc-summary-submit";function pt(e,t){var n;if(t){let o=(n=e.closest(".CXPage"))!=null?n:void 0,u=o==null?void 0:o.getAttribute("data-xn");o instanceof HTMLElement&&R(u)&&(0,m.$)(o).is(":hidden")&&(0,m.gotoPage)(u)}yn(e,{animator:uo(400)})}function mt(){let e=[];return{awaitAll:()=>W(this,null,function*(){try{for(let t of yield nt(e))t.status==="rejected"&&console.error("Error while awaiting summary promise",t.reason)}catch(t){console.error("Error while awaiting summary promise",t)}}),queueAsync:t=>e.push(t.catch(n=>console.log("Error while awaiting summary promise",n)))}}function po(e){return W(this,null,function*(){for(let t of e){let n=mt(),o={form:t instanceof HTMLFormElement?t:document.createElement("form"),queueAsync:n.queueAsync},u=new CustomEvent(lo,{bubbles:!1,detail:o});document.dispatchEvent(u),yield n.awaitAll()}})}function En(e){return W(this,null,function*(){let t=(0,m.$)("FORM.xm-form");if(t.data("summary")!==!0)return;t.removeData("summary"),t.find(".summary-hidden-empty").removeClass("summary-hidden-empty"),t.find(".summary-hidden-after").removeClass("summary-hidden-after"),t.find(".xm-summary").removeClass("xm-summary"),t.find(".xm-summary-full-label").removeClass("xm-summary-full-label"),t.find(".xm-summary-value, .xm-summary-gotopage, .xm-summary-title").remove(),t.find(".xm-form-row").show();let n=e!=null?e:t.find(".CXPage").filter(":visible").get(0);t.find(".CXPage").hide(),Nn(t),yield po(t),n!==void 0&&pt(n,!0)})}function Nn(e){e.find(".xm-summary-readonly").removeClass("xm-summary-readonly").prop("disabled",!1)}function mo(e){if(e.target instanceof HTMLElement){let t=(0,m.$)(e.target).closest("form").addBack("form");Nn(t);let n={form:t instanceof HTMLFormElement?t:document.createElement("form")},o=new CustomEvent(fo,{bubbles:!1,detail:n});document.dispatchEvent(o)}}function go(e){for(let t of e.find(".XAppointment")){let n=V((0,m.$)(t).val());if(ze(n)){(0,m.$)(t).getContainer().addClass("summary-hidden-empty");continue}(0,m.$)(t).closest(".hasDatepicker").after((0,m.$)("<span>",{class:"xm-summary-value",text:n}))}}function ho(e){return W(this,null,function*(){for(let t of e){let n=mt(),o={container:t,queueAsync:n.queueAsync},u=new CustomEvent(so,{bubbles:!1,detail:o});document.dispatchEvent(u),yield n.awaitAll()}})}function bo(e){for(let t of e.find(".XTextField, .XTextArea, .XDropDown, .XList")){let o=(0,m.$)(t).find("option").length>0?(0,m.$)(t).find(':selected[value!=""]').text():V((0,m.$)(t).val());if(!((0,m.$)(t).attr("data-xm-cob2auto")==="0"&&t.tagName==="INPUT")){if(ze(o)){(0,m.$)(t).getContainer().addClass("summary-hidden-empty");continue}(0,m.$)(t).after((0,m.$)("<span>",{class:"xm-summary-value",text:o}))}}}function xo(e){var t,n,o,u,s,l,f;for(let d of e.find(".XUpload")){let p=(0,m.$)(d).closest(".xm-upl-input-wrapper").parent(),g=(f=(l=(n=(t=Me(d,HTMLInputElement))==null?void 0:t.files)==null?void 0:n.item(0))!=null?l:(s=(u=(o=m.$.xutil)==null?void 0:o.ajaxUploadManager)==null?void 0:u.getUpload)==null?void 0:s.call(u,d))!=null?f:void 0,b=K(g==null?void 0:g.name,p.find(".XUploadLink").text(),p.find(".XImagePreview").attr("alt"));R(b)?(0,m.$)(d).after((0,m.$)("<span>",{class:"xm-summary-value",text:b})):(0,m.$)(d).getContainer().addClass("summary-hidden-empty")}}function yo(e){for(let n of e.find(".opt-div")){if((0,m.$)("input:checked",n).length===0){(0,m.$)(n).addClass("summary-hidden-empty");continue}let o=(0,m.$)(n).find("label").not(".label-icon-checkbox,.label-icon-radio");(0,m.$)(n).after((0,m.$)("<span>",{class:"xm-summary-value xm-summary-html",html:o.html()}))}let t=e.find(".opt-div").toArray().map(n=>(0,m.$)(n).getContainer().get(0)).filter(me).filter(n=>(0,m.$)(n).find(".xm-summary-value").length===0);for(let n of t)n.classList.add("summary-hidden-empty")}function vo(e){for(let t of e.find(".XQuestTable")){let n=(0,m.$)(t);if(n.find(".XTableCheckbox,.XTableRadio").find("input:checked").length>0){let u=n.clone(!1,!1),s=(0,m.$)(document.createElement("span")).text("\u2713"),l=(0,m.$)(document.createElement("span")).text("\xD7");u.find(".XTableCheckbox input:checked").parent().find("label").replaceWith(s),u.find(".XTableRadio input:checked").parent().find("label").replaceWith(l),u.find(".XTableCheckbox input:not(:checked)").parent().find("label").remove(),u.find(".XTableRadio input:not(:checked)").parent().find("label").remove(),u.find(".XTableCheckbox input").remove(),u.find(".XTableRadio input").remove(),u.removeClass("XQuestTable"),u.addClass("xm-summary-value xm-summary-table"),u.removeClass("validate-change"),u.find(".XValueItem").removeClass("XValueItem").removeClass("XTableCheckbox").removeClass("XTableRadio"),n.after(u)}}}function Eo(e){for(let t of e.find(".CXCheckbox")){if((0,m.$)("input:checked",t).length<=0)continue;let o=(0,m.$)(t).find("label").not(".label-icon-checkbox").html();(0,m.$)(t).append((0,m.$)("<span>",{class:"xm-summary-value",html:o}))}}function No(e){let t=Q(X),n=e.find(".XHeader h1").length>0?"h2":"h1",o=(0,m.$)(document.createElement(n)).text(t.summaryHeader),u=(0,m.$)(document.createElement("div")).addClass("xm-item-div label-none xm-summary-title").append(o);e.find(".XHeader").append(u)}function wo(e){for(let t of e.find("DIV.XSelect.left-top.XRadio, DIV.XSelect.left-top.XCheckbox, .label-top+table.XQuestTable"))(0,m.$)(t).parent().find("Label:first").addClass("xm-summary-full-label")}function So(e){return W(this,null,function*(){for(let t of e){let n=mt(),o={form:t instanceof HTMLFormElement?t:document.createElement("form"),queueAsync:n.queueAsync},u=new CustomEvent(co,{bubbles:!1,detail:o});document.dispatchEvent(u),yield n.awaitAll()}})}function ye(e){return W(this,null,function*(){var d;let n=(0,m.$)(e).parents(".CXPage"),o=(0,m.$)("[cn=XPage],[data-cn=XPage],[cn=XHeader],[data-cn=XHeader],[cn=XFooter],[data-cn=XFooter]"),u=!1,s=(0,m.$)("FORM.xm-form");if(s.data("summary")===!0){o.each((p,g)=>{let b=(0,m.$)(".XPage, .XHeader, .XFooter",g);u?b.parent().show():b.attr("not-summary")!=="true"&&!b.hasClass("xm-not-summary")&&o.index(n)===p&&(u=!0)});return}let l=Q(X);if(!(0,m.$)(".XPage:visible").validate()){(0,m.$)("Textarea, Input, Select",(0,m.$)(".error").first()).first().trigger("focus");let p=(0,m.$)(".xm-error-container").filter(":visible").get(0);p!==void 0&&pt(p,!1);return}for(let[p,g]of Jt(o)){let b=(0,m.$)(".XPage, .XHeader, .XFooter",p),E=b.attr("data-show-on-summary")!=="0";if(E&&u){b.parent().show();for(let x of(0,m.$)('[data-show-on-summary="0"]'))(0,m.$)(x).getContainer().addClass("summary-hidden-after")}else if(E&&b.attr("not-summary")!=="true"&&!b.hasClass("xm-not-summary")){b.parent().addClass("xm-summary"),bo(b),xo(b),yo(b),vo(b),Eo(b),go(b),yield ho(b);for(let x of(0,m.$)('[data-show-on-summary="0"]'))(0,m.$)(x).getContainer().addClass("summary-hidden-empty");for(let x of b.find(".XContainer, .XFieldSet")){let y=(0,m.$)(x);y.hasClass("XContainerInvisible")?y.children(":visible").length===0&&y.getContainer().addClass("summary-hidden-empty"):y.find(".xm-summary-value:visible, .xm-upl-label:visible").length===0&&y.getContainer().addClass("summary-hidden-empty")}b.children(":visible").length===0&&b.getContainer().addClass("summary-hidden-empty");for(let x of b.find(".XFieldSet LEGEND")){let y=document.createElement("a");y.classList.add("xm-summary-gotopage"),y.href="javascript:void 0",y.textContent=l.xmSummaryGotoPageLink,y.addEventListener("click",()=>En(x)),(0,m.$)(x).after(y)}}o.index(n)===g&&(u=!0)}No(s),wo(s),yield So(s),s.data("summary",!0),s.attr("data-summary-target",(d=n.attr("data-xn"))!=null?d:""),(0,m.$)(".xm-form-row").each((p,g)=>{(0,m.$)(g).visible((0,m.$)(".xm-summary-value:visible",g).length>0||(0,m.$)("[data-show-on-summary=1]",g).not(".summary-hidden-empty").length>0)});let f=s.find(".CXHeader").get(0);f!==void 0&&pt(f,!1)})}function To(){for(let e of(0,m.$)(".XButton[data-target-page='xleitfaden_summary']")){let t=(0,m.$)(e);t.addClass("xm-leitfaden-button-summary"),t.attr("data-custom-action","xm-leitfaden-summary"),t.removeAttr("data-target-page")}}function Ao(e){if(!Ht((0,m.$)(e.form).data("summary")))return{navigationState:void 0};let t=e.form.dataset.summaryTarget;return Lt(t)?{navigationState:void 0}:{navigationState:{id:vn,pageTarget:t}}}function _o(e){var n,o,u;let t=e.navigationState.map(s=>he(s)).filter(s=>s.id===vn)[0];if(t!==void 0){let s=V(t.pageTarget),l=(u=(o=e.form.querySelector(`.CXPage[data-xn="${CSS.escape(s)}"] .XPage`))!=null?o:(n=e.form.querySelector(".CXPage .XPage"))==null?void 0:n.lastChild)!=null?u:null;l instanceof HTMLElement&&ye(l)}return{}}function wn(){To(),(0,m.$)(".xm-leitfaden-button-summary").on("click",e=>ye(e.target)),(0,m.$)(".xm-form").on("submit",mo).validate(!0),(0,m.$)(".CXPage").on("onshow",()=>En(void 0)),m.$.xutil.on("saveNavigation",Ao),m.$.xutil.on("loadNavigation",_o)}var D=P(F());function Sn(e,t){let n={};return(e||[]).forEach(o=>{let u=t(o);n[u]||(n[u]=[]),n[u].push(o)}),n}function Io(e){return Object.keys(e).map(t=>[t,e[t]])}function Mo(e){return typeof e=="number"&&!isNaN(e)}function Co(e,t){return(e||[]).reduce((n,o)=>n&&t(o),!0)}function Bo(e){return e}function Do(e){e=e||[];let t=e.length-1;return t>=0?e[t]:null}function Oo(e,t=!1,n=!1){e=String(e);let o=e.split("");if(e.length!==11||e[0]==="0")return!1;let u=o.map(p=>parseInt(p,10));if(!Co(u,Mo))return!1;let s=u.slice(0,10),l=Io(Sn(s,Bo)),f=Sn(l,p=>p[1].length),d=!1;if((!t&&l.length===9&&f[2]&&f[2].length===1&&f[1]&&f[1].length===8||!n&&l.length===8&&f[3]&&f[3].length===1&&f[1]&&f[1].length===7)&&(d=!0),d){let p=0,g=10;for(let E=0;E<=9;E++)p=(s[E]+g)%10,p===0&&(p=10),g=p*2%11;let b=11-g;if(b===10&&(b=0),b===Do(u))return!0}return!1}var Tn={validate:Oo};var r;(function(e){e.AD="AD",e.AE="AE",e.AF="AF",e.AG="AG",e.AI="AI",e.AL="AL",e.AM="AM",e.AO="AO",e.AQ="AQ",e.AR="AR",e.AS="AS",e.AT="AT",e.AU="AU",e.AW="AW",e.AX="AX",e.AZ="AZ",e.BA="BA",e.BB="BB",e.BD="BD",e.BE="BE",e.BF="BF",e.BG="BG",e.BH="BH",e.BI="BI",e.BJ="BJ",e.BL="BL",e.BM="BM",e.BN="BN",e.BO="BO",e.BQ="BQ",e.BR="BR",e.BS="BS",e.BT="BT",e.BV="BV",e.BW="BW",e.BY="BY",e.BZ="BZ",e.CA="CA",e.CC="CC",e.CD="CD",e.CF="CF",e.CG="CG",e.CH="CH",e.CI="CI",e.CK="CK",e.CL="CL",e.CM="CM",e.CN="CN",e.CO="CO",e.CR="CR",e.CU="CU",e.CV="CV",e.CW="CW",e.CX="CX",e.CY="CY",e.CZ="CZ",e.DE="DE",e.DJ="DJ",e.DK="DK",e.DM="DM",e.DO="DO",e.DZ="DZ",e.EC="EC",e.EE="EE",e.EG="EG",e.EH="EH",e.ER="ER",e.ES="ES",e.ET="ET",e.FI="FI",e.FJ="FJ",e.FK="FK",e.FM="FM",e.FO="FO",e.FR="FR",e.GA="GA",e.GB="GB",e.GD="GD",e.GE="GE",e.GF="GF",e.GG="GG",e.GH="GH",e.GI="GI",e.GL="GL",e.GM="GM",e.GN="GN",e.GP="GP",e.GQ="GQ",e.GR="GR",e.GS="GS",e.GT="GT",e.GU="GU",e.GW="GW",e.GY="GY",e.HK="HK",e.HM="HM",e.HN="HN",e.HR="HR",e.HT="HT",e.HU="HU",e.ID="ID",e.IE="IE",e.IL="IL",e.IM="IM",e.IN="IN",e.IO="IO",e.IQ="IQ",e.IR="IR",e.IS="IS",e.IT="IT",e.JE="JE",e.JM="JM",e.JO="JO",e.JP="JP",e.KE="KE",e.KG="KG",e.KH="KH",e.KI="KI",e.KM="KM",e.KN="KN",e.KP="KP",e.KR="KR",e.KW="KW",e.KY="KY",e.KZ="KZ",e.LA="LA",e.LB="LB",e.LC="LC",e.LI="LI",e.LK="LK",e.LR="LR",e.LS="LS",e.LT="LT",e.LU="LU",e.LV="LV",e.LY="LY",e.MA="MA",e.MC="MC",e.MD="MD",e.ME="ME",e.MF="MF",e.MG="MG",e.MH="MH",e.MK="MK",e.ML="ML",e.MM="MM",e.MN="MN",e.MO="MO",e.MP="MP",e.MQ="MQ",e.MR="MR",e.MS="MS",e.MT="MT",e.MU="MU",e.MV="MV",e.MW="MW",e.MX="MX",e.MY="MY",e.MZ="MZ",e.NA="NA",e.NC="NC",e.NE="NE",e.NF="NF",e.NG="NG",e.NI="NI",e.NL="NL",e.NO="NO",e.NP="NP",e.NR="NR",e.NU="NU",e.NZ="NZ",e.OM="OM",e.PA="PA",e.PE="PE",e.PF="PF",e.PG="PG",e.PH="PH",e.PK="PK",e.PL="PL",e.PM="PM",e.PN="PN",e.PR="PR",e.PS="PS",e.PT="PT",e.PW="PW",e.PY="PY",e.QA="QA",e.RE="RE",e.RO="RO",e.RS="RS",e.RU="RU",e.RW="RW",e.SA="SA",e.SB="SB",e.SC="SC",e.SD="SD",e.SE="SE",e.SG="SG",e.SH="SH",e.SI="SI",e.SJ="SJ",e.SK="SK",e.SL="SL",e.SM="SM",e.SN="SN",e.SO="SO",e.SR="SR",e.SS="SS",e.ST="ST",e.SV="SV",e.SX="SX",e.SY="SY",e.SZ="SZ",e.TC="TC",e.TD="TD",e.TF="TF",e.TG="TG",e.TH="TH",e.TJ="TJ",e.TK="TK",e.TL="TL",e.TM="TM",e.TN="TN",e.TO="TO",e.TR="TR",e.TT="TT",e.TV="TV",e.TW="TW",e.TZ="TZ",e.UA="UA",e.UG="UG",e.UM="UM",e.US="US",e.UY="UY",e.UZ="UZ",e.VA="VA",e.VC="VC",e.VE="VE",e.VG="VG",e.VI="VI",e.VN="VN",e.VU="VU",e.WF="WF",e.WS="WS",e.XK="XK",e.YE="YE",e.YT="YT",e.ZA="ZA",e.ZM="ZM",e.ZW="ZW"})(r||(r={}));var An={[r.AD]:["Andorra","AND"],[r.AE]:["United Arab Emirates","ARE"],[r.AF]:["Afghanistan","AFG"],[r.AG]:["Antigua and Barbuda","ATG"],[r.AI]:["Anguilla","AIA"],[r.AL]:["Albania","ALB"],[r.AM]:["Armenia","ARM"],[r.AO]:["Angola","AGO"],[r.AQ]:["Antarctica","ATA"],[r.AR]:["Argentina","ARG"],[r.AS]:["American Samoa","ASM"],[r.AT]:["Austria","AUT"],[r.AU]:["Australia","AUS"],[r.AW]:["Aruba","ABW"],[r.AX]:["\u212Bland Islands","ALA"],[r.AZ]:["Azerbaijan","AZE"],[r.BA]:["Bosnia and Herzegovina","BIH"],[r.BB]:["Barbados","BRB"],[r.BD]:["Bangladesh","BGD"],[r.BE]:["Belgium","BEL"],[r.BF]:["Burkina Faso","BFA"],[r.BG]:["Bulgaria","BGR"],[r.BH]:["Bahrain","BHR"],[r.BI]:["Burundi","BDI"],[r.BJ]:["Benin","BEN"],[r.BL]:["Saint Barth\xE9lemy","BLM"],[r.BM]:["Bermuda","BMU"],[r.BN]:["Brunei Darussalam","BRN"],[r.BO]:["Plurinational State of Bolivia","BOL"],[r.BQ]:["Bonaire, Sint Eustatius and Saba","BES"],[r.BR]:["Brazil","BRA"],[r.BS]:["Bahamas","BHS"],[r.BT]:["Bhutan","BTN"],[r.BV]:["Bouvet Island","BVT"],[r.BW]:["Botswana","BWA"],[r.BY]:["Belarus","BLR"],[r.BZ]:["Belize","BLZ"],[r.CA]:["Canada","CAN"],[r.CC]:["Cocos Islands","CCK"],[r.CD]:["The Democratic Republic of the Congo","COD"],[r.CF]:["Central African Republic","CAF"],[r.CG]:["Congo","COG"],[r.CH]:["Switzerland","CHE"],[r.CI]:["C\xF4te d'Ivoire","CIV"],[r.CK]:["Cook Islands","COK"],[r.CL]:["Chile","CHL"],[r.CM]:["Cameroon","CMR"],[r.CN]:["China","CHN"],[r.CO]:["Colombia","COL"],[r.CR]:["Costa Rica","CRI"],[r.CU]:["Cuba","CUB"],[r.CV]:["Cape Verde","CPV"],[r.CW]:["Cura\xE7ao","CUW"],[r.CX]:["Christmas Island","CXR"],[r.CY]:["Cyprus","CYP"],[r.CZ]:["Czech Republic","CZE"],[r.DE]:["Germany","DEU"],[r.DJ]:["Djibouti","DJI"],[r.DK]:["Denmark","DNK"],[r.DM]:["Dominica","DMA"],[r.DO]:["Dominican Republic","DOM"],[r.DZ]:["Algeria","DZA"],[r.EC]:["Ecuador","ECU"],[r.EE]:["Estonia","EST"],[r.EG]:["Egypt","EGY"],[r.EH]:["Western Sahara","ESH"],[r.ER]:["Eritrea","ERI"],[r.ES]:["Spain","ESP"],[r.ET]:["Ethiopia","ETH"],[r.FI]:["Finland","FIN"],[r.FJ]:["Fiji","FJI"],[r.FK]:["Falkland Islands","FLK"],[r.FM]:["Federated States of Micronesia","FSM"],[r.FO]:["Faroe Islands","FRO"],[r.FR]:["France","FRA"],[r.GA]:["Gabon","GAB"],[r.GB]:["United Kingdom","GBR"],[r.GD]:["Grenada","GRD"],[r.GE]:["Georgia","GEO"],[r.GF]:["French Guiana","GUF"],[r.GG]:["Guemsey","GGY"],[r.GH]:["Ghana","GHA"],[r.GI]:["Gibraltar","GIB"],[r.GL]:["Greenland","GRL"],[r.GM]:["Gambia","GMB"],[r.GN]:["Guinea","GIN"],[r.GP]:["Guadeloupe","GLP"],[r.GQ]:["Equatorial Guinea","GNQ"],[r.GR]:["Greece","GRC"],[r.GS]:["South Georgia and the South Sandwich Islands","SGS"],[r.GT]:["Guatemala","GTM"],[r.GU]:["Guam","GUM"],[r.GW]:["Guinea-Bissau","GNB"],[r.GY]:["Guyana","GUY"],[r.HK]:["Hong Kong","HKG"],[r.HM]:["Heard Island and McDonald Islands","HMD"],[r.HN]:["Honduras","HND"],[r.HR]:["Croatia","HRV"],[r.HT]:["Haiti","HTI"],[r.HU]:["Hungary","HUN"],[r.ID]:["Indonesia","IDN"],[r.IE]:["Ireland","IRL"],[r.IL]:["Israel","ISR"],[r.IM]:["Isle of Man","IMN"],[r.IN]:["India","IND"],[r.IO]:["British Indian Ocean Territory","IOT"],[r.IQ]:["Iraq","IRQ"],[r.IR]:["Islamic Republic of Iran","IRN"],[r.IS]:["Iceland","ISL"],[r.IT]:["Italy","ITA"],[r.JE]:["Jersey","JEY"],[r.JM]:["Jamaica","JAM"],[r.JO]:["Jordan","JOR"],[r.JP]:["Japan","JPN"],[r.KE]:["Kenya","KEN"],[r.KG]:["Kyrgyzstan","KGZ"],[r.KH]:["Cambodia","KHM"],[r.KI]:["Kiribati","KIR"],[r.KM]:["Comoros","COM"],[r.KN]:["Saint Kitts and Nevis","KNA"],[r.KP]:["Democratic People's Republic of Korea","PRK"],[r.KR]:["Republic of Korea","KOR"],[r.KW]:["Kuwait","KWT"],[r.KY]:["Cayman Islands","CYM"],[r.KZ]:["Kazakhstan","KAZ"],[r.LA]:["Lao People's Democratic Republic","LAO"],[r.LB]:["Lebanon","LBN"],[r.LC]:["Saint Lucia","LCA"],[r.LI]:["Liechtenstein","LIE"],[r.LK]:["Sri Lanka","LKA"],[r.LR]:["Liberia","LBR"],[r.LS]:["Lesotho","LSO"],[r.LT]:["Lithuania","LTU"],[r.LU]:["Luxembourg","LUX"],[r.LV]:["Latvia","LVA"],[r.LY]:["Libya","LBY"],[r.MA]:["Morocco","MAR"],[r.MC]:["Monaco","MCO"],[r.MD]:["Republic of Moldova","MDA"],[r.ME]:["Montenegro","MNE"],[r.MF]:["Saint Martin","MAF"],[r.MG]:["Madagascar","MDG"],[r.MH]:["Marshall Islands","MHL"],[r.MK]:["The former Yugoslav Republic of Macedonia","MKD"],[r.ML]:["Mali","MLI"],[r.MM]:["Myanmar","MMR"],[r.MN]:["Mongolia","MNG"],[r.MO]:["Macao","MAC"],[r.MP]:["Northern Mariana Islands","MNP"],[r.MQ]:["Martinique","MTQ"],[r.MR]:["Mauritania","MRT"],[r.MS]:["Montserrat","MSR"],[r.MT]:["Malta","MLT"],[r.MU]:["Mauritius","MUS"],[r.MV]:["Maldives","MDV"],[r.MW]:["Malawi","MWI"],[r.MX]:["Mexico","MEX"],[r.MY]:["Malaysia","MYS"],[r.MZ]:["Mozambique","MOZ"],[r.NA]:["Namibia","NAM"],[r.NC]:["New Caledonia","NCL"],[r.NE]:["Niger","NER"],[r.NF]:["Norfolk Island","NFK"],[r.NG]:["Nigeria","NGA"],[r.NI]:["Nicaragua","NIC"],[r.NL]:["Netherlands","NLD"],[r.NO]:["Norway","NOR"],[r.NP]:["Nepal","NPL"],[r.NR]:["Nauru","NRU"],[r.NU]:["Niue","NIU"],[r.NZ]:["New Zealand","NZL"],[r.OM]:["Oman","OMN"],[r.PA]:["Panama","PAN"],[r.PE]:["Peru","PER"],[r.PF]:["French Polynesia","PYF"],[r.PG]:["Papua New Guinea","PNG"],[r.PH]:["Philippines","PHL"],[r.PK]:["Pakistan","PAK"],[r.PL]:["Poland","POL"],[r.PM]:["Saint Pierre and Miquelon","SPM"],[r.PN]:["Pitcairn","PCN"],[r.PR]:["Puerto Rico","PRI"],[r.PS]:["Occupied Palestinian Territory","PSE"],[r.PT]:["Portugal","PRT"],[r.PW]:["Palau","PLW"],[r.PY]:["Paraguay","PRY"],[r.QA]:["Qatar","QAT"],[r.RE]:["R\xE9union","REU"],[r.RO]:["Romania","ROU"],[r.RS]:["Serbia","SRB"],[r.RU]:["Russian Federation","RUS"],[r.RW]:["Rwanda","RWA"],[r.SA]:["Saudi Arabia","SAU"],[r.SB]:["Solomon Islands","SLB"],[r.SC]:["Seychelles","SYC"],[r.SD]:["Sudan","SDN"],[r.SE]:["Sweden","SWE"],[r.SG]:["Singapore","SGP"],[r.SH]:["Saint Helena, Ascension and Tristan da Cunha","SHN"],[r.SI]:["Slovenia","SVN"],[r.SJ]:["Svalbard and Jan Mayen","SJM"],[r.SK]:["Slovakia","SVK"],[r.SL]:["Sierra Leone","SLE"],[r.SM]:["San Marino","SMR"],[r.SN]:["Senegal","SEN"],[r.SO]:["Somalia","SOM"],[r.SR]:["Suriname","SUR"],[r.SS]:["South Sudan","SSD"],[r.ST]:["Sao Tome and Principe","STP"],[r.SV]:["El Salvador","SLV"],[r.SX]:["Sint Maarten","SXM"],[r.SY]:["Syrian Arab Republic","SYR"],[r.SZ]:["Swaziland","SWZ"],[r.TC]:["Turks and Caicos Islands","TCA"],[r.TD]:["Chad","TCD"],[r.TF]:["French Southern Territories","ATF"],[r.TG]:["Togo","TGO"],[r.TH]:["Thailand","THA"],[r.TJ]:["Tajikistan","TJK"],[r.TK]:["Tokelau","TKL"],[r.TL]:["Timor-Leste","TLS"],[r.TM]:["Turkmenistan","TKM"],[r.TN]:["Tunisia","TUN"],[r.TO]:["Tonga","TON"],[r.TR]:["Turkey","TUR"],[r.TT]:["Trinidad and Tobago","TTO"],[r.TV]:["Tuvalu","TUV"],[r.TW]:["Taiwan, Province of China","TWN"],[r.TZ]:["United Republic of Tanzania","TZA"],[r.UA]:["Ukraine","UKR"],[r.UG]:["Uganda","UGA"],[r.UM]:["United States Minor Outlying Islands","UMI"],[r.US]:["United States","USA"],[r.UY]:["Uruguay","URY"],[r.UZ]:["Uzbekistan","UZB"],[r.VA]:["Holy See","VAT"],[r.VC]:["Saint Vincent and the Grenadines","VCT"],[r.VE]:["Bolivarian Republic of Venezuela","VEN"],[r.VG]:["British Virgin Islands","VGB"],[r.VI]:["Virgin Islands, U.S.","VIR"],[r.VN]:["Viet Nam","VNM"],[r.VU]:["Vanuatu","VUT"],[r.WF]:["Wallis and Futuna","WLF"],[r.WS]:["Samoa","WSM"],[r.XK]:["Kosovo","UNK"],[r.YE]:["Yemen","YEM"],[r.YT]:["Mayotte","MYT"],[r.ZA]:["South Africa","ZAF"],[r.ZM]:["Zambia","ZMB"],[r.ZW]:["Zimbabwe","ZWE"]},Ro=Object.entries(An).reduce((e,[t,n])=>(e[t]=[t,n],e),{}),Lo=Object.entries(An).reduce((e,[t,n])=>(e[n[1]]=[t,n],e),{});function Z(e){if(e===null)return null;let t;return e.length===3?t=Lo[e]:e.length===2&&(t=Ro[e]),t?t[0]:null}function Re(e,t=0){return Math.floor(Math.random()*e)+t}var h;(function(e){e[e.BANK_CODE=0]="BANK_CODE",e[e.BRANCH_CODE=1]="BRANCH_CODE",e[e.ACCOUNT_NUMBER=2]="ACCOUNT_NUMBER",e[e.BRANCH_CHECK_DIGIT=3]="BRANCH_CHECK_DIGIT",e[e.NATIONAL_CHECK_DIGIT=4]="NATIONAL_CHECK_DIGIT",e[e.CURRENCY_TYPE=5]="CURRENCY_TYPE",e[e.ACCOUNT_TYPE=6]="ACCOUNT_TYPE",e[e.OWNER_ACCOUNT_NUMBER=7]="OWNER_ACCOUNT_NUMBER",e[e.IDENTIFICATION_NUMBER=8]="IDENTIFICATION_NUMBER"})(h||(h={}));var i;(function(e){e[e.n=0]="n",e[e.a=1]="a",e[e.c=2]="c",e[e.e=3]="e"})(i||(i={}));var ko={[i.n]:"0123456789",[i.a]:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",[i.c]:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",[i.e]:" "},Uo={[i.n]:/^[0-9]+$/,[i.a]:/^[A-Z]+$/,[i.c]:/^[0-9A-Za-z]+$/,[i.e]:/^ +$/},a=class e{constructor(t,n,o,u,s){this.entryType=t,this.characterType=n,this.length=o,this.generate=s||this.defaultGenerator,this.hasGenerator=!!s,this.trailingSeparator=u}static bankCode(t,n,o=!0){return new e(h.BANK_CODE,n,t,o)}static branchCode(t,n,o=!0){return new e(h.BRANCH_CODE,n,t,o)}static accountNumber(t,n,o=!0){return new e(h.ACCOUNT_NUMBER,n,t,o)}static nationalCheckDigit(t,n,o,u=!1){return new e(h.NATIONAL_CHECK_DIGIT,n,t,u,o)}static branchCheckDigit(t,n,o,u=!1){return new e(h.BRANCH_CHECK_DIGIT,n,t,u,o)}static accountType(t,n,o=!1){return new e(h.ACCOUNT_TYPE,n,t,o)}static currencyType(t,n,o=!1){return new e(h.CURRENCY_TYPE,n,t,o)}static ownerAccountNumber(t,n,o=!0){return new e(h.OWNER_ACCOUNT_NUMBER,n,t,o)}static identificationNumber(t,n,o=!0){return new e(h.IDENTIFICATION_NUMBER,n,t,o)}getPartType(){return this.entryType}getCharacterType(){return this.characterType}getLength(){return this.length}validate(t){return Uo[this.characterType].test(t)}defaultGenerator(t,n){let o=ko[this.characterType],u=[];for(let s=0;s<this.getLength();s+=1)u.push(o[Re(o.length)]);return u.join("")}};var T;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_NULL=1]="NOT_NULL",e[e.NOT_EMPTY=2]="NOT_EMPTY",e[e.BIC_LENGTH_8_OR_11=3]="BIC_LENGTH_8_OR_11",e[e.BIC_ONLY_UPPER_CASE_LETTERS=4]="BIC_ONLY_UPPER_CASE_LETTERS",e[e.BRANCH_CODE_ONLY_LETTERS_OR_DIGITS=5]="BRANCH_CODE_ONLY_LETTERS_OR_DIGITS",e[e.LOCATION_CODE_ONLY_LETTERS_OR_DIGITS=6]="LOCATION_CODE_ONLY_LETTERS_OR_DIGITS",e[e.BANK_CODE_ONLY_LETTERS=7]="BANK_CODE_ONLY_LETTERS",e[e.COUNTRY_CODE_TWO_LETTERS=8]="COUNTRY_CODE_TWO_LETTERS",e[e.COUNTRY_CODE_ONLY_UPPER_CASE_LETTERS=9]="COUNTRY_CODE_ONLY_UPPER_CASE_LETTERS",e[e.COUNTRY_CODE_EXISTS=10]="COUNTRY_CODE_EXISTS",e[e.NATIONAL_CHECK_DIGIT=11]="NATIONAL_CHECK_DIGIT",e[e.CHECK_DIGIT_TWO_DIGITS=12]="CHECK_DIGIT_TWO_DIGITS",e[e.CHECK_DIGIT_ONLY_DIGITS=13]="CHECK_DIGIT_ONLY_DIGITS",e[e.BBAN_LENGTH=14]="BBAN_LENGTH",e[e.BBAN_ONLY_UPPER_CASE_LETTERS=15]="BBAN_ONLY_UPPER_CASE_LETTERS",e[e.BBAN_ONLY_DIGITS_OR_LETTERS=16]="BBAN_ONLY_DIGITS_OR_LETTERS",e[e.BBAN_ONLY_DIGITS=17]="BBAN_ONLY_DIGITS",e[e.IBAN_VALID_CHARACTERS=18]="IBAN_VALID_CHARACTERS",e[e.COUNTRY_CODE_NOT_NULL=19]="COUNTRY_CODE_NOT_NULL",e[e.BANK_CODE_NOT_NULL=20]="BANK_CODE_NOT_NULL",e[e.ACCOUNT_NUMBER_NOT_NULL=21]="ACCOUNT_NUMBER_NOT_NULL"})(T||(T={}));var A=class e extends Error{constructor(t,n,o,u){super(n),this.formatViolation=t,this.expected=o,this.actual=u,Object.setPrototypeOf(this,e.prototype)}},j=class e extends Error{constructor(t,n){super(t),this.actual=n,Object.setPrototypeOf(this,e.prototype)}},Le=class e extends Error{constructor(t,n,o){super(t),this.expected=n,this.actual=o,Object.setPrototypeOf(this,e.prototype)}},ke=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function gt(e,t){return(11-e.split("").reduce((n,o,u)=>n+parseInt(o,10)*t[u%t.length],0)%11)%11}function Po(e,t){let n=[1,2,4,8,5,10,9,7,3,6],o=[h.BANK_CODE,h.BRANCH_CODE].map(f=>t.extractValueMust(e,f)).join("");function u(f){return f===10?1:f===11?0:f}let s=u(gt(`00${o}`,n)),l=u(gt(t.extractValueMust(e,h.ACCOUNT_NUMBER),n));return`${s}${l}`}function ht(e,t){let n={"[AJ]":"1","[BKS]":"2","[CLT]":"3","[DMU]":"4","[ENV]":"5","[FOW]":"6","[GPX]":"7","[HQY]":"8","[IRZ]":"9"},o=[h.BANK_CODE,h.BRANCH_CODE,h.ACCOUNT_NUMBER].map(s=>String(t.extractValue(e,s))).join("")+"00";Object.entries(n).map(([s,l])=>o=o.replace(new RegExp(s,"g"),l));let u=97-o.split("").reduce((s,l)=>(s*10+parseInt(l))%97,0);return String(u).padStart(2,"0")}function _n(e,t){let n=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],o=[1,0,5,7,9,13,15,17,19,21,2,4,18,20,11,3,6,8,12,14,16,10,22,25,24,23],u=48,s=57,l=65,f=[h.BANK_CODE,h.BRANCH_CODE,h.ACCOUNT_NUMBER].map(d=>t.extractValueMust(e,d)).join("").split("").map(d=>d.toUpperCase().charCodeAt(0)).map(d=>d-(u<=d&&d<=s?u:l)).reduce((d,p,g)=>d+(g%2===0?o[p]:n[p]),0)%26;return String.fromCharCode(l+f)}function Fo(e,t){let n=[h.BANK_CODE,h.ACCOUNT_NUMBER].map(o=>t.extractValueMust(e,o)).join("");return String(gt(n,[5,4,3,2,7,6,5,4,3,2])%10)}function Go(e,t){let o=[73,17,89,38,62,45,53,15,50,5,49,34,81,76,27,90,9,30,3],u=[h.BANK_CODE,h.BRANCH_CODE,h.ACCOUNT_NUMBER].map(s=>t.extractValueMust(e,s)).join("").split("").map(s=>s.charCodeAt(0)).reduce((s,l,f)=>(s+(l-48)*o[f])%97,0);return String(98-u).padStart(2,"0")}var c=class{constructor(...t){this.entries=t}getParts(){return this.entries}validate(t){this.validateBbanLength(t),this.validateBbanEntries(t)}extractValue(t,n){let o=0,u=null;for(let s of this.getParts()){let l=s.getLength(),f=t.substring(o,o+l);o=o+l,s.getPartType()==n&&(u=(u||"")+f)}return u}extractValueMust(t,n){let o=this.extractValue(t,n);if(o===null)throw new ke(`Required part type [${n}] missing`);return o}static forCountry(t){return t&&this.structures[t]||null}static getEntries(){return Object.values(this.structures)}static supportedCountries(){return Object.keys(this.structures)}getBbanLength(){return this.entries.reduce((t,n)=>t+n.getLength(),0)}validateBbanLength(t){let n=this.getBbanLength(),o=t.length;if(n!=o)throw new A(T.BBAN_LENGTH,`[${t}] length is ${o}, expected BBAN length is: ${n}`,String(o),String(n))}validateBbanEntries(t){let n=0;for(let o of this.getParts()){let u=o.getLength(),s=t.substring(n,n+u);n=n+u,this.validateBbanEntryCharacterType(t,o,s)}}validateBbanEntryCharacterType(t,n,o){if(!n.validate(o))switch(n.getCharacterType()){case i.a:throw new A(T.BBAN_ONLY_UPPER_CASE_LETTERS,`[${o}] must contain only upper case letters.`,o);case i.c:throw new A(T.BBAN_ONLY_DIGITS_OR_LETTERS,`[${o}] must contain only digits or letters.`,o);case i.n:throw new A(T.BBAN_ONLY_DIGITS,`[${o}] must contain only digits.`,o)}if(n.getPartType()===h.NATIONAL_CHECK_DIGIT&&n.hasGenerator){let u=n.generate(t,this);if(o!==u)throw new A(T.NATIONAL_CHECK_DIGIT,`national check digit(s) don't match expect=[${u}] actual=[${o}]`,u,o)}}};c.bbanFR=new c(a.bankCode(5,i.n),a.branchCode(5,i.n),a.accountNumber(11,i.c),a.nationalCheckDigit(2,i.n,ht));c.structures={[r.AD]:new c(a.bankCode(4,i.n),a.branchCode(4,i.n),a.accountNumber(12,i.c)),[r.AE]:new c(a.bankCode(3,i.n),a.accountNumber(16,i.c)),[r.AL]:new c(a.bankCode(3,i.n),a.branchCode(4,i.n),a.nationalCheckDigit(1,i.n),a.accountNumber(16,i.c)),[r.AO]:new c(a.accountNumber(21,i.n)),[r.AT]:new c(a.bankCode(5,i.n),a.accountNumber(11,i.n)),[r.AZ]:new c(a.bankCode(4,i.a),a.accountNumber(20,i.c)),[r.BA]:new c(a.bankCode(3,i.n),a.branchCode(3,i.n),a.accountNumber(8,i.n),a.nationalCheckDigit(2,i.n)),[r.BE]:new c(a.bankCode(3,i.n),a.accountNumber(7,i.n),a.nationalCheckDigit(2,i.n,(e,t)=>{let n=t.extractValue(e,h.ACCOUNT_NUMBER),o=t.extractValue(e,h.BANK_CODE);if(n===null||o===null)throw new A(T.NOT_EMPTY,"account number or bank code missing");let u=parseInt(`${o}${n}`,10),s=Math.floor(u/97),l=u-s*97;return l===0&&(l=97),String(l).padStart(2,"0")})),[r.BF]:new c(a.accountNumber(23,i.n)),[r.BG]:new c(a.bankCode(4,i.a),a.branchCode(4,i.n),a.accountType(2,i.n),a.accountNumber(8,i.c)),[r.BH]:new c(a.bankCode(4,i.a),a.accountNumber(14,i.c)),[r.BI]:new c(a.bankCode(5,i.n),a.branchCode(5,i.n),a.accountNumber(11,i.n),a.nationalCheckDigit(2,i.n)),[r.BJ]:new c(a.bankCode(5,i.c),a.branchCode(5,i.n),a.accountNumber(12,i.n),a.nationalCheckDigit(2,i.n,ht)),[r.BR]:new c(a.bankCode(8,i.n),a.branchCode(5,i.n),a.accountNumber(10,i.n),a.accountType(1,i.a),a.ownerAccountNumber(1,i.c)),[r.BY]:new c(a.bankCode(4,i.c),a.accountType(4,i.n),a.accountNumber(16,i.c)),[r.CF]:new c(a.accountNumber(23,i.n)),[r.CG]:new c(a.accountNumber(23,i.n)),[r.CH]:new c(a.bankCode(5,i.n),a.accountNumber(12,i.c)),[r.CI]:new c(a.bankCode(2,i.c),a.accountNumber(22,i.n)),[r.CM]:new c(a.accountNumber(23,i.n)),[r.CR]:new c(a.bankCode(4,i.n),a.accountNumber(14,i.n)),[r.CV]:new c(a.accountNumber(21,i.n)),[r.CY]:new c(a.bankCode(3,i.n),a.branchCode(5,i.n),a.accountNumber(16,i.c)),[r.CZ]:new c(a.bankCode(4,i.n),a.branchCode(6,i.n),a.accountNumber(10,i.n)),[r.DE]:new c(a.bankCode(8,i.n),a.accountNumber(10,i.n)),[r.DJ]:new c(a.bankCode(5,i.n),a.branchCode(5,i.n),a.accountNumber(11,i.n),a.nationalCheckDigit(2,i.n)),[r.DK]:new c(a.bankCode(4,i.n),a.accountNumber(10,i.n)),[r.DO]:new c(a.bankCode(4,i.c),a.accountNumber(20,i.n)),[r.DZ]:new c(a.accountNumber(20,i.n)),[r.EE]:new c(a.bankCode(2,i.n),a.branchCode(2,i.n),a.accountNumber(11,i.n),a.nationalCheckDigit(1,i.n)),[r.EG]:new c(a.bankCode(4,i.n),a.branchCode(4,i.n),a.accountNumber(17,i.n)),[r.ES]:new c(a.bankCode(4,i.n),a.branchCode(4,i.n),a.nationalCheckDigit(2,i.n,Po),a.accountNumber(10,i.n)),[r.FI]:new c(a.bankCode(3,i.n),a.accountNumber(11,i.n)),[r.FK]:new c(a.bankCode(2,i.a),a.accountNumber(12,i.n)),[r.FO]:new c(a.bankCode(4,i.n),a.accountNumber(9,i.n),a.nationalCheckDigit(1,i.n)),[r.FR]:c.bbanFR,[r.GA]:c.bbanFR,[r.GB]:new c(a.bankCode(4,i.a),a.branchCode(6,i.n),a.accountNumber(8,i.n)),[r.GE]:new c(a.bankCode(2,i.a),a.accountNumber(16,i.n)),[r.GI]:new c(a.bankCode(4,i.a),a.accountNumber(15,i.c)),[r.GL]:new c(a.bankCode(4,i.n),a.accountNumber(10,i.n)),[r.GQ]:c.bbanFR,[r.GR]:new c(a.bankCode(3,i.n),a.branchCode(4,i.n),a.accountNumber(16,i.c)),[r.GT]:new c(a.bankCode(4,i.c),a.currencyType(2,i.n),a.accountType(2,i.n),a.accountNumber(16,i.c)),[r.HR]:new c(a.bankCode(7,i.n),a.accountNumber(10,i.n)),[r.HN]:new c(a.bankCode(4,i.a),a.accountNumber(20,i.n)),[r.HU]:new c(a.bankCode(3,i.n),a.branchCode(4,i.n),a.branchCheckDigit(1,i.n),a.accountNumber(15,i.n),a.nationalCheckDigit(1,i.n)),[r.IE]:new c(a.bankCode(4,i.a),a.branchCode(6,i.n),a.accountNumber(8,i.n)),[r.IL]:new c(a.bankCode(3,i.n),a.branchCode(3,i.n),a.accountNumber(13,i.n)),[r.IQ]:new c(a.bankCode(4,i.a),a.branchCode(3,i.n),a.accountNumber(12,i.n)),[r.IR]:new c(a.bankCode(3,i.n),a.accountNumber(19,i.n)),[r.IS]:new c(a.bankCode(4,i.n),a.branchCode(2,i.n),a.accountNumber(6,i.n),a.identificationNumber(10,i.n)),[r.IT]:new c(a.nationalCheckDigit(1,i.a,_n),a.bankCode(5,i.n),a.branchCode(5,i.n),a.accountNumber(12,i.c)),[r.JO]:new c(a.bankCode(4,i.a),a.branchCode(4,i.n),a.accountNumber(18,i.c)),[r.KM]:new c(a.accountNumber(23,i.n)),[r.KW]:new c(a.bankCode(4,i.a),a.accountNumber(22,i.c)),[r.KZ]:new c(a.bankCode(3,i.n),a.accountNumber(13,i.c)),[r.LB]:new c(a.bankCode(4,i.n),a.accountNumber(20,i.c)),[r.LC]:new c(a.bankCode(4,i.a),a.accountNumber(24,i.n)),[r.LI]:new c(a.bankCode(5,i.n),a.accountNumber(12,i.c)),[r.LT]:new c(a.bankCode(5,i.n),a.accountNumber(11,i.n)),[r.LU]:new c(a.bankCode(3,i.n),a.accountNumber(13,i.c)),[r.LV]:new c(a.bankCode(4,i.a),a.accountNumber(13,i.c)),[r.LY]:new c(a.bankCode(3,i.n),a.branchCode(3,i.n),a.accountNumber(15,i.n)),[r.MA]:new c(a.accountNumber(24,i.n)),[r.MC]:new c(a.bankCode(5,i.n),a.branchCode(5,i.n),a.accountNumber(11,i.c),a.nationalCheckDigit(2,i.n,ht)),[r.MD]:new c(a.bankCode(2,i.c),a.accountNumber(18,i.c)),[r.ME]:new c(a.bankCode(3,i.n),a.accountNumber(13,i.n),a.nationalCheckDigit(2,i.n)),[r.MG]:new c(a.bankCode(5,i.n),a.branchCode(5,i.n),a.accountNumber(11,i.c),a.nationalCheckDigit(2,i.n)),[r.MK]:new c(a.bankCode(3,i.n),a.accountNumber(10,i.c),a.nationalCheckDigit(2,i.n)),[r.ML]:new c(a.bankCode(1,i.a),a.accountNumber(25,i.n)),[r.MN]:new c(a.bankCode(4,i.n),a.accountNumber(12,i.n)),[r.MR]:new c(a.bankCode(5,i.n),a.branchCode(5,i.n),a.accountNumber(11,i.n),a.nationalCheckDigit(2,i.n)),[r.MT]:new c(a.bankCode(4,i.a),a.branchCode(5,i.n),a.accountNumber(18,i.c)),[r.MU]:new c(a.bankCode(6,i.c),a.branchCode(2,i.n),a.accountNumber(12,i.c),a.accountType(3,i.n),a.currencyType(3,i.a)),[r.MZ]:new c(a.accountNumber(21,i.n)),[r.NE]:new c(a.bankCode(2,i.a),a.accountNumber(22,i.n)),[r.NI]:new c(a.bankCode(4,i.a),a.accountNumber(20,i.n)),[r.NL]:new c(a.bankCode(4,i.a),a.accountNumber(10,i.n)),[r.NO]:new c(a.bankCode(4,i.n),a.accountNumber(6,i.n),a.nationalCheckDigit(1,i.n,Fo)),[r.OM]:new c(a.bankCode(3,i.n),a.accountNumber(16,i.n)),[r.PK]:new c(a.bankCode(4,i.c),a.accountNumber(16,i.c)),[r.PL]:new c(a.bankCode(3,i.n),a.branchCode(4,i.n),a.nationalCheckDigit(1,i.n),a.accountNumber(16,i.n)),[r.PS]:new c(a.bankCode(4,i.a),a.accountNumber(21,i.c)),[r.PT]:new c(a.bankCode(4,i.n),a.branchCode(4,i.n),a.accountNumber(11,i.n),a.nationalCheckDigit(2,i.n,Go)),[r.QA]:new c(a.bankCode(4,i.a),a.accountNumber(21,i.c)),[r.RO]:new c(a.bankCode(4,i.a),a.accountNumber(16,i.c)),[r.RS]:new c(a.bankCode(3,i.n),a.accountNumber(13,i.n),a.nationalCheckDigit(2,i.n)),[r.RU]:new c(a.bankCode(9,i.n),a.branchCode(5,i.n),a.accountNumber(15,i.c)),[r.SA]:new c(a.bankCode(2,i.n),a.accountNumber(18,i.c)),[r.SC]:new c(a.bankCode(4,i.a),a.branchCode(2,i.n),a.branchCheckDigit(2,i.n),a.accountNumber(16,i.n),a.currencyType(3,i.a)),[r.SD]:new c(a.bankCode(2,i.n),a.accountNumber(12,i.n)),[r.SE]:new c(a.bankCode(3,i.n),a.accountNumber(16,i.n),a.nationalCheckDigit(1,i.n)),[r.SI]:new c(a.bankCode(2,i.n),a.branchCode(3,i.n),a.accountNumber(8,i.n),a.nationalCheckDigit(2,i.n)),[r.SK]:new c(a.bankCode(4,i.n),a.accountNumber(16,i.n)),[r.SM]:new c(a.nationalCheckDigit(1,i.a,_n),a.bankCode(5,i.n),a.branchCode(5,i.n),a.accountNumber(12,i.c)),[r.SN]:new c(a.bankCode(5,i.c),a.branchCode(5,i.n),a.accountNumber(14,i.n)),[r.SO]:new c(a.bankCode(4,i.n),a.branchCode(3,i.n),a.accountNumber(12,i.n)),[r.ST]:new c(a.bankCode(4,i.n),a.branchCode(4,i.n),a.accountNumber(13,i.n)),[r.SV]:new c(a.bankCode(4,i.a),a.branchCode(4,i.n),a.accountNumber(16,i.n)),[r.TG]:new c(a.bankCode(2,i.a),a.accountNumber(22,i.n)),[r.TD]:new c(a.accountNumber(23,i.n)),[r.TL]:new c(a.bankCode(3,i.n),a.accountNumber(14,i.n),a.nationalCheckDigit(2,i.n)),[r.TN]:new c(a.bankCode(2,i.n),a.branchCode(3,i.n),a.accountNumber(13,i.c),a.nationalCheckDigit(2,i.c)),[r.TR]:new c(a.bankCode(5,i.n),a.nationalCheckDigit(1,i.c),a.accountNumber(16,i.c)),[r.UA]:new c(a.bankCode(6,i.n),a.accountNumber(19,i.n)),[r.VA]:new c(a.bankCode(3,i.c),a.accountNumber(15,i.n)),[r.VG]:new c(a.bankCode(4,i.a),a.accountNumber(16,i.n)),[r.XK]:new c(a.bankCode(2,i.n),a.branchCode(2,i.n),a.accountNumber(10,i.n),a.nationalCheckDigit(2,i.n))};var Ho=/^[A-Z]+$/,Jo=/^[0-9]+$/,xt="00",In=97,Ko=999999999,Ue=0,se=2,bt=se,Pe=2,Vo=bt+Pe;function ve(e){let t=Ee(e,xt),n=Gn(t);return String(98-n).padStart(2,"0")}function ce(e){jo(e),Fn(e,!0),Wo(e),Fe(le(e),ee(e)),Xo(e)}function Fe(e,t){Fn(e,!0);let n=vt(e);if(!n)throw new Error("Internal error, expected structure");n.validate(t)}function Ge(e){return e.substring(bt,bt+Pe)}function le(e){return e.substring(Ue,Ue+se)}function qo(e){return e.substring(Ue,Ue+se+Pe)}function ee(e){return e.substring(Vo)}function Mn(e){return J(e,h.ACCOUNT_NUMBER)}function Cn(e){return J(e,h.BANK_CODE)}function Bn(e){return J(e,h.BRANCH_CODE)}function Dn(e){return J(e,h.NATIONAL_CHECK_DIGIT)}function On(e){return J(e,h.BRANCH_CHECK_DIGIT)}function Rn(e){return J(e,h.CURRENCY_TYPE)}function Ln(e){return J(e,h.ACCOUNT_TYPE)}function kn(e){return J(e,h.OWNER_ACCOUNT_NUMBER)}function Un(e){return J(e,h.IDENTIFICATION_NUMBER)}function Ee(e,t){return le(e)+t+ee(e)}function yt(e,t=" "){return e.replace(/(.{4})/g,`$1${t}`).trim()}function Pn(e,t=" "){let n=vt(e);if(n===null)throw new Error("should't happen - already validated IBAN");let o=ee(e),u=n.getParts().reduce((s,l)=>{let f=n.extractValue(o,l.getPartType());return s.concat(f||"",l.trailingSeparator?t:"")},[]);return u.pop(),u.join("")}function Xo(e){if(Gn(e)!=1){let t=Ge(e),n=ve(e);throw new Le(`[${e}] has invalid check digit: ${t}, expected check digit is: ${n}`,t,n)}}function jo(e){if(e==null)throw new A(T.NOT_NULL,"Null can't be a valid Iban.");if(e.length===0)throw new A(T.NOT_EMPTY,"Empty string can't be a valid Iban.")}function Fn(e,t=!0){if(e.length<se)throw new A(T.COUNTRY_CODE_TWO_LETTERS,"Iban must contain 2 char country code.",e);let n=le(e);if(n!==n.toUpperCase()||!Ho.test(n))throw new A(T.COUNTRY_CODE_ONLY_UPPER_CASE_LETTERS,"Iban country code must contain upper case letters.",n);let o=Z(n);if(o==null)throw new A(T.COUNTRY_CODE_EXISTS,"Iban contains non existing country code.",n);if(t&&c.forCountry(o)==null)throw new j("Country code is not supported.",n)}function Wo(e){if(e.length<se+Pe)throw new A(T.CHECK_DIGIT_TWO_DIGITS,"Iban must contain 2 digit check digit.",e.substring(se));let t=Ge(e);if(!Jo.test(t))throw new A(T.CHECK_DIGIT_ONLY_DIGITS,"Iban's check digit should contain only digits.",t)}function Gn(e){let t=ee(e)+qo(e),n=65,o=90,u=48,s=57;function l(d,p){let g=(p>9?d*100:d*10)+p;return g>Ko?g%In:g}return t.toUpperCase().split("").reduce((d,p)=>{let g=p.charCodeAt(0);if(n<=g&&g<=o)return l(d,g-n+10);if(u<=g&&g<=s)return l(d,g-u);throw new A(T.IBAN_VALID_CHARACTERS,`Invalid Character[${p}] = '${g}'`,p)},0)%In}function vt(e){let t=Z(le(e));return t?Yo(t):null}function Yo(e){return c.forCountry(e)}function J(e,t){let n=ee(e),o=vt(e);return o===null?null:o.extractValue(n,t)}var fe=class{countryCode(t){return this.countryCodeValue=t,this}bankCode(t){return this.bankCodeValue=t,this}branchCode(t){return this.branchCodeValue=t,this}accountNumber(t){return this.accountNumberValue=t,this}nationalCheckDigit(t){return this.nationalCheckDigitValue=t,this}branchCheckDigit(t){return this.branchCheckDigitValue=t,this}accountType(t){return this.accountTypeValue=t,this}ownerAccountType(t){return this.ownerAccountTypeValue=t,this}identificationNumber(t){return this.identificationNumberValue=t,this}build(t=!0,n=!0){if(t&&this.countryCodeValue==null){let f=c.supportedCountries();this.countryCodeValue=f[Re(f.length)]}if(c.forCountry(this.countryCodeValue)===null)throw new Error("shouldn't happen");this.fillMissingFieldsRandomly(t);let u=this.formatIban(),s=ve(u),l=Ee(u,s);return n&&ce(l),new te(l)}formatBban(){let t=[],n=c.forCountry(this.countryCodeValue);if(n===null)throw new j("Country code is not supported.",this.countryCodeValue);for(let o of n.getParts())switch(o.getPartType()){case h.BANK_CODE:typeof this.bankCodeValue=="string"&&t.push(this.bankCodeValue);break;case h.BRANCH_CODE:typeof this.branchCodeValue=="string"&&t.push(this.branchCodeValue);break;case h.BRANCH_CHECK_DIGIT:typeof this.branchCheckDigitValue=="string"&&t.push(this.branchCheckDigitValue);break;case h.ACCOUNT_NUMBER:typeof this.accountNumberValue=="string"&&t.push(this.accountNumberValue);break;case h.NATIONAL_CHECK_DIGIT:typeof this.nationalCheckDigitValue=="string"&&t.push(this.nationalCheckDigitValue);break;case h.ACCOUNT_TYPE:typeof this.accountTypeValue=="string"&&t.push(this.accountTypeValue);break;case h.OWNER_ACCOUNT_NUMBER:typeof this.ownerAccountTypeValue=="string"&&t.push(this.ownerAccountTypeValue);break;case h.IDENTIFICATION_NUMBER:typeof this.identificationNumberValue=="string"&&t.push(this.identificationNumberValue);break}return t.join("")}formatIban(){return`${this.countryCodeValue}${xt}${this.formatBban()}`}fillMissingFieldsRandomly(t){let n=c.forCountry(this.countryCodeValue);if(n==null)throw new j("Country code is not supported.",this.countryCodeValue);let o=!1;for(let u of n.getParts())switch(u.getPartType()){case h.BANK_CODE:if(!this.bankCodeValue)this.bankCodeValue=u.generate("",n);else if(!t)throw new A(T.NOT_NULL,"bankCode is required; it cannot be null");break;case h.BRANCH_CODE:if(!this.branchCodeValue)this.branchCodeValue=u.generate("",n);else if(!t)throw new A(T.NOT_NULL,"branchCode is required; it cannot be null");break;case h.BRANCH_CHECK_DIGIT:if(!this.branchCheckDigitValue)this.branchCheckDigitValue=u.generate("",n);else if(!t)throw new A(T.NOT_NULL,"branchCheckDigit is required; it cannot be null");break;case h.ACCOUNT_NUMBER:if(!this.accountNumberValue)this.accountNumberValue=u.generate("",n);else if(!t)throw new A(T.NOT_NULL,"accountNumber is required; it cannot be null");break;case h.NATIONAL_CHECK_DIGIT:this.nationalCheckDigitValue||(o=!0,this.nationalCheckDigitValue="".padStart(u.getLength(),"0"));break;case h.ACCOUNT_TYPE:if(!this.accountTypeValue)this.accountTypeValue=u.generate("",n);else if(!t)throw new A(T.NOT_NULL,"accountType is required; it cannot be null");break;case h.OWNER_ACCOUNT_NUMBER:if(!this.ownerAccountTypeValue)this.ownerAccountTypeValue=u.generate("",n);else if(!t)throw new A(T.NOT_NULL,"ownerAccountType is required; it cannot be null");break;case h.IDENTIFICATION_NUMBER:if(!this.identificationNumberValue)this.identificationNumberValue=u.generate("",n);else if(!t)throw new A(T.NOT_NULL,"indentificationNumber is required; it cannot be null");break}if(o){for(let u of n.getParts())if(u.getPartType()===h.NATIONAL_CHECK_DIGIT){let s=this.formatBban();this.nationalCheckDigitValue=u.generate(s,n)}}}};var $o=/[^a-z0-9]/ig,Jn={AD:"AD1200012030200359100100",AE:"AE070331234567890123456",AL:"AL47212110090000000235698741",AT:"AT611904300234573201",AZ:"AZ21NABZ00000000137010001944",BA:"BA391990440001200279",BE:"BE68539007547034",BG:"BG80BNBG96611020345678",BH:"BH67BMAG00001299123456",BR:"BR9700360305000010009795493P1",BY:"BY13NBRB3600900000002Z00AB00",CH:"CH9300762011623852957",CR:"CR05015202001026284066",CY:"CY17002001280000001200527600",CZ:"CZ6508000000192000145399",DE:"DE89370400440532013000",DK:"DK5000400440116243",DO:"DO28BAGR00000001212453611324",EE:"EE382200221020145685",ES:"ES9121000418450200051332",FI:"FI2112345600000785",FO:"FO6264600001631634",FR:"FR1420041010050500013M02606",GB:"GB29NWBK60161331926819",GE:"GE29NB0000000101904917",GI:"GI75NWBK000000007099453",GL:"GL8964710001000206",GR:"GR1601101250000000012300695",GT:"GT82TRAJ01020000001210029690",HR:"HR1210010051863000160",HU:"HU42117730161111101800000000",IE:"IE29AIBK93115212345678",IL:"IL620108000000099999999",IQ:"IQ98NBIQ850123456789012",IS:"IS140159260076545510730339",IT:"IT60X0542811101000000123456",JO:"JO94CBJO0010000000000131000302",KW:"KW81CBKU0000000000001234560101",KZ:"KZ86125KZT5004100100",LB:"LB62099900000001001901229114",LC:"LC07HEMM000100010012001200013015",LI:"LI21088100002324013AA",LT:"LT121000011101001000",LU:"LU280019400644750000",LV:"LV80BANK0000435195001",MC:"MC5811222000010123456789030",MD:"MD24AG000225100013104168",ME:"ME25505000012345678951",MK:"MK07250120000058984",MR:"MR1300020001010000123456753",MT:"MT84MALT011000012345MTLCAST001S",MU:"MU17BOMM0101101030300200000MUR",NL:"NL91ABNA0417164300",NO:"NO9386011117947",PK:"PK36SCBL0000001123456702",PL:"PL61109010140000071219812874",PS:"PS92PALS000000000400123456702",PT:"PT50000201231234567890154",QA:"QA58DOHB00001234567890ABCDEFG",RO:"RO49AAAA1B31007593840000",RS:"RS35260005601001611379",SA:"SA0380000000608010167519",SC:"SC18SSCB11010000000000001497USD",SE:"SE4550000000058398257466",SI:"SI56263300012039086",SK:"SK3112000000198742637541",SM:"SM86U0322509800000000270100",ST:"ST68000100010051845310112",SV:"SV62CENR00000000000000700025",TL:"TL380080012345678910157",TN:"TN5910006035183598478831",TR:"TR330006100519786457841326",UA:"UA213223130000026007233566001",VA:"VA59001123000012345678",VG:"VG96VPVG0000012345678901",XK:"XK051212012345678906",AO:"AO69123456789012345678901",BF:"BF2312345678901234567890123",BI:"BI41123456789012",BJ:"BJ11B00610100400271101192591",CF:"CF4220001000010120069700160",CI:"CI93CI0080111301134291200589",CM:"CM9012345678901234567890123",CV:"CV30123456789012345678901",DJ:"DJ2110002010010409943020008",DZ:"DZ8612345678901234567890",GQ:"GQ7050002001003715228190196",HN:"HN54PISA00000000000000123124",IR:"IR861234568790123456789012",MG:"MG1812345678901234567890123",ML:"ML15A12345678901234567890123",MZ:"MZ25123456789012345678901",SN:"SN52A12345678901234567890123",KM:"KM4600005000010010904400137",TD:"TD8960002000010271091600153",CG:"CG3930011000101013451300019",EG:"EG800002000156789012345180002",GA:"GA2140021010032001890020126",MA:"MA64011519000001205000534921",NI:"NI92BAMC000000000000000003123123",NE:"NE58NE0380100100130305000268",TG:"TG53TG0090604310346500400070"},te=class e{constructor(t){let n=e.electronicFormat(t);ce(n),this.value=n}getCountryCode(){return Z(le(this.value))}getCheckDigit(){return Ge(this.value)}getAccountNumber(){return Mn(this.value)}getBankCode(){return Cn(this.value)}getBranchCode(){return Bn(this.value)}getNationalCheckDigit(){return Dn(this.value)}getBranchCheckDigit(){return On(this.value)}getCurrencyType(){return Rn(this.value)}getAccountType(){return Ln(this.value)}getOwnerAccountType(){return kn(this.value)}getIdentificationNumber(){return Un(this.value)}getBban(){return ee(this.value)}toString(){return this.value}toFormattedString(){return yt(this.value)}static isValid(t){try{ce(e.electronicFormat(t))}catch(n){return!1}return!0}static toBBAN(t,n=" "){let o=e.electronicFormat(t);return ce(o),Pn(o,n)}static fromBBAN(t,n){Fe(t,e.electronicFormat(n));let o=`${t}00${n}`,u=ve(o);return Ee(o,u)}static isValidBBAN(t,n){try{Fe(t,e.electronicFormat(n))}catch(o){return!1}return!0}static printFormat(t,n=" "){return yt(t,n)}static electronicFormat(t){return t.replace($o,"").toUpperCase()}static random(t){return t!==void 0?new fe().countryCode(t).build():new fe().build()}static sample(t){let n=Jn[t];return n!==void 0?n:Jn[r.DE]}};var zo=0,Qo=4,Zo=zo+Qo,ei=2,ti=Zo+ei,ni=2,_c=ti+ni;function Kn(e,t){for(let n of(0,D.$)(e))(0,D.$)(n).errorFunc(function(){return qn(this,t)});(0,D.getXUtil)().on("addRow",n=>{for(let o of n.container.find(e))(0,D.$)(o).errorFunc(function(){return qn(this,t)})})}function oi(){for(let e of(0,D.$)('[vdt="xm-vdt-steuerid"],[data-vdt="xm-vdt-steuerid"]'))(0,D.$)(e).errorFunc(function(){return Vn(this)});(0,D.getXUtil)().on("addRow",e=>{for(let t of e.container.find('[vdt="xm-vdt-steuerid"],[data-vdt="xm-vdt-steuerid"]'))(0,D.$)(t).errorFunc(function(){return Vn(this)})})}function ii(){Kn('[vdt="xm-vdt-iban"],[data-vdt="xm-vdt-iban"]',!1),Kn('[vdt="xm-vdt-iban-de"],[data-vdt="xm-vdt-iban-de"]',!0)}function Vn(e){var u,s;let t=V((0,D.$)(e).val());if(t==="")return"";let n=t.replace(/[^\d]/g,""),o=Tn.validate(n);return o&&e.val(`${n.substring(0,3)} / ${n.substring(3,6)} / ${n.substring(6,11)}`),o?"":(s=(u=(0,D.getXmFormPluginValidationRules)()["xm-vdt-steuerid"])==null?void 0:u.errorMsg)!=null?s:"Invalid Tax ID"}function qn(e,t){var o,u,s;let n=V((0,D.$)(e).val());if(n==="")return"";try{let l=new te(n);if(t&&l.getCountryCode()!=="DE")throw new Error("Country code must be 'DE'");return(0,D.$)(e).val(l.toFormattedString()),""}catch(l){let f=(0,D.getXmFormPluginValidationRules)(),d=t?(o=f["xm-vdt-iban-de"])==null?void 0:o.errorMsg:(u=f["xm-vdt-iban"])==null?void 0:u.errorMsg,p=l instanceof Error?l.message:"";return(s=d==null?void 0:d.replace(/%reason%/g,p))!=null?s:"Invalid IBAN"}}function Xn(){oi(),ii()}var Wn=P(jn(),1);function Yn(e){return function(t){return t(e)}}function $n(e,t){var n,o=(0,Wn.getXUtil)();o.nestedRepetitionsRegistry=(n=o.nestedRepetitionsRegistry)!==null&&n!==void 0?n:{};var u=o.nestedRepetitionsRegistry;if(e in u){console.error("Skipping plugin registration request <".concat(e,">, this plugin was registered already"));return}u[e]=t}var zn=P(F());function ai(e){return e(({data:t,dom:n,handler:o})=>Yn({data:t,dom:n,handler:At(Tt({},o),{loadState:(u,s,l)=>{o.loadState(u,s,l);let f=(0,zn.getJQuery)()(o.extractMainElementFromDom(u)).closest(".xm-upl-input-wrapper").addBack(".xm-upl-input-wrapper").parent();ut(f)}})}))}function Qn(){$n("de.xima.plugin.leitfaden",{wrapItem:e=>{if(e.itemDiv.classList.contains("CXUpload"))return ai(e.item)}})}var Ne=P(F());function Zn(e){(0,Ne.getXfcMetaData)().requestType==="print"&&(0,Ne.getXUtil)().on("print",()=>e)}function er(){return{setCompactMode:e=>{let t=un("form.xm-form");t!==void 0&&ln(t,"xm-style-guide--compact",e)},showSummary:e=>{let t=lt(e)[0];if(t===void 0)return console.warn("Cannot show summary, no element found or given",e),Promise.resolve();let n=ye(t);return Zn(n),n},showSummaryOn:(...e)=>{let t=(0,Ne.getXfcMetaData)().requestType;if(!e.includes(t))return Promise.resolve();let o=document.querySelectorAll(".XPage"),u=o[o.length-2];if(!(u instanceof HTMLElement))return Promise.resolve();let s=ye(u);return Zn(s),s.then(()=>{var l;for(let f of ue(document.querySelectorAll(".xm-summary-gotopage, .xm-summary-title")))(l=f.parentElement)==null||l.removeChild(f)}),s}}}Qn();(0,Je.getJQuery)()(()=>{rn(),wn(),Xn()});var tr;(0,Je.getJQuery)().leitfaden=(tr=(0,Je.getJQuery)().leitfaden)!=null?tr:er();})();
