From 58460a70cc7265e628c1a7dbb221e4233c17bb30 Mon Sep 17 00:00:00 2001 From: Benjamin Pick Date: Tue, 9 Nov 2021 18:49:02 +0100 Subject: [PATCH] show-if: display none important did not work in all cases --- js/dist/frontend.js | 2 +- js/dist/frontend.js.map | 2 +- js/lookup/get_info.js | 2 +- js/main.js | 4 +++- js/shortcodes/onchange.js | 8 ++++++-- js/shortcodes/show-if.js | 6 +++++- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/js/dist/frontend.js b/js/dist/frontend.js index e1b95d39..95c5771d 100644 --- a/js/dist/frontend.js +++ b/js/dist/frontend.js @@ -1,2 +1,2 @@ -!function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},t={},r={},o=e.parcelRequire94b4;null==o&&((o=function(e){if(e in t)return t[e].exports;if(e in r){var o=r[e];delete r[e];var n={id:e,exports:{}};return t[e]=n,o.call(n.exports,n,n.exports),n.exports}var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){r[e]=t},e.parcelRequire94b4=o);var n={},a={};(a=function(e){return e&&e.__esModule?e:{default:e}}).default=a,a.__esModule=!0,Object.defineProperty(n,"__esModule",{value:!0}),n.get_info=function(){return ce.apply(this,arguments)},n.options=void 0,o.register("3qYWT",(function(e,t){e.exports=o("ioxmE")})),o.register("ioxmE",(function(e,t){var r=function(e){var t,r=Object.prototype,o=r.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},a=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",u=n.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function c(e,t,r,o){var n=t&&t.prototype instanceof _?t:_,a=Object.create(n.prototype),i=new S(o||[]);return a._invoke=function(e,t,r){var o=f;return function(n,a){if(o===p)throw new Error("Generator is already running");if(o===h){if("throw"===n)throw a;return P()}for(r.method=n,r.arg=a;;){var i=r.delegate;if(i){var u=k(i,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var s=l(e,t,r);if("normal"===s.type){if(o=r.done?h:d,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=h,r.method="throw",r.arg=s.arg)}}}(e,r,i),a}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",d="suspendedYield",p="executing",h="completed",v={};function _(){}function y(){}function g(){}var m={};s(m,a,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(T([])));w&&w!==r&&o.call(w,a)&&(m=w);var x=g.prototype=_.prototype=Object.create(m);function E(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(n,a,i,u){var s=l(e[n],e,a);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,i,u)}),(function(e){r("throw",e,i,u)})):t.resolve(f).then((function(e){c.value=e,i(c)}),(function(e){return r("throw",e,i,u)}))}u(s.arg)}var n;this._invoke=function(e,o){function a(){return new t((function(t,n){r(e,o,t,n)}))}return n=n?n.then(a,a):a()}}function k(e,r){var o=e.iterator[r.method];if(o===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var n=l(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,v;var a=n.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function T(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function r(){for(;++n=0;--a){var i=this.tryEntries[a],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;L(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,o){return this.delegate={iterator:T(e),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}));var i=a(o("3qYWT"));o.register("hDdED",(function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0}));var u=a(o("hDdED"));o.register("2fiVm",(function(e,t){function r(e,t,r,o,n,a,i){try{var u=e[a](i),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(o,n)}e.exports=function(e){return function(){var t=this,o=arguments;return new Promise((function(n,a){var i=e.apply(t,o);function u(e){r(i,n,a,u,s,"next",e)}function s(e){r(i,n,a,u,s,"throw",e)}u(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0}));var s=a(o("2fiVm"));o.register("VIOjt",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.default=e.exports.camelToUnderscore=void 0;var r=a(o("17dzk")),n=a(o("eq7aj")),i=a(o("hDdED")),u=a(o("bIbJ7")),s=function(e,t){if("object"===i.default(e)&&null!==e){if("object"===i.default(e.names)&&"object"===i.default(t))for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"";t=this._process_locales(t),".name"===e.substr(-5)&&(e=e.substr(0,e.length-5));var o=this.get_raw(e);return null!==(o=s(o,t))&&""!==o||(o=r),o}},{key:"_process_locales",value:function(e){return"string"==typeof e&&(e=[e]),Array.isArray(e)&&0!==e.length||(e=this.default_locales),e}},{key:"get_with_locales",value:function(e,t,r){var o=this._lookup_with_locales(e,t,r);return"object"===i.default(o)&&console.warn('Geolocation IP Detection: The property "'+e+'" is of type "'+i.default(o)+'", should be string or similar',o),void 0===o?(console.warn('Geolocation IP Detection: The property "'+e+'" is not defined, please check spelling or maybe you need a different data source',{data:this.data}),""):o}},{key:"get_country_iso",value:function(){var e=this.get("country.iso_code");return e&&(e=e.substr(0,2).toLowerCase()),e}},{key:"is_empty",value:function(){return this.get("is_empty",!1)}},{key:"error",value:function(){return this.get_raw("extra.error")||""}},{key:"serialize",value:function(){return this.data}}]),e}();e.exports.default=l})),o.register("17dzk",(function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0})),o.register("eq7aj",(function(e,t){function r(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GET",r=new XMLHttpRequest;return new Promise((function(o,n){r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300?o(r):n({status:r.status,statusText:r.statusText,request:r}))},r.open(t||"GET",e,!0),r.send()}))};l.makeRequest=p;var h=function(e){try{return JSON.parse(e)}catch(t){return v("Invalid JSON: "+e)}};function v(e){return{is_empty:!0,extra:{error:e}}}l.jsonDecodeIfPossible=h;var _=function(){var e=d.default(f.default.mark((function e(t){var r,o,n=arguments;return f.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:"GET",e.prev=1,e.next=4,p(t,r);case 4:if((o=e.sent).responseText&&"0"!==o.responseText){e.next=7;break}return e.abrupt("return",v("Got an empty response from server. Did you enable AJAX in the options?"));case 7:return e.abrupt("return",h(o.responseText));case 10:return e.prev=10,e.t0=e.catch(1),e.abrupt("return",h(e.t0.request.responseText));case 13:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t){return e.apply(this,arguments)}}();l.makeJSONRequest=_;var y={};Object.defineProperty(y,"__esModule",{value:!0}),y.set_override_with_merge=function(e,t,r){var o=oe()||{};e=e||"",e=b.camelToUnderscore(e);var n=x.default(o,e);"object"==g.default(n)&&"object"==g.default(n.names)&&(e+=".name");e.endsWith(".name")&&(e+="s",t={en:t});w.default(o,e,t),re(o,r)},y.set_override=re,y.remove_override=function(){return m.setLocalStorage(n.options.cookie_name,{},-1),!0},y.getRecordDataFromLocalStorage=oe,y.setRecordDataToLocalStorage=function(e,t){m.setLocalStorage(n.options.cookie_name,e,t)},y.get_info_stored_locally_record=function(){return new b.default(oe(),n.options.default_locales)};var g=a(o("hDdED")),m={};Object.defineProperty(m,"__esModule",{value:!0}),m.getLocalStorage=m.setLocalStorage=void 0;m.setLocalStorage=function(e,t,r){var o={value:t,expires_at:(new Date).getTime()+1e3*r/1};localStorage.setItem(e.toString(),JSON.stringify(o))};m.getLocalStorage=function(e){var t=null;try{t=JSON.parse(localStorage.getItem(e.toString()))}catch(e){return null}if(null!==t){if(!(null!==t.expires_at&&t.expires_at<(new Date).getTime()))return t.value;localStorage.removeItem(e.toString())}return null};var b=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o("hDdED")(e)&&"function"!=typeof e)return{default:e};var r=te(t);if(r&&r.has(e))return r.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=a?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(o("VIOjt"));o.register("jTtDb",(function(e,t){function r(e){if("__proto__"===e||"constructor"===e||"prototype"===e)throw new Error("setting of prototype values not supported")}e.exports=function(e,t,o){var n,a,i;Array.isArray(t)&&(n=t.slice(0));"string"==typeof t&&(n=t.split("."));"symbol"==typeof t&&(n=[t]);if(!Array.isArray(n))throw new Error("props arg must be an array, a string or a symbol");if(!(a=n.pop()))return!1;r(a);for(;i=n.shift();)if(r(i),void 0===e[i]&&(e[i]={}),!(e=e[i])||"object"!=typeof e)return!1;return e[a]=o,!0}}));var w=a(o("jTtDb")),x=a(o("bIbJ7"));o.register("30kHV",(function(e,t){e.exports=function(e,t,r){var o=null,n=null,a=function(){o&&(clearTimeout(o),n=null,o=null)},i=function(){if(!t)return e.apply(this,arguments);var i=this,u=arguments,s=r&&!o;return a(),n=function(){e.apply(i,u)},o=setTimeout((function(){if(o=null,!s){var e=n;return n=null,e()}}),t),s?n():void 0};return i.cancel=a,i.flush=function(){var e=n;a(),e&&e()},i}}));a(o("30kHV"));o.register("cbzha",(function(e,t){function r(e,t){return e===t||(e!=e&&t!=t||{}.toString.call(e)=={}.toString.call(t)&&(e===Object(e)&&(!!e&&(Array.isArray(e)?o(e,t):"[object Set]"=={}.toString.call(e)?o(Array.from(e),Array.from(t)):"[object Object]"=={}.toString.call(e)?function(e,t){var o=Object.keys(e).sort(),n=Object.keys(t).sort(),a=o.length;if(a!=n.length)return!1;for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:null,o=A(e);r=r||o.property,o.skip_cache&&console.warn("Geolocation IP Detection: The property 'skip_cache' is ignored in AJAX mode. You could disable the response caching on the server by setting the constant GEOIP_DETECT_READER_CACHE_TIME.");return t.get_with_locales(r,o.lang,o.default)};var D=a(o("3qYWT")),I=a(o("2fiVm"));function A(e){var t=e.getAttribute("data-options");try{return JSON.parse(t)}catch(e){return{}}}function M(){return(M=I.default(D.default.mark((function e(t,r,o){var a,i;return D.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=document.getElementsByClassName(t)).length){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,n.get_info();case 5:if(!(i=e.sent).error()){e.next=9;break}return console.error("Geolocation IP Detection Error ("+r+"): "+i.error()),e.abrupt("return");case 9:Array.from(a).forEach((function(e){return o(e,i)}));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var N={};Object.defineProperty(N,"__esModule",{value:!0}),N.do_shortcode_normal=function(e,t){e.innerText=P.get_value_from_record(e,t)},N.do_shortcode_flags=function(e,t){var r=t.get_country_iso()||P.get_options(e).default;r&&e.classList.add("flag-icon-"+r)},N.do_shortcode_country_select=function(e,t){var r=t.get_country_iso();if(S.selectItemByAttribute(e,"data-c",r))R.triggerNativeEvent(e,"change");else{var o=P.get_options(e).default;P.get_options(e).default&&S.selectItemByAttribute(e,"data-c",o)&&R.triggerNativeEvent(e,"change")}},N.do_shortcode_text_input=function(e,t){e.value=P.get_value_from_record(e,t),R.triggerNativeEvent(e,"change")};var R={};Object.defineProperty(R,"__esModule",{value:!0}),R.isInternalEvent=function(){return G},R.triggerNativeEvent=function(e,t){if(G=!0,document.createEvent){var r=document.createEvent("HTMLEvents");r.initEvent(t,!0,!1),e.dispatchEvent(r)}else e.fireEvent("on"+t);G=!1};var G=!1;var q={};Object.defineProperty(q,"__esModule",{value:!0}),q.init=function(){document.addEventListener("change",V,!1)};var J=!1,C=0;function V(e){if(!R.isInternalEvent()){var t=e.target;if(t.matches(".js-geoip-detect-input-autosave")){console.log("autosave on change",t);var r=P.get_options(t).property,o=t.value;if(o){if(C++,J||C>100)return void console.warn("Thats weird! autosave change detected a recursion!");if(J=!0,t.matches("select.js-geoip-detect-country-select")){var n=t.options[t.selectedIndex],a=null==n?void 0:n.getAttribute("data-c");a&&y.set_override_with_merge("country.iso_code",a.toUpperCase(),{reevaluate:!1})}y.set_override_with_merge(r,o),J=!1}}}}var W={};Object.defineProperty(W,"__esModule",{value:!0}),W.do_shortcode_show_if=function(e,t){var r=P.get_options(e);z(r.parsed,r,t)?e.style.display="":e.style.display="none !important"},W.geoip_detect2_shortcode_evaluate_conditions=z;var F=a(o("hDdED"));o.register("czPBu",(function(e,t){e.exports=function(e,t){if(!Array.isArray(e)||!Array.isArray(t))throw new Error("expected both arguments to be arrays");for(var r=[],o=e.length,n=0;n-1&&-1==r.indexOf(a)&&r.push(a)}return r}}));var U=a(o("czPBu"));function z(e,t,r){var o=["name","iso_code","iso_code3","code","geoname_id"],n="or"!==e.op;return e.conditions.forEach((function(a){var i=!1,u=[],s=r.get_raw(a.p);null===s?i=!1:"object"===F.default(s)?o.forEach((function(e){s[e]?u.push(s[e]):"name"==e&&u.push(r.get_with_locales(a.p,t.lang))})):u=[s],i=function(e,t){!0===t[0]?t=["true","yes","y","1"]:!1===t[0]&&(t=["false","no","n","0",""]);return t=t.map((function(e){return String(e).toLowerCase()})),e=e.split(","),U.default(e,t).length>0}(a.v,u),a.not&&(i=!i),n="or"===e.op?n||i:n&&i})),e.not&&(n=!n),n}k.do_shortcodes_init=function(){q.init()};var Y=function(){var e=L.default(O.default.mark((function e(){return O.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S.domReady;case 2:P.action_on_elements("js-geoip-detect-shortcode","could not execute shortcode(s) [geoip_detect2 ...]",N.do_shortcode_normal),P.action_on_elements("js-geoip-detect-flag","could not configure the flag(s)",N.do_shortcode_flags),P.action_on_elements("js-geoip-text-input","could not set the value of the text input field(s)",N.do_shortcode_text_input),P.action_on_elements("js-geoip-detect-country-select","could not set the value of the select field(s)",N.do_shortcode_country_select),P.action_on_elements("js-geoip-detect-show-if","could not execute the show-if/hide-if conditions",W.do_shortcode_show_if);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();k.do_shortcodes=Y;var B={};Object.defineProperty(B,"__esModule",{value:!0}),B.calc_classes=Z,B.add_body_classes=function(){return $.apply(this,arguments)},B.add_classes_to_body=K;var H=a(o("3qYWT")),X=a(o("2fiVm"));function Z(e){return{country:e.get("country.iso_code"),"country-is-in-european-union":e.get("country.is_in_european_union",!1),continent:e.get("continent.code"),province:e.get("most_specific_subdivision.iso_code")}}function $(){return($=X.default(H.default.mark((function e(){var t;return H.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.get_info();case 2:if(!(t=e.sent).error()){e.next=6;break}return console.error("Geolocation IP Detection Error (could not add CSS-classes to body): "+t.error()),e.abrupt("return");case 6:return e.next=8,S.domReady;case 8:K(t);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(e){var t,r,o,n=Z(e),a=document.getElementsByTagName("body")[0];r="geoip-",o=(t=a).className.split(" ").filter((function(e){return!e.startsWith(r)})),t.className=o.join(" ").trim();for(var i=0,u=Object.keys(n);i=0;--a){var i=this.tryEntries[a],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;O(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,o){return this.delegate={iterator:P(e),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}));var i=a(o("3qYWT"));o.register("hDdED",(function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0}));var u=a(o("hDdED"));o.register("2fiVm",(function(e,t){function r(e,t,r,o,n,a,i){try{var u=e[a](i),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(o,n)}e.exports=function(e){return function(){var t=this,o=arguments;return new Promise((function(n,a){var i=e.apply(t,o);function u(e){r(i,n,a,u,s,"next",e)}function s(e){r(i,n,a,u,s,"throw",e)}u(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0}));var s=a(o("2fiVm"));o.register("VIOjt",(function(e,t){"use strict";Object.defineProperty(e.exports,"__esModule",{value:!0}),e.exports.default=e.exports.camelToUnderscore=void 0;var r=a(o("17dzk")),n=a(o("eq7aj")),i=a(o("hDdED")),u=a(o("bIbJ7")),s=function(e,t){if("object"===i.default(e)&&null!==e){if("object"===i.default(e.names)&&"object"===i.default(t))for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"";t=this._process_locales(t),".name"===e.substr(-5)&&(e=e.substr(0,e.length-5));var o=this.get_raw(e);return null!==(o=s(o,t))&&""!==o||(o=r),o}},{key:"_process_locales",value:function(e){return"string"==typeof e&&(e=[e]),Array.isArray(e)&&0!==e.length||(e=this.default_locales),e}},{key:"get_with_locales",value:function(e,t,r){var o=this._lookup_with_locales(e,t,r);return"object"===i.default(o)&&console.warn('Geolocation IP Detection: The property "'+e+'" is of type "'+i.default(o)+'", should be string or similar',o),void 0===o?(console.warn('Geolocation IP Detection: The property "'+e+'" is not defined, please check spelling or maybe you need a different data source',{data:this.data}),""):o}},{key:"get_country_iso",value:function(){var e=this.get("country.iso_code");return e&&(e=e.substr(0,2).toLowerCase()),e}},{key:"is_empty",value:function(){return this.get("is_empty",!1)}},{key:"error",value:function(){return this.get_raw("extra.error")||""}},{key:"serialize",value:function(){return this.data}}]),e}();e.exports.default=l})),o.register("17dzk",(function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0})),o.register("eq7aj",(function(e,t){function r(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GET",r=new XMLHttpRequest;return new Promise((function(o,n){r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300?o(r):n({status:r.status,statusText:r.statusText,request:r}))},r.open(t||"GET",e,!0),r.send()}))};l.makeRequest=p;var h=function(e){try{return JSON.parse(e)}catch(t){return v("Invalid JSON: "+e)}};function v(e){return{is_empty:!0,extra:{error:e}}}l.jsonDecodeIfPossible=h;var _=function(){var e=d.default(f.default.mark((function e(t){var r,o,n=arguments;return f.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:"GET",e.prev=1,e.next=4,p(t,r);case 4:if((o=e.sent).responseText&&"0"!==o.responseText){e.next=7;break}return e.abrupt("return",v("Got an empty response from server. Did you enable AJAX in the options?"));case 7:return e.abrupt("return",h(o.responseText));case 10:return e.prev=10,e.t0=e.catch(1),e.abrupt("return",h(e.t0.request.responseText));case 13:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t){return e.apply(this,arguments)}}();l.makeJSONRequest=_;var y={};Object.defineProperty(y,"__esModule",{value:!0}),y.set_override_with_merge=function(e,t,r){var o=oe()||{};e=e||"",e=b.camelToUnderscore(e);var n=x.default(o,e);"object"==g.default(n)&&"object"==g.default(n.names)&&(e+=".name");e.endsWith(".name")&&(e+="s",t={en:t});w.default(o,e,t),re(o,r)},y.set_override=re,y.remove_override=function(){return m.setLocalStorage(n.options.cookie_name,{},-1),!0},y.getRecordDataFromLocalStorage=oe,y.setRecordDataToLocalStorage=function(e,t){m.setLocalStorage(n.options.cookie_name,e,t)},y.get_info_stored_locally_record=function(){return new b.default(oe(),n.options.default_locales)};var g=a(o("hDdED")),m={};Object.defineProperty(m,"__esModule",{value:!0}),m.getLocalStorage=m.setLocalStorage=void 0;m.setLocalStorage=function(e,t,r){var o={value:t,expires_at:(new Date).getTime()+1e3*r/1};localStorage.setItem(e.toString(),JSON.stringify(o))};m.getLocalStorage=function(e){var t=null;try{t=JSON.parse(localStorage.getItem(e.toString()))}catch(e){return null}if(null!==t){if(!(null!==t.expires_at&&t.expires_at<(new Date).getTime()))return t.value;localStorage.removeItem(e.toString())}return null};var b=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o("hDdED")(e)&&"function"!=typeof e)return{default:e};var r=te(t);if(r&&r.has(e))return r.get(e);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var u=a?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(n,i,u):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(o("VIOjt"));o.register("jTtDb",(function(e,t){function r(e){if("__proto__"===e||"constructor"===e||"prototype"===e)throw new Error("setting of prototype values not supported")}e.exports=function(e,t,o){var n,a,i;Array.isArray(t)&&(n=t.slice(0));"string"==typeof t&&(n=t.split("."));"symbol"==typeof t&&(n=[t]);if(!Array.isArray(n))throw new Error("props arg must be an array, a string or a symbol");if(!(a=n.pop()))return!1;r(a);for(;i=n.shift();)if(r(i),void 0===e[i]&&(e[i]={}),!(e=e[i])||"object"!=typeof e)return!1;return e[a]=o,!0}}));var w=a(o("jTtDb")),x=a(o("bIbJ7"));o.register("30kHV",(function(e,t){e.exports=function(e,t,r){var o=null,n=null,a=function(){o&&(clearTimeout(o),n=null,o=null)},i=function(){if(!t)return e.apply(this,arguments);var i=this,u=arguments,s=r&&!o;return a(),n=function(){e.apply(i,u)},o=setTimeout((function(){if(o=null,!s){var e=n;return n=null,e()}}),t),s?n():void 0};return i.cancel=a,i.flush=function(){var e=n;a(),e&&e()},i}}));a(o("30kHV"));o.register("cbzha",(function(e,t){function r(e,t){return e===t||(e!=e&&t!=t||{}.toString.call(e)=={}.toString.call(t)&&(e===Object(e)&&(!!e&&(Array.isArray(e)?o(e,t):"[object Set]"=={}.toString.call(e)?o(Array.from(e),Array.from(t)):"[object Object]"=={}.toString.call(e)?function(e,t){var o=Object.keys(e).sort(),n=Object.keys(t).sort(),a=o.length;if(a!=n.length)return!1;for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:null,o=A(e);r=r||o.property,o.skip_cache&&console.warn("Geolocation IP Detection: The property 'skip_cache' is ignored in AJAX mode. You could disable the response caching on the server by setting the constant GEOIP_DETECT_READER_CACHE_TIME.");return t.get_with_locales(r,o.lang,o.default)};var D=a(o("3qYWT")),I=a(o("2fiVm"));function A(e){var t=e.getAttribute("data-options");try{return JSON.parse(t)}catch(e){return{}}}function M(){return(M=I.default(D.default.mark((function e(t,r,o){var a,i;return D.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=document.getElementsByClassName(t)).length){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,n.get_info();case 5:if(!(i=e.sent).error()){e.next=9;break}return console.error("Geolocation IP Detection Error ("+r+"): "+i.error()),e.abrupt("return");case 9:Array.from(a).forEach((function(e){return o(e,i)}));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var N={};Object.defineProperty(N,"__esModule",{value:!0}),N.do_shortcode_normal=function(e,t){e.innerText=T.get_value_from_record(e,t)},N.do_shortcode_flags=function(e,t){var r=t.get_country_iso()||T.get_options(e).default;r&&e.classList.add("flag-icon-"+r)},N.do_shortcode_country_select=function(e,t){var r=t.get_country_iso();if(S.selectItemByAttribute(e,"data-c",r))G.triggerNativeEvent(e,"change");else{var o=T.get_options(e).default;T.get_options(e).default&&S.selectItemByAttribute(e,"data-c",o)&&G.triggerNativeEvent(e,"change")}},N.do_shortcode_text_input=function(e,t){e.value=T.get_value_from_record(e,t),G.triggerNativeEvent(e,"change")};var G={};Object.defineProperty(G,"__esModule",{value:!0}),G.isInternalEvent=function(){return R},G.triggerNativeEvent=function(e,t){if(R=!0,document.createEvent){var r=document.createEvent("HTMLEvents");r.initEvent(t,!0,!1),e.dispatchEvent(r)}else e.fireEvent("on"+t);R=!1};var R=!1;var q={};Object.defineProperty(q,"__esModule",{value:!0}),q.init=function(){document.addEventListener("change",V,!1)};var J=!1,C=0;function V(e){if(!G.isInternalEvent()){var t=e.target;if(t.matches(".js-geoip-detect-input-autosave")){var r=T.get_options(t).property,o=t.value;if(o){if(C++,J||C>100)return void console.warn("Error: Thats weird! autosave change detected a recursion! Please file a bug report about this.");if(J=!0,t.matches("select.js-geoip-detect-country-select")){var n=t.options[t.selectedIndex],a=null==n?void 0:n.getAttribute("data-c");a&&y.set_override_with_merge("country.iso_code",a.toUpperCase(),{reevaluate:!1})}y.set_override_with_merge(r,o),J=!1}}}}var W={};Object.defineProperty(W,"__esModule",{value:!0}),W.do_shortcode_show_if=function(e,t){var r=T.get_options(e);z(r.parsed,r,t)?(e.style.display="",e.classList.remove("geoip-hidden"),e.classList.add("geoip-shown")):(e.style.display="none",e.classList.add("geoip-hidden"),e.classList.remove("geoip-shown"))},W.geoip_detect2_shortcode_evaluate_conditions=z;var F=a(o("hDdED"));o.register("czPBu",(function(e,t){e.exports=function(e,t){if(!Array.isArray(e)||!Array.isArray(t))throw new Error("expected both arguments to be arrays");for(var r=[],o=e.length,n=0;n-1&&-1==r.indexOf(a)&&r.push(a)}return r}}));var U=a(o("czPBu"));function z(e,t,r){var o=["name","iso_code","iso_code3","code","geoname_id"],n="or"!==e.op;return e.conditions.forEach((function(a){var i=!1,u=[],s=r.get_raw(a.p);null===s?i=!1:"object"===F.default(s)?o.forEach((function(e){s[e]?u.push(s[e]):"name"==e&&u.push(r.get_with_locales(a.p,t.lang))})):u=[s],i=function(e,t){!0===t[0]?t=["true","yes","y","1"]:!1===t[0]&&(t=["false","no","n","0",""]);return t=t.map((function(e){return String(e).toLowerCase()})),e=e.split(","),U.default(e,t).length>0}(a.v,u),a.not&&(i=!i),n="or"===e.op?n||i:n&&i})),e.not&&(n=!n),n}k.do_shortcodes_init=function(){q.init()};var Y=function(){var e=O.default(L.default.mark((function e(){return L.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S.domReady;case 2:T.action_on_elements("js-geoip-detect-shortcode","could not execute shortcode(s) [geoip_detect2 ...]",N.do_shortcode_normal),T.action_on_elements("js-geoip-detect-flag","could not configure the flag(s)",N.do_shortcode_flags),T.action_on_elements("js-geoip-text-input","could not set the value of the text input field(s)",N.do_shortcode_text_input),T.action_on_elements("js-geoip-detect-country-select","could not set the value of the select field(s)",N.do_shortcode_country_select),T.action_on_elements("js-geoip-detect-show-if","could not execute the show-if/hide-if conditions",W.do_shortcode_show_if);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();k.do_shortcodes=Y;var B={};Object.defineProperty(B,"__esModule",{value:!0}),B.calc_classes=Z,B.add_body_classes=function(){return $.apply(this,arguments)},B.add_classes_to_body=K;var H=a(o("3qYWT")),X=a(o("2fiVm"));function Z(e){return{country:e.get("country.iso_code"),"country-is-in-european-union":e.get("country.is_in_european_union",!1),continent:e.get("continent.code"),province:e.get("most_specific_subdivision.iso_code")}}function $(){return($=X.default(H.default.mark((function e(){var t;return H.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.get_info();case 2:if(!(t=e.sent).error()){e.next=6;break}return console.error("Geolocation IP Detection Error (could not add CSS-classes to body): "+t.error()),e.abrupt("return");case 6:return e.next=8,S.domReady;case 8:K(t);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function K(e){var t,r,o,n=Z(e),a=document.getElementsByTagName("body")[0];r="geoip-",o=(t=a).className.split(" ").filter((function(e){return!e.startsWith(r)})),t.className=o.join(" ").trim();for(var i=0,u=Object.keys(n);i result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","import _get from 'just-safe-get';\n\n\nconst _get_localized = function(ret, locales) {\n if (typeof(ret) === 'object' && ret !== null) {\n if (typeof (ret.names) === 'object' && typeof (locales) === 'object') {\n for (let i = 0 ; i < locales.length ; i++) {\n let locale = locales[i];\n\n if (ret.names[locale]) {\n return ret.names[locale];\n }\n }\n }\n\n if (ret.name) {\n return ret.name;\n }\n\n return '';\n }\n return ret;\n}\n\nexport const camelToUnderscore = function(key) {\n key = key.split('.').map((x) => {\n if (typeof (x) !== 'string' || typeof (x[0]) !== 'string') {\n return '';\n }\n x = x[0].toLowerCase() + x.slice(1); // to allow \"MostSpecificSubdivision\"\n x = x.replace(/([A-Z])/g, \"_$1\").toLowerCase();\n return x;\n }).join('.');\n\n return key;\n}\n\nclass Record {\n data = {};\n default_locales = [];\n\n constructor(data, default_locales) {\n this.data = data || { is_empty: true };\n \n this.default_locales = ['en']; \n this.default_locales = this._process_locales(default_locales);\n }\n\n get(prop, default_value) {\n return this.get_with_locales(prop, null, default_value);\n }\n\n get_raw(prop) {\n prop = camelToUnderscore(prop);\n return _get(this.data, prop, null);\n }\n \n has_property(prop) {\n const ret = this._lookup_with_locales(prop, this.default_locales, null)\n return ret !== null;\n }\n\n _lookup_with_locales(prop, locales, default_value = '') {\n locales = this._process_locales(locales);\n\n // Treat pseudo-property 'name' as if it never existed\n if (prop.substr(-5) === '.name') {\n prop = prop.substr(0, prop.length - 5);\n }\n\n let ret = this.get_raw(prop);\n \n // Localize property, if possible\n ret = _get_localized(ret, locales);\n \n if (ret === null || ret === '') {\n ret = default_value;\n }\n\n return ret;\n }\n \n _process_locales(locales) {\n if (typeof(locales) === 'string') {\n locales = [ locales ];\n }\n if (!Array.isArray(locales) || locales.length === 0) {\n locales = this.default_locales;\n }\n return locales;\n }\n\n get_with_locales(prop, locales, default_value) {\n const ret = this._lookup_with_locales(prop, locales, default_value);\n\n if (typeof(ret) === 'object') {\n console.warn('Geolocation IP Detection: The property \"' + prop + '\" is of type \"' + typeof (ret) + '\", should be string or similar', ret)\n }\n if (typeof(ret) === 'undefined') {\n console.warn('Geolocation IP Detection: The property \"' + prop + '\" is not defined, please check spelling or maybe you need a different data source', { data: this.data })\n return '';\n }\n\n return ret;\n }\n\n get_country_iso() {\n let country = this.get('country.iso_code');\n if(country) {\n country = country.substr(0, 2).toLowerCase();\n }\n return country;\n }\n\n /**\n * Check if there is information available for this IP\n * @returns boolean \n */\n is_empty() {\n return this.get('is_empty', false);\n }\n \n /**\n * Get error message, if any\n * @return string Error Message\n */\n error() {\n return this.get_raw('extra.error') || '';\n }\n\n /**\n * Get the raw data of this object\n * @returns object\n */\n serialize() {\n return this.data;\n }\n}\n\nexport default Record;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","module.exports = get;\n\n/*\n const obj = {a: {aa: {aaa: 2}}, b: 4};\n\n get(obj, 'a.aa.aaa'); // 2\n get(obj, ['a', 'aa', 'aaa']); // 2\n\n get(obj, 'b.bb.bbb'); // undefined\n get(obj, ['b', 'bb', 'bbb']); // undefined\n\n get(obj.a, 'aa.aaa'); // 2\n get(obj.a, ['aa', 'aaa']); // 2\n\n get(obj.b, 'bb.bbb'); // undefined\n get(obj.b, ['bb', 'bbb']); // undefined\n\n get(obj.b, 'bb.bbb', 42); // 42\n get(obj.b, ['bb', 'bbb'], 42); // 42\n\n get(null, 'a'); // undefined\n get(undefined, ['a']); // undefined\n\n get(null, 'a', 42); // 42\n get(undefined, ['a'], 42); // 42\n\n const obj = {a: {}};\n const sym = Symbol();\n obj.a[sym] = 4;\n get(obj.a, sym); // 4\n*/\n\nfunction get(obj, propsArg, defaultValue) {\n if (!obj) {\n return defaultValue;\n }\n var props, prop;\n if (Array.isArray(propsArg)) {\n props = propsArg.slice(0);\n }\n if (typeof propsArg == 'string') {\n props = propsArg.split('.');\n }\n if (typeof propsArg == 'symbol') {\n props = [propsArg];\n }\n if (!Array.isArray(props)) {\n throw new Error('props arg must be an array, a string or a symbol');\n }\n while (props.length) {\n prop = props.shift();\n if (!obj) {\n return defaultValue;\n }\n obj = obj[prop];\n if (obj === undefined) {\n return defaultValue;\n }\n }\n return obj;\n}\n","import Record from '../models/record';\n\nimport { makeJSONRequest } from '../lib/xhr';\nimport { getRecordDataFromLocalStorage, setRecordDataToLocalStorage } from './override';\n\n\nexport const options = window.geoip_detect?.options || {\n ajaxurl: \"/wp-admin/admin-ajax.php\",\n default_locales: ['en'],\n cookie_duration_in_days: 7,\n cookie_name: 'geoip-detect-result',\n do_body_classes: false\n};\n\nlet ajaxPromise = null;\n\nfunction get_info_raw() {\n if (!ajaxPromise) {\n // Do Ajax Request only once per page load\n const url = options.ajaxurl + '?action=geoip_detect2_get_info_from_current_ip'\n\n ajaxPromise = makeJSONRequest(url);\n \n ajaxPromise.then((response) => {\n if (response?.extra?.error) {\n console.error('Geolocation IP Detection Error: Server returned an error: ' + response.extra.error);\n }\n })\n }\n\n return ajaxPromise;\n}\n\nasync function get_info_cached() {\n let response = false;\n let storedResponse = false;\n\n // 1) Load Info from localstorage cookie cache, if possible\n if (options.cookie_name) {\n storedResponse = getRecordDataFromLocalStorage()\n if (storedResponse && storedResponse.extra) {\n if (storedResponse.extra.override === true) {\n console.info('Geolocation IP Detection: Using cached response (override)');\n } else {\n console.info('Geolocation IP Detection: Using cached response');\n }\n return storedResponse;\n }\n }\n\n // 2) Get response\n try {\n response = await get_info_raw();\n } catch (err) {\n console.log('Uncaught ERROR ??');\n response = err.responseJSON || err;\n }\n\n // 3) Save info to localstorage cookie cache\n if (options.cookie_name) {\n\n // Check if Override has been set now\n storedResponse = getRecordDataFromLocalStorage()\n if (storedResponse?.extra?.override === true) {\n console.info('Geolocation IP Detection: Using cached response (override)');\n return storedResponse;\n }\n\n let cache_duration = options.cookie_duration_in_days * 24 * 60 * 60;\n if (response?.extra?.error)\n cache_duration = 60; // Cache errors only for 1 minute, then try again\n \n setRecordDataToLocalStorage(response, cache_duration);\n }\n\n return response;\n}\n\n\n/**\n * Load the data from the server\n * \n * (It can also be loaded from the browser localstorage, if the record data is present there already.)\n * \n * @api\n * @return Promise(Record)\n */\nexport async function get_info() {\n let response = await get_info_cached();\n\n if (typeof (response) !== 'object') {\n console.error('Geolocation IP Detection Error: Record should be an object, not a ' + typeof (response), response);\n response = { 'extra': { 'error': response || 'Network error, look at the original server response ...' } };\n }\n\n const record = new Record(response, options.default_locales);\n return record;\n}\n","// @see https://gomakethings.com/promise-based-xhr/\n\nexport const makeRequest = function (url, method = 'GET') {\n\n // Create the XHR request\n var request = new XMLHttpRequest();\n\n // Return it as a Promise\n return new Promise(function (resolve, reject) {\n\n // Setup our listener to process compeleted requests\n request.onreadystatechange = function () {\n\n // Only run if the request is complete\n if (request.readyState !== 4) return;\n\n // Process the response\n if (request.status >= 200 && request.status < 300) {\n // If successful\n resolve(request);\n } else {\n // If failed\n reject({\n status: request.status,\n statusText: request.statusText,\n request: request\n });\n }\n\n };\n\n // Setup our HTTP request\n request.open(method || 'GET', url, true);\n\n // Send the request\n request.send();\n\n });\n};\n\nexport const jsonDecodeIfPossible = function(str) {\n try {\n return JSON.parse(str);\n } catch(e) {\n return createErrorObject('Invalid JSON: ' + str);\n }\n}\n\nfunction createErrorObject(errorMsg) {\n return {\n is_empty: true,\n extra: {\n error: errorMsg\n }\n };\n}\n\nexport const makeJSONRequest = async function(url, method = 'GET') {\n try {\n const request = await makeRequest(url, method);\n if (!request.responseText || request.responseText === '0') {\n return createErrorObject('Got an empty response from server. Did you enable AJAX in the options?');\n }\n return jsonDecodeIfPossible(request.responseText);\n } catch(e) {\n return jsonDecodeIfPossible(e.request.responseText);\n }\n}\n","import { getLocalStorage, setLocalStorage } from '../lib/localStorageAccess';\nimport { options as globalOptions } from './get_info';\nimport Record, { camelToUnderscore } from '../models/record';\nimport _set from 'just-safe-set';\nimport _get from 'just-safe-get';\nimport _debounce from 'just-debounce-it';\nimport _is_object_content_equal from 'just-compare';\nimport { main } from '../main';\n\nfunction processOptions(options) {\n options = options || {};\n if (typeof(options) == 'number') {\n options = {\n 'duration_in_days': options\n };\n }\n\n options.duration_in_days = options.duration_in_days || globalOptions.cookie_duration_in_days;\n if (options.duration_in_days < 0) {\n console.warn('Geolocation IP Detection set_override_data() did nothing: A negative duration doesn\\'t make sense. If you want to remove the override, use remove_override() instead.');\n return false;\n }\n\n if (typeof (options.reevaluate) == 'undefined' ) {\n options.reevaluate = true;\n }\n\n return options;\n}\n/**\n * Override only one property, leave the other properties as-is.\n * @param {string} property \n * @param {*} value \n */\nexport function set_override_with_merge(property, value, options) {\n let record = getRecordDataFromLocalStorage() || {};\n property = property || '';\n \n property = camelToUnderscore(property);\n\n const oldData = _get(record, property);\n if (typeof(oldData) == 'object' && typeof(oldData.names) == 'object') {\n property += '.name';\n }\n if (property.endsWith('.name')) {\n property += 's';\n value = { 'en' : value };\n }\n \n _set(record, property, value);\n set_override(record, options);\n}\n\n/**\n * This functions allows to override the geodetected data manually (e.g. a country selector)\n * \n * @api\n * @param {*} record \n * @param {object} options\n * @param {number} duration_in_days When this override expires (default: 1 week later)\n * @param {boolean} reevaluate If the shortcodes etc. should be re-evaluated (default: true)\n * @return boolean TRUE if override data changed\n */\nexport function set_override(record, options) {\n options = processOptions(options);\n\n if (record && typeof (record.serialize) === 'function') {\n record = record.serialize();\n }\n\n return set_override_data(record, options);\n}\n\nfunction set_override_data(newData, options) {\n newData = newData || {};\n _set(newData, 'extra.override', true);\n\n const oldData = getRecordDataFromLocalStorage();\n setLocalStorage(globalOptions.cookie_name, newData, options.duration_in_days * 24 * 60 * 60);\n\n if (options.reevaluate && !_is_object_content_equal(newData, oldData)) {\n main();\n return true;\n }\n\n return false;\n}\n\n/**\n * Remove the override data.\n * On next page load, the record data will be loaded from the server again.\n * \n * @return boolean\n */\nexport function remove_override() {\n setLocalStorage(globalOptions.cookie_name, {}, -1);\n return true;\n}\n\n\n// Sync function in case it is known that no AJAX will occur\nexport function getRecordDataFromLocalStorage() {\n return getLocalStorage(globalOptions.cookie_name);\n}\n\nexport function setRecordDataToLocalStorage(data, cache_duration) {\n setLocalStorage(globalOptions.cookie_name, data, cache_duration);\n}\n\nexport function get_info_stored_locally_record() {\n return new Record(getRecordDataFromLocalStorage(), globalOptions.default_locales);\n}","export const setLocalStorage = function (variable, value, ttl_sec) {\n var data = {value: value, expires_at: new Date().getTime() + (ttl_sec * 1000) / 1 };\n localStorage.setItem(variable.toString(), JSON.stringify(data));\n};\n\nexport const getLocalStorage = function (variable) {\n let data = null;\n try {\n data = JSON.parse(localStorage.getItem(variable.toString()));\n } catch(e) {\n return null;\n }\n if (data !== null) {\n if (data.expires_at !== null && data.expires_at < new Date().getTime()) {\n localStorage.removeItem(variable.toString());\n } else {\n return data.value;\n }\n }\n return null;\n}\n","module.exports = set;\n\n/*\n var obj1 = {};\n set(obj1, 'a.aa.aaa', 4); // true\n obj1; // {a: {aa: {aaa: 4}}}\n\n var obj2 = {};\n set(obj2, ['a', 'aa', 'aaa'], 4); // true\n obj2; // {a: {aa: {aaa: 4}}}\n\n var obj3 = {a: {aa: {aaa: 2}}};\n set(obj3, 'a.aa.aaa', 3); // true\n obj3; // {a: {aa: {aaa: 3}}}\n\n // don't clobber existing\n var obj4 = {a: {aa: {aaa: 2}}};\n set(obj4, 'a.aa', {bbb: 7}); // false\n\n const obj5 = {a: {}};\n const sym = Symbol();\n set(obj5.a, sym, 7); // true\n obj5; // {a: {Symbol(): 7}}\n*/\n\nfunction set(obj, propsArg, value) {\n var props, lastProp;\n if (Array.isArray(propsArg)) {\n props = propsArg.slice(0);\n }\n if (typeof propsArg == 'string') {\n props = propsArg.split('.');\n }\n if (typeof propsArg == 'symbol') {\n props = [propsArg];\n }\n if (!Array.isArray(props)) {\n throw new Error('props arg must be an array, a string or a symbol');\n }\n lastProp = props.pop();\n if (!lastProp) {\n return false;\n }\n prototypeCheck(lastProp);\n var thisProp;\n while ((thisProp = props.shift())) {\n prototypeCheck(thisProp);\n if (typeof obj[thisProp] == 'undefined') {\n obj[thisProp] = {};\n }\n obj = obj[thisProp];\n if (!obj || typeof obj != 'object') {\n return false;\n }\n }\n obj[lastProp] = value;\n return true;\n}\n\nfunction prototypeCheck(prop) {\n if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') {\n throw new Error('setting of prototype values not supported');\n }\n}\n","module.exports = debounce;\n\nfunction debounce(fn, wait, callFirst) {\n var timeout = null;\n var debouncedFn = null;\n\n var clear = function() {\n if (timeout) {\n clearTimeout(timeout);\n\n debouncedFn = null;\n timeout = null;\n }\n };\n\n var flush = function() {\n var call = debouncedFn;\n clear();\n\n if (call) {\n call();\n }\n };\n\n var debounceWrapper = function() {\n if (!wait) {\n return fn.apply(this, arguments);\n }\n\n var context = this;\n var args = arguments;\n var callNow = callFirst && !timeout;\n clear();\n\n debouncedFn = function() {\n fn.apply(context, args);\n };\n\n timeout = setTimeout(function() {\n timeout = null;\n\n if (!callNow) {\n var call = debouncedFn;\n debouncedFn = null;\n\n return call();\n }\n }, wait);\n\n if (callNow) {\n return debouncedFn();\n }\n };\n\n debounceWrapper.cancel = clear;\n debounceWrapper.flush = flush;\n\n return debounceWrapper;\n}\n","module.exports = compare;\n\n/*\n primitives: value1 === value2\n functions: value1.toString == value2.toString\n arrays: if length, sequence and values of properties are identical\n objects: if length, names and values of properties are identical\n compare([[1, [2, 3]], [[1, [2, 3]]); // true\n compare([[1, [2, 3], 4], [[1, [2, 3]]); // false\n compare({a: 2, b: 3}, {a: 2, b: 3}); // true\n compare({a: 2, b: 3}, {b: 3, a: 2}); // true\n compare({a: 2, b: 3, c: 4}, {a: 2, b: 3}); // false\n compare({a: 2, b: 3}, {a: 2, b: 3, c: 4}); // false\n compare([[1, [2, {a: 4}], 4], [[1, [2, {a: 4}]]); // true\n*/\n\nfunction compare(value1, value2) {\n if (value1 === value2) {\n return true;\n }\n /* eslint-disable no-self-compare */\n // if both values are NaNs return true\n if (value1 !== value1 && value2 !== value2) {\n return true;\n }\n if ({}.toString.call(value1) != {}.toString.call(value2)) {\n return false;\n }\n if (value1 !== Object(value1)) {\n // non equal primitives\n return false;\n }\n if (!value1) {\n return false;\n }\n if (Array.isArray(value1)) {\n return compareArrays(value1, value2);\n }\n if ({}.toString.call(value1) == '[object Set]') {\n return compareArrays(Array.from(value1), Array.from(value2));\n }\n if ({}.toString.call(value1) == '[object Object]') {\n return compareObjects(value1, value2);\n } else {\n return compareNativeSubtypes(value1, value2);\n }\n}\n\nfunction compareNativeSubtypes(value1, value2) {\n // e.g. Function, RegExp, Date\n return value1.toString() === value2.toString();\n}\n\nfunction compareArrays(value1, value2) {\n var len = value1.length;\n if (len != value2.length) {\n return false;\n }\n var alike = true;\n for (var i = 0; i < len; i++) {\n if (!compare(value1[i], value2[i])) {\n alike = false;\n break;\n }\n }\n return alike;\n}\n\nfunction compareObjects(value1, value2) {\n var keys1 = Object.keys(value1).sort();\n var keys2 = Object.keys(value2).sort();\n var len = keys1.length;\n if (len != keys2.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n var key1 = keys1[i];\n var key2 = keys2[i];\n if (!(key1 == key2 && compare(value1[key1], value2[key2]))) {\n return false;\n }\n }\n return true;\n}\n","import { do_shortcodes, do_shortcodes_init } from './shortcodes/index';\nimport { add_body_classes } from './body_classes';\nimport { options } from './lookup/get_info';\n\nlet firstCall = true;\n\nexport function main() {\nconsole.log('Do Main');\n\n if (firstCall) {\n do_shortcodes_init();\n firstCall = false; \n }\n\n if (options.do_body_classes) {\n add_body_classes();\n }\n\n // Do all the shortcodes that are in the HTML. Even if shortcodes is not enabled globally, they might be enabled for a specific shortcode.\n do_shortcodes();\n}","export const domReady = new Promise(resolve => {\n if (document.readyState === \"loading\") {\n if (document.addEventListener) {\n document.addEventListener('DOMContentLoaded', resolve);\n } else {\n document.attachEvent('onreadystatechange', function () {\n if (document.readyState != 'loading')\n resolve();\n });\n }\n }\n else {\n resolve();\n }\n});\n\nexport function selectItemByValue(el, value) {\n for (var i = 0; i < el.options.length; i++) {\n if (el.options[i].value === value) {\n el.selectedIndex = i;\n break;\n }\n }\n}\n\n/**\n * @param {*} el Select Tag\n * @param {string} attributeName HTML attribute name to search by\n * @param {string} attributeValue HTML attribute value to search by\n * @returns boolean TRUE if Value found in select tag\n */\nexport function selectItemByAttribute(el, attributeName, attributeValue) {\n for (let i = 0; i < el.options.length; i++) {\n if (el.options[i].getAttribute(attributeName) === attributeValue) {\n el.selectedIndex = i;\n return true;\n }\n }\n return false;\n}","import { get_info } from \"../lookup/get_info\";\n\n// Get Options from data-options and json parse them\nexport function get_options(el) {\n const raw = el.getAttribute('data-options');\n try {\n return JSON.parse(raw);\n } catch (e) {\n return {};\n }\n}\n\nexport async function action_on_elements(className, errorMessage, callback) {\n const elements = document.getElementsByClassName(className);\n if (!elements.length) return;\n\n const record = await get_info();\n\n if (record.error()) {\n console.error('Geolocation IP Detection Error (' + errorMessage + '): ' + record.error());\n return;\n }\n\n Array.from(elements)\n .forEach(el => callback(el, record));\n}\n\nexport function get_value_from_record(el, record, property = null) {\n const opt = get_options(el);\n property = property || opt.property;\n if (opt.skip_cache) {\n console.warn(\"Geolocation IP Detection: The property 'skip_cache' is ignored in AJAX mode. You could disable the response caching on the server by setting the constant GEOIP_DETECT_READER_CACHE_TIME.\");\n }\n\n return record.get_with_locales(property, opt.lang, opt.default);\n}","import { triggerNativeEvent } from \"../lib/events\";\nimport { selectItemByAttribute } from \"../lib/html\";\nimport { get_value_from_record, get_options } from \"./helpers\";\n\nexport function do_shortcode_normal(el, record) {\n el.innerText = get_value_from_record(el, record);\n}\n\nexport function do_shortcode_flags(el, record) {\n const country = record.get_country_iso() || get_options(el).default;\n if (country) {\n el.classList.add('flag-icon-' + country)\n }\n}\n\n\nexport function do_shortcode_country_select(el, record) {\n let country = record.get_country_iso();\n\n if (selectItemByAttribute(el, 'data-c', country)) {\n triggerNativeEvent(el, 'change');\n } else {\n const defaultValue = get_options(el).default;\n if (get_options(el).default) {\n if (selectItemByAttribute(el, 'data-c', defaultValue)) {\n triggerNativeEvent(el, 'change');\n }\n }\n }\n}\n\nexport function do_shortcode_text_input(el, record) {\n el.value = get_value_from_record(el, record);\n triggerNativeEvent(el, 'change');\n}","\nlet _internalEvent = false;\nexport function isInternalEvent() {\n return _internalEvent;\n}\n\nexport function triggerNativeEvent(el, name) {\n _internalEvent = true;\n if (document.createEvent) {\n const event = document.createEvent('HTMLEvents');\n event.initEvent(name, true, false);\n el.dispatchEvent(event);\n } else {\n el.fireEvent('on' + name);\n }\n _internalEvent = false;\n}","\nimport { isInternalEvent } from \"../lib/events\";\nimport { set_override_with_merge } from \"../lookup/override\";\nimport { get_options } from \"./helpers\";\n\nlet _listener_active = false; // for recursion detection (maybe remove later)\nlet _change_counter = 0; // ToDo remove later!\n\nexport function init() {\n document.addEventListener('change', event_listener_autosave_on_change, false);\n}\n\nfunction event_listener_autosave_on_change(event) {\n if (isInternalEvent()) return;\n\n const target = event.target;\n if (target.matches('.js-geoip-detect-input-autosave')) {\n console.log('autosave on change', target);\n const property = get_options(target).property;\n const value = target.value;\n\n if (value) {\n _change_counter++;\n if (_listener_active || _change_counter > 100) {\n console.warn('Thats weird! autosave change detected a recursion!');\n debugger;\n return;\n } else {\n _listener_active = true;\n\n if (target.matches('select.js-geoip-detect-country-select')) {\n const selected = target.options[target.selectedIndex];\n const isoCode = selected?.getAttribute('data-c');\n if (isoCode) {\n set_override_with_merge('country.iso_code', isoCode.toUpperCase(), {reevaluate: false});\n }\n }\n \n set_override_with_merge(property, value); // might call do_shortcodes etc.\n\n _listener_active = false;\n }\n }\n }\n}","import { get_options } from './helpers';\nimport _intersect from 'just-intersect';\n\n\nexport function do_shortcode_show_if(el, record) {\n const opt = get_options(el);\n const evaluated = geoip_detect2_shortcode_evaluate_conditions(opt.parsed, opt, record);\n\n if (!evaluated) {\n el.style.display = \"none !important\";\n } else {\n el.style.display = '';\n }\n}\n\nexport function geoip_detect2_shortcode_evaluate_conditions(parsed, opt, record) {\n const alternativePropertyNames = [\n 'name',\n 'iso_code',\n 'iso_code3',\n 'code',\n 'geoname_id',\n ];\n\n let isConditionMatching = (parsed.op === 'or') ? false : true;\n\n parsed.conditions.forEach(c => {\n let subConditionMatching = false;\n let values = [];\n\n const raw_value = record.get_raw(c.p);\n\n if (raw_value === null) {\n subConditionMatching = false;\n } else {\n if (typeof (raw_value) === 'object') {\n alternativePropertyNames.forEach(name => {\n if (raw_value[name]) {\n values.push(raw_value[name]);\n } else if (name == 'name') {\n values.push(record.get_with_locales(c.p, opt.lang));\n }\n })\n } else {\n values = [raw_value]\n }\n }\n\n subConditionMatching = geoip_detect2_shortcode_check_subcondition(c.v, values);\n\n if (c.not) {\n subConditionMatching = !subConditionMatching;\n }\n\n if (parsed.op === 'or') {\n isConditionMatching = isConditionMatching || subConditionMatching;\n } else {\n isConditionMatching = isConditionMatching && subConditionMatching;\n }\n\n });\n\n if (parsed.not) {\n isConditionMatching = !isConditionMatching;\n }\n\n return isConditionMatching;\n}\n\nfunction geoip_detect2_shortcode_check_subcondition(expectedValues, actualValues) {\n if (actualValues[0] === true) {\n actualValues = ['true', 'yes', 'y', '1'];\n } else if (actualValues[0] === false) {\n actualValues = ['false', 'no', 'n', '0', ''];\n }\n\n actualValues = actualValues.map(x => String(x).toLowerCase())\n\n expectedValues = expectedValues.split(',');\n\n const intersect = _intersect(expectedValues, actualValues);\n\n return intersect.length > 0;\n}","module.exports = intersect;\n\n/*\n intersect([1, 2, 5, 6], [2, 3, 5, 6]); // [2, 5, 6]\n intersect([1, 2, 2, 4, 5], [3, 2, 2, 5, 7]); // [2, 5]\n*/\n\nfunction intersect(arr1, arr2) {\n if (!Array.isArray(arr1) || !Array.isArray(arr2)) {\n throw new Error('expected both arguments to be arrays');\n }\n var result = [];\n var len = arr1.length;\n for (var i = 0; i < len; i++) {\n var elem = arr1[i];\n if (arr2.indexOf(elem) > -1 && result.indexOf(elem) == -1) {\n result.push(elem);\n }\n }\n return result;\n}\n","import { domReady } from \"../lib/html\";\nimport { action_on_elements } from \"./helpers\";\nimport { do_shortcode_country_select, do_shortcode_flags, do_shortcode_normal, do_shortcode_text_input } from \"./normal\";\nimport { init as onchangeInit } from \"./onchange\";\nimport { do_shortcode_show_if } from \"./show-if\";\n\n\nexport const do_shortcodes_init = function () {\n onchangeInit();\n}\n\nexport const do_shortcodes = async function do_shortcodes() {\n // Before doing any of these, the DOM tree needs to be loaded\n await domReady;\n\n // These are called in parallel, as they are async functions\n action_on_elements('js-geoip-detect-shortcode',\n 'could not execute shortcode(s) [geoip_detect2 ...]', do_shortcode_normal);\n\n action_on_elements('js-geoip-detect-flag',\n 'could not configure the flag(s)', do_shortcode_flags);\n\n action_on_elements('js-geoip-text-input',\n 'could not set the value of the text input field(s)', do_shortcode_text_input);\n\n action_on_elements('js-geoip-detect-country-select',\n 'could not set the value of the select field(s)', do_shortcode_country_select);\n\n action_on_elements('js-geoip-detect-show-if',\n 'could not execute the show-if/hide-if conditions', do_shortcode_show_if);\n};\n","import { domReady } from './lib/html';\nimport { get_info } from './lookup/get_info';\n\nexport function calc_classes(record) {\n return {\n country: record.get('country.iso_code'),\n 'country-is-in-european-union': record.get('country.is_in_european_union', false),\n continent: record.get('continent.code'),\n province: record.get('most_specific_subdivision.iso_code'),\n };\n}\n\nfunction remove_css_classes_by_prefix(el, prefix) {\n const classes = el.className.split(\" \").filter(c => !c.startsWith(prefix));\n el.className = classes.join(\" \").trim();\n}\n\nexport async function add_body_classes() {\n const record = await get_info();\n\n if (record.error()) {\n console.error('Geolocation IP Detection Error (could not add CSS-classes to body): ' + record.error());\n return;\n }\n\n await domReady;\n\n add_classes_to_body(record);\n}\n\nexport function add_classes_to_body(record) {\n const css_classes = calc_classes(record);\n\n const body = document.getElementsByTagName('body')[0];\n \n // Remove old classes in case there are any\n remove_css_classes_by_prefix(body, 'geoip-');\n \n for (let key of Object.keys(css_classes)) {\n const value = css_classes[key];\n if (value) {\n if (typeof (value) == 'string') {\n body.classList.add(`geoip-${key}-${value}`);\n } else {\n body.classList.add(`geoip-${key}`);\n }\n }\n }\n}","import { get_info } from './lookup/get_info';\nimport { remove_override, set_override } from './lookup/override';\nimport { main } from './main';\n\n// Evaluate shortcodes, body classes, etc.\nmain();\n\n\n// Extend window object \nwindow.geoip_detect.get_info = get_info;\n\nwindow.geoip_detect.set_override = set_override;\nwindow.geoip_detect.remove_override = remove_override;"],"names":["$7fb3379cb4faeaa9$exports","obj","__esModule","module","exports","parcelRequire","$d644595609e664a3$var$runtime","undefined","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","GenStateSuspendedStart","method","arg","GenStateExecuting","Error","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","done","GenStateSuspendedYield","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","invoke","resolve","reject","result","__await","then","value1","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","this","reset","iterable","iteratorMethod","isNaN","length","i","next1","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","key1","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","globalThis","Function","$cd60abae8b9c0748$var$_typeof","obj1","$1a2ba968d63fb6cf$var$asyncGeneratorStep","gen","_next","_throw","args","arguments","apply","$0ad8156b16c85a9a$var$_justSafeGet","_get_localized","ret","locales","$0ad8156b16c85a9a$var$_typeof2","default","names","locale","camelToUnderscore","split","map","x","toLowerCase","replace","join","Record","data","default_locales","$0ad8156b16c85a9a$var$_classCallCheck2","is_empty","_process_locales","prop","default_value","get_with_locales","_lookup_with_locales","substr","get_raw","Array","isArray","console","warn","country","get","instance","Constructor","$a7f90d4906b02dea$var$_defineProperties","target","props","descriptor","protoProps","staticProps","propsArg","defaultValue","shift","$9fe0fb67532c57dd$var$_record","makeRequest","url","request","XMLHttpRequest","onreadystatechange","readyState","status","statusText","open","send","jsonDecodeIfPossible","str","JSON","parse","e","createErrorObject","errorMsg","extra","makeJSONRequest","_ref","$b866da47520fe162$var$_asyncToGenerator2","$b866da47520fe162$var$_regenerator","_callee","_args","_context","responseText","t0","_x","property","options","getRecordDataFromLocalStorage","$38b58d3e214bcd83$var$_record","oldData","$38b58d3e214bcd83$var$_justSafeGet","$38b58d3e214bcd83$var$_typeof2","endsWith","$38b58d3e214bcd83$var$_justSafeSet","set_override","$cda3d83fa806874f$exports","setLocalStorage","globalOptions","cookie_name","cache_duration","variable","ttl_sec","expires_at","Date","getTime","localStorage","setItem","toString","stringify","getItem","removeItem","$38b58d3e214bcd83$var$_interopRequireWildcard","$e7ba237efef71388$var$prototypeCheck","lastProp","thisProp","wait","callFirst","timeout","debouncedFn","clear","clearTimeout","debounceWrapper","callNow","setTimeout","cancel","flush","$8df1e026a66990a7$var$compare","value2","$8df1e026a66990a7$var$compareArrays","from","keys1","sort","keys2","len","key2","$8df1e026a66990a7$var$compareObjects","$8df1e026a66990a7$var$compareNativeSubtypes","alike","$38b58d3e214bcd83$var$_justCompare","log","firstCall","$2cf774dbc37eb0c4$exports","do_shortcodes_init","do_body_classes","$4cd5b8be8663970b$exports","add_body_classes","do_shortcodes","el","selectedIndex","attributeName","attributeValue","getAttribute","domReady","document","addEventListener","attachEvent","action_on_elements","opt","get_options","skip_cache","lang","raw","$5db6259c0d5d765a$var$_action_on_elements","$5db6259c0d5d765a$var$_asyncToGenerator2","$5db6259c0d5d765a$var$_regenerator","className","errorMessage","callback","elements","getElementsByClassName","$9fe0fb67532c57dd$exports","get_info","innerText","$5db6259c0d5d765a$exports","get_value_from_record","get_country_iso","classList","add","$5cf978ba75b479f8$exports","selectItemByAttribute","$dec43294fed98591$exports","triggerNativeEvent","_internalEvent","createEvent","event","initEvent","dispatchEvent","fireEvent","event_listener_autosave_on_change","_listener_active","_change_counter","isInternalEvent","matches","selected","isoCode","$38b58d3e214bcd83$exports","set_override_with_merge","toUpperCase","reevaluate","geoip_detect2_shortcode_evaluate_conditions","parsed","style","display","arr1","arr2","elem","indexOf","$3c68d05e62fd88f8$var$_justIntersect","alternativePropertyNames","isConditionMatching","op","conditions","c","subConditionMatching","raw_value","p","$3c68d05e62fd88f8$var$_typeof2","expectedValues","actualValues","String","geoip_detect2_shortcode_check_subcondition","v","not","$6da902fb26eb6fbd$exports","init","_do_shortcodes","$2cf774dbc37eb0c4$var$_asyncToGenerator2","$2cf774dbc37eb0c4$var$_regenerator","do_shortcode_normal","do_shortcode_flags","do_shortcode_text_input","do_shortcode_country_select","do_shortcode_show_if","calc_classes","continent","province","$4cd5b8be8663970b$var$_add_body_classes","$4cd5b8be8663970b$var$_asyncToGenerator2","$4cd5b8be8663970b$var$_regenerator","add_classes_to_body","prefix","classes","css_classes","body","getElementsByTagName","filter","startsWith","trim","_i","_Object$keys","concat","duration_in_days","cookie_duration_in_days","processOptions","serialize","newData","$7ba2aa436d90b205$exports","main","set_override_data","getLocalStorage","$9fe0fb67532c57dd$var$_window$geoip_detect","window","geoip_detect","ajaxurl","ajaxPromise","get_info_raw","$b866da47520fe162$exports","response","_response$extra","get_info_cached","$9fe0fb67532c57dd$var$_get_info_cached","$9fe0fb67532c57dd$var$_asyncToGenerator2","$9fe0fb67532c57dd$var$_regenerator","storedResponse","_storedResponse","_storedResponse$extra","_response","_response$extra2","override","responseJSON","setRecordDataToLocalStorage","$9fe0fb67532c57dd$var$_get_info","_callee2","_context2","$9fe0fb67532c57dd$var$_typeof2","remove_override"],"version":3,"file":"frontend.js.map"} \ No newline at end of file +{"mappings":"+fAMAA,WANgCC,UACvBA,GAAOA,EAAIC,WAAaD,EAAG,SACrBA,KAKS,QAAID,EAAgBA,EAAeE,YAAa,6JCPxEC,EAAAC,QAAiBC,EAAA,8CCOjB,IAAIC,EAAO,SAAcF,GAGvB,IAEIG,EAFAC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAAuB,mBAANC,OAAwBA,OAAM,GAC/CC,EAAiBF,EAAQG,UAAQ,aACjCC,EAAsBJ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,EAAAA,SAE/B2F,OAAOC,aAAaxK,aAAeA,EAAAA,aACnCuK,OAAOC,aAAawB,gBAAkBA,EAAAA","sources":["node_modules/@babel/runtime/helpers/interopRequireDefault.js","node_modules/@babel/runtime/regenerator/index.js","node_modules/regenerator-runtime/runtime.js","node_modules/@babel/runtime/helpers/typeof.js","node_modules/@babel/runtime/helpers/asyncToGenerator.js","js/models/record.js","node_modules/@babel/runtime/helpers/classCallCheck.js","node_modules/@babel/runtime/helpers/createClass.js","node_modules/just-safe-get/index.js","js/lookup/get_info.js","js/lib/xhr.js","js/lookup/override.js","js/lib/localStorageAccess.js","node_modules/just-safe-set/index.js","node_modules/just-debounce-it/index.js","node_modules/just-compare/index.js","js/main.js","js/lib/html.js","js/shortcodes/helpers.js","js/shortcodes/normal.js","js/lib/events.js","js/shortcodes/onchange.js","js/shortcodes/show-if.js","node_modules/just-intersect/index.js","js/shortcodes/index.js","js/body_classes.js","js/frontend.js"],"sourcesContent":["function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","module.exports = require(\"regenerator-runtime\");\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","import _get from 'just-safe-get';\n\n\nconst _get_localized = function(ret, locales) {\n if (typeof(ret) === 'object' && ret !== null) {\n if (typeof (ret.names) === 'object' && typeof (locales) === 'object') {\n for (let i = 0 ; i < locales.length ; i++) {\n let locale = locales[i];\n\n if (ret.names[locale]) {\n return ret.names[locale];\n }\n }\n }\n\n if (ret.name) {\n return ret.name;\n }\n\n return '';\n }\n return ret;\n}\n\nexport const camelToUnderscore = function(key) {\n key = key.split('.').map((x) => {\n if (typeof (x) !== 'string' || typeof (x[0]) !== 'string') {\n return '';\n }\n x = x[0].toLowerCase() + x.slice(1); // to allow \"MostSpecificSubdivision\"\n x = x.replace(/([A-Z])/g, \"_$1\").toLowerCase();\n return x;\n }).join('.');\n\n return key;\n}\n\nclass Record {\n data = {};\n default_locales = [];\n\n constructor(data, default_locales) {\n this.data = data || { is_empty: true };\n \n this.default_locales = ['en']; \n this.default_locales = this._process_locales(default_locales);\n }\n\n get(prop, default_value) {\n return this.get_with_locales(prop, null, default_value);\n }\n\n get_raw(prop) {\n prop = camelToUnderscore(prop);\n return _get(this.data, prop, null);\n }\n \n has_property(prop) {\n const ret = this._lookup_with_locales(prop, this.default_locales, null)\n return ret !== null;\n }\n\n _lookup_with_locales(prop, locales, default_value = '') {\n locales = this._process_locales(locales);\n\n // Treat pseudo-property 'name' as if it never existed\n if (prop.substr(-5) === '.name') {\n prop = prop.substr(0, prop.length - 5);\n }\n\n let ret = this.get_raw(prop);\n \n // Localize property, if possible\n ret = _get_localized(ret, locales);\n \n if (ret === null || ret === '') {\n ret = default_value;\n }\n\n return ret;\n }\n \n _process_locales(locales) {\n if (typeof(locales) === 'string') {\n locales = [ locales ];\n }\n if (!Array.isArray(locales) || locales.length === 0) {\n locales = this.default_locales;\n }\n return locales;\n }\n\n get_with_locales(prop, locales, default_value) {\n const ret = this._lookup_with_locales(prop, locales, default_value);\n\n if (typeof(ret) === 'object') {\n console.warn('Geolocation IP Detection: The property \"' + prop + '\" is of type \"' + typeof (ret) + '\", should be string or similar', ret)\n }\n if (typeof(ret) === 'undefined') {\n console.warn('Geolocation IP Detection: The property \"' + prop + '\" is not defined, please check spelling or maybe you need a different data source', { data: this.data })\n return '';\n }\n\n return ret;\n }\n\n get_country_iso() {\n let country = this.get('country.iso_code');\n if(country) {\n country = country.substr(0, 2).toLowerCase();\n }\n return country;\n }\n\n /**\n * Check if there is information available for this IP\n * @returns boolean \n */\n is_empty() {\n return this.get('is_empty', false);\n }\n \n /**\n * Get error message, if any\n * @return string Error Message\n */\n error() {\n return this.get_raw('extra.error') || '';\n }\n\n /**\n * Get the raw data of this object\n * @returns object\n */\n serialize() {\n return this.data;\n }\n}\n\nexport default Record;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","module.exports = get;\n\n/*\n const obj = {a: {aa: {aaa: 2}}, b: 4};\n\n get(obj, 'a.aa.aaa'); // 2\n get(obj, ['a', 'aa', 'aaa']); // 2\n\n get(obj, 'b.bb.bbb'); // undefined\n get(obj, ['b', 'bb', 'bbb']); // undefined\n\n get(obj.a, 'aa.aaa'); // 2\n get(obj.a, ['aa', 'aaa']); // 2\n\n get(obj.b, 'bb.bbb'); // undefined\n get(obj.b, ['bb', 'bbb']); // undefined\n\n get(obj.b, 'bb.bbb', 42); // 42\n get(obj.b, ['bb', 'bbb'], 42); // 42\n\n get(null, 'a'); // undefined\n get(undefined, ['a']); // undefined\n\n get(null, 'a', 42); // 42\n get(undefined, ['a'], 42); // 42\n\n const obj = {a: {}};\n const sym = Symbol();\n obj.a[sym] = 4;\n get(obj.a, sym); // 4\n*/\n\nfunction get(obj, propsArg, defaultValue) {\n if (!obj) {\n return defaultValue;\n }\n var props, prop;\n if (Array.isArray(propsArg)) {\n props = propsArg.slice(0);\n }\n if (typeof propsArg == 'string') {\n props = propsArg.split('.');\n }\n if (typeof propsArg == 'symbol') {\n props = [propsArg];\n }\n if (!Array.isArray(props)) {\n throw new Error('props arg must be an array, a string or a symbol');\n }\n while (props.length) {\n prop = props.shift();\n if (!obj) {\n return defaultValue;\n }\n obj = obj[prop];\n if (obj === undefined) {\n return defaultValue;\n }\n }\n return obj;\n}\n","import Record from '../models/record';\n\nimport { makeJSONRequest } from '../lib/xhr';\nimport { getRecordDataFromLocalStorage, setRecordDataToLocalStorage } from './override';\n\n\nexport const options = window.geoip_detect?.options || {\n ajaxurl: \"/wp-admin/admin-ajax.php\",\n default_locales: ['en'],\n cookie_duration_in_days: 7,\n cookie_name: 'geoip-detect-result',\n do_body_classes: false\n};\n\nlet ajaxPromise = null;\n\nfunction get_info_raw() {\n if (!ajaxPromise) {\n // Do Ajax Request only once per page load\n const url = options.ajaxurl + '?action=geoip_detect2_get_info_from_current_ip'\n\n ajaxPromise = makeJSONRequest(url);\n \n ajaxPromise.then((response) => {\n if (response?.extra?.error) {\n console.error('Geolocation IP Detection Error: Server returned an error: ' + response.extra.error);\n }\n })\n }\n\n return ajaxPromise;\n}\n\nasync function get_info_cached() {\n let response = false;\n let storedResponse = false;\n\n // 1) Load Info from localstorage cookie cache, if possible\n if (options.cookie_name) {\n storedResponse = getRecordDataFromLocalStorage()\n if (storedResponse && storedResponse.extra) {\n if (storedResponse.extra.override === true) {\n console.info('Geolocation IP Detection: Using cached response (override)');\n } else {\n console.info('Geolocation IP Detection: Using cached response');\n }\n return storedResponse;\n }\n }\n\n // 2) Get response\n try {\n response = await get_info_raw();\n } catch (err) {\n console.log('Weird: Uncaught error...', err);\n response = err.responseJSON || err;\n }\n\n // 3) Save info to localstorage cookie cache\n if (options.cookie_name) {\n\n // Check if Override has been set now\n storedResponse = getRecordDataFromLocalStorage()\n if (storedResponse?.extra?.override === true) {\n console.info('Geolocation IP Detection: Using cached response (override)');\n return storedResponse;\n }\n\n let cache_duration = options.cookie_duration_in_days * 24 * 60 * 60;\n if (response?.extra?.error)\n cache_duration = 60; // Cache errors only for 1 minute, then try again\n \n setRecordDataToLocalStorage(response, cache_duration);\n }\n\n return response;\n}\n\n\n/**\n * Load the data from the server\n * \n * (It can also be loaded from the browser localstorage, if the record data is present there already.)\n * \n * @api\n * @return Promise(Record)\n */\nexport async function get_info() {\n let response = await get_info_cached();\n\n if (typeof (response) !== 'object') {\n console.error('Geolocation IP Detection Error: Record should be an object, not a ' + typeof (response), response);\n response = { 'extra': { 'error': response || 'Network error, look at the original server response ...' } };\n }\n\n const record = new Record(response, options.default_locales);\n return record;\n}\n","// @see https://gomakethings.com/promise-based-xhr/\n\nexport const makeRequest = function (url, method = 'GET') {\n\n // Create the XHR request\n var request = new XMLHttpRequest();\n\n // Return it as a Promise\n return new Promise(function (resolve, reject) {\n\n // Setup our listener to process compeleted requests\n request.onreadystatechange = function () {\n\n // Only run if the request is complete\n if (request.readyState !== 4) return;\n\n // Process the response\n if (request.status >= 200 && request.status < 300) {\n // If successful\n resolve(request);\n } else {\n // If failed\n reject({\n status: request.status,\n statusText: request.statusText,\n request: request\n });\n }\n\n };\n\n // Setup our HTTP request\n request.open(method || 'GET', url, true);\n\n // Send the request\n request.send();\n\n });\n};\n\nexport const jsonDecodeIfPossible = function(str) {\n try {\n return JSON.parse(str);\n } catch(e) {\n return createErrorObject('Invalid JSON: ' + str);\n }\n}\n\nfunction createErrorObject(errorMsg) {\n return {\n is_empty: true,\n extra: {\n error: errorMsg\n }\n };\n}\n\nexport const makeJSONRequest = async function(url, method = 'GET') {\n try {\n const request = await makeRequest(url, method);\n if (!request.responseText || request.responseText === '0') {\n return createErrorObject('Got an empty response from server. Did you enable AJAX in the options?');\n }\n return jsonDecodeIfPossible(request.responseText);\n } catch(e) {\n return jsonDecodeIfPossible(e.request.responseText);\n }\n}\n","import { getLocalStorage, setLocalStorage } from '../lib/localStorageAccess';\nimport { options as globalOptions } from './get_info';\nimport Record, { camelToUnderscore } from '../models/record';\nimport _set from 'just-safe-set';\nimport _get from 'just-safe-get';\nimport _debounce from 'just-debounce-it';\nimport _is_object_content_equal from 'just-compare';\nimport { main } from '../main';\n\nfunction processOptions(options) {\n options = options || {};\n if (typeof(options) == 'number') {\n options = {\n 'duration_in_days': options\n };\n }\n\n options.duration_in_days = options.duration_in_days || globalOptions.cookie_duration_in_days;\n if (options.duration_in_days < 0) {\n console.warn('Geolocation IP Detection set_override_data() did nothing: A negative duration doesn\\'t make sense. If you want to remove the override, use remove_override() instead.');\n return false;\n }\n\n if (typeof (options.reevaluate) == 'undefined' ) {\n options.reevaluate = true;\n }\n\n return options;\n}\n/**\n * Override only one property, leave the other properties as-is.\n * @param {string} property \n * @param {*} value \n */\nexport function set_override_with_merge(property, value, options) {\n let record = getRecordDataFromLocalStorage() || {};\n property = property || '';\n \n property = camelToUnderscore(property);\n\n const oldData = _get(record, property);\n if (typeof(oldData) == 'object' && typeof(oldData.names) == 'object') {\n property += '.name';\n }\n if (property.endsWith('.name')) {\n property += 's';\n value = { 'en' : value };\n }\n \n _set(record, property, value);\n set_override(record, options);\n}\n\n/**\n * This functions allows to override the geodetected data manually (e.g. a country selector)\n * \n * @api\n * @param {*} record \n * @param {object} options\n * @param {number} duration_in_days When this override expires (default: 1 week later)\n * @param {boolean} reevaluate If the shortcodes etc. should be re-evaluated (default: true)\n * @return boolean TRUE if override data changed\n */\nexport function set_override(record, options) {\n options = processOptions(options);\n\n if (record && typeof (record.serialize) === 'function') {\n record = record.serialize();\n }\n\n return set_override_data(record, options);\n}\n\nfunction set_override_data(newData, options) {\n newData = newData || {};\n _set(newData, 'extra.override', true);\n\n const oldData = getRecordDataFromLocalStorage();\n setLocalStorage(globalOptions.cookie_name, newData, options.duration_in_days * 24 * 60 * 60);\n\n if (options.reevaluate && !_is_object_content_equal(newData, oldData)) {\n main();\n return true;\n }\n\n return false;\n}\n\n/**\n * Remove the override data.\n * On next page load, the record data will be loaded from the server again.\n * \n * @return boolean\n */\nexport function remove_override() {\n setLocalStorage(globalOptions.cookie_name, {}, -1);\n return true;\n}\n\n\n// Sync function in case it is known that no AJAX will occur\nexport function getRecordDataFromLocalStorage() {\n return getLocalStorage(globalOptions.cookie_name);\n}\n\nexport function setRecordDataToLocalStorage(data, cache_duration) {\n setLocalStorage(globalOptions.cookie_name, data, cache_duration);\n}\n\nexport function get_info_stored_locally_record() {\n return new Record(getRecordDataFromLocalStorage(), globalOptions.default_locales);\n}","export const setLocalStorage = function (variable, value, ttl_sec) {\n var data = {value: value, expires_at: new Date().getTime() + (ttl_sec * 1000) / 1 };\n localStorage.setItem(variable.toString(), JSON.stringify(data));\n};\n\nexport const getLocalStorage = function (variable) {\n let data = null;\n try {\n data = JSON.parse(localStorage.getItem(variable.toString()));\n } catch(e) {\n return null;\n }\n if (data !== null) {\n if (data.expires_at !== null && data.expires_at < new Date().getTime()) {\n localStorage.removeItem(variable.toString());\n } else {\n return data.value;\n }\n }\n return null;\n}\n","module.exports = set;\n\n/*\n var obj1 = {};\n set(obj1, 'a.aa.aaa', 4); // true\n obj1; // {a: {aa: {aaa: 4}}}\n\n var obj2 = {};\n set(obj2, ['a', 'aa', 'aaa'], 4); // true\n obj2; // {a: {aa: {aaa: 4}}}\n\n var obj3 = {a: {aa: {aaa: 2}}};\n set(obj3, 'a.aa.aaa', 3); // true\n obj3; // {a: {aa: {aaa: 3}}}\n\n // don't clobber existing\n var obj4 = {a: {aa: {aaa: 2}}};\n set(obj4, 'a.aa', {bbb: 7}); // false\n\n const obj5 = {a: {}};\n const sym = Symbol();\n set(obj5.a, sym, 7); // true\n obj5; // {a: {Symbol(): 7}}\n*/\n\nfunction set(obj, propsArg, value) {\n var props, lastProp;\n if (Array.isArray(propsArg)) {\n props = propsArg.slice(0);\n }\n if (typeof propsArg == 'string') {\n props = propsArg.split('.');\n }\n if (typeof propsArg == 'symbol') {\n props = [propsArg];\n }\n if (!Array.isArray(props)) {\n throw new Error('props arg must be an array, a string or a symbol');\n }\n lastProp = props.pop();\n if (!lastProp) {\n return false;\n }\n prototypeCheck(lastProp);\n var thisProp;\n while ((thisProp = props.shift())) {\n prototypeCheck(thisProp);\n if (typeof obj[thisProp] == 'undefined') {\n obj[thisProp] = {};\n }\n obj = obj[thisProp];\n if (!obj || typeof obj != 'object') {\n return false;\n }\n }\n obj[lastProp] = value;\n return true;\n}\n\nfunction prototypeCheck(prop) {\n if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') {\n throw new Error('setting of prototype values not supported');\n }\n}\n","module.exports = debounce;\n\nfunction debounce(fn, wait, callFirst) {\n var timeout = null;\n var debouncedFn = null;\n\n var clear = function() {\n if (timeout) {\n clearTimeout(timeout);\n\n debouncedFn = null;\n timeout = null;\n }\n };\n\n var flush = function() {\n var call = debouncedFn;\n clear();\n\n if (call) {\n call();\n }\n };\n\n var debounceWrapper = function() {\n if (!wait) {\n return fn.apply(this, arguments);\n }\n\n var context = this;\n var args = arguments;\n var callNow = callFirst && !timeout;\n clear();\n\n debouncedFn = function() {\n fn.apply(context, args);\n };\n\n timeout = setTimeout(function() {\n timeout = null;\n\n if (!callNow) {\n var call = debouncedFn;\n debouncedFn = null;\n\n return call();\n }\n }, wait);\n\n if (callNow) {\n return debouncedFn();\n }\n };\n\n debounceWrapper.cancel = clear;\n debounceWrapper.flush = flush;\n\n return debounceWrapper;\n}\n","module.exports = compare;\n\n/*\n primitives: value1 === value2\n functions: value1.toString == value2.toString\n arrays: if length, sequence and values of properties are identical\n objects: if length, names and values of properties are identical\n compare([[1, [2, 3]], [[1, [2, 3]]); // true\n compare([[1, [2, 3], 4], [[1, [2, 3]]); // false\n compare({a: 2, b: 3}, {a: 2, b: 3}); // true\n compare({a: 2, b: 3}, {b: 3, a: 2}); // true\n compare({a: 2, b: 3, c: 4}, {a: 2, b: 3}); // false\n compare({a: 2, b: 3}, {a: 2, b: 3, c: 4}); // false\n compare([[1, [2, {a: 4}], 4], [[1, [2, {a: 4}]]); // true\n*/\n\nfunction compare(value1, value2) {\n if (value1 === value2) {\n return true;\n }\n /* eslint-disable no-self-compare */\n // if both values are NaNs return true\n if (value1 !== value1 && value2 !== value2) {\n return true;\n }\n if ({}.toString.call(value1) != {}.toString.call(value2)) {\n return false;\n }\n if (value1 !== Object(value1)) {\n // non equal primitives\n return false;\n }\n if (!value1) {\n return false;\n }\n if (Array.isArray(value1)) {\n return compareArrays(value1, value2);\n }\n if ({}.toString.call(value1) == '[object Set]') {\n return compareArrays(Array.from(value1), Array.from(value2));\n }\n if ({}.toString.call(value1) == '[object Object]') {\n return compareObjects(value1, value2);\n } else {\n return compareNativeSubtypes(value1, value2);\n }\n}\n\nfunction compareNativeSubtypes(value1, value2) {\n // e.g. Function, RegExp, Date\n return value1.toString() === value2.toString();\n}\n\nfunction compareArrays(value1, value2) {\n var len = value1.length;\n if (len != value2.length) {\n return false;\n }\n var alike = true;\n for (var i = 0; i < len; i++) {\n if (!compare(value1[i], value2[i])) {\n alike = false;\n break;\n }\n }\n return alike;\n}\n\nfunction compareObjects(value1, value2) {\n var keys1 = Object.keys(value1).sort();\n var keys2 = Object.keys(value2).sort();\n var len = keys1.length;\n if (len != keys2.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n var key1 = keys1[i];\n var key2 = keys2[i];\n if (!(key1 == key2 && compare(value1[key1], value2[key2]))) {\n return false;\n }\n }\n return true;\n}\n","import { do_shortcodes, do_shortcodes_init } from './shortcodes/index';\nimport { add_body_classes } from './body_classes';\nimport { options } from './lookup/get_info';\n\nlet firstCall = true;\n\nexport function main() {\n if (process.env.NODE_ENV !== 'production') {\n console.log('Do Main');\n }\n\n if (firstCall) {\n do_shortcodes_init();\n firstCall = false; \n }\n\n if (options.do_body_classes) {\n add_body_classes();\n }\n\n // Do all the shortcodes that are in the HTML. Even if shortcodes is not enabled globally, they might be enabled for a specific shortcode.\n do_shortcodes();\n}","export const domReady = new Promise(resolve => {\n if (document.readyState === \"loading\") {\n if (document.addEventListener) {\n document.addEventListener('DOMContentLoaded', resolve);\n } else {\n document.attachEvent('onreadystatechange', function () {\n if (document.readyState != 'loading')\n resolve();\n });\n }\n }\n else {\n resolve();\n }\n});\n\nexport function selectItemByValue(el, value) {\n for (var i = 0; i < el.options.length; i++) {\n if (el.options[i].value === value) {\n el.selectedIndex = i;\n break;\n }\n }\n}\n\n/**\n * @param {*} el Select Tag\n * @param {string} attributeName HTML attribute name to search by\n * @param {string} attributeValue HTML attribute value to search by\n * @returns boolean TRUE if Value found in select tag\n */\nexport function selectItemByAttribute(el, attributeName, attributeValue) {\n for (let i = 0; i < el.options.length; i++) {\n if (el.options[i].getAttribute(attributeName) === attributeValue) {\n el.selectedIndex = i;\n return true;\n }\n }\n return false;\n}","import { get_info } from \"../lookup/get_info\";\n\n// Get Options from data-options and json parse them\nexport function get_options(el) {\n const raw = el.getAttribute('data-options');\n try {\n return JSON.parse(raw);\n } catch (e) {\n return {};\n }\n}\n\nexport async function action_on_elements(className, errorMessage, callback) {\n const elements = document.getElementsByClassName(className);\n if (!elements.length) return;\n\n const record = await get_info();\n\n if (record.error()) {\n console.error('Geolocation IP Detection Error (' + errorMessage + '): ' + record.error());\n return;\n }\n\n Array.from(elements)\n .forEach(el => callback(el, record));\n}\n\nexport function get_value_from_record(el, record, property = null) {\n const opt = get_options(el);\n property = property || opt.property;\n if (opt.skip_cache) {\n console.warn(\"Geolocation IP Detection: The property 'skip_cache' is ignored in AJAX mode. You could disable the response caching on the server by setting the constant GEOIP_DETECT_READER_CACHE_TIME.\");\n }\n\n return record.get_with_locales(property, opt.lang, opt.default);\n}","import { triggerNativeEvent } from \"../lib/events\";\nimport { selectItemByAttribute } from \"../lib/html\";\nimport { get_value_from_record, get_options } from \"./helpers\";\n\nexport function do_shortcode_normal(el, record) {\n el.innerText = get_value_from_record(el, record);\n}\n\nexport function do_shortcode_flags(el, record) {\n const country = record.get_country_iso() || get_options(el).default;\n if (country) {\n el.classList.add('flag-icon-' + country)\n }\n}\n\n\nexport function do_shortcode_country_select(el, record) {\n let country = record.get_country_iso();\n\n if (selectItemByAttribute(el, 'data-c', country)) {\n triggerNativeEvent(el, 'change');\n } else {\n const defaultValue = get_options(el).default;\n if (get_options(el).default) {\n if (selectItemByAttribute(el, 'data-c', defaultValue)) {\n triggerNativeEvent(el, 'change');\n }\n }\n }\n}\n\nexport function do_shortcode_text_input(el, record) {\n el.value = get_value_from_record(el, record);\n triggerNativeEvent(el, 'change');\n}","\nlet _internalEvent = false;\nexport function isInternalEvent() {\n return _internalEvent;\n}\n\nexport function triggerNativeEvent(el, name) {\n _internalEvent = true;\n if (document.createEvent) {\n const event = document.createEvent('HTMLEvents');\n event.initEvent(name, true, false);\n el.dispatchEvent(event);\n } else {\n el.fireEvent('on' + name);\n }\n _internalEvent = false;\n}","\nimport { isInternalEvent } from \"../lib/events\";\nimport { set_override_with_merge } from \"../lookup/override\";\nimport { get_options } from \"./helpers\";\n\nlet _listener_active = false; // for recursion detection (maybe remove later)\nlet _change_counter = 0; // ToDo remove later!\n\nexport function init() {\n document.addEventListener('change', event_listener_autosave_on_change, false);\n}\n\nfunction event_listener_autosave_on_change(event) {\n if (isInternalEvent()) return;\n\n const target = event.target;\n if (target.matches('.js-geoip-detect-input-autosave')) {\n\n if (process.env.NODE_ENV !== 'production') {\n console.log('autosave on change', target);\n }\n\n const property = get_options(target).property;\n const value = target.value;\n\n if (value) {\n _change_counter++;\n if (_listener_active || _change_counter > 100) {\n console.warn('Error: Thats weird! autosave change detected a recursion! Please file a bug report about this.');\n debugger;\n return;\n } else {\n _listener_active = true;\n\n if (target.matches('select.js-geoip-detect-country-select')) {\n const selected = target.options[target.selectedIndex];\n const isoCode = selected?.getAttribute('data-c');\n if (isoCode) {\n set_override_with_merge('country.iso_code', isoCode.toUpperCase(), {reevaluate: false});\n }\n }\n \n set_override_with_merge(property, value); // might call do_shortcodes etc.\n\n _listener_active = false;\n }\n }\n }\n}","import { get_options } from './helpers';\nimport _intersect from 'just-intersect';\n\n\nexport function do_shortcode_show_if(el, record) {\n const opt = get_options(el);\n const evaluated = geoip_detect2_shortcode_evaluate_conditions(opt.parsed, opt, record);\n\n if (!evaluated) {\n el.style.display = \"none\";\n el.classList.add('geoip-hidden');\n el.classList.remove('geoip-shown');\n } else {\n el.style.display = '';\n el.classList.remove('geoip-hidden');\n el.classList.add('geoip-shown');\n }\n}\n\nexport function geoip_detect2_shortcode_evaluate_conditions(parsed, opt, record) {\n const alternativePropertyNames = [\n 'name',\n 'iso_code',\n 'iso_code3',\n 'code',\n 'geoname_id',\n ];\n\n let isConditionMatching = (parsed.op === 'or') ? false : true;\n\n parsed.conditions.forEach(c => {\n let subConditionMatching = false;\n let values = [];\n\n const raw_value = record.get_raw(c.p);\n\n if (raw_value === null) {\n subConditionMatching = false;\n } else {\n if (typeof (raw_value) === 'object') {\n alternativePropertyNames.forEach(name => {\n if (raw_value[name]) {\n values.push(raw_value[name]);\n } else if (name == 'name') {\n values.push(record.get_with_locales(c.p, opt.lang));\n }\n })\n } else {\n values = [raw_value]\n }\n }\n\n subConditionMatching = geoip_detect2_shortcode_check_subcondition(c.v, values);\n\n if (c.not) {\n subConditionMatching = !subConditionMatching;\n }\n\n if (parsed.op === 'or') {\n isConditionMatching = isConditionMatching || subConditionMatching;\n } else {\n isConditionMatching = isConditionMatching && subConditionMatching;\n }\n\n });\n\n if (parsed.not) {\n isConditionMatching = !isConditionMatching;\n }\n\n return isConditionMatching;\n}\n\nfunction geoip_detect2_shortcode_check_subcondition(expectedValues, actualValues) {\n if (actualValues[0] === true) {\n actualValues = ['true', 'yes', 'y', '1'];\n } else if (actualValues[0] === false) {\n actualValues = ['false', 'no', 'n', '0', ''];\n }\n\n actualValues = actualValues.map(x => String(x).toLowerCase())\n\n expectedValues = expectedValues.split(',');\n\n const intersect = _intersect(expectedValues, actualValues);\n\n return intersect.length > 0;\n}","module.exports = intersect;\n\n/*\n intersect([1, 2, 5, 6], [2, 3, 5, 6]); // [2, 5, 6]\n intersect([1, 2, 2, 4, 5], [3, 2, 2, 5, 7]); // [2, 5]\n*/\n\nfunction intersect(arr1, arr2) {\n if (!Array.isArray(arr1) || !Array.isArray(arr2)) {\n throw new Error('expected both arguments to be arrays');\n }\n var result = [];\n var len = arr1.length;\n for (var i = 0; i < len; i++) {\n var elem = arr1[i];\n if (arr2.indexOf(elem) > -1 && result.indexOf(elem) == -1) {\n result.push(elem);\n }\n }\n return result;\n}\n","import { domReady } from \"../lib/html\";\nimport { action_on_elements } from \"./helpers\";\nimport { do_shortcode_country_select, do_shortcode_flags, do_shortcode_normal, do_shortcode_text_input } from \"./normal\";\nimport { init as onchangeInit } from \"./onchange\";\nimport { do_shortcode_show_if } from \"./show-if\";\n\n\nexport const do_shortcodes_init = function () {\n onchangeInit();\n}\n\nexport const do_shortcodes = async function do_shortcodes() {\n // Before doing any of these, the DOM tree needs to be loaded\n await domReady;\n\n // These are called in parallel, as they are async functions\n action_on_elements('js-geoip-detect-shortcode',\n 'could not execute shortcode(s) [geoip_detect2 ...]', do_shortcode_normal);\n\n action_on_elements('js-geoip-detect-flag',\n 'could not configure the flag(s)', do_shortcode_flags);\n\n action_on_elements('js-geoip-text-input',\n 'could not set the value of the text input field(s)', do_shortcode_text_input);\n\n action_on_elements('js-geoip-detect-country-select',\n 'could not set the value of the select field(s)', do_shortcode_country_select);\n\n action_on_elements('js-geoip-detect-show-if',\n 'could not execute the show-if/hide-if conditions', do_shortcode_show_if);\n};\n","import { domReady } from './lib/html';\nimport { get_info } from './lookup/get_info';\n\nexport function calc_classes(record) {\n return {\n country: record.get('country.iso_code'),\n 'country-is-in-european-union': record.get('country.is_in_european_union', false),\n continent: record.get('continent.code'),\n province: record.get('most_specific_subdivision.iso_code'),\n };\n}\n\nfunction remove_css_classes_by_prefix(el, prefix) {\n const classes = el.className.split(\" \").filter(c => !c.startsWith(prefix));\n el.className = classes.join(\" \").trim();\n}\n\nexport async function add_body_classes() {\n const record = await get_info();\n\n if (record.error()) {\n console.error('Geolocation IP Detection Error (could not add CSS-classes to body): ' + record.error());\n return;\n }\n\n await domReady;\n\n add_classes_to_body(record);\n}\n\nexport function add_classes_to_body(record) {\n const css_classes = calc_classes(record);\n\n const body = document.getElementsByTagName('body')[0];\n \n // Remove old classes in case there are any\n remove_css_classes_by_prefix(body, 'geoip-');\n \n for (let key of Object.keys(css_classes)) {\n const value = css_classes[key];\n if (value) {\n if (typeof (value) == 'string') {\n body.classList.add(`geoip-${key}-${value}`);\n } else {\n body.classList.add(`geoip-${key}`);\n }\n }\n }\n}","import { get_info } from './lookup/get_info';\nimport { remove_override, set_override } from './lookup/override';\nimport { main } from './main';\n\n// Evaluate shortcodes, body classes, etc.\nmain();\n\n\n// Extend window object \nwindow.geoip_detect.get_info = get_info;\n\nwindow.geoip_detect.set_override = set_override;\nwindow.geoip_detect.remove_override = remove_override;"],"names":["$7fb3379cb4faeaa9$exports","obj","__esModule","module","exports","parcelRequire","$d644595609e664a3$var$runtime","undefined","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","GenStateSuspendedStart","method","arg","GenStateExecuting","Error","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","done","GenStateSuspendedYield","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","invoke","resolve","reject","result","__await","then","value1","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","this","reset","iterable","iteratorMethod","isNaN","length","i","next1","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","key1","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","globalThis","Function","$cd60abae8b9c0748$var$_typeof","obj1","$1a2ba968d63fb6cf$var$asyncGeneratorStep","gen","_next","_throw","args","arguments","apply","$0ad8156b16c85a9a$var$_justSafeGet","_get_localized","ret","locales","$0ad8156b16c85a9a$var$_typeof2","default","names","locale","camelToUnderscore","split","map","x","toLowerCase","replace","join","Record","data","default_locales","$0ad8156b16c85a9a$var$_classCallCheck2","is_empty","_process_locales","prop","default_value","get_with_locales","_lookup_with_locales","substr","get_raw","Array","isArray","console","warn","country","get","instance","Constructor","$a7f90d4906b02dea$var$_defineProperties","target","props","descriptor","protoProps","staticProps","propsArg","defaultValue","shift","$9fe0fb67532c57dd$var$_record","makeRequest","url","request","XMLHttpRequest","onreadystatechange","readyState","status","statusText","open","send","jsonDecodeIfPossible","str","JSON","parse","e","createErrorObject","errorMsg","extra","makeJSONRequest","_ref","$b866da47520fe162$var$_asyncToGenerator2","$b866da47520fe162$var$_regenerator","_callee","_args","_context","responseText","t0","_x","property","options","getRecordDataFromLocalStorage","$38b58d3e214bcd83$var$_record","oldData","$38b58d3e214bcd83$var$_justSafeGet","$38b58d3e214bcd83$var$_typeof2","endsWith","$38b58d3e214bcd83$var$_justSafeSet","set_override","$cda3d83fa806874f$exports","setLocalStorage","globalOptions","cookie_name","cache_duration","variable","ttl_sec","expires_at","Date","getTime","localStorage","setItem","toString","stringify","getItem","removeItem","$38b58d3e214bcd83$var$_interopRequireWildcard","$e7ba237efef71388$var$prototypeCheck","lastProp","thisProp","wait","callFirst","timeout","debouncedFn","clear","clearTimeout","debounceWrapper","callNow","setTimeout","cancel","flush","$8df1e026a66990a7$var$compare","value2","$8df1e026a66990a7$var$compareArrays","from","keys1","sort","keys2","len","key2","$8df1e026a66990a7$var$compareObjects","$8df1e026a66990a7$var$compareNativeSubtypes","alike","$38b58d3e214bcd83$var$_justCompare","firstCall","$2cf774dbc37eb0c4$exports","do_shortcodes_init","do_body_classes","$4cd5b8be8663970b$exports","add_body_classes","do_shortcodes","el","selectedIndex","attributeName","attributeValue","getAttribute","domReady","document","addEventListener","attachEvent","action_on_elements","opt","get_options","skip_cache","lang","raw","$5db6259c0d5d765a$var$_action_on_elements","$5db6259c0d5d765a$var$_asyncToGenerator2","$5db6259c0d5d765a$var$_regenerator","className","errorMessage","callback","elements","getElementsByClassName","$9fe0fb67532c57dd$exports","get_info","innerText","$5db6259c0d5d765a$exports","get_value_from_record","get_country_iso","classList","add","$5cf978ba75b479f8$exports","selectItemByAttribute","$dec43294fed98591$exports","triggerNativeEvent","_internalEvent","createEvent","event","initEvent","dispatchEvent","fireEvent","event_listener_autosave_on_change","_listener_active","_change_counter","isInternalEvent","matches","selected","isoCode","$38b58d3e214bcd83$exports","set_override_with_merge","toUpperCase","reevaluate","geoip_detect2_shortcode_evaluate_conditions","parsed","style","display","remove","arr1","arr2","elem","indexOf","$3c68d05e62fd88f8$var$_justIntersect","alternativePropertyNames","isConditionMatching","op","conditions","c","subConditionMatching","raw_value","p","$3c68d05e62fd88f8$var$_typeof2","expectedValues","actualValues","String","geoip_detect2_shortcode_check_subcondition","v","not","$6da902fb26eb6fbd$exports","init","_do_shortcodes","$2cf774dbc37eb0c4$var$_asyncToGenerator2","$2cf774dbc37eb0c4$var$_regenerator","do_shortcode_normal","do_shortcode_flags","do_shortcode_text_input","do_shortcode_country_select","do_shortcode_show_if","calc_classes","continent","province","$4cd5b8be8663970b$var$_add_body_classes","$4cd5b8be8663970b$var$_asyncToGenerator2","$4cd5b8be8663970b$var$_regenerator","add_classes_to_body","prefix","classes","css_classes","body","getElementsByTagName","filter","startsWith","trim","_i","_Object$keys","concat","duration_in_days","cookie_duration_in_days","processOptions","serialize","newData","$7ba2aa436d90b205$exports","main","set_override_data","getLocalStorage","$9fe0fb67532c57dd$var$_window$geoip_detect","window","geoip_detect","ajaxurl","ajaxPromise","get_info_raw","$b866da47520fe162$exports","response","_response$extra","get_info_cached","$9fe0fb67532c57dd$var$_get_info_cached","$9fe0fb67532c57dd$var$_asyncToGenerator2","$9fe0fb67532c57dd$var$_regenerator","storedResponse","_storedResponse","_storedResponse$extra","_response","_response$extra2","override","log","responseJSON","setRecordDataToLocalStorage","$9fe0fb67532c57dd$var$_get_info","_callee2","_context2","$9fe0fb67532c57dd$var$_typeof2","remove_override"],"version":3,"file":"frontend.js.map"} \ No newline at end of file diff --git a/js/lookup/get_info.js b/js/lookup/get_info.js index 4f9397ce..c93ad06c 100644 --- a/js/lookup/get_info.js +++ b/js/lookup/get_info.js @@ -52,7 +52,7 @@ async function get_info_cached() { try { response = await get_info_raw(); } catch (err) { - console.log('Uncaught ERROR ??'); + console.log('Weird: Uncaught error...', err); response = err.responseJSON || err; } diff --git a/js/main.js b/js/main.js index 3a317e01..98de4603 100644 --- a/js/main.js +++ b/js/main.js @@ -5,7 +5,9 @@ import { options } from './lookup/get_info'; let firstCall = true; export function main() { -console.log('Do Main'); + if (process.env.NODE_ENV !== 'production') { + console.log('Do Main'); + } if (firstCall) { do_shortcodes_init(); diff --git a/js/shortcodes/onchange.js b/js/shortcodes/onchange.js index 12e9d812..4b380f49 100644 --- a/js/shortcodes/onchange.js +++ b/js/shortcodes/onchange.js @@ -15,14 +15,18 @@ function event_listener_autosave_on_change(event) { const target = event.target; if (target.matches('.js-geoip-detect-input-autosave')) { - console.log('autosave on change', target); + + if (process.env.NODE_ENV !== 'production') { + console.log('autosave on change', target); + } + const property = get_options(target).property; const value = target.value; if (value) { _change_counter++; if (_listener_active || _change_counter > 100) { - console.warn('Thats weird! autosave change detected a recursion!'); + console.warn('Error: Thats weird! autosave change detected a recursion! Please file a bug report about this.'); debugger; return; } else { diff --git a/js/shortcodes/show-if.js b/js/shortcodes/show-if.js index ee771f85..0ee3ade9 100644 --- a/js/shortcodes/show-if.js +++ b/js/shortcodes/show-if.js @@ -7,9 +7,13 @@ export function do_shortcode_show_if(el, record) { const evaluated = geoip_detect2_shortcode_evaluate_conditions(opt.parsed, opt, record); if (!evaluated) { - el.style.display = "none !important"; + el.style.display = "none"; + el.classList.add('geoip-hidden'); + el.classList.remove('geoip-shown'); } else { el.style.display = ''; + el.classList.remove('geoip-hidden'); + el.classList.add('geoip-shown'); } }