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GtE,eAAe,WACX,OAAG,CACC,MAAM,QAA2B,SAAS,OAAO,CAC7C,KAAM,gBACN,KAAM,SACN,QAAS,8BAEP,EAAW,UAAU,MAAM,GAAa,EAAS,QAAQ,gBAAkB,EAAmB,gBACpG,GAAI,EAAU,CACV,QAAQ,IAAI,MAAM,OAAO,KAAK,OAAO,cAAc,EAAS,aAAa,EAAS,gBAOlF,cANkB,SAAS,OAAO,CAC9B,KAAM,WACN,KAAM,OACN,QAAS,CAAC,UAAW,WAAY,gBAAiB,QAClD,QAAS,0BAED,UACR,IAAK,UACD,MAAM,QAAsB,SAAS,OAAO,CACxC,KAAM,SACN,KAAM,SACN,QAAS,gCAEb,EAAS,QAAQ,QAAQ,EAAc,QACvC,MACJ,IAAK,WACD,MAAM,QAAuB,SAAS,OAAO,CACzC,KAAM,SACN,KAAM,SACN,QAAS,iCAEb,EAAS,QAAQ,SAAS,EAAe,QACzC,MACJ,IAAK,gBACD,EAAS,QAAQ,eACjB,MACJ,IAAK,OACD,QAAQ,IAAI,MAAM,OAAO,KAAK,OAAO,gCACrC,QAAQ,IAAI,MAAM,OAAO,KAAK,OAAO,6DACrC,QAAQ,OAEpB,MAEI,QAAQ,IAAI,MAAM,IAAI,KAAK,OAAO,6CAE1C,CACJ,CACA","file":"/npm/mr95-oop-my-bank@1.0.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/mr95-oop-my-bank@1.0.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#! /usr/bin/env node\nimport chalk from \"chalk\";\nimport inquirer from \"inquirer\";\n//Bank Account Class\nclass BankAccount {\n    accountNumber;\n    balance;\n    constructor(accountNumber, balance) {\n        this.accountNumber = accountNumber;\n        this.balance = balance;\n    }\n    //Creadit Money\n    deposit(amount) {\n        if (amount >= 100) {\n            amount -= 1; // $1 fee charged if more then deposit $100 is deposited.\n            console.log(chalk.yellow.bold.italic(\"\\n$1 fee charged\\n\"));\n        }\n        if (amount <= 0) {\n            console.log(chalk.red.bold.italic(\"\\nInvalid Amount\\n\"));\n        }\n        this.balance += amount;\n        console.log(chalk.green.bold.italic(`\\nDeposit of $${amount} successfull. Remaining balnace: $${this.balance}\\n`));\n    }\n    //Debit Money\n    withdraw(amount) {\n        if (amount <= 0) {\n            console.log(chalk.red.bold.italic(\"Invalid Amount\"));\n        }\n        if (this.balance >= amount) {\n            this.balance -= amount;\n            console.log(chalk.green.bold.italic(`\\nWithdrawl of $${amount} successfull. Remaining balnace: $${this.balance}\\n`));\n        }\n        else {\n            console.log(chalk.red.bold.italic(\"\\nInsufficient Balance\\n\"));\n        }\n    }\n    //Check Balance\n    checkBalance() {\n        console.log(chalk.green.bold.italic(`\\nYour current balance is: $${this.balance}\\n`));\n    }\n}\n//Customer Class\nclass Customer {\n    firstName;\n    lastName;\n    age;\n    gender;\n    mobileNumber;\n    account;\n    constructor(firstName, lastName, age, gender, mobileNumber, account) {\n        this.firstName = firstName;\n        this.lastName = lastName;\n        this.age = age;\n        this.gender = gender;\n        this.mobileNumber = mobileNumber;\n        this.account = account;\n    }\n}\n//Create Bank Account\nconst account = [\n    new BankAccount(100052024, 1000),\n    new BankAccount(100052025, 2000),\n    new BankAccount(100052026, 3000),\n];\n//Create customer\nconst customers = [\n    new Customer(\"Daniyal\", \"Inam\", 27, \"Male\", 3323423790, account[0]),\n    new Customer(\"Sheikh\", \"Hammad\", 26, \"Male\", 3224543210, account[1]),\n    new Customer(\"Syeda\", \"Fatima\", 24, \"Female\", 3318977064, account[2]),\n];\n//Bank Functionality\nasync function services() {\n    do {\n        const accountNumberInput = await inquirer.prompt({\n            name: \"accountNumber\",\n            type: \"number\",\n            message: \"Enter your account number\",\n        });\n        const customer = customers.find((customer) => customer.account.accountNumber === accountNumberInput.accountNumber);\n        if (customer) {\n            console.log(chalk.yellow.bold.italic(`\\nWelcome, ${customer.firstName} ${customer.lastName}!\\n`));\n            const ans = await inquirer.prompt({\n                name: \"services\",\n                type: \"list\",\n                choices: [\"Deposit\", \"Withdraw\", \"Check Balance\", \"Exit\"],\n                message: \"Select your services\",\n            });\n            switch (ans.services) {\n                case \"Deposit\":\n                    const depositAmount = await inquirer.prompt({\n                        name: \"amount\",\n                        type: \"number\",\n                        message: \"Enter the amount to deposit\",\n                    });\n                    customer.account.deposit(depositAmount.amount);\n                    break;\n                case \"Withdraw\":\n                    const withdrawAmount = await inquirer.prompt({\n                        name: \"amount\",\n                        type: \"number\",\n                        message: \"Enter the amount to withdraw\",\n                    });\n                    customer.account.withdraw(withdrawAmount.amount);\n                    break;\n                case \"Check Balance\":\n                    customer.account.checkBalance();\n                    break;\n                case \"Exit\":\n                    console.log(chalk.yellow.bold.italic(\"\\nExiting bank program...\\n\"));\n                    console.log(chalk.yellow.bold.italic(\"Thank you for using our bank services. Have a great day!\"));\n                    process.exit();\n            }\n        }\n        else {\n            console.log(chalk.red.bold.italic(\"Invalid account number. Please try again.\"));\n        }\n    } while (true);\n}\nservices();\n"]}