File "index.js"

Full Path: /home/vantageo/public_html/cache/.wp-cli/wp-content/plugins/woocommerce/packages/woocommerce-admin/dist/currency/index.js
File size: 5.53 KB
MIME-type: text/plain
Charset: utf-8

this.wc=this.wc||{},this.wc.currency=function(e){var r={};function t(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=e,t.c=r,t.d=function(e,r,o){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)t.d(o,n,function(r){return e[r]}.bind(null,n));return o},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=580)}({0:function(e,r){e.exports=window.wp.element},2:function(e,r){e.exports=window.wp.i18n},203:function(e,r){e.exports=window.wp.deprecated},278:function(e,r){e.exports=window.wc.number},4:function(e,r){e.exports=function(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}},580:function(e,r,t){"use strict";t.r(r),t.d(r,"getCurrencyData",(function(){return d}));var o=t(4),n=t.n(o),i=t(0),a=t(99),c=t(2),s=t(278),u=t(203),l=t.n(u);function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function m(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?p(Object(t),!0).forEach((function(r){n()(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function d(){return l()("getCurrencyData",{version:"3.1.0",alternative:"CurrencyFactory.getDataForCountry",plugin:"WooCommerce Admin",hint:"Pass in the country, locale data, and symbol info to use getDataForCountry"}),{US:{code:"USD",symbol:"$",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2},EU:{code:"EUR",symbol:"€",symbolPosition:"left",thousandSeparator:".",decimalSeparator:",",precision:2},IN:{code:"INR",symbol:"₹",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2},GB:{code:"GBP",symbol:"£",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2},BR:{code:"BRL",symbol:"R$",symbolPosition:"left",thousandSeparator:".",decimalSeparator:",",precision:2},VN:{code:"VND",symbol:"₫",symbolPosition:"right",thousandSeparator:".",decimalSeparator:",",precision:1},ID:{code:"IDR",symbol:"Rp",symbolPosition:"left",thousandSeparator:".",decimalSeparator:",",precision:0},BD:{code:"BDT",symbol:"৳",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:0},PK:{code:"PKR",symbol:"₨",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2},RU:{code:"RUB",symbol:"₽",symbolPosition:"right",thousandSeparator:" ",decimalSeparator:",",precision:2},TR:{code:"TRY",symbol:"₺",symbolPosition:"left",thousandSeparator:".",decimalSeparator:",",precision:2},MX:{code:"MXN",symbol:"$",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2},CA:{code:"CAD",symbol:"$",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2}}}r.default=function(e){var r;function t(e){var t=m(m({},{code:"USD",symbol:"$",symbolPosition:"left",thousandSeparator:",",decimalSeparator:".",precision:2}),e);r={code:t.code.toString(),symbol:t.symbol.toString(),symbolPosition:t.symbolPosition.toString(),decimalSeparator:t.decimalSeparator.toString(),priceFormat:n(t),thousandSeparator:t.thousandSeparator.toString(),precision:parseInt(t.precision,10)}}function o(e){var t=Object(s.numberFormat)(r,e);if(""===t)return t;var o=r,n=o.priceFormat,i=o.symbol;return Object(c.sprintf)(n,i,t)}function n(e){if(e.priceFormat)return r=e.priceFormat.toString(),(t=document.createElement("DIV")).innerHTML=r,t.textContent||t.innerText||"";var r,t;switch(e.symbolPosition){case"left":return"%1$s%2$s";case"right":return"%2$s%1$s";case"left_space":return"%1$s %2$s";case"right_space":return"%2$s %1$s"}return"%1$s%2$s"}return t(e),{getCurrencyConfig:function(){return m({},r)},getDataForCountry:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r[e]||{},n=t[o.currency_code];return n?{code:o.currency_code,symbol:Object(a.decodeEntities)(n),symbolPosition:o.currency_pos,thousandSeparator:o.thousand_sep,decimalSeparator:o.decimal_sep,precision:o.num_decimals}:{}},setCurrency:t,formatAmount:o,formatCurrency:function(e){return l()("Currency().formatCurrency",{version:"5.0.0",alternative:"Currency().formatAmount",plugin:"WooCommerce",hint:"`formatAmount` accepts the same arguments as formatCurrency"}),o(e)},getPriceFormat:n,formatDecimal:function(e){if("number"!=typeof e&&(e=parseFloat(e)),Number.isNaN(e))return 0;var t=r.precision;return Math.round(e*Math.pow(10,t))/Math.pow(10,t)},formatDecimalString:function(e){if("number"!=typeof e&&(e=parseFloat(e)),Number.isNaN(e))return"";var t=r.precision;return e.toFixed(t)},render:function(e){return"number"!=typeof e&&(e=parseFloat(e)),e<0?Object(i.createElement)("span",{className:"is-negative"},o(e)):o(e)}}}},99:function(e,r){e.exports=window.wp.htmlEntities}});