-
-
+
+
+
+ Latency Higher to Lower
+
+
+ @for(data of ripeData; track data){
+ {{data.countryFrom}} : {{data.latency}}
+ }
+
+
+
diff --git a/src/app/pages/show-map/show-map.page.scss b/src/app/pages/show-map/show-map.page.scss
index e69de29..f69d632 100644
--- a/src/app/pages/show-map/show-map.page.scss
+++ b/src/app/pages/show-map/show-map.page.scss
@@ -0,0 +1,9 @@
+.fixed-card {
+ position: absolute;
+ top: 10px;
+ left: 50px;
+ z-index: 1000;
+ background-color: white;
+ border-radius: 10px;
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
+}
diff --git a/src/app/pages/show-map/show-map.page.ts b/src/app/pages/show-map/show-map.page.ts
index 11dc480..dd31887 100644
--- a/src/app/pages/show-map/show-map.page.ts
+++ b/src/app/pages/show-map/show-map.page.ts
@@ -15,53 +15,66 @@ import {Ripe} from "../../interfaces/ripe";
export class ShowMapPage implements OnInit, OnDestroy{
map: Leaflet.Map|undefined;
- ripeData:Ripe = {
- fromLatitude: 0,
- fromLongitude: 0,
- toLatitude: 0,
- toLongitude: 0,
- latency: 0
- }
+ ripeData: Ripe[]=[];
constructor(
+ private ripeService: RipeService
) {
}
ngOnInit() {
- }
- ionViewDidEnter() { this.leafletMap(); }
-
- leafletMap() {
- this.map = Leaflet.map('mapId').setView([0, 0], 2.5);
- Leaflet.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
- attribution: 'edupala.com © Angular LeafLet',
- }).addTo(this.map);
+ }
- antPath([[this.ripeData.fromLatitude, this.ripeData.fromLongitude], [this.ripeData.toLatitude, this.ripeData.toLongitude]],
- { color: '#FF0000', weight: 5, opacity: 0.6 })
- .addTo(this.map);
- //in the middle of the path add a Latency in ms thing
- const labelIcon = Leaflet.divIcon({
- className: 'label-icon',
- html: `Latency: ${this.ripeData.latency} ms
`,
- iconSize: [120, 20] // size of the icon
- })
+ async ionViewDidEnter() {
+ this.ripeData= await this.ripeService.getAllResults("DevProbe", "Web", "NEW IONIC");
+ await this.leafletMap();
+ }
- // Add the label to the map at the desired coordinates
- const labelCoordinates:LatLngExpression = [(this.ripeData.fromLatitude! + this.ripeData.toLatitude!) / 2, (this.ripeData.fromLongitude! + this.ripeData.toLongitude!) / 2];
- Leaflet.marker(labelCoordinates, { icon: labelIcon }).addTo(this.map);
+ async leafletMap() {
+ this.map = Leaflet.map('mapId').setView([0, 0], 2.5);
+ Leaflet.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
+ attribution: 'edupala.com © Angular LeafLet',
+ }).addTo(this.map);
setTimeout(() => {
- this.map!.invalidateSize();
- },100);
-
+ this.map!.invalidateSize();
+ this.addPaths();
+ }, 1000);
}
/** Remove map when we have multiple map object */
ngOnDestroy() {
this.map!.remove();
}
+
+ addPaths() {
+ // @ts-ignore
+ this.ripeData = this.ripeData["data"];
+ //sort from highest to lowest latency
+ this.ripeData.sort((a, b) => (a.latency! < b.latency!) ? 1 : -1);
+
+
+
+ for (let data of this.ripeData) {
+ antPath([[data.fromLatitude, data.fromLongitude], [data.toLatitude, data.toLongitude]],
+ {color: '#FF0000', weight: 5, opacity: 0.6})
+ .addTo(this.map);
+
+ let labelIcon = Leaflet.divIcon({
+ className: 'label-icon',
+ html: `Latency: ${data.latency} ms
`,
+ iconSize: [120, 20] // size of the icon
+ })
+
+ // Add the label to the map at the desired coordinates
+ // @ts-ignore
+ const labelCoordinates:LatLngExpression = [(data.fromLatitude + data.toLatitude) / 2, (data.fromLongitude + data.toLongitude) / 2];
+ Leaflet.marker(labelCoordinates, { icon: labelIcon }).addTo(this.map!);
+
+
+ }
+ }
}
diff --git a/src/app/services/location.service.spec.ts b/src/app/services/location.service.spec.ts
deleted file mode 100644
index 49dca00..0000000
--- a/src/app/services/location.service.spec.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { TestBed } from '@angular/core/testing';
-
-import { LocationService } from './location.service';
-
-describe('LocationService', () => {
- let service: LocationService;
-
- beforeEach(() => {
- TestBed.configureTestingModule({});
- service = TestBed.inject(LocationService);
- });
-
- it('should be created', () => {
- expect(service).toBeTruthy();
- });
-});
diff --git a/src/app/services/location.service.ts b/src/app/services/location.service.ts
index 60661dd..56ce156 100644
--- a/src/app/services/location.service.ts
+++ b/src/app/services/location.service.ts
@@ -1,9 +1,82 @@
import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { collection, doc, Firestore, setDoc } from '@angular/fire/firestore';
+import { Ripe } from '../interfaces/ripe';
+import { IpApi } from '../interfaces/ip-api';
@Injectable({
providedIn: 'root'
})
export class LocationService {
- constructor() { }
+ private ipApiURL = 'https://cors-ea3m.onrender.com/http://ip-api.com/json/';
+
+ constructor(
+ private firestore: Firestore,
+ private http: HttpClient
+ ) { }
+
+ async getLocation(ripeData: Ripe[]): Promise {
+
+ console.log(ripeData);
+
+ // Primera solicitud
+ const fromLoc = this.http.get(this.ipApiURL + ripeData[0].dst_addr).toPromise();
+ const fromData = await fromLoc;
+
+ // Actualiza los datos para todos los elementos en ripeData
+ for (let i = 0; i < ripeData.length; i++) {
+ ripeData[i].toLatitude = fromData!.lat;
+ ripeData[i].toLongitude = fromData!.lon;
+ ripeData[i].cityTo = fromData!.city;
+ ripeData[i].countryTo = fromData!.country;
+ }
+
+ // Segunda solicitud
+ const promises = ripeData.map((ripe) => this.http.get(this.ipApiURL + ripe.from).toPromise());
+ const results = await Promise.all(promises);
+
+ // Actualiza los datos con los resultados de la segunda solicitud
+ results.forEach((data, index) => {
+ ripeData[index].fromLatitude = data!.lat;
+ ripeData[index].fromLongitude = data!.lon;
+ ripeData[index].cityFrom = data!.city;
+ ripeData[index].countryFrom = data!.country;
+ });
+
+ console.log(ripeData);
+
+ return ripeData;
+ }
+
+ async saveLocationResults(orgName: string, productObjective: string, description: string, ripeData: Ripe[]) {
+ try {
+ console.log(ripeData, "ripeData");
+ const collectionRef = collection(this.firestore, 'teams', orgName, 'products', productObjective, 'ripe');
+ const docRef = doc(collectionRef, description); // Use description as the document ID
+
+ //Create a new object called locationData, this object will have all the arrays of ripeData
+ // Prepare the data
+ const data = ripeData.map((item) => ({
+ from: item.from,
+ dst_addr: item.dst_addr,
+ latency: item.latency,
+ cityFrom: item.cityFrom,
+ countryFrom: item.countryFrom,
+ cityTo: item.cityTo,
+ countryTo: item.countryTo,
+ fromLatitude: item.fromLatitude,
+ fromLongitude: item.fromLongitude,
+ toLatitude: item.toLatitude,
+ toLongitude: item.toLongitude
+ }));
+ await setDoc(docRef, { data });
+ console.log("Data saved", { data });
+ return true;
+ } catch (e) {
+ console.log(e);
+ return false;
+ }
+ }
+
}
diff --git a/src/app/services/ripe.service.ts b/src/app/services/ripe.service.ts
index 273cd33..3417386 100644
--- a/src/app/services/ripe.service.ts
+++ b/src/app/services/ripe.service.ts
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {Ripe} from "../interfaces/ripe";
import {Observable} from "rxjs";
-import {collection, doc, Firestore, setDoc} from "@angular/fire/firestore";
+import {collection, doc, Firestore, getDoc, getDocs, setDoc} from "@angular/fire/firestore";
@Injectable({
@@ -59,26 +59,38 @@ export class RipeService {
}
-async saveMeasurementResults(orgName:string, productObjective:string,description:string ,ripeData:Ripe[]){
- try {
- const collectionRef = collection(this.firestore, 'teams', orgName, 'products', productObjective, 'ripe');
- const docRef = doc(collectionRef, description); // Use description as the document ID
+ async saveMeasurementResults(orgName:string, productObjective:string,description:string ,ripeData:Ripe[]){
+ try {
+ const collectionRef = collection(this.firestore, 'teams', orgName, 'products', productObjective, 'ripe');
+ const docRef = doc(collectionRef, description); // Use description as the document ID
- // Prepare the data
- const data = ripeData.map((item, index) => ({
- from: item.from,
- dst_addr: item.dst_addr,
- latency: item.latency
- }));
+ // Prepare the data
+ const data = ripeData.map((item, index) => ({
+ from: item.from,
+ dst_addr: item.dst_addr,
+ latency: item.latency
+ }));
- await setDoc(docRef, { data });
+ await setDoc(docRef, { data });
- return true;
- } catch (e) {
- console.log(e);
- return false;
+ return true;
+ } catch (e) {
+ console.log(e);
+ return false;
+ }
}
-}
+
+
+ async getAllResults(orgName:string, productObjective:string, description:string):Promise{
+ let path = 'teams/' + orgName + '/products/' + productObjective + '/ripe';
+ let ref = doc(this.firestore, path, description);
+ const fetchOrg = await getDoc(ref);
+ const ripeData = fetchOrg.data();
+ return ripeData as Ripe[];
+
+ }
+
+
diff --git a/www/1956.bf40c06794b2530b.js b/www/1956.bf40c06794b2530b.js
deleted file mode 100644
index e9c9d82..0000000
--- a/www/1956.bf40c06794b2530b.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[1956],{1956:(j,d,r)=>{r.r(d),r.d(d,{LatencyTestPageModule:()=>C});var y=r(177),p=r(4341),i=r(7863),h=r(305),u=r(467),e=r(4438),f=r(1626);let v=(()=>{var n;class a{constructor(t){this.http=t,this.measurementsUrl="https://cors-ea3m.onrender.com/https://atlas.ripe.net/api/v2/measurements/",this.measurementID="73134479"}sendMeasurementRequest(t,s,l){var o=this;return(0,u.A)(function*(){let g={definitions:[{target:t,description:s,type:"ping",af:4,is_oneoff:!0}],probes:[{requested:1,type:"area",value:"WW"}]};console.log(g);let m=yield o.http.post(o.measurementsUrl,g,{headers:{Authorization:"Key 92530695-134f-4cbc-b7c3-ec130f3719b0"}}).toPromise();console.log(m),o.measurementID=m.measurements[0],console.log(o.measurementID)})()}getMeasurementResults(){var t=this;return(0,u.A)(function*(){return t.http.get(t.measurementsUrl+t.measurementID+"/results/",{headers:{Authorization:"Key 92530695-134f-4cbc-b7c3-ec130f3719b0"}})})()}}return(n=a).\u0275fac=function(t){return new(t||n)(e.KVO(f.Qq))},n.\u0275prov=e.jDH({token:n,factory:n.\u0275fac,providedIn:"root"}),a})();var T=r(385),M=r(8453);const R=[{path:"",component:(()=>{var n;class a{constructor(t){this.ripeService=t,this.host="portfoliojuanfranciscocisneros.web.app",this.description="NEW IONIC",this.type="ping",this.ripeResults=[]}ngOnInit(){var t=this;return(0,u.A)(function*(){yield t.getResults()})()}sendRequest(){console.log(this.host,this.description,this.type),this.ripeService.sendMeasurementRequest(this.host,this.description,this.type)}getResults(){var t=this;return(0,u.A)(function*(){(yield t.ripeService.getMeasurementResults()).subscribe(s=>{for(let l=0;l{var n;class a{}return(n=a).\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.$C({type:n}),n.\u0275inj=e.G2t({imports:[h.iI.forChild(R),h.iI]}),a})();var L=r(5553);let C=(()=>{var n;class a{}return(n=a).\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.$C({type:n}),n.\u0275inj=e.G2t({imports:[y.MD,p.YN,i.bv,P,L.h]}),a})()}}]);
\ No newline at end of file
diff --git a/www/246.40c5b07bd0aaa622.js b/www/246.40c5b07bd0aaa622.js
deleted file mode 100644
index bebebc0..0000000
--- a/www/246.40c5b07bd0aaa622.js
+++ /dev/null
@@ -1 +0,0 @@
-(self.webpackChunkapp=self.webpackChunkapp||[]).push([[246],{246:($e,fe,z)=>{"use strict";z.r(fe),z.d(fe,{ShowMapPageModule:()=>T});var Ut=z(177),l=z(4341),v=z(7863),r=z(305),h=z(8244),a=z(5841),c=z(4438);const d=[{path:"",component:(()=>{var g;class y{constructor(){this.ripeData={fromLatitude:0,fromLongitude:0,toLatitude:0,toLongitude:0,latency:0}}ngOnInit(){}ionViewDidEnter(){this.leafletMap()}leafletMap(){this.map=h.map("mapId").setView([0,0],2.5),h.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"edupala.com \xa9 Angular LeafLet"}).addTo(this.map),(0,a.antPath)([[this.ripeData.fromLatitude,this.ripeData.fromLongitude],[this.ripeData.toLatitude,this.ripeData.toLongitude]],{color:"#FF0000",weight:5,opacity:.6}).addTo(this.map);const w=h.divIcon({className:"label-icon",html:`Latency: ${this.ripeData.latency} ms
`,iconSize:[120,20]});h.marker([(this.ripeData.fromLatitude+this.ripeData.toLatitude)/2,(this.ripeData.fromLongitude+this.ripeData.toLongitude)/2],{icon:w}).addTo(this.map),setTimeout(()=>{this.map.invalidateSize()},100)}ngOnDestroy(){this.map.remove()}}return(g=y).\u0275fac=function(w){return new(w||g)},g.\u0275cmp=c.VBU({type:g,selectors:[["app-show-map"]],decls:6,vars:1,consts:[[3,"translucent"],["id","mapId",2,"width","100%","height","100%"]],template:function(w,C){1&w&&(c.j41(0,"ion-header",0)(1,"ion-toolbar")(2,"ion-title"),c.EFF(3,"show-map"),c.k0s()()(),c.j41(4,"ion-content"),c.nrm(5,"div",1),c.k0s()),2&w&&c.Y8G("translucent",!0)},dependencies:[v.W9,v.eU,v.BC,v.ai]}),y})()}];let _=(()=>{var g;class y{}return(g=y).\u0275fac=function(w){return new(w||g)},g.\u0275mod=c.$C({type:g}),g.\u0275inj=c.G2t({imports:[r.iI.forChild(d),r.iI]}),y})(),T=(()=>{var g;class y{}return(g=y).\u0275fac=function(w){return new(w||g)},g.\u0275mod=c.$C({type:g}),g.\u0275inj=c.G2t({imports:[Ut.MD,l.YN,v.bv,_]}),y})()},5841:($e,fe,z)=>{var Ut;window,$e.exports=(Ut=z(8244),function(l){var v={};function r(h){if(v[h])return v[h].exports;var a=v[h]={i:h,l:!1,exports:{}};return l[h].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=l,r.c=v,r.d=function(h,a,c){r.o(h,a)||Object.defineProperty(h,a,{enumerable:!0,get:c})},r.r=function(h){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})},r.t=function(h,a){if(1&a&&(h=r(h)),8&a||4&a&&"object"==typeof h&&h&&h.__esModule)return h;var c=Object.create(null);if(r.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:h}),2&a&&"string"!=typeof h)for(var f in h)r.d(c,f,function(d){return h[d]}.bind(null,f));return c},r.n=function(h){var a=h&&h.__esModule?function(){return h.default}:function(){return h};return r.d(a,"a",a),a},r.o=function(h,a){return Object.prototype.hasOwnProperty.call(h,a)},r.p="",r(r.s=59)}([function(l,v){l.exports="object"==typeof window&&window&&window.Math==Math?window:"object"==typeof self&&self&&self.Math==Math?self:Function("return this")()},function(l,v){l.exports=Ut},function(l,v,r){var h=r(4);l.exports=function(a){if(!h(a))throw TypeError(String(a)+" is not an object");return a}},function(l,v,r){var h=r(0),a=r(11).f,c=r(16),f=r(33),d=r(30),_=r(52),T=r(69);l.exports=function(g,y){var b,w,C,H,G,J=g.target,$=g.global,et=g.stat;if(b=$?h:et?h[J]||d(J,{}):(h[J]||{}).prototype)for(w in y){if(H=y[w],C=g.noTargetGet?(G=a(b,w))&&G.value:b[w],!T($?w:J+(et?".":"#")+w,g.forced)&&void 0!==C){if(typeof H==typeof C)continue;_(H,C)}(g.sham||C&&C.sham)&&c(H,"sham",!0),f(b,w,H,g)}}},function(l,v){l.exports=function(r){return"object"==typeof r?null!==r:"function"==typeof r}},function(l,v){l.exports=function(r){try{return!!r()}catch{return!0}}},function(l,v,r){var h=r(20),a=r(7),c=r(55),f=r(8).f;l.exports=function(d){var _=h.Symbol||(h.Symbol={});a(_,d)||f(_,d,{value:c.f(d)})}},function(l,v){var r={}.hasOwnProperty;l.exports=function(h,a){return r.call(h,a)}},function(l,v,r){var h=r(9),a=r(46),c=r(2),f=r(13),d=Object.defineProperty;v.f=h?d:function(_,T,g){if(c(_),T=f(T,!0),c(g),a)try{return d(_,T,g)}catch{}if("get"in g||"set"in g)throw TypeError("Accessors not supported");return"value"in g&&(_[T]=g.value),_}},function(l,v,r){l.exports=!r(5)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(l,v,r){var h=r(15)("wks"),a=r(31),c=r(0).Symbol,f=r(49);l.exports=function(d){return h[d]||(h[d]=f&&c[d]||(f?c:a)("Symbol."+d))}},function(l,v,r){var h=r(9),a=r(32),c=r(14),f=r(17),d=r(13),_=r(7),T=r(46),g=Object.getOwnPropertyDescriptor;v.f=h?g:function(y,b){if(y=f(y),b=d(b,!0),T)try{return g(y,b)}catch{}if(_(y,b))return c(!a.f.call(y,b),y[b])}},function(l,v,r){l.exports=r(21)},function(l,v,r){var h=r(4);l.exports=function(a,c){if(!h(a))return a;var f,d;if(c&&"function"==typeof(f=a.toString)&&!h(d=f.call(a))||"function"==typeof(f=a.valueOf)&&!h(d=f.call(a))||!c&&"function"==typeof(f=a.toString)&&!h(d=f.call(a)))return d;throw TypeError("Can't convert object to primitive value")}},function(l,v){l.exports=function(r,h){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:h}}},function(l,v,r){var h=r(0),a=r(30),c=h["__core-js_shared__"]||a("__core-js_shared__",{});(l.exports=function(f,d){return c[f]||(c[f]=void 0!==d?d:{})})("versions",[]).push({version:"3.0.1",mode:r(48)?"pure":"global",copyright:"\xa9 2019 Denis Pushkarev (zloirock.ru)"})},function(l,v,r){var h=r(8),a=r(14);l.exports=r(9)?function(c,f,d){return h.f(c,f,a(1,d))}:function(c,f,d){return c[f]=d,c}},function(l,v,r){var h=r(65),a=r(43);l.exports=function(c){return h(a(c))}},function(l,v,r){var h=r(15)("keys"),a=r(31);l.exports=function(c){return h[c]||(h[c]=a(c))}},function(l,v){l.exports={}},function(l,v,r){l.exports=r(0)},function(l,v,r){var h=function(){return this||"object"==typeof self&&self}()||Function("return this")(),a=h.regeneratorRuntime&&Object.getOwnPropertyNames(h).indexOf("regeneratorRuntime")>=0,c=a&&h.regeneratorRuntime;if(h.regeneratorRuntime=void 0,l.exports=r(22),a)h.regeneratorRuntime=c;else try{delete h.regeneratorRuntime}catch{h.regeneratorRuntime=void 0}},function(l,v){!function(r){"use strict";var h,a=Object.prototype,c=a.hasOwnProperty,f="function"==typeof Symbol?Symbol:{},d=f.iterator||"@@iterator",_=f.asyncIterator||"@@asyncIterator",T=f.toStringTag||"@@toStringTag",g="object"==typeof l,y=r.regeneratorRuntime;if(y)g&&(l.exports=y);else{(y=r.regeneratorRuntime=g?l.exports:{}).wrap=pt;var b="suspendedStart",w="suspendedYield",C="executing",H="completed",G={},J={};J[d]=function(){return this};var $=Object.getPrototypeOf,et=$&&$($(Z([])));et&&et!==a&&c.call(et,d)&&(J=et);var ct=I.prototype=A.prototype=Object.create(J);E.prototype=ct.constructor=I,I.constructor=E,I[T]=E.displayName="GeneratorFunction",y.isGeneratorFunction=function(S){var x="function"==typeof S&&S.constructor;return!!x&&(x===E||"GeneratorFunction"===(x.displayName||x.name))},y.mark=function(S){return Object.setPrototypeOf?Object.setPrototypeOf(S,I):(S.__proto__=I,T in S||(S[T]="GeneratorFunction")),S.prototype=Object.create(ct),S},y.awrap=function(S){return{__await:S}},j(W.prototype),W.prototype[_]=function(){return this},y.AsyncIterator=W,y.async=function(S,x,B,N){var M=new W(pt(S,x,B,N));return y.isGeneratorFunction(x)?M:M.next().then(function(at){return at.done?at.value:M.next()})},j(ct),ct[T]="Generator",ct[d]=function(){return this},ct.toString=function(){return"[object Generator]"},y.keys=function(S){var x=[];for(var B in S)x.push(B);return x.reverse(),function N(){for(;x.length;){var M=x.pop();if(M in S)return N.value=M,N.done=!1,N}return N.done=!0,N}},y.values=Z,X.prototype={constructor:X,reset:function(S){if(this.prev=0,this.next=0,this.sent=this._sent=h,this.done=!1,this.delegate=null,this.method="next",this.arg=h,this.tryEntries.forEach(P),!S)for(var x in this)"t"===x.charAt(0)&&c.call(this,x)&&!isNaN(+x.slice(1))&&(this[x]=h)},stop:function(){this.done=!0;var S=this.tryEntries[0].completion;if("throw"===S.type)throw S.arg;return this.rval},dispatchException:function(S){if(this.done)throw S;var x=this;function B(Et,nt){return at.type="throw",at.arg=S,x.next=Et,nt&&(x.method="next",x.arg=h),!!nt}for(var N=this.tryEntries.length-1;N>=0;--N){var M=this.tryEntries[N],at=M.completion;if("root"===M.tryLoc)return B("end");if(M.tryLoc<=this.prev){var vt=c.call(M,"catchLoc"),St=c.call(M,"finallyLoc");if(vt&&St){if(this.prev=0;--B){var N=this.tryEntries[B];if(N.tryLoc<=this.prev&&c.call(N,"finallyLoc")&&this.prev=0;--x){var B=this.tryEntries[x];if(B.finallyLoc===S)return this.complete(B.completion,B.afterLoc),P(B),G}},catch:function(S){for(var x=this.tryEntries.length-1;x>=0;--x){var B=this.tryEntries[x];if(B.tryLoc===S){var N=B.completion;if("throw"===N.type){var M=N.arg;P(B)}return M}}throw new Error("illegal catch attempt")},delegateYield:function(S,x,B){return this.delegate={iterator:Z(S),resultName:x,nextLoc:B},"next"===this.method&&(this.arg=h),G}}}function pt(S,x,B,N){var at=Object.create((x&&x.prototype instanceof A?x:A).prototype),vt=new X(N||[]);return at._invoke=function(St,Et,nt){var ht=b;return function(xt,Zt){if(ht===C)throw new Error("Generator is already running");if(ht===H){if("throw"===xt)throw Zt;return q()}for(nt.method=xt,nt.arg=Zt;;){var _t=nt.delegate;if(_t){var Pt=K(_t,nt);if(Pt){if(Pt===G)continue;return Pt}}if("next"===nt.method)nt.sent=nt._sent=nt.arg;else if("throw"===nt.method){if(ht===b)throw ht=H,nt.arg;nt.dispatchException(nt.arg)}else"return"===nt.method&&nt.abrupt("return",nt.arg);ht=C;var ut=D(St,Et,nt);if("normal"===ut.type){if(ht=nt.done?H:w,ut.arg===G)continue;return{value:ut.arg,done:nt.done}}"throw"===ut.type&&(ht=H,nt.method="throw",nt.arg=ut.arg)}}}(S,B,vt),at}function D(S,x,B){try{return{type:"normal",arg:S.call(x,B)}}catch(N){return{type:"throw",arg:N}}}function A(){}function E(){}function I(){}function j(S){["next","throw","return"].forEach(function(x){S[x]=function(B){return this._invoke(x,B)}})}function W(S){var x;this._invoke=function(B,N){function M(){return new Promise(function(at,vt){!function St(Et,nt,ht,xt){var Zt=D(S[Et],S,nt);if("throw"!==Zt.type){var _t=Zt.arg,Pt=_t.value;return Pt&&"object"==typeof Pt&&c.call(Pt,"__await")?Promise.resolve(Pt.__await).then(function(ut){St("next",ut,ht,xt)},function(ut){St("throw",ut,ht,xt)}):Promise.resolve(Pt).then(function(ut){_t.value=ut,ht(_t)},function(ut){return St("throw",ut,ht,xt)})}xt(Zt.arg)}(B,N,at,vt)})}return x=x?x.then(M,M):M()}}function K(S,x){var B=S.iterator[x.method];if(B===h){if(x.delegate=null,"throw"===x.method){if(S.iterator.return&&(x.method="return",x.arg=h,K(S,x),"throw"===x.method))return G;x.method="throw",x.arg=new TypeError("The iterator does not provide a 'throw' method")}return G}var N=D(B,S.iterator,x.arg);if("throw"===N.type)return x.method="throw",x.arg=N.arg,x.delegate=null,G;var M=N.arg;return M?M.done?(x[S.resultName]=M.value,x.next=S.nextLoc,"return"!==x.method&&(x.method="next",x.arg=h),x.delegate=null,G):M:(x.method="throw",x.arg=new TypeError("iterator result is not an object"),x.delegate=null,G)}function k(S){var x={tryLoc:S[0]};1 in S&&(x.catchLoc=S[1]),2 in S&&(x.finallyLoc=S[2],x.afterLoc=S[3]),this.tryEntries.push(x)}function P(S){var x=S.completion||{};x.type="normal",delete x.arg,S.completion=x}function X(S){this.tryEntries=[{tryLoc:"root"}],S.forEach(k,this),this.reset(!0)}function Z(S){if(S){var x=S[d];if(x)return x.call(S);if("function"==typeof S.next)return S;if(!isNaN(S.length)){var B=-1,N=function M(){for(;++B=0&&g.splice(A,1)}function G(D){var A=document.createElement("style");if(void 0===D.attrs.type&&(D.attrs.type="text/css"),void 0===D.attrs.nonce){var E=r.nc;E&&(D.attrs.nonce=E)}return J(A,D.attrs),C(D,A),A}function J(D,A){Object.keys(A).forEach(function(E){D.setAttribute(E,A[E])})}function $(D,A){var E,I,j,W,k,P;if(A.transform&&D.css){if(!(W="function"==typeof A.transform?A.transform(D.css):A.transform.default(D.css)))return function(){};D.css=W}if(A.singleton){var K=T++;E=_||(_=G(A)),I=pt.bind(null,E,K,!1),j=pt.bind(null,E,K,!0)}else D.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(k=A,P=document.createElement("link"),void 0===k.attrs.type&&(k.attrs.type="text/css"),k.attrs.rel="stylesheet",J(P,k.attrs),C(k,P),I=function(k,P,X){var Z=X.css,q=X.sourceMap;(P.convertToAbsoluteUrls||void 0===P.convertToAbsoluteUrls&&q)&&(Z=y(Z)),q&&(Z+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(q))))+" */");var x=new Blob([Z],{type:"text/css"}),B=k.href;k.href=URL.createObjectURL(x),B&&URL.revokeObjectURL(B)}.bind(null,E=P,A),j=function(){H(E),E.href&&URL.revokeObjectURL(E.href)}):(E=G(A),I=function(k,P){var X=P.css,Z=P.media;if(Z&&k.setAttribute("media",Z),k.styleSheet)k.styleSheet.cssText=X;else{for(;k.firstChild;)k.removeChild(k.firstChild);k.appendChild(document.createTextNode(X))}}.bind(null,E),j=function(){H(E)});return I(D),function(k){if(k){if(k.css===D.css&&k.media===D.media&&k.sourceMap===D.sourceMap)return;I(D=k)}else j()}}l.exports=function(D,A){if(typeof DEBUG<"u"&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(A=A||{}).attrs="object"==typeof A.attrs?A.attrs:{},A.singleton||"boolean"==typeof A.singleton||(A.singleton=f()),A.insertInto||(A.insertInto="head"),A.insertAt||(A.insertAt="bottom");var E=w(D,A);return b(E,A),function(I){for(var j=[],W=0;W1&&void 0!==arguments[1]?arguments[1]:{};return function(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}(this,I),this,P=!(Z=g(I).call(this))||"object"!==f(Z)&&"function"!=typeof Z?b(this):Z,w(b(b(P)),H,null),w(b(b(P)),G,null),w(b(b(P)),"_map",null),w(b(b(P)),"_path",null),w(b(b(P)),"_animatedPathId",null),w(b(b(P)),"_animatedPathClass","leaflet-ant-path"),w(b(b(P)),"_reversePathClass","".concat(P._animatedPathClass,"__reverse")),w(b(b(P)),"_hardwareAccClass","hardware-acceleration"),w(b(b(P)),"_defaultOptions",{use:h.polyline,paused:!1,reverse:!1,hardwareAcceleration:!1,renderer:Object(h.svg)({pane:"overlayPane"}),delay:400,dashArray:[10,20],weight:5,opacity:.5,color:"#0000FF",pulseColor:"#FFFFFF"}),h.Util.setOptions(b(b(P)),_({},P._defaultOptions,q)),P._path=k,P._animatedPathId="ant-path-".concat((new Date).getTime()),P._mount(),P}var j,W,K;return function(k,P){if("function"!=typeof P&&null!==P)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(P&&P.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),P&&y(k,P)}(I,h.FeatureGroup),j=I,K=[{key:J,get:function(){return this}}],(W=[{key:"map",value:function(k){return new this.constructor[Symbol.species](this._path.map(k),_({},this.options))}},{key:et,value:c.a.mark(function k(){return c.a.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.delegateYield(this._path,"t0",1);case 1:case"end":return P.stop()}},k,this)})},{key:"_processOptions",value:function(){var k=this.options,P=this._animatedPathClass,X=this._reversePathClass,Z=this._hardwareAccClass,q=this._animatedPathId,S=k.reverse,x=k.hardwareAcceleration,B=_({},k),N=_({},k);return N.color=N.pulseColor||k.pulseColor,N.className=[P,q,S?X:"",x?"".concat(P,"__").concat(Z):""].join(" "),delete B.dashArray,Array.isArray(N.dashArray)&&(N.dashArray=String(N.dashArray)),{pathOpts:B,pulseOpts:N}}},{key:"_mount",value:function(){var k=this._processOptions(),X=k.pulseOpts,Z=this.options.use;this.addLayer(this[C.main]=Z(this._path,k.pathOpts)),this.addLayer(this[C.pulse]=Z(this._path,X))}},{key:"_calculateAnimationSpeed",value:function(){var k=this.options,P=this._map,X=this._animatedPathId;if(!k.paused&&P){var Z=P.getZoom(),q=document.getElementsByClassName(X),S=1+k.delay/3/Z+"s",x=["-webkit-","-moz-","-ms-","-o-",""].map(function(B){return"".concat(B,"animation-duration: ").concat(S)}).join(";");Array.from(q,function(B){B.style.cssText=x,B.setAttribute("data-animated","true")})}}},{key:"_pureReverse",value:function(){var k=this[C.pulse].getElement();k&&(this.options.reverse?k.classList.remove(this._reversePathClass):k.classList.add(this._reversePathClass))}},{key:"onAdd",value:function(k){return this._map=k,this._map.on("zoomend",this._calculateAnimationSpeed,this),this._mount(),this._calculateAnimationSpeed(),this}},{key:"onRemove",value:function(k){return this._map&&(this._map.off("zoomend",this._calculateAnimationSpeed,this),this._map=null),k&&k.removeLayer(this[C.main]).removeLayer(this[C.pulse]),this}},{key:"pause",value:function(){if(!this.options.paused){var k=this[C.pulse].getElement();return this.options.paused=!0,k&&(k.removeAttribute("style"),k.setAttribute("data-animated","true")),!0}return!1}},{key:"resume",value:function(){var k=this.options;return!!k.paused&&(k.paused=!1,this._calculateAnimationSpeed(),!0)}},{key:"bringToFront",value:function(){return this[C.main].bringToFront(),this[C.pulse].bringToFront(),this}},{key:"bringToBack",value:function(){return this[C.pulse].bringToBack(),this[C.main].bringToBack(),this}},{key:"removeFrom",value:function(k){return k&&k.hasLayer(this)&&k.removeLayer(this),this}},{key:"setStyle",value:function(k){var P=_({},this.options,k),Z=P.delay,q=P.reverse;P.paused?this.pause():this.resume(),Z!==this.options.delay&&(this.options.delay=Z||this._defaultOptions.delay,this._calculateAnimationSpeed()),void 0!==q&&q!==this.options.reverse&&this._pureReverse(),this.options=_({},this.options,k);var S=this._processOptions(),B=S.pulseOpts;return this[C.main].setStyle(S.pathOpts),this[C.pulse].setStyle(B),this}},{key:"reverse",value:function(){return this._pureReverse(),this.options.reverse=!this.options.reverse,this}},{key:"redraw",value:function(){return this[C.main].redraw(),this[C.pulse].redraw(),this}},{key:"addLatLng",value:function(){for(var k,P,X=arguments.length,Z=new Array(X),q=0;q0?a(h(c),9007199254740991):0}},function(l,v){var r=Math.ceil,h=Math.floor;l.exports=function(a){return isNaN(a=+a)?0:(a>0?h:r)(a)}},function(l,v,r){l.exports=!r(9)&&!r(5)(function(){return 7!=Object.defineProperty(r(47)("div"),"a",{get:function(){return 7}}).a})},function(l,v,r){var h=r(4),a=r(0).document,c=h(a)&&h(a.createElement);l.exports=function(f){return c?a.createElement(f):{}}},function(l,v){l.exports=!1},function(l,v,r){l.exports=!r(5)(function(){return!String(Symbol())})},function(l,v,r){l.exports=r(15)("native-function-to-string",Function.toString)},function(l,v,r){var h,a,c,f=r(66),d=r(4),_=r(16),T=r(7),g=r(18),y=r(19),b=r(0).WeakMap;if(f){var w=new b,C=w.get,H=w.has,G=w.set;h=function($,et){return G.call(w,$,et),et},a=function($){return C.call(w,$)||{}},c=function($){return H.call(w,$)}}else{var J=g("state");y[J]=!0,h=function($,et){return _($,J,et),et},a=function($){return T($,J)?$[J]:{}},c=function($){return T($,J)}}l.exports={set:h,get:a,has:c,enforce:function($){return c($)?a($):h($,{})},getterFor:function($){return function(et){var ct;if(!d(et)||(ct=a(et)).type!==$)throw TypeError("Incompatible receiver, "+$+" required");return ct}}}},function(l,v,r){var h=r(7),a=r(53),c=r(11),f=r(8);l.exports=function(d,_){for(var T=a(_),g=f.f,y=c.f,b=0;by;)h(g,T=_[y++])&&(~c(b,T)||b.push(T));return b}},function(l,v,r){v.f=r(10)},function(l,v,r){var h=r(2),a=r(75),c=r(35),f=r(76),d=r(47),_=r(18)("IE_PROTO"),T=function(){},g=function(){var y,b=d("iframe"),w=c.length;for(b.style.display="none",f.appendChild(b),b.src="javascript:",(y=b.contentWindow.document).open(),y.write("