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AAqBQ,KAAK,KAAM,IAC3DF,EAAmBG,KAAOT,EAAqBQ,KAAK,KAAMF,EAAmBG,KAAKD,KAAKF,G,KC7CvF,IAAII,EAAsB7D,EAAoBQ,OAAEjF,EAAW,CAAC,KAAK,IAAOyE,EAAoB,QAC5F6D,EAAsB7D,EAAoBQ,EAAEqD,E","sources":["webpack://web/webpack/runtime/chunk loaded","webpack://web/webpack/runtime/create fake namespace object","webpack://web/./src/loan/Pages/LoanPage/LoanCalculatorApp.module.scss?2581","webpack://web/./src/loan/Components/CustomInput/CustomInput.tsx","webpack://web/./src/loan/Utils/Utils.ts","webpack://web/./src/loan/Pages/LoanPage/LoanCalculator.ts","webpack://web/./src/loan/Index.tsx","webpack://web/./src/loan/Pages/LoanPage/LoanCalculatorApp.tsx","webpack://web/webpack/bootstrap","webpack://web/webpack/runtime/amd options","webpack://web/webpack/runtime/compat get default export","webpack://web/webpack/runtime/define property getters","webpack://web/webpack/runtime/hasOwnProperty shorthand","webpack://web/webpack/runtime/make namespace object","webpack://web/webpack/runtime/runtimeId","webpack://web/webpack/runtime/jsonp chunk loading","webpack://web/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// extracted by mini-css-extract-plugin\nexport default {\"component\":\"YqtBtaRoMModxxAMYSz1\",\"item\":\"aKk4PbAZqOADLSEoD3yR\",\"header\":\"FPTGr3Kw34hy0jPw37JT\",\"title\":\"vMrKdQOlzkUElRL14sWS\",\"addButton\":\"IVr1AS9Yz2wF4jWiVOBU\",\"deleteButton\":\"YEDeTSIWzyUcRvWEcK0y\",\"hide\":\"cjGeO3xCebcellT1Rrvc\",\"inputs\":\"MA0OxIDDIN0aoRDRUjSL\",\"row\":\"brzXC7AiYL0dPezbGQJc\",\"repaymentFrequencyButtonGroup\":\"HwD64Qnu4h8kG206oD24\",\"results\":\"aquSP05IqpX7Gxc2hfU_\",\"resultItem\":\"GwAE97U1fAw7OCFn_6bw\",\"amount\":\"YunmaUBT4YtPHyfoVh34\",\"diff\":\"xymsqb08NAMnh7L7TnNx\",\"positive\":\"J3A7G2R5mqQerhoOQ0rS\",\"hidden\":\"kwVtzFDzj0zTLWGUtZzB\"};","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport * as React from \"react\";\nimport { NumericFormat, NumericFormatProps } from \"react-number-format\";\n\ninterface CustomProps {\n onChange: (event: { target: { name: string; value: string } }) => void;\n name: string;\n}\n\ninterface CustomInputOption {\n prefix?: string;\n suffix?: string;\n thousandSeparator?: boolean;\n}\n\nconst CustomInput = (options: CustomInputOption) =>\n React.forwardRef(function NumericFormatCustom(props, ref) {\n const { onChange, ...other } = props;\n\n return (\n {\n onChange({\n target: {\n name: props.name,\n value: values.value,\n },\n });\n }}\n thousandSeparator={options.thousandSeparator}\n valueIsNumericString\n prefix={options.prefix}\n suffix={options.suffix}\n />\n );\n });\n\nexport const CurrencyInput = CustomInput({\n prefix: \"$\",\n thousandSeparator: true,\n}) as any;\n\nexport const PercentInput = CustomInput({ suffix: \"%\" }) as any;\n\nexport const YearsInput = CustomInput({ suffix: \" years\" }) as any;\n","const formatCurrency = (x: number) => {\n return \"$\" + x.toFixed(2).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n};\n\nconst formatDays = (days: number) => {\n days = Math.abs(Math.ceil(days));\n const monthDays = 365 / 12;\n const years = Math.floor(days / 365);\n const months = Math.floor((days % 365) / monthDays);\n const remainingDays = Math.floor((days % 365) % monthDays);\n\n let result = \"\";\n if (years > 0) {\n result += `${years} ${years === 1 ? \"year\" : \"years\"}`;\n }\n if (months > 0) {\n if (result !== \"\") result += \", \";\n result += `${months} ${months === 1 ? \"month\" : \"months\"}`;\n }\n if (remainingDays > 0) {\n if (result !== \"\") result += \", \";\n result += `${remainingDays} ${remainingDays === 1 ? \"day\" : \"days\"}`;\n }\n\n return result;\n};\n\nconst NPER = (\n rate: number,\n payment: number,\n present: number,\n future: number = 0,\n type: number = 0\n) => {\n const num = payment * (1 + rate * type) - future * rate;\n const den = present * rate + payment * (1 + rate * type);\n\n return Math.log(num / den) / Math.log(1 + rate);\n};\n\nexport const utils = {\n formatCurrency,\n formatDays,\n NPER,\n};\n","import { utils } from \"../../Utils\";\n\ninterface LoanCalculatorData {\n loanAmount?: number;\n interestRate?: number;\n loanYears?: number;\n offsetBalance?: number;\n extraPayment?: number;\n paymentFrequencyPerYear?: number;\n}\n\nexport class LoanCalculator {\n private _loanAmount: number = 0;\n private _interestRate: number = 0;\n private _loanYears: number = 0;\n private _offsetBalance: number = 0;\n private _extraPayment: number = 0;\n private _paymentFrequencyPerYear: number = 12;\n\n private _periodDays: number = 0;\n private repaymentPerDay: number = 0;\n\n constructor(data: LoanCalculatorData) {\n this.update(data);\n }\n\n get loanAmount(): number {\n return this._loanAmount;\n }\n\n get interestRate(): number {\n return this._interestRate;\n }\n\n get loanYears(): number {\n return this._loanYears;\n }\n\n get offsetBalance(): number {\n return this._offsetBalance;\n }\n\n get extraPayment(): number {\n return this._extraPayment;\n }\n\n get paymentFrequencyPerYear(): number {\n return this._paymentFrequencyPerYear;\n }\n\n get repayment(): number {\n return this.repaymentPerDay * this._periodDays + this._extraPayment;\n }\n\n get firstInterest(): number {\n const dailyRate = this._interestRate / 100 / 365;\n const balance = this._loanAmount - this._offsetBalance;\n\n return balance * dailyRate * this._periodDays;\n }\n\n get totalInterest(): number {\n const days = this.payOffDays;\n const extraPaymentPerDay = this._extraPayment / this._periodDays;\n const totalPaymentPerDay = this.calcRepaymentPerDay() + extraPaymentPerDay;\n const totalRepayment = totalPaymentPerDay * days;\n\n return totalRepayment - this._loanAmount + this._offsetBalance;\n }\n\n get averageInterest(): number {\n const interestPerDay = this.totalInterest / this.payOffDays;\n\n return interestPerDay * this._periodDays;\n }\n\n get payOffDays(): number {\n const rate = this._interestRate / 100 / this._paymentFrequencyPerYear;\n const repayment = this.repayment;\n const presentValue = -1 * (this._loanAmount - this._offsetBalance);\n\n const periods = utils.NPER(rate, repayment, presentValue);\n\n return periods * this._periodDays;\n }\n\n update(data: LoanCalculatorData) {\n if (data.loanAmount !== undefined) {\n this._loanAmount = data.loanAmount;\n }\n\n if (data.interestRate !== undefined) {\n this._interestRate = data.interestRate;\n }\n\n if (data.loanYears !== undefined) {\n this._loanYears = data.loanYears;\n }\n\n if (data.offsetBalance !== undefined) {\n this._offsetBalance = data.offsetBalance || 0;\n }\n\n if (data.extraPayment !== undefined) {\n this._extraPayment = data.extraPayment || 0;\n }\n\n if (data.paymentFrequencyPerYear !== undefined) {\n this._paymentFrequencyPerYear = data.paymentFrequencyPerYear;\n this._periodDays = 365 / this._paymentFrequencyPerYear;\n }\n\n this.repaymentPerDay = this.calcRepaymentPerDay();\n }\n\n private calcRepaymentPerDay = (useOffset: boolean = false): number => {\n const ratePerPeriod =\n this._interestRate / 100 / this._paymentFrequencyPerYear;\n const numberOfPeriods = this._loanYears * this._paymentFrequencyPerYear;\n\n const amount = useOffset\n ? this._loanAmount - this.offsetBalance\n : this._loanAmount;\n\n const repayment =\n (amount *\n (ratePerPeriod * Math.pow(1 + ratePerPeriod, numberOfPeriods))) /\n (Math.pow(1 + ratePerPeriod, numberOfPeriods) - 1);\n\n return (repayment * this._paymentFrequencyPerYear) / 365;\n };\n}\n","import { createRoot } from \"react-dom/client\";\nimport { LoanCalculatorApp } from \"./Pages/LoanPage/LoanCalculatorApp\";\n\nconst root = createRoot(document.getElementById(\"loan-app\"));\nroot.render(\n ,\n);\n","import {\n Button,\n ButtonGroup,\n IconButton,\n InputLabel,\n TextField,\n} from \"@mui/material\";\nimport css from \"./LoanCalculatorApp.module.scss\";\nimport { ChangeEvent, useRef, useState } from \"react\";\nimport { CurrencyInput, PercentInput, YearsInput } from \"../../Components\";\nimport cx from \"classnames\";\nimport { utils } from \"../../Utils\";\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport AddCircleOutlineIcon from \"@mui/icons-material/AddCircleOutline\";\nimport classNames from \"classnames\";\nimport { LoanCalculator } from \"./LoanCalculator\";\n\nexport const LoanCalculatorApp = () => {\n const [dummyRender, setRender] = useState(false);\n const [interestMode, setInterestMode] = useState(0);\n\n console.log(dummyRender);\n \n const defaultItem = new LoanCalculator({\n loanAmount: 1000000,\n interestRate: 6,\n loanYears: 30,\n offsetBalance: 0,\n paymentFrequencyPerYear: 12,\n });\n\n const items = useRef([defaultItem]);\n\n const render = () => {\n setRender((old) => !old);\n };\n\n const loanAmountChangeHandler =\n (index: number) => (event: ChangeEvent) => {\n items.current[index].update({\n loanAmount: parseInt(event.target.value, 10),\n });\n render();\n };\n\n const interestRateChangeHandler =\n (index: number) => (event: ChangeEvent) => {\n items.current[index].update({\n interestRate: parseFloat(event.target.value),\n });\n render();\n };\n\n const loanYearsChangeHandler =\n (index: number) => (event: ChangeEvent) => {\n items.current[index].update({\n loanYears: parseInt(event.target.value, 10),\n });\n render();\n };\n\n const paymentFrequencyPerYearChangeHandler =\n (index: number, value: number) => () => {\n items.current[index].update({ paymentFrequencyPerYear: value });\n render();\n };\n\n const offsetBalanceChangeHandler =\n (index: number) => (event: ChangeEvent) => {\n items.current[index].update({\n offsetBalance: parseInt(event.target.value, 10),\n });\n render();\n };\n\n const extraPaymentChangeHandler =\n (index: number) => (event: ChangeEvent) => {\n items.current[index].update({\n extraPayment: parseInt(event.target.value, 10),\n });\n render();\n };\n\n const getDiffElement = (\n value1: number,\n value2: number,\n format: (value: number) => string\n ) => {\n const hidden =
0
;\n\n if (\n value1 !== undefined &&\n value2 !== undefined &&\n value1 !== value2 &&\n Math.abs(value1 - value2) > 0.009\n ) {\n const value = value1 - value2;\n\n return (\n
0 })}>\n {format(value)}\n
\n );\n }\n\n return hidden;\n };\n\n const currencyDiffFormatter = (value: number) => {\n const formattedValue = utils.formatCurrency(value);\n return value > 0 ? `+${formattedValue}` : formattedValue;\n };\n\n const getRepaymentDiffElement = (index: number) => {\n const current = items.current[index].repayment;\n const base = items.current[0].repayment;\n\n return getDiffElement(current, base, currencyDiffFormatter);\n };\n\n const getInterestDiffElement = (index: number) => {\n const current = getInterest(items.current[index]);\n const base = getInterest(items.current[0]);\n\n return getDiffElement(current, base, currencyDiffFormatter);\n };\n\n const getPayOffDiffElement = (index: number) => {\n const current = items.current[index].payOffDays;\n const base = items.current[0].payOffDays;\n\n return getDiffElement(current, base, utils.formatDays);\n };\n\n const deleteButtonHandler = (index: number) => () => {\n if (items.current.length === 1) return;\n\n items.current.splice(index, 1);\n render();\n };\n\n const newItemClickHandler = (index: number) => () => {\n const copyItem = items.current[index];\n const newItem = new LoanCalculator({\n loanAmount: copyItem.loanAmount,\n interestRate: copyItem.interestRate,\n loanYears: copyItem.loanYears,\n offsetBalance: copyItem.offsetBalance,\n paymentFrequencyPerYear: copyItem.paymentFrequencyPerYear,\n extraPayment: copyItem.extraPayment,\n });\n\n items.current.splice(index + 1, 0, newItem);\n\n render();\n };\n\n const interestModeChangeHandler = () => {\n setInterestMode((old) => {\n if (old === 2) {\n return 0;\n }\n\n return old + 1;\n });\n };\n\n const getInterest = (item: LoanCalculator) => {\n if (interestMode === 0) {\n return item.firstInterest;\n } else if (interestMode === 1) {\n return item.averageInterest;\n } else {\n return item.totalInterest;\n }\n };\n\n const getInterestLabel = () => {\n if (interestMode === 0) {\n return \"First interest\";\n } else if (interestMode === 1) {\n return \"Average interest\";\n } else {\n return \"Total interest\";\n }\n };\n\n const getCalculatorInstance = (item: LoanCalculator, index: number) => {\n return (\n
\n
\n
\n \n\n \n \n \n\n \n \n \n
\n \n\n
\n \n\n \n
\n\n
\n \n\n \n
\n\n \n \n Weekly\n \n \n Fortnightly\n \n \n Monthly\n \n \n
\n\n
\n
\n
\n Repayment\n
\n {utils.formatCurrency(item.repayment)}\n
\n {getRepaymentDiffElement(index)}\n
\n\n
\n \n
\n {utils.formatCurrency(getInterest(item))}\n
\n {getInterestDiffElement(index)}\n
\n
\n\n
\n
\n Pay off\n
\n {utils.formatDays(Math.round(item.payOffDays))}\n
\n {getPayOffDiffElement(index)}\n
\n
\n
\n
\n );\n };\n\n return (\n
\n {items.current.map((item, index) => {\n return getCalculatorInstance(item, index);\n })}\n
\n );\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdO = {};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.j = 785;","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t785: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkweb\"] = self[\"webpackChunkweb\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [96], () => (__webpack_require__(2887)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","leafPrototypes","getProto","CustomInput","options","props","ref","onChange","other","getInputRef","onValueChange","values","target","name","value","thousandSeparator","valueIsNumericString","prefix","suffix","CurrencyInput","PercentInput","YearsInput","utils","x","toFixed","replace","days","Math","abs","ceil","monthDays","years","floor","months","remainingDays","result","LoanCalculator","_loanAmount","_interestRate","_loanYears","_offsetBalance","_extraPayment","_paymentFrequencyPerYear","_periodDays","repaymentPerDay","constructor","data","this","update","loanAmount","interestRate","loanYears","offsetBalance","extraPayment","paymentFrequencyPerYear","repayment","firstInterest","dailyRate","totalInterest","payOffDays","extraPaymentPerDay","calcRepaymentPerDay","averageInterest","rate","payment","present","future","type","num","den","log","undefined","useOffset","ratePerPeriod","numberOfPeriods","pow","createRoot","document","getElementById","render","dummyRender","setRender","useState","interestMode","setInterestMode","console","defaultItem","items","useRef","old","loanAmountChangeHandler","index","event","current","parseInt","interestRateChangeHandler","parseFloat","loanYearsChangeHandler","paymentFrequencyPerYearChangeHandler","offsetBalanceChangeHandler","extraPaymentChangeHandler","getDiffElement","value1","value2","format","hidden","className","currencyDiffFormatter","formattedValue","getRepaymentDiffElement","base","getInterestDiffElement","getInterest","getPayOffDiffElement","deleteButtonHandler","length","splice","newItemClickHandler","copyItem","newItem","interestModeChangeHandler","item","map","defaultValue","IconButton","size","onClick","Delete","fontSize","AddCircleOutline","A","TextField","label","InputProps","inputComponent","ButtonGroup","disableElevation","color","Button","variant","InputLabel","round","getCalculatorInstance","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","m","amdO","O","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","Object","keys","every","key","r","n","getter","__esModule","d","a","getPrototypeOf","obj","t","mode","then","ns","create","def","indexOf","getOwnPropertyNames","forEach","definition","o","defineProperty","enumerable","get","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","id","chunkLoadingGlobal","self","bind","push","__webpack_exports__"],"sourceRoot":""}