import{e as r,PopStateHandlers as v,setURLParam as T}from"/static/js/utils/utils.js?v=c676bb123f83b0ed";// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0-or-later
var c="number",a="bigint";try{BigInt(69)}catch(t){BigInt=Number,a=c}var y=r("output"),i=[r("euro"),r("mark"),r("ost"),r("schwarz")],p=[BigInt(1),BigInt(2),BigInt(4),BigInt(20)],M=/^(?:\d+|(?:\d+)?[,.]\d{1,2}|\d+[,.](?:\d{1,2})?)?$/,m=t=>/^0*$/.test(t);function g(t){if(typeof t=="string"&&(t=f(t)),typeof t!==a)return alert("Ungültiger Wert ".concat(t," mit type ").concat(typeof t)),null;typeof t=="number"&&(t=Math.floor(t));let n=t.toString();if(a===c&&n.includes("e")){let[u,l]=n.split("e");if(l.startsWith("-"))return"0";let[o,s]=u.split(".");s=s!=null?s:"",n=(o!=null?o:"")+s+"0".repeat(parseInt(l)-s.length)}if(m(n))return"0";let e=n.slice(-2);return(n.slice(0,-2)||"0")+(m(e)?"":","+(e.length===1?"0":"")+e)}function f(t){if(m(t))return BigInt(0);let[n,e]=[t,"00"];return t.includes(",")?[n,e]=t.split(","):t.includes(".")&&([n,e]=t.split(".")),e.length!==2&&(e=(e+"00").slice(0,2)),BigInt(n+e)}var b="currencyConverter";v[b]=t=>{I(f(t.state.euro.toString()))};var d=(t,n)=>T("euro",t,{euro:t},b,n);function I(t,n=null){var e;d((e=g(t))!=null?e:"null",!1);for(let u=0;u<4;u++){let l=g(t*p[u]);i[u].placeholder=l!=null?l:"null",u!==n&&(i[u].value=l!=null?l:"null")}}var E=()=>{y.value=i[0].value+" Euro, das sind ja "+i[1].value+" Mark; "+i[2].value+" Ostmark und "+i[3].value+" Ostmark auf dem Schwarzmarkt!"};function B(t){var n;t.preventDefault();for(let e of i)e.value=(n=g(e.value))!=null?n:"null";d(i[0].value,!0),E()}for(let t=0;t<4;t++)i[t].oninput=()=>{for(let n of i)n.className="";if(!M.test(i[t].value)){i[t].className="invalid";return}I(f(i[t].value)/p[t],t),E()};for(let t of i)t.value=t.placeholder;r("form").onsubmit=B;
// @license-end
//# sourceMappingURL=converter.js.map
