diff --git a/js/dist/forum.js b/js/dist/forum.js index c13ff74..7f31f54 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,3 +1,3 @@ /*! For license information please see forum.js.LICENSE.txt */ -(()=>{var t={301:function(t){t.exports=function(){"use strict";function t(r){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function r(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r{t.exports=function(t){for(var r=[],e=0,n=0,o=0,a=t.length;o{var n=e(735).default;function o(){"use strict";t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var r,e={},a=Object.prototype,i=a.hasOwnProperty,c=Object.defineProperty||function(t,r,e){t[r]=e.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function p(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{p({},"")}catch(r){p=function(t,r,e){return t[r]=e}}function d(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,a=Object.create(o.prototype),i=new P(n||[]);return c(a,"_invoke",{value:O(t,e,i)}),a}function m(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",y="suspendedYield",v="executing",g="completed",b={};function w(){}function x(){}function _(){}var L={};p(L,l,(function(){return this}));var I=Object.getPrototypeOf,j=I&&I(I(z([])));j&&j!==a&&i.call(j,l)&&(L=j);var S=_.prototype=w.prototype=Object.create(L);function A(t){["next","throw","return"].forEach((function(r){p(t,r,(function(t){return this._invoke(r,t)}))}))}function C(t,r){function e(o,a,c,u){var l=m(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return e("throw",t,c,u)}))}u(l.arg)}var o;c(this,"_invoke",{value:function(t,n){function a(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(a,a):a()}})}function O(t,e,n){var o=h;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=E(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=m(t,e,n);if("normal"===l.type){if(o=n.done?g:y,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=g,n.method="throw",n.arg=l.arg)}}}function E(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=m(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,b;var i=a.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,b):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,b)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function T(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function z(t){if(t||""===t){var e=t[l];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),T(e),b}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;T(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:z(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),b}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,r,e)=>{var n=e(24)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},r={};function e(n){var o=r[n];if(void 0!==o)return o.exports;var a=r[n]={exports:{}};return t[n].call(a.exports,a,a.exports,e),a.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";e.r(n),e.d(n,{extend:()=>K});const t=flarum.core.compat["forum/app"];var r=e.n(t);const o=flarum.core.compat["common/extend"],a=flarum.core.compat["common/components/PostMeta"];var i=e.n(a);const c=flarum.core.compat["common/components/Tooltip"];var u=e.n(c),l=e(301),s=e.n(l),f=e(880),p=e.n(f),d=function(t){if(t.countryCode()){var r=function(t){var r=s()(t);if(!r)return null;var e=p()(r);return e?"https://cdn.jsdelivr.net/gh/twitter/twemoji@14/assets/72x72/"+e+".png":null}(t.countryCode());if(r)return m(u(),{text:t.countryCode()},m("img",{src:r,alt:t.countryCode(),height:"16",loading:"lazy"}))}return null},h=function(t){var r=function(t){return t.organization()||t.isp()||t.error()||""}(t),e=function(t){return t.threatTypes()&&t.threatTypes().join(", ")}(t);return{description:r,threat:e,image:d(t),zip:t.zipCode(),country:t.countryCode()}},y=function(t){return function(){!function(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then((function(){}));else{var r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r);var e=document.getSelection(),n=e&&e.rangeCount>0?e.getRangeAt(0):null;r.select(),document.execCommand("copy"),document.body.removeChild(r),n&&e&&(e.removeAllRanges(),e.addRange(n))}}(t),r().alerts.show({type:"success"},r().translator.trans("fof-geoip.forum.alerts.ip_copied"))}};const v=flarum.core.compat["common/utils/ItemList"];var g=e.n(v);const b=flarum.core.compat["common/components/Button"];var w=e.n(b);function x(t,r){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},x(t,r)}function _(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,x(t,r)}const I=flarum.core.compat["common/components/Modal"];var j=e.n(I);function S(t,r,e,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}var A=e(183),C=e.n(A);const O=flarum.core.compat["common/Component"];var E=e.n(O);const k=flarum.core.compat["common/components/LoadingIndicator"];var T=e.n(k);const P=function(){function t(t){return function(r){return new Promise((function(e,n){var o=document.createElement(t),a="body",i="src";switch(o.onload=function(){e(r)},o.onerror=function(){n(r)},t){case"script":o.async=!0;break;case"link":o.type="text/css",o.rel="stylesheet",i="href",a="head"}o[i]=r,document[a].appendChild(o)}))}}return{css:t("link"),js:t("script"),img:t("img")}}();var z=!1,N=function(){var t,r=(t=C().mark((function t(){return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!z){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,P.css("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css");case 4:return t.next=6,P.js("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js");case 6:z=!0;case 7:case"end":return t.stop()}}),t)})),function(){var r=this,e=arguments;return new Promise((function(n,o){var a=t.apply(r,e);function i(t){S(a,n,o,i,c,"next",t)}function c(t){S(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(){return r.apply(this,arguments)}}(),M=function(t){function e(){return t.apply(this,arguments)||this}_(e,t);var n=e.prototype;return n.oninit=function(r){t.prototype.oninit.call(this,r),this.ipInfo=this.attrs.ipInfo,this.data=null,this.ipInfo.latitude()&&this.ipInfo.longitude()?this.searchLatLon():this.ipInfo.zipCode()?this.searchZip():this.data={unknown:!0}},n.view=function(){return this.loading?m(T(),{size:"medium"}):this.data&&this.data.unknown?m("div",{className:"helpText"},r().translator.trans("fof-geoip.forum.map_modal.not_enough_data")):this.data?m("div",{id:"geoip-map",oncreate:this.configMap.bind(this)}):m("div",null)},n.searchLatLon=function(){var t=this;if(!this.loading)return this.loading=!0,N().then(r().request({url:"https://nominatim.openstreetmap.org/reverse",method:"GET",params:{lat:this.ipInfo.latitude(),lon:this.ipInfo.longitude(),format:"json"}}).then((function(r){t.data=r,t.loading=!1,m.redraw()})))},n.searchZip=function(){var t=this;if(!this.loading)return this.loading=!0,N().then(r().request({url:"https://nominatim.openstreetmap.org/search",method:"GET",params:{q:this.ipInfo.zipCode(),countrycodes:this.ipInfo.countryCode(),limit:1,format:"json"}}).then((function(r){t.data=r[0],t.loading=!1,m.redraw()})))},n.configMap=function(t){if(this.data){var r=this.data,e=r.boundingbox;r.display_name,this.map=L.map(t.dom).setView([51.505,-.09],5),L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© OpenStreetMap contributors'}).addTo(this.map),L.marker([e[0],e[2]]).addTo(this.map).openPopup()}},e}(E());const G=flarum.core.compat["common/components/LabelValue"];var F=e.n(G),B=function(t){function e(){for(var r,e=arguments.length,n=new Array(e),o=0;o0&&m(F(),{label:r().translator.trans("fof-geoip.forum.map_modal.threat_types"),value:t.threatTypes().join(", ")}),t.error()&&m(F(),{label:r().translator.trans("fof-geoip.forum.map_modal.error"),value:t.error()})),m("hr",null),m("div",{id:"mapContainer"},m(M,{ipInfo:t}))):m("div",{className:"Modal-body"},m(T(),null))},e}(j());function R(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.children);!(n=o()).done;){var a=n.value.children.find((function(t){return"label"===(null==t?void 0:t.tag)})),i=a&&a.children.find((function(t){return"code"===(null==t?void 0:t.tag)})),c=i&&a.children.indexOf(i);if(i){var l=h(r),s=l.description,f=l.threat,p=l.image;i.attrs||(i.attrs={}),i.attrs["data-threat-level"]=r.threatLevel(),i.children[1]=m(u(),{text:s+(f?" ("+f+")":"")},m("span",null,i.children[1])),p&&a.children.splice(c,0,p)}}r.zipCode()&&r.countryCode()&&t.children.splice(2,0,m("div",{className:"Form-group"},m(M,{zip:r.zipCode(),country:r.countryCode()})))}}})),(0,o.extend)(D().prototype,"tokenActionItems",(function(t,e){var n=e.lastIpAddress();n&&t.add("geoip-info",m(w(),{className:"Button",onclick:function(){return r().modal.show(B,{ipAddr:n})},"aria-label":r().translator.trans("fof-geoip.forum.map_button_label")},r().translator.trans("fof-geoip.forum.map_button_label")),10)}))}))})(),module.exports=n})(); +(()=>{var t={301:function(t){t.exports=function(){"use strict";function t(r){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function r(t){return function(t){if(Array.isArray(t)){for(var r=0,e=new Array(t.length);r{t.exports=function(t){for(var r=[],e=0,n=0,o=0,a=t.length;o{var n=e(735).default;function o(){"use strict";t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var r,e={},a=Object.prototype,i=a.hasOwnProperty,u=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function p(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{p({},"")}catch(r){p=function(t,r,e){return t[r]=e}}function d(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,a=Object.create(o.prototype),i=new T(n||[]);return u(a,"_invoke",{value:O(t,e,i)}),a}function m(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",y="suspendedYield",v="executing",g="completed",b={};function w(){}function x(){}function _(){}var L={};p(L,l,(function(){return this}));var I=Object.getPrototypeOf,j=I&&I(I(z([])));j&&j!==a&&i.call(j,l)&&(L=j);var S=_.prototype=w.prototype=Object.create(L);function A(t){["next","throw","return"].forEach((function(r){p(t,r,(function(t){return this._invoke(r,t)}))}))}function C(t,r){function e(o,a,u,c){var l=m(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,u,c)}),(function(t){e("throw",t,u,c)})):r.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return e("throw",t,u,c)}))}c(l.arg)}var o;u(this,"_invoke",{value:function(t,n){function a(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(a,a):a()}})}function O(t,e,n){var o=h;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var u=n.delegate;if(u){var c=E(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=m(t,e,n);if("normal"===l.type){if(o=n.done?g:y,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=g,n.method="throw",n.arg=l.arg)}}}function E(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=m(o,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,b;var i=a.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,b):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,b)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function P(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function z(t){if(t||""===t){var e=t[l];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),P(e),b}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;P(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:z(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),b}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,r,e)=>{var n=e(24)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},r={};function e(n){var o=r[n];if(void 0!==o)return o.exports;var a=r[n]={exports:{}};return t[n].call(a.exports,a,a.exports,e),a.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";e.r(n),e.d(n,{extend:()=>K});const t=flarum.core.compat["forum/app"];var r=e.n(t);const o=flarum.core.compat["common/extend"],a=flarum.core.compat["common/components/PostMeta"];var i=e.n(a);const u=flarum.core.compat["common/components/Tooltip"];var c=e.n(u),l=e(301),s=e.n(l),f=e(880),p=e.n(f),d=function(t){if(t.countryCode()){var r=function(t){var r=s()(t);if(!r)return null;var e=p()(r);return e?"https://cdn.jsdelivr.net/gh/twitter/twemoji@14/assets/72x72/"+e+".png":null}(t.countryCode());if(r)return m(c(),{text:t.countryCode()},m("img",{src:r,alt:t.countryCode(),height:"16",loading:"lazy"}))}return null},h=function(t){var r=function(t){return t.organization()||t.isp()||t.error()||""}(t),e=function(t){return t.threatTypes()&&t.threatTypes().join(", ")}(t);return{description:r,threat:e,image:d(t),zip:t.zipCode(),country:t.countryCode()}},y=function(t){return function(){!function(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then((function(){}));else{var r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="absolute",r.style.left="-9999px",document.body.appendChild(r);var e=document.getSelection(),n=e&&e.rangeCount>0?e.getRangeAt(0):null;r.select(),document.execCommand("copy"),document.body.removeChild(r),n&&e&&(e.removeAllRanges(),e.addRange(n))}}(t),r().alerts.show({type:"success"},r().translator.trans("fof-geoip.forum.alerts.ip_copied"))}};const v=flarum.core.compat["common/utils/ItemList"];var g=e.n(v);const b=flarum.core.compat["common/components/Button"];var w=e.n(b);function x(t,r){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},x(t,r)}function _(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,x(t,r)}const I=flarum.core.compat["common/components/Modal"];var j=e.n(I);function S(t,r,e,n,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}var A=e(183),C=e.n(A);const O=flarum.core.compat["common/Component"];var E=e.n(O);const k=flarum.core.compat["common/components/LoadingIndicator"];var P=e.n(k);const T=function(){function t(t){return function(r){return new Promise((function(e,n){var o=document.createElement(t),a="body",i="src";switch(o.onload=function(){e(r)},o.onerror=function(){n(r)},t){case"script":o.async=!0;break;case"link":o.type="text/css",o.rel="stylesheet",i="href",a="head"}o[i]=r,document[a].appendChild(o)}))}}return{css:t("link"),js:t("script"),img:t("img")}}();var z=!1,N=function(){var t,r=(t=C().mark((function t(){return C().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!z){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,T.css("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css");case 4:return t.next=6,T.js("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js");case 6:z=!0;case 7:case"end":return t.stop()}}),t)})),function(){var r=this,e=arguments;return new Promise((function(n,o){var a=t.apply(r,e);function i(t){S(a,n,o,i,u,"next",t)}function u(t){S(a,n,o,i,u,"throw",t)}i(void 0)}))});return function(){return r.apply(this,arguments)}}(),M=function(t){function e(){return t.apply(this,arguments)||this}_(e,t);var n=e.prototype;return n.oninit=function(r){t.prototype.oninit.call(this,r),this.ipInfo=this.attrs.ipInfo,this.data=null,this.ipInfo.latitude()&&this.ipInfo.longitude()?this.searchLatLon():this.ipInfo.zipCode()?this.searchZip():this.data={unknown:!0}},n.view=function(){return this.loading?m(P(),{size:"medium"}):this.data&&this.data.unknown?m("div",{className:"helpText"},r().translator.trans("fof-geoip.forum.map_modal.not_enough_data")):this.data?m("div",{id:"geoip-map",oncreate:this.configMap.bind(this)}):m("div",null)},n.searchLatLon=function(){var t=this;if(!this.loading)return this.loading=!0,N().then(r().request({url:"https://nominatim.openstreetmap.org/reverse",method:"GET",params:{lat:this.ipInfo.latitude(),lon:this.ipInfo.longitude(),format:"json"}}).then((function(r){t.data=r,t.loading=!1,m.redraw()})))},n.searchZip=function(){var t=this;if(!this.loading)return this.loading=!0,N().then(r().request({url:"https://nominatim.openstreetmap.org/search",method:"GET",params:{q:this.ipInfo.zipCode(),countrycodes:this.ipInfo.countryCode(),limit:1,format:"json"}}).then((function(r){t.data=r[0],t.loading=!1,m.redraw()})))},n.configMap=function(t){if(this.data){var r=this.data,e=r.boundingbox,n=r.display_name,o=(parseFloat(e[0])+parseFloat(e[1]))/2,a=(parseFloat(e[2])+parseFloat(e[3]))/2;this.map=L.map(t.dom).setView([o,a],5),L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© OpenStreetMap contributors'}).addTo(this.map),L.marker([o,a]).addTo(this.map).bindPopup(n).openPopup()}},e}(E());const F=flarum.core.compat["common/components/LabelValue"];var G=e.n(F),B=function(t){function e(){for(var r,e=arguments.length,n=new Array(e),o=0;o0&&m(G(),{label:r().translator.trans("fof-geoip.forum.map_modal.threat_types"),value:t.threatTypes().join(", ")}),t.error()&&m(G(),{label:r().translator.trans("fof-geoip.forum.map_modal.error"),value:t.error()})),m("hr",null),m("div",{id:"mapContainer"},m(M,{ipInfo:t}))):m("div",{className:"Modal-body"},m(P(),null))},e}(j());function R(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.children);!(n=o()).done;){var a=n.value.children.find((function(t){return"label"===(null==t?void 0:t.tag)})),i=a&&a.children.find((function(t){return"code"===(null==t?void 0:t.tag)})),u=i&&a.children.indexOf(i);if(i){var l=h(r),s=l.description,f=l.threat,p=l.image;i.attrs||(i.attrs={}),i.attrs["data-threat-level"]=r.threatLevel(),i.children[1]=m(c(),{text:s+(f?" ("+f+")":"")},m("span",null,i.children[1])),p&&a.children.splice(u,0,p)}}r.zipCode()&&r.countryCode()&&t.children.splice(2,0,m("div",{className:"Form-group"},m(M,{zip:r.zipCode(),country:r.countryCode()})))}}})),(0,o.extend)(D().prototype,"tokenActionItems",(function(t,e){var n=e.lastIpAddress();n&&t.add("geoip-info",m(w(),{className:"Button",onclick:function(){return r().modal.show(B,{ipAddr:n})},"aria-label":r().translator.trans("fof-geoip.forum.map_button_label")},r().translator.trans("fof-geoip.forum.map_button_label")),10)}))}))})(),module.exports=n})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index baae799..24e4616 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":";ynBACA,IAAMA,EAAW,cAGF,OAOA,SAA0BC,GAAA,IAClCD,EAASE,KAAKD,GAAK,KAChBE,EAAAC,EAAcH,GAAA,MACd,IAAII,UAAA,8DAAAC,OAEG,WAATH,EAAoBF,EAAKE,EAAA,mBAKzBI,EAAQC,EAAIP,EAAGQ,eAAeC,KAAI,SAAAV,GAAA,OAAKA,EAAEW,aAjBlC,MAiBiD,WACvDC,OAAOC,cAAAC,MAAPF,OAAAJ,EAAwBD,GAAA,cCnBjCQ,EAAOC,QAAU,SAAUC,GAOzB,IANA,IAAIC,EAAI,GACJC,EAAI,EACJC,EAAI,EACJC,EAAI,EACJC,EAAIL,EAAIM,OAELF,EAAIC,GACTH,EAAIF,EAAIN,WAAWU,KACfD,GACFF,EAAEM,MAAM,OAAYJ,EAAI,OAAW,KAAOD,EAAI,QAASM,SAAS,KAChEL,EAAI,GACK,OAAUD,GAAKA,GAAK,MAC7BC,EAAID,EAEJD,EAAEM,KAAKL,EAAEM,SAAS,KAItB,OAAOP,EAAEQ,KAAK,IAChB,gBCvBA,IAAItB,EAAUuB,EAAAA,KAAAA,QACd,SAASC,IACP,aACAb,EAAOC,QAAUY,EAAsB,WACrC,OAAOzB,CACT,EAAGY,EAAOC,QAAQa,YAAa,EAAMd,EAAOC,QAAiB,QAAID,EAAOC,QACxE,IAAIhB,EACFG,EAAI,CAAC,EACLe,EAAIY,OAAOC,UACXxB,EAAIW,EAAEc,eACN/B,EAAI6B,OAAOG,gBAAkB,SAAUjC,EAAGG,EAAGe,GAC3ClB,EAAEG,GAAKe,EAAEgB,KACX,EACAb,EAAI,mBAAqBc,OAASA,OAAS,CAAC,EAC5CC,EAAIf,EAAEgB,UAAY,aAClBl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AAClR,GAAC,MAAgB,UAAV,MAADA,OAAC,EAADA,EAAG6M,IAAc,IAE5D0H,EAAYD,GAAQ7C,EAAM2B,SAASoB,QAAQF,GACjD,GAAKA,EAAL,CAEA,IAAAR,EAAuCtK,EAAUf,GAAzCgB,EAAWqK,EAAXrK,YAAaK,EAAMgK,EAANhK,OAAQG,EAAK6J,EAAL7J,MAExBqK,EAAK/F,QAAO+F,EAAK/F,MAAQ,CAAC,GAC/B+F,EAAK/F,MAAM,qBAAuB9F,EAAOoJ,cAEzCyC,EAAKlB,SAAS,GACZnK,EAACC,IAAO,CAACC,KAAMM,GAAiBK,EAAS,KAAKA,EAAM,IAAM,KACxDb,EAAA,YAAOqL,EAAKlB,SAAS,KAIrBnJ,GACFwH,EAAM2B,SAASqB,OAAOF,EAAW,EAAGtK,EAdnB,CAgBrB,CAEIxB,EAAO0B,WAAa1B,EAAOC,eAC7BqK,EAAKK,SAASqB,OACZ,EACA,EACAxL,EAAA,OAAKgG,UAAU,cACbhG,EAACiF,EAAU,CAAChE,IAAKzB,EAAO0B,UAAWC,QAAS3B,EAAOC,iBA9BxB,CALe,CAuClD,KEzCFmK,EAAAA,EAAAA,QAAO6B,IAAAA,UAA4B,oBAAoB,SAAUhB,EAAmCiB,GAClG,IAAMvD,EAASuD,EAAMC,gBAEjBxD,GACFsC,EAAMjB,IACJ,aACAxJ,EAAC8K,IAAM,CACL9E,UAAU,SACVyC,QAAS,kBAAM5F,IAAAA,MAAUC,KAAK6E,EAAU,CAAEQ,OAAQA,GAAS,EAC3D,aAAYtF,IAAAA,WAAeE,MAAM,qCAEhCF,IAAAA,WAAeE,MAAM,qCAExB,GAGN,GHfF","sources":["webpack://@fof/geoip/../src/index.js","webpack://@fof/geoip/./node_modules/twemoji-basename/index.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/geoip/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/geoip/webpack/bootstrap","webpack://@fof/geoip/webpack/runtime/compat get default export","webpack://@fof/geoip/webpack/runtime/define property getters","webpack://@fof/geoip/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/geoip/webpack/runtime/make namespace object","webpack://@fof/geoip/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/PostMeta']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/geoip/./src/forum/helpers/IPDataHelper.tsx","webpack://@fof/geoip/./src/forum/util/getFlagEmojiUrl.js","webpack://@fof/geoip/./src/forum/helpers/ClipboardHelper.ts","webpack://@fof/geoip/./src/forum/util/copyToClipboard.ts","webpack://@fof/geoip/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/geoip/./node_modules/external-load/index.js","webpack://@fof/geoip/./src/forum/components/ZipCodeMap.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/LabelValue']\"","webpack://@fof/geoip/./src/forum/components/MapModal.tsx","webpack://@fof/geoip/external root \"flarum.core.compat['forum/components/AccessTokensList']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/geoip/./src/forum/models/IPInfo.ts","webpack://@fof/geoip/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/geoip/./src/forum/extend.ts","webpack://@fof/geoip/./src/forum/index.ts","webpack://@fof/geoip/./src/forum/extenders/extendBanIPModal.js","webpack://@fof/geoip/./src/forum/extenders/extendPostMeta.js","webpack://@fof/geoip/./src/forum/extenders/extendAccessTokensList.tsx"],"sourcesContent":["// country code regex\nconst CC_REGEX = /^[a-z]{2}$/i;\n\n// offset between uppercase ascii and regional indicator symbols\nconst OFFSET = 127397;\n\n/**\n * convert country code to corresponding emoji flag\n * @param {string} cc - country code string\n * @returns {string} country code emoji\n */\nexport default function countryCodeEmoji(cc) {\n if (!CC_REGEX.test(cc)) {\n const type = typeof cc;\n throw new TypeError(\n `cc argument must be an ISO 3166-1 alpha-2 string, but got '${\n type === 'string' ? cc : type\n }' instead.`,\n );\n }\n\n const chars = [...cc.toUpperCase()].map(c => c.charCodeAt() + OFFSET);\n return String.fromCodePoint(...chars);\n}\n","/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */\n/* https://github.com/twitter/twemoji/blob/gh-pages/LICENSE */\n\nmodule.exports = function (str) {\n var r = []\n var c = 0\n var p = 0\n var i = 0\n var l = str.length\n\n while (i < l) {\n c = str.charCodeAt(i++)\n if (p) {\n r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16))\n p = 0\n } else if (0xD800 <= c && c <= 0xDBFF) {\n p = c\n } else {\n r.push(c.toString(16))\n }\n }\n\n return r.join('-')\n}\n","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw new Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n 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, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/PostMeta'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import IPInfo from '../models/IPInfo';\nimport getFlagEmojiUrl from '../util/getFlagEmojiUrl';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport const getDescription = (ipInfo: IPInfo) => {\n return ipInfo.organization() || ipInfo.isp() || ipInfo.error() || '';\n};\n\nexport const getThreat = (ipInfo: IPInfo) => {\n return ipInfo.threatTypes() && ipInfo.threatTypes().join(', ');\n};\n\nexport const getFlagImage = (ipInfo: IPInfo) => {\n if (ipInfo.countryCode()) {\n const url = getFlagEmojiUrl(ipInfo.countryCode());\n if (url) {\n return (\n \n {ipInfo.countryCode()}\n \n );\n }\n }\n return null;\n};\n\nexport const getIPData = (ipInfo: IPInfo) => {\n const description = getDescription(ipInfo);\n const threat = getThreat(ipInfo);\n const image = getFlagImage(ipInfo);\n\n // Extracting zip and country from ipInfo\n const zip = ipInfo.zipCode();\n const country = ipInfo.countryCode(); // Assuming the country code is used as 'country'\n\n return { description, threat, image, zip, country };\n};\n","import flag from 'country-code-emoji';\nimport convert from 'twemoji-basename';\n\nexport default (countryCode) => {\n const codepoint = flag(countryCode);\n if (!codepoint) return null;\n\n const basename = convert(codepoint);\n return basename ? `https://cdn.jsdelivr.net/gh/twitter/twemoji@14/assets/72x72/${basename}.png` : null;\n};\n","import app from 'flarum/forum/app';\nimport copyToClipboard from '../util/copyToClipboard';\n\nexport const handleCopyIP = (ip: string) => {\n return () => {\n copyToClipboard(ip);\n app.alerts.show({ type: 'success' }, app.translator.trans('fof-geoip.forum.alerts.ip_copied'));\n };\n};\n","export default (str: string): void => {\n if (navigator.clipboard) {\n navigator.clipboard.writeText(str).then(() => {});\n return;\n }\n\n // Fallback method:\n const el: HTMLTextAreaElement = document.createElement('textarea');\n el.value = str;\n el.setAttribute('readonly', '');\n el.style.position = 'absolute';\n el.style.left = '-9999px';\n document.body.appendChild(el);\n\n const selection = document.getSelection();\n const selected: Range | null = selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : null;\n\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n\n if (selected && selection) {\n selection.removeAllRanges();\n selection.addRange(selected);\n }\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","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 if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _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 function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","/**\n * Simple resource loader based on David Walsh's tutorial\n * https://davidwalsh.name/javascript-loader\n * https://davidwalsh.name/javascript-functions\n */\nexport default (function() {\n // Function which returns a function\n function _load(tag) {\n return function(url) {\n // This promise will be used by Promise.all to determine success or failure\n return new Promise(function(resolve, reject) {\n var element = document.createElement(tag);\n var parent = \"body\";\n var attr = \"src\";\n\n // Important success and error for the promise\n element.onload = function() {\n resolve(url);\n };\n element.onerror = function() {\n reject(url);\n };\n\n // Need to set different attributes depending on tag type\n switch (tag) {\n case \"script\":\n element.async = true;\n break;\n case \"link\":\n element.type = \"text/css\";\n element.rel = \"stylesheet\";\n attr = \"href\";\n parent = \"head\";\n }\n\n // Inject into document to kick off loading\n element[attr] = url;\n document[parent].appendChild(element);\n });\n };\n }\n\n return {\n css: _load(\"link\"),\n js: _load(\"script\"),\n img: _load(\"img\")\n };\n})();\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport load from 'external-load';\n\nlet addedResources = false;\nconst addResources = async () => {\n if (addedResources) return;\n\n await load.css('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');\n await load.js('https://unpkg.com/leaflet@1.9.4/dist/leaflet.js');\n\n addedResources = true;\n};\n\nexport default class ZipCodeMap extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.ipInfo = this.attrs.ipInfo;\n\n this.data = null;\n\n if (this.ipInfo.latitude() && this.ipInfo.longitude()) {\n this.searchLatLon();\n } else if (this.ipInfo.zipCode()) {\n this.searchZip();\n } else {\n this.data = { unknown: true };\n }\n }\n\n view() {\n if (this.loading) {\n return ;\n } else if (this.data && this.data.unknown) {\n return
{app.translator.trans('fof-geoip.forum.map_modal.not_enough_data')}
;\n } else if (!this.data) {\n return
;\n }\n\n return
;\n }\n\n searchLatLon() {\n if (this.loading) return;\n\n this.loading = true;\n\n return addResources().then(\n app\n .request({\n url: `https://nominatim.openstreetmap.org/reverse`,\n method: 'GET',\n params: {\n lat: this.ipInfo.latitude(),\n lon: this.ipInfo.longitude(),\n format: 'json',\n },\n })\n .then((data) => {\n this.data = data;\n this.loading = false;\n\n m.redraw();\n })\n );\n }\n\n searchZip() {\n if (this.loading) return;\n\n this.loading = true;\n\n return addResources().then(\n app\n .request({\n url: `https://nominatim.openstreetmap.org/search`,\n method: 'GET',\n params: {\n q: this.ipInfo.zipCode(),\n countrycodes: this.ipInfo.countryCode(),\n limit: 1,\n format: 'json',\n },\n })\n .then((data) => {\n this.data = data[0];\n this.loading = false;\n\n m.redraw();\n })\n );\n }\n\n configMap(vnode) {\n if (!this.data) return;\n\n const { boundingbox: bounding, display_name: displayName } = this.data;\n\n this.map = L.map(vnode.dom).setView([51.505, -0.09], 5);\n\n L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '© OpenStreetMap contributors',\n }).addTo(this.map);\n\n L.marker([bounding[0], bounding[2]]).addTo(this.map).openPopup();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LabelValue'];","import app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport ZipCodeMap from './ZipCodeMap';\nimport IPInfo from '../models/IPInfo';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\nimport LabelValue from 'flarum/common/components/LabelValue';\nimport type Mithril from 'mithril';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\ninterface MapModalAttrs extends IInternalModalAttrs {\n ipInfo?: IPInfo;\n ipAddr: string;\n}\n\nexport default class MapModal extends Modal {\n ipInfo: IPInfo | undefined;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.ipInfo = this.attrs.ipInfo;\n if (this.ipInfo === undefined) {\n this.loadIpInfo();\n }\n }\n\n className() {\n return 'MapModal Modal--medium';\n }\n\n loadIpInfo() {\n app.store\n .find('ip_info', encodeURIComponent(this.attrs.ipAddr))\n .then((ipInfo) => {\n this.ipInfo = ipInfo;\n m.redraw();\n })\n .catch((error) => {\n console.error('Failed to load IP information from the store', error);\n });\n }\n\n title() {\n return app.translator.trans('fof-geoip.forum.map_modal.title');\n }\n\n content() {\n const ipInfo = this.ipInfo;\n\n if (!ipInfo) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
\n \n {this.attrs.ipAddr}\n \n }\n />\n {ipInfo.countryCode() && }\n {ipInfo.zipCode() && }\n {ipInfo.isp() && }\n {ipInfo.organization() && (\n \n )}\n {ipInfo.as() && }\n {}\n {ipInfo.threatLevel() && }\n {ipInfo.threatTypes().length > 0 && (\n \n )}\n {ipInfo.error() && }\n
\n
\n
\n \n
\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/AccessTokensList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class IPInfo extends Model {\n id() {\n return Model.attribute('id').call(this);\n }\n\n countryCode() {\n return Model.attribute('countryCode').call(this);\n }\n\n zipCode() {\n return Model.attribute('zipCode').call(this);\n }\n\n latitude() {\n return Model.attribute('latitude').call(this);\n }\n\n longitude() {\n return Model.attribute('longitude').call(this);\n }\n\n isp() {\n return Model.attribute('isp').call(this);\n }\n\n organization() {\n return Model.attribute('organization').call(this);\n }\n\n as() {\n return Model.attribute('as').call(this);\n }\n\n mobile() {\n return Model.attribute('mobile').call(this);\n }\n\n threatLevel() {\n return Model.attribute('threatLevel').call(this);\n }\n\n threatTypes() {\n const raw = Model.attribute('threatTypes').call(this);\n if (!raw) {\n return [];\n }\n try {\n return JSON.parse(raw);\n } catch (error) {\n return [];\n }\n }\n\n error() {\n return Model.attribute('error').call(this);\n }\n\n dataProvider() {\n return Model.attribute('dataProvider').call(this);\n }\n\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n\n updatedAt() {\n return Model.attribute('updatedAt', Model.transformDate).call(this);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","import Extend from 'flarum/common/extenders';\nimport IPInfo from './models/IPInfo';\nimport Post from 'flarum/common/models/Post';\n\nexport default [\n new Extend.Store() //\n .add('ip_info', IPInfo),\n\n new Extend.Model(Post) //\n .hasOne('ip_info'),\n];\n","import app from 'flarum/forum/app';\nimport extendPostMeta from './extenders/extendPostMeta';\nimport extendBanIPModal from './extenders/extendBanIPModal';\nimport extendAccessTokensList from './extenders/extendAccessTokensList';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('fof/geoip', () => {\n extendPostMeta();\n extendBanIPModal();\n extendAccessTokensList();\n});\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ZipCodeMap from '../components/ZipCodeMap';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport { getIPData } from '../helpers/IPDataHelper';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\n\nexport default function extendBanIPModal() {\n const BanIPModal = flarum.core.compat['fof/ban-ips/components/BanIPModal'];\n\n if (BanIPModal) {\n extend(BanIPModal.prototype, 'content', function (vdom) {\n if (!this.post || !this.post.ipAddress()) return;\n\n const ipInfo = this.post.ip_info();\n const formGroup = vdom.children.find((e) => e?.attrs?.className?.includes('Form-group') && e.children?.find?.((e) => e.tag === 'div'));\n\n if (!ipInfo || !formGroup) return;\n\n for (const child of formGroup.children) {\n const label = child.children.find((e) => e?.tag === 'label');\n const code = label && label.children.find((e) => e?.tag === 'code');\n\n const codeIndex = code && label.children.indexOf(code);\n if (!code) continue;\n\n const { description, threat, image } = getIPData(ipInfo);\n\n if (!code.attrs) code.attrs = {};\n code.attrs['data-threat-level'] = ipInfo.threatLevel();\n\n code.children[1] = (\n \n {code.children[1]}\n \n );\n\n if (image) {\n label.children.splice(codeIndex, 0, image);\n }\n }\n\n if (ipInfo.zipCode() && ipInfo.countryCode()) {\n vdom.children.splice(\n 2,\n 0,\n
\n \n
\n );\n }\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport PostMeta from 'flarum/common/components/PostMeta';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport { getIPData } from '../helpers/IPDataHelper';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Button from 'flarum/common/components/Button';\nimport MapModal from '../components/MapModal';\n\nexport default function extendPostMeta() {\n extend(PostMeta.prototype, 'view', function (vdom) {\n const post = this.attrs.post;\n\n // Exit early if there's no post\n if (!post) return;\n\n const ipInformation = post.ip_info();\n\n // Exit early if there's no IP information for the post\n if (!ipInformation) return;\n\n // Extract dropdown from the VDOM\n const menuDropdown = vdom.children.find((e) => e.attrs?.className?.includes('dropdown-menu'));\n\n // Extract IP element for modification\n const ipElement = menuDropdown.children.find((e) => e.tag === 'span' && e.attrs?.className === 'PostMeta-ip');\n\n // Clear any default text from the IP element\n delete ipElement.text;\n\n // Construct the IP element with the tooltip and interactive behavior\n ipElement.children = [
{this.ipItems().toArray()}
];\n\n // If there's a threat level, add it as a data attribute for potential styling\n // TODO: move this to an Item?\n if (ipInformation.threatLevel) {\n ipElement.attrs['data-threat-level'] = ipInformation.threatLevel();\n }\n });\n\n PostMeta.prototype.ipItems = function () {\n const items = new ItemList();\n const post = this.attrs.post;\n const ipInformation = post.ip_info();\n const ipAddr = post.data.attributes.ipAddress;\n\n if (ipInformation && ipAddr) {\n const { description, threat, image } = getIPData(ipInformation);\n\n items.add(\n 'ipInfo',\n
\n {image}\n \n {ipAddr}\n \n
,\n 100\n );\n\n items.add(\n 'mapButton',\n \n app.modal.show(MapModal, { ipInfo: ipInformation, ipAddr: ipAddr })}\n aria-label={app.translator.trans('fof-geoip.forum.map_button_label')}\n />\n ,\n 90\n );\n }\n\n return items;\n };\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport AccessTokensList from 'flarum/forum/components/AccessTokensList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport MapModal from '../components/MapModal';\nimport Button from 'flarum/common/components/Button';\nimport type Mithril from 'mithril';\nimport AccessToken from 'flarum/common/models/AccessToken';\n\nexport default function extendAccessTokensList() {\n extend(AccessTokensList.prototype, 'tokenActionItems', function (items: ItemList, token: AccessToken) {\n const ipAddr = token.lastIpAddress();\n\n if (ipAddr) {\n items.add(\n 'geoip-info',\n app.modal.show(MapModal, { ipAddr: ipAddr })}\n aria-label={app.translator.trans('fof-geoip.forum.map_button_label')}\n >\n {app.translator.trans('fof-geoip.forum.map_button_label')}\n ,\n 10\n );\n }\n });\n}\n"],"names":["t","o","test","e","_typeof","TypeError","concat","n","_toConsumableArray","toUpperCase","map","charCodeAt","String","fromCodePoint","apply","module","exports","str","r","c","p","i","l","length","push","toString","join","require","_regeneratorRuntime","__esModule","Object","prototype","hasOwnProperty","defineProperty","value","Symbol","a","iterator","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","isNaN","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","definition","key","get","obj","prop","flarum","core","compat","getFlagImage","ipInfo","countryCode","url","codepoint","flag","basename","convert","getFlagEmojiUrl","m","Tooltip","text","src","alt","height","loading","getIPData","description","organization","isp","error","getDescription","threat","threatTypes","getThreat","image","zip","zipCode","country","handleCopyIP","ip","navigator","clipboard","writeText","el","document","createElement","setAttribute","style","position","left","body","appendChild","selection","getSelection","selected","rangeCount","getRangeAt","select","execCommand","removeChild","removeAllRanges","addRange","copyToClipboard","app","show","trans","_setPrototypeOf","bind","_inheritsLoose","subClass","superClass","asyncGeneratorStep","gen","reject","_next","_throw","info","_load","tag","element","parent","attr","onload","onerror","rel","css","js","img","addedResources","addResources","fn","_ref","_callee","_context","load","self","args","arguments","err","ZipCodeMap","_Component","_proto","oninit","vnode","attrs","data","latitude","longitude","searchLatLon","searchZip","unknown","view","LoadingIndicator","size","className","id","oncreate","configMap","_this","params","lat","lon","format","redraw","_this2","q","countrycodes","limit","_this$data","bounding","boundingbox","display_name","L","dom","setView","tileLayer","attribution","addTo","marker","openPopup","Component","MapModal","_Modal","_len","Array","_key","loadIpInfo","find","encodeURIComponent","ipAddr","console","title","content","LabelValue","label","onclick","as","mobile","threatLevel","Modal","IPInfo","_Model","Model","raw","JSON","parse","dataProvider","createdAt","updatedAt","Extend","add","Post","hasOne","BanIPModal","extend","PostMeta","vdom","post","ipInformation","ip_info","ipElement","children","_e$attrs","includes","_e$attrs2","ipItems","toArray","items","ItemList","attributes","ipAddress","_getIPData","Button","icon","formGroup","_e$children","_step","_iterator","_createForOfIteratorHelperLoose","code","codeIndex","indexOf","splice","AccessTokensList","token","lastIpAddress"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";ynBACA,IAAMA,EAAW,cAGF,OAOA,SAA0BC,GAAA,IAClCD,EAASE,KAAKD,GAAK,KAChBE,EAAAC,EAAcH,GAAA,MACd,IAAII,UAAA,8DAAAC,OAEG,WAATH,EAAoBF,EAAKE,EAAA,mBAKzBI,EAAQC,EAAIP,EAAGQ,eAAeC,KAAI,SAAAV,GAAA,OAAKA,EAAEW,aAjBlC,MAiBiD,WACvDC,OAAOC,cAAAC,MAAPF,OAAAJ,EAAwBD,GAAA,cCnBjCQ,EAAOC,QAAU,SAAUC,GAOzB,IANA,IAAIC,EAAI,GACJC,EAAI,EACJC,EAAI,EACJC,EAAI,EACJC,EAAIL,EAAIM,OAELF,EAAIC,GACTH,EAAIF,EAAIN,WAAWU,KACfD,GACFF,EAAEM,MAAM,OAAYJ,EAAI,OAAW,KAAOD,EAAI,QAASM,SAAS,KAChEL,EAAI,GACK,OAAUD,GAAKA,GAAK,MAC7BC,EAAID,EAEJD,EAAEM,KAAKL,EAAEM,SAAS,KAItB,OAAOP,EAAEQ,KAAK,IAChB,gBCvBA,IAAItB,EAAUuB,EAAAA,KAAAA,QACd,S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B,oBAAoB,SAAUhB,EAAmCiB,GAClG,IAAMvD,EAASuD,EAAMC,gBAEjBxD,GACFsC,EAAMjB,IACJ,aACA5J,EAACkL,IAAM,CACLlF,UAAU,SACV6C,QAAS,kBAAMhG,IAAAA,MAAUC,KAAKiF,EAAU,CAAEQ,OAAQA,GAAS,EAC3D,aAAY1F,IAAAA,WAAeE,MAAM,qCAEhCF,IAAAA,WAAeE,MAAM,qCAExB,GAGN,GHfF","sources":["webpack://@fof/geoip/../src/index.js","webpack://@fof/geoip/./node_modules/twemoji-basename/index.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/geoip/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/geoip/webpack/bootstrap","webpack://@fof/geoip/webpack/runtime/compat get default export","webpack://@fof/geoip/webpack/runtime/define property getters","webpack://@fof/geoip/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/geoip/webpack/runtime/make namespace object","webpack://@fof/geoip/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/PostMeta']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/geoip/./src/forum/helpers/IPDataHelper.tsx","webpack://@fof/geoip/./src/forum/util/getFlagEmojiUrl.js","webpack://@fof/geoip/./src/forum/helpers/ClipboardHelper.ts","webpack://@fof/geoip/./src/forum/util/copyToClipboard.ts","webpack://@fof/geoip/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/geoip/./node_modules/external-load/index.js","webpack://@fof/geoip/./src/forum/components/ZipCodeMap.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/LabelValue']\"","webpack://@fof/geoip/./src/forum/components/MapModal.tsx","webpack://@fof/geoip/external root \"flarum.core.compat['forum/components/AccessTokensList']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/geoip/./src/forum/models/IPInfo.ts","webpack://@fof/geoip/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/geoip/./src/forum/extend.ts","webpack://@fof/geoip/./src/forum/index.ts","webpack://@fof/geoip/./src/forum/extenders/extendBanIPModal.js","webpack://@fof/geoip/./src/forum/extenders/extendPostMeta.js","webpack://@fof/geoip/./src/forum/extenders/extendAccessTokensList.tsx"],"sourcesContent":["// country code regex\nconst CC_REGEX = /^[a-z]{2}$/i;\n\n// offset between uppercase ascii and regional indicator symbols\nconst OFFSET = 127397;\n\n/**\n * convert country code to corresponding emoji flag\n * @param {string} cc - country code string\n * @returns {string} country code emoji\n */\nexport default function countryCodeEmoji(cc) {\n if (!CC_REGEX.test(cc)) {\n const type = typeof cc;\n throw new TypeError(\n `cc argument must be an ISO 3166-1 alpha-2 string, but got '${\n type === 'string' ? cc : type\n }' instead.`,\n );\n }\n\n const chars = [...cc.toUpperCase()].map(c => c.charCodeAt() + OFFSET);\n return String.fromCodePoint(...chars);\n}\n","/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */\n/* https://github.com/twitter/twemoji/blob/gh-pages/LICENSE */\n\nmodule.exports = function (str) {\n var r = []\n var c = 0\n var p = 0\n var i = 0\n var l = str.length\n\n while (i < l) {\n c = str.charCodeAt(i++)\n if (p) {\n r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16))\n p = 0\n } else if (0xD800 <= c && c <= 0xDBFF) {\n p = c\n } else {\n r.push(c.toString(16))\n }\n }\n\n return r.join('-')\n}\n","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw new Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n 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, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/PostMeta'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import IPInfo from '../models/IPInfo';\nimport getFlagEmojiUrl from '../util/getFlagEmojiUrl';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport const getDescription = (ipInfo: IPInfo) => {\n return ipInfo.organization() || ipInfo.isp() || ipInfo.error() || '';\n};\n\nexport const getThreat = (ipInfo: IPInfo) => {\n return ipInfo.threatTypes() && ipInfo.threatTypes().join(', ');\n};\n\nexport const getFlagImage = (ipInfo: IPInfo) => {\n if (ipInfo.countryCode()) {\n const url = getFlagEmojiUrl(ipInfo.countryCode());\n if (url) {\n return (\n \n {ipInfo.countryCode()}\n \n );\n }\n }\n return null;\n};\n\nexport const getIPData = (ipInfo: IPInfo) => {\n const description = getDescription(ipInfo);\n const threat = getThreat(ipInfo);\n const image = getFlagImage(ipInfo);\n\n // Extracting zip and country from ipInfo\n const zip = ipInfo.zipCode();\n const country = ipInfo.countryCode(); // Assuming the country code is used as 'country'\n\n return { description, threat, image, zip, country };\n};\n","import flag from 'country-code-emoji';\nimport convert from 'twemoji-basename';\n\nexport default (countryCode) => {\n const codepoint = flag(countryCode);\n if (!codepoint) return null;\n\n const basename = convert(codepoint);\n return basename ? `https://cdn.jsdelivr.net/gh/twitter/twemoji@14/assets/72x72/${basename}.png` : null;\n};\n","import app from 'flarum/forum/app';\nimport copyToClipboard from '../util/copyToClipboard';\n\nexport const handleCopyIP = (ip: string) => {\n return () => {\n copyToClipboard(ip);\n app.alerts.show({ type: 'success' }, app.translator.trans('fof-geoip.forum.alerts.ip_copied'));\n };\n};\n","export default (str: string): void => {\n if (navigator.clipboard) {\n navigator.clipboard.writeText(str).then(() => {});\n return;\n }\n\n // Fallback method:\n const el: HTMLTextAreaElement = document.createElement('textarea');\n el.value = str;\n el.setAttribute('readonly', '');\n el.style.position = 'absolute';\n el.style.left = '-9999px';\n document.body.appendChild(el);\n\n const selection = document.getSelection();\n const selected: Range | null = selection && selection.rangeCount > 0 ? selection.getRangeAt(0) : null;\n\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n\n if (selected && selection) {\n selection.removeAllRanges();\n selection.addRange(selected);\n }\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","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 if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _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 function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","/**\n * Simple resource loader based on David Walsh's tutorial\n * https://davidwalsh.name/javascript-loader\n * https://davidwalsh.name/javascript-functions\n */\nexport default (function() {\n // Function which returns a function\n function _load(tag) {\n return function(url) {\n // This promise will be used by Promise.all to determine success or failure\n return new Promise(function(resolve, reject) {\n var element = document.createElement(tag);\n var parent = \"body\";\n var attr = \"src\";\n\n // Important success and error for the promise\n element.onload = function() {\n resolve(url);\n };\n element.onerror = function() {\n reject(url);\n };\n\n // Need to set different attributes depending on tag type\n switch (tag) {\n case \"script\":\n element.async = true;\n break;\n case \"link\":\n element.type = \"text/css\";\n element.rel = \"stylesheet\";\n attr = \"href\";\n parent = \"head\";\n }\n\n // Inject into document to kick off loading\n element[attr] = url;\n document[parent].appendChild(element);\n });\n };\n }\n\n return {\n css: _load(\"link\"),\n js: _load(\"script\"),\n img: _load(\"img\")\n };\n})();\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport load from 'external-load';\n\nlet addedResources = false;\nconst addResources = async () => {\n if (addedResources) return;\n\n await load.css('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');\n await load.js('https://unpkg.com/leaflet@1.9.4/dist/leaflet.js');\n\n addedResources = true;\n};\n\nexport default class ZipCodeMap extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.ipInfo = this.attrs.ipInfo;\n\n this.data = null;\n\n if (this.ipInfo.latitude() && this.ipInfo.longitude()) {\n this.searchLatLon();\n } else if (this.ipInfo.zipCode()) {\n this.searchZip();\n } else {\n this.data = { unknown: true };\n }\n }\n\n view() {\n if (this.loading) {\n return ;\n } else if (this.data && this.data.unknown) {\n return
{app.translator.trans('fof-geoip.forum.map_modal.not_enough_data')}
;\n } else if (!this.data) {\n return
;\n }\n\n return
;\n }\n\n searchLatLon() {\n if (this.loading) return;\n\n this.loading = true;\n\n return addResources().then(\n app\n .request({\n url: `https://nominatim.openstreetmap.org/reverse`,\n method: 'GET',\n params: {\n lat: this.ipInfo.latitude(),\n lon: this.ipInfo.longitude(),\n format: 'json',\n },\n })\n .then((data) => {\n this.data = data;\n this.loading = false;\n\n m.redraw();\n })\n );\n }\n\n searchZip() {\n if (this.loading) return;\n\n this.loading = true;\n\n return addResources().then(\n app\n .request({\n url: `https://nominatim.openstreetmap.org/search`,\n method: 'GET',\n params: {\n q: this.ipInfo.zipCode(),\n countrycodes: this.ipInfo.countryCode(),\n limit: 1,\n format: 'json',\n },\n })\n .then((data) => {\n this.data = data[0];\n this.loading = false;\n\n m.redraw();\n })\n );\n }\n\n configMap(vnode) {\n if (!this.data) return;\n\n const { boundingbox: bounding, display_name: displayName } = this.data;\n\n // Extract the latitude and longitude from the bounding box\n const lat1 = parseFloat(bounding[0]); // South bound latitude\n const lat2 = parseFloat(bounding[1]); // North bound latitude\n const lon1 = parseFloat(bounding[2]); // West bound longitude\n const lon2 = parseFloat(bounding[3]); // East bound longitude\n\n // Calculate the center of the bounding box\n const centerLat = (lat1 + lat2) / 2;\n const centerLon = (lon1 + lon2) / 2;\n\n const zoomLevel = 5; // Set your preferred zoom level here\n\n this.map = L.map(vnode.dom).setView([centerLat, centerLon], zoomLevel);\n\n L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '© OpenStreetMap contributors',\n }).addTo(this.map);\n\n // Set a marker at the center of the bounding box\n L.marker([centerLat, centerLon]).addTo(this.map).bindPopup(displayName).openPopup();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LabelValue'];","import app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport ZipCodeMap from './ZipCodeMap';\nimport IPInfo from '../models/IPInfo';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\nimport LabelValue from 'flarum/common/components/LabelValue';\nimport type Mithril from 'mithril';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\ninterface MapModalAttrs extends IInternalModalAttrs {\n ipInfo?: IPInfo;\n ipAddr: string;\n}\n\nexport default class MapModal extends Modal {\n ipInfo: IPInfo | undefined;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.ipInfo = this.attrs.ipInfo;\n if (this.ipInfo === undefined) {\n this.loadIpInfo();\n }\n }\n\n className() {\n return 'MapModal Modal--medium';\n }\n\n loadIpInfo() {\n app.store\n .find('ip_info', encodeURIComponent(this.attrs.ipAddr))\n .then((ipInfo) => {\n this.ipInfo = ipInfo;\n m.redraw();\n })\n .catch((error) => {\n console.error('Failed to load IP information from the store', error);\n });\n }\n\n title() {\n return app.translator.trans('fof-geoip.forum.map_modal.title');\n }\n\n content() {\n const ipInfo = this.ipInfo;\n\n if (!ipInfo) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
\n \n {this.attrs.ipAddr}\n \n }\n />\n {ipInfo.countryCode() && }\n {ipInfo.zipCode() && }\n {ipInfo.isp() && }\n {ipInfo.organization() && (\n \n )}\n {ipInfo.as() && }\n {}\n {ipInfo.threatLevel() && }\n {ipInfo.threatTypes().length > 0 && (\n \n )}\n {ipInfo.error() && }\n
\n
\n
\n \n
\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/AccessTokensList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\n\nexport default class IPInfo extends Model {\n id() {\n return Model.attribute('id').call(this);\n }\n\n countryCode() {\n return Model.attribute('countryCode').call(this);\n }\n\n zipCode() {\n return Model.attribute('zipCode').call(this);\n }\n\n latitude() {\n return Model.attribute('latitude').call(this);\n }\n\n longitude() {\n return Model.attribute('longitude').call(this);\n }\n\n isp() {\n return Model.attribute('isp').call(this);\n }\n\n organization() {\n return Model.attribute('organization').call(this);\n }\n\n as() {\n return Model.attribute('as').call(this);\n }\n\n mobile() {\n return Model.attribute('mobile').call(this);\n }\n\n threatLevel() {\n return Model.attribute('threatLevel').call(this);\n }\n\n threatTypes() {\n const raw = Model.attribute('threatTypes').call(this);\n if (!raw) {\n return [];\n }\n try {\n return JSON.parse(raw);\n } catch (error) {\n return [];\n }\n }\n\n error() {\n return Model.attribute('error').call(this);\n }\n\n dataProvider() {\n return Model.attribute('dataProvider').call(this);\n }\n\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n\n updatedAt() {\n return Model.attribute('updatedAt', Model.transformDate).call(this);\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","import Extend from 'flarum/common/extenders';\nimport IPInfo from './models/IPInfo';\nimport Post from 'flarum/common/models/Post';\n\nexport default [\n new Extend.Store() //\n .add('ip_info', IPInfo),\n\n new Extend.Model(Post) //\n .hasOne('ip_info'),\n];\n","import app from 'flarum/forum/app';\nimport extendPostMeta from './extenders/extendPostMeta';\nimport extendBanIPModal from './extenders/extendBanIPModal';\nimport extendAccessTokensList from './extenders/extendAccessTokensList';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('fof/geoip', () => {\n extendPostMeta();\n extendBanIPModal();\n extendAccessTokensList();\n});\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport ZipCodeMap from '../components/ZipCodeMap';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport { getIPData } from '../helpers/IPDataHelper';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\n\nexport default function extendBanIPModal() {\n const BanIPModal = flarum.core.compat['fof/ban-ips/components/BanIPModal'];\n\n if (BanIPModal) {\n extend(BanIPModal.prototype, 'content', function (vdom) {\n if (!this.post || !this.post.ipAddress()) return;\n\n const ipInfo = this.post.ip_info();\n const formGroup = vdom.children.find((e) => e?.attrs?.className?.includes('Form-group') && e.children?.find?.((e) => e.tag === 'div'));\n\n if (!ipInfo || !formGroup) return;\n\n for (const child of formGroup.children) {\n const label = child.children.find((e) => e?.tag === 'label');\n const code = label && label.children.find((e) => e?.tag === 'code');\n\n const codeIndex = code && label.children.indexOf(code);\n if (!code) continue;\n\n const { description, threat, image } = getIPData(ipInfo);\n\n if (!code.attrs) code.attrs = {};\n code.attrs['data-threat-level'] = ipInfo.threatLevel();\n\n code.children[1] = (\n \n {code.children[1]}\n \n );\n\n if (image) {\n label.children.splice(codeIndex, 0, image);\n }\n }\n\n if (ipInfo.zipCode() && ipInfo.countryCode()) {\n vdom.children.splice(\n 2,\n 0,\n
\n \n
\n );\n }\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport PostMeta from 'flarum/common/components/PostMeta';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport { getIPData } from '../helpers/IPDataHelper';\nimport { handleCopyIP } from '../helpers/ClipboardHelper';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Button from 'flarum/common/components/Button';\nimport MapModal from '../components/MapModal';\n\nexport default function extendPostMeta() {\n extend(PostMeta.prototype, 'view', function (vdom) {\n const post = this.attrs.post;\n\n // Exit early if there's no post\n if (!post) return;\n\n const ipInformation = post.ip_info();\n\n // Exit early if there's no IP information for the post\n if (!ipInformation) return;\n\n // Extract dropdown from the VDOM\n const menuDropdown = vdom.children.find((e) => e.attrs?.className?.includes('dropdown-menu'));\n\n // Extract IP element for modification\n const ipElement = menuDropdown.children.find((e) => e.tag === 'span' && e.attrs?.className === 'PostMeta-ip');\n\n // Clear any default text from the IP element\n delete ipElement.text;\n\n // Construct the IP element with the tooltip and interactive behavior\n ipElement.children = [
{this.ipItems().toArray()}
];\n\n // If there's a threat level, add it as a data attribute for potential styling\n // TODO: move this to an Item?\n if (ipInformation.threatLevel) {\n ipElement.attrs['data-threat-level'] = ipInformation.threatLevel();\n }\n });\n\n PostMeta.prototype.ipItems = function () {\n const items = new ItemList();\n const post = this.attrs.post;\n const ipInformation = post.ip_info();\n const ipAddr = post.data.attributes.ipAddress;\n\n if (ipInformation && ipAddr) {\n const { description, threat, image } = getIPData(ipInformation);\n\n items.add(\n 'ipInfo',\n
\n {image}\n \n {ipAddr}\n \n
,\n 100\n );\n\n items.add(\n 'mapButton',\n \n app.modal.show(MapModal, { ipInfo: ipInformation, ipAddr: ipAddr })}\n aria-label={app.translator.trans('fof-geoip.forum.map_button_label')}\n />\n ,\n 90\n );\n }\n\n return items;\n };\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport AccessTokensList from 'flarum/forum/components/AccessTokensList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport MapModal from '../components/MapModal';\nimport Button from 'flarum/common/components/Button';\nimport type Mithril from 'mithril';\nimport AccessToken from 'flarum/common/models/AccessToken';\n\nexport default function extendAccessTokensList() {\n extend(AccessTokensList.prototype, 'tokenActionItems', function (items: ItemList, token: AccessToken) {\n const ipAddr = token.lastIpAddress();\n\n if (ipAddr) {\n items.add(\n 'geoip-info',\n app.modal.show(MapModal, { ipAddr: ipAddr })}\n aria-label={app.translator.trans('fof-geoip.forum.map_button_label')}\n >\n {app.translator.trans('fof-geoip.forum.map_button_label')}\n ,\n 10\n );\n }\n });\n}\n"],"names":["t","o","test","e","_typeof","TypeError","concat","n","_toConsumableArray","toUpperCase","map","charCodeAt","String","fromCodePoint","apply","module","exports","str","r","c","p","i","l","length","push","toString","join","require","_regeneratorRuntime","__esModule","Object","prototype","hasOwnProperty","defineProperty","value","Symbol","a","iterator","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","isNaN","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","definition","key","get","obj","prop","flarum","core","compat","getFlagImage","ipInfo","countryCode","url","codepoint","flag","basename","convert","getFlagEmojiUrl","m","Tooltip","text","src","alt","height","loading","getIPData","description","organization","isp","error","getDescription","threat","threatTypes","getThreat","image","zip","zipCode","country","handleCopyIP","ip","navigator","clipboard","writeText","el","document","createElement","setAttribute","style","position","left","body","appendChild","selection","getSelection","selected","rangeCount","getRangeAt","select","execCommand","removeChild","removeAllRanges","addRange","copyToClipboard","app","show","trans","_setPrototypeOf","bind","_inheritsLoose","subClass","superClass","asyncGeneratorStep","gen","reject","_next","_throw","info","_load","tag","element","parent","attr","onload","onerror","rel","css","js","img","addedResources","addResources","fn","_ref","_callee","_context","load","self","args","arguments","err","ZipCodeMap","_Component","_proto","oninit","vnode","attrs","data","latitude","longitude","searchLatLon","searchZip","unknown","view","LoadingIndicator","size","className","id","oncreate","configMap","_this","params","lat","lon","format","redraw","_this2","q","countrycodes","limit","_this$data","bounding","boundingbox","display_name","centerLat","parseFloat","centerLon","L","dom","setView","tileLayer","attribution","addTo","marker","bindPopup","openPopup","Component","MapModal","_Modal","_len","Array","_key","loadIpInfo","find","encodeURIComponent","ipAddr","console","title","content","LabelValue","label","onclick","as","mobile","threatLevel","Modal","IPInfo","_Model","Model","raw","JSON","parse","dataProvider","createdAt","updatedAt","Extend","add","Post","hasOne","BanIPModal","extend","PostMeta","vdom","post","ipInformation","ip_info","ipElement","children","_e$attrs","includes","_e$attrs2","ipItems","toArray","items","ItemList","attributes","ipAddress","_getIPData","Button","icon","formGroup","_e$children","_step","_iterator","_createForOfIteratorHelperLoose","code","codeIndex","indexOf","splice","AccessTokensList","token","lastIpAddress"],"sourceRoot":""} \ No newline at end of file