{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/WOOMC/Currency/Selector/src/Currency.js","webpack:///./src/WOOMC/Currency/Selector/src/CurrencyCookie.js","webpack:///./src/WOOMC/Currency/Selector/src/Page.js","webpack:///./src/WOOMC/Currency/Selector/src/Reloaded.js","webpack:///./src/WOOMC/Currency/Selector/src/currency-selector.js","webpack:///./src/WOOMC/Currency/Selector/src/Prerequisites.js","webpack:///./src/WOOMC/Currency/Selector/src/Cache.js","webpack:///./src/WOOMC/Currency/Selector/src/flags/index.js","webpack:///./src/WOOMC/Currency/Selector/src/flags/Setup.js","webpack:///./src/WOOMC/Currency/Selector/src/flags/Hook.js","webpack:///./src/WOOMC/Currency/Selector/src/flags/Style.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","CurrencyCookie","require","Page","change","currency","$body","jQuery","document","body","set","trigger","reload_timeout","setTimeout","reload","on","clearTimeout","equals","cookie","split","some","item","includes","woomc","cookieSettings","expires","notAsCached","currentURL","appendTo","submit","RELOADED_NAME","unset","isSet","trim","startsWith","Prerequisites","Currency","Cache","Flags","$","met","bust","currencySelectorDOM","this","length","go","msg","console","error","window","location","search","indexOf","Reloaded","history","replaceState","href","widget","ui","selectmenu","_renderMenu","ul","items","that","each","index","_renderItemData","parent","addClass","_renderItem","li","wrapper","text","label","toLowerCase","prependTo","append","_resizeButton","width","options","element","show","outerWidth","hide","button","_drawButton","selectedOption","find","ids","attr","_on","click","event","focus","preventDefault","tabindex","disabled","id","role","menu","insertAfter","val","buttonText","_setText","_buttonEvents","one","menuItems","_refreshMenu","_hoverable","_focusable","data","iconSelectMenu","$stdSelect","css","props","test","navigator","userAgent","concat","forEach","prop","prop_css","$link_selector","rel","type","url","currencySelectorCSS","toAdd","currencyFlagsCSS","$title","first","after","head","prepend"],"mappings":"aAC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C,kBAGPhE,KAAKiE,WAAWjE,KAAKyC,QACrBzC,KAAKkE,WAAWlE,KAAKyC,c,gBCvGxB,IAAMhD,EAAWlC,EAAQ,GAuBzBlC,EAAOD,QAAU,CAChB8E,GAhBU,SAACN,GAEXA,EAAEhB,MAAMmB,qBAAqBsB,MAAK,WAC7BzB,EAAEI,MAAMmE,KAAK,SAChBvE,EAAEI,MAAMoE,eACP,CACC3G,OAAQ,SAAUwF,EAAOkB,GACxB1E,EAAShC,OAAO0G,EAAKzF,KAAKnC,gB,cC4EhClB,EAAOD,QAAU,CAChB8E,GAvFU,SAACN,GACX,IAAIyE,EAAazE,EAAEhB,MAAMmB,qBACrBuE,EAAM,mDAGNC,EAAQ,CACX,aACA,SACA,gBACA,QACA,WAIG,eAAeC,KAAKC,UAAUC,UAAU3C,iBAC3CwC,EAAQA,EAAMI,OAAO,CACpB,mBACA,mBACA,mBACA,mBACA,qBACA,qBACA,qBACA,sBACA,sBACA,sBACA,oBACA,oBACA,oBACA,cACA,gBACA,oBAKFJ,EAAMK,SAAQ,SAAUC,GACvB,IAAIC,EAAWT,EAAWC,IAAIO,GAC1BC,IACHR,GAAOO,EAAO,IAAMC,EAAW,QAGjCR,GAAO,qBACPA,GAAO,IAKP,IAAIS,EAAiBnF,EAAE,SAAU,CAChC0D,GAAI,oCACJ0B,IAAK,aACLC,KAAM,WACNpE,KAAMjC,MAAMsG,IAAIC,sBAkBbC,EAAQ,CAhBMxF,EAAE,SAAU,CAC7B0D,GAAI,iCACJ0B,IAAK,aACLC,KAAM,WACNpE,KAAMjC,MAAMsG,IAAIG,mBAYSN,EANPnF,EAAE,UAAW,CAC/B0D,GAAI,0CACJ2B,KAAM,aAELpD,KAAKyC,IAQHgB,EAAS1F,EAAE,cAEX0F,EAAOrF,OACVqF,EAAOC,QAAQC,MAAMJ,GAErBxF,EAAE/B,SAAS4H,MAAMC,QAAQN","file":"currency-selector.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n","/*\n * Copyright (c) 2020, TIV.NET INC. All Rights Reserved.\n */\n\nconst CurrencyCookie = require(\"./CurrencyCookie\");\nconst Page = require(\"./Page\");\n\n/**\n * Change currency.\n *\n * @param {string} currency The currency code.\n */\nconst change = function (currency) {\n\n\tconst TIMEOUT = 2000;\n\tconst $body = jQuery(document.body);\n\n\tCurrencyCookie.set(currency);\n\n\t/**\n\t * Trigger the \"refresh fragments\" AJAX to update the mini-cart widget and the top bar cart icon totals.\n\t *\n\t * Related: @see \\WOOMC\\MultiCurrency\\App::action__wc_ajax_get_refreshed_fragments\n\t *\n\t * @since 1.9.0\n\t */\n\t$body.trigger(\"wc_fragment_refresh\");\n\n\t/**\n\t * Reload page when fragments refreshed or after timeout.\n\t * If reloaded immediately, fragments refresh is aborted.\n\t */\n\tlet reload_timeout = setTimeout(Page.reload, TIMEOUT);\n\t$body.on(\"wc_fragments_refreshed\", function () {\n\t\tclearTimeout(reload_timeout);\n\t\tPage.reload();\n\t});\n};\n\nmodule.exports = {\n\tchange\n};\n","/*\n * Copyright (c) 2020, TIV.NET INC. All Rights Reserved.\n */\n\n/**\n * Save currency in cookie.\n *\n * @param {string} currency The currency code.\n */\nconst set = (currency) => {\n\tdocument.cookie = `${woomc.cookieSettings.name}=${currency};path=/;max-age=${woomc.cookieSettings.expires};samesite=strict`;\n};\n\nconst equals = (currency) => {\n\treturn document.cookie.split(\";\").some((item) => item.includes(`${woomc.cookieSettings.name}=${currency}`));\n};\n\nconst notAsCached = () => {\n\treturn !equals(woomc.currency);\n};\n\n\nmodule.exports = {\n\tset,\n\tequals,\n\tnotAsCached\n};\n","/*\n * Copyright (c) 2020, TIV.NET INC. All Rights Reserved.\n */\n\n/**\n * Force reloading page from the server.\n *\n * @since 1.20.1\n * @since 1.20.2 Set also a special cookie because not all themes have the body class filter.\n */\n\nconst reload = () => {\n\n\trequire(\"./Reloaded\").set();\n\n\tjQuery(\"<form>\",\n\t\t{\n\t\t\t\"method\": \"post\",\n\t\t\t\"action\": woomc.currentURL\n\t\t}\n\t)\n\t\t.appendTo(document.body)\n\t\t.submit()\n\t;\n};\n\nmodule.exports = {\n\treload\n};\n","/*\n * Copyright (c) 2020, TIV.NET INC. All Rights Reserved.\n */\n\nconst RELOADED_NAME = \"woocommerce-multicurrency-reloaded\";\n\nconst set = () => {\n\tdocument.cookie = `${RELOADED_NAME}=1`;\n};\n\nconst unset = () => {\n\tdocument.cookie = `${RELOADED_NAME}=; expires=Thu, 01 Jan 1970 00:00:00 GMT`;\n};\n\nconst isSet = () => {\n\treturn document.cookie.split(\";\").some((item) => item.trim().startsWith(`${RELOADED_NAME}=`))\n};\n\nmodule.exports = {\n\tset,\n\tunset,\n\tisSet\n};\n","/**\n * JS to handle the currency selector.\n *\n * @package WooCommerce-MultiCurrency\n *\n * @since 1.17.0\n *\n * Copyright (c) 2019, TIV.NET INC. All Rights Reserved.\n */\n/*global woomc*/\n\nimport \"./currency-selector.scss\";\n\nconst Prerequisites = require(\"./Prerequisites\");\nconst Currency = require(\"./Currency\");\nconst Cache = require(\"./Cache\");\nconst Flags = require(\"./flags/index\");\n\njQuery(function ($) {\n\n\tif (!Prerequisites.met()) {\n\t\treturn;\n\t}\n\n\t/**\n\t * @namespace woomc\n\t * @property {string} currencySelectorDOM\n\t * @property {string} currentURL\n\t * @property {string} currency\n\t * @property {Object} cookieSettings\n\t * @property {string} cookieSettings.name\n\t * @property {number} cookieSettings.expires\n\t * @property {string} url.currencySelectorCSS\n\t * @property {string} url.currencyFlagsCSS\n\t */\n\n\t/**\n\t * Check if we need to reload the outdated cached page.\n\t *\n\t * @since 1.20.1\n\t */\n\tCache.bust();\n\n\t/**\n\t * Hook the standard <select> to change currency.\n\t */\n\t$(woomc.currencySelectorDOM).on(\"change\", function () {\n\t\tCurrency.change(this.value);\n\t});\n\n\t/**\n\t * Run the \"flags\" if there are shortcodes with data-flag set.\n\t * @since 2.5.2\n\t */\n\tif ($(woomc.currencySelectorDOM + \"[data-flag=1]\").length) {\n\t\tFlags.go($);\n\t}\n});\n","/*\n * Copyright (c) 2020, TIV.NET INC. All Rights Reserved.\n */\n\n/**\n * Display console error message.\n * @param msg The message text.\n */\nconst errorMessage = (msg) => {\n\tconsole.error(`WooCommerce-Multicurrency error: ${msg}.`);\n};\n\n/**\n * Check if prerequisites met.\n * @returns {boolean}\n */\nconst met = () => {\n\n\tif (\"undefined\" === typeof woomc) {\n\t\terrorMessage(\"undefined 'woomc'.\");\n\t\treturn false;\n\t}\n\n\treturn true;\n\n};\n\nmodule.exports = {\n\tmet\n};\n","/*\n * Copyright (c) 2020, TIV.NET INC. All Rights Reserved.\n */\n\n/**\n * If the body class' currency does not match the currency cookie,\n * we assume that the page is cached. We'll try to reload it.\n *\n * @since 1.20.1\n * @since 1.20.2 Check for a special cookie because not all themes have the body class filter.\n * @since 2.0.0 Do not use body class for checking. Use the woomc.currency var set by backend.\n */\nconst bust = () => {\n\n\t// Currency is set via URL. No additional processing is needed.\n\tif (window.location.search.indexOf(\"currency=\") > 0) {\n\t\treturn;\n\t}\n\n\t/**\n\t * The `reloaded` cookie tells that the page was just reloaded.\n\t * To avoid endless loop, we check for it and do not reload.\n\t */\n\tconst Reloaded = require(\"./Reloaded\");\n\tif (Reloaded.isSet()) {\n\t\tReloaded.unset();\n\t\t// Also, we try a trick to make the browser forgetting that we reloaded using a POST.\n\t\t// Otherwise, if people try F5, browser prompts for form re-submission.\n\t\tif (window.history.replaceState) {\n\t\t\twindow.history.replaceState(null, null, window.location.href);\n\t\t}\n\t\treturn;\n\t}\n\n\tconst CurrencyCookie = require(\"./CurrencyCookie\");\n\tif (CurrencyCookie.notAsCached()) {\n\t\tconst Page = require(\"./Page\");\n\t\tPage.reload();\n\t}\n};\n\nmodule.exports = {\n\tbust\n};\n","/*\n * Widget with flags\n *\n * @since 1.17.0\n * @link  https://jqueryui.com/selectmenu/#product-selection\n *\n * Copyright (c) 2020, TIV.NET INC. All Rights Reserved.\n */\n\n/**\n * Controller.\n *\n * @param {jQuery} $\n */\nconst go = ($) => {\n\n\t/**\n\t * @since 2.0.0 Prevent Type Error when jquery-ui is not loaded for any reason.\n\t */\n\tif (\"function\" !== typeof $.widget || \"undefined\" === typeof $.ui) {\n\t\treturn;\n\t}\n\n\trequire(\"./Setup\").go($);\n\trequire(\"./Hook\").go($);\n\trequire(\"./Style\").go($);\n};\n\nmodule.exports = {\n\tgo\n};\n","/*\n * Copyright (c) 2020, TIV.NET INC. All Rights Reserved.\n */\n\nconst go = ($) => {\n\n\t$.widget(\"custom.iconSelectMenu\", $.ui.selectmenu, {\n\n\t\t/**\n\t\t * Override _renderMenu in order to set wrapping CSS class.\n\t\t * @link https://api.jqueryui.com/selectmenu/#method-_renderMenu\n\t\t * @since 2.4.1\n\t\t * @param ul The list element.\n\t\t * @param items The list items.\n\t\t * @private\n\t\t */\n\t\t_renderMenu: function (ul, items) {\n\t\t\tvar that = this;\n\t\t\t$.each(items, function (index, item) {\n\t\t\t\tthat._renderItemData(ul, item);\n\t\t\t});\n\t\t\t$(ul).parent().addClass('woocommerce-currency-selector-dropdown');\n\t\t},\n\n\t\t// Items are the dropdown list elements. Here we add the flags CSS to each.\n\t\t_renderItem: function (ul, item) {\n\t\t\tvar li = $(\"<li>\");\n\t\t\tvar wrapper = $(\"<div>\", {\n\t\t\t\t\"class\": \"woocommerce-currency-selector-option\",\n\t\t\t\ttext: item.label\n\t\t\t});\n\n\t\t\t$(\"<span>\", {\"class\": \"currency-flag currency-flag-\" + item.value.toLowerCase()}).prependTo(wrapper);\n\n\t\t\treturn li.append(wrapper).appendTo(ul);\n\t\t},\n\n\t\t// Button is what we see when the dropdown is closed: the currently selected element. Here we adjust its width.\n\t\t_resizeButton: function () {\n\t\t\tvar width = this.options.width;\n\n\t\t\tif (!width) {\n\t\t\t\twidth = this.element.show().outerWidth();\n\t\t\t\tthis.element.hide();\n\t\t\t}\n\n\t\t\t// Increase width to fit the flag\n\t\t\twidth += 18;\n\n\t\t\tthis.button.outerWidth(width);\n\t\t},\n\n\t\t// ...and here we add the flag to it.\n\t\t_drawButton: function () {\n\t\t\tvar that = this;\n\t\t\tvar selectedOption = this.element.find(\"option:selected\");\n\n\t\t\t// Associate existing label with the new button\n\t\t\tthis.label = $(\"label[for='\" + this.ids.element + \"']\").attr(\"for\", this.ids.button);\n\t\t\tthis._on(this.label, {\n\t\t\t\tclick: function (event) {\n\t\t\t\t\t// noinspection JSPotentiallyInvalidUsageOfThis\n\t\t\t\t\tthis.button.focus();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Hide original select element\n\t\t\tthis.element.hide();\n\n\t\t\t// Create button\n\t\t\tthis.button = $(\"<div>\", {\n\t\t\t\t\"class\": \"ui-widget\",\n\t\t\t\ttabindex: this.options.disabled ? -1 : 0,\n\t\t\t\tid: this.ids.button,\n\t\t\t\trole: \"combobox\",\n\t\t\t\t\"aria-expanded\": \"false\",\n\t\t\t\t\"aria-autocomplete\": \"list\",\n\t\t\t\t\"aria-owns\": this.ids.menu,\n\t\t\t\t\"aria-haspopup\": \"true\"\n\t\t\t})\n\t\t\t\t.insertAfter(this.element);\n\n\t\t\t$(\"<span>\", {\n\t\t\t\t\"class\": \"currency-flag currency-flag-\" + selectedOption.val().toLowerCase()\n\t\t\t})\n\t\t\t\t.prependTo(this.button);\n\n\n\t\t\tthis.buttonText = $(\"<span>\", {\n\t\t\t\t\"class\": \"ui-selectmenu-text\"\n\t\t\t})\n\t\t\t\t.appendTo(this.button);\n\n\t\t\tthis._setText(this.buttonText, selectedOption.text());\n\t\t\tthis._resizeButton();\n\n\t\t\tthis._on(this.button, this._buttonEvents);\n\t\t\tthis.button.one(\"focusin\", function () {\n\n\t\t\t\t// Delay rendering the menu items until the button receives focus.\n\t\t\t\t// The menu may have already been rendered via a programmatic open.\n\t\t\t\tif (!that.menuItems) {\n\t\t\t\t\tthat._refreshMenu();\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._hoverable(this.button);\n\t\t\tthis._focusable(this.button);\n\t\t}\n\n\t});\n};\n\nmodule.exports = {\n\tgo\n};\n","/*\n * Copyright (c) 2020, TIV.NET INC. All Rights Reserved.\n */\n\nconst Currency = require(\"../Currency\");\n\n/**\n * Convert each SELECT with data-flag=1 to \"flags\" menu.\n * Hook each menu option to the change currency function.\n *\n * @param {jQuery} $\n */\nconst go = ($) => {\n\n\t$(woomc.currencySelectorDOM).each(function () {\n\t\tif ($(this).data(\"flag\")) {\n\t\t\t$(this).iconSelectMenu(\n\t\t\t\t{\n\t\t\t\t\tchange: function (event, data) {\n\t\t\t\t\t\tCurrency.change(data.item.value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t});\n}\n\nmodule.exports = {\n\tgo\n};\n","/*\n * Copyright (c) 2020, TIV.NET INC. All Rights Reserved.\n */\n\n/**\n * Copy some CSS styles from standard SELECT to the flags dropdown.\n * @since 2.5.2\n * @param {jQuery} $\n */\nconst go = ($) => {\n\tvar $stdSelect = $(woomc.currencySelectorDOM);\n\tvar css = \".woocommerce-currency-selector-wrap .ui-widget {\";\n\n\t// For Chrome, those are enough.\n\tvar props = [\n\t\t\"background\",\n\t\t\"border\",\n\t\t\"border-radius\",\n\t\t\"color\",\n\t\t\"padding\",\n\t];\n\n\t// Firefox and Edge do not return shorthand properties.\n\tif (/firefox|edge/.test(navigator.userAgent.toLowerCase())) {\n\t\tprops = props.concat([\n\t\t\t\"background-color\",\n\t\t\t\"border-top-color\",\n\t\t\t\"border-top-style\",\n\t\t\t\"border-top-width\",\n\t\t\t\"border-right-color\",\n\t\t\t\"border-right-style\",\n\t\t\t\"border-right-width\",\n\t\t\t\"border-bottom-color\",\n\t\t\t\"border-bottom-style\",\n\t\t\t\"border-bottom-width\",\n\t\t\t\"border-left-color\",\n\t\t\t\"border-left-style\",\n\t\t\t\"border-left-width\",\n\t\t\t\"padding-top\",\n\t\t\t\"padding-right\",\n\t\t\t\"padding-bottom\",\n\t\t\t// No padding-left - see 2px below.\n\t\t]);\n\t}\n\n\tprops.forEach(function (prop) {\n\t\tvar prop_css = $stdSelect.css(prop);\n\t\tif (prop_css) {\n\t\t\tcss += prop + \":\" + prop_css + \";\";\n\t\t}\n\t})\n\tcss += \"padding-left: 2px;\";\n\tcss += \"}\";\n\n\t/**\n\t * CSS links to static jQuery-UI select menu styling and flags.\n\t */\n\tvar $link_selector = $(\"<link>\", {\n\t\tid: \"woocommerce-currency-selector-css\",\n\t\trel: \"stylesheet\",\n\t\ttype: \"text/css\",\n\t\thref: woomc.url.currencySelectorCSS\n\t});\n\tvar $link_flags = $(\"<link>\", {\n\t\tid: \"woocommerce-currency-flags-css\",\n\t\trel: \"stylesheet\",\n\t\ttype: \"text/css\",\n\t\thref: woomc.url.currencyFlagsCSS\n\t});\n\n\t/**\n\t * STYLE tag with rules copied from the theme.\n\t */\n\tvar $style_theme = $(\"<style>\", {\n\t\tid: \"woocommerce-currency-selector-theme-css\",\n\t\ttype: \"text/css\"\n\t})\n\t\t.text(css);\n\n\tvar toAdd = [$link_flags, $link_selector, $style_theme];\n\n\t/**\n\t * Add to the HEAD, right after the TITLE.\n\t * Fallback (no title?) is the first line in the HEAD.\n\t */\n\tvar $title = $(\"head title\");\n\n\tif ($title.length) {\n\t\t$title.first().after(toAdd);\n\t} else {\n\t\t$(document.head).prepend(toAdd);\n\t}\n\n};\n\nmodule.exports = {\n\tgo\n};\n"],"sourceRoot":""}