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C3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://woo-wallet/./src/payment-method/index.js","webpack://woo-wallet/./src/payment-method/style.scss","webpack://woo-wallet/external window \"React\"","webpack://woo-wallet/external window [\"wc\",\"wcBlocksRegistry\"]","webpack://woo-wallet/external window [\"wc\",\"wcSettings\"]","webpack://woo-wallet/external window [\"wp\",\"htmlEntities\"]","webpack://woo-wallet/external window [\"wp\",\"i18n\"]","webpack://woo-wallet/webpack/bootstrap","webpack://woo-wallet/webpack/runtime/chunk loaded","webpack://woo-wallet/webpack/runtime/compat get default export","webpack://woo-wallet/webpack/runtime/define property getters","webpack://woo-wallet/webpack/runtime/hasOwnProperty shorthand","webpack://woo-wallet/webpack/runtime/make namespace object","webpack://woo-wallet/webpack/runtime/jsonp chunk loading","webpack://woo-wallet/webpack/before-startup","webpack://woo-wallet/webpack/startup","webpack://woo-wallet/webpack/after-startup"],"sourcesContent":["\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { registerPaymentMethod } from '@woocommerce/blocks-registry';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { getSetting } from '@woocommerce/settings';\n\n/**\n * Internal dependencies\n */\nimport './style.scss';\n\nconst settings = getSetting( 'wallet_data', {} );\n\nconst defaultLabel = __(\n\t'Wallet Payment',\n\t'woo-wallet'\n);\n\nconst label = decodeEntities( settings.title ) || defaultLabel;\n/**\n * Content component\n */\nconst Content = () => {\n\treturn decodeEntities( settings.description || '' );\n};\n\nconst formatedBalance = () => {\n\tconst { balance, currency_symbol, decimal_separator, thousand_separator, decimals } = settings;\n\t// Ensure that 'amount' is a valid number\n let numericAmount = parseFloat(balance);\n if (isNaN(numericAmount)) {\n return amount; // Return the original value if it's not a valid number\n }\n // Format the amount to the required number of decimal places\n let fixedAmount = numericAmount.toFixed(decimals);\n // Split the integer and decimal parts\n let parts = fixedAmount.split('.');\n // Add thousand separator to the integer part only\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousand_separator);\n // Rejoin integer and decimal parts with the correct decimal separator\n let formattedAmount = parts.join(decimal_separator);\n return decodeEntities(`${currency_symbol}${formattedAmount}`);\n}\n\nconst CurrentBalance = () => {\n\treturn (\n\t\t\n\t\t\t { /* translators: 1: Wallet amount */ sprintf(__('| Current Balance: %s', 'woo-wallet'), formatedBalance())}\n\t\t\n\t);\n}\n/**\n * Label component\n *\n * @param {*} props Props from payment API.\n */\nconst Label = ( props ) => {\n\tconst { PaymentMethodLabel } = props.components;\n\treturn <> >;\n};\n\n/**\n * Wallet payment method config object.\n */\nconst Wallet = {\n\tname: \"wallet\",\n\tlabel: ,\n\tcontent: ,\n\tedit: ,\n\tcanMakePayment: () => settings.canMakePayment,\n\tariaLabel: label,\n\tsupports: {\n\t\tfeatures: settings.supports,\n\t},\n};\n\nregisterPaymentMethod( Wallet );\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wc\"][\"wcBlocksRegistry\"];","module.exports = window[\"wc\"][\"wcSettings\"];","module.exports = window[\"wp\"][\"htmlEntities\"];","module.exports = window[\"wp\"][\"i18n\"];","// 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","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};","// 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};","// 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\t\"payment-method/index\": 0,\n\t\"payment-method/style-index\": 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 = globalThis[\"webpackChunkwoo_wallet\"] = globalThis[\"webpackChunkwoo_wallet\"] || [];\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, [\"payment-method/style-index\"], () => (__webpack_require__(\"./src/payment-method/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["sprintf","__","registerPaymentMethod","decodeEntities","getSetting","settings","defaultLabel","label","title","Content","description","formatedBalance","balance","currency_symbol","decimal_separator","thousand_separator","decimals","numericAmount","parseFloat","isNaN","amount","fixedAmount","toFixed","parts","split","replace","formattedAmount","join","CurrentBalance","createElement","Label","props","PaymentMethodLabel","components","Fragment","text","Wallet","name","content","edit","canMakePayment","ariaLabel","supports","features"],"sourceRoot":""}