From edd09f34605086cc12f8c965c93d3065941bcac4 Mon Sep 17 00:00:00 2001 From: scrudden Date: Sun, 27 Aug 2017 13:21:53 +0100 Subject: [PATCH 01/81] Try out jcs cache with Kalman Error values. --- transitime/pom.xml | 7 ++ .../transitime/core/dataCache/ErrorCache.java | 16 ++++ .../core/dataCache/ErrorCacheFactory.java | 27 +++++++ .../{ => ehcache}/KalmanErrorCache.java | 25 ++++++- .../core/dataCache/jcs/KalmanErrorCache.java | 75 +++++++++++++++++++ .../kalman/KalmanPredictionGeneratorImpl.java | 15 ++-- .../ipc/servers/CacheQueryServer.java | 2 +- transitime/src/main/resources/cache.ccf | 16 ++++ 8 files changed, 168 insertions(+), 15 deletions(-) create mode 100644 transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java create mode 100644 transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java rename transitime/src/main/java/org/transitime/core/dataCache/{ => ehcache}/KalmanErrorCache.java (74%) create mode 100755 transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java create mode 100644 transitime/src/main/resources/cache.ccf diff --git a/transitime/pom.xml b/transitime/pom.xml index cfb0d4f24..77265626b 100755 --- a/transitime/pom.xml +++ b/transitime/pom.xml @@ -227,6 +227,13 @@ + + + org.apache.commons + commons-jcs-core + 2.2 + + javax.servlet diff --git a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java new file mode 100644 index 000000000..2e4e52072 --- /dev/null +++ b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java @@ -0,0 +1,16 @@ +package org.transitime.core.dataCache; + +import java.util.List; + +import org.slf4j.Logger; +import org.transitime.core.Indices; + +public interface ErrorCache { + + Double getErrorValue(Indices indices); + + Double getErrorValue(KalmanErrorCacheKey key); + + void putErrorValue(Indices indices, Double value); + +} \ No newline at end of file diff --git a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java new file mode 100644 index 000000000..8654616f6 --- /dev/null +++ b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java @@ -0,0 +1,27 @@ +package org.transitime.core.dataCache; +import org.transitime.config.StringConfigValue; +import org.transitime.utils.ClassInstantiator; + +/** + * @author Sean Óg Crudden + * Factoy that will provide cache to hold Kalman error values. + * + */ +public class ErrorCacheFactory { + private static StringConfigValue className = + new StringConfigValue("transitime.core.cache.errorCacheClass", + "org.transitime.core.dataCache.jcs.KalmanErrorCache", + "Specifies the class used to cache the Kalamn error values."); + + private static ErrorCache singleton = null; + + public static ErrorCache getInstance() { + + if (singleton == null) { + singleton = ClassInstantiator.instantiate(className.getValue(), + ErrorCache.class); + } + + return singleton; + } +} diff --git a/transitime/src/main/java/org/transitime/core/dataCache/KalmanErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java similarity index 74% rename from transitime/src/main/java/org/transitime/core/dataCache/KalmanErrorCache.java rename to transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java index 5496b8559..308d5c450 100755 --- a/transitime/src/main/java/org/transitime/core/dataCache/KalmanErrorCache.java +++ b/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java @@ -1,4 +1,4 @@ -package org.transitime.core.dataCache; +package org.transitime.core.dataCache.ehcache; import java.util.List; @@ -10,11 +10,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.transitime.core.Indices; +import org.transitime.core.dataCache.ErrorCache; + +import org.transitime.core.dataCache.KalmanErrorCacheKey; /** - * @author Sean Og Crudden + * @author Sean Óg Crudden * */ -public class KalmanErrorCache { +public class KalmanErrorCache implements ErrorCache { final private static String cacheName = "KalmanErrorCache"; private static KalmanErrorCache singleton = new KalmanErrorCache(); private static final Logger logger = LoggerFactory @@ -30,7 +33,7 @@ public static KalmanErrorCache getInstance() { return singleton; } - private KalmanErrorCache() { + KalmanErrorCache() { CacheManager cm = CacheManager.getInstance(); if (cm.getCache(cacheName) == null) { @@ -46,6 +49,7 @@ private KalmanErrorCache() { config.setMaxEntriesLocalDisk(1000000); } + public void logCache(Logger logger) { logger.debug("Cache content log."); @@ -66,6 +70,10 @@ public void logCache(Logger logger) } } + /* (non-Javadoc) + * @see org.transitime.core.dataCache.ErrorCache#getErrorValue(org.transitime.core.Indices) + */ + @Override @SuppressWarnings("unchecked") synchronized public Double getErrorValue(Indices indices) { @@ -78,6 +86,10 @@ synchronized public Double getErrorValue(Indices indices) { else return (Double)result.getObjectValue(); } + /* (non-Javadoc) + * @see org.transitime.core.dataCache.ErrorCache#getErrorValue(org.transitime.core.dataCache.KalmanErrorCacheKey) + */ + @Override @SuppressWarnings("unchecked") synchronized public Double getErrorValue(KalmanErrorCacheKey key) { @@ -88,6 +100,10 @@ synchronized public Double getErrorValue(KalmanErrorCacheKey key) { else return (Double)result.getObjectValue(); } + /* (non-Javadoc) + * @see org.transitime.core.dataCache.ErrorCache#putErrorValue(org.transitime.core.Indices, java.lang.Double) + */ + @Override @SuppressWarnings("unchecked") synchronized public void putErrorValue(Indices indices, Double value) { @@ -96,6 +112,7 @@ synchronized public void putErrorValue(Indices indices, Double value) { cache.put(errorElement); } + public List getKeys() { @SuppressWarnings("unchecked") diff --git a/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java new file mode 100755 index 000000000..7f0535a3b --- /dev/null +++ b/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java @@ -0,0 +1,75 @@ +package org.transitime.core.dataCache.jcs; + +import org.apache.commons.jcs.JCS; +import org.apache.commons.jcs.access.CacheAccess; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.transitime.core.Indices; +import org.transitime.core.dataCache.ErrorCache; +import org.transitime.core.dataCache.KalmanErrorCacheKey; +/** + * @author Sean Og Crudden + * + */ +public class KalmanErrorCache implements ErrorCache { + final private static String cacheName = "KalmanErrorCache"; + private static ErrorCache singleton = new KalmanErrorCache(); + + + private static final Logger logger = LoggerFactory + .getLogger(KalmanErrorCache.class); + + private CacheAccess cache = null; + /** + * Gets the singleton instance of this class. + * + * @return + */ + public static ErrorCache getInstance() { + return singleton; + } + + public KalmanErrorCache() { + cache = JCS.getInstance(cacheName); + } + + + /* (non-Javadoc) + * @see org.transitime.core.dataCache.ErrorCache#getErrorValue(org.transitime.core.Indices) + */ + @Override + @SuppressWarnings("unchecked") + synchronized public Double getErrorValue(Indices indices) { + + KalmanErrorCacheKey key=new KalmanErrorCacheKey(indices); + + Double result = cache.get(key); + + return result; + + } + /* (non-Javadoc) + * @see org.transitime.core.dataCache.ErrorCache#getErrorValue(org.transitime.core.dataCache.KalmanErrorCacheKey) + */ + @Override + @SuppressWarnings("unchecked") + synchronized public Double getErrorValue(KalmanErrorCacheKey key) { + + Double result = cache.get(key); + + return result; + } + /* (non-Javadoc) + * @see org.transitime.core.dataCache.ErrorCache#putErrorValue(org.transitime.core.Indices, java.lang.Double) + */ + @Override + @SuppressWarnings("unchecked") + synchronized public void putErrorValue(Indices indices, Double value) { + + KalmanErrorCacheKey key=new KalmanErrorCacheKey(indices); + + cache.put(key, value); + + } + +} diff --git a/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java b/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java index 6df042e2b..75894883e 100755 --- a/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java +++ b/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java @@ -1,8 +1,6 @@ package org.transitime.core.predictiongenerator.kalman; -import java.util.ArrayList; import java.util.Calendar; -import java.util.Collections; import java.util.Date; import java.util.List; @@ -15,20 +13,17 @@ import org.transitime.core.Indices; import org.transitime.core.TravelTimeDetails; import org.transitime.core.VehicleState; -import org.transitime.core.dataCache.ArrivalDepartureComparator; -import org.transitime.core.dataCache.KalmanErrorCache; +import org.transitime.core.dataCache.ErrorCache; +import org.transitime.core.dataCache.ErrorCacheFactory; import org.transitime.core.dataCache.KalmanErrorCacheKey; -import org.transitime.core.dataCache.PredictionComparator; -import org.transitime.core.dataCache.PredictionDataCache; import org.transitime.core.dataCache.StopPathPredictionCache; import org.transitime.core.dataCache.TripDataHistoryCache; import org.transitime.core.dataCache.VehicleStateManager; +import org.transitime.core.dataCache.jcs.KalmanErrorCache; import org.transitime.core.predictiongenerator.PredictionComponentElementsGenerator; import org.transitime.core.predictiongenerator.average.scheduled.HistoricalAveragePredictionGeneratorImpl; import org.transitime.db.structs.AvlReport; import org.transitime.db.structs.PredictionForStopPath; -import org.transitime.ipc.data.IpcPrediction; -import org.transitime.ipc.data.IpcPredictionsForRouteStopDest; /** * @author Sean Óg Crudden This is a prediction generator that uses a Kalman @@ -74,7 +69,7 @@ public long getTravelTimeForPath(Indices indices, AvlReport avlReport, VehicleSt TripDataHistoryCache tripCache = TripDataHistoryCache.getInstance(); - KalmanErrorCache kalmanErrorCache = KalmanErrorCache.getInstance(); + ErrorCache kalmanErrorCache = ErrorCacheFactory.getInstance(); VehicleStateManager vehicleStateManager = VehicleStateManager.getInstance(); @@ -170,7 +165,7 @@ public long getTravelTimeForPath(Indices indices, AvlReport avlReport, VehicleSt return super.getTravelTimeForPath(indices, avlReport, vehicleState); } - private Double lastVehiclePredictionError(KalmanErrorCache cache, Indices indices) { + private Double lastVehiclePredictionError(ErrorCache cache, Indices indices) { Double result = cache.getErrorValue(indices); if(result!=null) { diff --git a/transitime/src/main/java/org/transitime/ipc/servers/CacheQueryServer.java b/transitime/src/main/java/org/transitime/ipc/servers/CacheQueryServer.java index a8fbfd238..dad3425d5 100755 --- a/transitime/src/main/java/org/transitime/ipc/servers/CacheQueryServer.java +++ b/transitime/src/main/java/org/transitime/ipc/servers/CacheQueryServer.java @@ -18,12 +18,12 @@ import org.transitime.core.dataCache.HistoricalAverage; import org.transitime.core.dataCache.HoldingTimeCache; import org.transitime.core.dataCache.HoldingTimeCacheKey; -import org.transitime.core.dataCache.KalmanErrorCache; import org.transitime.core.dataCache.KalmanErrorCacheKey; import org.transitime.core.dataCache.StopArrivalDepartureCache; import org.transitime.core.dataCache.StopArrivalDepartureCacheKey; import org.transitime.core.dataCache.TripDataHistoryCache; import org.transitime.core.dataCache.TripKey; +import org.transitime.core.dataCache.ehcache.KalmanErrorCache; import org.transitime.core.dataCache.frequency.FrequencyBasedHistoricalAverageCache; import org.transitime.core.dataCache.scheduled.ScheduleBasedHistoricalAverageCache; import org.transitime.core.dataCache.StopPathCacheKey; diff --git a/transitime/src/main/resources/cache.ccf b/transitime/src/main/resources/cache.ccf new file mode 100644 index 000000000..698a46cf6 --- /dev/null +++ b/transitime/src/main/resources/cache.ccf @@ -0,0 +1,16 @@ +# DEFAULT CACHE REGION +jcs.KalmanErrorCache=DC +jcs.KalmanErrorCache.cacheattributes= + org.apache.commons.jcs.engine.CompositeCacheAttributes +jcs.KalmanErrorCache.cacheattributes.MaxObjects=1000 +jcs.KalmanErrorCache.cacheattributes.MemoryCacheName= + org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache + +# AVAILABLE AUXILIARY CACHES +jcs.auxiliary.DC= + org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory +jcs.auxiliary.DC.attributes= + org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes +jcs.auxiliary.DC.attributes.DiskPath=/tmp/cache +jcs.auxiliary.DC.attributes.maxKeySize=100000 + From 805eca208c2ff9ddff610ff7ae8b407de046f69f Mon Sep 17 00:00:00 2001 From: scrudden Date: Fri, 8 Sep 2017 18:51:51 +0100 Subject: [PATCH 02/81] Change config for jcs. --- .../dataCache/StopArrivalDepartureCache.java | 2 +- .../StopArrivalDepartureCacheKey.java | 19 +++++++++++++------ transitime/src/main/resources/cache.ccf | 15 ++++++--------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCache.java b/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCache.java index 22ee05b87..1a91825e7 100755 --- a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCache.java +++ b/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCache.java @@ -117,7 +117,7 @@ synchronized public List getStopHistory(StopArrivalDepartureCa date.set(Calendar.MILLISECOND, 0); key.setDate(date.getTime()); Element result = cache.get(key); - + if (result != null) { return (List) result.getObjectValue(); } else { diff --git a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheKey.java b/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheKey.java index 917a10058..2693d0413 100755 --- a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheKey.java +++ b/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheKey.java @@ -1,6 +1,7 @@ package org.transitime.core.dataCache; import java.io.Serializable; +import java.util.Calendar; import java.util.Date; /** * @author Sean Og Crudden @@ -14,20 +15,26 @@ public class StopArrivalDepartureCacheKey implements Serializable { private Date date; public StopArrivalDepartureCacheKey(String stopid, Date date) { super(); - this.stopid = stopid; - this.date = date; + setDate(date); + this.stopid=stopid; } public String getStopid() { return stopid; } - public void setStopid(String stopid) { - this.stopid = stopid; - } + public Date getDate() { return date; } public void setDate(Date date) { - this.date = date; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + + this.date = calendar.getTime(); } @Override public int hashCode() { diff --git a/transitime/src/main/resources/cache.ccf b/transitime/src/main/resources/cache.ccf index 698a46cf6..a55fd715e 100644 --- a/transitime/src/main/resources/cache.ccf +++ b/transitime/src/main/resources/cache.ccf @@ -1,16 +1,13 @@ # DEFAULT CACHE REGION jcs.KalmanErrorCache=DC -jcs.KalmanErrorCache.cacheattributes= - org.apache.commons.jcs.engine.CompositeCacheAttributes -jcs.KalmanErrorCache.cacheattributes.MaxObjects=1000 -jcs.KalmanErrorCache.cacheattributes.MemoryCacheName= - org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache +jcs.KalmanErrorCache.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes +jcs.KalmanErrorCache.cacheattributes.MaxObjects=100 +jcs.KalmanErrorCache.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache + # AVAILABLE AUXILIARY CACHES -jcs.auxiliary.DC= - org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory -jcs.auxiliary.DC.attributes= - org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes +jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory +jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes jcs.auxiliary.DC.attributes.DiskPath=/tmp/cache jcs.auxiliary.DC.attributes.maxKeySize=100000 From 4214e3f25509199fd81ed0df95bcdfbff1968a67 Mon Sep 17 00:00:00 2001 From: scrudden Date: Sun, 24 Sep 2017 18:06:01 +0100 Subject: [PATCH 03/81] Try BlockDiskCache. --- transitime/src/main/resources/cache.ccf | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/transitime/src/main/resources/cache.ccf b/transitime/src/main/resources/cache.ccf index a55fd715e..358d67f7d 100644 --- a/transitime/src/main/resources/cache.ccf +++ b/transitime/src/main/resources/cache.ccf @@ -5,9 +5,12 @@ jcs.KalmanErrorCache.cacheattributes.MaxObjects=100 jcs.KalmanErrorCache.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache -# AVAILABLE AUXILIARY CACHES -jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory -jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes -jcs.auxiliary.DC.attributes.DiskPath=/tmp/cache -jcs.auxiliary.DC.attributes.maxKeySize=100000 +# Block Disk Cache +jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCacheFactory +jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCacheAttributes +jcs.auxiliary.DC.attributes.DiskPath=/tmp/block-disk-cache +jcs.auxiliary.DC.attributes.MaxPurgatorySize=300000 +jcs.auxiliary.DC.attributes.MaxKeySize=1000000 +jcs.auxiliary.DC.attributes.blockSizeBytes=500 +jcs.auxiliary.DC.attributes.EventQueueType=SINGLE From 923ac7f798697d522be462f32aab3e0f37ff3e76 Mon Sep 17 00:00:00 2001 From: scrudden Date: Sat, 30 Sep 2017 12:20:54 +0100 Subject: [PATCH 04/81] Now set to persist jcs cache to disk. This will allow for faster testing of Kalman method. --- .../java/org/transitime/core/Indices.java | 31 ++++++++------- .../transitime/core/dataCache/ErrorCache.java | 2 + .../dataCache/ehcache/KalmanErrorCache.java | 11 ++++++ .../core/dataCache/jcs/KalmanErrorCache.java | 14 ++++++- transitime/src/main/resources/cache.ccf | 39 ++++++++++++------- transitime/src/test/resources/cache.ccf | 29 ++++++++++++++ 6 files changed, 97 insertions(+), 29 deletions(-) create mode 100644 transitime/src/test/resources/cache.ccf diff --git a/transitime/src/main/java/org/transitime/core/Indices.java b/transitime/src/main/java/org/transitime/core/Indices.java index 0be93e325..77979c2ab 100644 --- a/transitime/src/main/java/org/transitime/core/Indices.java +++ b/transitime/src/main/java/org/transitime/core/Indices.java @@ -62,20 +62,23 @@ public Indices(Block block, int tripIndex, int stopPathIndex, // Make sure parameters are valid to avoid bugs. This could be // considered a bit wasteful though. - Trip trip = block.getTrip(tripIndex); - if (trip == null) - throw new IndexOutOfBoundsException("tripIndex " + tripIndex - + " invalid for block " + block); - StopPath stopPath = trip.getStopPath(stopPathIndex); - if (stopPath == null) - throw new IndexOutOfBoundsException("stopPathIndex " - + stopPathIndex + " invalid for tripIndex " + tripIndex - + " and block " + block); - VectorWithHeading vector = stopPath.getSegmentVector(segmentIndex); - if (vector == null) - throw new IndexOutOfBoundsException("segmentIndex " + segmentIndex - + " invalid for stopPathIndex " + stopPathIndex - + " tripIndex " + tripIndex + " and block " + block); + if(block!=null) + { + Trip trip = block.getTrip(tripIndex); + if (trip == null) + throw new IndexOutOfBoundsException("tripIndex " + tripIndex + + " invalid for block " + block); + StopPath stopPath = trip.getStopPath(stopPathIndex); + if (stopPath == null) + throw new IndexOutOfBoundsException("stopPathIndex " + + stopPathIndex + " invalid for tripIndex " + tripIndex + + " and block " + block); + VectorWithHeading vector = stopPath.getSegmentVector(segmentIndex); + if (vector == null) + throw new IndexOutOfBoundsException("segmentIndex " + segmentIndex + + " invalid for stopPathIndex " + stopPathIndex + + " tripIndex " + tripIndex + " and block " + block); + } } /** diff --git a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java index 2e4e52072..9c029c67f 100644 --- a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java +++ b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java @@ -12,5 +12,7 @@ public interface ErrorCache { Double getErrorValue(KalmanErrorCacheKey key); void putErrorValue(Indices indices, Double value); + + void putErrorValue(KalmanErrorCacheKey key, Double value); } \ No newline at end of file diff --git a/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java index 308d5c450..5f25003bc 100755 --- a/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java +++ b/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java @@ -119,4 +119,15 @@ public List getKeys() List keys = cache.getKeys(); return keys; } + + @Override + public void putErrorValue(KalmanErrorCacheKey key, Double value) { + + + Element errorElement = new Element(key, value); + + cache.put(errorElement); + } + + } diff --git a/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java index 7f0535a3b..37546aea5 100755 --- a/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java +++ b/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java @@ -54,7 +54,8 @@ synchronized public Double getErrorValue(Indices indices) { @Override @SuppressWarnings("unchecked") synchronized public Double getErrorValue(KalmanErrorCacheKey key) { - + System.out.println(cache.getStats().toString()); + Double result = cache.get(key); return result; @@ -70,6 +71,15 @@ synchronized public void putErrorValue(Indices indices, Double value) { cache.put(key, value); - } + } + + @Override + public void putErrorValue(KalmanErrorCacheKey key, Double value) { + + cache.put(key, value); + + + } + } diff --git a/transitime/src/main/resources/cache.ccf b/transitime/src/main/resources/cache.ccf index 358d67f7d..47861c9f4 100644 --- a/transitime/src/main/resources/cache.ccf +++ b/transitime/src/main/resources/cache.ccf @@ -1,16 +1,29 @@ -# DEFAULT CACHE REGION -jcs.KalmanErrorCache=DC -jcs.KalmanErrorCache.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes -jcs.KalmanErrorCache.cacheattributes.MaxObjects=100 -jcs.KalmanErrorCache.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache +############################################################## +##### Default Region Configuration +jcs.default=DC +jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes +jcs.default.cacheattributes.MaxObjects=0 +jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache +jcs.default.cacheattributes.DiskUsagePatternName=UPDATE +############################################################## +##### CACHE REGIONS +jcs.region.myRegion1=DC +jcs.region.myRegion1.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes +jcs.region.myRegion1.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache +jcs.region.myRegion1.cacheattributes.DiskUsagePatternName=UPDATE +jcs.region.myRegion1.elementattributes.IsEternal=true +jcs.region.myRegion1.cacheattributes.MaxObjects=0 -# Block Disk Cache -jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCacheFactory -jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCacheAttributes -jcs.auxiliary.DC.attributes.DiskPath=/tmp/block-disk-cache -jcs.auxiliary.DC.attributes.MaxPurgatorySize=300000 -jcs.auxiliary.DC.attributes.MaxKeySize=1000000 -jcs.auxiliary.DC.attributes.blockSizeBytes=500 -jcs.auxiliary.DC.attributes.EventQueueType=SINGLE +############################################################## +##### AUXILIARY CACHES +# Indexed Disk Cache +jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory +jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes +jcs.auxiliary.DC.attributes.diskPath=${user.home}/jcs_swap +jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000 +jcs.auxiliary.DC.attributes.MaxKeySize=10000 +jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000 +jcs.auxiliary.DC.attributes.OptimizeOnShutdown=true +jcs.auxiliary.DC.attributes.DiskLimitType=COUNT diff --git a/transitime/src/test/resources/cache.ccf b/transitime/src/test/resources/cache.ccf new file mode 100644 index 000000000..47861c9f4 --- /dev/null +++ b/transitime/src/test/resources/cache.ccf @@ -0,0 +1,29 @@ +############################################################## +##### Default Region Configuration +jcs.default=DC +jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes +jcs.default.cacheattributes.MaxObjects=0 +jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache +jcs.default.cacheattributes.DiskUsagePatternName=UPDATE + +############################################################## +##### CACHE REGIONS +jcs.region.myRegion1=DC +jcs.region.myRegion1.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes +jcs.region.myRegion1.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache +jcs.region.myRegion1.cacheattributes.DiskUsagePatternName=UPDATE +jcs.region.myRegion1.elementattributes.IsEternal=true +jcs.region.myRegion1.cacheattributes.MaxObjects=0 + +############################################################## +##### AUXILIARY CACHES +# Indexed Disk Cache +jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory +jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes +jcs.auxiliary.DC.attributes.diskPath=${user.home}/jcs_swap +jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000 +jcs.auxiliary.DC.attributes.MaxKeySize=10000 +jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000 +jcs.auxiliary.DC.attributes.OptimizeOnShutdown=true +jcs.auxiliary.DC.attributes.DiskLimitType=COUNT + From 1eba367915d05944be589eb93ed102053387e4fc Mon Sep 17 00:00:00 2001 From: scrudden Date: Sat, 30 Sep 2017 18:30:50 +0100 Subject: [PATCH 05/81] Added factory for StopArrivalDeparture cache. Also set max historical values to use in Kalman calculation correctly. --- .../org/transitime/applications/Core.java | 5 +-- .../ArrivalDepartureGeneratorDefaultImpl.java | 9 ++++-- .../transitime/core/PredictionGenerator.java | 11 ++++--- .../transitime/core/dataCache/ErrorCache.java | 2 ++ .../core/dataCache/ErrorCacheFactory.java | 2 +- .../dataCache/ehcache/KalmanErrorCache.java | 5 +-- .../StopArrivalDepartureCache.java | 31 +++++++++++-------- .../core/dataCache/jcs/KalmanErrorCache.java | 27 ++++++---------- .../LastArrivalsHeadwayGenerator.java | 5 +-- .../LastDepartureHeadwayGenerator.java | 5 +-- .../HoldingTimeGeneratorDefaultImpl.java | 7 +++-- .../SimpleHoldingTimeGeneratorImpl.java | 5 +-- .../kalman/KalmanPredictionGeneratorImpl.java | 7 ++++- .../ipc/servers/CacheQueryServer.java | 10 +++--- 14 files changed, 72 insertions(+), 59 deletions(-) rename transitime/src/main/java/org/transitime/core/dataCache/{ => ehcache}/StopArrivalDepartureCache.java (84%) diff --git a/transitime/src/main/java/org/transitime/applications/Core.java b/transitime/src/main/java/org/transitime/applications/Core.java index 4b02bff8b..c2f00890c 100755 --- a/transitime/src/main/java/org/transitime/applications/Core.java +++ b/transitime/src/main/java/org/transitime/applications/Core.java @@ -40,9 +40,10 @@ import org.transitime.core.ServiceUtils; import org.transitime.core.TimeoutHandlerModule; import org.transitime.core.dataCache.PredictionDataCache; -import org.transitime.core.dataCache.StopArrivalDepartureCache; +import org.transitime.core.dataCache.StopArrivalDepartureCacheFactory; import org.transitime.core.dataCache.TripDataHistoryCache; import org.transitime.core.dataCache.VehicleDataCache; +import org.transitime.core.dataCache.ehcache.StopArrivalDepartureCache; import org.transitime.core.dataCache.frequency.FrequencyBasedHistoricalAverageCache; import org.transitime.core.dataCache.scheduled.ScheduleBasedHistoricalAverageCache; import org.transitime.db.hibernate.DataDbLogger; @@ -437,7 +438,7 @@ public static void main(String[] args) { Date startDate=DateUtils.addDays(endDate, -1); logger.debug("Populating StopArrivalDepartureCache cache for period {} to {}",startDate,endDate); - StopArrivalDepartureCache.getInstance().populateCacheFromDb(session, startDate, endDate); + StopArrivalDepartureCacheFactory.getInstance().populateCacheFromDb(session, startDate, endDate); endDate=startDate; } diff --git a/transitime/src/main/java/org/transitime/core/ArrivalDepartureGeneratorDefaultImpl.java b/transitime/src/main/java/org/transitime/core/ArrivalDepartureGeneratorDefaultImpl.java index 03c64038c..c53d807fb 100755 --- a/transitime/src/main/java/org/transitime/core/ArrivalDepartureGeneratorDefaultImpl.java +++ b/transitime/src/main/java/org/transitime/core/ArrivalDepartureGeneratorDefaultImpl.java @@ -27,9 +27,10 @@ import org.transitime.core.dataCache.ArrivalDeparturesToProcessHoldingTimesFor; import org.transitime.core.dataCache.HoldingTimeCache; import org.transitime.core.dataCache.HoldingTimeCacheKey; -import org.transitime.core.dataCache.StopArrivalDepartureCache; +import org.transitime.core.dataCache.StopArrivalDepartureCacheFactory; import org.transitime.core.dataCache.TripDataHistoryCache; import org.transitime.core.dataCache.VehicleStateManager; +import org.transitime.core.dataCache.ehcache.StopArrivalDepartureCache; import org.transitime.core.dataCache.frequency.FrequencyBasedHistoricalAverageCache; import org.transitime.core.dataCache.scheduled.ScheduleBasedHistoricalAverageCache; import org.transitime.core.holdingmethod.HoldingTimeGeneratorFactory; @@ -329,8 +330,10 @@ private void updateCache(VehicleState vehicleState, ArrivalDeparture arrivalDepa if(TripDataHistoryCache.getInstance()!=null) TripDataHistoryCache.getInstance().putArrivalDeparture(arrivalDeparture); - if(StopArrivalDepartureCache.getInstance()!=null) - StopArrivalDepartureCache.getInstance().putArrivalDeparture(arrivalDeparture); + if(StopArrivalDepartureCacheFactory.getInstance()!=null) + { + StopArrivalDepartureCacheFactory.getInstance().putArrivalDeparture(arrivalDeparture); + } if(ScheduleBasedHistoricalAverageCache.getInstance()!=null) ScheduleBasedHistoricalAverageCache.getInstance().putArrivalDeparture(arrivalDeparture); diff --git a/transitime/src/main/java/org/transitime/core/PredictionGenerator.java b/transitime/src/main/java/org/transitime/core/PredictionGenerator.java index 636abbc41..6af3d0c78 100644 --- a/transitime/src/main/java/org/transitime/core/PredictionGenerator.java +++ b/transitime/src/main/java/org/transitime/core/PredictionGenerator.java @@ -31,10 +31,11 @@ import org.transitime.config.IntegerConfigValue; import org.transitime.core.dataCache.PredictionComparator; import org.transitime.core.dataCache.PredictionDataCache; -import org.transitime.core.dataCache.StopArrivalDepartureCache; +import org.transitime.core.dataCache.StopArrivalDepartureCacheFactory; import org.transitime.core.dataCache.StopArrivalDepartureCacheKey; import org.transitime.core.dataCache.TripDataHistoryCache; import org.transitime.core.dataCache.TripKey; +import org.transitime.core.dataCache.ehcache.StopArrivalDepartureCache; import org.transitime.db.structs.ArrivalDeparture; import org.transitime.db.structs.AvlReport; import org.transitime.db.structs.Block; @@ -90,9 +91,9 @@ protected TravelTimeDetails getLastVehicleTravelTime(VehicleState currentVehicle StopArrivalDepartureCacheKey currentStopKey = new StopArrivalDepartureCacheKey(currentStopId, new Date(currentVehicleState.getMatch().getAvlTime())); - List currentStopList = StopArrivalDepartureCache.getInstance().getStopHistory(currentStopKey); + List currentStopList = StopArrivalDepartureCacheFactory.getInstance().getStopHistory(currentStopKey); - List nextStopList = StopArrivalDepartureCache.getInstance().getStopHistory(nextStopKey); + List nextStopList = StopArrivalDepartureCacheFactory.getInstance().getStopHistory(nextStopKey); if (currentStopList != null && nextStopList != null) { // lists are already sorted when put into cache. @@ -139,9 +140,9 @@ protected Indices getLastVehicleIndices(VehicleState currentVehicleState, Indice StopArrivalDepartureCacheKey currentStopKey = new StopArrivalDepartureCacheKey(currentStopId, new Date(currentVehicleState.getMatch().getAvlTime())); - List currentStopList = StopArrivalDepartureCache.getInstance().getStopHistory(currentStopKey); + List currentStopList = StopArrivalDepartureCacheFactory.getInstance().getStopHistory(currentStopKey); - List nextStopList = StopArrivalDepartureCache.getInstance().getStopHistory(nextStopKey); + List nextStopList = StopArrivalDepartureCacheFactory.getInstance().getStopHistory(nextStopKey); if (currentStopList != null && nextStopList != null) { // lists are already sorted when put into cache. diff --git a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java index 9c029c67f..496b0b913 100644 --- a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java +++ b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java @@ -15,4 +15,6 @@ public interface ErrorCache { void putErrorValue(KalmanErrorCacheKey key, Double value); + List getKeys(); + } \ No newline at end of file diff --git a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java index 8654616f6..ca18d7eb1 100644 --- a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java +++ b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java @@ -4,7 +4,7 @@ /** * @author Sean Óg Crudden - * Factoy that will provide cache to hold Kalman error values. + * Factory that will provide cache to hold Kalman error values. * */ public class ErrorCacheFactory { diff --git a/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java index 5f25003bc..e979ef846 100755 --- a/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java +++ b/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java @@ -19,7 +19,7 @@ */ public class KalmanErrorCache implements ErrorCache { final private static String cacheName = "KalmanErrorCache"; - private static KalmanErrorCache singleton = new KalmanErrorCache(); + private static final Logger logger = LoggerFactory .getLogger(KalmanErrorCache.class); @@ -29,9 +29,6 @@ public class KalmanErrorCache implements ErrorCache { * * @return */ - public static KalmanErrorCache getInstance() { - return singleton; - } KalmanErrorCache() { CacheManager cm = CacheManager.getInstance(); diff --git a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCache.java b/transitime/src/main/java/org/transitime/core/dataCache/ehcache/StopArrivalDepartureCache.java similarity index 84% rename from transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCache.java rename to transitime/src/main/java/org/transitime/core/dataCache/ehcache/StopArrivalDepartureCache.java index 1a91825e7..5d6301253 100755 --- a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCache.java +++ b/transitime/src/main/java/org/transitime/core/dataCache/ehcache/StopArrivalDepartureCache.java @@ -1,7 +1,7 @@ /** * */ -package org.transitime.core.dataCache; +package org.transitime.core.dataCache.ehcache; import java.util.Collections; import java.util.Date; @@ -20,6 +20,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.transitime.config.IntegerConfigValue; +import org.transitime.core.dataCache.ArrivalDepartureComparator; +import org.transitime.core.dataCache.StopArrivalDepartureCacheFactory; +import org.transitime.core.dataCache.StopArrivalDepartureCacheInterface; +import org.transitime.core.dataCache.StopArrivalDepartureCacheKey; +import org.transitime.core.dataCache.TripKey; import org.transitime.db.structs.ArrivalDeparture; import org.transitime.utils.Time; @@ -32,8 +37,8 @@ * TODO this could do with an interface, factory class, and alternative * implementations, perhaps using Infinispan. */ -public class StopArrivalDepartureCache { - private static StopArrivalDepartureCache singleton = new StopArrivalDepartureCache(); +public class StopArrivalDepartureCache extends StopArrivalDepartureCacheInterface { + private static boolean debug = false; @@ -50,16 +55,8 @@ public class StopArrivalDepartureCache { "transitime.tripdatacache.tripDataCacheMaxAgeSec", 4 * Time.SEC_PER_DAY, "How old an arrivaldeparture has to be before it is removed from the cache "); - /** - * Gets the singleton instance of this class. - * - * @return - */ - public static StopArrivalDepartureCache getInstance() { - return singleton; - } - private StopArrivalDepartureCache() { + public StopArrivalDepartureCache() { CacheManager cm = CacheManager.getInstance(); EvictionAgePolicy evictionPolicy = null; if (tripDataCacheMaxAgeSec != null) { @@ -104,6 +101,10 @@ public void logCache(Logger logger) { } + /* (non-Javadoc) + * @see org.transitime.core.dataCache.ehcache.StopArrivalDepartureCacheInterface#getStopHistory(org.transitime.core.dataCache.StopArrivalDepartureCacheKey) + */ + @SuppressWarnings("unchecked") synchronized public List getStopHistory(StopArrivalDepartureCacheKey key) { @@ -125,6 +126,10 @@ synchronized public List getStopHistory(StopArrivalDepartureCa } } + /* (non-Javadoc) + * @see org.transitime.core.dataCache.ehcache.StopArrivalDepartureCacheInterface#putArrivalDeparture(org.transitime.db.structs.ArrivalDeparture) + */ + @SuppressWarnings("unchecked") synchronized public StopArrivalDepartureCacheKey putArrivalDeparture(ArrivalDeparture arrivalDeparture) { @@ -176,7 +181,7 @@ public void populateCacheFromDb(Session session, Date startDate, Date endDate) { List results = criteria.add(Restrictions.between("time", startDate, endDate)).list(); for (ArrivalDeparture result : results) { - StopArrivalDepartureCache.getInstance().putArrivalDeparture(result); + StopArrivalDepartureCacheFactory.getInstance().putArrivalDeparture(result); } } diff --git a/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java index 37546aea5..1bd6e3202 100755 --- a/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java +++ b/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java @@ -1,5 +1,7 @@ package org.transitime.core.dataCache.jcs; +import java.util.List; + import org.apache.commons.jcs.JCS; import org.apache.commons.jcs.access.CacheAccess; import org.slf4j.Logger; @@ -13,27 +15,16 @@ */ public class KalmanErrorCache implements ErrorCache { final private static String cacheName = "KalmanErrorCache"; - private static ErrorCache singleton = new KalmanErrorCache(); - private static final Logger logger = LoggerFactory .getLogger(KalmanErrorCache.class); private CacheAccess cache = null; - /** - * Gets the singleton instance of this class. - * - * @return - */ - public static ErrorCache getInstance() { - return singleton; - } public KalmanErrorCache() { cache = JCS.getInstance(cacheName); } - /* (non-Javadoc) * @see org.transitime.core.dataCache.ErrorCache#getErrorValue(org.transitime.core.Indices) */ @@ -76,10 +67,12 @@ synchronized public void putErrorValue(Indices indices, Double value) { @Override public void putErrorValue(KalmanErrorCacheKey key, Double value) { - cache.put(key, value); - - - } - - + cache.put(key, value); + } + + @Override + public List getKeys() { + // TODO Auto-generated method stub + return null; + } } diff --git a/transitime/src/main/java/org/transitime/core/headwaygenerator/LastArrivalsHeadwayGenerator.java b/transitime/src/main/java/org/transitime/core/headwaygenerator/LastArrivalsHeadwayGenerator.java index 35b96ade7..e7a90f9f0 100755 --- a/transitime/src/main/java/org/transitime/core/headwaygenerator/LastArrivalsHeadwayGenerator.java +++ b/transitime/src/main/java/org/transitime/core/headwaygenerator/LastArrivalsHeadwayGenerator.java @@ -7,10 +7,11 @@ import org.transitime.applications.Core; import org.transitime.core.HeadwayGenerator; import org.transitime.core.VehicleState; -import org.transitime.core.dataCache.StopArrivalDepartureCache; +import org.transitime.core.dataCache.StopArrivalDepartureCacheFactory; import org.transitime.core.dataCache.StopArrivalDepartureCacheKey; import org.transitime.core.dataCache.VehicleDataCache; import org.transitime.core.dataCache.VehicleStateManager; +import org.transitime.core.dataCache.ehcache.StopArrivalDepartureCache; import org.transitime.db.structs.ArrivalDeparture; import org.transitime.db.structs.Headway; import org.transitime.ipc.data.IpcVehicleComplete; @@ -39,7 +40,7 @@ public Headway generate(VehicleState vehicleState) { StopArrivalDepartureCacheKey key=new StopArrivalDepartureCacheKey(stopId, new Date(date)); - List stopList=StopArrivalDepartureCache.getInstance().getStopHistory(key); + List stopList=StopArrivalDepartureCacheFactory.getInstance().getStopHistory(key); int lastStopArrivalIndex =-1; int previousVehicleArrivalIndex = -1; diff --git a/transitime/src/main/java/org/transitime/core/headwaygenerator/LastDepartureHeadwayGenerator.java b/transitime/src/main/java/org/transitime/core/headwaygenerator/LastDepartureHeadwayGenerator.java index 327d5c760..7cd8843ee 100644 --- a/transitime/src/main/java/org/transitime/core/headwaygenerator/LastDepartureHeadwayGenerator.java +++ b/transitime/src/main/java/org/transitime/core/headwaygenerator/LastDepartureHeadwayGenerator.java @@ -8,10 +8,11 @@ import org.transitime.core.HeadwayGenerator; import org.transitime.core.VehicleState; import org.transitime.core.dataCache.PredictionDataCache; -import org.transitime.core.dataCache.StopArrivalDepartureCache; +import org.transitime.core.dataCache.StopArrivalDepartureCacheFactory; import org.transitime.core.dataCache.StopArrivalDepartureCacheKey; import org.transitime.core.dataCache.VehicleDataCache; import org.transitime.core.dataCache.VehicleStateManager; +import org.transitime.core.dataCache.ehcache.StopArrivalDepartureCache; import org.transitime.db.structs.ArrivalDeparture; import org.transitime.db.structs.Headway; import org.transitime.ipc.data.IpcVehicleComplete; @@ -40,7 +41,7 @@ public Headway generate(VehicleState vehicleState) { StopArrivalDepartureCacheKey key=new StopArrivalDepartureCacheKey(stopId, new Date(date)); - List stopList=StopArrivalDepartureCache.getInstance().getStopHistory(key); + List stopList=StopArrivalDepartureCacheFactory.getInstance().getStopHistory(key); int lastStopArrivalIndex =-1; int previousVehicleArrivalIndex = -1; diff --git a/transitime/src/main/java/org/transitime/core/holdingmethod/HoldingTimeGeneratorDefaultImpl.java b/transitime/src/main/java/org/transitime/core/holdingmethod/HoldingTimeGeneratorDefaultImpl.java index d4fbbf1a4..1ba7e5521 100755 --- a/transitime/src/main/java/org/transitime/core/holdingmethod/HoldingTimeGeneratorDefaultImpl.java +++ b/transitime/src/main/java/org/transitime/core/holdingmethod/HoldingTimeGeneratorDefaultImpl.java @@ -18,10 +18,11 @@ import org.transitime.core.dataCache.HoldingTimeCache; import org.transitime.core.dataCache.PredictionDataCache; -import org.transitime.core.dataCache.StopArrivalDepartureCache; +import org.transitime.core.dataCache.StopArrivalDepartureCacheFactory; import org.transitime.core.dataCache.StopArrivalDepartureCacheKey; import org.transitime.core.dataCache.VehicleDataCache; import org.transitime.core.dataCache.VehicleStateManager; +import org.transitime.core.dataCache.ehcache.StopArrivalDepartureCache; import org.transitime.db.structs.ArrivalDeparture; import org.transitime.db.structs.HoldingTime; import org.transitime.ipc.data.IpcPrediction; @@ -271,7 +272,7 @@ private ArrivalDeparture getLastVehicleDepartureTime(String currentVehicleId, St { StopArrivalDepartureCacheKey currentStopKey=new StopArrivalDepartureCacheKey(stopId,time); - List currentStopList = StopArrivalDepartureCache.getInstance().getStopHistory(currentStopKey); + List currentStopList = StopArrivalDepartureCacheFactory.getInstance().getStopHistory(currentStopKey); ArrivalDeparture closestDepartureEvent=null; if(currentStopList!=null) @@ -316,7 +317,7 @@ private ArrivalDeparture getLastVehicleArrivalEvent(String stopid, String vehicl { StopArrivalDepartureCacheKey currentStopKey=new StopArrivalDepartureCacheKey(stopid,time); - List currentStopList = StopArrivalDepartureCache.getInstance().getStopHistory(currentStopKey); + List currentStopList = StopArrivalDepartureCacheFactory.getInstance().getStopHistory(currentStopKey); ArrivalDeparture closestArrivalEvent=null; diff --git a/transitime/src/main/java/org/transitime/core/holdingmethod/SimpleHoldingTimeGeneratorImpl.java b/transitime/src/main/java/org/transitime/core/holdingmethod/SimpleHoldingTimeGeneratorImpl.java index 25c1165d3..a1acf897a 100644 --- a/transitime/src/main/java/org/transitime/core/holdingmethod/SimpleHoldingTimeGeneratorImpl.java +++ b/transitime/src/main/java/org/transitime/core/holdingmethod/SimpleHoldingTimeGeneratorImpl.java @@ -18,10 +18,11 @@ import org.transitime.core.Indices; import org.transitime.core.VehicleState; import org.transitime.core.dataCache.PredictionDataCache; -import org.transitime.core.dataCache.StopArrivalDepartureCache; +import org.transitime.core.dataCache.StopArrivalDepartureCacheFactory; import org.transitime.core.dataCache.StopArrivalDepartureCacheKey; import org.transitime.core.dataCache.VehicleDataCache; import org.transitime.core.dataCache.VehicleStateManager; +import org.transitime.core.dataCache.ehcache.StopArrivalDepartureCache; import org.transitime.db.structs.ArrivalDeparture; import org.transitime.db.structs.HoldingTime; import org.transitime.db.structs.Prediction; @@ -90,7 +91,7 @@ private ArrivalDeparture getLastVehicleDepartureTime(String tripId, String stopI { StopArrivalDepartureCacheKey currentStopKey=new StopArrivalDepartureCacheKey(stopId,time); - List currentStopList = StopArrivalDepartureCache.getInstance().getStopHistory(currentStopKey); + List currentStopList = StopArrivalDepartureCacheFactory.getInstance().getStopHistory(currentStopKey); ArrivalDeparture closestDepartureEvent=null; if(currentStopList!=null) diff --git a/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java b/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java index 75894883e..3e9b892a2 100755 --- a/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java +++ b/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java @@ -1,5 +1,6 @@ package org.transitime.core.predictiongenerator.kalman; +import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.List; @@ -86,10 +87,14 @@ public long getTravelTimeForPath(Indices indices, AvlReport avlReport, VehicleSt logger.debug("Kalman has last vehicle info for : " +indices.toString()+ " : "+travelTimeDetails); Date nearestDay = DateUtils.truncate(avlReport.getDate(), Calendar.DAY_OF_MONTH); + + SimpleDateFormat dateFormatter=new SimpleDateFormat("yyyy-MM-dd"); + + logger.debug("Kalman nearest Day : "+dateFormatter.format(nearestDay)); List lastDaysTimes = lastDaysTimes(tripCache, currentVehicleState.getTrip().getId(),currentVehicleState.getTrip().getDirectionId(), indices.getStopPathIndex(), nearestDay, currentVehicleState.getTrip().getStartTime(), - maxKalmanDaysToSearch.getValue(), minKalmanDays.getValue()); + maxKalmanDaysToSearch.getValue(), maxKalmanDays.getValue()); if(lastDaysTimes!=null) { diff --git a/transitime/src/main/java/org/transitime/ipc/servers/CacheQueryServer.java b/transitime/src/main/java/org/transitime/ipc/servers/CacheQueryServer.java index dad3425d5..8300fe925 100755 --- a/transitime/src/main/java/org/transitime/ipc/servers/CacheQueryServer.java +++ b/transitime/src/main/java/org/transitime/ipc/servers/CacheQueryServer.java @@ -15,15 +15,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.transitime.core.dataCache.ArrivalDepartureComparator; +import org.transitime.core.dataCache.ErrorCacheFactory; import org.transitime.core.dataCache.HistoricalAverage; import org.transitime.core.dataCache.HoldingTimeCache; import org.transitime.core.dataCache.HoldingTimeCacheKey; import org.transitime.core.dataCache.KalmanErrorCacheKey; -import org.transitime.core.dataCache.StopArrivalDepartureCache; +import org.transitime.core.dataCache.StopArrivalDepartureCacheFactory; import org.transitime.core.dataCache.StopArrivalDepartureCacheKey; import org.transitime.core.dataCache.TripDataHistoryCache; import org.transitime.core.dataCache.TripKey; import org.transitime.core.dataCache.ehcache.KalmanErrorCache; +import org.transitime.core.dataCache.ehcache.StopArrivalDepartureCache; import org.transitime.core.dataCache.frequency.FrequencyBasedHistoricalAverageCache; import org.transitime.core.dataCache.scheduled.ScheduleBasedHistoricalAverageCache; import org.transitime.core.dataCache.StopPathCacheKey; @@ -91,7 +93,7 @@ public List getStopArrivalDepartures(String stopId) throws StopArrivalDepartureCacheKey nextStopKey = new StopArrivalDepartureCacheKey(stopId, Calendar.getInstance().getTime()); - List result = StopArrivalDepartureCache.getInstance().getStopHistory(nextStopKey); + List result = StopArrivalDepartureCacheFactory.getInstance().getStopHistory(nextStopKey); List ipcResultList = new ArrayList(); @@ -203,13 +205,13 @@ public List getScheduledBasedHistoricalAverageCach @Override public Double getKalmanErrorValue(String tripId, Integer stopPathIndex) throws RemoteException { KalmanErrorCacheKey key=new KalmanErrorCacheKey(tripId, stopPathIndex); - Double result = KalmanErrorCache.getInstance().getErrorValue(key); + Double result = ErrorCacheFactory.getInstance().getErrorValue(key); return result; } @Override public List getKalmanErrorCacheKeys() throws RemoteException { - List keys = KalmanErrorCache.getInstance().getKeys(); + List keys = ErrorCacheFactory.getInstance().getKeys(); List ipcResultList = new ArrayList(); for(KalmanErrorCacheKey key:keys) From f53d717b9d53c70d712550dd24841c51c6b18642 Mon Sep 17 00:00:00 2001 From: scrudden Date: Sat, 30 Sep 2017 19:37:58 +0100 Subject: [PATCH 06/81] Missed in last commit. --- .../StopArrivalDepartureCacheFactory.java | 27 +++++++++++++++++ .../StopArrivalDepartureCacheInterface.java | 28 +++++++++++++++++ .../org/transitime/cache/TestJCSCache.java | 30 +++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheFactory.java create mode 100644 transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheInterface.java create mode 100644 transitime/src/test/java/org/transitime/cache/TestJCSCache.java diff --git a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheFactory.java b/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheFactory.java new file mode 100644 index 000000000..0bfc4585b --- /dev/null +++ b/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheFactory.java @@ -0,0 +1,27 @@ +package org.transitime.core.dataCache; +import org.transitime.config.StringConfigValue; +import org.transitime.utils.ClassInstantiator; + +/** + * @author Sean Óg Crudden + * Factory that will provide cache to hold Kalman error values. + * + */ +public class StopArrivalDepartureCacheFactory { + private static StringConfigValue className = + new StringConfigValue("transitime.core.cache.stopArrivalDepartureCache", + "org.transitime.core.dataCache.ehcache.StopArrivalDepartureCache", + "Specifies the class used to cache the arrival and departures for a stop."); + + private static StopArrivalDepartureCacheInterface singleton = null; + + public static StopArrivalDepartureCacheInterface getInstance() { + + if (singleton == null) { + singleton = ClassInstantiator.instantiate(className.getValue(), + StopArrivalDepartureCacheInterface.class); + } + + return singleton; + } +} diff --git a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheInterface.java b/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheInterface.java new file mode 100644 index 000000000..e90f65af3 --- /dev/null +++ b/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheInterface.java @@ -0,0 +1,28 @@ +package org.transitime.core.dataCache; + +import java.util.Date; +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.Session; +import org.hibernate.criterion.Restrictions; +import org.transitime.db.structs.ArrivalDeparture; + +public abstract class StopArrivalDepartureCacheInterface { + + abstract public List getStopHistory(StopArrivalDepartureCacheKey key); + + abstract public StopArrivalDepartureCacheKey putArrivalDeparture(ArrivalDeparture arrivalDeparture); + + public void populateCacheFromDb(Session session, Date startDate, Date endDate) { + Criteria criteria = session.createCriteria(ArrivalDeparture.class); + + @SuppressWarnings("unchecked") + List results = criteria.add(Restrictions.between("time", startDate, endDate)).list(); + + for (ArrivalDeparture result : results) { + this.putArrivalDeparture(result); + } + } + +} \ No newline at end of file diff --git a/transitime/src/test/java/org/transitime/cache/TestJCSCache.java b/transitime/src/test/java/org/transitime/cache/TestJCSCache.java new file mode 100644 index 000000000..6457ddadd --- /dev/null +++ b/transitime/src/test/java/org/transitime/cache/TestJCSCache.java @@ -0,0 +1,30 @@ +package org.transitime.cache; + +import org.transitime.core.dataCache.ErrorCache; +import org.transitime.core.dataCache.ErrorCacheFactory; +import org.transitime.core.dataCache.KalmanErrorCacheKey; + +import junit.framework.TestCase; + +public class TestJCSCache extends TestCase{ + public void testPersist() + { + for(int i=0;i<10;i++) + { + ErrorCache cache=ErrorCacheFactory.getInstance(); + + Double value=new Double(i); + + KalmanErrorCacheKey key=new KalmanErrorCacheKey(""+i,i); + + cache.putErrorValue(key, value); + + value=cache.getErrorValue(key); + + if(value.intValue()!=i) + assertTrue(false); + } + assertTrue(true); + + } +} From 295a8b2180f14efff20fd28611d0413fd23ac7c4 Mon Sep 17 00:00:00 2001 From: scrudden Date: Sun, 1 Oct 2017 20:31:26 +0100 Subject: [PATCH 07/81] Fix headway constructor. Now calculates headway of current vehicle in Kalman prediction generator. --- .../src/main/java/org/transitime/core/HeadwayDetails.java | 2 +- .../kalman/KalmanPredictionGeneratorImpl.java | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/transitime/src/main/java/org/transitime/core/HeadwayDetails.java b/transitime/src/main/java/org/transitime/core/HeadwayDetails.java index 4c643d8e2..f79b81d3e 100644 --- a/transitime/src/main/java/org/transitime/core/HeadwayDetails.java +++ b/transitime/src/main/java/org/transitime/core/HeadwayDetails.java @@ -26,7 +26,7 @@ public HeadwayDetails(IpcPrediction vehicleBehindPrediction, IpcPrediction vehic super(); this.vehicleBehindPrediction = vehicleBehindPrediction; this.vehicleAheadPrediction = vehicleAheadPrediction; - if ((vehicleBehindPrediction != null && vehicleAheadPrediction != null + if (!(vehicleBehindPrediction != null && vehicleAheadPrediction != null && vehicleBehindPrediction.getStopId().equals(vehicleAheadPrediction.getStopId()) && (!vehicleBehindPrediction.getVehicleId().equals(vehicleAheadPrediction.getVehicleId())))) { throw new Exception("Need two predictions for same stop for different vehicles to calculate headway."); diff --git a/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java b/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java index 3e9b892a2..fd04f6d90 100755 --- a/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java +++ b/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java @@ -86,11 +86,7 @@ public long getTravelTimeForPath(Indices indices, AvlReport avlReport, VehicleSt logger.debug("Kalman has last vehicle info for : " +indices.toString()+ " : "+travelTimeDetails); - Date nearestDay = DateUtils.truncate(avlReport.getDate(), Calendar.DAY_OF_MONTH); - - SimpleDateFormat dateFormatter=new SimpleDateFormat("yyyy-MM-dd"); - - logger.debug("Kalman nearest Day : "+dateFormatter.format(nearestDay)); + Date nearestDay = DateUtils.truncate(avlReport.getDate(), Calendar.DAY_OF_MONTH); List lastDaysTimes = lastDaysTimes(tripCache, currentVehicleState.getTrip().getId(),currentVehicleState.getTrip().getDirectionId(), indices.getStopPathIndex(), nearestDay, currentVehicleState.getTrip().getStartTime(), From 3cae257448a3028a6dcd81c5c21132366317b1e1 Mon Sep 17 00:00:00 2001 From: scrudden Date: Thu, 5 Oct 2017 17:42:49 +0100 Subject: [PATCH 08/81] Read AVL samples from capmetrics. --- .../transitime/avl/capmetro/AvlCsvReader.java | 46 +++++ .../transitime/avl/capmetro/AvlCsvRecord.java | 125 ++++++++++++ .../avl/capmetro/BatchCsvAvlFeedModule.java | 190 ++++++++++++++++++ .../transitime/utils/csv/CsvBaseReader.java | 8 +- 4 files changed, 367 insertions(+), 2 deletions(-) create mode 100644 transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvReader.java create mode 100644 transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvRecord.java create mode 100644 transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java diff --git a/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvReader.java b/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvReader.java new file mode 100644 index 000000000..35b123083 --- /dev/null +++ b/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvReader.java @@ -0,0 +1,46 @@ +/* + * This file is part of Transitime.org + * + * Transitime.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License (GPL) as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * Transitime.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Transitime.org . If not, see . + */ + +package org.transitime.avl.capmetro; + +import java.text.ParseException; + +import org.apache.commons.csv.CSVRecord; +import org.transitime.db.structs.AvlReport; +import org.transitime.utils.csv.CsvBaseReader; + +/** + * For reading in AVL data from a CSV file. + * + * @author SkiBu Smith + * + */ +public class AvlCsvReader extends CsvBaseReader { + + /********************** Member Functions **************************/ + + public AvlCsvReader(String fileName) { + super(fileName); + } + + @Override + public AvlReport handleRecord(CSVRecord record, boolean supplemental) + throws ParseException { + return AvlCsvRecord.getAvlReport(record, getFileName()); + } + +} diff --git a/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvRecord.java b/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvRecord.java new file mode 100644 index 000000000..cbdfada3e --- /dev/null +++ b/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvRecord.java @@ -0,0 +1,125 @@ +/* + * This file is part of Transitime.org + * + * Transitime.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License (GPL) as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * Transitime.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Transitime.org . If not, see . + */ + +package org.transitime.avl.capmetro; + +import org.apache.commons.csv.CSVRecord; +import org.transitime.db.structs.AvlReport; +import org.transitime.db.structs.AvlReport.AssignmentType; +import org.transitime.utils.Time; +import org.transitime.utils.csv.CsvBase; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; + +/** + * Represents a single record in a CSV file containing AVL data from CapMetrics. + * + * https://github.com/scascketta/CapMetrics + * + * @author SkiBu Smith + * + */ +public class AvlCsvRecord extends CsvBase { + + /********************** Member Functions **************************/ + + private AvlCsvRecord(CSVRecord record, String fileName) { + super(record, false, fileName); + } + + /** + * Returns AvlReport that the line in the CSV file represents. + * + * @param record + * @param fileName + * @return AvlReport, or null if could not be parsed. + */ + public static AvlReport getAvlReport(CSVRecord record, String fileName) + throws ParseException { + AvlCsvRecord avlCsvRecord = new AvlCsvRecord(record, fileName); + + // Obtain the required values + String vehicleId = avlCsvRecord.getRequiredValue(record, "vehicle_id"); + + String timeStr = avlCsvRecord.getRequiredValue(record, "timestamp"); + + DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX"); + + // Process time + long time = 0L; + + time=dateFormatter.parse(timeStr).getTime(); + + String latStr = avlCsvRecord.getRequiredValue(record, "latitude"); + + double lat=Double.NaN; + try { + lat = Double.parseDouble(latStr); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + String lonStr = avlCsvRecord.getRequiredValue(record, "longitude"); + double lon = Double.parseDouble(lonStr); + + String speedStr = avlCsvRecord.getOptionalValue(record, "speed"); + float speed = speedStr == null ? Float.NaN : Float.parseFloat(speedStr); + + String headingStr = avlCsvRecord.getOptionalValue(record, "heading"); + float heading = headingStr == null ? + Float.NaN : Float.parseFloat(headingStr); + + // Obtain the optional values + String leadVehicleId = avlCsvRecord.getOptionalValue(record, + "leadVehicleId"); + String driverId = + avlCsvRecord.getOptionalValue(record, "driverId"); + String licensePlate = avlCsvRecord.getOptionalValue(record, + "licensePlate"); + + String passengerFullnessStr = + avlCsvRecord.getOptionalValue(record, "passengerFullness"); + float passengerFullness = passengerFullnessStr==null ? + Float.NaN : Float.parseFloat(passengerFullnessStr); + + String passengerCountStr = + avlCsvRecord.getOptionalValue(record, "passengerCount"); + Integer passengerCount = passengerCountStr==null ? + null : Integer.parseInt(passengerCountStr); + + // Create the avlReport + AvlReport avlReport = + new AvlReport(vehicleId, time, lat, lon, speed, heading, "CSV", + leadVehicleId, driverId, licensePlate, passengerCount, + passengerFullness); + + // Assignment info + String assignmentId = + avlCsvRecord.getOptionalValue(record, "trip_id"); + + AssignmentType assignmentType = AssignmentType.TRIP_ID;; + + avlReport.setAssignment(assignmentId, assignmentType); + + + return avlReport; + } + +} diff --git a/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java b/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java new file mode 100644 index 000000000..e82089772 --- /dev/null +++ b/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java @@ -0,0 +1,190 @@ +/* + * This file is part of Transitime.org + * + * Transitime.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License (GPL) as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * Transitime.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Transitime.org . If not, see . + */ + +package org.transitime.avl.capmetro; + +import java.util.Calendar; +import java.util.List; +import java.util.regex.Pattern; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.transitime.applications.Core; +import org.transitime.config.BooleanConfigValue; +import org.transitime.config.StringConfigValue; +import org.transitime.core.AvlProcessor; +import org.transitime.db.structs.AvlReport; +import org.transitime.db.structs.Trip; +import org.transitime.gtfs.DbConfig; +import org.transitime.modules.Module; +import org.transitime.utils.Time; + +/** + * For reading in a batch of AVL data in CSV format and processing it. It only + * reads a single batch of data, unlike the usual AVL modules that continuously + * read data. This module is useful for debugging because can relatively easily + * create a plain text CSV file of AVL data and see what the code does. + *

+ * CSV columns include vehicleId, time (in epoch msec or as date string as in + * "9-14-2015 12:53:01"), latitude, longitude, speed (optional), heading + * (optional), assignmentId, and assignmentType (optional, but can be BLOCK_ID, + * ROUTE_ID, TRIP_ID, or TRIP_SHORT_NAME). + * + * @author SkiBu Smith + * + */ +public class BatchCsvAvlFeedModule extends Module { + + // For running in real time + private long lastAvlReportTimestamp = -1; + + /*********** Configurable Parameters for this module ***********/ + private static String getCsvAvlFeedFileName() { + return csvAvlFeedFileName.getValue(); + } + + private static StringConfigValue csvAvlFeedFileName = new StringConfigValue("transitime.avl.csvAvlFeedFileName", + "https://github.com/scascketta/CapMetrics/blob/master/data/vehicle_positions/2017-10-04.csv?raw=true", + "The name of the CSV file containing AVL data to process."); + + private static BooleanConfigValue processInRealTime = new BooleanConfigValue("transitime.avl.processInRealTime", + false, + "For when getting batch of AVL data from a CSV file. " + + "When true then when reading in do at the same speed as " + + "when the AVL was created. Set to false it you just want " + "to read in as fast as possible."); + + /****************** Logging **************************************/ + private static StringConfigValue routeIdFilterRegEx = new StringConfigValue("transitime.gtfs.routeIdFilterRegEx", + null, // Default of null means don't do any filtering + "Route is included only if route_id matches the this regular " + + "expression. If only want routes with \"SPECIAL\" in the id then " + + "would use \".*SPECIAL.*\". If want to filter out such trips " + + "would instead use the complicated \"^((?!SPECIAL).)*$\" or " + + "\"^((?!(SPECIAL1|SPECIAL2)).)*$\" " + "if want to filter out two names. The default value " + + "of null causes all routes to be included."); + private static Pattern routeIdFilterRegExPattern = null; + + private static StringConfigValue startTimeOfDay = new StringConfigValue("transitime.avl.startTimeOfDay", "10", + "The time of day to start processing AVL.");; + + private static StringConfigValue endTimeOfDay = new StringConfigValue("transitime.avl.endTimeOfDay", "14", + "The time of day to end processing AVL."); + + private static final Logger logger = LoggerFactory.getLogger(BatchCsvAvlFeedModule.class); + + /********************** Member Functions **************************/ + + /** + * @param projectId + */ + public BatchCsvAvlFeedModule(String projectId) { + super(projectId); + } + + /** + * If configured to process data in real time them delay the appropriate + * amount of time + * + * @param avlReport + */ + private void delayIfRunningInRealTime(AvlReport avlReport) { + if (processInRealTime.getValue()) { + long delayLength = 0; + + if (lastAvlReportTimestamp > 0) { + delayLength = avlReport.getTime() - lastAvlReportTimestamp; + lastAvlReportTimestamp = avlReport.getTime(); + } else { + lastAvlReportTimestamp = avlReport.getTime(); + } + + if (delayLength > 0) + Time.sleep(delayLength); + } + } + + /* + * Reads in AVL reports from CSV file and processes them. + * + * (non-Javadoc) + * + * @see java.lang.Runnable#run() + */ + @Override + public void run() { + List avlReports = (new AvlCsvReader(getCsvAvlFeedFileName())).get(); + + // Process the AVL Reports read in. + for (AvlReport avlReport : avlReports) { + + logger.info("Processing avlReport={}", avlReport); + + // If configured to process data in real time them delay + // the appropriate amount of time + delayIfRunningInRealTime(avlReport); + + // Use the AVL report time as the current system time + Core.getInstance().setSystemTime(avlReport.getTime()); + + Calendar cal = Calendar.getInstance(); + cal.setTime(avlReport.getDate()); + int hour = cal.get(Calendar.HOUR_OF_DAY); + + if (routeIdFilterRegEx != null) { + // Create pattern if haven't done so yet, but only do so once. + if (routeIdFilterRegExPattern == null) + routeIdFilterRegExPattern = Pattern.compile(routeIdFilterRegEx.getValue()); + + DbConfig dbConfig = Core.getInstance().getDbConfig(); + + Trip trip = dbConfig.getTrip(avlReport.getAssignmentId()); + + boolean matches = routeIdFilterRegExPattern.matcher(trip.getRouteId().trim()).matches(); + + if (matches) { + if (endTimeOfDay.getValue() != null && startTimeOfDay.getValue() != null) { + if (hour >= new Integer(startTimeOfDay.getValue()) + && hour < new Integer(endTimeOfDay.getValue())) { + AvlProcessor.getInstance().processAvlReport(avlReport); + } else { + AvlProcessor.getInstance().processAvlReport(avlReport); + } + } + } + } else { + if (endTimeOfDay.getValue() != null && startTimeOfDay.getValue() != null) { + if (hour >= new Integer(startTimeOfDay.getValue()) && hour < new Integer(endTimeOfDay.getValue())) { + AvlProcessor.getInstance().processAvlReport(avlReport); + } else { + AvlProcessor.getInstance().processAvlReport(avlReport); + } + } + } + + } + // Wait for database queue to be emptied before exiting. + while (Core.getInstance().getDbLogger().queueSize() > 0) { + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + + } + } + // Kill off the whole program because done processing the AVL data + System.exit(0); + } +} diff --git a/transitime/src/main/java/org/transitime/utils/csv/CsvBaseReader.java b/transitime/src/main/java/org/transitime/utils/csv/CsvBaseReader.java index 313a2e024..04770cbad 100644 --- a/transitime/src/main/java/org/transitime/utils/csv/CsvBaseReader.java +++ b/transitime/src/main/java/org/transitime/utils/csv/CsvBaseReader.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; +import java.net.URL; import java.text.ParseException; import java.util.ArrayList; import java.util.Iterator; @@ -125,9 +126,12 @@ private void parse() { // first character and then discard if it is a BOM character or // reset the reader to back to the beginning if it is not. This // way the CSV parser will process the file starting with the first - // true character. + // true character. + + URL u = new URL(fileName); + Reader in = new BufferedReader(new InputStreamReader( - new FileInputStream(fileName), "UTF-8")); + u.openStream(), "UTF-8")); // Deal with the possible BOM character at the beginning of the file in.mark(1); From e5d147a180b6b8fe6d86d963bacb2509a6c9f5bd Mon Sep 17 00:00:00 2001 From: scrudden Date: Thu, 5 Oct 2017 19:46:21 +0100 Subject: [PATCH 09/81] Add protocol to try fix URL problem. --- .../java/org/transitime/applications/GtfsFileProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transitime/src/main/java/org/transitime/applications/GtfsFileProcessor.java b/transitime/src/main/java/org/transitime/applications/GtfsFileProcessor.java index b2d0210f8..ebe415415 100644 --- a/transitime/src/main/java/org/transitime/applications/GtfsFileProcessor.java +++ b/transitime/src/main/java/org/transitime/applications/GtfsFileProcessor.java @@ -285,7 +285,7 @@ public void process() throws IllegalArgumentException { GtfsData gtfsData = new GtfsData(configRev, notes, zipFileLastModifiedTime, shouldStoreNewRevs, AgencyConfig.getAgencyId(), - gtfsDirectoryName, supplementDir, + "file:///"+gtfsDirectoryName, supplementDir, pathOffsetDistance, maxStopToPathDistance, maxDistanceForEliminatingVertices, defaultWaitTimeAtStopMsec, maxSpeedKph, From 9fa6984229b0c830b1a97905575800a7fa62645a Mon Sep 17 00:00:00 2001 From: scrudden Date: Sat, 7 Oct 2017 17:31:19 +0100 Subject: [PATCH 10/81] Reset BaseReader as URL change broke GTFSFileProcessor. --- .../applications/GtfsFileProcessor.java | 2 +- .../avl/capmetro/BatchCsvAvlFeedModule.java | 26 ++++++++++++------- .../transitime/utils/csv/CsvBaseReader.java | 5 +--- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/transitime/src/main/java/org/transitime/applications/GtfsFileProcessor.java b/transitime/src/main/java/org/transitime/applications/GtfsFileProcessor.java index ebe415415..b2d0210f8 100644 --- a/transitime/src/main/java/org/transitime/applications/GtfsFileProcessor.java +++ b/transitime/src/main/java/org/transitime/applications/GtfsFileProcessor.java @@ -285,7 +285,7 @@ public void process() throws IllegalArgumentException { GtfsData gtfsData = new GtfsData(configRev, notes, zipFileLastModifiedTime, shouldStoreNewRevs, AgencyConfig.getAgencyId(), - "file:///"+gtfsDirectoryName, supplementDir, + gtfsDirectoryName, supplementDir, pathOffsetDistance, maxStopToPathDistance, maxDistanceForEliminatingVertices, defaultWaitTimeAtStopMsec, maxSpeedKph, diff --git a/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java b/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java index e82089772..a4298ca82 100644 --- a/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java +++ b/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java @@ -152,18 +152,24 @@ public void run() { DbConfig dbConfig = Core.getInstance().getDbConfig(); Trip trip = dbConfig.getTrip(avlReport.getAssignmentId()); - - boolean matches = routeIdFilterRegExPattern.matcher(trip.getRouteId().trim()).matches(); - - if (matches) { - if (endTimeOfDay.getValue() != null && startTimeOfDay.getValue() != null) { - if (hour >= new Integer(startTimeOfDay.getValue()) - && hour < new Integer(endTimeOfDay.getValue())) { - AvlProcessor.getInstance().processAvlReport(avlReport); - } else { - AvlProcessor.getInstance().processAvlReport(avlReport); + + if(trip!=null) + { + boolean matches = routeIdFilterRegExPattern.matcher(trip.getRouteId().trim()).matches(); + + if (matches) { + if (endTimeOfDay.getValue() != null && startTimeOfDay.getValue() != null) { + if (hour >= new Integer(startTimeOfDay.getValue()) + && hour < new Integer(endTimeOfDay.getValue())) { + AvlProcessor.getInstance().processAvlReport(avlReport); + } else { + AvlProcessor.getInstance().processAvlReport(avlReport); + } } } + }else + { + logger.info("No trup with id {} in GTFS", avlReport.getAssignmentId()); } } else { if (endTimeOfDay.getValue() != null && startTimeOfDay.getValue() != null) { diff --git a/transitime/src/main/java/org/transitime/utils/csv/CsvBaseReader.java b/transitime/src/main/java/org/transitime/utils/csv/CsvBaseReader.java index 04770cbad..ccc1db02a 100644 --- a/transitime/src/main/java/org/transitime/utils/csv/CsvBaseReader.java +++ b/transitime/src/main/java/org/transitime/utils/csv/CsvBaseReader.java @@ -128,10 +128,7 @@ private void parse() { // way the CSV parser will process the file starting with the first // true character. - URL u = new URL(fileName); - - Reader in = new BufferedReader(new InputStreamReader( - u.openStream(), "UTF-8")); + Reader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), "UTF-8")); // Deal with the possible BOM character at the beginning of the file in.mark(1); From 0a913234fccb9af018ea5ce8ba284f895fe78e3c Mon Sep 17 00:00:00 2001 From: scrudden Date: Sun, 8 Oct 2017 12:14:46 +0100 Subject: [PATCH 11/81] Fix capmetics playback. Not using start end time correctly. --- .../avl/capmetro/BatchCsvAvlFeedModule.java | 22 +++++++++---------- .../kalman/KalmanPredictionGeneratorImpl.java | 6 +++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java b/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java index a4298ca82..7fa1aa37f 100644 --- a/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java +++ b/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java @@ -38,11 +38,7 @@ * reads a single batch of data, unlike the usual AVL modules that continuously * read data. This module is useful for debugging because can relatively easily * create a plain text CSV file of AVL data and see what the code does. - *

- * CSV columns include vehicleId, time (in epoch msec or as date string as in - * "9-14-2015 12:53:01"), latitude, longitude, speed (optional), heading - * (optional), assignmentId, and assignmentType (optional, but can be BLOCK_ID, - * ROUTE_ID, TRIP_ID, or TRIP_SHORT_NAME). + * * * @author SkiBu Smith * @@ -160,12 +156,14 @@ public void run() { if (matches) { if (endTimeOfDay.getValue() != null && startTimeOfDay.getValue() != null) { if (hour >= new Integer(startTimeOfDay.getValue()) - && hour < new Integer(endTimeOfDay.getValue())) { - AvlProcessor.getInstance().processAvlReport(avlReport); - } else { + && hour < new Integer(endTimeOfDay.getValue())) + { AvlProcessor.getInstance().processAvlReport(avlReport); } - } + + } else { + AvlProcessor.getInstance().processAvlReport(avlReport); + } } }else { @@ -175,9 +173,11 @@ && hour < new Integer(endTimeOfDay.getValue())) { if (endTimeOfDay.getValue() != null && startTimeOfDay.getValue() != null) { if (hour >= new Integer(startTimeOfDay.getValue()) && hour < new Integer(endTimeOfDay.getValue())) { AvlProcessor.getInstance().processAvlReport(avlReport); - } else { - AvlProcessor.getInstance().processAvlReport(avlReport); } + } + else + { + AvlProcessor.getInstance().processAvlReport(avlReport); } } diff --git a/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java b/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java index fd04f6d90..fb4968999 100755 --- a/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java +++ b/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java @@ -77,6 +77,8 @@ public long getTravelTimeForPath(Indices indices, AvlReport avlReport, VehicleSt VehicleState currentVehicleState = vehicleStateManager.getVehicleState(avlReport.getVehicleId()); TravelTimeDetails travelTimeDetails = this.getLastVehicleTravelTime(currentVehicleState, indices); + + /* * The first vehicle of the day should use schedule or historic data to * make prediction. Cannot use Kalman as yesterdays vehicle will have @@ -129,11 +131,11 @@ public long getTravelTimeForPath(Indices indices, AvlReport avlReport, VehicleSt TripSegment last_vehicle_segment = ts_day_0_k_1; - Indices previousVehicleIndices = getLastVehicleIndices(currentVehicleState, indices); + Indices previousVehicleIndices = new Indices(travelTimeDetails.getArrival()); Double last_prediction_error = lastVehiclePredictionError(kalmanErrorCache, previousVehicleIndices); - logger.debug("Using error value: " + last_prediction_error + " from: "+new KalmanErrorCacheKey(previousVehicleIndices).toString()); + logger.debug("Using error value: " + last_prediction_error +"found with vehicle id "+travelTimeDetails.getArrival().getVehicleId()+ " from: "+new KalmanErrorCacheKey(previousVehicleIndices).toString()); //TODO this should also display the detail of which vehicle it choose as the last one. logger.debug("Using last vehicle value: " + travelTimeDetails + " for : "+ indices.toString()); From 61471d032000c0970c97f2627637b6565e111886 Mon Sep 17 00:00:00 2001 From: scrudden Date: Wed, 11 Oct 2017 10:43:29 +0100 Subject: [PATCH 12/81] Fix typo in log message. --- .../kalman/KalmanPredictionGeneratorImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java b/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java index fb4968999..ddb93e914 100755 --- a/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java +++ b/transitime/src/main/java/org/transitime/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java @@ -135,7 +135,7 @@ public long getTravelTimeForPath(Indices indices, AvlReport avlReport, VehicleSt Double last_prediction_error = lastVehiclePredictionError(kalmanErrorCache, previousVehicleIndices); - logger.debug("Using error value: " + last_prediction_error +"found with vehicle id "+travelTimeDetails.getArrival().getVehicleId()+ " from: "+new KalmanErrorCacheKey(previousVehicleIndices).toString()); + logger.debug("Using error value: " + last_prediction_error +" found with vehicle id "+travelTimeDetails.getArrival().getVehicleId()+ " from: "+new KalmanErrorCacheKey(previousVehicleIndices).toString()); //TODO this should also display the detail of which vehicle it choose as the last one. logger.debug("Using last vehicle value: " + travelTimeDetails + " for : "+ indices.toString()); From b6bd21d6c1a66d65ed28f29de582a44c1d1ab43e Mon Sep 17 00:00:00 2001 From: scrudden Date: Tue, 12 Dec 2017 19:50:38 +0000 Subject: [PATCH 13/81] Reduce logging from matcher for test runs. --- transitime/src/main/resources/logback.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transitime/src/main/resources/logback.xml b/transitime/src/main/resources/logback.xml index 6ac77380d..e54c37956 100755 --- a/transitime/src/main/resources/logback.xml +++ b/transitime/src/main/resources/logback.xml @@ -448,9 +448,9 @@ level="debug" additivity="false"> - + - + + + com.simontuffs one-jar-boot diff --git a/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarAVLModule.java b/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarAVLModule.java new file mode 100644 index 000000000..5c6defaa9 --- /dev/null +++ b/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarAVLModule.java @@ -0,0 +1,103 @@ +/* + * This file is part of thetransitclock.org + * + * thetransitclock.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License (GPL) as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * thetransitclock.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with thetransitclock.org . If not, see . + */ +package org.transitclock.custom.traccar; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.transitclock.avl.AmigoCloudAvlModule; +import org.transitclock.avl.PollUrlAvlModule; +import org.transitclock.config.StringConfigValue; +import org.transitclock.db.structs.AvlReport; +import org.transitclock.db.structs.AvlReport.AssignmentType; +import io.swagger.client.ApiClient; +import io.swagger.client.api.DefaultApi; +import io.swagger.client.model.Position; +import io.swagger.client.model.User; + +/** + * @author Sean Óg Crudden This module integrated with the API of a traccar + * server. + * + * See http://www.traccar.org + * + * It uses classes that where generated using the swagger file provided + * with traccar. + * + */ +public class TraccarAVLModule extends PollUrlAvlModule { + + private User user = null; + private DefaultApi api = null; + + private static StringConfigValue traccarEmail = new StringConfigValue("transitclock.avl.traccar.email", "admin", + "This is the username for the traccar server api."); + + private static StringConfigValue traccarPassword = new StringConfigValue("transitclock.avl.traccar.password", + "admin", "This is the password for the traccar server api"); + + private static StringConfigValue traccarBaseUrl = new StringConfigValue("transitclock.avl.traccar.baseurl", + "http://127.0.0.1:8082/api", "This is the url for the traccar server api."); + + private static StringConfigValue traccarSource = new StringConfigValue("transitclock.avl.traccar.source", + "This is the value recorded in the source for the AVL Report." + "is used.", "Traccar"); + + private static final Logger logger = LoggerFactory.getLogger(TraccarAVLModule.class); + + public TraccarAVLModule(String agencyId) throws Throwable { + super(agencyId); + api = new DefaultApi(); + ApiClient client = new ApiClient(); + client.setBasePath(traccarBaseUrl.getValue()); + client.setUsername(traccarEmail.getValue()); + client.setPassword(traccarPassword.getValue()); + api.setApiClient(client); + user = api.sessionPost(traccarEmail.getValue(), traccarPassword.getValue()); + if (user != null) + logger.debug("Traccar login succeeded."); + } + + @Override + protected void getAndProcessData() throws Exception { + + Collection avlReportsReadIn = new ArrayList(); + if (api != null && user != null) { + List results = api.positionsGet(null, null, null, user.getId()); + for (Position result : results) { + logger.debug(result.toString()); + + AvlReport avlReport = new AvlReport(result.getDeviceId().toString(), + result.getDeviceTime().toDate().getTime(), result.getLatitude().doubleValue(), + result.getLongitude().doubleValue(), traccarSource.toString()); + + avlReportsReadIn.add(avlReport); + } + processAvlReports(avlReportsReadIn); + } + } + + @Override + protected Collection processData(InputStream in) throws Exception { + // TODO Auto-generated method stub + return null; + } + +} \ No newline at end of file diff --git a/transitclockTraccarClient/.gitignore b/transitclockTraccarClient/.gitignore new file mode 100644 index 000000000..b83d22266 --- /dev/null +++ b/transitclockTraccarClient/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/transitclockTraccarClient/pom.xml b/transitclockTraccarClient/pom.xml new file mode 100644 index 000000000..40c82a72d --- /dev/null +++ b/transitclockTraccarClient/pom.xml @@ -0,0 +1,181 @@ + + 4.0.0 + TheTransitClock + transitclockTraccarClient + 2.0.0-SNAPSHOT + jar + + transitclockTraccarClient + http://maven.apache.org + + + + + io.swagger + swagger-codegen-maven-plugin + 2.1.6 + + + + generate + + + + ${project.basedir}/src/main/resources/swagger.json + + + java + + + + + + joda + + + + jersey2 + + + + + + + + + maven-compiler-plugin + 2.5.1 + + 1.7 + 1.7 + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + io.swagger + + swagger-codegen-maven-plugin + + + [2.1.6,) + + + generate + + + + + + + + + + + + + + + + + junit + junit + 3.8.1 + test + + + + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + + + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-base + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + + + + + com.brsanthu + migbase64 + 2.2 + + + + + 1.5.8 + 2.22.2 + 2.8.9 + 2.7 + 1.0.0 + 4.8.1 + + + diff --git a/transitclockTraccarClient/src/main/java/TheTransitClock/transitclockTraccar/GetPositions.java b/transitclockTraccarClient/src/main/java/TheTransitClock/transitclockTraccar/GetPositions.java new file mode 100644 index 000000000..b0081678f --- /dev/null +++ b/transitclockTraccarClient/src/main/java/TheTransitClock/transitclockTraccar/GetPositions.java @@ -0,0 +1,46 @@ +package TheTransitClock.transitclockTraccar; + +import java.util.List; + +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.api.DefaultApi; +import io.swagger.client.model.Position; +import io.swagger.client.model.User; + + +/** + * @author Sean Óg Crudden + * Test App that reads all device positions from a traccar server. + * Uses classes generated from swagger file provided with traccar. + */ +public class GetPositions +{ + private static String email="admin"; + private static String password="admin"; + private static String baseUrl="http://127.0.0.1:8082/api"; + + public static void main( String[] args ) + { + DefaultApi api=new DefaultApi(); + ApiClient client=new ApiClient(); + client.setBasePath(baseUrl); + client.setUsername(email); + client.setPassword(password); + api.setApiClient(client); + try { + User user=api.sessionPost(email, password); + + List results = api.positionsGet(null, null, null, user.getId()); + + for(Position result:results) + { + System.out.println(result); + } + + } catch (ApiException e) { + + e.printStackTrace(); + } + } +} diff --git a/transitclockTraccarClient/src/main/resources/swagger.json b/transitclockTraccarClient/src/main/resources/swagger.json new file mode 100644 index 000000000..265e7bfd5 --- /dev/null +++ b/transitclockTraccarClient/src/main/resources/swagger.json @@ -0,0 +1,2100 @@ +{ + "swagger": "2.0", + "info": { + "version": "3.15", + "title": "traccar" + }, + "host": "demo.traccar.org", + "basePath": "/api", + "schemes": [ + "http" + ], + "security": [ + { + "basicAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/commands": { + "get": { + "summary": "Fetch a list of Saved Commands", + "description": "Without params, it returns a list of Drivers the user has access to", + "parameters": [ + { + "$ref": "#/parameters/all" + }, + { + "$ref": "#/parameters/userId" + }, + { + "$ref": "#/parameters/deviceId" + }, + { + "$ref": "#/parameters/groupId" + }, + { + "$ref": "#/parameters/refresh" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Command" + } + } + } + } + }, + "post": { + "summary": "Create a Saved Command", + "parameters": [ + { + "$ref": "#/parameters/Command" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Command" + } + } + } + } + }, + "/commands/{id}": { + "put": { + "summary": "Update a Saved Command", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Command" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Command" + } + } + } + }, + "delete": { + "summary": "Delete a Saved Command", + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/commands/send": { + "get": { + "summary": "Fetch a list of Saved Commands supported by Device at the moment", + "description": "Return a list of saved commands linked to Device and its groups, filtered by current Device protocol support", + "parameters": [ + { + "$ref": "#/parameters/deviceId" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Command" + } + } + }, + "400": { + "description": "Could happen when the user doesn't have permission for the device" + } + } + }, + "post": { + "summary": "Dispatch commands to device", + "description": "Dispatch a new command or Saved Command if _body.id_ set", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Command" + } + } + ], + "responses": { + "200": { + "description": "Command sent", + "schema": { + "$ref": "#/definitions/Command" + } + }, + "202": { + "description": "Command queued", + "schema": { + "$ref": "#/definitions/Command" + } + }, + "400": { + "description": "Could happen when the user doesn't have permission or an incorrect command _type_ for the device" + } + } + } + }, + "/commands/types": { + "get": { + "summary": "Fetch a list of available Commands for the Device or all possible Commands if Device ommited", + "parameters": [ + { + "name": "deviceId", + "in": "query", + "type": "integer" + }, + { + "name": "textChannel", + "in": "query", + "type": "boolean" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/CommandType" + } + } + }, + "400": { + "description": "Could happen when trying to fetch from a device the user does not have permission" + } + } + } + }, + "/devices": { + "get": { + "summary": "Fetch a list of Devices", + "description": "Without any params, returns a list of the user's devices", + "parameters": [ + { + "$ref": "#/parameters/all" + }, + { + "$ref": "#/parameters/userId" + }, + { + "name" : "id", + "in" : "query", + "description" : "To fetch one or more devices. Multiple params can be passed like `id=31&id=42`", + "required" : false, + "type" : "integer", + "collectionFormat" : "multi" + }, + { + "name" : "uniqueId", + "in" : "query", + "description" : "To fetch one or more devices. Multiple params can be passed like `uniqueId=333331&uniqieId=44442`", + "required" : false, + "type" : "string", + "collectionFormat" : "multi" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Device" + } + } + }, + "400": { + "description": "No permission" + } + } + }, + "post": { + "summary": "Create a Device", + "parameters": [ + { + "$ref": "#/parameters/Device" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Device" + } + } + } + } + }, + "/devices/{id}": { + "put": { + "summary": "Update a Device", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Device" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Device" + } + } + } + }, + "delete": { + "summary": "Delete a Device", + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/devices/{id}/distance": { + "put": { + "summary": "Update the distance counter of the Device", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeviceTotalDistance" + } + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/groups": { + "get": { + "summary": "Fetch a list of Groups", + "description": "Without any params, returns a list of the Groups the user belongs to", + "parameters": [ + { + "$ref": "#/parameters/all" + }, + { + "$ref": "#/parameters/userId" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Group" + } + } + } + } + }, + "post": { + "summary": "Create a Group", + "parameters": [ + { + "$ref": "#/parameters/Group" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Group" + } + }, + "400": { + "description": "No permission" + } + } + } + }, + "/groups/{id}": { + "put": { + "summary": "Update a Group", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Group" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Group" + } + } + } + }, + "delete": { + "summary": "Delete a Group", + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/permissions": { + "post": { + "summary": "Link an Object to another Object", + "parameters": [ + { + "$ref": "#/parameters/Permission" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Permission" + } + }, + "400": { + "description": "No permission" + } + } + }, + "delete": { + "summary": "Unlink an Object from another Object", + "parameters": [ + { + "$ref": "#/parameters/Permission" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/positions": { + "get": { + "summary" : "Fetches a list of Positions", + "description" : "Without any params, it returns a list of last known positions for all the user's Devices. _from_ and _to_ fields are not required with _id_", + "consumes": [ + "application/json", + "text/csv", + "application/gpx+xml" + ], + "produces": [ + "application/json", + "text/csv", + "application/gpx+xml" + ], + "parameters": [ + { + "name": "deviceId", + "in": "query", + "description": "_deviceId_ is optional, but requires the _from_ and _to_ parameters when used", + "required": false, + "type": "integer" + }, + { + "name": "from", + "in": "query", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name": "to", + "in": "query", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`", + "required": false, + "type": "string", + "format": "date-time" + }, + { + "name" : "id", + "in" : "query", + "description" : "To fetch one or more positions. Multiple params can be passed like `id=31&id=42`", + "required" : false, + "type" : "integer", + "collectionFormat" : "multi" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Position" + } + } + } + } + } + }, + "/server": { + "get": { + "summary": "Fetch Server information", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Server" + } + } + } + }, + "put": { + "summary": "Update Server information", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Server" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Server" + } + } + } + } + }, + "/session": { + "get": { + "summary": "Fetch Session information", + "consumes": [ + "application/x-www-form-urlencoded" + ], + "parameters": [ + { + "name": "token", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/User" + } + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "summary": "Create a new Session", + "consumes": [ + "application/x-www-form-urlencoded" + ], + "parameters": [ + { + "name": "email", + "in": "formData", + "required": true, + "type": "string" + }, + { + "name": "password", + "in": "formData", + "required": true, + "type": "string", + "format": "password" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/User" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "delete": { + "summary": "Close the Session", + "consumes": [ + "application/x-www-form-urlencoded" + ], + "parameters": [], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/users": { + "get": { + "summary": "Fetch a list of Users", + "parameters": [ + { + "name": "userId", + "in": "query", + "description": "Can only be used by admin or manager users", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + } + }, + "400": { + "description": "No Permission" + } + } + }, + "post": { + "summary": "Create a User", + "parameters": [ + { + "$ref": "#/parameters/User" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/User" + } + } + } + } + }, + "/users/{id}": { + "put": { + "summary": "Update a User", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/User" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/User" + } + } + } + }, + "delete": { + "summary": "Delete a User", + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/notifications": { + "get": { + "summary": "Fetch a list of Notifications", + "description": "Without params, it returns a list of Notifications the user has access to", + "parameters": [ + { + "$ref": "#/parameters/all" + }, + { + "$ref": "#/parameters/userId" + }, + { + "$ref": "#/parameters/deviceId" + }, + { + "$ref": "#/parameters/groupId" + }, + { + "$ref": "#/parameters/refresh" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Notification" + } + } + } + } + }, + "post": { + "summary": "Create a Notification", + "parameters": [ + { + "$ref": "#/parameters/Notification" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Notification" + } + } + } + } + }, + "/notifications/{id}": { + "put": { + "summary": "Update a Notification", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Notification" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Notification" + } + } + } + }, + "delete": { + "summary": "Delete a Notification", + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/notifications/types": { + "get": { + "summary": "Fetch a list of available Notification types", + "parameters": [], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/NotificationType" + } + } + } + } + } + }, + "/notifications/test": { + "post": { + "summary": "Send test notification to current user via Email and SMS", + "parameters": [], + "responses": { + "204": { + "description": "Successful sending" + }, + "400": { + "description": "Could happen if sending has failed" + } + } + } + }, + "/geofences": { + "get": { + "summary": "Fetch a list of Geofences", + "description": "Without params, it returns a list of Geofences the user has access to", + "parameters": [ + { + "$ref": "#/parameters/all" + }, + { + "$ref": "#/parameters/userId" + }, + { + "$ref": "#/parameters/deviceId" + }, + { + "$ref": "#/parameters/groupId" + }, + { + "$ref": "#/parameters/refresh" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Geofence" + } + } + } + } + }, + "post": { + "summary": "Create a Geofence", + "parameters": [ + { + "$ref": "#/parameters/Geofence" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Geofence" + } + } + } + } + }, + "/geofences/{id}": { + "put": { + "summary": "Update a Geofence", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Geofence" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Geofence" + } + } + } + }, + "delete": { + "summary": "Delete a Geofence", + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/events/{id}": { + "get": { + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Event" + } + } + } + } + }, + "/reports/route": { + "get": { + "summary": "Fetch a list of Positions within the time period for the Devices or Groups", + "description": "At least one _deviceId_ or one _groupId_ must be passed", + "consumes": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "produces": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "parameters": [ + { + "$ref": "#/parameters/deviceIdArray" + }, + { + "$ref": "#/parameters/groupIdArray" + }, + { + "$ref": "#/parameters/fromTime" + }, + { + "$ref": "#/parameters/toTime" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Position" + } + } + } + } + } + }, + "/reports/events": { + "get": { + "summary": "Fetch a list of Events within the time period for the Devices or Groups", + "description": "At least one _deviceId_ or one _groupId_ must be passed", + "consumes": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "produces": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "parameters": [ + { + "$ref": "#/parameters/deviceIdArray" + }, + { + "$ref": "#/parameters/groupIdArray" + }, + { + "name": "type", + "in": "query", + "description": "% can be used to return events of all types", + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "#/parameters/fromTime" + }, + { + "$ref": "#/parameters/toTime" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Event" + } + } + } + } + } + }, + "/reports/summary": { + "get": { + "summary": "Fetch a list of ReportSummary within the time period for the Devices or Groups", + "description": "At least one _deviceId_ or one _groupId_ must be passed", + "consumes": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "produces": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "parameters": [ + { + "$ref": "#/parameters/deviceIdArray" + }, + { + "$ref": "#/parameters/groupIdArray" + }, + { + "$ref": "#/parameters/fromTime" + }, + { + "$ref": "#/parameters/toTime" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ReportSummary" + } + } + } + } + } + }, + "/reports/trips": { + "get": { + "summary": "Fetch a list of ReportTrips within the time period for the Devices or Groups", + "description": "At least one _deviceId_ or one _groupId_ must be passed", + "consumes": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "produces": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "parameters": [ + { + "$ref": "#/parameters/deviceIdArray" + }, + { + "$ref": "#/parameters/groupIdArray" + }, + { + "$ref": "#/parameters/fromTime" + }, + { + "$ref": "#/parameters/toTime" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ReportTrips" + } + } + } + } + } + }, + "/reports/stops": { + "get": { + "summary": "Fetch a list of ReportStops within the time period for the Devices or Groups", + "description": "At least one _deviceId_ or one _groupId_ must be passed", + "consumes": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "produces": [ + "application/json", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ], + "parameters": [ + { + "$ref": "#/parameters/deviceIdArray" + }, + { + "$ref": "#/parameters/groupIdArray" + }, + { + "$ref": "#/parameters/fromTime" + }, + { + "$ref": "#/parameters/toTime" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ReportStops" + } + } + } + } + } + }, + "/statistics": { + "get": { + "summary": "Fetch server Statistics", + "parameters": [ + { + "$ref": "#/parameters/fromTime" + }, + { + "$ref": "#/parameters/toTime" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Statistics" + } + } + } + } + } + }, + "/calendars": { + "get": { + "summary": "Fetch a list of Calendars", + "description": "Without params, it returns a list of Calendars the user has access to", + "parameters": [ + { + "$ref": "#/parameters/all" + }, + { + "$ref": "#/parameters/userId" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Calendar" + } + } + } + } + }, + "post": { + "summary": "Create a Calendar", + "parameters": [ + { + "$ref": "#/parameters/Calendar" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Calendar" + } + } + } + } + }, + "/calendars/{id}": { + "put": { + "summary": "Update a Calendar", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Calendar" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Calendar" + } + } + } + }, + "delete": { + "summary": "Delete a Calendar", + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/attributes/computed": { + "get": { + "summary": "Fetch a list of Attributes", + "description": "Without params, it returns a list of Attributes the user has access to", + "parameters": [ + { + "$ref": "#/parameters/all" + }, + { + "$ref": "#/parameters/userId" + }, + { + "$ref": "#/parameters/deviceId" + }, + { + "$ref": "#/parameters/groupId" + }, + { + "$ref": "#/parameters/refresh" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Attribute" + } + } + } + } + }, + "post": { + "summary": "Create an Attribute", + "parameters": [ + { + "$ref": "#/parameters/Attribute" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Attribute" + } + } + } + } + }, + "/attributes/computed/{id}": { + "put": { + "summary": "Update an Attribute", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Attribute" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Attribute" + } + } + } + }, + "delete": { + "summary": "Delete an Attribute", + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, + "/drivers": { + "get": { + "summary": "Fetch a list of Drivers", + "description": "Without params, it returns a list of Drivers the user has access to", + "parameters": [ + { + "$ref": "#/parameters/all" + }, + { + "$ref": "#/parameters/userId" + }, + { + "$ref": "#/parameters/deviceId" + }, + { + "$ref": "#/parameters/groupId" + }, + { + "$ref": "#/parameters/refresh" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Driver" + } + } + } + } + }, + "post": { + "summary": "Create a Driver", + "parameters": [ + { + "$ref": "#/parameters/Driver" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Driver" + } + } + } + } + }, + "/drivers/{id}": { + "put": { + "summary": "Update a Driver", + "parameters": [ + { + "$ref": "#/parameters/entityId" + }, + { + "$ref": "#/parameters/Driver" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Driver" + } + } + } + }, + "delete": { + "summary": "Delete a Driver", + "parameters": [ + { + "$ref": "#/parameters/entityId" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + } + }, + "definitions": { + "Position": { + "properties": { + "id": { + "type": "integer" + }, + "deviceId": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "deviceTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "fixTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "serverTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "outdated": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + }, + "latitude": { + "type": "number" + }, + "longitude": { + "type": "number" + }, + "altitude": { + "type": "number" + }, + "speed": { + "type": "number", + "description": "in knots" + }, + "course": { + "type": "number" + }, + "address": { + "type": "string" + }, + "accuracy": { + "type": "number" + }, + "network": { + "type": "string" + }, + "attributes": {} + } + }, + "User": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "readonly": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + }, + "map": { + "type": "string" + }, + "latitude": { + "type": "number" + }, + "longitude": { + "type": "number" + }, + "zoom": { + "type": "integer" + }, + "password": { + "type": "string" + }, + "twelveHourFormat": { + "type": "boolean" + }, + "coordinateFormat": { + "type": "string" + }, + "disabled": { + "type": "boolean" + }, + "expirationTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "deviceLimit": { + "type": "integer" + }, + "userLimit": { + "type": "integer" + }, + "deviceReadonly": { + "type": "boolean" + }, + "limitCommands": { + "type": "boolean" + }, + "token": { + "type": "string" + }, + "attributes": {} + } + }, + "Server": { + "properties": { + "id": { + "type": "integer" + }, + "registration": { + "type": "boolean" + }, + "readonly": { + "type": "boolean" + }, + "deviceReadonly": { + "type": "boolean" + }, + "limitCommands": { + "type": "boolean" + }, + "map": { + "type": "string" + }, + "bingKey": { + "type": "string" + }, + "mapUrl": { + "type": "string" + }, + "latitude": { + "type": "number" + }, + "longitude": { + "type": "number" + }, + "zoom": { + "type": "integer" + }, + "twelveHourFormat": { + "type": "boolean" + }, + "version": { + "type": "string" + }, + "forceSettings": { + "type": "boolean" + }, + "coordinateFormat": { + "type": "string" + }, + "attributes": {} + } + }, + "Command": { + "properties": { + "id": { + "type": "integer" + }, + "deviceId": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + }, + "attributes": {} + } + }, + "Device": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "uniqueId": { + "type": "string" + }, + "status": { + "type": "string" + }, + "lastUpdate": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "positionId": { + "type": "integer" + }, + "groupId": { + "type": "integer" + }, + "phone": { + "type": "string" + }, + "model": { + "type": "string" + }, + "contact": { + "type": "string" + }, + "category": { + "type": "string" + }, + "geofenceIds": { + "type": "array", + "items": { + "type": "integer" + } + }, + "attributes": {} + } + }, + "Group": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "groupId": { + "type": "integer" + }, + "attributes": {} + } + }, + "Permission": { + "description": "This is a permission map that contain two object indexes. It is used to link/unlink objects. Order is important. Example: { deviceId:8, geofenceId: 16 }", + "properties": { + "userId": { + "description": "User Id, can be only first parameter", + "type": "integer" + }, + "deviceId": { + "description": "Device Id, can be first parameter or second only in combination with userId", + "type": "integer" + }, + "groupId": { + "description": "Group Id, can be first parameter or second only in combination with userId", + "type": "integer" + }, + "geofenceId": { + "description": "Geofence Id, can be second parameter only", + "type": "integer" + }, + "calendarId": { + "description": "Geofence Id, can be second parameter only and only in combination with userId", + "type": "integer" + }, + "attributeId": { + "description": "Computed Attribute Id, can be second parameter only", + "type": "integer" + }, + "driverId": { + "description": "Driver Id, can be second parameter only", + "type": "integer" + }, + "managedUserId": { + "description": "User Id, can be second parameter only and only in combination with userId", + "type": "integer" + } + } + }, + "CommandType": { + "properties": { + "type": { + "type": "string" + } + } + }, + "Geofence": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "area": { + "type": "string" + }, + "calendarId": { + "type": "integer" + }, + "attributes": {} + } + }, + "Notification": { + "properties": { + "id": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "always": { + "type": "boolean" + }, + "web": { + "type": "boolean" + }, + "mail": { + "type": "boolean" + }, + "sms": { + "type": "boolean" + }, + "attributes": {} + } + }, + "NotificationType": { + "properties": { + "type": { + "type": "string" + } + } + }, + "Event": { + "properties": { + "id": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "serverTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "deviceId": { + "type": "integer" + }, + "positionId": { + "type": "integer" + }, + "geofenceId": { + "type": "integer" + }, + "attributes": {} + } + }, + "ReportSummary": { + "properties": { + "deviceId": { + "type": "integer" + }, + "deviceName": { + "type": "string" + }, + "maxSpeed": { + "type": "number", + "description": "in knots" + }, + "averageSpeed": { + "type": "number", + "description": "in knots" + }, + "distance": { + "type": "number", + "description": "in meters" + }, + "spentFuel": { + "type": "number", + "description": "in liters" + }, + "engineHours": { + "type": "integer" + } + } + }, + "ReportTrips": { + "properties": { + "deviceId": { + "type": "integer" + }, + "deviceName": { + "type": "string" + }, + "maxSpeed": { + "type": "number", + "description": "in knots" + }, + "averageSpeed": { + "type": "number", + "description": "in knots" + }, + "distance": { + "type": "number", + "description": "in meters" + }, + "spentFuel": { + "type": "number", + "description": "in liters" + }, + "duration": { + "type": "integer" + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "startAddress": { + "type": "string" + }, + "startLat": { + "type": "number" + }, + "startLon": { + "type": "number" + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "endAddress": { + "type": "string" + }, + "endLat": { + "type": "number" + }, + "endLon": { + "type": "number" + }, + "driverUniqueId": { + "type": "integer" + }, + "driverName": { + "type": "string" + } + } + }, + "ReportStops": { + "properties": { + "deviceId": { + "type": "integer" + }, + "deviceName": { + "type": "string" + }, + "duration": { + "type": "integer" + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "address": { + "type": "string" + }, + "lat": { + "type": "number" + }, + "lon": { + "type": "number" + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "spentFuel": { + "type": "number", + "description": "in liters" + }, + "engineHours": { + "type": "integer" + } + } + }, + "Statistics": { + "properties": { + "captureTime": { + "type": "string", + "format": "date-time", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`" + }, + "activeUsers": { + "type": "integer" + }, + "activeDevices": { + "type": "integer" + }, + "requests": { + "type": "integer" + }, + "messagesReceived": { + "type": "integer" + }, + "messagesStored": { + "type": "integer" + } + } + }, + "DeviceTotalDistance": { + "properties": { + "deviceId": { + "type": "integer" + }, + "totalDistance": { + "type": "number", + "description": "in meters" + } + } + }, + "Calendar": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "data": { + "type": "string", + "description": "base64 encoded in iCalendar format" + }, + "atributes": {} + } + }, + "Attribute": { + "properties": { + "id": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "attribute": { + "type": "string" + }, + "expression": { + "type": "string" + }, + "type": { + "type": "string", + "description": "String|Number|Boolean" + } + } + }, + "Driver": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "uniqueId": { + "type": "string" + }, + "atributes": {} + } + } + }, + "parameters": { + "entityId": { + "name": "id", + "in": "path", + "required": true, + "type": "integer" + }, + "all": { + "name": "all", + "in": "query", + "description": "Can only be used by admins or managers to fetch all entities", + "type": "boolean" + }, + "refresh": { + "name": "refresh", + "in": "query", + "required": false, + "type": "boolean" + }, + "userId": { + "name": "userId", + "in": "query", + "description": "Standard users can use this only with their own _userId_", + "type": "integer" + }, + "deviceId": { + "name": "deviceId", + "in": "query", + "description": "Standard users can use this only with _deviceId_s, they have access to", + "type": "integer" + }, + "groupId": { + "name": "groupId", + "in": "query", + "description": "Standard users can use this only with _groupId_s, they have access to", + "type": "integer" + }, + "Device": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Device" + } + }, + "Permission": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Permission" + } + }, + "Group": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Group" + } + }, + "User": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/User" + } + }, + "Geofence": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Geofence" + } + }, + "Calendar": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Calendar" + } + }, + "Attribute": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Attribute" + } + }, + "Driver": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Driver" + } + }, + "Command": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Command" + } + }, + "Notification": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Notification" + } + }, + "deviceIdArray": { + "name": "deviceId", + "in": "query", + "type": "array", + "items": { + "type": "integer" + }, + "collectionFormat": "multi" + }, + "groupIdArray": { + "name": "groupId", + "in": "query", + "type": "array", + "items": { + "type": "integer" + }, + "collectionFormat": "multi" + }, + "fromTime": { + "name": "from", + "in": "query", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`", + "required": true, + "type": "string", + "format": "date-time" + }, + "toTime": { + "name": "to", + "in": "query", + "description": "in IS0 8601 format. eg. `1963-11-22T18:30:00Z`", + "required": true, + "type": "string", + "format": "date-time" + } + }, + "securityDefinitions": { + "basicAuth": { + "type": "basic", + "description": "Basic HTTP authorization with _email_ and _password_" + } + } +} diff --git a/transitclockTraccarClient/src/test/java/TheTransitClock/transitclockTraccar/AppTest.java b/transitclockTraccarClient/src/test/java/TheTransitClock/transitclockTraccar/AppTest.java new file mode 100644 index 000000000..96a9afe69 --- /dev/null +++ b/transitclockTraccarClient/src/test/java/TheTransitClock/transitclockTraccar/AppTest.java @@ -0,0 +1,38 @@ +package TheTransitClock.transitclockTraccar; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} From 8431661b5988209ca4aa4d59c8c6eb924b5701e8 Mon Sep 17 00:00:00 2001 From: scrudden Date: Thu, 8 Feb 2018 18:43:41 +0000 Subject: [PATCH 15/81] Fixed typo in comment. --- .../org/transitclock/custom/traccar/TraccarAVLModule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarAVLModule.java b/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarAVLModule.java index 5c6defaa9..c721242e1 100644 --- a/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarAVLModule.java +++ b/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarAVLModule.java @@ -34,8 +34,8 @@ import io.swagger.client.model.User; /** - * @author Sean Óg Crudden This module integrated with the API of a traccar - * server. + * @author Sean Óg Crudden This module integrates TheTransitClock with the API of a traccar + * server to get vehicle locations. * * See http://www.traccar.org * From 4e816f41271b9caf586d5368e27d2d9418258200 Mon Sep 17 00:00:00 2001 From: scrudden Date: Mon, 12 Feb 2018 18:17:50 +0000 Subject: [PATCH 16/81] Modules to support integration with barefoot server. --- .../avl/NextBusBarefootAvlModule.java | 97 +++++++++++ .../custom/barefoot/BarefootAVLModule.java | 164 ++++++++++++++++++ .../custom/traccar/TraccarAVLModule.java | 8 +- .../traccar/TraccarBarefootAVLModule.java | 124 +++++++++++++ transitclock/src/main/resources/logback.xml | 19 +- 5 files changed, 410 insertions(+), 2 deletions(-) create mode 100644 transitclock/src/main/java/org/transitclock/avl/NextBusBarefootAvlModule.java create mode 100644 transitclock/src/main/java/org/transitclock/custom/barefoot/BarefootAVLModule.java create mode 100644 transitclock/src/main/java/org/transitclock/custom/traccar/TraccarBarefootAVLModule.java diff --git a/transitclock/src/main/java/org/transitclock/avl/NextBusBarefootAvlModule.java b/transitclock/src/main/java/org/transitclock/avl/NextBusBarefootAvlModule.java new file mode 100644 index 000000000..f4faf66ab --- /dev/null +++ b/transitclock/src/main/java/org/transitclock/avl/NextBusBarefootAvlModule.java @@ -0,0 +1,97 @@ +package org.transitclock.avl; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.InetAddress; +import java.net.Socket; +import java.text.SimpleDateFormat; +import java.util.Collection; + +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.transitclock.db.structs.AvlReport; + +import com.esri.core.geometry.Point; + +public class NextBusBarefootAvlModule extends NextBusAvlModule { + private static final Logger logger = LoggerFactory + .getLogger(NextBusBarefootAvlModule.class); + public NextBusBarefootAvlModule(String agencyId) { + super(agencyId); + } + + @Override + protected void processAvlReports(Collection avlReports) { + forwardAvlReports(avlReports); + } + + + protected void forwardAvlReports(Collection avlReportsReadIn) { + for(AvlReport avlReport:avlReportsReadIn) + { + sendUpdate(avlReport); + } + } + + public void sendUpdate(AvlReport avlReport) { + try { + JSONObject report = new JSONObject(); + + InetAddress host = InetAddress.getLocalHost(); + + int port = 1234; + + report.put("id", avlReport.getVehicleId()); + + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ"); + + report.put("time", df.format(avlReport.getDate())); + + Point point = new Point(); + point.setX(avlReport.getLon()); + point.setY(avlReport.getLat()); + + report.put("point", "POINT(" + avlReport.getLon() + " " + avlReport.getLat() + ")"); + // report.put("point", GeometryEngine.geometryToGeoJson(point)); + + sendBareFootSample(host, port, report); + + } catch (Exception e) { + logger.error("Problem when sending samples to barefoot.", e); + } + } + + private void sendBareFootSample(InetAddress host, int port, JSONObject sample) throws Exception { + int trials = 120; + int timeout = 500; + Socket client = null; + // TODO Will need to leave socket open. + while (client == null || !client.isConnected()) { + try { + client = new Socket(host, port); + } catch (IOException e) { + Thread.sleep(timeout); + + if (trials == 0) { + logger.error(e.getMessage()); + client.close(); + throw new IOException(); + } else { + trials -= 1; + } + } + } + PrintWriter writer = new PrintWriter(client.getOutputStream()); + BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream())); + writer.println(sample.toString()); + writer.flush(); + + String code = reader.readLine(); + if (!code.equals("SUCCESS")) { + throw new Exception("Barefoot server did not respond with SUCCESS. Code="+code); + } + } +} diff --git a/transitclock/src/main/java/org/transitclock/custom/barefoot/BarefootAVLModule.java b/transitclock/src/main/java/org/transitclock/custom/barefoot/BarefootAVLModule.java new file mode 100644 index 000000000..19bb5fc76 --- /dev/null +++ b/transitclock/src/main/java/org/transitclock/custom/barefoot/BarefootAVLModule.java @@ -0,0 +1,164 @@ +/* + * This file is part of thetransitclock.org + * + * thetransitclock.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License (GPL) as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * thetransitclock.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with thetransitclock.org . If not, see . + */ +package org.transitclock.custom.barefoot; + +import java.io.InputStream; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; + +import org.transitclock.avl.NextBusBarefootAvlModule; +import org.transitclock.avl.PollUrlAvlModule; +import org.transitclock.config.DoubleConfigValue; +import org.transitclock.config.IntegerConfigValue; +import org.transitclock.config.StringConfigValue; +import org.transitclock.db.structs.AvlReport; +import org.zeromq.ZMQ; +import org.zeromq.ZMQ.Context; +import org.zeromq.ZMQ.Socket; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.transitclock.db.structs.Location; +import com.esri.core.geometry.GeometryEngine; +import com.esri.core.geometry.Point; +import com.esri.core.geometry.WktImportFlags; +import com.esri.core.geometry.Geometry.Type; + +/** + * @author Sean Óg Crudden + * + * This module subscribes to a barefoot server to get map matched GPS + * data. + * + * + */ +public class BarefootAVLModule extends PollUrlAvlModule { + + private static IntegerConfigValue barefootPort = new IntegerConfigValue("transitclock.avl.barefoot.subscribe.port", + 1235, "This is the port of the barefoot server to subscribe to."); + + private static StringConfigValue barefootServer = new StringConfigValue( + "transitclock.avl.barefoot.subscribe.server", "127.0.0.1", + "This is the server that is running the barefoot map matching service."); + + private static DoubleConfigValue minProbability = new DoubleConfigValue( + "transitclock.avl.barefoot.subscribe.minprobability", 0.1, + "Only use values that have a probability of being correct higher than this."); + + private static final Logger logger = LoggerFactory.getLogger(BarefootAVLModule.class); + + private static HashMap locations = new HashMap(); + + public BarefootAVLModule(String agencyId) { + super(agencyId); + + } + + @Override + protected void getAndProcessData() throws Exception { + + // Prepare our context and subscriber + + Context context = ZMQ.context(1); + + Socket subscriber = context.socket(ZMQ.SUB); + + subscriber.connect("tcp://" + barefootServer.getValue() + ":" + barefootPort.getValue()); + + subscriber.subscribe("".getBytes()); + + while (!Thread.currentThread().isInterrupted()) { + + String contents = subscriber.recvStr(); + logger.debug("Got content from barefoot : " + contents); + + JSONObject update = new JSONObject(contents); + + String vehicleId = update.getString("id"); + + Long time = update.getLong("time"); + Location location = getAdjustedLocation(vehicleId, update); + AvlReport avlReport = null; + if (location != null) { + avlReport = new AvlReport(vehicleId, time, location.getLat(), location.getLon(), "Barefoot"); + logger.debug("AVL from barefoot to be processed : " + avlReport); + processAvlReport(avlReport); + } + } + subscriber.close(); + context.term(); + } + + @Override + protected Collection processData(InputStream in) throws Exception { + // TODO Auto-generated method stub + return null; + } + + private Location getAdjustedLocation(String vehicleId, JSONObject state) { + + Location result = null; + try { + + JSONArray candidatesArray = state.getJSONArray("candidates"); + + Double maxProbability = 0.0; + + for (int i = 0; i < candidatesArray.length(); i++) { + double probabililty = candidatesArray.getJSONObject(i).getDouble("prob"); + + String geoPoint = candidatesArray.getJSONObject(i).getString("point"); + + Point point = (Point) GeometryEngine.geometryFromWkt(geoPoint, WktImportFlags.wktImportDefaults, + Type.Point); + + // Only consider new or modified GPS values + if ((locations.get(vehicleId) != null && !locations.get(vehicleId).equals(point)) + || locations.get(vehicleId) == null) { + if (probabililty > minProbability.getValue()) { + + maxProbability = probabililty; + + result = new Location(point.getY(), point.getX()); + + locations.put(vehicleId, point); + } + } + } + } catch (Exception e) { + logger.error("Failed to adjust location with barefoot. Reason: " + e.getMessage()); + e.printStackTrace(); + } + return result; + } + + protected double bearing(double lat1, double lon1, double lat2, double lon2) { + double longitude1 = lon1; + double longitude2 = lon2; + double latitude1 = Math.toRadians(lat1); + double latitude2 = Math.toRadians(lat2); + double longDiff = Math.toRadians(longitude2 - longitude1); + double y = Math.sin(longDiff) * Math.cos(latitude2); + double x = Math.cos(latitude1) * Math.sin(latitude2) + - Math.sin(latitude1) * Math.cos(latitude2) * Math.cos(longDiff); + + return (Math.toDegrees(Math.atan2(y, x)) + 360) % 360; + } +} diff --git a/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarAVLModule.java b/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarAVLModule.java index c721242e1..467007890 100644 --- a/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarAVLModule.java +++ b/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarAVLModule.java @@ -90,7 +90,8 @@ protected void getAndProcessData() throws Exception { avlReportsReadIn.add(avlReport); } - processAvlReports(avlReportsReadIn); + + forwardAvlReports(avlReportsReadIn); } } @@ -98,6 +99,11 @@ protected void getAndProcessData() throws Exception { protected Collection processData(InputStream in) throws Exception { // TODO Auto-generated method stub return null; + } + + protected void forwardAvlReports(Collection avlReportsReadIn) + { + processAvlReports(avlReportsReadIn); } } \ No newline at end of file diff --git a/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarBarefootAVLModule.java b/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarBarefootAVLModule.java new file mode 100644 index 000000000..9b5accadb --- /dev/null +++ b/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarBarefootAVLModule.java @@ -0,0 +1,124 @@ +/* + * This file is part of thetransitclock.org + * + * thetransitclock.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License (GPL) as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * thetransitclock.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with thetransitclock.org . If not, see . + */ +package org.transitclock.custom.traccar; + +import java.util.Collection; + +import org.transitclock.db.structs.AvlReport; + +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.transitclock.config.IntegerConfigValue; +import org.transitclock.config.StringConfigValue; +import com.esri.core.geometry.Point; +import java.io.BufferedReader; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.InetAddress; +import java.net.Socket; +import java.text.SimpleDateFormat; + +/** + * @author Sean Óg Crudden + * + * This module takes data from traccar and forwards it to a barefoot + * server instances to have it map matched to a GTFS route. + * + * The BarefootAVLModule should be configured with this module to read + * the adjusted AVL from the barefoot server for processing by + * TheTransitClock. + */ +public class TraccarBarefootAVLModule extends TraccarAVLModule { + private static final Logger logger = LoggerFactory.getLogger(TraccarBarefootAVLModule.class); + + private static IntegerConfigValue barefootPort = new IntegerConfigValue("transitclock.avl.barefoot.port", 1235, + "This is the port of the barefoot server to send samples to."); + + private static StringConfigValue barefootServer = new StringConfigValue("transitclock.avl.barefoot.server", + "127.0.0.1", "This is the server that is running the barefoot service."); + + public TraccarBarefootAVLModule(String agencyId) throws Throwable { + super(agencyId); + } + + protected void forwardAvlReports(Collection avlReportsReadIn) { + for(AvlReport avlReport:avlReportsReadIn) + { + sendUpdate(avlReport); + } + } + + public void sendUpdate(AvlReport avlReport) { + try { + JSONObject report = new JSONObject(); + + InetAddress host = InetAddress.getByName(barefootServer.getValue()); + + report.put("id", avlReport.getVehicleId()); + + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ"); + + report.put("time", df.format(avlReport.getDate())); + + Point point = new Point(); + point.setX(avlReport.getLon()); + point.setY(avlReport.getLat()); + + report.put("point", "POINT(" + avlReport.getLon() + " " + avlReport.getLat() + ")"); + // report.put("point", GeometryEngine.geometryToGeoJson(point)); + + sendBareFootSample(host, barefootPort.getValue(), report); + + } catch (Exception e) { + logger.error("Problem when sending samples to barefoot.", e); + } + } + + private void sendBareFootSample(InetAddress host, int port, JSONObject sample) throws Exception { + int trials = 120; + int timeout = 500; + Socket client = null; + // TODO Will need to leave socket open. + while (client == null || !client.isConnected()) { + try { + client = new Socket(host, port); + } catch (IOException e) { + Thread.sleep(timeout); + + if (trials == 0) { + logger.error(e.getMessage()); + client.close(); + throw new IOException(); + } else { + trials -= 1; + } + } + } + PrintWriter writer = new PrintWriter(client.getOutputStream()); + BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream())); + writer.println(sample.toString()); + writer.flush(); + + String code = reader.readLine(); + if (!code.equals("SUCCESS")) { + throw new Exception("Barefoot server did not respond with SUCCESS"); + } + } +} diff --git a/transitclock/src/main/resources/logback.xml b/transitclock/src/main/resources/logback.xml index ac0762f1a..35cb5b778 100755 --- a/transitclock/src/main/resources/logback.xml +++ b/transitclock/src/main/resources/logback.xml @@ -327,7 +327,7 @@ ${DEFAULT_PATTERN} - + @@ -347,6 +347,18 @@ ${DATA_PATTERN} + + + + + ${LOG_FILE_ROOT}/mapmatch.log.gz + + + UTF-8 + ${DATA_PATTERN} + + @@ -514,6 +526,11 @@ level="debug" additivity="true"> + + + + @@ -30,26 +31,34 @@ - + + TheTransitClock + transitclockBarefootClient + 2.0.0-SNAPSHOT + TheTransitClock transitclockTraccarClient 2.0.0-SNAPSHOT - - - - + + com.simontuffs one-jar-boot 0.97.3 - mysql @@ -78,7 +87,7 @@ 4.3.9.Final - xml-apis @@ -99,9 +108,9 @@ 1.1.3 - org.hsqldb - hsqldb - 2.2.4 + org.hsqldb + hsqldb + 2.2.4 @@ -145,7 +154,7 @@ 1.2 - @@ -167,10 +176,10 @@ 1.3.0 - org.json @@ -185,7 +194,7 @@ 1.1 - net.jcip @@ -403,71 +412,74 @@ - - PredictionsAccuracyIntegrationTest - - - - org.codehaus.mojo - truezip-maven-plugin - 1.2 - - - unzip-database - - copy - - test - - true - - ${project.basedir}/src/test/resources/database/transitime_test.zip - ${project.basedir}/src/test/resources/database/data - - - - - - - org.onebusaway.plugins - maven-hsqldb-plugin - - 1.0.1 - - - user-database-start - test - - run - - - true - ${project.basedir}/src/test/resources/database/data/transitime_test - 9001 - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.1.1 - - - test - test-case-execution - - java - - - org.transitclock.applications.PredictionsAccuracyIntegrationTest - -c transitime/src/test/resources/transiTimeConfigIntegrationTest.xml -gtfsDirectoryName transitime/src/test/resources/wmata_gtfs -storeNewRevs -maxTravelTimeSegmentLength 1000 - - - - - - - + + PredictionsAccuracyIntegrationTest + + + + org.codehaus.mojo + truezip-maven-plugin + 1.2 + + + unzip-database + + copy + + test + + true + + ${project.basedir}/src/test/resources/database/transitime_test.zip + ${project.basedir}/src/test/resources/database/data + + + + + + + org.onebusaway.plugins + maven-hsqldb-plugin + + 1.0.1 + + + user-database-start + test + + run + + + true + ${project.basedir}/src/test/resources/database/data/transitime_test + 9001 + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.1.1 + + + test + test-case-execution + + java + + + org.transitclock.applications.PredictionsAccuracyIntegrationTest + -c + transitime/src/test/resources/transiTimeConfigIntegrationTest.xml + -gtfsDirectoryName transitime/src/test/resources/wmata_gtfs + -storeNewRevs -maxTravelTimeSegmentLength 1000 + + + + + + + diff --git a/transitclockBarefootClient/.gitignore b/transitclockBarefootClient/.gitignore new file mode 100644 index 000000000..b83d22266 --- /dev/null +++ b/transitclockBarefootClient/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/transitclockBarefootClient/pom.xml b/transitclockBarefootClient/pom.xml new file mode 100644 index 000000000..56e03686e --- /dev/null +++ b/transitclockBarefootClient/pom.xml @@ -0,0 +1,30 @@ + + 4.0.0 + + TheTransitClock + transitclockBarefootClient + 2.0.0-SNAPSHOT + jar + + transitclockBarefootClient + http://maven.apache.org + + + UTF-8 + + + + + junit + junit + 3.8.1 + test + + + org.zeromq + jeromq + 0.3.5 + + + diff --git a/transitclockBarefootClient/src/main/java/TheTransitClock/transitclockBarefootClient/App.java b/transitclockBarefootClient/src/main/java/TheTransitClock/transitclockBarefootClient/App.java new file mode 100644 index 000000000..86ab06d3c --- /dev/null +++ b/transitclockBarefootClient/src/main/java/TheTransitClock/transitclockBarefootClient/App.java @@ -0,0 +1,32 @@ +package TheTransitClock.transitclockBarefootClient; + +import org.zeromq.ZMQ; +import org.zeromq.ZMQ.Context; +import org.zeromq.ZMQ.Socket; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + // Prepare our context and subscriber + Context context = ZMQ.context(1); + Socket subscriber = context.socket(ZMQ.SUB); + + subscriber.connect("tcp://localhost:1234"); + subscriber.subscribe("".getBytes()); + + while (!Thread.currentThread ().isInterrupted ()) { + // Read envelope with address + String address = subscriber.recvStr (); + // Read message contents + String contents = subscriber.recvStr (); + System.out.println(address + " : " + contents); + } + subscriber.close (); + context.term (); + } +} diff --git a/transitclockBarefootClient/src/test/java/TheTransitClock/transitclockBarefootClient/AppTest.java b/transitclockBarefootClient/src/test/java/TheTransitClock/transitclockBarefootClient/AppTest.java new file mode 100644 index 000000000..9e5985c26 --- /dev/null +++ b/transitclockBarefootClient/src/test/java/TheTransitClock/transitclockBarefootClient/AppTest.java @@ -0,0 +1,38 @@ +package TheTransitClock.transitclockBarefootClient; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/transitclockTraccarClient/pom.xml b/transitclockTraccarClient/pom.xml index 40c82a72d..dcead3184 100644 --- a/transitclockTraccarClient/pom.xml +++ b/transitclockTraccarClient/pom.xml @@ -171,7 +171,7 @@ 1.5.8 - 2.22.2 + 2.11 2.8.9 2.7 1.0.0 From 2fafc5b5e064e2e106c77b9e2f912e0fa1f5b25a Mon Sep 17 00:00:00 2001 From: scrudden Date: Sat, 9 Jun 2018 18:50:37 +0100 Subject: [PATCH 18/81] Adding a barefoot playback module. --- .gitignore | 3 +- .../avl/BarefootPlaybackModule.java | 164 ++++++++++++++++++ .../org/transitclock/avl/PlaybackModule.java | 14 +- .../traccar/TraccarBarefootAVLModule.java | 2 +- 4 files changed, 174 insertions(+), 9 deletions(-) create mode 100644 transitclock/src/main/java/org/transitclock/avl/BarefootPlaybackModule.java diff --git a/.gitignore b/.gitignore index 4a967fcd5..6552bb0ee 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,6 @@ *.jar *.war *.ear +*.log /bin/ -/.settings/ \ No newline at end of file +/.settings/ diff --git a/transitclock/src/main/java/org/transitclock/avl/BarefootPlaybackModule.java b/transitclock/src/main/java/org/transitclock/avl/BarefootPlaybackModule.java new file mode 100644 index 000000000..b5da9bf97 --- /dev/null +++ b/transitclock/src/main/java/org/transitclock/avl/BarefootPlaybackModule.java @@ -0,0 +1,164 @@ +package org.transitclock.avl; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.InetAddress; +import java.net.Socket; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.List; +import java.util.TimeZone; + +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.transitclock.applications.Core; +import org.transitclock.db.structs.AvlReport; +import org.transitclock.utils.IntervalTimer; +import org.transitclock.utils.Time; + +import com.esri.core.geometry.Point; + +public class BarefootPlaybackModule extends PlaybackModule { + private static final Logger logger = + LoggerFactory.getLogger(PlaybackModule.class); + + public BarefootPlaybackModule(String agencyId) { + super(agencyId); + + } + + @Override + public void run() { + + IntervalTimer timer = new IntervalTimer(); + // Keep running as long as not trying to access in the future. + + while (dbReadBeginTime < System.currentTimeMillis() && (playbackEndTimeStr.getValue().length()==0 || dbReadBeginTime avlReports = getBatchOfAvlReportsFromDb(); + + // Process the AVL Reports read in. + long last_avl_time=-1; + for (AvlReport avlReport : avlReports) { + logger.info("Processing avlReport={}", avlReport); + + // Update the Core SystemTime to use this AVL time + Core.getInstance().setSystemTime(avlReport.getTime()); + + DateFormat estFormat = new SimpleDateFormat("yyyyMMddHHmmss"); + TimeZone estTime = TimeZone.getTimeZone("EST"); + estFormat.setTimeZone(estTime); + + TimeZone gmtTime = TimeZone.getTimeZone("GMT"); + DateFormat gmtFormat = new SimpleDateFormat("yyyyMMddHHmmss"); + gmtFormat.setTimeZone(gmtTime); + + String estDate=estFormat.format(avlReport.getTime()); + String gmtDate=gmtFormat.format(avlReport.getTime()); + + + if(playbackRealtime.getValue()==true) + { + if(last_avl_time>-1) + { + try { + // only sleep if values less than 10 minutes. This is to allow it skip days/hours of missing data. + if((avlReport.getTime()-last_avl_time)<600000) + { + Thread.sleep(avlReport.getTime()-last_avl_time); + } + last_avl_time=avlReport.getTime(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + }else + { + last_avl_time=avlReport.getTime(); + } + } + // Send avl to barefoot server. + sendUpdate(avlReport); + + } + } + // logging here as the rest is database access dependent. + logger.info("Processed AVL from playbackStartTimeStr:{} to playbackEndTimeStr:{} in {} secs.",playbackStartTimeStr,playbackEndTimeStr, Time.secondsStr(timer.elapsedMsec())); + + + // Wait for database queue to be emptied before exiting. + while(Core.getInstance().getDbLogger().queueSize()>0) + { + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + + } + } + + + logger.info("Read in AVL in playback mode all the way up to current " + + "time so done. Exiting."); + + System.exit(0); + } + public void sendUpdate(AvlReport avlReport) { + try { + JSONObject report = new JSONObject(); + + InetAddress host = InetAddress.getLocalHost(); + + int port = 1234; + + report.put("id", avlReport.getVehicleId()); + + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ"); + + report.put("time", df.format(avlReport.getDate())); + + Point point = new Point(); + point.setX(avlReport.getLon()); + point.setY(avlReport.getLat()); + + report.put("point", "POINT(" + avlReport.getLon() + " " + avlReport.getLat() + ")"); + // report.put("point", GeometryEngine.geometryToGeoJson(point)); + + sendBareFootSample(host, port, report); + + } catch (Exception e) { + logger.error("Problem when sending samples to barefoot.", e); + } + } + + private void sendBareFootSample(InetAddress host, int port, JSONObject sample) throws Exception { + int trials = 120; + int timeout = 500; + Socket client = null; + // TODO Will need to leave socket open. + while (client == null || !client.isConnected()) { + try { + client = new Socket(host, port); + } catch (IOException e) { + Thread.sleep(timeout); + + if (trials == 0) { + logger.error(e.getMessage()); + client.close(); + throw new IOException(); + } else { + trials -= 1; + } + } + } + PrintWriter writer = new PrintWriter(client.getOutputStream()); + BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream())); + writer.println(sample.toString()); + writer.flush(); + + String code = reader.readLine(); + if (!code.equals("SUCCESS")) { + throw new Exception("Barefoot server did not respond with SUCCESS. Code="+code); + } + } +} diff --git a/transitclock/src/main/java/org/transitclock/avl/PlaybackModule.java b/transitclock/src/main/java/org/transitclock/avl/PlaybackModule.java index 451114488..e1490f6e0 100644 --- a/transitclock/src/main/java/org/transitclock/avl/PlaybackModule.java +++ b/transitclock/src/main/java/org/transitclock/avl/PlaybackModule.java @@ -50,7 +50,7 @@ public class PlaybackModule extends Module { private final static long DB_POLLING_TIME_MSEC = 5 * Time.MS_PER_MIN; // For keeping track of beginning of timespan for doing query - private long dbReadBeginTime; + protected long dbReadBeginTime; /*********** Configurable Parameters for this module ***********/ private static String getPlaybackVehicleId() { @@ -64,17 +64,17 @@ private static String getPlaybackVehicleId() { private static String getPlaybackStartTimeStr() { return playbackStartTimeStr.getValue(); } - private static StringConfigValue playbackStartTimeStr = + protected static StringConfigValue playbackStartTimeStr = new StringConfigValue("transitclock.avl.playbackStartTime", "", "Date and time of when to start the playback."); - private static StringConfigValue playbackEndTimeStr = + protected static StringConfigValue playbackEndTimeStr = new StringConfigValue("transitclock.avl.playbackEndTime", "", "Date and time of when to end the playback."); - private static BooleanConfigValue playbackRealtime = + protected static BooleanConfigValue playbackRealtime = new BooleanConfigValue("transitclock.avl.playbackRealtime", false, "Playback at normal time speed rather than as fast as possible."); @@ -96,7 +96,7 @@ public PlaybackModule(String agencyId) { || getPlaybackVehicleId().isEmpty() || getPlaybackStartTimeStr() == null || getPlaybackStartTimeStr().isEmpty()) { - logger.warn("Parameters not set. See log file for details. Exiting."); + logger.warn("Parameters not set. See log file for details."); } // Initialize the dbReadBeingTime member @@ -129,7 +129,7 @@ private static long parsePlaybackStartTime(String playbackStartTimeStr) { return -1; } } - private static long parsePlaybackEndTime(String playbackEndTimeStr) { + protected static long parsePlaybackEndTime(String playbackEndTimeStr) { try { long playbackEndTime = Time.parse(playbackEndTimeStr).getTime(); @@ -159,7 +159,7 @@ private static long parsePlaybackEndTime(String playbackEndTimeStr) { * Gets a batch of AVl data from the database * @return */ - private List getBatchOfAvlReportsFromDb() { + protected List getBatchOfAvlReportsFromDb() { // The times that should be reading data for long start = dbReadBeginTime; long end = dbReadBeginTime + DB_POLLING_TIME_MSEC; diff --git a/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarBarefootAVLModule.java b/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarBarefootAVLModule.java index 9b5accadb..04c789b57 100644 --- a/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarBarefootAVLModule.java +++ b/transitclock/src/main/java/org/transitclock/custom/traccar/TraccarBarefootAVLModule.java @@ -57,7 +57,7 @@ public class TraccarBarefootAVLModule extends TraccarAVLModule { public TraccarBarefootAVLModule(String agencyId) throws Throwable { super(agencyId); } - + @Override protected void forwardAvlReports(Collection avlReportsReadIn) { for(AvlReport avlReport:avlReportsReadIn) { From 762139668acdfd46e14e91fdd384a884e640d30a Mon Sep 17 00:00:00 2001 From: vperez Date: Thu, 21 Jun 2018 15:21:38 -0400 Subject: [PATCH 19/81] FIX #63. --- .../java/org/transitclock/api/gtfsRealtime/GtfsRtTripFeed.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transitclockApi/src/main/java/org/transitclock/api/gtfsRealtime/GtfsRtTripFeed.java b/transitclockApi/src/main/java/org/transitclock/api/gtfsRealtime/GtfsRtTripFeed.java index e8bb19990..3d1eff9dc 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/gtfsRealtime/GtfsRtTripFeed.java +++ b/transitclockApi/src/main/java/org/transitclock/api/gtfsRealtime/GtfsRtTripFeed.java @@ -173,7 +173,7 @@ private TripUpdate createTripUpdate(List predsForTrip) { // precedence over SCHED_BASED_PRED_UNCERTAINTY_VALUE. if (pred.isLateAndSubsequentTripSoMarkAsUncertain()) stopTimeEvent.setUncertainty(LATE_AND_SUBSEQUENT_TRIP_UNCERTAINTY_VALUE); - + // If vehicle not making forward progress then set uncertainty to // special value so that client can tell. Takes precedence over // LATE_AND_SUBSEQUENT_TRIP_UNCERTAINTY_VALUE. @@ -184,6 +184,7 @@ private TripUpdate createTripUpdate(List predsForTrip) { stopTimeUpdate.setArrival(stopTimeEvent); else stopTimeUpdate.setDeparture(stopTimeEvent); + //The relationship should always be SCHEDULED if departure or arrival time is given. stopTimeUpdate.setScheduleRelationship(ScheduleRelationship.SCHEDULED); From 203710a57e59644e94b4a4f66f6e3b10d8ed9d36 Mon Sep 17 00:00:00 2001 From: scrudden Date: Fri, 22 Jun 2018 17:48:54 +0100 Subject: [PATCH 20/81] Change default location for email config file. --- .../src/main/java/org/transitclock/utils/EmailSender.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transitclock/src/main/java/org/transitclock/utils/EmailSender.java b/transitclock/src/main/java/org/transitclock/utils/EmailSender.java index 9fff85722..ae35e88eb 100644 --- a/transitclock/src/main/java/org/transitclock/utils/EmailSender.java +++ b/transitclock/src/main/java/org/transitclock/utils/EmailSender.java @@ -56,7 +56,7 @@ public class EmailSender { private static StringConfigValue emailConfigFile = new StringConfigValue("transitclock.utils.emailConfigFile", - "/home/ec2-user/transitimeScripts/emailConfig.txt", + "/usr/local/transitclock/config/emailconfig.properties", "Specifies name of configuration file used for sending " + "out e-mails."); From 38be5a2208403c950d50ec10bb95d126da1e2fa3 Mon Sep 17 00:00:00 2001 From: scrudden Date: Tue, 26 Jun 2018 19:16:33 +0100 Subject: [PATCH 21/81] Set calendar to date passed in, rather than leaving as current system time. --- .../src/main/java/org/transitclock/core/ServiceUtils.java | 1 + 1 file changed, 1 insertion(+) diff --git a/transitclock/src/main/java/org/transitclock/core/ServiceUtils.java b/transitclock/src/main/java/org/transitclock/core/ServiceUtils.java index e91a835cd..a7be219c4 100755 --- a/transitclock/src/main/java/org/transitclock/core/ServiceUtils.java +++ b/transitclock/src/main/java/org/transitclock/core/ServiceUtils.java @@ -188,6 +188,7 @@ public List getServiceIdsForDay(Date epochTime) { private Date getStartOfDay(Date epochTime) { java.util.Calendar c = java.util.Calendar.getInstance(); + c.setTime(epochTime); c.set(java.util.Calendar.HOUR, 0); c.set(java.util.Calendar.MINUTE, 0); c.set(java.util.Calendar.SECOND, 0); From 3667e85876e2371d9f3651b430be4ca27fef6e4b Mon Sep 17 00:00:00 2001 From: scrudden Date: Tue, 26 Jun 2018 20:51:23 +0100 Subject: [PATCH 22/81] Check for null when looking up trips and stops. Should never occur but seen it when filtering by route. --- .../dataCache/StopArrivalDepartureCache.java | 63 +++++++++++-------- .../core/dataCache/TripDataHistoryCache.java | 56 ++++++++++------- .../FrequencyBasedHistoricalAverageCache.java | 11 +++- .../ScheduleBasedHistoricalAverageCache.java | 2 +- .../kalman/KalmanPredictionResult.java | 4 ++ 5 files changed, 83 insertions(+), 53 deletions(-) diff --git a/transitclock/src/main/java/org/transitclock/core/dataCache/StopArrivalDepartureCache.java b/transitclock/src/main/java/org/transitclock/core/dataCache/StopArrivalDepartureCache.java index 358533b61..ae76803b2 100755 --- a/transitclock/src/main/java/org/transitclock/core/dataCache/StopArrivalDepartureCache.java +++ b/transitclock/src/main/java/org/transitclock/core/dataCache/StopArrivalDepartureCache.java @@ -21,6 +21,7 @@ import org.slf4j.LoggerFactory; import org.transitclock.config.IntegerConfigValue; import org.transitclock.db.structs.ArrivalDeparture; +import org.transitclock.gtfs.GtfsData; import org.transitclock.utils.Time; /** @@ -138,31 +139,37 @@ synchronized public StopArrivalDepartureCacheKey putArrivalDeparture(ArrivalDepa date.set(Calendar.SECOND, 0); date.set(Calendar.MILLISECOND, 0); - StopArrivalDepartureCacheKey key = new StopArrivalDepartureCacheKey(arrivalDeparture.getStop().getId(), - date.getTime()); - - List list = null; - - Element result = cache.get(key); - - if (result != null && result.getObjectValue() != null) { - list = (List) result.getObjectValue(); - cache.remove(key); - } else { - list = new ArrayList(); + if(arrivalDeparture.getStop()!=null) + { + StopArrivalDepartureCacheKey key = new StopArrivalDepartureCacheKey(arrivalDeparture.getStop().getId(), + date.getTime()); + + List list = null; + + Element result = cache.get(key); + + if (result != null && result.getObjectValue() != null) { + list = (List) result.getObjectValue(); + cache.remove(key); + } else { + list = new ArrayList(); + } + + list.add(arrivalDeparture); + + Collections.sort(list, new ArrivalDepartureComparator()); + + // This is java 1.8 list.sort(new ArrivalDepartureComparator()); + + Element arrivalDepartures = new Element(key, Collections.synchronizedList(list)); + + cache.put(arrivalDepartures); + + return key; + }else + { + return null; } - - list.add(arrivalDeparture); - - Collections.sort(list, new ArrivalDepartureComparator()); - - // This is java 1.8 list.sort(new ArrivalDepartureComparator()); - - Element arrivalDepartures = new Element(key, Collections.synchronizedList(list)); - - cache.put(arrivalDepartures); - - return key; } private static Iterable emptyIfNull(Iterable iterable) { @@ -174,9 +181,15 @@ public void populateCacheFromDb(Session session, Date startDate, Date endDate) { @SuppressWarnings("unchecked") List results = criteria.add(Restrictions.between("time", startDate, endDate)).list(); + + for (ArrivalDeparture result : results) { - StopArrivalDepartureCache.getInstance().putArrivalDeparture(result); + // TODO this might be better done in the database. + if(GtfsData.routeNotFiltered(result.getRouteId())) + { + StopArrivalDepartureCache.getInstance().putArrivalDeparture(result); + } } } diff --git a/transitclock/src/main/java/org/transitclock/core/dataCache/TripDataHistoryCache.java b/transitclock/src/main/java/org/transitclock/core/dataCache/TripDataHistoryCache.java index ffb8e08b7..c978e6870 100755 --- a/transitclock/src/main/java/org/transitclock/core/dataCache/TripDataHistoryCache.java +++ b/transitclock/src/main/java/org/transitclock/core/dataCache/TripDataHistoryCache.java @@ -30,6 +30,7 @@ import org.transitclock.db.structs.Block; import org.transitclock.db.structs.Trip; import org.transitclock.gtfs.DbConfig; +import org.transitclock.gtfs.GtfsData; import org.transitclock.utils.Time; /** @@ -161,26 +162,30 @@ synchronized public TripKey putArrivalDeparture(ArrivalDeparture arrivalDepartur Trip trip=dbConfig.getTrip(arrivalDeparture.getTripId()); - tripKey = new TripKey(arrivalDeparture.getTripId(), - nearestDay, - trip.getStartTime()); - - List list = null; - - Element result = cache.get(tripKey); - - if (result != null && result.getObjectValue() != null) { - list = (List) result.getObjectValue(); - cache.remove(tripKey); - } else { - list = new ArrayList(); + if(trip!=null) + { + + tripKey = new TripKey(arrivalDeparture.getTripId(), + nearestDay, + trip.getStartTime()); + + List list = null; + + Element result = cache.get(tripKey); + + if (result != null && result.getObjectValue() != null) { + list = (List) result.getObjectValue(); + cache.remove(tripKey); + } else { + list = new ArrayList(); + } + + list.add(arrivalDeparture); + + Element arrivalDepartures = new Element(tripKey, Collections.synchronizedList(list)); + + cache.put(arrivalDepartures); } - - list.add(arrivalDeparture); - - Element arrivalDepartures = new Element(tripKey, Collections.synchronizedList(list)); - - cache.put(arrivalDepartures); } @@ -194,13 +199,16 @@ public void populateCacheFromDb(Session session, Date startDate, Date endDate) @SuppressWarnings("unchecked") List results=criteria.add(Restrictions.between("time", startDate, endDate)).list(); - for(ArrivalDeparture result : results) - { - TripDataHistoryCache.getInstance().putArrivalDeparture(result); + for(ArrivalDeparture result : results) + { + // TODO this might be better done in the database. + if(GtfsData.routeNotFiltered(result.getRouteId())) + { + TripDataHistoryCache.getInstance().putArrivalDeparture(result); + } } } - - + static public ArrivalDeparture findPreviousArrivalEvent(List arrivalDepartures,ArrivalDeparture current) { Collections.sort(arrivalDepartures, new ArrivalDepartureComparator()); diff --git a/transitclock/src/main/java/org/transitclock/core/dataCache/frequency/FrequencyBasedHistoricalAverageCache.java b/transitclock/src/main/java/org/transitclock/core/dataCache/frequency/FrequencyBasedHistoricalAverageCache.java index 5ae9d3068..2900f8999 100755 --- a/transitclock/src/main/java/org/transitclock/core/dataCache/frequency/FrequencyBasedHistoricalAverageCache.java +++ b/transitclock/src/main/java/org/transitclock/core/dataCache/frequency/FrequencyBasedHistoricalAverageCache.java @@ -30,6 +30,7 @@ import org.transitclock.db.structs.ArrivalDeparture; import org.transitclock.db.structs.Trip; import org.transitclock.gtfs.DbConfig; +import org.transitclock.gtfs.GtfsData; /** * @author Sean Óg Crudden * This class is to hold the historical average for frequency based services. It puts them in buckets that represent increments of time. The start time of the trip is used to decide which @@ -151,7 +152,7 @@ synchronized public void putArrivalDeparture(ArrivalDeparture arrivalDeparture) Trip trip=dbConfig.getTrip(arrivalDeparture.getTripId()); - if(trip.isNoSchedule()) + if(trip!=null && trip.isNoSchedule()) { Integer time=secondsFromMidnight(arrivalDeparture.getDate(), 2); @@ -294,8 +295,12 @@ public void populateCacheFromDb(Session session, Date startDate, Date endDate) List results=criteria.add(Restrictions.between("time", startDate, endDate)).list(); Collections.sort(results, new ArrivalDepartureComparator()); for(ArrivalDeparture result : results) - { - FrequencyBasedHistoricalAverageCache.getInstance().putArrivalDeparture(result); + { + // TODO this might be better done in the database. + if(GtfsData.routeNotFiltered(result.getRouteId())) + { + FrequencyBasedHistoricalAverageCache.getInstance().putArrivalDeparture(result); + } } } public static int round(double i, int v){ diff --git a/transitclock/src/main/java/org/transitclock/core/dataCache/scheduled/ScheduleBasedHistoricalAverageCache.java b/transitclock/src/main/java/org/transitclock/core/dataCache/scheduled/ScheduleBasedHistoricalAverageCache.java index 0f43bd7b8..1a3701678 100644 --- a/transitclock/src/main/java/org/transitclock/core/dataCache/scheduled/ScheduleBasedHistoricalAverageCache.java +++ b/transitclock/src/main/java/org/transitclock/core/dataCache/scheduled/ScheduleBasedHistoricalAverageCache.java @@ -115,7 +115,7 @@ synchronized public void putArrivalDeparture(ArrivalDeparture arrivalDeparture) Trip trip=dbConfig.getTrip(arrivalDeparture.getTripId()); - if(!trip.isNoSchedule()) + if(trip!=null && !trip.isNoSchedule()) { logger.debug("Putting :"+arrivalDeparture.toString() + " in HistoricalAverageCache cache."); diff --git a/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionResult.java b/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionResult.java index e3fd0b046..70d193edc 100755 --- a/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionResult.java +++ b/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionResult.java @@ -1,6 +1,10 @@ package org.transitclock.core.predictiongenerator.kalman; public class KalmanPredictionResult { + @Override + public String toString() { + return "KalmanPredictionResult [duration=" + duration + ", filterError=" + filterError + "]"; + } double duration; double filterError; public KalmanPredictionResult(double result, double filterError) { From fd8972fe25e7ad7ed5ede12aee865831fbe561a0 Mon Sep 17 00:00:00 2001 From: scrudden Date: Tue, 26 Jun 2018 21:05:25 +0100 Subject: [PATCH 23/81] Set default min days. --- .../core/dataCache/KalmanErrorCacheKey.java | 22 ++++++++++++++++++- .../dataCache/StopArrivalDepartureCache.java | 0 .../kalman/KalmanPredictionGeneratorImpl.java | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) mode change 100755 => 100644 transitclock/src/main/java/org/transitclock/core/dataCache/StopArrivalDepartureCache.java diff --git a/transitclock/src/main/java/org/transitclock/core/dataCache/KalmanErrorCacheKey.java b/transitclock/src/main/java/org/transitclock/core/dataCache/KalmanErrorCacheKey.java index f76df8efd..4346c7ff6 100755 --- a/transitclock/src/main/java/org/transitclock/core/dataCache/KalmanErrorCacheKey.java +++ b/transitclock/src/main/java/org/transitclock/core/dataCache/KalmanErrorCacheKey.java @@ -24,20 +24,40 @@ public void setStopPathIndex(Integer stopPathIndex) { private String tripId; private Integer stopPathIndex; + // The vehicleId is only used for debug purposed we know log which vehicle set the error value + private String vehiceId; + + public String getVehiceId() { + return vehiceId; + } + + public void setVehiceId(String vehiceId) { + this.vehiceId = vehiceId; + } + /** * Needs to be serializable to add to cache */ private static final long serialVersionUID = 5029823633051153716L; + public KalmanErrorCacheKey(Indices indices, String vehicleId) { + super(); + + this.tripId=indices.getBlock().getTrip(indices.getTripIndex()).getId(); + this.stopPathIndex=indices.getStopPathIndex(); + this.vehiceId=vehicleId; + + } public KalmanErrorCacheKey(Indices indices) { super(); this.tripId=indices.getBlock().getTrip(indices.getTripIndex()).getId(); this.stopPathIndex=indices.getStopPathIndex(); + + } - @Override public String toString() { return "KalmanErrorCacheKey [tripId=" + tripId + ", stopPathIndex=" + stopPathIndex + "]"; diff --git a/transitclock/src/main/java/org/transitclock/core/dataCache/StopArrivalDepartureCache.java b/transitclock/src/main/java/org/transitclock/core/dataCache/StopArrivalDepartureCache.java old mode 100755 new mode 100644 diff --git a/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java b/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java index 0d3dc591a..76fdb7854 100755 --- a/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java +++ b/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java @@ -43,7 +43,7 @@ public class KalmanPredictionGeneratorImpl extends HistoricalAveragePredictionGe * historical value. */ private static final IntegerConfigValue minKalmanDays = new IntegerConfigValue( - "transitclock.prediction.data.kalman.mindays", new Integer(1), + "transitclock.prediction.data.kalman.mindays", new Integer(3), "Min number of days trip data that needs to be available before Kalman prediciton is used instead of default transiTime prediction."); private static final IntegerConfigValue maxKalmanDays = new IntegerConfigValue( From 767bb793a313459b437bbb01e62dc7c8a42b178d Mon Sep 17 00:00:00 2001 From: scrudden Date: Fri, 29 Jun 2018 18:26:15 +0100 Subject: [PATCH 24/81] Fix for issue #66 --- .../org/transitclock/core/HeadwayDetails.java | 15 ++++-- .../core/PredictionGenerator.java | 46 ++++++++++--------- .../kalman/KalmanPredictionGeneratorImpl.java | 5 +- 3 files changed, 39 insertions(+), 27 deletions(-) diff --git a/transitclock/src/main/java/org/transitclock/core/HeadwayDetails.java b/transitclock/src/main/java/org/transitclock/core/HeadwayDetails.java index 6d1aa164c..973ee0142 100644 --- a/transitclock/src/main/java/org/transitclock/core/HeadwayDetails.java +++ b/transitclock/src/main/java/org/transitclock/core/HeadwayDetails.java @@ -1,6 +1,5 @@ package org.transitclock.core; -import org.transitclock.db.structs.ArrivalDeparture; import org.transitclock.ipc.data.IpcPrediction; /** @@ -26,11 +25,19 @@ public HeadwayDetails(IpcPrediction vehicleBehindPrediction, IpcPrediction vehic super(); this.vehicleBehindPrediction = vehicleBehindPrediction; this.vehicleAheadPrediction = vehicleAheadPrediction; - if ((vehicleBehindPrediction != null && vehicleAheadPrediction != null - && vehicleBehindPrediction.getStopId().equals(vehicleAheadPrediction.getStopId()) - && (!vehicleBehindPrediction.getVehicleId().equals(vehicleAheadPrediction.getVehicleId())))) { + + if(vehicleBehindPrediction == null || vehicleAheadPrediction == null) + { throw new Exception("Need two predictions for same stop for different vehicles to calculate headway."); } + if(!vehicleBehindPrediction.getStopId().equals(vehicleAheadPrediction.getStopId())) + { + throw new Exception("Cannot calculate headway from predictions for two different stops."); + } + if(vehicleBehindPrediction.getVehicleId().equals(vehicleAheadPrediction.getVehicleId())) + { + throw new Exception("Cannot calculate headway from two prediction for the same vehicle."); + } } public long getHeadway() { diff --git a/transitclock/src/main/java/org/transitclock/core/PredictionGenerator.java b/transitclock/src/main/java/org/transitclock/core/PredictionGenerator.java index 2311a9ea0..deefcf915 100644 --- a/transitclock/src/main/java/org/transitclock/core/PredictionGenerator.java +++ b/transitclock/src/main/java/org/transitclock/core/PredictionGenerator.java @@ -304,7 +304,7 @@ protected static Iterable emptyIfNull(Iterable iterable) { public long getHeadway(Indices indices, AvlReport avlReport, VehicleState vehicleState) throws Exception { - // This is a WIP to get a prediction headway at the stop. + // This is a WIP to get a predicted headway at the stop. List masterList=new ArrayList(); List predicitonsForRouteStopDest = PredictionDataCache.getInstance().getPredictions(vehicleState.getRouteId(), vehicleState.getTrip().getDirectionId(), indices.getTrip().getStopPath(indices.getStopPathIndex()).getStopId(), 5); @@ -315,31 +315,35 @@ public long getHeadway(Indices indices, AvlReport avlReport, VehicleState vehicl { masterList.add(prediction); } - } - Collections.sort(masterList, new PredictionComparator()); - int index=0; - boolean found=false; - for(IpcPrediction prediction:masterList) + } + // No such thing as headway if only one vehicle. + if(masterList.size()>1) { - /* find this vehicles prediction for this stop and the last ones prediction. */ - if(prediction.getVehicleId().equals(vehicleState.getVehicleId())) + Collections.sort(masterList, new PredictionComparator()); + int index=0; + boolean found=false; + for(IpcPrediction prediction:masterList) { - found=true; - break; + /* find this vehicles prediction for this stop and the last ones prediction. */ + if(prediction.getVehicleId().equals(vehicleState.getVehicleId())) + { + found=true; + break; + } + index++; } - index++; - } - if(found&&index>0) - { - IpcPrediction currentVehiclePrediction = masterList.get(index); - IpcPrediction lastVehiclePrediction = masterList.get(index-1); - /* now the difference between these will give the predicted headway. */ - long headway=currentVehiclePrediction.getPredictionTime()-lastVehiclePrediction.getPredictionTime(); - if(headway>0) + if(found&&index>0) { - return new HeadwayDetails(currentVehiclePrediction, lastVehiclePrediction).getHeadway(); + IpcPrediction currentVehiclePrediction = masterList.get(index); + IpcPrediction lastVehiclePrediction = masterList.get(index-1); + /* now the difference between these will give the predicted headway. */ + long headway=currentVehiclePrediction.getPredictionTime()-lastVehiclePrediction.getPredictionTime(); + if(headway>0) + { + return new HeadwayDetails(currentVehiclePrediction, lastVehiclePrediction).getHeadway(); + } } - } + } return -1; } diff --git a/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java b/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java index 76fdb7854..793890d8e 100755 --- a/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java +++ b/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java @@ -13,6 +13,7 @@ import org.transitclock.config.DoubleConfigValue; import org.transitclock.config.IntegerConfigValue; import org.transitclock.core.Indices; +import org.transitclock.core.PredictionGeneratorDefaultImpl; import org.transitclock.core.TravelTimeDetails; import org.transitclock.core.VehicleState; import org.transitclock.core.dataCache.ArrivalDepartureComparator; @@ -34,10 +35,10 @@ * @author Sean Óg Crudden This is a prediction generator that uses a Kalman * filter to provide predictions. It uses historical average while waiting on enough data to support a Kalman filter. */ -public class KalmanPredictionGeneratorImpl extends HistoricalAveragePredictionGeneratorImpl +public class KalmanPredictionGeneratorImpl extends PredictionGeneratorDefaultImpl implements PredictionComponentElementsGenerator { - private String alternative="HistoricalAveragePredictionGeneratorImpl"; + private String alternative="PredictionGeneratorDefaultImpl"; /* * TODO I think this needs to be a minimum of three and if just two will use * historical value. From 8d5479bbab774d1a079ff516cf4e594458e7f7af Mon Sep 17 00:00:00 2001 From: scrudden Date: Sat, 30 Jun 2018 14:29:39 +0100 Subject: [PATCH 25/81] Use Kalman to predict partial stop paths. --- .../kalman/KalmanPredictionGeneratorImpl.java | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java b/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java index 793890d8e..7858eee43 100755 --- a/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java +++ b/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java @@ -10,10 +10,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.transitclock.applications.Core; +import org.transitclock.config.BooleanConfigValue; import org.transitclock.config.DoubleConfigValue; import org.transitclock.config.IntegerConfigValue; import org.transitclock.core.Indices; import org.transitclock.core.PredictionGeneratorDefaultImpl; +import org.transitclock.core.SpatialMatch; import org.transitclock.core.TravelTimeDetails; import org.transitclock.core.VehicleState; import org.transitclock.core.dataCache.ArrivalDepartureComparator; @@ -44,11 +46,11 @@ public class KalmanPredictionGeneratorImpl extends PredictionGeneratorDefaultImp * historical value. */ private static final IntegerConfigValue minKalmanDays = new IntegerConfigValue( - "transitclock.prediction.data.kalman.mindays", new Integer(3), + "transitclock.prediction.data.kalman.mindays", new Integer(2), "Min number of days trip data that needs to be available before Kalman prediciton is used instead of default transiTime prediction."); private static final IntegerConfigValue maxKalmanDays = new IntegerConfigValue( - "transitclock.prediction.data.kalman.maxdays", new Integer(3), + "transitclock.prediction.data.kalman.maxdays", new Integer(2), "Max number of historical days trips to include in Kalman prediction calculation."); private static final IntegerConfigValue maxKalmanDaysToSearch = new IntegerConfigValue( @@ -58,6 +60,13 @@ public class KalmanPredictionGeneratorImpl extends PredictionGeneratorDefaultImp private static final DoubleConfigValue initialErrorValue = new DoubleConfigValue( "transitclock.prediction.data.kalman.initialerrorvalue", new Double(100), "Initial Kalman error value to use to start filter."); + + /* May be better to use the default implementation as it splits things down into segments. */ + private static final BooleanConfigValue useKalmanForPartialStopPaths = new BooleanConfigValue ( + "transitclock.prediction.data.kalman.usekalmanforpartialstoppaths", new Boolean(true), + "Will use Kalman prediction to get to first stop of prediction." + ); + private static final Logger logger = LoggerFactory.getLogger(KalmanPredictionGeneratorImpl.class); @@ -171,6 +180,33 @@ public long getTravelTimeForPath(Indices indices, AvlReport avlReport, VehicleSt return super.getTravelTimeForPath(indices, avlReport, vehicleState); } + @Override + public long expectedTravelTimeFromMatchToEndOfStopPath(AvlReport avlReport, SpatialMatch match) { + + if(useKalmanForPartialStopPaths.getValue().booleanValue()) + { + VehicleStateManager vehicleStateManager = VehicleStateManager.getInstance(); + + VehicleState currentVehicleState = vehicleStateManager.getVehicleState(avlReport.getVehicleId()); + + long fulltime = this.getTravelTimeForPath(match.getIndices(), avlReport, currentVehicleState); + + double distanceAlongStopPath = match.getDistanceAlongStopPath(); + + double stopPathLength = + match.getStopPath().getLength(); + + long remainingtime = (long) (fulltime * ((stopPathLength-distanceAlongStopPath)/stopPathLength)); + + logger.debug("Using Kalman for first stop path {} with value {} instead of {}.", match.getIndices(), remainingtime, super.expectedTravelTimeFromMatchToEndOfStopPath(avlReport, match)); + + return remainingtime; + }else + { + return super.expectedTravelTimeFromMatchToEndOfStopPath(avlReport, match); + } + } + private Double lastVehiclePredictionError(KalmanErrorCache cache, Indices indices) { Double result = cache.getErrorValue(indices); if(result!=null) From 0d3e3a400d059f60dd3627e67e7aab58f5ec5e6e Mon Sep 17 00:00:00 2001 From: scrudden Date: Sat, 30 Jun 2018 17:25:30 +0100 Subject: [PATCH 26/81] reset min max for kalman to 3. --- .../kalman/KalmanPredictionGeneratorImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java b/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java index 7858eee43..24e054724 100755 --- a/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java +++ b/transitclock/src/main/java/org/transitclock/core/predictiongenerator/kalman/KalmanPredictionGeneratorImpl.java @@ -46,11 +46,11 @@ public class KalmanPredictionGeneratorImpl extends PredictionGeneratorDefaultImp * historical value. */ private static final IntegerConfigValue minKalmanDays = new IntegerConfigValue( - "transitclock.prediction.data.kalman.mindays", new Integer(2), + "transitclock.prediction.data.kalman.mindays", new Integer(3), "Min number of days trip data that needs to be available before Kalman prediciton is used instead of default transiTime prediction."); private static final IntegerConfigValue maxKalmanDays = new IntegerConfigValue( - "transitclock.prediction.data.kalman.maxdays", new Integer(2), + "transitclock.prediction.data.kalman.maxdays", new Integer(3), "Max number of historical days trips to include in Kalman prediction calculation."); private static final IntegerConfigValue maxKalmanDaysToSearch = new IntegerConfigValue( From d6efe937219f5d43f6f5adc71464499200a7fe07 Mon Sep 17 00:00:00 2001 From: scrudden Date: Wed, 4 Jul 2018 21:55:02 +0100 Subject: [PATCH 27/81] Remove transitime files left by merge and add cache config. --- .../src/main}/resources/cache.ccf | 3 +- .../transitime/avl/capmetro/AvlCsvReader.java | 46 ---- .../transitime/avl/capmetro/AvlCsvRecord.java | 125 --------- .../avl/capmetro/BatchCsvAvlFeedModule.java | 196 --------------- .../transitime/core/dataCache/ErrorCache.java | 20 -- .../core/dataCache/ErrorCacheFactory.java | 27 -- .../StopArrivalDepartureCacheFactory.java | 27 -- .../StopArrivalDepartureCacheInterface.java | 28 --- .../dataCache/ehcache/KalmanErrorCache.java | 130 ---------- .../ehcache/StopArrivalDepartureCache.java | 237 ------------------ .../core/dataCache/jcs/KalmanErrorCache.java | 78 ------ transitime/src/main/resources/cache.ccf | 29 --- .../org/transitime/cache/TestJCSCache.java | 30 --- 13 files changed, 1 insertion(+), 975 deletions(-) rename {transitime/src/test => transitclock/src/main}/resources/cache.ccf (96%) delete mode 100644 transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvReader.java delete mode 100644 transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvRecord.java delete mode 100644 transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java delete mode 100644 transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java delete mode 100644 transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java delete mode 100644 transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheFactory.java delete mode 100644 transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheInterface.java delete mode 100755 transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java delete mode 100755 transitime/src/main/java/org/transitime/core/dataCache/ehcache/StopArrivalDepartureCache.java delete mode 100755 transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java delete mode 100644 transitime/src/main/resources/cache.ccf delete mode 100644 transitime/src/test/java/org/transitime/cache/TestJCSCache.java diff --git a/transitime/src/test/resources/cache.ccf b/transitclock/src/main/resources/cache.ccf similarity index 96% rename from transitime/src/test/resources/cache.ccf rename to transitclock/src/main/resources/cache.ccf index 47861c9f4..d0d39e407 100644 --- a/transitime/src/test/resources/cache.ccf +++ b/transitclock/src/main/resources/cache.ccf @@ -25,5 +25,4 @@ jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000 jcs.auxiliary.DC.attributes.MaxKeySize=10000 jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000 jcs.auxiliary.DC.attributes.OptimizeOnShutdown=true -jcs.auxiliary.DC.attributes.DiskLimitType=COUNT - +jcs.auxiliary.DC.attributes.DiskLimitType=COUNT \ No newline at end of file diff --git a/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvReader.java b/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvReader.java deleted file mode 100644 index 35b123083..000000000 --- a/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvReader.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of Transitime.org - * - * Transitime.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License (GPL) as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * Transitime.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Transitime.org . If not, see . - */ - -package org.transitime.avl.capmetro; - -import java.text.ParseException; - -import org.apache.commons.csv.CSVRecord; -import org.transitime.db.structs.AvlReport; -import org.transitime.utils.csv.CsvBaseReader; - -/** - * For reading in AVL data from a CSV file. - * - * @author SkiBu Smith - * - */ -public class AvlCsvReader extends CsvBaseReader { - - /********************** Member Functions **************************/ - - public AvlCsvReader(String fileName) { - super(fileName); - } - - @Override - public AvlReport handleRecord(CSVRecord record, boolean supplemental) - throws ParseException { - return AvlCsvRecord.getAvlReport(record, getFileName()); - } - -} diff --git a/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvRecord.java b/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvRecord.java deleted file mode 100644 index cbdfada3e..000000000 --- a/transitime/src/main/java/org/transitime/avl/capmetro/AvlCsvRecord.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * This file is part of Transitime.org - * - * Transitime.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License (GPL) as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * Transitime.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Transitime.org . If not, see . - */ - -package org.transitime.avl.capmetro; - -import org.apache.commons.csv.CSVRecord; -import org.transitime.db.structs.AvlReport; -import org.transitime.db.structs.AvlReport.AssignmentType; -import org.transitime.utils.Time; -import org.transitime.utils.csv.CsvBase; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; - -/** - * Represents a single record in a CSV file containing AVL data from CapMetrics. - * - * https://github.com/scascketta/CapMetrics - * - * @author SkiBu Smith - * - */ -public class AvlCsvRecord extends CsvBase { - - /********************** Member Functions **************************/ - - private AvlCsvRecord(CSVRecord record, String fileName) { - super(record, false, fileName); - } - - /** - * Returns AvlReport that the line in the CSV file represents. - * - * @param record - * @param fileName - * @return AvlReport, or null if could not be parsed. - */ - public static AvlReport getAvlReport(CSVRecord record, String fileName) - throws ParseException { - AvlCsvRecord avlCsvRecord = new AvlCsvRecord(record, fileName); - - // Obtain the required values - String vehicleId = avlCsvRecord.getRequiredValue(record, "vehicle_id"); - - String timeStr = avlCsvRecord.getRequiredValue(record, "timestamp"); - - DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX"); - - // Process time - long time = 0L; - - time=dateFormatter.parse(timeStr).getTime(); - - String latStr = avlCsvRecord.getRequiredValue(record, "latitude"); - - double lat=Double.NaN; - try { - lat = Double.parseDouble(latStr); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - String lonStr = avlCsvRecord.getRequiredValue(record, "longitude"); - double lon = Double.parseDouble(lonStr); - - String speedStr = avlCsvRecord.getOptionalValue(record, "speed"); - float speed = speedStr == null ? Float.NaN : Float.parseFloat(speedStr); - - String headingStr = avlCsvRecord.getOptionalValue(record, "heading"); - float heading = headingStr == null ? - Float.NaN : Float.parseFloat(headingStr); - - // Obtain the optional values - String leadVehicleId = avlCsvRecord.getOptionalValue(record, - "leadVehicleId"); - String driverId = - avlCsvRecord.getOptionalValue(record, "driverId"); - String licensePlate = avlCsvRecord.getOptionalValue(record, - "licensePlate"); - - String passengerFullnessStr = - avlCsvRecord.getOptionalValue(record, "passengerFullness"); - float passengerFullness = passengerFullnessStr==null ? - Float.NaN : Float.parseFloat(passengerFullnessStr); - - String passengerCountStr = - avlCsvRecord.getOptionalValue(record, "passengerCount"); - Integer passengerCount = passengerCountStr==null ? - null : Integer.parseInt(passengerCountStr); - - // Create the avlReport - AvlReport avlReport = - new AvlReport(vehicleId, time, lat, lon, speed, heading, "CSV", - leadVehicleId, driverId, licensePlate, passengerCount, - passengerFullness); - - // Assignment info - String assignmentId = - avlCsvRecord.getOptionalValue(record, "trip_id"); - - AssignmentType assignmentType = AssignmentType.TRIP_ID;; - - avlReport.setAssignment(assignmentId, assignmentType); - - - return avlReport; - } - -} diff --git a/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java b/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java deleted file mode 100644 index 7fa1aa37f..000000000 --- a/transitime/src/main/java/org/transitime/avl/capmetro/BatchCsvAvlFeedModule.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * This file is part of Transitime.org - * - * Transitime.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License (GPL) as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * Transitime.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Transitime.org . If not, see . - */ - -package org.transitime.avl.capmetro; - -import java.util.Calendar; -import java.util.List; -import java.util.regex.Pattern; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.transitime.applications.Core; -import org.transitime.config.BooleanConfigValue; -import org.transitime.config.StringConfigValue; -import org.transitime.core.AvlProcessor; -import org.transitime.db.structs.AvlReport; -import org.transitime.db.structs.Trip; -import org.transitime.gtfs.DbConfig; -import org.transitime.modules.Module; -import org.transitime.utils.Time; - -/** - * For reading in a batch of AVL data in CSV format and processing it. It only - * reads a single batch of data, unlike the usual AVL modules that continuously - * read data. This module is useful for debugging because can relatively easily - * create a plain text CSV file of AVL data and see what the code does. - * - * - * @author SkiBu Smith - * - */ -public class BatchCsvAvlFeedModule extends Module { - - // For running in real time - private long lastAvlReportTimestamp = -1; - - /*********** Configurable Parameters for this module ***********/ - private static String getCsvAvlFeedFileName() { - return csvAvlFeedFileName.getValue(); - } - - private static StringConfigValue csvAvlFeedFileName = new StringConfigValue("transitime.avl.csvAvlFeedFileName", - "https://github.com/scascketta/CapMetrics/blob/master/data/vehicle_positions/2017-10-04.csv?raw=true", - "The name of the CSV file containing AVL data to process."); - - private static BooleanConfigValue processInRealTime = new BooleanConfigValue("transitime.avl.processInRealTime", - false, - "For when getting batch of AVL data from a CSV file. " - + "When true then when reading in do at the same speed as " - + "when the AVL was created. Set to false it you just want " + "to read in as fast as possible."); - - /****************** Logging **************************************/ - private static StringConfigValue routeIdFilterRegEx = new StringConfigValue("transitime.gtfs.routeIdFilterRegEx", - null, // Default of null means don't do any filtering - "Route is included only if route_id matches the this regular " - + "expression. If only want routes with \"SPECIAL\" in the id then " - + "would use \".*SPECIAL.*\". If want to filter out such trips " - + "would instead use the complicated \"^((?!SPECIAL).)*$\" or " - + "\"^((?!(SPECIAL1|SPECIAL2)).)*$\" " + "if want to filter out two names. The default value " - + "of null causes all routes to be included."); - private static Pattern routeIdFilterRegExPattern = null; - - private static StringConfigValue startTimeOfDay = new StringConfigValue("transitime.avl.startTimeOfDay", "10", - "The time of day to start processing AVL.");; - - private static StringConfigValue endTimeOfDay = new StringConfigValue("transitime.avl.endTimeOfDay", "14", - "The time of day to end processing AVL."); - - private static final Logger logger = LoggerFactory.getLogger(BatchCsvAvlFeedModule.class); - - /********************** Member Functions **************************/ - - /** - * @param projectId - */ - public BatchCsvAvlFeedModule(String projectId) { - super(projectId); - } - - /** - * If configured to process data in real time them delay the appropriate - * amount of time - * - * @param avlReport - */ - private void delayIfRunningInRealTime(AvlReport avlReport) { - if (processInRealTime.getValue()) { - long delayLength = 0; - - if (lastAvlReportTimestamp > 0) { - delayLength = avlReport.getTime() - lastAvlReportTimestamp; - lastAvlReportTimestamp = avlReport.getTime(); - } else { - lastAvlReportTimestamp = avlReport.getTime(); - } - - if (delayLength > 0) - Time.sleep(delayLength); - } - } - - /* - * Reads in AVL reports from CSV file and processes them. - * - * (non-Javadoc) - * - * @see java.lang.Runnable#run() - */ - @Override - public void run() { - List avlReports = (new AvlCsvReader(getCsvAvlFeedFileName())).get(); - - // Process the AVL Reports read in. - for (AvlReport avlReport : avlReports) { - - logger.info("Processing avlReport={}", avlReport); - - // If configured to process data in real time them delay - // the appropriate amount of time - delayIfRunningInRealTime(avlReport); - - // Use the AVL report time as the current system time - Core.getInstance().setSystemTime(avlReport.getTime()); - - Calendar cal = Calendar.getInstance(); - cal.setTime(avlReport.getDate()); - int hour = cal.get(Calendar.HOUR_OF_DAY); - - if (routeIdFilterRegEx != null) { - // Create pattern if haven't done so yet, but only do so once. - if (routeIdFilterRegExPattern == null) - routeIdFilterRegExPattern = Pattern.compile(routeIdFilterRegEx.getValue()); - - DbConfig dbConfig = Core.getInstance().getDbConfig(); - - Trip trip = dbConfig.getTrip(avlReport.getAssignmentId()); - - if(trip!=null) - { - boolean matches = routeIdFilterRegExPattern.matcher(trip.getRouteId().trim()).matches(); - - if (matches) { - if (endTimeOfDay.getValue() != null && startTimeOfDay.getValue() != null) { - if (hour >= new Integer(startTimeOfDay.getValue()) - && hour < new Integer(endTimeOfDay.getValue())) - { - AvlProcessor.getInstance().processAvlReport(avlReport); - } - - } else { - AvlProcessor.getInstance().processAvlReport(avlReport); - } - } - }else - { - logger.info("No trup with id {} in GTFS", avlReport.getAssignmentId()); - } - } else { - if (endTimeOfDay.getValue() != null && startTimeOfDay.getValue() != null) { - if (hour >= new Integer(startTimeOfDay.getValue()) && hour < new Integer(endTimeOfDay.getValue())) { - AvlProcessor.getInstance().processAvlReport(avlReport); - } - } - else - { - AvlProcessor.getInstance().processAvlReport(avlReport); - } - } - - } - // Wait for database queue to be emptied before exiting. - while (Core.getInstance().getDbLogger().queueSize() > 0) { - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - - } - } - // Kill off the whole program because done processing the AVL data - System.exit(0); - } -} diff --git a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java deleted file mode 100644 index 496b0b913..000000000 --- a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCache.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.transitime.core.dataCache; - -import java.util.List; - -import org.slf4j.Logger; -import org.transitime.core.Indices; - -public interface ErrorCache { - - Double getErrorValue(Indices indices); - - Double getErrorValue(KalmanErrorCacheKey key); - - void putErrorValue(Indices indices, Double value); - - void putErrorValue(KalmanErrorCacheKey key, Double value); - - List getKeys(); - -} \ No newline at end of file diff --git a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java b/transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java deleted file mode 100644 index ca18d7eb1..000000000 --- a/transitime/src/main/java/org/transitime/core/dataCache/ErrorCacheFactory.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.transitime.core.dataCache; -import org.transitime.config.StringConfigValue; -import org.transitime.utils.ClassInstantiator; - -/** - * @author Sean Óg Crudden - * Factory that will provide cache to hold Kalman error values. - * - */ -public class ErrorCacheFactory { - private static StringConfigValue className = - new StringConfigValue("transitime.core.cache.errorCacheClass", - "org.transitime.core.dataCache.jcs.KalmanErrorCache", - "Specifies the class used to cache the Kalamn error values."); - - private static ErrorCache singleton = null; - - public static ErrorCache getInstance() { - - if (singleton == null) { - singleton = ClassInstantiator.instantiate(className.getValue(), - ErrorCache.class); - } - - return singleton; - } -} diff --git a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheFactory.java b/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheFactory.java deleted file mode 100644 index 0bfc4585b..000000000 --- a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheFactory.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.transitime.core.dataCache; -import org.transitime.config.StringConfigValue; -import org.transitime.utils.ClassInstantiator; - -/** - * @author Sean Óg Crudden - * Factory that will provide cache to hold Kalman error values. - * - */ -public class StopArrivalDepartureCacheFactory { - private static StringConfigValue className = - new StringConfigValue("transitime.core.cache.stopArrivalDepartureCache", - "org.transitime.core.dataCache.ehcache.StopArrivalDepartureCache", - "Specifies the class used to cache the arrival and departures for a stop."); - - private static StopArrivalDepartureCacheInterface singleton = null; - - public static StopArrivalDepartureCacheInterface getInstance() { - - if (singleton == null) { - singleton = ClassInstantiator.instantiate(className.getValue(), - StopArrivalDepartureCacheInterface.class); - } - - return singleton; - } -} diff --git a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheInterface.java b/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheInterface.java deleted file mode 100644 index e90f65af3..000000000 --- a/transitime/src/main/java/org/transitime/core/dataCache/StopArrivalDepartureCacheInterface.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.transitime.core.dataCache; - -import java.util.Date; -import java.util.List; - -import org.hibernate.Criteria; -import org.hibernate.Session; -import org.hibernate.criterion.Restrictions; -import org.transitime.db.structs.ArrivalDeparture; - -public abstract class StopArrivalDepartureCacheInterface { - - abstract public List getStopHistory(StopArrivalDepartureCacheKey key); - - abstract public StopArrivalDepartureCacheKey putArrivalDeparture(ArrivalDeparture arrivalDeparture); - - public void populateCacheFromDb(Session session, Date startDate, Date endDate) { - Criteria criteria = session.createCriteria(ArrivalDeparture.class); - - @SuppressWarnings("unchecked") - List results = criteria.add(Restrictions.between("time", startDate, endDate)).list(); - - for (ArrivalDeparture result : results) { - this.putArrivalDeparture(result); - } - } - -} \ No newline at end of file diff --git a/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java deleted file mode 100755 index e979ef846..000000000 --- a/transitime/src/main/java/org/transitime/core/dataCache/ehcache/KalmanErrorCache.java +++ /dev/null @@ -1,130 +0,0 @@ -package org.transitime.core.dataCache.ehcache; - -import java.util.List; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.Element; -import net.sf.ehcache.config.CacheConfiguration; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.transitime.core.Indices; -import org.transitime.core.dataCache.ErrorCache; - -import org.transitime.core.dataCache.KalmanErrorCacheKey; -/** - * @author Sean Óg Crudden - * - */ -public class KalmanErrorCache implements ErrorCache { - final private static String cacheName = "KalmanErrorCache"; - - private static final Logger logger = LoggerFactory - .getLogger(KalmanErrorCache.class); - - private Cache cache = null; - /** - * Gets the singleton instance of this class. - * - * @return - */ - - KalmanErrorCache() { - CacheManager cm = CacheManager.getInstance(); - - if (cm.getCache(cacheName) == null) { - cm.addCache(cacheName); - } - cache = cm.getCache(cacheName); - - CacheConfiguration config = cache.getCacheConfiguration(); - - config.setEternal(true); - - config.setMaxEntriesLocalHeap(1000000); - - config.setMaxEntriesLocalDisk(1000000); - } - - public void logCache(Logger logger) - { - logger.debug("Cache content log."); - @SuppressWarnings("unchecked") - List keys = cache.getKeys(); - - for(KalmanErrorCacheKey key : keys) - { - Element result=cache.get(key); - if(result!=null) - { - logger.debug("Key: "+key.toString()); - - Double value=(Double) result.getObjectValue(); - - logger.debug("Error value: "+value); - } - } - } - - /* (non-Javadoc) - * @see org.transitime.core.dataCache.ErrorCache#getErrorValue(org.transitime.core.Indices) - */ - @Override - @SuppressWarnings("unchecked") - synchronized public Double getErrorValue(Indices indices) { - - KalmanErrorCacheKey key=new KalmanErrorCacheKey(indices); - - Element result = cache.get(key); - - if(result==null) - return null; - else - return (Double)result.getObjectValue(); - } - /* (non-Javadoc) - * @see org.transitime.core.dataCache.ErrorCache#getErrorValue(org.transitime.core.dataCache.KalmanErrorCacheKey) - */ - @Override - @SuppressWarnings("unchecked") - synchronized public Double getErrorValue(KalmanErrorCacheKey key) { - - Element result = cache.get(key); - - if(result==null) - return null; - else - return (Double)result.getObjectValue(); - } - /* (non-Javadoc) - * @see org.transitime.core.dataCache.ErrorCache#putErrorValue(org.transitime.core.Indices, java.lang.Double) - */ - @Override - @SuppressWarnings("unchecked") - synchronized public void putErrorValue(Indices indices, Double value) { - - KalmanErrorCacheKey key=new KalmanErrorCacheKey(indices); - Element errorElement = new Element(key, value); - - cache.put(errorElement); - } - - public List getKeys() - { - @SuppressWarnings("unchecked") - List keys = cache.getKeys(); - return keys; - } - - @Override - public void putErrorValue(KalmanErrorCacheKey key, Double value) { - - - Element errorElement = new Element(key, value); - - cache.put(errorElement); - } - - -} diff --git a/transitime/src/main/java/org/transitime/core/dataCache/ehcache/StopArrivalDepartureCache.java b/transitime/src/main/java/org/transitime/core/dataCache/ehcache/StopArrivalDepartureCache.java deleted file mode 100755 index 5d6301253..000000000 --- a/transitime/src/main/java/org/transitime/core/dataCache/ehcache/StopArrivalDepartureCache.java +++ /dev/null @@ -1,237 +0,0 @@ -/** - * - */ -package org.transitime.core.dataCache.ehcache; - -import java.util.Collections; -import java.util.Date; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.Element; -import net.sf.ehcache.store.Policy; - -import org.hibernate.Criteria; -import org.hibernate.criterion.Restrictions; -import org.hibernate.Session; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.transitime.config.IntegerConfigValue; -import org.transitime.core.dataCache.ArrivalDepartureComparator; -import org.transitime.core.dataCache.StopArrivalDepartureCacheFactory; -import org.transitime.core.dataCache.StopArrivalDepartureCacheInterface; -import org.transitime.core.dataCache.StopArrivalDepartureCacheKey; -import org.transitime.core.dataCache.TripKey; -import org.transitime.db.structs.ArrivalDeparture; -import org.transitime.utils.Time; - -/** - * @author Sean Og Crudden This is a Cache to hold a sorted list of all arrival departure events - * for each stop in a cache. We can use this to look up all event for a - * stop for a day. The date used in the key should be the start of the - * day concerned. - * - * TODO this could do with an interface, factory class, and alternative - * implementations, perhaps using Infinispan. - */ -public class StopArrivalDepartureCache extends StopArrivalDepartureCacheInterface { - - - private static boolean debug = false; - - final private static String cacheByStop = "arrivalDeparturesByStop"; - - private static final Logger logger = LoggerFactory.getLogger(StopArrivalDepartureCache.class); - - private Cache cache = null; - - /** - * Default is 4 as we need 3 days worth for Kalman Filter implementation - */ - private static final IntegerConfigValue tripDataCacheMaxAgeSec = new IntegerConfigValue( - "transitime.tripdatacache.tripDataCacheMaxAgeSec", 4 * Time.SEC_PER_DAY, - "How old an arrivaldeparture has to be before it is removed from the cache "); - - - public StopArrivalDepartureCache() { - CacheManager cm = CacheManager.getInstance(); - EvictionAgePolicy evictionPolicy = null; - if (tripDataCacheMaxAgeSec != null) { - evictionPolicy = new EvictionAgePolicy(tripDataCacheMaxAgeSec.getValue() * Time.MS_PER_SEC); - } else { - evictionPolicy = new EvictionAgePolicy(4 * Time.SEC_PER_DAY * Time.MS_PER_SEC); - } - - if (cm.getCache(cacheByStop) == null) { - cm.addCache(cacheByStop); - } - cache = cm.getCache(cacheByStop); - - // CacheConfiguration config = cache.getCacheConfiguration(); - - // cache.setMemoryStoreEvictionPolicy(evictionPolicy); - } - - @SuppressWarnings("unchecked") - public List getKeys() { - return (List) cache.getKeys(); - } - - public void logCache(Logger logger) { - logger.debug("Cache content log."); - @SuppressWarnings("unchecked") - List keys = cache.getKeys(); - - for (StopArrivalDepartureCacheKey key : keys) { - Element result = cache.get(key); - if (result != null) { - logger.debug("Key: " + key.toString()); - @SuppressWarnings("unchecked") - - List ads = (List) result.getObjectValue(); - - for (ArrivalDeparture ad : ads) { - logger.debug(ad.toString()); - } - } - } - - } - - /* (non-Javadoc) - * @see org.transitime.core.dataCache.ehcache.StopArrivalDepartureCacheInterface#getStopHistory(org.transitime.core.dataCache.StopArrivalDepartureCacheKey) - */ - - @SuppressWarnings("unchecked") - synchronized public List getStopHistory(StopArrivalDepartureCacheKey key) { - - //logger.debug(cache.toString()); - Calendar date = Calendar.getInstance(); - date.setTime(key.getDate()); - - date.set(Calendar.HOUR_OF_DAY, 0); - date.set(Calendar.MINUTE, 0); - date.set(Calendar.SECOND, 0); - date.set(Calendar.MILLISECOND, 0); - key.setDate(date.getTime()); - Element result = cache.get(key); - - if (result != null) { - return (List) result.getObjectValue(); - } else { - return null; - } - } - - /* (non-Javadoc) - * @see org.transitime.core.dataCache.ehcache.StopArrivalDepartureCacheInterface#putArrivalDeparture(org.transitime.db.structs.ArrivalDeparture) - */ - - @SuppressWarnings("unchecked") - synchronized public StopArrivalDepartureCacheKey putArrivalDeparture(ArrivalDeparture arrivalDeparture) { - - logger.debug("Putting :" + arrivalDeparture.toString() + " in StopArrivalDepartureCache cache."); - - Calendar date = Calendar.getInstance(); - date.setTime(arrivalDeparture.getDate()); - - date.set(Calendar.HOUR_OF_DAY, 0); - date.set(Calendar.MINUTE, 0); - date.set(Calendar.SECOND, 0); - date.set(Calendar.MILLISECOND, 0); - - StopArrivalDepartureCacheKey key = new StopArrivalDepartureCacheKey(arrivalDeparture.getStop().getId(), - date.getTime()); - - List list = null; - - Element result = cache.get(key); - - if (result != null && result.getObjectValue() != null) { - list = (List) result.getObjectValue(); - cache.remove(key); - } else { - list = new ArrayList(); - } - - list.add(arrivalDeparture); - - Collections.sort(list, new ArrivalDepartureComparator()); - - // This is java 1.8 list.sort(new ArrivalDepartureComparator()); - - Element arrivalDepartures = new Element(key, Collections.synchronizedList(list)); - - cache.put(arrivalDepartures); - - return key; - } - - private static Iterable emptyIfNull(Iterable iterable) { - return iterable == null ? Collections. emptyList() : iterable; - } - - public void populateCacheFromDb(Session session, Date startDate, Date endDate) { - Criteria criteria = session.createCriteria(ArrivalDeparture.class); - - @SuppressWarnings("unchecked") - List results = criteria.add(Restrictions.between("time", startDate, endDate)).list(); - - for (ArrivalDeparture result : results) { - StopArrivalDepartureCacheFactory.getInstance().putArrivalDeparture(result); - } - } - - /** - * This policy evicts arrival departures from the cache when they are X - * (age) number of milliseconds old - * - */ - private class EvictionAgePolicy implements Policy { - private String name = "AGE"; - - private long age = 0L; - - public EvictionAgePolicy(long age) { - super(); - this.age = age; - } - - @Override - public boolean compare(Element arg0, Element arg1) { - if (arg0.getObjectKey() instanceof StopArrivalDepartureCacheKey - && arg1.getObjectKey() instanceof StopArrivalDepartureCacheKey) { - if (((StopArrivalDepartureCacheKey) arg0.getObjectKey()).getDate() - .after(((StopArrivalDepartureCacheKey) arg1.getObjectKey()).getDate())) { - return true; - } - - } - return false; - } - - @Override - public String getName() { - return name; - } - - @Override - public Element selectedBasedOnPolicy(Element[] arg0, Element arg1) { - - for (int i = 0; i < arg0.length; i++) { - - if (arg0[i].getObjectKey() instanceof TripKey) { - StopArrivalDepartureCacheKey key = (StopArrivalDepartureCacheKey) arg0[i].getObjectKey(); - - if (Calendar.getInstance().getTimeInMillis() - key.getDate().getTime() > age) { - return arg0[i]; - } - } - } - return null; - } - } -} diff --git a/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java b/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java deleted file mode 100755 index 1bd6e3202..000000000 --- a/transitime/src/main/java/org/transitime/core/dataCache/jcs/KalmanErrorCache.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.transitime.core.dataCache.jcs; - -import java.util.List; - -import org.apache.commons.jcs.JCS; -import org.apache.commons.jcs.access.CacheAccess; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.transitime.core.Indices; -import org.transitime.core.dataCache.ErrorCache; -import org.transitime.core.dataCache.KalmanErrorCacheKey; -/** - * @author Sean Og Crudden - * - */ -public class KalmanErrorCache implements ErrorCache { - final private static String cacheName = "KalmanErrorCache"; - - private static final Logger logger = LoggerFactory - .getLogger(KalmanErrorCache.class); - - private CacheAccess cache = null; - - public KalmanErrorCache() { - cache = JCS.getInstance(cacheName); - } - - /* (non-Javadoc) - * @see org.transitime.core.dataCache.ErrorCache#getErrorValue(org.transitime.core.Indices) - */ - @Override - @SuppressWarnings("unchecked") - synchronized public Double getErrorValue(Indices indices) { - - KalmanErrorCacheKey key=new KalmanErrorCacheKey(indices); - - Double result = cache.get(key); - - return result; - - } - /* (non-Javadoc) - * @see org.transitime.core.dataCache.ErrorCache#getErrorValue(org.transitime.core.dataCache.KalmanErrorCacheKey) - */ - @Override - @SuppressWarnings("unchecked") - synchronized public Double getErrorValue(KalmanErrorCacheKey key) { - System.out.println(cache.getStats().toString()); - - Double result = cache.get(key); - - return result; - } - /* (non-Javadoc) - * @see org.transitime.core.dataCache.ErrorCache#putErrorValue(org.transitime.core.Indices, java.lang.Double) - */ - @Override - @SuppressWarnings("unchecked") - synchronized public void putErrorValue(Indices indices, Double value) { - - KalmanErrorCacheKey key=new KalmanErrorCacheKey(indices); - - cache.put(key, value); - - } - - @Override - public void putErrorValue(KalmanErrorCacheKey key, Double value) { - - cache.put(key, value); - } - - @Override - public List getKeys() { - // TODO Auto-generated method stub - return null; - } -} diff --git a/transitime/src/main/resources/cache.ccf b/transitime/src/main/resources/cache.ccf deleted file mode 100644 index 47861c9f4..000000000 --- a/transitime/src/main/resources/cache.ccf +++ /dev/null @@ -1,29 +0,0 @@ -############################################################## -##### Default Region Configuration -jcs.default=DC -jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes -jcs.default.cacheattributes.MaxObjects=0 -jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache -jcs.default.cacheattributes.DiskUsagePatternName=UPDATE - -############################################################## -##### CACHE REGIONS -jcs.region.myRegion1=DC -jcs.region.myRegion1.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes -jcs.region.myRegion1.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache -jcs.region.myRegion1.cacheattributes.DiskUsagePatternName=UPDATE -jcs.region.myRegion1.elementattributes.IsEternal=true -jcs.region.myRegion1.cacheattributes.MaxObjects=0 - -############################################################## -##### AUXILIARY CACHES -# Indexed Disk Cache -jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory -jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes -jcs.auxiliary.DC.attributes.diskPath=${user.home}/jcs_swap -jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000 -jcs.auxiliary.DC.attributes.MaxKeySize=10000 -jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000 -jcs.auxiliary.DC.attributes.OptimizeOnShutdown=true -jcs.auxiliary.DC.attributes.DiskLimitType=COUNT - diff --git a/transitime/src/test/java/org/transitime/cache/TestJCSCache.java b/transitime/src/test/java/org/transitime/cache/TestJCSCache.java deleted file mode 100644 index 6457ddadd..000000000 --- a/transitime/src/test/java/org/transitime/cache/TestJCSCache.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.transitime.cache; - -import org.transitime.core.dataCache.ErrorCache; -import org.transitime.core.dataCache.ErrorCacheFactory; -import org.transitime.core.dataCache.KalmanErrorCacheKey; - -import junit.framework.TestCase; - -public class TestJCSCache extends TestCase{ - public void testPersist() - { - for(int i=0;i<10;i++) - { - ErrorCache cache=ErrorCacheFactory.getInstance(); - - Double value=new Double(i); - - KalmanErrorCacheKey key=new KalmanErrorCacheKey(""+i,i); - - cache.putErrorValue(key, value); - - value=cache.getErrorValue(key); - - if(value.intValue()!=i) - assertTrue(false); - } - assertTrue(true); - - } -} From 627f5a92fb14a1331a33d5498e6ff310c4a47a87 Mon Sep 17 00:00:00 2001 From: scrudden Date: Thu, 5 Jul 2018 20:51:05 +0100 Subject: [PATCH 28/81] Set class for cache to transitclock package. --- .../core/dataCache/StopArrivalDepartureCacheFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transitclock/src/main/java/org/transitclock/core/dataCache/StopArrivalDepartureCacheFactory.java b/transitclock/src/main/java/org/transitclock/core/dataCache/StopArrivalDepartureCacheFactory.java index b4b2b451e..8c190d973 100644 --- a/transitclock/src/main/java/org/transitclock/core/dataCache/StopArrivalDepartureCacheFactory.java +++ b/transitclock/src/main/java/org/transitclock/core/dataCache/StopArrivalDepartureCacheFactory.java @@ -9,8 +9,8 @@ */ public class StopArrivalDepartureCacheFactory { private static StringConfigValue className = - new StringConfigValue("transitime.core.cache.stopArrivalDepartureCache", - "org.transitime.core.dataCache.ehcache.StopArrivalDepartureCache", + new StringConfigValue("transitclock.core.cache.stopArrivalDepartureCache", + "org.transitclock.core.dataCache.ehcache.StopArrivalDepartureCache", "Specifies the class used to cache the arrival and departures for a stop."); private static StopArrivalDepartureCacheInterface singleton = null; From f383c9504b48e8168fffb24d854eee90133a882f Mon Sep 17 00:00:00 2001 From: vperez Date: Fri, 6 Jul 2018 10:12:17 -0400 Subject: [PATCH 29/81] Add swagger 3 support. It was necessary to upgrade the version of jersey. It was added doc.html (swagger ui with theTransitClock icon). OpenApi.json can be accessed in "api/doc" path. --- transitclockApi/pom.xml | 45 +++- .../api/rootResources/CacheApi.java | 3 + .../api/rootResources/CommandsApi.java | 89 +++++-- .../api/rootResources/GtfsRealtimeApi.java | 12 +- .../api/rootResources/SiriApi.java | 24 +- .../api/rootResources/TransitimeApi.java | 221 ++++++++++++++++-- .../rootResources/TransitimeNonAgencyApi.java | 9 + .../api/rootResources/package-info.java | 2 +- .../api/utils/StandardParameters.java | 4 + .../servlet/swagger/ApiOriginFilter.java | 42 ++++ .../src/main/webapp/WEB-INF/web.xml | 58 ++++- transitclockApi/src/main/webapp/doc.html | 64 +++++ .../src/main/webapp/oauth2-redirect.html | 67 ++++++ .../src/main/webapp/swagger-ui-bundle.js | 104 +++++++++ .../src/main/webapp/swagger-ui-bundle.js.map | 1 + .../webapp/swagger-ui-standalone-preset.js | 14 ++ .../swagger-ui-standalone-preset.js.map | 1 + .../src/main/webapp/swagger-ui.css | 3 + .../src/main/webapp/swagger-ui.css.map | 1 + transitclockApi/src/main/webapp/swagger-ui.js | 9 + .../src/main/webapp/swagger-ui.js.map | 1 + 21 files changed, 720 insertions(+), 54 deletions(-) create mode 100644 transitclockApi/src/main/java/org/transitclock/servlet/swagger/ApiOriginFilter.java create mode 100644 transitclockApi/src/main/webapp/doc.html create mode 100644 transitclockApi/src/main/webapp/oauth2-redirect.html create mode 100644 transitclockApi/src/main/webapp/swagger-ui-bundle.js create mode 100644 transitclockApi/src/main/webapp/swagger-ui-bundle.js.map create mode 100644 transitclockApi/src/main/webapp/swagger-ui-standalone-preset.js create mode 100644 transitclockApi/src/main/webapp/swagger-ui-standalone-preset.js.map create mode 100644 transitclockApi/src/main/webapp/swagger-ui.css create mode 100644 transitclockApi/src/main/webapp/swagger-ui.css.map create mode 100644 transitclockApi/src/main/webapp/swagger-ui.js create mode 100644 transitclockApi/src/main/webapp/swagger-ui.js.map diff --git a/transitclockApi/pom.xml b/transitclockApi/pom.xml index c8071285e..c0abae0d8 100755 --- a/transitclockApi/pom.xml +++ b/transitclockApi/pom.xml @@ -9,6 +9,8 @@ UTF-8 + 1.8 + 1.8 @@ -30,7 +32,7 @@ org.glassfish.jersey.media jersey-media-moxy - 2.11 + 2.24.1 org.slf4j @@ -42,7 +44,7 @@ org.glassfish.jersey.containers jersey-container-servlet - 2.11 + 2.24.1 @@ -50,6 +52,41 @@ transitclockCore 2.0.0-SNAPSHOT + + com.google.guava + guava + 20.0 + + + org.glassfish.jersey.bundles.repackaged + jersey-guava + 2.6 + + + + + + + + + io.swagger.core.v3 + swagger-jaxrs2 + 2.0.2 + + + + + org.webjars + swagger-ui + 3.17.1 + + + + @@ -63,8 +100,8 @@ 2.5.1 true - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/transitclockApi/src/main/java/org/transitclock/api/rootResources/CacheApi.java b/transitclockApi/src/main/java/org/transitclock/api/rootResources/CacheApi.java index deda93afe..3a97bd3a4 100755 --- a/transitclockApi/src/main/java/org/transitclock/api/rootResources/CacheApi.java +++ b/transitclockApi/src/main/java/org/transitclock/api/rootResources/CacheApi.java @@ -53,6 +53,9 @@ import org.transitclock.ipc.interfaces.HoldingTimeInterface; import org.transitclock.ipc.interfaces.PredictionAnalysisInterface; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.servers.Servers; + /** * Contains the API commands for the Transitime API for getting info on data that is cached. *

diff --git a/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java b/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java index 5dda5f6e4..c1c2d5f80 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java +++ b/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java @@ -30,6 +30,7 @@ import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.WebApplicationException; @@ -47,7 +48,16 @@ import org.transitclock.db.structs.MeasuredArrivalTime; import org.transitclock.db.structs.AvlReport.AssignmentType; import org.transitclock.ipc.data.IpcAvl; +import org.transitclock.ipc.data.IpcTrip; import org.transitclock.ipc.interfaces.CommandsInterface; +import org.transitclock.ipc.interfaces.ConfigInterface; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.servers.Servers; @Path("/key/{key}/agency/{agency}") public class CommandsApi { @@ -80,16 +90,18 @@ public class CommandsApi { @Path("/command/pushAvl") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Reads in a single AVL report specified by the query string parameters", + description="Reads in a single AVL report specified by the query string parameters.",tags= {"operation","vehicle","avl"}) public Response pushAvlData( @BeanParam StandardParameters stdParameters, - @QueryParam(value = "v") String vehicleId, - @QueryParam(value = "t") long time, - @QueryParam(value = "lat") double lat, - @QueryParam(value = "lon") double lon, - @QueryParam(value = "s") @DefaultValue("NaN") float speed, - @QueryParam(value = "h") @DefaultValue("NaN") float heading, - @QueryParam(value = "assignmentId") String assignmentId, - @QueryParam(value = "assignmentType") String assignmentTypeStr) + @Parameter(description="VehicleId. Unique identifier of the vehicle.",required=true)@QueryParam(value = "v") String vehicleId, + @Parameter(description="GPS epoch time in msec.",required=true) @QueryParam(value = "t") long time, + @Parameter(description="Latitude of AVL reporte. Decimal degrees.",required=true) @QueryParam(value = "lat") double lat, + @Parameter(description="Longitude of AVL reporte. Decimal degrees.",required=true) @QueryParam(value = "lon") double lon, + @Parameter(description="Speed of AVL reporte. m/s.",required=false) @QueryParam(value = "s") @DefaultValue("NaN") float speed, + @Parameter(description="Heading of AVL report. Degrees. 0 degrees=North. Should be set to Float.NaN if speed not available",required=false)@QueryParam(value = "h") @DefaultValue("NaN") float heading, + @Parameter(description="Indicates the assignmet id of the AVL report according to the assingment tyoe. For example, if assingment type is ROUTE_ID, the assingment ID should be one route_id loaded in the system.", required=false)@QueryParam(value = "assignmentId") String assignmentId, + @Parameter(description="Indicates the assignmet type of the AV report. This parameter can take the next values:

  • ROUTE_ID
  • TRIP_ID
  • TRIP_SHORT_NAME
")@QueryParam(value = "assignmentType") String assignmentTypeStr) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -184,8 +196,16 @@ private static JSONObject getJsonObject(InputStream requestBody) @Path("/command/pushAvl") @POST @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Reads in a single AVL report in the message body.", + description="Reads in a single AVL report specified by the query string parameters.

{avl: [{v: \"vehicleId1\", t: epochTimeMsec, lat: latitude, lon: longitude, s:speed(optional), h:heading(optional)},\r\n" + + " {v: \"vehicleId2\", t: epochTimeMsec, lat: latitude, lon: longitude, " + + " s: speed(optional), h: heading(optional)}, "+ + " {etc...}]

. Can also specify assignment info using " + + " \"assignmentId: 4321, assignmentType: TRIP_ID\" " + + " where assignmentType can be BLOCK_ID, ROUTE_ID, TRIP_ID, or " + + " TRIP_SHORT_NAME.",tags= {"operation","vehicle","avl"}) public Response pushAvlData(@BeanParam StandardParameters stdParameters, - InputStream requestBody) throws WebApplicationException { + @Parameter(description="Json of avl report.",required=true)InputStream requestBody) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -246,8 +266,11 @@ else if (assignmentTypeStr.equals("TRIP_SHORT_NAME")) @Path("/command/resetVehicle") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Reset a vehicle", + description="This is to give the means of manually setting a vehicle unpredictable and unassigned so it will be reassigned quickly.", + tags= {"command","vehicle"}) public Response getVehicles(@BeanParam StandardParameters stdParameters, - @QueryParam(value = "v") List vehicleIds) throws WebApplicationException { + @Parameter(description="List of vechilesId.")@QueryParam(value = "v") List vehicleIds) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -279,13 +302,15 @@ public Response getVehicles(@BeanParam StandardParameters stdParameters, @Path("/command/pushMeasuredArrivalTime") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Reads in information from request and stores arrival information into db", + description="For storing a measured arrival time so that can see if measured arrival time via GPS is accurate.",tags= {"command"}) public Response pushAvlData( @BeanParam StandardParameters stdParameters, - @QueryParam(value = "r") String routeId, - @QueryParam(value = "rShortName") String routeShortName, - @QueryParam(value = "s") String stopId, - @QueryParam(value = "d") String directionId, - @QueryParam(value = "headsign") String headsign) + @Parameter(description="Route id",required=true) @QueryParam(value = "r") String routeId, + @Parameter(description="Route short name.",required=true) @QueryParam(value = "rShortName") String routeShortName, + @Parameter(description="Route stop id.",required=true) @QueryParam(value = "s") String stopId, + @Parameter(description="Direcction id.",required=true) @QueryParam(value = "d") String directionId, + @Parameter(description="headsign.",required=true) @QueryParam(value = "headsign") String headsign) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -310,5 +335,39 @@ public Response pushAvlData( throw WebUtils.badRequestException(e); } } + @Path("/command/cancelTrip/{tripId}") + @GET //SHOULD BE POST,IT IS AN UPDATE + @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Cancel a trip in order to be shown in GTFS realtime.", + description="Experimental. It will work olny with the correct version. It cancel a trip that has no vechilce assigned." + ,tags= {"command","trip"}) + public Response cancelTrip(@BeanParam StandardParameters stdParameters, + @Parameter(description="tripId to be marked as canceled.",required=true)@PathParam("tripId") String tripId) + { + stdParameters.validate(); + String agencyId = stdParameters.getAgencyId(); + System.out.println(agencyId); + String result=null; + try + { + CommandsInterface inter = stdParameters.getCommandsInterface(); + //We need to get the block id in order to get the vehicle + ConfigInterface cofingInterface = stdParameters.getConfigInterface(); + IpcTrip ipcTrip = cofingInterface.getTrip(tripId); + if(ipcTrip==null) + throw WebUtils.badRequestException("TripId=" + tripId + " does not exist."); + String blockId=ipcTrip.getBlockId(); + result=inter.cancelTrip(blockId); + System.out.println(result); + } + catch (RemoteException e) { + e.printStackTrace(); + throw WebUtils.badRequestException("Could not send request to Core server. "+e.getMessage()); + } + if(result==null) + return stdParameters.createResponse(new ApiCommandAck(true,"Processed")); + else + return stdParameters.createResponse(new ApiCommandAck(true,result)); + } } diff --git a/transitclockApi/src/main/java/org/transitclock/api/rootResources/GtfsRealtimeApi.java b/transitclockApi/src/main/java/org/transitclock/api/rootResources/GtfsRealtimeApi.java index 0f8490404..f6f42f374 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/rootResources/GtfsRealtimeApi.java +++ b/transitclockApi/src/main/java/org/transitclock/api/rootResources/GtfsRealtimeApi.java @@ -38,6 +38,11 @@ import com.google.transit.realtime.GtfsRealtime.FeedMessage; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.servers.Servers; + /** * Contains API commands for the GTFS-realtime API. * @@ -71,8 +76,10 @@ public class GtfsRealtimeApi { @Path("/command/gtfs-rt/vehiclePositions") @GET @Produces({ MediaType.TEXT_PLAIN, MediaType.APPLICATION_OCTET_STREAM }) + @Operation(summary="GTFS-realtime Vehicle Positions data for all vehicles.",description="Gets real time vehicle position feed. It might be in human readeable format or binary.",tags= {"GTFS","feed"}) public Response getGtfsRealtimeVehiclePositionsFeed( final @BeanParam StandardParameters stdParameters, + @Parameter(description="If specified as human, it will get the output in human readable format. Otherwise will output data in binary format", required=false) @QueryParam(value = "format") String format) throws WebApplicationException { @@ -125,7 +132,7 @@ public void write(OutputStream outputStream) throws IOException, } /** - * For getting GTFS-realtime Vehicle Positions data for all vehicles. + * For getting GTFS-realtime for all trips. * * @param stdParameters * @param format @@ -137,8 +144,11 @@ public void write(OutputStream outputStream) throws IOException, @Path("/command/gtfs-rt/tripUpdates") @GET @Produces({ MediaType.TEXT_PLAIN, MediaType.APPLICATION_OCTET_STREAM }) + @Operation(summary="GTFS-realtime trip data.",description="Gets real time trip feed. It might be in human readeable format or binary.",tags= {"GTFS","feed"}) + public Response getGtfsRealtimeTripFeed( final @BeanParam StandardParameters stdParameters, + @Parameter(description="If specified as human, it will get the output in human readable format. Otherwise will output data in binary format", required=false) @QueryParam(value = "format") String format) throws WebApplicationException { diff --git a/transitclockApi/src/main/java/org/transitclock/api/rootResources/SiriApi.java b/transitclockApi/src/main/java/org/transitclock/api/rootResources/SiriApi.java index a5a866ca7..b70b1fe18 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/rootResources/SiriApi.java +++ b/transitclockApi/src/main/java/org/transitclock/api/rootResources/SiriApi.java @@ -41,6 +41,11 @@ import org.transitclock.ipc.interfaces.PredictionsInterface; import org.transitclock.ipc.interfaces.VehiclesInterface; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.servers.Servers; + /** * The Siri API * @@ -68,9 +73,13 @@ public class SiriApi { @Path("/command/siri/vehicleMonitoring") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Returns vehicleMonitoring vehicle information in SIRI format.", + description="It is possible to specify vehicleIds, routeIds, or routeShortNames " + + "to get subset of data. If not specified then vehicle information for entire agency is returned.", + tags= {"SIRI","feed"}) public Response getVehicles(@BeanParam StandardParameters stdParameters, - @QueryParam(value = "v") List vehicleIds, - @QueryParam(value = "r") List routesIdOrShortNames) + @Parameter(description="List of vehicles id", required=false)@QueryParam(value = "v") List vehicleIds, + @Parameter(description="List of routesId or routeShortName", required=false)@QueryParam(value = "r") List routesIdOrShortNames) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -114,13 +123,18 @@ public Response getVehicles(@BeanParam StandardParameters stdParameters, @Path("/command/siri/stopMonitoring") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Returns stopMonitoring vehicle information in SIRI format.", + description="It is possible to specify vehicleIds, routeIds, or routeShortNames " + + "to get subset of data. It is possible to specify the number of perdictions per stop." + + " If not specified then vehicle information for entire agency is returned.", + tags= {"SIRI","feed"}) public Response getVehicles( @BeanParam StandardParameters stdParameters, - @QueryParam(value = "r") String routeIdOrShortName, - @QueryParam(value = "s") String stopId, - @QueryParam(value = "numPreds") @DefaultValue("3") int numberPredictions) + @Parameter(description="RoutesId or routeShortName", required=true) @QueryParam(value = "r") String routeIdOrShortName, + @Parameter(description="StopIds", required=true) @QueryParam(value = "s") String stopId, + @Parameter(description="Number of predictions", required=false) @QueryParam(value = "numPreds") @DefaultValue("3") int numberPredictions) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); diff --git a/transitclockApi/src/main/java/org/transitclock/api/rootResources/TransitimeApi.java b/transitclockApi/src/main/java/org/transitclock/api/rootResources/TransitimeApi.java index 8fa10ca10..7f956fed1 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/rootResources/TransitimeApi.java +++ b/transitclockApi/src/main/java/org/transitclock/api/rootResources/TransitimeApi.java @@ -85,8 +85,21 @@ import org.transitclock.ipc.interfaces.PredictionsInterface; import org.transitclock.ipc.interfaces.ServerStatusInterface; import org.transitclock.ipc.interfaces.VehiclesInterface; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.servers.ServerVariable; +import io.swagger.v3.oas.annotations.servers.Servers; + +//import io.swagger.annotations.Api; +//import io.swagger.annotations.ApiOperation; + import org.transitclock.ipc.interfaces.PredictionsInterface.RouteStop; + /** * Contains the API commands for the Transitime API for getting real-time * vehicle and prediction information plus the static configuration information. @@ -100,6 +113,12 @@ * @author SkiBu Smith * */ +@OpenAPIDefinition(info = @Info(title = "TrasnsitClockAPI", version = "1.0", +description = "TheTransitClock is an open source transit information system." + + " It’s core function is to provide and analyze arrival predictions for transit " + + "systems.
Here you will find the detailed description of The Transit Clock API.
" + + "For more information visit thetransitclock.github.io." +),servers= {@Server(url="/api/v1")}) @Path("/key/{key}/agency/{agency}") public class TransitimeApi { @@ -130,13 +149,21 @@ public class TransitimeApi { * @return The Response object already configured for the specified media * type. */ + @Operation(summary="Returns data for all vehicles or for the vehicles specified via the query string.", + description="Returns data for all vehicles or for the vehicles specified via the query string.",tags= {"vehicle","prediction"}) @Path("/command/vehicles") + @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - public Response getVehicles(@BeanParam StandardParameters stdParameters, - @QueryParam(value = "v") List vehicleIds, - @QueryParam(value = "r") List routesIdOrShortNames, @QueryParam(value = "s") String stopId, - @QueryParam(value = "numPreds") @DefaultValue("2") int numberPredictions) throws WebApplicationException { + public Response getVehicles( + @BeanParam StandardParameters stdParameters, + @Parameter(description="Vehicles is list.") @QueryParam(value = "v") List vehicleIds, + @Parameter(description="Specifies which vehicles to get data for.",required=false) @QueryParam(value = "r") List routesIdOrShortNames, + @Parameter(description="Specifies a stop so can get predictions for" + + " routes and determine which vehicles are the ones generating the predictions. " + + "The other vehicles are labeled as minor so they can be drawn specially in the UI.",required=false) + @QueryParam(value = "s") String stopId, + @Parameter(description="Number of predictions to show.", required=false) @QueryParam(value = "numPreds") @DefaultValue("2") int numberPredictions) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -183,6 +210,7 @@ public Response getVehicles(@BeanParam StandardParameters stdParameters, * @throws WebApplicationException */ @Path("/command/vehicleIds") + @Operation(summary="Gets the list of vehicles Id", tags= {"vehicle"}) @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public Response getVehicleIds(@BeanParam StandardParameters stdParameters) throws WebApplicationException { @@ -204,8 +232,11 @@ public Response getVehicleIds(@BeanParam StandardParameters stdParameters) throw @Path("/command/vehicleLocation") @GET + @Operation(summary="It gets the location for the specified vehicle.",description="It gets the location for the specified vehicle.", + tags= {"vehicle"}) @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public Response getVehicleLocation(@BeanParam StandardParameters stdParameters, + @Parameter(description="Specifies the vehicle from which to get the location from.",required=true) @QueryParam(value = "v") String vehicleId) throws WebApplicationException { try { @@ -255,11 +286,26 @@ public Response getVehicleLocation(@BeanParam StandardParameters stdParameters, */ @Path("/command/vehiclesDetails") @GET + @Operation(summary="Returns detailed data for all " + + "vehicles or for the vehicles specified via the query string", + description="Returns detailed data for all" + + " vehicles or for the vehicles specified via the query string. This data " + + " includes things not necessarily intended for the public, such as schedule" + + " adherence and driver IDs.",tags= {"vehicle"}) @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public Response getVehiclesDetails(@BeanParam StandardParameters stdParameters, + @Parameter(description="Specifies which vehicles to get data for",required=true) @QueryParam(value = "v") List vehicleIds, - @QueryParam(value = "r") List routesIdOrShortNames, @QueryParam(value = "s") String stopId, - @QueryParam(value = "numPreds") @DefaultValue("3") int numberPredictions) throws WebApplicationException { + @Parameter(description="Specifies which routes to get data for",required=false) + @QueryParam(value = "r") List routesIdOrShortNames, + @Parameter(description="Specifies a stop so can get predictions for" + + " routes and determine which vehicles are the ones generating" + + " the predictions. The other vehicles are labeled as minor so" + + " they can be drawn specially in the UI. ",required=false) + @QueryParam(value = "s") String stopId, + @Parameter(description=" For when determining which vehicles are generating the" + + "predictions so can label minor vehicles",required=false)@QueryParam(value = "numPreds") + @DefaultValue("3") int numberPredictions) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -324,6 +370,9 @@ public enum UiMode { */ @Path("/command/vehicleConfigs") @GET + @Operation(summary="Returns a list of vehilces with its configurarion.", + description="Returns a list of vehicles coniguration which inclides description, capacity, type and crushCapacity.", + tags= {"vehicle"}) @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public Response getVehicleConfigs(@BeanParam StandardParameters stdParameters) throws WebApplicationException { // Make sure request is valid @@ -466,13 +515,23 @@ private static List determineVehiclesGeneratingPreds(StandardParameters @Path("/command/predictions") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - + @Operation(summary="Gets predictions from server",tags= {"prediction"}) public Response getPredictions( @BeanParam StandardParameters stdParameters, + @Parameter(description="List of route/stops to return predictions for. " + + "If route not specified then data will be returned for all routes " + + "for the specified stop. The route specifier is the route id or the route short name. " + + "It is often best to use route short name for " + + "consistency across configuration changes (route ID is not consistent for many agencies). " + + "The stop specified can either be the stop ID or the stop code. " + + "Each route/stop is separated by the \"|\" character so" + + " for example the query string could have \"rs=43|2029&rs=43|3029\"") @QueryParam(value = "rs") List routeStopStrs, + @Parameter(description="List of stops to return predictions for. Can use either stop ID or stop code.") @QueryParam(value = "s") List stopStrs, + @Parameter(description="Maximum number of predictions to return.") @QueryParam(value = "numPreds") @DefaultValue("3") int numberPredictions) throws WebApplicationException { // Make sure request is valid @@ -553,9 +612,15 @@ private static List determineVehiclesGeneratingPreds(StandardParameters @Path("/command/predictionsByLoc") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - public Response getPredictions(@BeanParam StandardParameters stdParameters, @QueryParam(value = "lat") Double lat, + @Operation(summary="Gets predictions from server by location",tags= {"prediction"}) + public Response getPredictions(@BeanParam StandardParameters stdParameters, + @Parameter(description="Latitude of the location in decimal degrees.",required=true) + @QueryParam(value = "lat") Double lat, + @Parameter(description="Longitude of the location in decimal degrees.",required=true) @QueryParam(value = "lon") Double lon, + @Parameter(description="How far away a stop can be from the location (lat/lon).",required=false) @QueryParam(value = "maxDistance") @DefaultValue("1500.0") double maxDistance, + @Parameter(description="Maximum number of predictions to return.") @QueryParam(value = "numPreds") @DefaultValue("3") int numberPredictions) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -592,10 +657,15 @@ public Response getPredictions(@BeanParam StandardParameters stdParameters, @Que @Path("/command/routes") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - + @Operation(summary="Gets the list of routes.", description="Gets a list of the existing routes in the server." + + " It might be filtered according to routeId or routeShortName. " + + "If more than one route have the same shortName, it is possible to specify keepDuplicates parameter to show all of them. ", + tags={"base data","route"} ) public Response getRoutes(@BeanParam StandardParameters stdParameters, - @QueryParam(value = "r") List routeIdsOrShortNames, - @QueryParam(value = "keepDuplicates") Boolean keepDuplicates) + @Parameter(description="List of routeId or routeShortName. Example: r=1&r=2" ,required=false) + @QueryParam(value = "r") List routeIdsOrShortNames, + @Parameter(description="Return all routes when more than one have the same shortName.",required=false) + @QueryParam(value = "keepDuplicates") Boolean keepDuplicates) throws WebApplicationException { // Make sure request is valid @@ -698,9 +768,21 @@ public Response getRoutes(@BeanParam StandardParameters stdParameters, @Path("/command/routesDetails") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Provides detailed information for a route.", + description="Provides detailed information for a route includes all stops " + + "and paths such that it can be drawn in a map.",tags= {"base data","route"}) public Response getRouteDetails(@BeanParam StandardParameters stdParameters, - @QueryParam(value = "r") List routeIdsOrShortNames, @QueryParam(value = "d") String directionId, - @QueryParam(value = "s") String stopId, @QueryParam(value = "tripPattern") String tripPatternId) + @Parameter(description="List of routeId or routeShortName. Example: r=1&r=2" ,required=false) + List routeIdsOrShortNames, + @Parameter(description="If set then only the shape for specified direction is marked as being for the UI." ,required=false) + @QueryParam(value = "d") String directionId, + @Parameter(description="If set then only this stop and the remaining ones on " + + "the trip pattern are marked as being for the UI and can be " + + "highlighted. Useful for when want to emphasize in the UI only " + + " the stops that are of interest to the user.",required=false) + @QueryParam(value = "s") String stopId, + @Parameter(description="If set then only the specified trip pattern is marked as being for the UI",required=false) + @QueryParam(value = "tripPattern") String tripPatternId) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -755,7 +837,13 @@ public Response getRouteDetails(@BeanParam StandardParameters stdParameters, @Path("/command/stops") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives bus stops from the server.", + description="Returns all stops associated with a route,"+ + " grouped by direction. Useful for creating a UI where user needs to select" + + " a stop from a list.",tags= {"base data","stop"}) public Response getStops(@BeanParam StandardParameters stdParameters, + @Parameter(description="if set, retrives only busstops belongind to the route. " + + "It might be routeId or route shrot name.",required=false) @QueryParam(value = "r") String routesIdOrShortNames) throws WebApplicationException { // Make sure request is valid @@ -794,7 +882,14 @@ public Response getStops(@BeanParam StandardParameters stdParameters, @Path("/command/block") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - public Response getBlock(@BeanParam StandardParameters stdParameters, @QueryParam(value = "blockId") String blockId, + @Operation(summary="Retrives configuration data for the specified block ID and service ID", + description="Retrives configuration data for the specified block ID and service ID. " + + "Includes all sub-data such as trips ans trip patterns." + + "Every trip is associated with a block.",tags= {"base data","trip","block"}) + public Response getBlock(@BeanParam StandardParameters stdParameters, + @Parameter(description="Block id to be asked.",required=true) + @QueryParam(value = "blockId") String blockId, + @Parameter(description="Service id to be asked.",required=true) @QueryParam(value = "serviceId") String serviceId) throws WebApplicationException { // Make sure request is valid @@ -835,7 +930,11 @@ public Response getBlock(@BeanParam StandardParameters stdParameters, @QueryPara @Path("/command/blocksTerse") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives configuration data for the specified block ID.", + description="Retrives configuration data for the specified block ID. It does not include trip patterns." + + "Every trip is associated with a block.",tags= {"base data","trip","block"}) public Response getBlocksTerse(@BeanParam StandardParameters stdParameters, + @Parameter(description="Block id to be asked.",required=true) @QueryParam(value = "blockId") String blockId) throws WebApplicationException { // Make sure request is valid @@ -873,8 +972,11 @@ public Response getBlocksTerse(@BeanParam StandardParameters stdParameters, @Path("/command/blocks") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives configuration data for the specified block ID", + description="Retrives configuration data for the specified block ID. Includes all sub-data such as trips and trip." + + "Every trip is associated with a block.",tags= {"base data","trip","block"}) public Response getBlocks(@BeanParam StandardParameters stdParameters, - @QueryParam(value = "blockId") String blockId) throws WebApplicationException { + @Parameter(description="Block id to be asked.",required=true) @QueryParam(value = "blockId") String blockId) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -908,7 +1010,12 @@ public Response getBlocks(@BeanParam StandardParameters stdParameters, @Path("/command/blockIds") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + + @Operation(summary="Retrives a list of all blockId for the specified service ID", + description="Retrives a list of all blockId for the specified service ID." + + "Every trip is associated with a block.",tags= {"base data","trip","block"}) public Response getBlockIds(@BeanParam StandardParameters stdParameters, + @Parameter(description="if set, returns only the data for that serviceId.",required=false) @QueryParam(value = "serviceId") String serviceId) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -947,8 +1054,16 @@ public Response getBlockIds(@BeanParam StandardParameters stdParameters, @Path("/command/activeBlocks") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Gets which blocks are active", + description="Retrives a list of active blocks. Optionally can be filered accorditn to routesIdOrShortNames params." + + "Every trip is associated with a block.",tags= {"prediction","trip","block"}) + public Response getActiveBlocks(@BeanParam StandardParameters stdParameters, + @Parameter(description="if set, retrives only active blocks belongind to the route. " + + "It might be routeId or route shrot name.",required=false) @QueryParam(value = "r") List routesIdOrShortNames, + @Parameter(description="A block will be active if the time is between the" + + " block start time minus allowableBeforeTimeSecs and the block end time") @QueryParam(value = "t") @DefaultValue("0") int allowableBeforeTimeSecs) throws WebApplicationException { // Make sure request is valid @@ -976,8 +1091,16 @@ public Response getActiveBlocks(@BeanParam StandardParameters stdParameters, @Path("/command/activeBlocksByRoute") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Gets which blocks are active by route", + description="Retrives a list routes with its active blocks. Optionally can be filered according to routesIdOrShortNames params." + + "Every trip is associated with a block.",tags= {"prediction","trip","block","route"}) + public Response getActiveBlocksByRoute(@BeanParam StandardParameters stdParameters, + @Parameter(description="if set, retrives only active blocks belongind to the route. " + + "It might be routeId or route shrot name.",required=false) @QueryParam(value = "r") List routesIdOrShortNames, + @Parameter(description="A block will be active if the time is between the block start time minus" + + " allowableBeforeTimeSecs and the block end time") @QueryParam(value = "t") @DefaultValue("0") int allowableBeforeTimeSecs) throws WebApplicationException { // Make sure request is valid @@ -1005,9 +1128,17 @@ public Response getActiveBlocksByRoute(@BeanParam StandardParameters stdParamete @Path("/command/activeBlocksByRouteWithoutVehicles") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Gets which blocks are active by route.", + description="Retrives a list routes with its active blocks, without the vechicles. Optionally " + + "can be filered accorditn to routesIdOrShortNames params." + + "Every trip is associated with a block.",tags= {"prediction","trip","block","route"}) public Response getActiveBlocksByRouteWithoutVehicles( @BeanParam StandardParameters stdParameters, + @Parameter(description="if set, retrives only active blocks belongind to the route. " + + "It might be routeId or route shrot name.",required=false) @QueryParam(value = "r") List routesIdOrShortNames, + @Parameter(description="A block will be active if the time is between the block start " + + "time minus allowableBeforeTimeSecs and the block end time") @QueryParam(value = "t") @DefaultValue("0") int allowableBeforeTimeSecs) throws WebApplicationException { @@ -1037,9 +1168,15 @@ public Response getActiveBlocksByRouteWithoutVehicles( @Path("/command/activeBlockByRouteWithVehicles") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Gets which blocks are active by route.", + description="Retrives a list routes with its active blocks, including the vechicles. " + + "Optionally can be filered accorditn to routesIdOrShortNames params." + + "Every trip is associated with a block.",tags= {"prediction","trip","block","route","vehicle"}) public Response getActiveBlockByRouteWithVehicles( @BeanParam StandardParameters stdParameters, + @Parameter(description="if set, retrives only active blocks belongind to the route. It might be routeId or route shrot name.",required=false) @QueryParam(value = "r") String routesIdOrShortName, + @Parameter(description="A block will be active if the time is between the block start time minus allowableBeforeTimeSecs and the block end time") @QueryParam(value = "t") @DefaultValue("0") int allowableBeforeTimeSecs) throws WebApplicationException { @@ -1067,9 +1204,15 @@ public Response getActiveBlockByRouteWithVehicles( @Path("/command/activeBlockByRouteNameWithVehicles") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Gets which blocks are active by routeName.", + description="Retrives a list routes with its active blocks, including the vechicles. " + + "Optionally can be filered accorditn to routesIdOrShortNames params." + + "Every trip is associated with a block.",tags= {"prediction","trip","block","route","vehicle"}) public Response getActiveBlockByRouteNameWithVehicles( @BeanParam StandardParameters stdParameters, + @Parameter(description="if set, retrives only active blocks belongind to the route name specified.",required=false) @QueryParam(value = "r") String routeName, + @Parameter(description="A block will be active if the time is between the block start time minus allowableBeforeTimeSecs and the block end time") @QueryParam(value = "t") @DefaultValue("0") int allowableBeforeTimeSecs) throws WebApplicationException { // Make sure request is valid @@ -1093,13 +1236,17 @@ public Response getActiveBlockByRouteNameWithVehicles( } } - @Path("/command/vehicleAdherenceSummary") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Returns the counters for the number of current vehicles running early, late or on time. ", + description="Returns the amount of vehicles running early, late or on time. " + + "Besides specify the amount of vehicles no predictables and the amount of active blocks.", + tags= {"prediction"}) public Response getVehicleAdherenceSummary(@BeanParam StandardParameters stdParameters, - @QueryParam(value = "allowableEarlySec") @DefaultValue("0") int allowableEarlySec, - @QueryParam(value = "allowableLateSec") @DefaultValue("0") int allowableLateSec, + @Parameter(description="The number of seconds early a vehicle has to be before it is considered in the early counter.", required=false) @QueryParam(value = "allowableEarlySec") @DefaultValue("0") int allowableEarlySec, + @Parameter(description="The number of seconds early a vehicle has to be before it is considered in the late counter.", required=false) @QueryParam(value = "allowableLateSec") @DefaultValue("0") int allowableLateSec, + @Parameter(description="A block will be active if the time is between the block start time minus allowableBeforeTimeSecs (t) and the block end time") @QueryParam(value = "t") @DefaultValue("0") int allowableBeforeTimeSecs) throws WebApplicationException { // Make sure request is valid @@ -1150,7 +1297,9 @@ else if (adh.isLaterThan(allowableLateSec)) @Path("/command/trip") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - public Response getTrip(@BeanParam StandardParameters stdParameters, @QueryParam(value = "tripId") String tripId) + @Operation(summary="Gets the configuration data of a trip.", + description="Gets the configuration data of a trip",tags= {"base data","trip"}) + public Response getTrip(@BeanParam StandardParameters stdParameters,@Parameter(description="Trip id",required=true) @QueryParam(value = "tripId") String tripId) throws WebApplicationException { // Make sure request is valid @@ -1188,8 +1337,10 @@ public Response getTrip(@BeanParam StandardParameters stdParameters, @QueryParam @Path("/command/tripWithTravelTimes") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Gets the configuration data of a trip.", + description="Gets the configuration data of a trip. Includes all sub-data such as trip patterns",tags= {"base data","trip"}) public Response getTripWithTravelTimes(@BeanParam StandardParameters stdParameters, - @QueryParam(value = "tripId") String tripId) throws WebApplicationException { + @Parameter(description="Trip id",required=true) @QueryParam(value = "tripId") String tripId) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -1224,6 +1375,9 @@ public Response getTripWithTravelTimes(@BeanParam StandardParameters stdParamete @Path("/command/tripIds") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives a list of all tripIds", + description="Retrives a list of all tripIds." + ,tags= {"base data","trip"}) public Response getTripIds(@BeanParam StandardParameters stdParameters) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -1253,8 +1407,11 @@ public Response getTripIds(@BeanParam StandardParameters stdParameters) throws W @Path("/command/tripPatterns") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives a list of all trip patters.", + description="Retrives a list of all trip patters for the specific routeId or routeShortName." + ,tags= {"base data","trip"}) public Response getTripPatterns(@BeanParam StandardParameters stdParameters, - @QueryParam(value = "r") String routesIdOrShortNames) throws WebApplicationException { + @Parameter(description="Specifies the routeId or routeShortName.",required=true)@QueryParam(value = "r") String routesIdOrShortNames) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -1292,8 +1449,13 @@ public Response getTripPatterns(@BeanParam StandardParameters stdParameters, @Path("/command/scheduleVertStops") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives schedule for the specified route.", + description="Retrives schedule for the specified route. The data is output such that the stops are listed " + + "vertically (and the trips are horizontal). For when there are a good number of stops but not as" + + " many trips, such as for commuter rail." + ,tags= {"base data","schedule"}) public Response getScheduleVertStops(@BeanParam StandardParameters stdParameters, - @QueryParam(value = "r") String routesIdOrShortNames) throws WebApplicationException { + @Parameter(description="Specifies the routeId or routeShortName.",required=true) @QueryParam(value = "r") String routesIdOrShortNames) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -1331,8 +1493,13 @@ public Response getScheduleVertStops(@BeanParam StandardParameters stdParameters @Path("/command/scheduleHorizStops") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives schedule for the specified route.", + description="Retrives schedule for the specified route. The data is output such that the stops are listed " + + "horizontally (and the trips are vertical). For when there are a good number of stops but not as" + + " many trips, such as for commuter rail." + ,tags= {"base data","schedule"}) public Response getScheduleHorizStops(@BeanParam StandardParameters stdParameters, - @QueryParam(value = "r") String routesIdOrShortNames) throws WebApplicationException { + @Parameter(description="Specifies the routeId or routeShortName.",required=true) @QueryParam(value = "r") String routesIdOrShortNames) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -1366,6 +1533,7 @@ public Response getScheduleHorizStops(@BeanParam StandardParameters stdParameter @Path("/command/agencyGroup") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives agency infomation.",description="Retrives agency infomation, including extent.",tags= {"base data","agency"}) public Response getAgencyGroup(@BeanParam StandardParameters stdParameters) throws WebApplicationException { // Make sure request is valid @@ -1399,6 +1567,7 @@ public Response getAgencyGroup(@BeanParam StandardParameters stdParameters) thro @Path("/command/currentCalendars") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives current calendar infomation.",description="Retrives current calendar infomation. Only teh calendar that applies to current day",tags= {"base data","calendar","serviceId"}) public Response getCurrentCalendars(@BeanParam StandardParameters stdParameters) throws WebApplicationException { // Make sure request is valid @@ -1428,6 +1597,7 @@ public Response getCurrentCalendars(@BeanParam StandardParameters stdParameters) @Path("/command/allCalendars") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives all calendar infomation.",description="Retrives all calendar infomation.",tags= {"base data","calendar","serviceId"}) public Response getAllCalendars(@BeanParam StandardParameters stdParameters) throws WebApplicationException { // Make sure request is valid @@ -1457,6 +1627,7 @@ public Response getAllCalendars(@BeanParam StandardParameters stdParameters) thr @Path("/command/serviceIds") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives all service id.",description="Retrives all service id.",tags= {"base data","serviceId"}) public Response getServiceIds(@BeanParam StandardParameters stdParameters) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -1485,6 +1656,7 @@ public Response getServiceIds(@BeanParam StandardParameters stdParameters) throw @Path("/command/currentServiceIds") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives current service id.",description="Retrives current service id.",tags= {"base data","serviceId"}) public Response getCurrentServiceIds(@BeanParam StandardParameters stdParameters) throws WebApplicationException { // Make sure request is valid stdParameters.validate(); @@ -1513,6 +1685,7 @@ public Response getCurrentServiceIds(@BeanParam StandardParameters stdParameters @Path("/command/serverStatus") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives server status information.",description="Retrives server status information.",tags= {"server status"}) public Response getServerStatus(@BeanParam StandardParameters stdParameters) throws WebApplicationException { // Make sure request is valid @@ -1543,6 +1716,7 @@ public Response getServerStatus(@BeanParam StandardParameters stdParameters) thr @Path("/command/rmiStatus") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives RMI status information.",description="Retrives RMI server status information.",tags= {"server status"}) public Response getRmiStatus(@BeanParam StandardParameters stdParameters) throws WebApplicationException { // Make sure request is valid @@ -1555,6 +1729,7 @@ public Response getRmiStatus(@BeanParam StandardParameters stdParameters) throws @Path("/command/currentServerTime") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Retrives server time.",description="Retrives server time",tags= {"server status"}) public Response getCurrentServerTime(@BeanParam StandardParameters stdParameters) throws WebApplicationException, RemoteException { // Make sure request is valid stdParameters.validate(); diff --git a/transitclockApi/src/main/java/org/transitclock/api/rootResources/TransitimeNonAgencyApi.java b/transitclockApi/src/main/java/org/transitclock/api/rootResources/TransitimeNonAgencyApi.java index 58d2b83d6..0d8bfe04b 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/rootResources/TransitimeNonAgencyApi.java +++ b/transitclockApi/src/main/java/org/transitclock/api/rootResources/TransitimeNonAgencyApi.java @@ -48,6 +48,10 @@ import org.transitclock.ipc.interfaces.ConfigInterface; import org.transitclock.ipc.interfaces.PredictionsInterface; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.servers.Servers; + /** * Contains the API commands for the Transitime API for system wide commands, * such as determining all agencies. The intent of this feed is to provide what @@ -76,6 +80,8 @@ public class TransitimeNonAgencyApi { @Path("/command/agencies") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Rerives all tha agencies managed by the server.", + description="Rerives all tha agencies managed by the server.",tags= {"base data","agency"}) public Response getAgencies(@BeanParam StandardParameters stdParameters) throws WebApplicationException { // Make sure request is valid @@ -135,6 +141,9 @@ public Response getAgencies(@BeanParam StandardParameters stdParameters) @Path("/command/predictionsByLoc") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Gets predictions from server by location", + description="Gets a list of prediction by location for all angencies managed by the api.", + tags= {"prediction"}) public Response getPredictions( @BeanParam StandardParameters stdParameters, @QueryParam(value = "lat") Double lat, diff --git a/transitclockApi/src/main/java/org/transitclock/api/rootResources/package-info.java b/transitclockApi/src/main/java/org/transitclock/api/rootResources/package-info.java index 87f1ea053..9c66e6ab4 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/rootResources/package-info.java +++ b/transitclockApi/src/main/java/org/transitclock/api/rootResources/package-info.java @@ -19,4 +19,4 @@ * Contains descriptions of all of all of the API calls * and specifies their syntax. */ -package org.transitclock.api.rootResources; \ No newline at end of file +package org.transitclock.api.rootResources; diff --git a/transitclockApi/src/main/java/org/transitclock/api/utils/StandardParameters.java b/transitclockApi/src/main/java/org/transitclock/api/utils/StandardParameters.java index cb8f56297..1a2052e8b 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/utils/StandardParameters.java +++ b/transitclockApi/src/main/java/org/transitclock/api/utils/StandardParameters.java @@ -47,6 +47,8 @@ import org.transitclock.ipc.interfaces.ServerStatusInterface; import org.transitclock.ipc.interfaces.VehiclesInterface; +import io.swagger.v3.oas.annotations.Parameter; + /** * For getting the standard parameters from the URI used to access the feed. * Includes the key, agency, and the media type (JSON or XML). Does not include @@ -57,9 +59,11 @@ */ public class StandardParameters { @PathParam("key") + @Parameter(description="Application key to access this api.") private String key; @PathParam("agency") + @Parameter(description="Specify the agency the request is intended to.") private String agencyId; @QueryParam("format") diff --git a/transitclockApi/src/main/java/org/transitclock/servlet/swagger/ApiOriginFilter.java b/transitclockApi/src/main/java/org/transitclock/servlet/swagger/ApiOriginFilter.java new file mode 100644 index 000000000..6940892e6 --- /dev/null +++ b/transitclockApi/src/main/java/org/transitclock/servlet/swagger/ApiOriginFilter.java @@ -0,0 +1,42 @@ +/** + * Copyright 2016 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.transitclock.servlet.swagger; + +import java.io.IOException; + +import javax.servlet.*; +import javax.servlet.http.HttpServletResponse; + +public class ApiOriginFilter implements javax.servlet.Filter { + @Override + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + HttpServletResponse res = (HttpServletResponse) response; + res.addHeader("Access-Control-Allow-Origin", "*"); + res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); + res.addHeader("Access-Control-Allow-Headers", "Content-Type"); + chain.doFilter(request, response); + } + + @Override + public void destroy() { + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + } +} \ No newline at end of file diff --git a/transitclockApi/src/main/webapp/WEB-INF/web.xml b/transitclockApi/src/main/webapp/WEB-INF/web.xml index 47dacf644..464f9d906 100644 --- a/transitclockApi/src/main/webapp/WEB-INF/web.xml +++ b/transitclockApi/src/main/webapp/WEB-INF/web.xml @@ -4,15 +4,14 @@ version="3.0"> The Transit Clock api - transitime_config_file_location - - /usr/local/transitclock/config/transitclockConfig.xml - + /Users/vperez/git/transitime/transitclockWebapp/src/main/resources/transiTimeconfig.xml + + org.transitclock.web.ReadConfigListener @@ -28,13 +27,62 @@ /error/messageOnlyError.jsp + ApiLoggingFilter org.transitclock.api.utils.ApiLoggingFilter ApiLoggingFilter - /* + /api/* + + + + + + jersey + org.glassfish.jersey.servlet.ServletContainer + + jersey.config.server.wadl.disableWadl + true + + + jersey.config.server.provider.packages + + + io.swagger.v3.jaxrs2.integration.resources, org.transitclock.api.rootResources,org.transitclock.api.utils + + + + openApi.configuration.prettyPrint + true + + + 1 + + + + jersey + /doc/* + + + + ApiOriginFilter + org.transitclock.servlet.swagger.ApiOriginFilter + + + + ApiOriginFilter + /* + + + + diff --git a/transitclockApi/src/main/webapp/doc.html b/transitclockApi/src/main/webapp/doc.html new file mode 100644 index 000000000..d15e64334 --- /dev/null +++ b/transitclockApi/src/main/webapp/doc.html @@ -0,0 +1,64 @@ + + + + + + Swagger UI + + + + + + + + +
+ + +
+ + + + + + diff --git a/transitclockApi/src/main/webapp/oauth2-redirect.html b/transitclockApi/src/main/webapp/oauth2-redirect.html new file mode 100644 index 000000000..fb68399d2 --- /dev/null +++ b/transitclockApi/src/main/webapp/oauth2-redirect.html @@ -0,0 +1,67 @@ + + + + + + diff --git a/transitclockApi/src/main/webapp/swagger-ui-bundle.js b/transitclockApi/src/main/webapp/swagger-ui-bundle.js new file mode 100644 index 000000000..2215aa3a1 --- /dev/null +++ b/transitclockApi/src/main/webapp/swagger-ui-bundle.js @@ -0,0 +1,104 @@ +!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,function(){return function(e){var t={};function __webpack_require__(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="/dist",__webpack_require__(__webpack_require__.s=491)}([function(e,t,r){"use strict";e.exports=r(77)},function(e,t,r){e.exports=r(898)()},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,r){"use strict";t.__esModule=!0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(285));t.default=function(){function defineProperties(e,t){for(var r=0;r>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?ensureSize(e)+t:t}function returnTrue(){return!0}function wholeSlice(e,t,r){return(0===e||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function resolveBegin(e,t){return resolveIndex(e,t,0)}function resolveEnd(e,t){return resolveIndex(e,t,t)}function resolveIndex(e,t,r){return void 0===e?r:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var p=0,f=1,d=2,h="function"==typeof Symbol&&Symbol.iterator,m="@@iterator",v=h||m;function Iterator(e){this.next=e}function iteratorValue(e,t,r,n){var i=0===e?t:1===e?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function iteratorDone(){return{value:void 0,done:!0}}function hasIterator(e){return!!getIteratorFn(e)}function isIterator(e){return e&&"function"==typeof e.next}function getIterator(e){var t=getIteratorFn(e);return t&&t.call(e)}function getIteratorFn(e){var t=e&&(h&&e[h]||e[m]);if("function"==typeof t)return t}function isArrayLike(e){return e&&"number"==typeof e.length}function Seq(e){return null===e||void 0===e?emptySequence():isIterable(e)?e.toSeq():function seqFromValue(e){var t=maybeIndexedSeqFromValue(e)||"object"==typeof e&&new ObjectSeq(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function KeyedSeq(e){return null===e||void 0===e?emptySequence().toKeyedSeq():isIterable(e)?isKeyed(e)?e.toSeq():e.fromEntrySeq():keyedSeqFromValue(e)}function IndexedSeq(e){return null===e||void 0===e?emptySequence():isIterable(e)?isKeyed(e)?e.entrySeq():e.toIndexedSeq():indexedSeqFromValue(e)}function SetSeq(e){return(null===e||void 0===e?emptySequence():isIterable(e)?isKeyed(e)?e.entrySeq():e:indexedSeqFromValue(e)).toSetSeq()}Iterator.prototype.toString=function(){return"[Iterator]"},Iterator.KEYS=p,Iterator.VALUES=f,Iterator.ENTRIES=d,Iterator.prototype.inspect=Iterator.prototype.toSource=function(){return this.toString()},Iterator.prototype[v]=function(){return this},createClass(Seq,Iterable),Seq.of=function(){return Seq(arguments)},Seq.prototype.toSeq=function(){return this},Seq.prototype.toString=function(){return this.__toString("Seq {","}")},Seq.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},Seq.prototype.__iterate=function(e,t){return seqIterate(this,e,t,!0)},Seq.prototype.__iterator=function(e,t){return seqIterator(this,e,t,!0)},createClass(KeyedSeq,Seq),KeyedSeq.prototype.toKeyedSeq=function(){return this},createClass(IndexedSeq,Seq),IndexedSeq.of=function(){return IndexedSeq(arguments)},IndexedSeq.prototype.toIndexedSeq=function(){return this},IndexedSeq.prototype.toString=function(){return this.__toString("Seq [","]")},IndexedSeq.prototype.__iterate=function(e,t){return seqIterate(this,e,t,!1)},IndexedSeq.prototype.__iterator=function(e,t){return seqIterator(this,e,t,!1)},createClass(SetSeq,Seq),SetSeq.of=function(){return SetSeq(arguments)},SetSeq.prototype.toSetSeq=function(){return this},Seq.isSeq=isSeq,Seq.Keyed=KeyedSeq,Seq.Set=SetSeq,Seq.Indexed=IndexedSeq;var g,y,_,b="@@__IMMUTABLE_SEQ__@@";function ArraySeq(e){this._array=e,this.size=e.length}function ObjectSeq(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function IterableSeq(e){this._iterable=e,this.size=e.length||e.size}function IteratorSeq(e){this._iterator=e,this._iteratorCache=[]}function isSeq(e){return!(!e||!e[b])}function emptySequence(){return g||(g=new ArraySeq([]))}function keyedSeqFromValue(e){var t=Array.isArray(e)?new ArraySeq(e).fromEntrySeq():isIterator(e)?new IteratorSeq(e).fromEntrySeq():hasIterator(e)?new IterableSeq(e).fromEntrySeq():"object"==typeof e?new ObjectSeq(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function indexedSeqFromValue(e){var t=maybeIndexedSeqFromValue(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function maybeIndexedSeqFromValue(e){return isArrayLike(e)?new ArraySeq(e):isIterator(e)?new IteratorSeq(e):hasIterator(e)?new IterableSeq(e):void 0}function seqIterate(e,t,r,n){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[r?o-a:a];if(!1===t(s[1],n?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,r)}function seqIterator(e,t,r,n){var i=e._cache;if(i){var o=i.length-1,a=0;return new Iterator(function(){var e=i[r?o-a:a];return a++>o?{value:void 0,done:!0}:iteratorValue(t,n?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,r)}function fromJS(e,t){return t?function fromJSWith(e,t,r,n){if(Array.isArray(t))return e.call(n,r,IndexedSeq(t).map(function(r,n){return fromJSWith(e,r,n,t)}));if(isPlainObj(t))return e.call(n,r,KeyedSeq(t).map(function(r,n){return fromJSWith(e,r,n,t)}));return t}(t,e,"",{"":e}):fromJSDefault(e)}function fromJSDefault(e){return Array.isArray(e)?IndexedSeq(e).map(fromJSDefault).toList():isPlainObj(e)?KeyedSeq(e).map(fromJSDefault).toMap():e}function isPlainObj(e){return e&&(e.constructor===Object||void 0===e.constructor)}function is(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function deepEqual(e,t){if(e===t)return!0;if(!isIterable(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||isKeyed(e)!==isKeyed(t)||isIndexed(e)!==isIndexed(t)||isOrdered(e)!==isOrdered(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!isAssociative(e);if(isOrdered(e)){var n=e.entries();return t.every(function(e,t){var i=n.next().value;return i&&is(i[1],e)&&(r||is(i[0],t))})&&n.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var a=!0,s=t.__iterate(function(t,n){if(r?!e.has(t):i?!is(t,e.get(n,u)):!is(e.get(n,u),t))return a=!1,!1});return a&&e.size===s}function Repeat(e,t){if(!(this instanceof Repeat))return new Repeat(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(y)return y;y=this}}function invariant(e,t){if(!e)throw new Error(t)}function Range(e,t,r){if(!(this instanceof Range))return new Range(e,t,r);if(invariant(0!==r,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),r=void 0===r?1:Math.abs(r),tn?{value:void 0,done:!0}:iteratorValue(e,i,r[t?n-i++:i++])})},createClass(ObjectSeq,KeyedSeq),ObjectSeq.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ObjectSeq.prototype.has=function(e){return this._object.hasOwnProperty(e)},ObjectSeq.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,i=n.length-1,o=0;o<=i;o++){var a=n[t?i-o:o];if(!1===e(r[a],a,this))return o+1}return o},ObjectSeq.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,i=n.length-1,o=0;return new Iterator(function(){var a=n[t?i-o:o];return o++>i?{value:void 0,done:!0}:iteratorValue(e,a,r[a])})},ObjectSeq.prototype[i]=!0,createClass(IterableSeq,IndexedSeq),IterableSeq.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=getIterator(this._iterable),n=0;if(isIterator(r))for(var i;!(i=r.next()).done&&!1!==e(i.value,n++,this););return n},IterableSeq.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=getIterator(this._iterable);if(!isIterator(r))return new Iterator(iteratorDone);var n=0;return new Iterator(function(){var t=r.next();return t.done?t:iteratorValue(e,n++,t.value)})},createClass(IteratorSeq,IndexedSeq),IteratorSeq.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var r,n=this._iterator,i=this._iteratorCache,o=0;o=n.length){var t=r.next();if(t.done)return t;n[i]=t.value}return iteratorValue(e,i,n[i++])})},createClass(Repeat,IndexedSeq),Repeat.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Repeat.prototype.get=function(e,t){return this.has(e)?this._value:t},Repeat.prototype.includes=function(e){return is(this._value,e)},Repeat.prototype.slice=function(e,t){var r=this.size;return wholeSlice(e,t,r)?this:new Repeat(this._value,resolveEnd(t,r)-resolveBegin(e,r))},Repeat.prototype.reverse=function(){return this},Repeat.prototype.indexOf=function(e){return is(this._value,e)?0:-1},Repeat.prototype.lastIndexOf=function(e){return is(this._value,e)?this.size:-1},Repeat.prototype.__iterate=function(e,t){for(var r=0;r=0&&t=0&&rr?{value:void 0,done:!0}:iteratorValue(e,o++,a)})},Range.prototype.equals=function(e){return e instanceof Range?this._start===e._start&&this._end===e._end&&this._step===e._step:deepEqual(this,e)},createClass(Collection,Iterable),createClass(KeyedCollection,Collection),createClass(IndexedCollection,Collection),createClass(SetCollection,Collection),Collection.Keyed=KeyedCollection,Collection.Indexed=IndexedCollection,Collection.Set=SetCollection;var S="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function imul(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function smi(e){return e>>>1&1073741824|3221225471&e}function hash(e){if(!1===e||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null===e||void 0===e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var r=0|e;for(r!==e&&(r^=4294967295*e);e>4294967295;)r^=e/=4294967295;return smi(r)}if("string"===t)return e.length>A?function cachedHashString(e){var t=T[e];void 0===t&&(t=hashString(e),M===R&&(M=0,T={}),M++,T[e]=t);return t}(e):hashString(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function hashJSObj(e){var t;if(C&&void 0!==(t=E.get(e)))return t;if(void 0!==(t=e[D]))return t;if(!x){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[D]))return t;if(void 0!==(t=function getIENodeHash(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}t=++w,1073741824&w&&(w=0);if(C)E.set(e,t);else{if(void 0!==k&&!1===k(e))throw new Error("Non-extensible objects are not allowed as keys.");if(x)Object.defineProperty(e,D,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[D]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[D]=t}}return t}(e);if("function"==typeof e.toString)return hashString(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function hashString(e){for(var t=0,r=0;r=t.length)throw new Error("Missing value for key: "+t[r]);e.set(t[r],t[r+1])}})},Map.prototype.toString=function(){return this.__toString("Map {","}")},Map.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Map.prototype.set=function(e,t){return updateMap(this,e,t)},Map.prototype.setIn=function(e,t){return this.updateIn(e,u,function(){return t})},Map.prototype.remove=function(e){return updateMap(this,e,u)},Map.prototype.deleteIn=function(e){return this.updateIn(e,function(){return u})},Map.prototype.update=function(e,t,r){return 1===arguments.length?e(this):this.updateIn([e],t,r)},Map.prototype.updateIn=function(e,t,r){r||(r=t,t=void 0);var n=function updateInDeepMap(e,t,r,n){var i=e===u;var o=t.next();if(o.done){var a=i?r:e,s=n(a);return s===a?e:s}invariant(i||e&&e.set,"invalid keyPath");var l=o.value;var c=i?u:e.get(l,u);var p=updateInDeepMap(c,t,r,n);return p===c?e:p===u?e.remove(l):(i?emptyMap():e).set(l,p)}(this,forceIterator(e),t,r);return n===u?void 0:n},Map.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):emptyMap()},Map.prototype.merge=function(){return mergeIntoMapWith(this,void 0,arguments)},Map.prototype.mergeWith=function(t){return mergeIntoMapWith(this,t,e.call(arguments,1))},Map.prototype.mergeIn=function(t){var r=e.call(arguments,1);return this.updateIn(t,emptyMap(),function(e){return"function"==typeof e.merge?e.merge.apply(e,r):r[r.length-1]})},Map.prototype.mergeDeep=function(){return mergeIntoMapWith(this,deepMerger,arguments)},Map.prototype.mergeDeepWith=function(t){var r=e.call(arguments,1);return mergeIntoMapWith(this,deepMergerWith(t),r)},Map.prototype.mergeDeepIn=function(t){var r=e.call(arguments,1);return this.updateIn(t,emptyMap(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,r):r[r.length-1]})},Map.prototype.sort=function(e){return OrderedMap(sortFactory(this,e))},Map.prototype.sortBy=function(e,t){return OrderedMap(sortFactory(this,t,e))},Map.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Map.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)},Map.prototype.asImmutable=function(){return this.__ensureOwner()},Map.prototype.wasAltered=function(){return this.__altered},Map.prototype.__iterator=function(e,t){return new MapIterator(this,e,t)},Map.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate(function(t){return n++,e(t[1],t[0],r)},t),n},Map.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?makeMap(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Map.isMap=isMap;var O,P="@@__IMMUTABLE_MAP__@@",I=Map.prototype;function ArrayMapNode(e,t){this.ownerID=e,this.entries=t}function BitmapIndexedNode(e,t,r){this.ownerID=e,this.bitmap=t,this.nodes=r}function HashArrayMapNode(e,t,r){this.ownerID=e,this.count=t,this.nodes=r}function HashCollisionNode(e,t,r){this.ownerID=e,this.keyHash=t,this.entries=r}function ValueNode(e,t,r){this.ownerID=e,this.keyHash=t,this.entry=r}function MapIterator(e,t,r){this._type=t,this._reverse=r,this._stack=e._root&&mapIteratorFrame(e._root)}function mapIteratorValue(e,t){return iteratorValue(e,t[0],t[1])}function mapIteratorFrame(e,t){return{node:e,index:0,__prev:t}}function makeMap(e,t,r,n){var i=Object.create(I);return i.size=e,i._root=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function emptyMap(){return O||(O=makeMap(0))}function updateMap(e,t,r){var n,i;if(e._root){var o=MakeRef(l),a=MakeRef(c);if(n=updateNode(e._root,e.__ownerID,0,void 0,t,r,o,a),!a.value)return e;i=e.size+(o.value?r===u?-1:1:0)}else{if(r===u)return e;i=1,n=new ArrayMapNode(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=i,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?makeMap(i,n):emptyMap()}function updateNode(e,t,r,n,i,o,a,s){return e?e.update(t,r,n,i,o,a,s):o===u?e:(SetRef(s),SetRef(a),new ValueNode(t,n,[i,o]))}function isLeafNode(e){return e.constructor===ValueNode||e.constructor===HashCollisionNode}function mergeIntoNode(e,t,r,n,i){if(e.keyHash===n)return new HashCollisionNode(t,n,[e.entry,i]);var a,u=(0===r?e.keyHash:e.keyHash>>>r)&s,l=(0===r?n:n>>>r)&s;return new BitmapIndexedNode(t,1<>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function setIn(e,t,r,n){var i=n?e:arrCopy(e);return i[t]=r,i}I[P]=!0,I.delete=I.remove,I.removeIn=I.deleteIn,ArrayMapNode.prototype.get=function(e,t,r,n){for(var i=this.entries,o=0,a=i.length;o=q)return function createNodes(e,t,r,n){e||(e=new OwnerID);for(var i=new ValueNode(e,hash(r),[r,n]),o=0;o>>e)&s),a=this.bitmap;return 0==(a&i)?n:this.nodes[popCount(a&i-1)].get(e+o,t,r,n)},BitmapIndexedNode.prototype.update=function(e,t,r,n,i,l,c){void 0===r&&(r=hash(n));var p=(0===t?r:r>>>t)&s,f=1<=F)return function expandNodes(e,t,r,n,i){for(var o=0,s=new Array(a),u=0;0!==r;u++,r>>>=1)s[u]=1&r?t[o++]:void 0;return s[n]=i,new HashArrayMapNode(e,o+1,s)}(e,v,d,p,y);if(h&&!y&&2===v.length&&isLeafNode(v[1^m]))return v[1^m];if(h&&y&&1===v.length&&isLeafNode(y))return y;var _=e&&e===this.ownerID,b=h?y?d:d^f:d|f,S=h?y?setIn(v,m,y,_):function spliceOut(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var i=new Array(n),o=0,a=0;a>>e)&s,a=this.nodes[i];return a?a.get(e+o,t,r,n):n},HashArrayMapNode.prototype.update=function(e,t,r,n,i,a,l){void 0===r&&(r=hash(n));var c=(0===t?r:r>>>t)&s,p=i===u,f=this.nodes,d=f[c];if(p&&!d)return this;var h=updateNode(d,e,t+o,r,n,i,a,l);if(h===d)return this;var m=this.count;if(d){if(!h&&--m0&&n=0&&e=e.size||t<0)return e.withMutations(function(e){t<0?setListBounds(e,t).set(0,r):setListBounds(e,0,t+1).set(t,r)});t+=e._origin;var n=e._tail,i=e._root,o=MakeRef(c);t>=getTailOffset(e._capacity)?n=updateVNode(n,e.__ownerID,0,t,r,o):i=updateVNode(i,e.__ownerID,e._level,t,r,o);if(!o.value)return e;if(e.__ownerID)return e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e;return makeList(e._origin,e._capacity,e._level,i,n)}(this,e,t)},List.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},List.prototype.insert=function(e,t){return this.splice(e,0,t)},List.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=o,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):emptyList()},List.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(r){setListBounds(r,0,t+e.length);for(var n=0;n>>t&s;if(n>=this.array.length)return new VNode([],e);var i,a=0===n;if(t>0){var u=this.array[n];if((i=u&&u.removeBefore(e,t-o,r))===u&&a)return this}if(a&&!i)return this;var l=editableVNode(this,e);if(!a)for(var c=0;c>>t&s;if(i>=this.array.length)return this;if(t>0){var a=this.array[i];if((n=a&&a.removeAfter(e,t-o,r))===a&&i===this.array.length-1)return this}var u=editableVNode(this,e);return u.array.splice(i+1),n&&(u.array[i]=n),u};var L,z,U={};function iterateList(e,t){var r=e._origin,n=e._capacity,i=getTailOffset(n),s=e._tail;return iterateNodeOrLeaf(e._root,e._level,0);function iterateNodeOrLeaf(e,u,l){return 0===u?function iterateLeaf(e,o){var u=o===i?s&&s.array:e&&e.array,l=o>r?0:r-o,c=n-o;c>a&&(c=a);return function(){if(l===c)return U;var e=t?--c:l++;return u&&u[e]}}(e,l):function iterateNode(e,i,s){var u,l=e&&e.array,c=s>r?0:r-s>>i,p=1+(n-s>>i);p>a&&(p=a);return function(){for(;;){if(u){var e=u();if(e!==U)return e;u=null}if(c===p)return U;var r=t?--p:c++;u=iterateNodeOrLeaf(l&&l[r],i-o,s+(r<>>r&s,c=e&&l0){var p=e&&e.array[l],f=updateVNode(p,t,r-o,n,i,a);return f===p?e:((u=editableVNode(e,t)).array[l]=f,u)}return c&&e.array[l]===i?e:(SetRef(a),u=editableVNode(e,t),void 0===i&&l===u.array.length-1?u.array.pop():u.array[l]=i,u)}function editableVNode(e,t){return t&&e&&t===e.ownerID?e:new VNode(e?e.array.slice():[],t)}function listNodeFor(e,t){if(t>=getTailOffset(e._capacity))return e._tail;if(t<1<0;)r=r.array[t>>>n&s],n-=o;return r}}function setListBounds(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new OwnerID,i=e._origin,a=e._capacity,u=i+t,l=void 0===r?a:r<0?a+r:i+r;if(u===i&&l===a)return e;if(u>=l)return e.clear();for(var c=e._level,p=e._root,f=0;u+f<0;)p=new VNode(p&&p.array.length?[void 0,p]:[],n),f+=1<<(c+=o);f&&(u+=f,i+=f,l+=f,a+=f);for(var d=getTailOffset(a),h=getTailOffset(l);h>=1<d?new VNode([],n):m;if(m&&h>d&&uo;y-=o){var _=d>>>y&s;g=g.array[_]=editableVNode(g.array[_],n)}g.array[d>>>o&s]=m}if(l=h)u-=h,l-=h,c=o,p=null,v=v&&v.removeBefore(n,0,u);else if(u>i||h>>c&s;if(b!==h>>>c&s)break;b&&(f+=(1<i&&(p=p.removeBefore(n,c,u-f)),p&&hi&&(i=s.size),isIterable(a)||(s=s.map(function(e){return fromJS(e)})),n.push(s)}return i>e.size&&(e=e.setSize(i)),mergeIntoCollectionWith(e,t,n)}function getTailOffset(e){return e>>o<=a&&s.size>=2*o.size?(n=(i=s.filter(function(e,t){return void 0!==e&&l!==t})).toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(n.__ownerID=i.__ownerID=e.__ownerID)):(n=o.remove(t),i=l===s.size-1?s.pop():s.set(l,void 0))}else if(c){if(r===s.get(l)[1])return e;n=o,i=s.set(l,[t,r])}else n=o.set(t,s.size),i=s.set(s.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=i,e.__hash=void 0,e):makeOrderedMap(n,i)}function ToKeyedSequence(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function ToIndexedSequence(e){this._iter=e,this.size=e.size}function ToSetSequence(e){this._iter=e,this.size=e.size}function FromEntriesSequence(e){this._iter=e,this.size=e.size}function flipFactory(e){var t=makeSequence(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=cacheResultThrough,t.__iterateUncached=function(t,r){var n=this;return e.__iterate(function(e,r){return!1!==t(r,e,n)},r)},t.__iteratorUncached=function(t,r){if(t===d){var n=e.__iterator(t,r);return new Iterator(function(){var e=n.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===f?p:f,r)},t}function mapFactory(e,t,r){var n=makeSequence(e);return n.size=e.size,n.has=function(t){return e.has(t)},n.get=function(n,i){var o=e.get(n,u);return o===u?i:t.call(r,o,n,e)},n.__iterateUncached=function(n,i){var o=this;return e.__iterate(function(e,i,a){return!1!==n(t.call(r,e,i,a),i,o)},i)},n.__iteratorUncached=function(n,i){var o=e.__iterator(d,i);return new Iterator(function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return iteratorValue(n,s,t.call(r,a[1],s,e),i)})},n}function reverseFactory(e,t){var r=makeSequence(e);return r._iter=e,r.size=e.size,r.reverse=function(){return e},e.flip&&(r.flip=function(){var t=flipFactory(e);return t.reverse=function(){return e.flip()},t}),r.get=function(r,n){return e.get(t?r:-1-r,n)},r.has=function(r){return e.has(t?r:-1-r)},r.includes=function(t){return e.includes(t)},r.cacheResult=cacheResultThrough,r.__iterate=function(t,r){var n=this;return e.__iterate(function(e,r){return t(e,r,n)},!r)},r.__iterator=function(t,r){return e.__iterator(t,!r)},r}function filterFactory(e,t,r,n){var i=makeSequence(e);return n&&(i.has=function(n){var i=e.get(n,u);return i!==u&&!!t.call(r,i,n,e)},i.get=function(n,i){var o=e.get(n,u);return o!==u&&t.call(r,o,n,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate(function(e,o,u){if(t.call(r,e,o,u))return s++,i(e,n?o:s-1,a)},o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(d,o),s=0;return new Iterator(function(){for(;;){var o=a.next();if(o.done)return o;var u=o.value,l=u[0],c=u[1];if(t.call(r,c,l,e))return iteratorValue(i,n?l:s++,c,o)}})},i}function sliceFactory(e,t,r,n){var i=e.size;if(void 0!==t&&(t|=0),void 0!==r&&(r===1/0?r=i:r|=0),wholeSlice(t,r,i))return e;var o=resolveBegin(t,i),a=resolveEnd(r,i);if(o!=o||a!=a)return sliceFactory(e.toSeq().cacheResult(),t,r,n);var s,u=a-o;u==u&&(s=u<0?0:u);var l=makeSequence(e);return l.size=0===s?s:e.size&&s||void 0,!n&&isSeq(e)&&s>=0&&(l.get=function(t,r){return(t=wrapIndex(this,t))>=0&&ts)return{value:void 0,done:!0};var e=i.next();return n||t===f?e:iteratorValue(t,u-1,t===p?void 0:e.value[1],e)})},l}function skipWhileFactory(e,t,r,n){var i=makeSequence(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,u=0;return e.__iterate(function(e,o,l){if(!s||!(s=t.call(r,e,o,l)))return u++,i(e,n?o:u-1,a)}),u},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(d,o),u=!0,l=0;return new Iterator(function(){var e,o,c;do{if((e=s.next()).done)return n||i===f?e:iteratorValue(i,l++,i===p?void 0:e.value[1],e);var h=e.value;o=h[0],c=h[1],u&&(u=t.call(r,c,o,a))}while(u);return i===d?e:iteratorValue(i,o,c,e)})},i}function flattenFactory(e,t,r){var n=makeSequence(e);return n.__iterateUncached=function(n,i){var o=0,a=!1;return function flatDeep(e,s){var u=this;e.__iterate(function(e,i){return(!t||s0}function zipWithFactory(e,t,r){var n=makeSequence(e);return n.size=new ArraySeq(r).map(function(e){return e.size}).min(),n.__iterate=function(e,t){for(var r,n=this.__iterator(f,t),i=0;!(r=n.next()).done&&!1!==e(r.value,i++,this););return i},n.__iteratorUncached=function(e,n){var i=r.map(function(e){return e=Iterable(e),getIterator(n?e.reverse():e)}),o=0,a=!1;return new Iterator(function(){var r;return a||(r=i.map(function(e){return e.next()}),a=r.some(function(e){return e.done})),a?{value:void 0,done:!0}:iteratorValue(e,o++,t.apply(null,r.map(function(e){return e.value})))})},n}function reify(e,t){return isSeq(e)?t:e.constructor(t)}function validateEntry(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function resolveSize(e){return assertNotInfinite(e.size),ensureSize(e)}function iterableClass(e){return isKeyed(e)?KeyedIterable:isIndexed(e)?IndexedIterable:SetIterable}function makeSequence(e){return Object.create((isKeyed(e)?KeyedSeq:isIndexed(e)?IndexedSeq:SetSeq).prototype)}function cacheResultThrough(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Seq.prototype.cacheResult.call(this)}function defaultComparator(e,t){return e>t?1:e=0;r--)t={value:arguments[r],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):makeStack(e,t)},Stack.prototype.pushAll=function(e){if(0===(e=IndexedIterable(e)).size)return this;assertNotInfinite(e.size);var t=this.size,r=this._head;return e.reverse().forEach(function(e){t++,r={value:e,next:r}}),this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):makeStack(t,r)},Stack.prototype.pop=function(){return this.slice(1)},Stack.prototype.unshift=function(){return this.push.apply(this,arguments)},Stack.prototype.unshiftAll=function(e){return this.pushAll(e)},Stack.prototype.shift=function(){return this.pop.apply(this,arguments)},Stack.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):emptyStack()},Stack.prototype.slice=function(e,t){if(wholeSlice(e,t,this.size))return this;var r=resolveBegin(e,this.size);if(resolveEnd(t,this.size)!==this.size)return IndexedCollection.prototype.slice.call(this,e,t);for(var n=this.size-r,i=this._head;r--;)i=i.next;return this.__ownerID?(this.size=n,this._head=i,this.__hash=void 0,this.__altered=!0,this):makeStack(n,i)},Stack.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?makeStack(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Stack.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var r=0,n=this._head;n&&!1!==e(n.value,r++,this);)n=n.next;return r},Stack.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var r=0,n=this._head;return new Iterator(function(){if(n){var t=n.value;return n=n.next,iteratorValue(e,r++,t)}return{value:void 0,done:!0}})},Stack.isStack=isStack;var X,Y="@@__IMMUTABLE_STACK__@@",$=Stack.prototype;function makeStack(e,t,r,n){var i=Object.create($);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function emptyStack(){return X||(X=makeStack(0))}function mixin(e,t){var r=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}$[Y]=!0,$.withMutations=I.withMutations,$.asMutable=I.asMutable,$.asImmutable=I.asImmutable,$.wasAltered=I.wasAltered,Iterable.Iterator=Iterator,mixin(Iterable,{toArray:function(){assertNotInfinite(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,r){e[r]=t}),e},toIndexedSeq:function(){return new ToIndexedSequence(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new ToKeyedSequence(this,!0)},toMap:function(){return Map(this.toKeyedSeq())},toObject:function(){assertNotInfinite(this.size);var e={};return this.__iterate(function(t,r){e[r]=t}),e},toOrderedMap:function(){return OrderedMap(this.toKeyedSeq())},toOrderedSet:function(){return OrderedSet(isKeyed(this)?this.valueSeq():this)},toSet:function(){return Set(isKeyed(this)?this.valueSeq():this)},toSetSeq:function(){return new ToSetSequence(this)},toSeq:function(){return isIndexed(this)?this.toIndexedSeq():isKeyed(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Stack(isKeyed(this)?this.valueSeq():this)},toList:function(){return List(isKeyed(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return reify(this,function concatFactory(e,t){var r=isKeyed(e),n=[e].concat(t).map(function(e){return isIterable(e)?r&&(e=KeyedIterable(e)):e=r?keyedSeqFromValue(e):indexedSeqFromValue(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===n.length)return e;if(1===n.length){var i=n[0];if(i===e||r&&isKeyed(i)||isIndexed(e)&&isIndexed(i))return i}var o=new ArraySeq(n);return r?o=o.toKeyedSeq():isIndexed(e)||(o=o.toSetSeq()),(o=o.flatten(!0)).size=n.reduce(function(e,t){if(void 0!==e){var r=t.size;if(void 0!==r)return e+r}},0),o}(this,e.call(arguments,0)))},includes:function(e){return this.some(function(t){return is(t,e)})},entries:function(){return this.__iterator(d)},every:function(e,t){assertNotInfinite(this.size);var r=!0;return this.__iterate(function(n,i,o){if(!e.call(t,n,i,o))return r=!1,!1}),r},filter:function(e,t){return reify(this,filterFactory(this,e,t,!0))},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},forEach:function(e,t){return assertNotInfinite(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){assertNotInfinite(this.size),e=void 0!==e?""+e:",";var t="",r=!0;return this.__iterate(function(n){r?r=!1:t+=e,t+=null!==n&&void 0!==n?n.toString():""}),t},keys:function(){return this.__iterator(p)},map:function(e,t){return reify(this,mapFactory(this,e,t))},reduce:function(e,t,r){var n,i;return assertNotInfinite(this.size),arguments.length<2?i=!0:n=t,this.__iterate(function(t,o,a){i?(i=!1,n=t):n=e.call(r,n,t,o,a)}),n},reduceRight:function(e,t,r){var n=this.toKeyedSeq().reverse();return n.reduce.apply(n,arguments)},reverse:function(){return reify(this,reverseFactory(this,!0))},slice:function(e,t){return reify(this,sliceFactory(this,e,t,!0))},some:function(e,t){return!this.every(not(e),t)},sort:function(e){return reify(this,sortFactory(this,e))},values:function(){return this.__iterator(f)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return ensureSize(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function countByFactory(e,t,r){var n=Map().asMutable();return e.__iterate(function(i,o){n.update(t.call(r,i,o,e),0,function(e){return e+1})}),n.asImmutable()}(this,e,t)},equals:function(e){return deepEqual(this,e)},entrySeq:function(){var e=this;if(e._cache)return new ArraySeq(e._cache);var t=e.toSeq().map(entryMapper).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(not(e),t)},findEntry:function(e,t,r){var n=r;return this.__iterate(function(r,i,o){if(e.call(t,r,i,o))return n=[i,r],!1}),n},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},findLastEntry:function(e,t,r){return this.toKeyedSeq().reverse().findEntry(e,t,r)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(returnTrue)},flatMap:function(e,t){return reify(this,function flatMapFactory(e,t,r){var n=iterableClass(e);return e.toSeq().map(function(i,o){return n(t.call(r,i,o,e))}).flatten(!0)}(this,e,t))},flatten:function(e){return reify(this,flattenFactory(this,e,!0))},fromEntrySeq:function(){return new FromEntriesSequence(this)},get:function(e,t){return this.find(function(t,r){return is(r,e)},void 0,t)},getIn:function(e,t){for(var r,n=this,i=forceIterator(e);!(r=i.next()).done;){var o=r.value;if((n=n&&n.get?n.get(o,u):u)===u)return t}return n},groupBy:function(e,t){return function groupByFactory(e,t,r){var n=isKeyed(e),i=(isOrdered(e)?OrderedMap():Map()).asMutable();e.__iterate(function(o,a){i.update(t.call(r,o,a,e),function(e){return(e=e||[]).push(n?[a,o]:o),e})});var o=iterableClass(e);return i.map(function(t){return reify(e,o(t))})}(this,e,t)},has:function(e){return this.get(e,u)!==u},hasIn:function(e){return this.getIn(e,u)!==u},isSubset:function(e){return e="function"==typeof e.includes?e:Iterable(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:Iterable(e)).isSubset(this)},keyOf:function(e){return this.findKey(function(t){return is(t,e)})},keySeq:function(){return this.toSeq().map(keyMapper).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return maxFactory(this,e)},maxBy:function(e,t){return maxFactory(this,t,e)},min:function(e){return maxFactory(this,e?neg(e):defaultNegComparator)},minBy:function(e,t){return maxFactory(this,t?neg(t):defaultNegComparator,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return reify(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return reify(this,skipWhileFactory(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(not(e),t)},sortBy:function(e,t){return reify(this,sortFactory(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return reify(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return reify(this,function takeWhileFactory(e,t,r){var n=makeSequence(e);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var a=0;return e.__iterate(function(e,i,s){return t.call(r,e,i,s)&&++a&&n(e,i,o)}),a},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var a=e.__iterator(d,i),s=!0;return new Iterator(function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var i=e.value,u=i[0],l=i[1];return t.call(r,l,u,o)?n===d?e:iteratorValue(n,u,l,e):(s=!1,{value:void 0,done:!0})})},n}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(not(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function hashIterable(e){if(e.size===1/0)return 0;var t=isOrdered(e),r=isKeyed(e),n=t?1:0;return function murmurHashOfSize(e,t){return t=S(t,3432918353),t=S(t<<15|t>>>-15,461845907),t=S(t<<13|t>>>-13,5),t=S((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=smi((t=S(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(r?t?function(e,t){n=31*n+hashMerge(hash(e),hash(t))|0}:function(e,t){n=n+hashMerge(hash(e),hash(t))|0}:t?function(e){n=31*n+hash(e)|0}:function(e){n=n+hash(e)|0}),n)}(this))}});var Z=Iterable.prototype;Z[t]=!0,Z[v]=Z.values,Z.__toJS=Z.toArray,Z.__toStringMapper=quoteString,Z.inspect=Z.toSource=function(){return this.toString()},Z.chain=Z.flatMap,Z.contains=Z.includes,mixin(KeyedIterable,{flip:function(){return reify(this,flipFactory(this))},mapEntries:function(e,t){var r=this,n=0;return reify(this,this.toSeq().map(function(i,o){return e.call(t,[o,i],n++,r)}).fromEntrySeq())},mapKeys:function(e,t){var r=this;return reify(this,this.toSeq().flip().map(function(n,i){return e.call(t,n,i,r)}).flip())}});var Q=KeyedIterable.prototype;function keyMapper(e,t){return t}function entryMapper(e,t){return[t,e]}function not(e){return function(){return!e.apply(this,arguments)}}function neg(e){return function(){return-e.apply(this,arguments)}}function quoteString(e){return"string"==typeof e?JSON.stringify(e):String(e)}function defaultZipper(){return arrCopy(arguments)}function defaultNegComparator(e,t){return et?-1:0}function hashMerge(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Q[r]=!0,Q[v]=Z.entries,Q.__toJS=Z.toObject,Q.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+quoteString(e)},mixin(IndexedIterable,{toKeyedSeq:function(){return new ToKeyedSequence(this,!1)},filter:function(e,t){return reify(this,filterFactory(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return reify(this,reverseFactory(this,!1))},slice:function(e,t){return reify(this,sliceFactory(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(0|t,0),0===r||2===r&&!t)return this;e=resolveBegin(e,e<0?this.count():this.size);var n=this.slice(0,e);return reify(this,1===r?n:n.concat(arrCopy(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(){return this.get(0)},flatten:function(e){return reify(this,flattenFactory(this,e,!1))},get:function(e,t){return(e=wrapIndex(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,r){return r===e},void 0,t)},has:function(e){return(e=wrapIndex(this,e))>=0&&(void 0!==this.size?this.size===1/0||e5e3)return e.textContent;return function reset(e){for(var r,n,i,o,a,s=e.textContent,u=0,l=s[0],c=1,p=e.innerHTML="",f=0;n=r,r=f<7&&"\\"==r?1:c;){if(c=l,l=s[++u],o=p.length>1,!c||f>8&&"\n"==c||[/\S/.test(c),1,1,!/[$\w]/.test(c),("/"==r||"\n"==r)&&o,'"'==r&&o,"'"==r&&o,s[u-4]+n+r=="--\x3e",n+r=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),i=f&&f<7?f:i,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(c),/[\])]/.test(c),/[$\w]/.test(c),"/"==c&&i<2&&"<"!=r,'"'==c,"'"==c,c+l+s[u+1]+s[u+2]=="\x3c!--",c+l=="/*",c+l=="//","#"==c][--f];);p+=c}}(e)},t.mapToList=function mapToList(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.Map();if(!l.default.Map.isMap(e)||!e.size)return l.default.List();Array.isArray(t)||(t=[t]);if(t.length<1)return e.merge(r);var n=l.default.List();var a=t[0];var s=!0;var u=!1;var c=void 0;try{for(var p,f=(0,o.default)(e.entries());!(s=(p=f.next()).done);s=!0){var d=p.value,h=(0,i.default)(d,2),m=h[0],v=h[1],g=mapToList(v,t.slice(1),r.set(a,m));n=l.default.List.isList(g)?n.concat(g):n.push(g)}}catch(e){u=!0,c=e}finally{try{!s&&f.return&&f.return()}finally{if(u)throw c}}return n},t.extractFileNameFromContentDispositionHeader=function extractFileNameFromContentDispositionHeader(e){var t=/filename="([^;]*);?"/i.exec(e);null===t&&(t=/filename=([^;]*);?/i.exec(e));if(null!==t&&t.length>1)return t[1];return null},t.pascalCase=pascalCase,t.pascalCaseFilename=function pascalCaseFilename(e){return pascalCase(e.replace(/\.[^./]*$/,""))},t.sanitizeUrl=function sanitizeUrl(e){if("string"!=typeof e||""===e)return"";return(0,c.sanitizeUrl)(e)},t.getAcceptControllingResponse=function getAcceptControllingResponse(e){if(!l.default.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&(0,s.default)(e.get("content")||{}).length>0}),r=e.get("default")||l.default.OrderedMap(),n=(r.get("content")||l.default.OrderedMap()).keySeq().toJS().length?r:null;return t||n},t.deeplyStripKey=function deeplyStripKey(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0};if("object"!==(void 0===e?"undefined":(0,u.default)(e))||Array.isArray(e)||null===e||!t)return e;var n=(0,a.default)({},e);(0,s.default)(n).forEach(function(e){e===t&&r(n[e],e)?delete n[e]:n[e]=deeplyStripKey(n[e],t,r)});return n};var l=_interopRequireDefault(r(7)),c=r(617),p=_interopRequireDefault(r(618)),f=_interopRequireDefault(r(303)),d=_interopRequireDefault(r(308)),h=_interopRequireDefault(r(193)),m=_interopRequireDefault(r(695)),v=_interopRequireDefault(r(111)),g=r(204),y=_interopRequireDefault(r(32)),_=_interopRequireDefault(r(768));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var b="default",S=t.isImmutable=function isImmutable(e){return l.default.Iterable.isIterable(e)};function normalizeArray(e){return Array.isArray(e)?e:[e]}function isObject(e){return!!e&&"object"===(void 0===e?"undefined":(0,u.default)(e))}t.memoize=d.default;function pascalCase(e){return(0,f.default)((0,p.default)(e))}t.propChecker=function propChecker(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,s.default)(e).length!==(0,s.default)(t).length||((0,m.default)(e,function(e,r){if(n.includes(r))return!1;var i=t[r];return l.default.Iterable.isIterable(e)?!l.default.is(e,i):("object"!==(void 0===e?"undefined":(0,u.default)(e))||"object"!==(void 0===i?"undefined":(0,u.default)(i)))&&e!==i})||r.some(function(r){return!(0,v.default)(e[r],t[r])}))};var k=t.validateMaximum=function validateMaximum(e,t){if(e>t)return"Value must be less than Maximum"},x=t.validateMinimum=function validateMinimum(e,t){if(et)return"Value must be less than MaxLength"},O=t.validateMinLength=function validateMinLength(e,t){if(e.length2&&void 0!==arguments[2]&&arguments[2],n=[],i=t&&"body"===e.get("in")?e.get("value_xml"):e.get("value"),o=e.get("required"),a=r?e.get("schema"):e;if(!a)return n;var s=a.get("maximum"),c=a.get("minimum"),p=a.get("type"),f=a.get("format"),d=a.get("maxLength"),h=a.get("minLength"),m=a.get("pattern");if(p&&(o||i)){var v="string"===p&&i,g="array"===p&&Array.isArray(i)&&i.length,_="array"===p&&l.default.List.isList(i)&&i.count(),b="file"===p&&i instanceof y.default.File,S="boolean"===p&&(i||!1===i),I="number"===p&&(i||0===i),q="integer"===p&&(i||0===i),F=!1;if(r&&"object"===p)if("object"===(void 0===i?"undefined":(0,u.default)(i)))F=!0;else if("string"==typeof i)try{JSON.parse(i),F=!0}catch(e){return n.push("Parameter string value must be valid JSON"),n}var B=[v,g,_,b,S,I,q,F].some(function(e){return!!e});if(o&&!B)return n.push("Required field is not provided"),n;if(m){var N=P(i,m);N&&n.push(N)}if(d||0===d){var j=T(i,d);j&&n.push(j)}if(h){var L=O(i,h);L&&n.push(L)}if(s||0===s){var z=k(i,s);z&&n.push(z)}if(c||0===c){var U=x(i,c);U&&n.push(U)}if("string"===p){var W=void 0;if(!(W="date-time"===f?R(i):"uuid"===f?M(i):A(i)))return n;n.push(W)}else if("boolean"===p){var V=D(i);if(!V)return n;n.push(V)}else if("number"===p){var H=E(i);if(!H)return n;n.push(H)}else if("integer"===p){var J=C(i);if(!J)return n;n.push(J)}else if("array"===p){var K;if(!_||!i.count())return n;K=a.getIn(["items","type"]),i.forEach(function(e,t){var r=void 0;"number"===K?r=E(e):"integer"===K?r=C(e):"string"===K&&(r=A(e)),r&&n.push({index:t,error:r})})}else if("file"===p){var G=w(i);if(!G)return n;n.push(G)}}return n},t.getSampleSchema=function getSampleSchema(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'\n\x3c!-- XML example cannot be generated --\x3e':null;var i=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=i[1]}return(0,g.memoizedCreateXMLExample)(e,r)}return(0,n.default)((0,g.memoizedSampleFromSchema)(e,r),null,2)},t.parseSearch=function parseSearch(){var e={},t=y.default.location.search;if(!t)return{};if(""!=t){var r=t.substr(1).split("&");for(var n in r)r.hasOwnProperty(n)&&(n=r[n].split("="),e[decodeURIComponent(n[0])]=n[1]&&decodeURIComponent(n[1])||"")}return e},t.serializeSearch=function serializeSearch(e){return(0,s.default)(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")},t.btoa=function btoa(t){return(t instanceof e?t:new e(t.toString(),"utf-8")).toString("base64")},t.sorters={operationsSorter:{alpha:function alpha(e,t){return e.get("path").localeCompare(t.get("path"))},method:function method(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function alpha(e,t){return e.localeCompare(t)}}},t.buildFormData=function buildFormData(e){var t=[];for(var r in e){var n=e[r];void 0!==n&&""!==n&&t.push([r,"=",encodeURIComponent(n).replace(/%20/g,"+")].join(""))}return t.join("&")},t.shallowEqualKeys=function shallowEqualKeys(e,t,r){return!!(0,h.default)(r,function(r){return(0,v.default)(e[r],t[r])})};var I=t.createDeepLinkPath=function createDeepLinkPath(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"_"):""};t.escapeDeepLinkPath=function escapeDeepLinkPath(e){return(0,_.default)(I(e))},t.getExtensions=function getExtensions(e){return e.filter(function(e,t){return/^x-/.test(t)})},t.getCommonExtensions=function getCommonExtensions(e){return e.filter(function(e,t){return/^pattern|maxLength|minLength|maximum|minimum/.test(t)})}}).call(t,r(48).Buffer)},function(e,t,r){"use strict";e.exports=function reactProdInvariant(e){for(var t=arguments.length-1,r="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,n=0;n>",o={listOf:function createListOfTypeChecker(e){return createIterableTypeChecker(e,"List",n.List.isList)},mapOf:function createMapOfTypeChecker(e,t){return createMapOfTypeCheckerFactory(e,t,"Map",n.Map.isMap)},orderedMapOf:function createOrderedMapOfTypeChecker(e,t){return createMapOfTypeCheckerFactory(e,t,"OrderedMap",n.OrderedMap.isOrderedMap)},setOf:function createSetOfTypeChecker(e){return createIterableTypeChecker(e,"Set",n.Set.isSet)},orderedSetOf:function createOrderedSetOfTypeChecker(e){return createIterableTypeChecker(e,"OrderedSet",n.OrderedSet.isOrderedSet)},stackOf:function createStackOfTypeChecker(e){return createIterableTypeChecker(e,"Stack",n.Stack.isStack)},iterableOf:function createIterableOfTypeChecker(e){return createIterableTypeChecker(e,"Iterable",n.Iterable.isIterable)},recordOf:function createRecordOfTypeChecker(e){return createChainableTypeChecker(function validate(t,r,i,o,a){for(var s=arguments.length,u=Array(s>5?s-5:0),l=5;l6?u-6:0),c=6;c5?u-5:0),c=5;c5?a-5:0),u=5;u key("+c[p]+")"].concat(s));if(d instanceof Error)return d}})}(t).apply(void 0,o)})}function createShapeTypeChecker(e){var t=void 0===arguments[1]?"Iterable":arguments[1],r=void 0===arguments[2]?n.Iterable.isIterable:arguments[2];return createChainableTypeChecker(function validate(n,i,o,a,s){for(var u=arguments.length,l=Array(u>5?u-5:0),c=5;c?@[\]^_`{|}~-])/g;function isValidEntityCode(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function fromCodePoint(e){if(e>65535){var t=55296+((e-=65536)>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}var o=/&([a-z#][a-z0-9]{1,31});/gi,a=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,s=r(456);function replaceEntityPattern(e,t){var r=0;return has(s,t)?s[t]:35===t.charCodeAt(0)&&a.test(t)&&isValidEntityCode(r="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?fromCodePoint(r):e}var u=/[&<>"]/,l=/[&<>"]/g,c={"&":"&","<":"<",">":">",'"':"""};function replaceUnsafeChar(e){return c[e]}t.assign=function assign(e){return[].slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){e[r]=t[r]})}}),e},t.isString=function isString(e){return"[object String]"===function typeOf(e){return Object.prototype.toString.call(e)}(e)},t.has=has,t.unescapeMd=function unescapeMd(e){return e.indexOf("\\")<0?e:e.replace(i,"$1")},t.isValidEntityCode=isValidEntityCode,t.fromCodePoint=fromCodePoint,t.replaceEntities=function replaceEntities(e){return e.indexOf("&")<0?e:e.replace(o,replaceEntityPattern)},t.escapeHtml=function escapeHtml(e){return u.test(e)?e.replace(l,replaceUnsafeChar):e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(33),i=r(63),o=r(61),a=r(75),s=r(127),u=function(e,t,r){var l,c,p,f,d=e&u.F,h=e&u.G,m=e&u.S,v=e&u.P,g=e&u.B,y=h?n:m?n[t]||(n[t]={}):(n[t]||{}).prototype,_=h?i:i[t]||(i[t]={}),b=_.prototype||(_.prototype={});for(l in h&&(r=t),r)p=((c=!d&&y&&void 0!==y[l])?y:r)[l],f=g&&c?s(p,n):v&&"function"==typeof p?s(Function.call,p):p,y&&a(y,l,p,e&u.U),_[l]!=p&&o(_,l,f),v&&b[l]!=p&&(b[l]=p)};n.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,r){var n=r(30),i=r(107),o=r(57),a=/"/g,s=function(e,t,r,n){var i=String(o(e)),s="<"+t;return""!==r&&(s+=" "+r+'="'+String(n).replace(a,""")+'"'),s+">"+i+""};e.exports=function(e,t){var r={};r[e]=t(s),n(n.P+n.F*i(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",r)}},function(e,t,r){"use strict";var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(97));e.exports=function makeWindow(){var e={location:{},history:{},open:function open(){},close:function close(){},File:function File(){}};if("undefined"==typeof window)return e;try{e=window;var t=!0,r=!1,i=void 0;try{for(var o,a=(0,n.default)(["File","Blob","FormData"]);!(t=(o=a.next()).done);t=!0){var s=o.value;s in window&&(e[s]=window[s])}}catch(e){r=!0,i=e}finally{try{!t&&a.return&&a.return()}finally{if(r)throw i}}}catch(e){console.error(e)}return e}()},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,r){"use strict";function makeEmptyFunction(e){return function(){return e}}var n=function emptyFunction(){};n.thatReturns=makeEmptyFunction,n.thatReturnsFalse=makeEmptyFunction(!1),n.thatReturnsTrue=makeEmptyFunction(!0),n.thatReturnsNull=makeEmptyFunction(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(26));t.isOAS3=isOAS3,t.isSwagger2=function isSwagger2(e){var t=e.get("swagger");if(!t)return!1;return t.startsWith("2.0")},t.OAS3ComponentWrapFactory=function OAS3ComponentWrapFactory(e){return function(t,r){return function(o){if(r&&r.specSelectors&&r.specSelectors.specJson){var a=r.specSelectors.specJson();return isOAS3(a)?i.default.createElement(e,(0,n.default)({},o,r,{Ori:t})):i.default.createElement(t,o)}return console.warn("OAS3 wrapper: couldn't get spec"),null}}};var i=_interopRequireDefault(r(0));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function isOAS3(e){var t=e.get("openapi");return!!t&&t.startsWith("3.0.")}},function(e,t,r){var n=r(29);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){e.exports={default:r(562),__esModule:!0}},function(e,t,r){var n=r(301),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},function(e,t){e.exports=function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var r,n,i=e.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(r===setTimeout)return setTimeout(e,0);if((r===defaultSetTimout||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){r=defaultSetTimout}try{n="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){n=defaultClearTimeout}}();var o,a=[],s=!1,u=-1;function cleanUpNextTick(){s&&o&&(s=!1,o.length?a=o.concat(a):u=-1,a.length&&drainQueue())}function drainQueue(){if(!s){var e=runTimeout(cleanUpNextTick);s=!0;for(var t=a.length;t;){for(o=a,a=[];++u1)for(var r=1;r0&&(o=this.buffer[s-1],e.call("\0\r\n…\u2028\u2029",o)<0);)if(s--,this.pointer-s>r/2-1){i=" ... ",s+=5;break}for(u="",n=this.pointer;nr/2-1){u=" ... ",n-=5;break}return""+new Array(t).join(" ")+i+this.buffer.slice(s,n)+u+"\n"+new Array(t+this.pointer-s+i.length).join(" ")+"^"},Mark.prototype.toString=function(){var e,t;return e=this.get_snippet(),t=" on line "+(this.line+1)+", column "+(this.column+1),e?t:t+":\n"+e},Mark}(),this.YAMLError=function(e){function YAMLError(e){this.message=e,YAMLError.__super__.constructor.call(this),this.stack=this.toString()+"\n"+(new Error).stack.split("\n").slice(1).join("\n")}return t(YAMLError,e),YAMLError.prototype.toString=function(){return this.message},YAMLError}(Error),this.MarkedYAMLError=function(e){function MarkedYAMLError(e,t,r,n,i){this.context=e,this.context_mark=t,this.problem=r,this.problem_mark=n,this.note=i,MarkedYAMLError.__super__.constructor.call(this)}return t(MarkedYAMLError,e),MarkedYAMLError.prototype.toString=function(){var e;return e=[],null!=this.context&&e.push(this.context),null==this.context_mark||null!=this.problem&&null!=this.problem_mark&&this.context_mark.line===this.problem_mark.line&&this.context_mark.column===this.problem_mark.column||e.push(this.context_mark.toString()),null!=this.problem&&e.push(this.problem),null!=this.problem_mark&&e.push(this.problem_mark.toString()),null!=this.note&&e.push(this.note),e.join("\n")},MarkedYAMLError}(this.YAMLError)}).call(this)},function(e,t,r){e.exports=!r(55)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,r){"use strict";(function(e){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var n=r(574),i=r(575),o=r(284);function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,i);if("number"==typeof t)return t&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function read(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,p=0;pi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(p=c);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&c)<<6|63&o)>127&&(p=l);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(l=(15&c)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(p=l);break;case 4:o=e[i+1],s=e[i+2],u=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&u)&&(l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&u)>65535&&l<1114112&&(p=l)}null===p?(p=65533,f=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|1023&p),n.push(p),i+=f}return function decodeCodePointsArray(e){var t=e.length;if(t<=a)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},Buffer.prototype.equals=function equals(e){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function inspect(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},Buffer.prototype.compare=function compare(e,t,r,n,i){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,a=r-t,s=Math.min(o,a),u=this.slice(n,i),l=e.slice(t,r),c=0;ci)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var a=4096;function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,i,o){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function objectWriteUInt16(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function objectWriteUInt32(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function checkIEEE754(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,o){return o||checkIEEE754(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,o){return o||checkIEEE754(e,0,r,8),i.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function slice(e,t){var r,n=this.length;if(e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},Buffer.prototype.readUInt8=function readUInt8(e,t){return t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function readIntLE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function readIntBE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function readInt8(e,t){return t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function readInt16BE(e,t){t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function readFloatLE(e,t){return t||checkOffset(e,4,this.length),i.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return t||checkOffset(e,4,this.length),i.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return t||checkOffset(e,8,this.length),i.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return t||checkOffset(e,8,this.length),i.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,r,n){(e=+e,t|=0,r|=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},Buffer.prototype.writeUInt8=function writeUInt8(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},Buffer.prototype.writeIntBE=function writeIntBE(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},Buffer.prototype.writeInt8=function writeInt8(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function copy(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function base64ToBytes(e){return n.toByteArray(function base64clean(e){if((e=function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(s,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function blitBuffer(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(t,r(18))},function(e,t,r){"use strict";e.exports={current:null}},function(e,t){e.exports=function isObjectLike(e){return null!=e&&"object"==typeof e}},function(e,t,r){"use strict";var n=r(13),i=r(71),o=r(34),a=(r(9),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),s={type:null,target:null,currentTarget:o.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};function SyntheticEvent(e,t,r,n){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=r;var i=this.constructor.Interface;for(var a in i)if(i.hasOwnProperty(a)){0;var s=i[a];s?this[a]=s(r):"target"===a?this.target=n:this[a]=r[a]}var u=null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue;return this.isDefaultPrevented=u?o.thatReturnsTrue:o.thatReturnsFalse,this.isPropagationStopped=o.thatReturnsFalse,this}n(SyntheticEvent.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=o.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=o.thatReturnsTrue)},persist:function(){this.isPersistent=o.thatReturnsTrue},isPersistent:o.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:defaultEqualityCheck,r=null,n=null;return function(){return function areArgumentsShallowlyEqual(e,t,r){if(null===t||null===r||t.length!==r.length)return!1;for(var n=t.length,i=0;i1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:n;if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var r=Object.keys(e);return t(r.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),n=0;n=r?e:e.length+1===r?""+t+e:""+new Array(r-e.length+1).join(t)+e},this.to_hex=function(e){return"string"==typeof e&&(e=e.charCodeAt(0)),e.toString(16)}}).call(this)}).call(t,r(18))},function(e,t,r){var n=r(124),i=r(266);e.exports=r(106)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(76);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var r=e.exports={version:"2.5.5"};"number"==typeof __e&&(__e=r)},function(e,t,r){var n=r(80),i=r(620),o=r(621),a="[object Null]",s="[object Undefined]",u=n?n.toStringTag:void 0;e.exports=function baseGetTag(e){return null==e?void 0===e?s:a:u&&u in Object(e)?i(e):o(e)}},function(e,t,r){var n=r(637),i=r(640);e.exports=function getNative(e,t){var r=i(e,t);return n(r)?r:void 0}},function(e,t,r){var n=r(318),i=r(677),o=r(81);e.exports=function keys(e){return o(e)?n(e):i(e)}},function(e,t,r){"use strict";var n=r(147),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=Duplex;var o=r(112);o.inherits=r(84);var a=r(328),s=r(207);o.inherits(Duplex,a);for(var u=i(s.prototype),l=0;l1){for(var f=Array(p),d=0;d1){for(var m=Array(h),v=0;v=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}},function(e,t,r){"use strict";function isNothing(e){return void 0===e||null===e}e.exports.isNothing=isNothing,e.exports.isObject=function isObject(e){return"object"==typeof e&&null!==e},e.exports.toArray=function toArray(e){return Array.isArray(e)?e:isNothing(e)?[]:[e]},e.exports.repeat=function repeat(e,t){var r,n="";for(r=0;r`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),d=new RegExp('[&<>"]',"g"),h=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}};e.exports={unescapeString:function(e){return c.test(e)?e.replace(f,m):e},normalizeURI:function(e){try{return n(i(e))}catch(t){return e}},escapeXml:function(e,t){return d.test(e)?t?e.replace(h,v):e.replace(d,v):e},reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t,r){"use strict";var n=r(476),i=r(477),o=r(164).decodeHTML,a="&(?:#x[a-f0-9]{1,8}|#[0-9]{1,8}|[a-z][a-z0-9]{1,31});",s="<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),d=new RegExp('[&<>"]',"g"),h=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}};e.exports={unescapeString:function(e){return c.test(e)?e.replace(f,m):e},normalizeURI:function(e){try{return n(i(e))}catch(t){return e}},escapeXml:function(e,t){return d.test(e)?t?e.replace(h,v):e.replace(d,v):e},reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t,r){e.exports={default:r(493),__esModule:!0}},function(e,t,r){r(494);for(var n=r(23),i=r(54),o=r(72),a=r(20)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){e.exports=!r(107)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports={}},function(e,t,r){var n=r(126),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){"use strict";e.exports=function reactProdInvariant(e){for(var t=arguments.length-1,r="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,n=0;n0?i(n(e),9007199254740991):0}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t,r){var n=r(62),i=r(505),o=r(506),a=Object.defineProperty;t.f=r(106)?Object.defineProperty:function defineProperty(e,t,r){if(n(e),t=o(t,!0),n(r),i)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n=r(128);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){var n=r(511),i=r(57);e.exports=function(e){return n(i(e))}},function(e,t,r){"use strict";var n=r(61),i=r(75),o=r(107),a=r(57),s=r(17);e.exports=function(e,t,r){var u=s(e),l=r(a,u,""[e]),c=l[0],p=l[1];o(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,c),n(RegExp.prototype,u,2==t?function(e,t){return p.call(e,this,t)}:function(e){return p.call(e,this)}))}},function(e,t,r){var n=r(123)("meta"),i=r(29),o=r(56),a=r(42).f,s=0,u=Object.isExtensible||function(){return!0},l=!r(55)(function(){return u(Object.preventExtensions({}))}),c=function(e){a(e,n,{value:{i:"O"+ ++s,w:{}}})},p=e.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,n)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[n].i},getWeak:function(e,t){if(!o(e,n)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[n].w},onFreeze:function(e){return l&&p.NEED&&u(e)&&!o(e,n)&&c(e),e}}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){"use strict";var n={};e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CLEAR_BY=t.CLEAR=t.NEW_AUTH_ERR=t.NEW_SPEC_ERR_BATCH=t.NEW_SPEC_ERR=t.NEW_THROWN_ERR_BATCH=t.NEW_THROWN_ERR=void 0,t.newThrownErr=function newThrownErr(e){return{type:i,payload:(0,n.default)(e)}},t.newThrownErrBatch=function newThrownErrBatch(e){return{type:o,payload:e}},t.newSpecErr=function newSpecErr(e){return{type:a,payload:e}},t.newSpecErrBatch=function newSpecErrBatch(e){return{type:s,payload:e}},t.newAuthErr=function newAuthErr(e){return{type:u,payload:e}},t.clear=function clear(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:l,payload:e}},t.clearBy=function clearBy(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return{type:c,payload:e}};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(190));var i=t.NEW_THROWN_ERR="err_new_thrown_err",o=t.NEW_THROWN_ERR_BATCH="err_new_thrown_err_batch",a=t.NEW_SPEC_ERR="err_new_spec_err",s=t.NEW_SPEC_ERR_BATCH="err_new_spec_err_batch",u=t.NEW_AUTH_ERR="err_new_auth_err",l=t.CLEAR="err_clear",c=t.CLEAR_BY="err_clear_by"},function(e,t,r){var n=r(64),i=r(50),o="[object Symbol]";e.exports=function isSymbol(e){return"symbol"==typeof e||i(e)&&n(e)==o}},function(e,t,r){var n=r(65)(Object,"create");e.exports=n},function(e,t,r){var n=r(645),i=r(646),o=r(647),a=r(648),s=r(649);function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e_;_++)if((v=t?y(a(h=e[_])[0],h[1]):y(e[_]))===l||v===c)return v}else for(m=g.call(e);!(h=m.next()).done;)if((v=i(m,y,h.value,t))===l||v===c)return v}).BREAK=l,t.RETURN=c},function(e,t,r){"use strict";var n=r(89);e.exports=n.DEFAULT=new n({include:[r(114)],explicit:[r(802),r(803),r(804)]})},function(e,t,r){var n=r(367),i=r(111),o=Object.prototype.hasOwnProperty;e.exports=function assignValue(e,t,r){var a=e[t];o.call(e,t)&&i(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},function(e,t,r){"use strict";var n=r(11),i=(r(8),{}),o={reinitializeTransaction:function(){this.transactionWrappers=this.getTransactionWrappers(),this.wrapperInitData?this.wrapperInitData.length=0:this.wrapperInitData=[],this._isInTransaction=!1},_isInTransaction:!1,getTransactionWrappers:null,isInTransaction:function(){return!!this._isInTransaction},perform:function(e,t,r,i,o,a,s,u){var l,c;this.isInTransaction()&&n("27");try{this._isInTransaction=!0,l=!0,this.initializeAll(0),c=e.call(t,r,i,o,a,s,u),l=!1}finally{try{if(l)try{this.closeAll(0)}catch(e){}else this.closeAll(0)}finally{this._isInTransaction=!1}}return c},initializeAll:function(e){for(var t=this.transactionWrappers,r=e;r]/,u=r(229)(function(e,t){if(e.namespaceURI!==o.svg||"innerHTML"in e)e.innerHTML=t;else{(n=n||document.createElement("div")).innerHTML=""+t+"";for(var r=n.firstChild;r.firstChild;)e.appendChild(r.firstChild)}});if(i.canUseDOM){var l=document.createElement("div");l.innerHTML=" ",""===l.innerHTML&&(u=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var r=e.firstChild;1===r.data.length?e.removeChild(r):r.deleteData(0,1)}else e.innerHTML=t}),l=null}e.exports=u},function(e,t,r){"use strict";var n=/["'&<>]/;e.exports=function escapeTextContentForBrowser(e){return"boolean"==typeof e||"number"==typeof e?""+e:function escapeHtml(e){var t,r=""+e,i=n.exec(r);if(!i)return r;var o="",a=0,s=0;for(a=i.index;adocument.F=Object<\/script>"),e.close(),u=e.F;n--;)delete u.prototype[o[n]];return u()};e.exports=Object.create||function create(e,t){var r;return null!==e?(s.prototype=n(e),r=new s,s.prototype=null,r[a]=e):r=u(),void 0===t?r:i(r,t)}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n=r(173)("keys"),i=r(123);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){var n=r(23),i=n["__core-js_shared__"]||(n["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(176),i=r(20)("iterator"),o=r(72);e.exports=r(15).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[n(e)]}},function(e,t,r){var n=r(99),i=r(20)("toStringTag"),o="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:o?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,r){var n=r(105),i=r(17)("toStringTag"),o="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:o?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t,r){var n=r(76),i=r(33).document,o=n(i)&&n(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,r){var n=r(265)("keys"),i=r(178);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){var n=r(124).f,i=r(125),o=r(17)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},function(e,t,r){"use strict";var n=r(128);e.exports.f=function(e){return new function PromiseCapability(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)}(e)}},function(e,t,r){var n=r(279),i=r(57);e.exports=function(e,t,r){if(n(t))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(e))}},function(e,t,r){var n=r(17)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,r){t.f=r(20)},function(e,t,r){var n=r(23),i=r(15),o=r(121),a=r(185),s=r(42).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){},function(e,t,r){"use strict";(function(t){ +/*! + * @description Recursive object extending + * @author Viacheslav Lotsmanov + * @license MIT + * + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Viacheslav Lotsmanov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +function isSpecificValue(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function cloneSpecificValue(e){if(e instanceof t){var r=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(r),r}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function safeGetProperty(e,t){return"__proto__"===t?void 0:e[t]}var r=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,n=arguments[0];return Array.prototype.slice.call(arguments,1).forEach(function(i){"object"!=typeof i||null===i||Array.isArray(i)||Object.keys(i).forEach(function(o){return t=safeGetProperty(n,o),(e=safeGetProperty(i,o))===n?void 0:"object"!=typeof e||null===e?void(n[o]=e):Array.isArray(e)?void(n[o]=function deepCloneArray(e){var t=[];return e.forEach(function(e,n){"object"==typeof e&&null!==e?Array.isArray(e)?t[n]=deepCloneArray(e):isSpecificValue(e)?t[n]=cloneSpecificValue(e):t[n]=r({},e):t[n]=e}),t}(e)):isSpecificValue(e)?void(n[o]=cloneSpecificValue(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(n[o]=r({},e)):void(n[o]=r(t,e))})}),n}}).call(t,r(48).Buffer)},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e?function destroyCircular(e,t){var r;r=Array.isArray(e)?[]:{};t.push(e);Object.keys(e).forEach(function(n){var i=e[n];"function"!=typeof i&&(i&&"object"==typeof i?-1!==t.indexOf(e[n])?r[n]="[Circular]":r[n]=destroyCircular(e[n],t.slice(0)):r[n]=i)});"string"==typeof e.name&&(r.name=e.name);"string"==typeof e.message&&(r.message=e.message);"string"==typeof e.stack&&(r.stack=e.stack);return r}(e,[]):"function"==typeof e?"[Function: "+(e.name||"anonymous")+"]":e}},function(e,t,r){var n=r(634),i=r(650),o=r(652),a=r(653),s=r(654);function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=r}},function(e,t){e.exports=function baseUnary(e){return function(t){return e(t)}}},function(e,t,r){(function(e){var n=r(301),i="object"==typeof t&&t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i&&n.process,s=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s}).call(t,r(141)(e))},function(e,t,r){var n=r(21),i=r(135),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function isKey(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},function(e,t){e.exports=function identity(e){return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.memoizedSampleFromSchema=t.memoizedCreateXMLExample=t.sampleXmlFromSchema=t.inferSchema=t.sampleFromSchema=void 0,t.createXMLExample=createXMLExample;var n=r(10),i=_interopRequireDefault(r(701)),o=_interopRequireDefault(r(714));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var a={string:function string(){return"string"},string_email:function string_email(){return"user@example.com"},"string_date-time":function string_dateTime(){return(new Date).toISOString()},number:function number(){return 0},number_float:function number_float(){return 0},integer:function integer(){return 0},boolean:function boolean(e){return"boolean"!=typeof e.default||e.default}},s=function primitive(e){var t=e=(0,n.objectify)(e),r=t.type,i=t.format,o=a[r+"_"+i]||a[r];return(0,n.isFunc)(o)?o(e):"Unknown Type: "+e.type},u=t.sampleFromSchema=function sampleFromSchema(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,n.objectify)(e),i=r.type,o=r.example,a=r.properties,u=r.additionalProperties,l=r.items,c=t.includeReadOnly,p=t.includeWriteOnly;if(void 0!==o)return(0,n.deeplyStripKey)(o,"$$ref",function(e){return"string"==typeof e&&e.indexOf("#")>-1});if(!i)if(a)i="object";else{if(!l)return;i="array"}if("object"===i){var f=(0,n.objectify)(a),d={};for(var h in f)f[h].readOnly&&!c||f[h].writeOnly&&!p||(d[h]=sampleFromSchema(f[h],t));if(!0===u)d.additionalProp1={};else if(u)for(var m=(0,n.objectify)(u),v=sampleFromSchema(m,t),g=1;g<4;g++)d["additionalProp"+g]=v;return d}return"array"===i?Array.isArray(l.anyOf)?l.anyOf.map(function(e){return sampleFromSchema(e,t)}):Array.isArray(l.oneOf)?l.oneOf.map(function(e){return sampleFromSchema(e,t)}):[sampleFromSchema(l,t)]:e.enum?e.default?e.default:(0,n.normalizeArray)(e.enum)[0]:"file"!==i?s(e):void 0},l=(t.inferSchema=function inferSchema(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},t.sampleXmlFromSchema=function sampleXmlFromSchema(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,n.objectify)(e),o=i.type,a=i.properties,u=i.additionalProperties,l=i.items,c=i.example,p=r.includeReadOnly,f=r.includeWriteOnly,d=i.default,h={},m={},v=e.xml,g=v.name,y=v.prefix,_=v.namespace,b=i.enum,S=void 0;if(!o)if(a||u)o="object";else{if(!l)return;o="array"}(g=g||"notagname",t=(y?y+":":"")+g,_)&&(m[y?"xmlns:"+y:"xmlns"]=_);if("array"===o&&l){if(l.xml=l.xml||v||{},l.xml.name=l.xml.name||v.name,v.wrapped)return h[t]=[],Array.isArray(c)?c.forEach(function(e){l.example=e,h[t].push(sampleXmlFromSchema(l,r))}):Array.isArray(d)?d.forEach(function(e){l.default=e,h[t].push(sampleXmlFromSchema(l,r))}):h[t]=[sampleXmlFromSchema(l,r)],m&&h[t].push({_attr:m}),h;var k=[];return Array.isArray(c)?(c.forEach(function(e){l.example=e,k.push(sampleXmlFromSchema(l,r))}),k):Array.isArray(d)?(d.forEach(function(e){l.default=e,k.push(sampleXmlFromSchema(l,r))}),k):sampleXmlFromSchema(l,r)}if("object"===o){var x=(0,n.objectify)(a);for(var E in h[t]=[],c=c||{},x)if(x.hasOwnProperty(E)&&(!x[E].readOnly||p)&&(!x[E].writeOnly||f))if(x[E].xml=x[E].xml||{},x[E].xml.attribute){var C=Array.isArray(x[E].enum)&&x[E].enum[0],w=x[E].example,D=x[E].default;m[x[E].xml.name||E]=void 0!==w&&w||void 0!==c[E]&&c[E]||void 0!==D&&D||C||s(x[E])}else{x[E].xml.name=x[E].xml.name||E,void 0===x[E].example&&void 0!==c[E]&&(x[E].example=c[E]);var A=sampleXmlFromSchema(x[E]);Array.isArray(A)?h[t]=h[t].concat(A):h[t].push(A)}return!0===u?h[t].push({additionalProp:"Anything can be here"}):u&&h[t].push({additionalProp:s(u)}),m&&h[t].push({_attr:m}),h}return S=void 0!==c?c:void 0!==d?d:Array.isArray(b)?b[0]:s(e),h[t]=m?[{_attr:m},S]:S,h});function createXMLExample(e,t){var r=l(e,t);if(r)return(0,i.default)(r,{declaration:!0,indent:"\t"})}t.memoizedCreateXMLExample=(0,o.default)(createXMLExample),t.memoizedSampleFromSchema=(0,o.default)(u)},function(e,t){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(e){return"function"==typeof e}function isObject(e){return"object"==typeof e&&null!==e}function isUndefined(e){return void 0===e}e.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(e){if(!function isNumber(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},EventEmitter.prototype.emit=function(e){var t,r,n,i,o,a;if(this._events||(this._events={}),"error"===e&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var s=new Error('Uncaught, unspecified "error" event. ('+t+")");throw s.context=t,s}if(isUndefined(r=this._events[e]))return!1;if(isFunction(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(isObject(r))for(i=Array.prototype.slice.call(arguments,1),n=(a=r.slice()).length,o=0;o0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(e,t){if(!isFunction(t))throw TypeError("listener must be a function");var r=!1;function g(){this.removeListener(e,g),r||(r=!0,t.apply(this,arguments))}return g.listener=t,this.on(e,g),this},EventEmitter.prototype.removeListener=function(e,t){var r,n,i,o;if(!isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(r=this._events[e]).length,n=-1,r===t||isFunction(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(isObject(r)){for(o=i;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},EventEmitter.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(isFunction(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},EventEmitter.prototype.listeners=function(e){return this._events&&this._events[e]?isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},EventEmitter.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(isFunction(t))return 1;if(t)return t.length}return 0},EventEmitter.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){(t=e.exports=r(328)).Stream=t,t.Readable=t,t.Writable=r(207),t.Duplex=r(67),t.Transform=r(333),t.PassThrough=r(709)},function(e,t,r){"use strict";(function(t,n,i){var o=r(147);function CorkedRequest(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function onCorkedFinish(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=Writable;var a,s=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;Writable.WritableState=WritableState;var u=r(112);u.inherits=r(84);var l={deprecate:r(708)},c=r(329),p=r(148).Buffer,f=i.Uint8Array||function(){};var d,h=r(330);function nop(){}function WritableState(e,t){a=a||r(67),e=e||{};var n=t instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===e.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function onwrite(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function onwriteError(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(finishMaybe,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),finishMaybe(e,t))}(e,r,n,t,i);else{var a=needFinish(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||clearBuffer(e,r),n?s(afterWrite,e,r,a,i):afterWrite(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(e){if(a=a||r(67),!(d.call(Writable,this)||this instanceof a))return new Writable(e);this._writableState=new WritableState(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),c.call(this)}function doWrite(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function afterWrite(e,t,r,n){r||function onwriteDrain(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),finishMaybe(e,t)}function clearBuffer(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)i[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;i.allBuffers=s,doWrite(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new CorkedRequest(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,c=r.callback;if(doWrite(e,t,!1,t.objectMode?1:u.length,u,l,c),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function needFinish(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function callFinal(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),finishMaybe(e,t)})}function finishMaybe(e,t){var r=needFinish(t);return r&&(!function prefinish(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(callFinal,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(Writable,c),WritableState.prototype.getBuffer=function getBuffer(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===Writable&&(e&&e._writableState instanceof WritableState)}})):d=function(e){return e instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&function _isUint8Array(e){return p.isBuffer(e)||e instanceof f}(e);return a&&!p.isBuffer(e)&&(e=function _uint8ArrayToBuffer(e){return p.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=nop),n.ended?function writeAfterEnd(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(a||function validChunk(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,n,e,r))&&(n.pendingcb++,i=function writeOrBuffer(e,t,r,n,i,o){if(!r){var a=function decodeChunk(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=p.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function endWritable(e,t,r){t.ending=!0,finishMaybe(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),Writable.prototype.destroy=h.destroy,Writable.prototype._undestroy=h.undestroy,Writable.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,r(40),r(331).setImmediate,r(18))},function(e,t,r){"use strict";e.exports=function(e){return"function"==typeof e}},function(e,t,r){"use strict";e.exports=r(735)()?Array.from:r(736)},function(e,t,r){"use strict";var n=r(749),i=r(69),o=r(85),a=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,u=Math.abs,l=Math.floor;e.exports=function(e){var t,r,c,p;if(!n(e))return a.apply(this,arguments);for(r=i(o(this).length),c=arguments[1],t=c=isNaN(c)?0:c>=0?l(c):i(this.length)-l(u(c));t1&&void 0!==arguments[1])||arguments[1];return e=(0,n.normalizeArray)(e),{type:s,payload:{thing:e,shown:t}}},t.changeMode=function changeMode(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=(0,n.normalizeArray)(e),{type:a,payload:{thing:e,mode:t}}};var n=r(10),i=t.UPDATE_LAYOUT="layout_update_layout",o=t.UPDATE_FILTER="layout_update_filter",a=t.UPDATE_MODE="layout_update_mode",s=t.SHOW="layout_show"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateBeforeExecute=t.canExecuteScheme=t.operationScheme=t.hasHost=t.operationWithMeta=t.parameterWithMeta=t.parameterWithMetaByIdentity=t.allowTryItOutFor=t.mutatedRequestFor=t.requestFor=t.responseFor=t.mutatedRequests=t.requests=t.responses=t.taggedOperations=t.operationsWithTags=t.tagDetails=t.tags=t.operationsWithRootInherited=t.schemes=t.host=t.basePath=t.definitions=t.findDefinition=t.securityDefinitions=t.security=t.produces=t.consumes=t.operations=t.paths=t.semver=t.version=t.externalDocs=t.info=t.isOAS3=t.spec=t.specJsonWithResolvedSubtrees=t.specResolvedSubtree=t.specResolved=t.specJson=t.specSource=t.specStr=t.url=t.lastError=void 0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(86));t.getParameter=function getParameter(e,t,r,i){return t=t||[],e.getIn(["meta","paths"].concat((0,n.default)(t),["parameters"]),(0,a.fromJS)([])).find(function(e){return a.Map.isMap(e)&&e.get("name")===r&&e.get("in")===i})||(0,a.Map)()},t.parameterValues=function parameterValues(e,t,r){return t=t||[],D.apply(void 0,[e].concat((0,n.default)(t))).get("parameters",(0,a.List)()).reduce(function(e,t){var n=r&&"body"===t.get("in")?t.get("value_xml"):t.get("value");return e.set(t.get("in")+"."+t.get("name"),n)},(0,a.fromJS)({}))},t.parametersIncludeIn=function parametersIncludeIn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(a.List.isList(e))return e.some(function(e){return a.Map.isMap(e)&&e.get("in")===t})},t.parametersIncludeType=parametersIncludeType,t.contentTypeValues=function contentTypeValues(e,t){t=t||[];var r=p(e).getIn(["paths"].concat((0,n.default)(t)),(0,a.fromJS)({})),i=e.getIn(["meta","paths"].concat((0,n.default)(t)),(0,a.fromJS)({})),o=currentProducesFor(e,t),s=r.get("parameters")||new a.List,u=i.get("consumes_value")?i.get("consumes_value"):parametersIncludeType(s,"file")?"multipart/form-data":parametersIncludeType(s,"formData")?"application/x-www-form-urlencoded":void 0;return(0,a.fromJS)({requestContentType:u,responseContentType:o})},t.operationConsumes=function operationConsumes(e,t){return t=t||[],p(e).getIn(["paths"].concat((0,n.default)(t),["consumes"]),(0,a.fromJS)({}))},t.currentProducesFor=currentProducesFor;var i=r(59),o=r(10),a=r(7);var s=["get","put","post","delete","options","head","patch","trace"],u=function state(e){return e||(0,a.Map)()},l=(t.lastError=(0,i.createSelector)(u,function(e){return e.get("lastError")}),t.url=(0,i.createSelector)(u,function(e){return e.get("url")}),t.specStr=(0,i.createSelector)(u,function(e){return e.get("spec")||""}),t.specSource=(0,i.createSelector)(u,function(e){return e.get("specSource")||"not-editor"}),t.specJson=(0,i.createSelector)(u,function(e){return e.get("json",(0,a.Map)())})),c=(t.specResolved=(0,i.createSelector)(u,function(e){return e.get("resolved",(0,a.Map)())}),t.specResolvedSubtree=function specResolvedSubtree(e,t){return e.getIn(["resolvedSubtrees"].concat((0,n.default)(t)),void 0)},function mergerFn(e,t){return a.Map.isMap(e)&&a.Map.isMap(t)?t.get("$$ref")?t:(0,a.OrderedMap)().mergeWith(mergerFn,e,t):t}),p=t.specJsonWithResolvedSubtrees=(0,i.createSelector)(u,function(e){return(0,a.OrderedMap)().mergeWith(c,e.get("json"),e.get("resolvedSubtrees"))}),f=t.spec=function spec(e){return l(e)},d=(t.isOAS3=(0,i.createSelector)(f,function(){return!1}),t.info=(0,i.createSelector)(f,function(e){return returnSelfOrNewMap(e&&e.get("info"))})),h=(t.externalDocs=(0,i.createSelector)(f,function(e){return returnSelfOrNewMap(e&&e.get("externalDocs"))}),t.version=(0,i.createSelector)(d,function(e){return e&&e.get("version")})),m=(t.semver=(0,i.createSelector)(h,function(e){return/v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(e).slice(1)}),t.paths=(0,i.createSelector)(p,function(e){return e.get("paths")})),v=t.operations=(0,i.createSelector)(m,function(e){if(!e||e.size<1)return(0,a.List)();var t=(0,a.List)();return e&&e.forEach?(e.forEach(function(e,r){if(!e||!e.forEach)return{};e.forEach(function(e,n){s.indexOf(n)<0||(t=t.push((0,a.fromJS)({path:r,method:n,operation:e,id:n+"-"+r})))})}),t):(0,a.List)()}),g=t.consumes=(0,i.createSelector)(f,function(e){return(0,a.Set)(e.get("consumes"))}),y=t.produces=(0,i.createSelector)(f,function(e){return(0,a.Set)(e.get("produces"))}),_=(t.security=(0,i.createSelector)(f,function(e){return e.get("security",(0,a.List)())}),t.securityDefinitions=(0,i.createSelector)(f,function(e){return e.get("securityDefinitions")}),t.findDefinition=function findDefinition(e,t){var r=e.getIn(["resolvedSubtrees","definitions",t],null),n=e.getIn(["json","definitions",t],null);return r||n||null},t.definitions=(0,i.createSelector)(f,function(e){return e.get("definitions")||(0,a.Map)()}),t.basePath=(0,i.createSelector)(f,function(e){return e.get("basePath")}),t.host=(0,i.createSelector)(f,function(e){return e.get("host")}),t.schemes=(0,i.createSelector)(f,function(e){return e.get("schemes",(0,a.Map)())}),t.operationsWithRootInherited=(0,i.createSelector)(v,g,y,function(e,t,r){return e.map(function(e){return e.update("operation",function(e){if(e){if(!a.Map.isMap(e))return;return e.withMutations(function(e){return e.get("consumes")||e.update("consumes",function(e){return(0,a.Set)(e).merge(t)}),e.get("produces")||e.update("produces",function(e){return(0,a.Set)(e).merge(r)}),e})}return(0,a.Map)()})})})),b=t.tags=(0,i.createSelector)(f,function(e){return e.get("tags",(0,a.List)())}),S=t.tagDetails=function tagDetails(e,t){return(b(e)||(0,a.List)()).filter(a.Map.isMap).find(function(e){return e.get("name")===t},(0,a.Map)())},k=t.operationsWithTags=(0,i.createSelector)(_,b,function(e,t){return e.reduce(function(e,t){var r=(0,a.Set)(t.getIn(["operation","tags"]));return r.count()<1?e.update("default",(0,a.List)(),function(e){return e.push(t)}):r.reduce(function(e,r){return e.update(r,(0,a.List)(),function(e){return e.push(t)})},e)},t.reduce(function(e,t){return e.set(t.get("name"),(0,a.List)())},(0,a.OrderedMap)()))}),x=(t.taggedOperations=function taggedOperations(e){return function(t){var r=(0,t.getConfigs)(),n=r.tagsSorter,i=r.operationsSorter;return k(e).sortBy(function(e,t){return t},function(e,t){var r="function"==typeof n?n:o.sorters.tagsSorter[n];return r?r(e,t):null}).map(function(t,r){var n="function"==typeof i?i:o.sorters.operationsSorter[i],s=n?t.sort(n):t;return(0,a.Map)({tagDetails:S(e,r),operations:s})})}},t.responses=(0,i.createSelector)(u,function(e){return e.get("responses",(0,a.Map)())})),E=t.requests=(0,i.createSelector)(u,function(e){return e.get("requests",(0,a.Map)())}),C=t.mutatedRequests=(0,i.createSelector)(u,function(e){return e.get("mutatedRequests",(0,a.Map)())}),w=(t.responseFor=function responseFor(e,t,r){return x(e).getIn([t,r],null)},t.requestFor=function requestFor(e,t,r){return E(e).getIn([t,r],null)},t.mutatedRequestFor=function mutatedRequestFor(e,t,r){return C(e).getIn([t,r],null)},t.allowTryItOutFor=function allowTryItOutFor(){return!0},t.parameterWithMetaByIdentity=function parameterWithMetaByIdentity(e,t,r){var i=p(e).getIn(["paths"].concat((0,n.default)(t),["parameters"]),(0,a.OrderedMap)()),o=e.getIn(["meta","paths"].concat((0,n.default)(t),["parameters"]),(0,a.OrderedMap)());return i.map(function(e){var t=o.get(r.get("name")+"."+r.get("in")),n=o.get(r.get("name")+"."+r.get("in")+".hash-"+r.hashCode());return(0,a.OrderedMap)().merge(e,t,n)}).find(function(e){return e.get("in")===r.get("in")&&e.get("name")===r.get("name")},(0,a.OrderedMap)())}),D=(t.parameterWithMeta=function parameterWithMeta(e,t,r,i){var o=p(e).getIn(["paths"].concat((0,n.default)(t),["parameters"]),(0,a.OrderedMap)()).find(function(e){return e.get("in")===i&&e.get("name")===r},(0,a.OrderedMap)());return w(e,t,o)},t.operationWithMeta=function operationWithMeta(e,t,r){var n=p(e).getIn(["paths",t,r],(0,a.OrderedMap)()),i=e.getIn(["meta","paths",t,r],(0,a.OrderedMap)()),o=n.get("parameters",(0,a.List)()).map(function(n){return w(e,[t,r],n)});return(0,a.OrderedMap)().merge(n,i).set("parameters",o)});t.hasHost=(0,i.createSelector)(f,function(e){var t=e.get("host");return"string"==typeof t&&t.length>0&&"/"!==t[0]});function parametersIncludeType(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(a.List.isList(e))return e.some(function(e){return a.Map.isMap(e)&&e.get("type")===t})}function currentProducesFor(e,t){t=t||[];var r=p(e).getIn(["paths"].concat((0,n.default)(t)),null);if(null!==r){var i=e.getIn(["meta","paths"].concat((0,n.default)(t),["produces_value"]),null),o=r.getIn(["produces",0],null);return i||o||"application/json"}}var A=t.operationScheme=function operationScheme(e,t,r){var n=e.get("url").match(/^([a-z][a-z0-9+\-.]*):/),i=Array.isArray(n)?n[1]:null;return e.getIn(["scheme",t,r])||e.getIn(["scheme","_defaultScheme"])||i||""};t.canExecuteScheme=function canExecuteScheme(e,t,r){return["http","https"].indexOf(A(e,t,r))>-1},t.validateBeforeExecute=function validateBeforeExecute(e,t){t=t||[];var r=!0;return e.getIn(["meta","paths"].concat((0,n.default)(t),["parameters"]),(0,a.fromJS)([])).forEach(function(e){var t=e.get("errors");t&&t.count()&&(r=!1)}),r};function returnSelfOrNewMap(e){return a.Map.isMap(e)?e:new a.Map}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.executeRequest=t.logRequest=t.setMutatedRequest=t.setRequest=t.setResponse=t.validateParams=t.invalidateResolvedSubtreeCache=t.updateResolvedSubtree=t.requestResolvedSubtree=t.resolveSpec=t.parseToJson=t.SET_SCHEME=t.UPDATE_RESOLVED_SUBTREE=t.UPDATE_RESOLVED=t.UPDATE_OPERATION_META_VALUE=t.CLEAR_VALIDATE_PARAMS=t.CLEAR_REQUEST=t.CLEAR_RESPONSE=t.LOG_REQUEST=t.SET_MUTATED_REQUEST=t.SET_REQUEST=t.SET_RESPONSE=t.VALIDATE_PARAMS=t.UPDATE_PARAM=t.UPDATE_JSON=t.UPDATE_URL=t.UPDATE_SPEC=void 0;var n=_interopRequireDefault(r(26)),i=_interopRequireDefault(r(87)),o=_interopRequireDefault(r(25)),a=_interopRequireDefault(r(43)),s=_interopRequireDefault(r(151)),u=_interopRequireDefault(r(361)),l=_interopRequireDefault(r(362)),c=_interopRequireDefault(r(44));t.updateSpec=function updateSpec(e){var t=q(e).replace(/\t/g," ");if("string"==typeof e)return{type:_,payload:t}},t.updateResolved=function updateResolved(e){return{type:O,payload:e}},t.updateUrl=function updateUrl(e){return{type:b,payload:e}},t.updateJsonSpec=function updateJsonSpec(e){return{type:S,payload:e}},t.changeParam=function changeParam(e,t,r,n,i){return{type:k,payload:{path:e,value:n,paramName:t,paramIn:r,isXml:i}}},t.changeParamByIdentity=function changeParamByIdentity(e,t,r,n){return{type:k,payload:{path:e,param:t,value:r,isXml:n}}},t.clearValidateParams=function clearValidateParams(e){return{type:M,payload:{pathMethod:e}}},t.changeConsumesValue=function changeConsumesValue(e,t){return{type:T,payload:{path:e,value:t,key:"consumes_value"}}},t.changeProducesValue=function changeProducesValue(e,t){return{type:T,payload:{path:e,value:t,key:"produces_value"}}},t.clearResponse=function clearResponse(e,t){return{type:A,payload:{path:e,method:t}}},t.clearRequest=function clearRequest(e,t){return{type:R,payload:{path:e,method:t}}},t.setScheme=function setScheme(e,t,r){return{type:I,payload:{scheme:e,path:t,method:r}}};var p=_interopRequireDefault(r(218)),f=r(7),d=_interopRequireDefault(r(220)),h=_interopRequireDefault(r(190)),m=_interopRequireDefault(r(365)),v=_interopRequireDefault(r(809)),g=_interopRequireDefault(r(811)),y=r(10);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var _=t.UPDATE_SPEC="spec_update_spec",b=t.UPDATE_URL="spec_update_url",S=t.UPDATE_JSON="spec_update_json",k=t.UPDATE_PARAM="spec_update_param",x=t.VALIDATE_PARAMS="spec_validate_param",E=t.SET_RESPONSE="spec_set_response",C=t.SET_REQUEST="spec_set_request",w=t.SET_MUTATED_REQUEST="spec_set_mutated_request",D=t.LOG_REQUEST="spec_log_request",A=t.CLEAR_RESPONSE="spec_clear_response",R=t.CLEAR_REQUEST="spec_clear_request",M=t.CLEAR_VALIDATE_PARAMS="spec_clear_validate_param",T=t.UPDATE_OPERATION_META_VALUE="spec_update_operation_meta_value",O=t.UPDATE_RESOLVED="spec_update_resolved",P=t.UPDATE_RESOLVED_SUBTREE="spec_update_resolved_subtree",I=t.SET_SCHEME="set_scheme",q=function toStr(e){return(0,m.default)(e)?e:""};t.parseToJson=function parseToJson(e){return function(t){var r=t.specActions,n=t.specSelectors,i=t.errActions,o=n.specStr,a=null;try{e=e||o(),i.clear({source:"parser"}),a=p.default.safeLoad(e)}catch(e){return console.error(e),i.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return a&&"object"===(void 0===a?"undefined":(0,c.default)(a))?r.updateJsonSpec(a):{}}};var F=!1,B=(t.resolveSpec=function resolveSpec(e,t){return function(r){var n=r.specActions,i=r.specSelectors,o=r.errActions,a=r.fn,s=a.fetch,u=a.resolve,l=a.AST,c=r.getConfigs;F||(console.warn("specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!"),F=!0);var p=c(),f=p.modelPropertyMacro,d=p.parameterMacro,h=p.requestInterceptor,m=p.responseInterceptor;void 0===e&&(e=i.specJson()),void 0===t&&(t=i.url());var v=l.getLineNumberForPath,g=i.specStr();return u({fetch:s,spec:e,baseDoc:t,modelPropertyMacro:f,parameterMacro:d,requestInterceptor:h,responseInterceptor:m}).then(function(e){var t=e.spec,r=e.errors;if(o.clear({type:"thrown"}),Array.isArray(r)&&r.length>0){var i=r.map(function(e){return console.error(e),e.line=e.fullPath?v(g,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",Object.defineProperty(e,"message",{enumerable:!0,value:e.message}),e});o.newThrownErrBatch(i)}return n.updateResolved(t)})}},[]),N=(0,v.default)((0,l.default)(u.default.mark(function _callee2(){var e,t,r,n,i,o,a,c,p,d,h,m,v,y,_;return u.default.wrap(function _callee2$(b){for(;;)switch(b.prev=b.next){case 0:if(e=B.system){b.next=4;break}return console.error("debResolveSubtrees: don't have a system to operate on, aborting."),b.abrupt("return");case 4:if(t=e.errActions,r=e.errSelectors,n=e.fn,i=n.resolveSubtree,o=n.AST.getLineNumberForPath,a=e.specSelectors,c=e.specActions,i){b.next=8;break}return console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing."),b.abrupt("return");case 8:return p=a.specStr(),d=e.getConfigs(),h=d.modelPropertyMacro,m=d.parameterMacro,v=d.requestInterceptor,y=d.responseInterceptor,b.prev=10,b.next=13,B.reduce(function(){var e=(0,l.default)(u.default.mark(function _callee(e,n){var s,l,c,f,d,_,b;return u.default.wrap(function _callee$(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,e;case 2:return s=u.sent,l=s.resultMap,c=s.specWithCurrentSubtrees,u.next=7,i(c,n,{baseDoc:a.url(),modelPropertyMacro:h,parameterMacro:m,requestInterceptor:v,responseInterceptor:y});case 7:return f=u.sent,d=f.errors,_=f.spec,r.allErrors().size&&t.clear({type:"thrown"}),Array.isArray(d)&&d.length>0&&(b=d.map(function(e){return e.line=e.fullPath?o(p,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",Object.defineProperty(e,"message",{enumerable:!0,value:e.message}),e}),t.newThrownErrBatch(b)),(0,g.default)(l,n,_),(0,g.default)(c,n,_),u.abrupt("return",{resultMap:l,specWithCurrentSubtrees:c});case 15:case"end":return u.stop()}},_callee,void 0)}));return function(t,r){return e.apply(this,arguments)}}(),s.default.resolve({resultMap:(a.specResolvedSubtree([])||(0,f.Map)()).toJS(),specWithCurrentSubtrees:a.specJson().toJS()}));case 13:_=b.sent,delete B.system,B=[],b.next=21;break;case 18:b.prev=18,b.t0=b.catch(10),console.error(b.t0);case 21:c.updateResolvedSubtree([],_.resultMap);case 22:case"end":return b.stop()}},_callee2,void 0,[[10,18]])})),35);t.requestResolvedSubtree=function requestResolvedSubtree(e){return function(t){B.push(e),B.system=t,N()}};t.updateResolvedSubtree=function updateResolvedSubtree(e,t){return{type:P,payload:{path:e,value:t}}},t.invalidateResolvedSubtreeCache=function invalidateResolvedSubtreeCache(){return{type:P,payload:{path:[],value:(0,f.Map)()}}},t.validateParams=function validateParams(e,t){return{type:x,payload:{pathMethod:e,isOAS3:t}}};t.setResponse=function setResponse(e,t,r){return{payload:{path:e,method:t,res:r},type:E}},t.setRequest=function setRequest(e,t,r){return{payload:{path:e,method:t,req:r},type:C}},t.setMutatedRequest=function setMutatedRequest(e,t,r){return{payload:{path:e,method:t,req:r},type:w}},t.logRequest=function logRequest(e){return{payload:e,type:D}},t.executeRequest=function executeRequest(e){return function(t){var r=t.fn,n=t.specActions,i=t.specSelectors,s=t.getConfigs,u=t.oas3Selectors,l=e.pathName,c=e.method,p=e.operation,f=s(),m=f.requestInterceptor,v=f.responseInterceptor,g=p.toJS();if(e.contextUrl=(0,d.default)(i.url()).toString(),g&&g.operationId?e.operationId=g.operationId:g&&l&&c&&(e.operationId=r.opId(g,l,c)),i.isOAS3()){var _=l+":"+c;e.server=u.selectedServer(_)||u.selectedServer();var b=u.serverVariables({server:e.server,namespace:_}).toJS(),S=u.serverVariables({server:e.server}).toJS();e.serverVariables=(0,a.default)(b).length?b:S,e.requestContentType=u.requestContentType(l,c),e.responseContentType=u.responseContentType(l,c)||"*/*";var k=u.requestBodyValue(l,c);(0,y.isJSONObject)(k)?e.requestBody=JSON.parse(k):k&&k.toJS?e.requestBody=k.toJS():e.requestBody=k}var x=(0,o.default)({},e);x=r.buildRequest(x),n.setRequest(e.pathName,e.method,x);e.requestInterceptor=function requestInterceptorWrapper(t){var r=m.apply(this,[t]),i=(0,o.default)({},r);return n.setMutatedRequest(e.pathName,e.method,i),r},e.responseInterceptor=v;var E=Date.now();return r.execute(e).then(function(t){t.duration=Date.now()-E,n.setResponse(e.pathName,e.method,t)}).catch(function(t){return n.setResponse(e.pathName,e.method,{error:!0,err:(0,h.default)(t)})})}};t.execute=function execute(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,r=e.method,o=(0,i.default)(e,["path","method"]);return function(e){var i=e.fn.fetch,a=e.specSelectors,s=e.specActions,u=a.specJsonWithResolvedSubtrees().toJS(),l=a.operationScheme(t,r),c=a.contentTypeValues([t,r]).toJS(),p=c.requestContentType,f=c.responseContentType,d=/xml/i.test(p),h=a.parameterValues([t,r],d).toJS();return s.executeRequest((0,n.default)({},o,{fetch:i,spec:u,pathName:t,method:r,parameters:h,requestContentType:p,scheme:l,responseContentType:f}))}}},function(e,t){e.exports=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e}},function(e,t,r){"use strict";var n=r(100);e.exports.f=function(e){return new function PromiseCapability(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)}(e)}},function(e,t,r){var n=r(54);e.exports=function(e,t,r){for(var i in t)r&&e[i]?e[i]=t[i]:n(e,i,t[i]);return e}},function(e,t,r){"use strict";var n=r(786);e.exports=n},function(e,t,r){"use strict";var n=r(89);e.exports=new n({explicit:[r(789),r(790),r(791)]})},function(e,t,r){"use strict";(function(t){var n=r(807),i=r(808),o=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],u={hash:1,query:1};function lolcation(e){var r,n={},i=typeof(e=e||t.location||{});if("blob:"===e.protocol)n=new URL(unescape(e.pathname),{});else if("string"===i)for(r in n=new URL(e,{}),u)delete n[r];else if("object"===i){for(r in e)r in u||(n[r]=e[r]);void 0===n.slashes&&(n.slashes=a.test(e.href))}return n}function extractProtocol(e){var t=o.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function URL(e,t,r){if(!(this instanceof URL))return new URL(e,t,r);var o,a,u,l,c,p,f=s.slice(),d=typeof t,h=this,m=0;for("object"!==d&&"string"!==d&&(r=t,t=null),r&&"function"!=typeof r&&(r=i.parse),t=lolcation(t),o=!(a=extractProtocol(e||"")).protocol&&!a.slashes,h.slashes=a.slashes||o&&t.slashes,h.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(f[2]=[/(.*)/,"pathname"]);m-1||n("96",e),!a.plugins[r]){t.extractEvents||n("97",e),a.plugins[r]=t;var s=t.eventTypes;for(var u in s)publishEventForPlugin(s[u],t,u)||n("98",u,e)}}}function publishEventForPlugin(e,t,r){a.eventNameDispatchConfigs.hasOwnProperty(r)&&n("99",r),a.eventNameDispatchConfigs[r]=e;var i=e.phasedRegistrationNames;if(i){for(var o in i){if(i.hasOwnProperty(o))publishRegistrationName(i[o],t,r)}return!0}return!!e.registrationName&&(publishRegistrationName(e.registrationName,t,r),!0)}function publishRegistrationName(e,t,r){a.registrationNameModules[e]&&n("100",e),a.registrationNameModules[e]=t,a.registrationNameDependencies[e]=t.eventTypes[r].dependencies}var a={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){i&&n("101"),i=Array.prototype.slice.call(e),recomputePluginOrdering()},injectEventPluginsByName:function(e){var t=!1;for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];o.hasOwnProperty(r)&&o[r]===i||(o[r]&&n("102",r),o[r]=i,t=!0)}t&&recomputePluginOrdering()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return a.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var r=t.phasedRegistrationNames;for(var n in r)if(r.hasOwnProperty(n)){var i=a.registrationNameModules[r[n]];if(i)return i}}return null},_resetEventPlugins:function(){for(var e in i=null,o)o.hasOwnProperty(e)&&delete o[e];a.plugins.length=0;var t=a.eventNameDispatchConfigs;for(var r in t)t.hasOwnProperty(r)&&delete t[r];var n=a.registrationNameModules;for(var s in n)n.hasOwnProperty(s)&&delete n[s]}};e.exports=a},function(e,t,r){"use strict";var n,i,o=r(11),a=r(223);r(8),r(9);function executeDispatch(e,t,r,n){var i=e.type||"unknown-event";e.currentTarget=s.getNodeFromInstance(n),t?a.invokeGuardedCallbackWithCatch(i,r,e):a.invokeGuardedCallback(i,r,e),e.currentTarget=null}var s={isEndish:function isEndish(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e},isMoveish:function isMoveish(e){return"topMouseMove"===e||"topTouchMove"===e},isStartish:function isStartish(e){return"topMouseDown"===e||"topTouchStart"===e},executeDirectDispatch:function executeDirectDispatch(e){var t=e._dispatchListeners,r=e._dispatchInstances;Array.isArray(t)&&o("103"),e.currentTarget=t?s.getNodeFromInstance(r):null;var n=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,n},executeDispatchesInOrder:function executeDispatchesInOrder(e,t){var r=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(r))for(var i=0;i0&&n.length<20?r+" (keys: "+n.join(", ")+")":r}function getInternalInstanceReadyForUpdate(e,t){var r=i.get(e);return r||null}var a={isMounted:function(e){var t=i.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,r){a.validateCallback(t,r);var n=getInternalInstanceReadyForUpdate(e);if(!n)return null;n._pendingCallbacks?n._pendingCallbacks.push(t):n._pendingCallbacks=[t],enqueueUpdate(n)},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],enqueueUpdate(e)},enqueueForceUpdate:function(e){var t=getInternalInstanceReadyForUpdate(e);t&&(t._pendingForceUpdate=!0,enqueueUpdate(t))},enqueueReplaceState:function(e,t,r){var n=getInternalInstanceReadyForUpdate(e);n&&(n._pendingStateQueue=[t],n._pendingReplaceState=!0,void 0!==r&&null!==r&&(a.validateCallback(r,"replaceState"),n._pendingCallbacks?n._pendingCallbacks.push(r):n._pendingCallbacks=[r]),enqueueUpdate(n))},enqueueSetState:function(e,t){var r=getInternalInstanceReadyForUpdate(e);r&&((r._pendingStateQueue||(r._pendingStateQueue=[])).push(t),enqueueUpdate(r))},enqueueElementInternal:function(e,t,r){e._pendingElement=t,e._context=r,enqueueUpdate(e)},validateCallback:function(e,t){e&&"function"!=typeof e&&n("122",t,formatUnexpectedArgument(e))}};e.exports=a},function(e,t,r){"use strict";r(13);var n=r(34),i=(r(9),n);e.exports=i},function(e,t,r){"use strict";e.exports=function getEventCharCode(e){var t,r=e.keyCode;return"charCode"in e?0===(t=e.charCode)&&13===r&&(t=13):t=r,t>=32||13===t?t:0}},function(e,t,r){var n=r(64),i=r(239),o=r(50),a="[object Object]",s=Function.prototype,u=Object.prototype,l=s.toString,c=u.hasOwnProperty,p=l.call(Object);e.exports=function isPlainObject(e){if(!o(e)||n(e)!=a)return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)==p}},function(e,t,r){var n=r(320)(Object.getPrototypeOf,Object);e.exports=n},function(e,t,r){var n=r(314);e.exports=function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},function(e,t,r){(function(){var e,t,n,i=function(e,t){for(var r in t)o.call(t,r)&&(e[r]=t[r]);function ctor(){this.constructor=e}return ctor.prototype=t.prototype,e.prototype=new ctor,e.__super__=t.prototype,e},o={}.hasOwnProperty,a=[].indexOf||function(e){for(var t=0,r=this.length;tr?p.push([c,s]):i[s]=this.yaml_path_resolvers[c][s]);else for(a=0,l=(h=this.yaml_path_resolvers).length;a=0)return o[e];if(a.call(o,null)>=0)return o.null}return e===t.ScalarNode?"tag:yaml.org,2002:str":e===t.SequenceNode?"tag:yaml.org,2002:seq":e===t.MappingNode?"tag:yaml.org,2002:map":void 0},BaseResolver}(),this.Resolver=function(e){function Resolver(){return Resolver.__super__.constructor.apply(this,arguments)}return i(Resolver,e),Resolver}(this.BaseResolver),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:bool",/^(?:yes|Yes|YES|true|True|TRUE|on|On|ON|no|No|NO|false|False|FALSE|off|Off|OFF)$/,"yYnNtTfFoO"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:float",/^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)?|\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/,"-+0123456789."),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:int",/^(?:[-+]?0b[01_]+|[-+]?0[0-7_]+|[-+]?(?:0|[1-9][0-9_]*)|[-+]?0x[0-9a-fA-F_]+|[-+]?0o[0-7_]+|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$/,"-+0123456789"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:merge",/^(?:<<)$/,"<"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:null",/^(?:~|null|Null|NULL|)$/,["~","n","N",""]),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:timestamp",/^(?:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]|[0-9][0-9][0-9][0-9]-[0-9][0-9]?-[0-9][0-9]?(?:[Tt]|[\x20\t]+)[0-9][0-9]?:[0-9][0-9]:[0-9][0-9](?:\.[0-9]*)?(?:[\x20\t]*(?:Z|[-+][0-9][0-9]?(?::[0-9][0-9])?))?)$/,"0123456789"),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:value",/^(?:=)$/,"="),this.Resolver.add_implicit_resolver("tag:yaml.org,2002:yaml",/^(?:!|&|\*)$/,"!&*")}).call(this)},function(e,t){(function(){var e=function(e,r){for(var n in r)t.call(r,n)&&(e[n]=r[n]);function ctor(){this.constructor=e}return ctor.prototype=r.prototype,e.prototype=new ctor,e.__super__=r.prototype,e},t={}.hasOwnProperty;this.Token=function(){return function Token(e,t){this.start_mark=e,this.end_mark=t}}(),this.DirectiveToken=function(t){function DirectiveToken(e,t,r,n){this.name=e,this.value=t,this.start_mark=r,this.end_mark=n}return e(DirectiveToken,t),DirectiveToken.prototype.id="",DirectiveToken}(this.Token),this.DocumentStartToken=function(t){function DocumentStartToken(){return DocumentStartToken.__super__.constructor.apply(this,arguments)}return e(DocumentStartToken,t),DocumentStartToken.prototype.id="",DocumentStartToken}(this.Token),this.DocumentEndToken=function(t){function DocumentEndToken(){return DocumentEndToken.__super__.constructor.apply(this,arguments)}return e(DocumentEndToken,t),DocumentEndToken.prototype.id="",DocumentEndToken}(this.Token),this.StreamStartToken=function(t){function StreamStartToken(e,t,r){this.start_mark=e,this.end_mark=t,this.encoding=r}return e(StreamStartToken,t),StreamStartToken.prototype.id="",StreamStartToken}(this.Token),this.StreamEndToken=function(t){function StreamEndToken(){return StreamEndToken.__super__.constructor.apply(this,arguments)}return e(StreamEndToken,t),StreamEndToken.prototype.id="",StreamEndToken}(this.Token),this.BlockSequenceStartToken=function(t){function BlockSequenceStartToken(){return BlockSequenceStartToken.__super__.constructor.apply(this,arguments)}return e(BlockSequenceStartToken,t),BlockSequenceStartToken.prototype.id="",BlockSequenceStartToken}(this.Token),this.BlockMappingStartToken=function(t){function BlockMappingStartToken(){return BlockMappingStartToken.__super__.constructor.apply(this,arguments)}return e(BlockMappingStartToken,t),BlockMappingStartToken.prototype.id="",BlockMappingStartToken}(this.Token),this.BlockEndToken=function(t){function BlockEndToken(){return BlockEndToken.__super__.constructor.apply(this,arguments)}return e(BlockEndToken,t),BlockEndToken.prototype.id="",BlockEndToken}(this.Token),this.FlowSequenceStartToken=function(t){function FlowSequenceStartToken(){return FlowSequenceStartToken.__super__.constructor.apply(this,arguments)}return e(FlowSequenceStartToken,t),FlowSequenceStartToken.prototype.id="[",FlowSequenceStartToken}(this.Token),this.FlowMappingStartToken=function(t){function FlowMappingStartToken(){return FlowMappingStartToken.__super__.constructor.apply(this,arguments)}return e(FlowMappingStartToken,t),FlowMappingStartToken.prototype.id="{",FlowMappingStartToken}(this.Token),this.FlowSequenceEndToken=function(t){function FlowSequenceEndToken(){return FlowSequenceEndToken.__super__.constructor.apply(this,arguments)}return e(FlowSequenceEndToken,t),FlowSequenceEndToken.prototype.id="]",FlowSequenceEndToken}(this.Token),this.FlowMappingEndToken=function(t){function FlowMappingEndToken(){return FlowMappingEndToken.__super__.constructor.apply(this,arguments)}return e(FlowMappingEndToken,t),FlowMappingEndToken.prototype.id="}",FlowMappingEndToken}(this.Token),this.KeyToken=function(t){function KeyToken(){return KeyToken.__super__.constructor.apply(this,arguments)}return e(KeyToken,t),KeyToken.prototype.id="?",KeyToken}(this.Token),this.ValueToken=function(t){function ValueToken(){return ValueToken.__super__.constructor.apply(this,arguments)}return e(ValueToken,t),ValueToken.prototype.id=":",ValueToken}(this.Token),this.BlockEntryToken=function(t){function BlockEntryToken(){return BlockEntryToken.__super__.constructor.apply(this,arguments)}return e(BlockEntryToken,t),BlockEntryToken.prototype.id="-",BlockEntryToken}(this.Token),this.FlowEntryToken=function(t){function FlowEntryToken(){return FlowEntryToken.__super__.constructor.apply(this,arguments)}return e(FlowEntryToken,t),FlowEntryToken.prototype.id=",",FlowEntryToken}(this.Token),this.AliasToken=function(t){function AliasToken(e,t,r){this.value=e,this.start_mark=t,this.end_mark=r}return e(AliasToken,t),AliasToken.prototype.id="",AliasToken}(this.Token),this.AnchorToken=function(t){function AnchorToken(e,t,r){this.value=e,this.start_mark=t,this.end_mark=r}return e(AnchorToken,t),AnchorToken.prototype.id="",AnchorToken}(this.Token),this.TagToken=function(t){function TagToken(e,t,r){this.value=e,this.start_mark=t,this.end_mark=r}return e(TagToken,t),TagToken.prototype.id="",TagToken}(this.Token),this.ScalarToken=function(t){function ScalarToken(e,t,r,n,i){this.value=e,this.plain=t,this.start_mark=r,this.end_mark=n,this.style=i}return e(ScalarToken,t),ScalarToken.prototype.id="",ScalarToken}(this.Token)}).call(this)},function(e,t){var r=this&&this.__extends||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)},n=Object.prototype.hasOwnProperty; +/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017 Joachim Wester + * MIT license + */function hasOwnProperty(e,t){return n.call(e,t)}function _objectKeys(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r=48&&t<=57))return!1;r++}return!0},t.escapePathComponent=escapePathComponent,t.unescapePathComponent=function unescapePathComponent(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},t._getPathRecursive=_getPathRecursive,t.getPath=function getPath(e,t){if(e===t)return"/";var r=_getPathRecursive(e,t);if(""===r)throw new Error("Object not found in root");return"/"+r},t.hasUndefined=function hasUndefined(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,r=e.length;tS;S++)if((f||S in y)&&(v=_(m=y[S],S,g),e))if(r)k[S]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return S;case 2:k.push(m)}else if(c)return!1;return p?-1:l||c?c:k}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authorizeRequest=t.authorizeAccessCodeWithBasicAuthentication=t.authorizeAccessCodeWithFormParams=t.authorizeApplication=t.authorizePassword=t.preAuthorizeImplicit=t.CONFIGURE_AUTH=t.VALIDATE=t.AUTHORIZE_OAUTH2=t.PRE_AUTHORIZE_OAUTH2=t.LOGOUT=t.AUTHORIZE=t.SHOW_AUTH_POPUP=void 0;var n=_interopRequireDefault(r(44)),i=_interopRequireDefault(r(25)),o=_interopRequireDefault(r(37));t.showDefinitions=function showDefinitions(e){return{type:l,payload:e}},t.authorize=function authorize(e){return{type:c,payload:e}},t.logout=function logout(e){return{type:p,payload:e}},t.authorizeOauth2=function authorizeOauth2(e){return{type:f,payload:e}},t.configureAuth=function configureAuth(e){return{type:d,payload:e}};var a=_interopRequireDefault(r(220)),s=_interopRequireDefault(r(32)),u=r(10);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var l=t.SHOW_AUTH_POPUP="show_popup",c=t.AUTHORIZE="authorize",p=t.LOGOUT="logout",f=(t.PRE_AUTHORIZE_OAUTH2="pre_authorize_oauth2",t.AUTHORIZE_OAUTH2="authorize_oauth2"),d=(t.VALIDATE="validate",t.CONFIGURE_AUTH="configure_auth");t.preAuthorizeImplicit=function preAuthorizeImplicit(e){return function(t){var r=t.authActions,n=t.errActions,i=e.auth,a=e.token,u=e.isValid,l=i.schema,c=i.name,p=l.get("flow");delete s.default.swaggerUIRedirectOauth2,"accessCode"===p||u||n.newAuthErr({authId:c,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),a.error?n.newAuthErr({authId:c,source:"auth",level:"error",message:(0,o.default)(a)}):r.authorizeOauth2({auth:i,token:a})}};t.authorizePassword=function authorizePassword(e){return function(t){var r=t.authActions,n=e.schema,o=e.name,a=e.username,s=e.password,l=e.passwordType,c=e.clientId,p=e.clientSecret,f={grant_type:"password",scope:e.scopes.join(" ")},d={},h={};return"basic"===l?h.Authorization="Basic "+(0,u.btoa)(a+":"+s):((0,i.default)(f,{username:a},{password:s}),"query"===l?(c&&(d.client_id=c),p&&(d.client_secret=p)):h.Authorization="Basic "+(0,u.btoa)(c+":"+p)),r.authorizeRequest({body:(0,u.buildFormData)(f),url:n.get("tokenUrl"),name:o,headers:h,query:d,auth:e})}},t.authorizeApplication=function authorizeApplication(e){return function(t){var r=t.authActions,n=e.schema,i=e.scopes,o=e.name,a=e.clientId,s=e.clientSecret,l={Authorization:"Basic "+(0,u.btoa)(a+":"+s)},c={grant_type:"client_credentials",scope:i.join(" ")};return r.authorizeRequest({body:(0,u.buildFormData)(c),name:o,url:n.get("tokenUrl"),auth:e,headers:l})}},t.authorizeAccessCodeWithFormParams=function authorizeAccessCodeWithFormParams(e){var t=e.auth,r=e.redirectUrl;return function(e){var n=e.authActions,i=t.schema,o=t.name,a=t.clientId,s=t.clientSecret,l={grant_type:"authorization_code",code:t.code,client_id:a,client_secret:s,redirect_uri:r};return n.authorizeRequest({body:(0,u.buildFormData)(l),name:o,url:i.get("tokenUrl"),auth:t})}},t.authorizeAccessCodeWithBasicAuthentication=function authorizeAccessCodeWithBasicAuthentication(e){var t=e.auth,r=e.redirectUrl;return function(e){var n=e.authActions,i=t.schema,o=t.name,a=t.clientId,s=t.clientSecret,l={Authorization:"Basic "+(0,u.btoa)(a+":"+s)},c={grant_type:"authorization_code",code:t.code,client_id:a,redirect_uri:r};return n.authorizeRequest({body:(0,u.buildFormData)(c),name:o,url:i.get("tokenUrl"),auth:t,headers:l})}},t.authorizeRequest=function authorizeRequest(e){return function(t){var r=t.fn,s=t.getConfigs,u=t.authActions,l=t.errActions,c=t.oas3Selectors,p=t.specSelectors,f=t.authSelectors,d=e.body,h=e.query,m=void 0===h?{}:h,v=e.headers,g=void 0===v?{}:v,y=e.name,_=e.url,b=e.auth,S=(f.getConfigs()||{}).additionalQueryStringParams,k=void 0;k=p.isOAS3()?(0,a.default)(_,c.selectedServer(),!0):(0,a.default)(_,p.url(),!0),"object"===(void 0===S?"undefined":(0,n.default)(S))&&(k.query=(0,i.default)({},k.query,S));var x=k.toString(),E=(0,i.default)({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded"},g);r.fetch({url:x,method:"post",headers:E,query:m,body:d,requestInterceptor:s().requestInterceptor,responseInterceptor:s().responseInterceptor}).then(function(e){var t=JSON.parse(e.data),r=t&&(t.error||""),n=t&&(t.parseError||"");e.ok?r||n?l.newAuthErr({authId:y,level:"error",source:"auth",message:(0,o.default)(t)}):u.authorizeOauth2({auth:b,token:t}):l.newAuthErr({authId:y,level:"error",source:"auth",message:e.statusText})}).catch(function(e){var t=new Error(e);l.newAuthErr({authId:y,level:"error",source:"auth",message:t.message})})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(991)),i=_interopRequireDefault(r(996)),o=_interopRequireDefault(r(997)),a=_interopRequireDefault(r(998)),s=_interopRequireDefault(r(999)),u=_interopRequireDefault(r(1e3)),l=_interopRequireDefault(r(1001)),c=_interopRequireDefault(r(1002)),p=_interopRequireDefault(r(1003)),f=_interopRequireDefault(r(1004)),d=_interopRequireDefault(r(1005)),h=_interopRequireDefault(r(1007)),m=_interopRequireDefault(r(1021));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var v=[o.default,i.default,a.default,u.default,l.default,c.default,p.default,f.default,d.default,s.default],g=(0,n.default)({prefixMap:m.default.prefixMap,plugins:v},h.default);t.default=g,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function capitalizeString(e){return e.charAt(0).toUpperCase()+e.slice(1)},e.exports=t.default},function(e,t,r){var n=r(1022),i=r(1);e.exports=function(e,t,r){var i=e[t];if(i){var o=[];if(Object.keys(i).forEach(function(e){-1===n.indexOf(e)&&o.push(e)}),o.length)throw new Error("Prop "+t+" passed to "+r+". Has invalid keys "+o.join(", "))}},e.exports.isRequired=function(t,r,n){if(!t[r])throw new Error("Prop "+r+" passed to "+n+" is required");return e.exports(t,r,n)},e.exports.supportingArrays=i.oneOfType([i.arrayOf(e.exports),e.exports])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseYamlConfig=void 0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(218));t.parseYamlConfig=function parseYamlConfig(e,t){try{return n.default.safeLoad(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loaded=t.TOGGLE_CONFIGS=t.UPDATE_CONFIGS=void 0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(24));t.update=function update(e,t){return{type:i,payload:(0,n.default)({},e,t)}},t.toggle=function toggle(e){return{type:o,payload:e}};var i=t.UPDATE_CONFIGS="configs_update",o=t.TOGGLE_CONFIGS="configs_toggle";t.loaded=function loaded(){return function(){}}},function(e,t,r){"use strict";t.__esModule=!0,t.default=function mapToZero(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=0);return t},e.exports=t.default},function(e,t,r){"use strict";t.__esModule=!0,t.default=function stepper(e,t,r,i,o,a,s){var u=r+(-o*(t-i)+-a*r)*e,l=t+u*e;if(Math.abs(u)u;)n(s,r=t[u++])&&(~o(l,r)||l.push(r));return l}},function(e,t,r){var n=r(23).document;e.exports=n&&n.documentElement},function(e,t,r){var n=r(56),i=r(74),o=r(172)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,r){var n=r(33),i=n["__core-js_shared__"]||(n["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){"use strict";var n=r(268)(!0);r(269)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},function(e,t,r){var n=r(126),i=r(57);e.exports=function(e){return function(t,r){var o,a,s=String(i(t)),u=n(r),l=s.length;return u<0||u>=l?e?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===l||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},function(e,t,r){"use strict";var n=r(270),i=r(30),o=r(75),a=r(61),s=r(108),u=r(507),l=r(181),c=r(513),p=r(17)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,r,h,m,v,g){u(r,t,h);var y,_,b,S=function(e){if(!f&&e in C)return C[e];switch(e){case"keys":return function keys(){return new r(this,e)};case"values":return function values(){return new r(this,e)}}return function entries(){return new r(this,e)}},k=t+" Iterator",x="values"==m,E=!1,C=e.prototype,w=C[p]||C["@@iterator"]||m&&C[m],D=w||S(m),A=m?x?S("entries"):D:void 0,R="Array"==t&&C.entries||w;if(R&&(b=c(R.call(new e)))!==Object.prototype&&b.next&&(l(b,k,!0),n||"function"==typeof b[p]||a(b,p,d)),x&&w&&"values"!==w.name&&(E=!0,D=function values(){return w.call(this)}),n&&!g||!f&&!E&&C[p]||a(C,p,D),s[t]=D,s[k]=d,m)if(y={values:x?D:S("values"),keys:v?D:S("keys"),entries:A},g)for(_ in y)_ in C||o(C,_,y[_]);else i(i.P+i.F*(f||E),t,y);return y}},function(e,t){e.exports=!1},function(e,t,r){var n=r(510),i=r(273);e.exports=Object.keys||function keys(e){return n(e,i)}},function(e,t,r){var n=r(126),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=n(e))<0?i(e+t,0):o(e,t)}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(33).document;e.exports=n&&n.documentElement},function(e,t,r){var n=r(62),i=r(128),o=r(17)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||void 0==(r=n(a)[o])?t:i(r)}},function(e,t,r){var n,i,o,a=r(127),s=r(525),u=r(274),l=r(179),c=r(33),p=c.process,f=c.setImmediate,d=c.clearImmediate,h=c.MessageChannel,m=c.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},_=function(e){y.call(e.data)};f&&d||(f=function setImmediate(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},n(v),v},d=function clearImmediate(e){delete g[e]},"process"==r(105)(p)?n=function(e){p.nextTick(a(y,e,1))}:m&&m.now?n=function(e){m.now(a(y,e,1))}:h?(o=(i=new h).port2,i.port1.onmessage=_,n=a(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(n=function(e){c.postMessage(e+"","*")},c.addEventListener("message",_,!1)):n="onreadystatechange"in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:d}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,r){var n=r(62),i=r(76),o=r(182);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},function(e,t,r){var n=r(76),i=r(105),o=r(17)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,r){var n=r(22),i=r(15),o=r(55);e.exports=function(e,t){var r=(i.Object||{})[e]||Object[e],a={};a[e]=t(r),n(n.S+n.F*o(function(){r(1)}),"Object",a)}},function(e,t,r){var n=r(99);e.exports=Array.isArray||function isArray(e){return"Array"==n(e)}},function(e,t,r){var n=r(262),i=r(174).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return n(e,i)}},function(e,t,r){var n=r(132),i=r(101),o=r(73),a=r(168),s=r(56),u=r(261),l=Object.getOwnPropertyDescriptor;t.f=r(47)?l:function getOwnPropertyDescriptor(e,t){if(e=o(e),t=a(t,!0),u)try{return l(e,t)}catch(e){}if(s(e,t))return i(!n.f.call(e,t),e[t])}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){e.exports={default:r(577),__esModule:!0}},function(e,t,r){"use strict";var n=r(102),i=r(187),o=r(132),a=r(74),s=r(165),u=Object.assign;e.exports=!u||r(55)(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=u({},e)[r]||Object.keys(u({},t)).join("")!=n})?function assign(e,t){for(var r=a(e),u=arguments.length,l=1,c=i.f,p=o.f;u>l;)for(var f,d=s(arguments[l++]),h=c?n(d).concat(c(d)):n(d),m=h.length,v=0;m>v;)p.call(d,f=h[v++])&&(r[f]=d[f]);return r}:u},function(e,t,r){"use strict";var n=r(110),i=r(13),o=r(288),a=(r(289),r(133));r(8),r(581);function ReactComponent(e,t,r){this.props=e,this.context=t,this.refs=a,this.updater=r||o}function ReactPureComponent(e,t,r){this.props=e,this.context=t,this.refs=a,this.updater=r||o}function ComponentDummy(){}ReactComponent.prototype.isReactComponent={},ReactComponent.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&n("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},ReactComponent.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")},ComponentDummy.prototype=ReactComponent.prototype,ReactPureComponent.prototype=new ComponentDummy,ReactPureComponent.prototype.constructor=ReactPureComponent,i(ReactPureComponent.prototype,ReactComponent.prototype),ReactPureComponent.prototype.isPureReactComponent=!0,e.exports={Component:ReactComponent,PureComponent:ReactPureComponent}},function(e,t,r){"use strict";r(9);var n={isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}};e.exports=n},function(e,t,r){"use strict";var n=!1;e.exports=n},function(e,t,r){"use strict";var n="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=n},function(e,t,r){"use strict";var n=r(589);e.exports=function(e){return n(e,!1)}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(294),i=r(606),o=r(607),a=r(608),s=r(298);r(297);r.d(t,"createStore",function(){return n.b}),r.d(t,"combineReducers",function(){return i.a}),r.d(t,"bindActionCreators",function(){return o.a}),r.d(t,"applyMiddleware",function(){return a.a}),r.d(t,"compose",function(){return s.a})},function(e,t,r){"use strict";r.d(t,"a",function(){return o}),t.b=function createStore(e,t,r){var a;"function"==typeof t&&void 0===r&&(r=t,t=void 0);if(void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(createStore)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var s=e;var u=t;var l=[];var c=l;var p=!1;function ensureCanMutateNextListeners(){c===l&&(c=l.slice())}function getState(){return u}function subscribe(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return ensureCanMutateNextListeners(),c.push(e),function unsubscribe(){if(t){t=!1,ensureCanMutateNextListeners();var r=c.indexOf(e);c.splice(r,1)}}}function dispatch(e){if(!n.a(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(p)throw new Error("Reducers may not dispatch actions.");try{p=!0,u=s(u,e)}finally{p=!1}for(var t=l=c,r=0;ri?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++nf))return!1;var h=c.get(e);if(h&&c.get(t))return h==t;var m=-1,v=!0,g=r&s?new n:void 0;for(c.set(e,t),c.set(t,e);++m0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function _uint8ArrayToBuffer(e){return l.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):addChunk(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?addChunk(e,a,t,!1):maybeReadMore(e,a)):addChunk(e,a,t,!1))):n||(a.reading=!1));return function needMoreData(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function computeNewHighWaterMark(e){return e>=y?e=y:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function emitReadable(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(emitReadable_,e):emitReadable_(e))}function emitReadable_(e){d("emit readable"),e.emit("readable"),flow(e)}function maybeReadMore(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(maybeReadMore_,e,t))}function maybeReadMore_(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function fromListPartial(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function copyFromBuffer(e,t){var r=l.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function endReadable(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(endReadableNT,t,e))}function endReadableNT(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function indexOf(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?endReadable(this):emitReadable(this),null;if(0===(e=howMuchToRead(e,t))&&t.ended)return 0===t.length&&endReadable(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?fromList(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&endReadable(this)),null!==n&&this.emit("data",n),n},Readable.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?onend:unpipe;function onunpipe(t,n){d("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,function cleanup(){d("cleanup"),e.removeListener("close",onclose),e.removeListener("finish",onfinish),e.removeListener("drain",l),e.removeListener("error",onerror),e.removeListener("unpipe",onunpipe),r.removeListener("end",onend),r.removeListener("end",unpipe),r.removeListener("data",ondata),c=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l()}())}function onend(){d("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",onunpipe);var l=function pipeOnDrain(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,flow(e))}}(r);e.on("drain",l);var c=!1;var p=!1;function ondata(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==indexOf(o.pipes,e))&&!c&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function onerror(t){d("onerror",t),unpipe(),e.removeListener("error",onerror),0===s(e,"error")&&e.emit("error",t)}function onclose(){e.removeListener("finish",onfinish),unpipe()}function onfinish(){d("onfinish"),e.removeListener("close",onclose),unpipe()}function unpipe(){d("unpipe"),r.unpipe(e)}return r.on("data",ondata),function prependListener(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",onerror),e.once("close",onclose),e.once("finish",onfinish),e.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),e},Readable.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o=0&&(e._idleTimeoutId=setTimeout(function onTimeout(){e._onTimeout&&e._onTimeout()},t))},r(707),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(t,r(18))},function(e,t,r){"use strict";var n=r(148).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function StringDecoder(e){var t;switch(this.encoding=function normalizeEncoding(e){var t=function _normalizeEncoding(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,t=4;break;case"utf8":this.fillLast=utf8FillLast,t=4;break;case"base64":this.text=base64Text,this.end=base64End,t=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function utf8CheckByte(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed,r=function utf8CheckExtraBytes(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function utf16Text(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function base64Text(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function base64End(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}t.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(e.lastNeed=i-1),i;if(--n=0)return i>0&&(e.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},StringDecoder.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";e.exports=Transform;var n=r(67),i=r(112);function Transform(e){if(!(this instanceof Transform))return new Transform(e);n.call(this,e),this._transformState={afterTransform:function afterTransform(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length=0?r&&i?i-1:i:1:!1!==e&&n(e)}},function(e,t,r){"use strict";e.exports=r(723)()?Object.assign:r(724)},function(e,t,r){"use strict";var n,i,o,a,s,u=r(69),l=function(e,t){return t};try{Object.defineProperty(l,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(e){}1===l.length?(n={configurable:!0,writable:!1,enumerable:!1},i=Object.defineProperty,e.exports=function(e,t){return t=u(t),e.length===t?e:(n.value=t,i(e,"length",n))}):(a=r(339),s=[],o=function(e){var t,r=0;if(s[e])return s[e];for(t=[];e--;)t.push("a"+(++r).toString(36));return new Function("fn","return function ("+t.join(", ")+") { return fn.apply(this, arguments); };")},e.exports=function(e,t){var r;if(t=u(t),e.length===t)return e;r=o(t)(e);try{a(r,e)}catch(e){}return r})},function(e,t,r){"use strict";var n=r(85),i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;e.exports=function(e,t){var r,u=Object(n(t));if(e=Object(n(e)),a(u).forEach(function(n){try{i(e,n,o(t,n))}catch(e){r=e}}),"function"==typeof s&&s(u).forEach(function(n){try{i(e,n,o(t,n))}catch(e){r=e}}),void 0!==r)throw r;return e}},function(e,t,r){"use strict";var n=r(58),i=r(149),o=Function.prototype.call;e.exports=function(e,t){var r={},a=arguments[2];return n(t),i(e,function(e,n,i,s){r[n]=o.call(t,a,e,n,i,s)}),r}},function(e,t){e.exports=function isPromise(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{statePlugins:{err:{reducers:(0,n.default)(e),actions:i,selectors:o}}}};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(343)),i=_interopRequireWildcard(r(134)),o=_interopRequireWildcard(r(348));function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(24)),i=_interopRequireDefault(r(25));t.default=function(e){var t;return t={},(0,n.default)(t,o.NEW_THROWN_ERR,function(t,r){var n=r.payload,o=(0,i.default)(u,n,{type:"thrown"});return t.update("errors",function(e){return(e||(0,a.List)()).push((0,a.fromJS)(o))}).update("errors",function(t){return(0,s.default)(t,e.getSystem())})}),(0,n.default)(t,o.NEW_THROWN_ERR_BATCH,function(t,r){var n=r.payload;return n=n.map(function(e){return(0,a.fromJS)((0,i.default)(u,e,{type:"thrown"}))}),t.update("errors",function(e){return(e||(0,a.List)()).concat((0,a.fromJS)(n))}).update("errors",function(t){return(0,s.default)(t,e.getSystem())})}),(0,n.default)(t,o.NEW_SPEC_ERR,function(t,r){var n=r.payload,i=(0,a.fromJS)(n);return i=i.set("type","spec"),t.update("errors",function(e){return(e||(0,a.List)()).push((0,a.fromJS)(i)).sortBy(function(e){return e.get("line")})}).update("errors",function(t){return(0,s.default)(t,e.getSystem())})}),(0,n.default)(t,o.NEW_SPEC_ERR_BATCH,function(t,r){var n=r.payload;return n=n.map(function(e){return(0,a.fromJS)((0,i.default)(u,e,{type:"spec"}))}),t.update("errors",function(e){return(e||(0,a.List)()).concat((0,a.fromJS)(n))}).update("errors",function(t){return(0,s.default)(t,e.getSystem())})}),(0,n.default)(t,o.NEW_AUTH_ERR,function(t,r){var n=r.payload,o=(0,a.fromJS)((0,i.default)({},n));return o=o.set("type","auth"),t.update("errors",function(e){return(e||(0,a.List)()).push((0,a.fromJS)(o))}).update("errors",function(t){return(0,s.default)(t,e.getSystem())})}),(0,n.default)(t,o.CLEAR,function(e,t){var r=t.payload;if(!r||!e.get("errors"))return e;var n=e.get("errors").filter(function(e){return e.keySeq().every(function(t){var n=e.get(t),i=r[t];return!i||n!==i})});return e.merge({errors:n})}),(0,n.default)(t,o.CLEAR_BY,function(e,t){var r=t.payload;if(!r||"function"!=typeof r)return e;var n=e.get("errors").filter(function(e){return r(e)});return e.merge({errors:n})}),t};var o=r(134),a=r(7),s=_interopRequireDefault(r(344));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var u={line:0,level:"error",message:"Unknown error"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function transformErrors(e,t){var r={jsSpec:t.specSelectors.specJson().toJS()};return(0,n.default)(i,function(e,t){try{var n=t.transform(e,r);return n.filter(function(e){return!!e})}catch(t){return console.error("Transformer error:",t),e}},e).filter(function(e){return!!e}).map(function(e){return!e.get("line")&&e.get("path"),e})};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(771));function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var i=[_interopRequireWildcard(r(345)),_interopRequireWildcard(r(346)),_interopRequireWildcard(r(347))]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transform=function transform(e){return e.map(function(e){var t=e.get("message").indexOf("is not of a type(s)");if(t>-1){var r=e.get("message").slice(t+"is not of a type(s)".length).split(",");return e.set("message",e.get("message").slice(0,t)+function makeNewMessage(e){return e.reduce(function(e,t,r,n){return r===n.length-1&&n.length>1?e+"or "+t:n[r+1]&&n.length>2?e+t+", ":n[r+1]?e+t+" ":e+t},"should be a")}(r))}return e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transform=function transform(e,t){t.jsSpec;return e};(function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}})(r(145)),r(7)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transform=function transform(e){return e.map(function(e){return e.set("message",function removeSubstring(e,t){return e.replace(new RegExp(t,"g"),"")}(e.get("message"),"instance."))})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lastError=t.allErrors=void 0;var n=r(7),i=r(59),o=t.allErrors=(0,i.createSelector)(function state(e){return e},function(e){return e.get("errors",(0,n.List)())});t.lastError=(0,i.createSelector)(o,function(e){return e.last()})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{layout:{reducers:n.default,actions:i,selectors:o}}}};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(350)),i=_interopRequireWildcard(r(212)),o=_interopRequireWildcard(r(351));function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(24)),o=r(7),a=r(212);t.default=(n={},(0,i.default)(n,a.UPDATE_LAYOUT,function(e,t){return e.set("layout",t.payload)}),(0,i.default)(n,a.UPDATE_FILTER,function(e,t){return e.set("filter",t.payload)}),(0,i.default)(n,a.SHOW,function(e,t){var r=t.payload.shown,n=(0,o.fromJS)(t.payload.thing);return e.update("shown",(0,o.fromJS)({}),function(e){return e.set(n,r)})}),(0,i.default)(n,a.UPDATE_MODE,function(e,t){var r=t.payload.thing,n=t.payload.mode;return e.setIn(["modes"].concat(r),(n||"")+"")}),n)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.showSummary=t.whatMode=t.isShown=t.currentFilter=t.current=void 0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(86)),i=r(59),o=r(10),a=r(7);t.current=function current(e){return e.get("layout")},t.currentFilter=function currentFilter(e){return e.get("filter")};var s=t.isShown=function isShown(e,t,r){return t=(0,o.normalizeArray)(t),e.get("shown",(0,a.fromJS)({})).get((0,a.fromJS)(t),r)};t.whatMode=function whatMode(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t=(0,o.normalizeArray)(t),e.getIn(["modes"].concat((0,n.default)(t)),r)},t.showSummary=(0,i.createSelector)(function state(e){return e},function(e){return!s(e,"editor")})},function(e,t,r){var n=r(36);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var o=e.return;throw void 0!==o&&n(o.call(e)),t}}},function(e,t,r){var n=r(72),i=r(20)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||o[i]===e)}},function(e,t,r){var n=r(20)("iterator"),i=!1;try{var o=[7][n]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var o=[7],a=o[n]();a.next=function(){return{done:r=!0}},o[n]=function(){return a},e(o)}catch(e){}return r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{statePlugins:{spec:{wrapActions:a,reducers:n.default,actions:i,selectors:o}}}};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(356)),i=_interopRequireWildcard(r(214)),o=_interopRequireWildcard(r(213)),a=_interopRequireWildcard(r(369));function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=_interopRequireDefault(r(24)),o=_interopRequireDefault(r(25)),a=_interopRequireDefault(r(86)),s=r(7),u=r(10),l=_interopRequireDefault(r(32)),c=r(213),p=r(214);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.default=(n={},(0,i.default)(n,p.UPDATE_SPEC,function(e,t){return"string"==typeof t.payload?e.set("spec",t.payload):e}),(0,i.default)(n,p.UPDATE_URL,function(e,t){return e.set("url",t.payload+"")}),(0,i.default)(n,p.UPDATE_JSON,function(e,t){return e.set("json",(0,u.fromJSOrdered)(t.payload))}),(0,i.default)(n,p.UPDATE_RESOLVED,function(e,t){return e.setIn(["resolved"],(0,u.fromJSOrdered)(t.payload))}),(0,i.default)(n,p.UPDATE_RESOLVED_SUBTREE,function(e,t){var r=t.payload,n=r.value,i=r.path;return e.setIn(["resolvedSubtrees"].concat((0,a.default)(i)),(0,u.fromJSOrdered)(n))}),(0,i.default)(n,p.UPDATE_PARAM,function(e,t){var r=t.payload,n=r.path,i=r.paramName,o=r.paramIn,s=r.param,u=r.value,l=r.isXml,c=void 0;c=s&&s.hashCode&&!o&&!i?s.get("name")+"."+s.get("in")+".hash-"+s.hashCode():i+"."+o;var p=l?"value_xml":"value";return e.setIn(["meta","paths"].concat((0,a.default)(n),["parameters",c,p]),u)}),(0,i.default)(n,p.VALIDATE_PARAMS,function(e,t){var r=t.payload,n=r.pathMethod,i=r.isOAS3,o=e.getIn(["meta","paths"].concat((0,a.default)(n)),(0,s.fromJS)({})),l=/xml/i.test(o.get("consumes_value")),p=c.operationWithMeta.apply(void 0,[e].concat((0,a.default)(n)));return e.updateIn(["meta","paths"].concat((0,a.default)(n),["parameters"]),(0,s.fromJS)({}),function(e){return p.get("parameters",(0,s.List)()).reduce(function(e,t){var r=(0,u.validateParam)(t,l,i);return e.setIn([t.get("name")+"."+t.get("in"),"errors"],(0,s.fromJS)(r))},e)})}),(0,i.default)(n,p.CLEAR_VALIDATE_PARAMS,function(e,t){var r=t.payload.pathMethod;return e.updateIn(["meta","paths"].concat((0,a.default)(r),["parameters"]),(0,s.fromJS)([]),function(e){return e.map(function(e){return e.set("errors",(0,s.fromJS)([]))})})}),(0,i.default)(n,p.SET_RESPONSE,function(e,t){var r=t.payload,n=r.res,i=r.path,a=r.method,s=void 0;(s=n.error?(0,o.default)({error:!0,name:n.err.name,message:n.err.message,statusCode:n.err.statusCode},n.err.response):n).headers=s.headers||{};var c=e.setIn(["responses",i,a],(0,u.fromJSOrdered)(s));return l.default.Blob&&n.data instanceof l.default.Blob&&(c=c.setIn(["responses",i,a,"text"],n.data)),c}),(0,i.default)(n,p.SET_REQUEST,function(e,t){var r=t.payload,n=r.req,i=r.path,o=r.method;return e.setIn(["requests",i,o],(0,u.fromJSOrdered)(n))}),(0,i.default)(n,p.SET_MUTATED_REQUEST,function(e,t){var r=t.payload,n=r.req,i=r.path,o=r.method;return e.setIn(["mutatedRequests",i,o],(0,u.fromJSOrdered)(n))}),(0,i.default)(n,p.UPDATE_OPERATION_META_VALUE,function(e,t){var r=t.payload,n=r.path,i=r.value,o=r.key,u=["paths"].concat((0,a.default)(n)),l=["meta","paths"].concat((0,a.default)(n));return e.getIn(["json"].concat((0,a.default)(u)))||e.getIn(["resolved"].concat((0,a.default)(u)))||e.getIn(["resolvedSubtrees"].concat((0,a.default)(u)))?e.setIn([].concat((0,a.default)(l),[o]),(0,s.fromJS)(i)):e}),(0,i.default)(n,p.CLEAR_RESPONSE,function(e,t){var r=t.payload,n=r.path,i=r.method;return e.deleteIn(["responses",n,i])}),(0,i.default)(n,p.CLEAR_REQUEST,function(e,t){var r=t.payload,n=r.path,i=r.method;return e.deleteIn(["requests",n,i])}),(0,i.default)(n,p.SET_SCHEME,function(e,t){var r=t.payload,n=r.scheme,i=r.path,o=r.method;return i&&o?e.setIn(["scheme",i,o],n):i||o?void 0:e.setIn(["scheme","_defaultScheme"],n)}),n)},function(e,t,r){var n=r(36),i=r(100),o=r(20)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||void 0==(r=n(a)[o])?t:i(r)}},function(e,t,r){var n,i,o,a=r(53),s=r(779),u=r(263),l=r(167),c=r(23),p=c.process,f=c.setImmediate,d=c.clearImmediate,h=c.MessageChannel,m=c.Dispatch,v=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},_=function(e){y.call(e.data)};f&&d||(f=function setImmediate(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},n(v),v},d=function clearImmediate(e){delete g[e]},"process"==r(99)(p)?n=function(e){p.nextTick(a(y,e,1))}:m&&m.now?n=function(e){m.now(a(y,e,1))}:h?(o=(i=new h).port2,i.port1.onmessage=_,n=a(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(n=function(e){c.postMessage(e+"","*")},c.addEventListener("message",_,!1)):n="onreadystatechange"in l("script")?function(e){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:f,clear:d}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,r){var n=r(36),i=r(29),o=r(216);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=o.f(e);return(0,r.resolve)(t),r.promise}},function(e,t,r){e.exports=r(784)},function(e,t,r){"use strict";t.__esModule=!0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(151));t.default=function(e){return function(){var t=e.apply(this,arguments);return new n.default(function(e,r){return function step(i,o){try{var a=t[i](o),s=a.value}catch(e){return void r(e)}if(!a.done)return n.default.resolve(s).then(function(e){step("next",e)},function(e){step("throw",e)});e(s)}("next")})}}},function(e,t,r){"use strict";var n=r(89);e.exports=new n({include:[r(364)]})},function(e,t,r){"use strict";var n=r(89);e.exports=new n({include:[r(219)],implicit:[r(792),r(793),r(794),r(795)]})},function(e,t,r){var n=r(64),i=r(21),o=r(50),a="[object String]";e.exports=function isString(e){return"string"==typeof e||!i(e)&&o(e)&&n(e)==a}},function(e,t,r){var n=r(154),i=r(82),o=r(142),a=r(39),s=r(83);e.exports=function baseSet(e,t,r,u){if(!a(e))return e;for(var l=-1,c=(t=i(t,e)).length,p=c-1,f=e;null!=f&&++l.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or .":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var o,s=a.createElement(A,{child:t});if(e){var u=f.get(e);o=u._processChildContext(u._context)}else o=g;var l=getTopLevelWrapperInContainer(r);if(l){var c=l._currentElement.props.child;if(b(c,t)){var p=l._renderedComponent.getPublicInstance(),d=i&&function(){i.call(p)};return R._updateRootComponent(l,s,o,r,d),p}R.unmountComponentAtNode(r)}var h=getReactRootElementInContainer(r),v=h&&!!internalGetID(h),y=hasNonRootReactChild(r),_=v&&!l&&!y,S=R._renderNewRootComponent(s,r,_,o)._renderedComponent.getPublicInstance();return i&&i.call(S),S},render:function(e,t,r){return R._renderSubtreeIntoContainer(null,e,t,r)},unmountComponentAtNode:function(e){isValidContainer(e)||n("40");var t=getTopLevelWrapperInContainer(e);if(!t){hasNonRootReactChild(e),1===e.nodeType&&e.hasAttribute(k);return!1}return delete w[t._instance.rootID],v.batchedUpdates(unmountComponentFromNode,t,e,!1),!0},_mountImageIntoNode:function(e,t,r,o,a){if(isValidContainer(t)||n("41"),o){var s=getReactRootElementInContainer(t);if(d.canReuseMarkup(e,s))return void u.precacheNode(r,s);var l=s.getAttribute(d.CHECKSUM_ATTR_NAME);s.removeAttribute(d.CHECKSUM_ATTR_NAME);var c=s.outerHTML;s.setAttribute(d.CHECKSUM_ATTR_NAME,l);var p=e,f=function firstDifferenceIndex(e,t){for(var r=Math.min(e.length,t.length),n=0;n1?n-1:0),a=1;a=i&&(t=console)[e].apply(t,o)}return log.warn=log.bind(null,"warn"),log.error=log.bind(null,"error"),log.info=log.bind(null,"info"),log.debug=log.bind(null,"debug"),{rootInjects:{log:log}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{fn:{AST:n},components:{JumpToPath:i.default}}};var n=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(411)),i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(417))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLineNumberForPathAsync=t.positionRangeForPathAsync=t.pathForPositionAsync=void 0;var n=_interopRequireDefault(r(151)),i=_interopRequireDefault(r(44));t.getLineNumberForPath=getLineNumberForPath,t.positionRangeForPath=positionRangeForPath,t.pathForPosition=pathForPosition;var o=_interopRequireDefault(r(937)),a=_interopRequireDefault(r(21)),s=_interopRequireDefault(r(193));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var u=(0,r(10).memoize)(o.default.compose),l="tag:yaml.org,2002:map",c="tag:yaml.org,2002:seq";function getLineNumberForPath(e,t){if("string"!=typeof e)throw new TypeError("yaml should be a string");if(!(0,a.default)(t))throw new TypeError("path should be an array of strings");var r=0;return function find(e,t,n){if(!e)return n&&n.start_mark?n.start_mark.line:0;if(t.length&&e.tag===l)for(r=0;r=t.column:t.line===e.start_mark.line?t.column>=e.start_mark.column:t.line===e.end_mark.line?t.column<=e.end_mark.column:e.start_mark.linet.line}}(r)}t.pathForPositionAsync=promisifySyncFn(pathForPosition),t.positionRangeForPathAsync=promisifySyncFn(positionRangeForPath),t.getLineNumberForPathAsync=promisifySyncFn(getLineNumberForPath);function promisifySyncFn(e){return function(){for(var t=arguments.length,r=Array(t),i=0;i=0)throw new t.ConstructorError(null,null,"found unconstructable recursive node",e.start_mark);if(this.constructing_nodes.push(e.unique_id),r=null,s=null,e.tag in this.yaml_constructors)r=this.yaml_constructors[e.tag];else{for(a in this.yaml_multi_constructors)if(e.tag.indexOf(0===a)){s=e.tag.slice(a.length),r=this.yaml_multi_constructors[a];break}null==r&&(null in this.yaml_multi_constructors?(s=e.tag,r=this.yaml_multi_constructors.null):null in this.yaml_constructors?r=this.yaml_constructors.null:e instanceof i.ScalarNode?r=this.construct_scalar:e instanceof i.SequenceNode?r=this.construct_sequence:e instanceof i.MappingNode&&(r=this.construct_mapping))}return n=r.call(this,null!=s?s:e,e),this.constructed_objects[e.unique_id]=n,this.constructing_nodes.pop(),n},BaseConstructor.prototype.construct_scalar=function(e){if(!(e instanceof i.ScalarNode))throw new t.ConstructorError(null,null,"expected a scalar node but found "+e.id,e.start_mark);return e.value},BaseConstructor.prototype.construct_sequence=function(e){var r,n,o,a,s;if(!(e instanceof i.SequenceNode))throw new t.ConstructorError(null,null,"expected a sequence node but found "+e.id,e.start_mark);for(s=[],n=0,o=(a=e.value).length;n=0&&(c=c.slice(1)),"0"===c)return 0;if(0===c.indexOf("0b"))return l*parseInt(c.slice(2),2);if(0===c.indexOf("0x"))return l*parseInt(c.slice(2),16);if(0===c.indexOf("0o"))return l*parseInt(c.slice(2),8);if("0"===c[0])return l*parseInt(c,8);if(u.call(c,":")>=0){for((n=function(){var e,t,r,n;for(n=[],e=0,t=(r=c.split(/:/g)).length;e=0&&(c=c.slice(1)),".inf"===c)return Infinity*l;if(".nan"===c)return NaN;if(u.call(c,":")>=0){for((n=function(){var e,t,r,n;for(n=[],e=0,t=(r=c.split(/:/g)).length;e=0||"\r"===t&&"\n"!==this.string[this.index]?(this.line++,this.column=0):this.column++,r.push(e--);return r},Reader.prototype.get_mark=function(){return new e(this.line,this.column,this.string,this.index)},Reader.prototype.check_printable=function(){var e,n,i;if(n=r.exec(this.string))throw e=n[0],i=this.string.length-this.index+n.index,new t.ReaderError(i,e,"special characters are not allowed")},Reader}()}).call(this)},function(e,t,r){(function(){var e,n,i,o,a={}.hasOwnProperty,s=[].slice,u=[].indexOf||function(e){for(var t=0,r=this.length;t"===e&&0===this.flow_level)return this.fetch_folded();if("'"===e)return this.fetch_single();if('"'===e)return this.fetch_double();if(this.check_plain())return this.fetch_plain();throw new t.ScannerError("while scanning for the next token",null,"found character "+e+" that cannot start any token",this.get_mark())},Scanner.prototype.next_possible_simple_key=function(){var e,t,r,n;for(t in r=null,n=this.possible_simple_keys)a.call(n,t)&&(e=n[t],(null===r||e.token_numbere;)t=this.get_mark(),this.indent=this.indents.pop(),r.push(this.tokens.push(new i.BlockEndToken(t,t)));return r}},Scanner.prototype.add_indent=function(e){return e>this.indent&&(this.indents.push(this.indent),this.indent=e,!0)},Scanner.prototype.fetch_stream_start=function(){var e;return e=this.get_mark(),this.tokens.push(new i.StreamStartToken(e,e,this.encoding))},Scanner.prototype.fetch_stream_end=function(){var e;return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_possible_simple_key=!1,this.possible_simple_keys={},e=this.get_mark(),this.tokens.push(new i.StreamEndToken(e,e)),this.done=!0},Scanner.prototype.fetch_directive=function(){return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_directive())},Scanner.prototype.fetch_document_start=function(){return this.fetch_document_indicator(i.DocumentStartToken)},Scanner.prototype.fetch_document_end=function(){return this.fetch_document_indicator(i.DocumentEndToken)},Scanner.prototype.fetch_document_indicator=function(e){var t;return this.unwind_indent(-1),this.remove_possible_simple_key(),this.allow_simple_key=!1,t=this.get_mark(),this.forward(3),this.tokens.push(new e(t,this.get_mark()))},Scanner.prototype.fetch_flow_sequence_start=function(){return this.fetch_flow_collection_start(i.FlowSequenceStartToken)},Scanner.prototype.fetch_flow_mapping_start=function(){return this.fetch_flow_collection_start(i.FlowMappingStartToken)},Scanner.prototype.fetch_flow_collection_start=function(e){var t;return this.save_possible_simple_key(),this.flow_level++,this.allow_simple_key=!0,t=this.get_mark(),this.forward(),this.tokens.push(new e(t,this.get_mark()))},Scanner.prototype.fetch_flow_sequence_end=function(){return this.fetch_flow_collection_end(i.FlowSequenceEndToken)},Scanner.prototype.fetch_flow_mapping_end=function(){return this.fetch_flow_collection_end(i.FlowMappingEndToken)},Scanner.prototype.fetch_flow_collection_end=function(e){var t;return this.remove_possible_simple_key(),this.flow_level--,this.allow_simple_key=!1,t=this.get_mark(),this.forward(),this.tokens.push(new e(t,this.get_mark()))},Scanner.prototype.fetch_flow_entry=function(){var e;return this.allow_simple_key=!0,this.remove_possible_simple_key(),e=this.get_mark(),this.forward(),this.tokens.push(new i.FlowEntryToken(e,this.get_mark()))},Scanner.prototype.fetch_block_entry=function(){var e,r;if(0===this.flow_level){if(!this.allow_simple_key)throw new t.ScannerError(null,null,"sequence entries are not allowed here",this.get_mark());this.add_indent(this.column)&&(e=this.get_mark(),this.tokens.push(new i.BlockSequenceStartToken(e,e)))}return this.allow_simple_key=!0,this.remove_possible_simple_key(),r=this.get_mark(),this.forward(),this.tokens.push(new i.BlockEntryToken(r,this.get_mark()))},Scanner.prototype.fetch_key=function(){var e,r;if(0===this.flow_level){if(!this.allow_simple_key)throw new t.ScannerError(null,null,"mapping keys are not allowed here",this.get_mark());this.add_indent(this.column)&&(e=this.get_mark(),this.tokens.push(new i.BlockMappingStartToken(e,e)))}return this.allow_simple_key=!this.flow_level,this.remove_possible_simple_key(),r=this.get_mark(),this.forward(),this.tokens.push(new i.KeyToken(r,this.get_mark()))},Scanner.prototype.fetch_value=function(){var e,r,n;if(e=this.possible_simple_keys[this.flow_level])delete this.possible_simple_keys[this.flow_level],this.tokens.splice(e.token_number-this.tokens_taken,0,new i.KeyToken(e.mark,e.mark)),0===this.flow_level&&this.add_indent(e.column)&&this.tokens.splice(e.token_number-this.tokens_taken,0,new i.BlockMappingStartToken(e.mark,e.mark)),this.allow_simple_key=!1;else{if(0===this.flow_level){if(!this.allow_simple_key)throw new t.ScannerError(null,null,"mapping values are not allowed here",this.get_mark());this.add_indent(this.column)&&(r=this.get_mark(),this.tokens.push(new i.BlockMappingStartToken(r,r)))}this.allow_simple_key=!this.flow_level,this.remove_possible_simple_key()}return n=this.get_mark(),this.forward(),this.tokens.push(new i.ValueToken(n,this.get_mark()))},Scanner.prototype.fetch_alias=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_anchor(i.AliasToken))},Scanner.prototype.fetch_anchor=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_anchor(i.AnchorToken))},Scanner.prototype.fetch_tag=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_tag())},Scanner.prototype.fetch_literal=function(){return this.fetch_block_scalar("|")},Scanner.prototype.fetch_folded=function(){return this.fetch_block_scalar(">")},Scanner.prototype.fetch_block_scalar=function(e){return this.allow_simple_key=!0,this.remove_possible_simple_key(),this.tokens.push(this.scan_block_scalar(e))},Scanner.prototype.fetch_single=function(){return this.fetch_flow_scalar("'")},Scanner.prototype.fetch_double=function(){return this.fetch_flow_scalar('"')},Scanner.prototype.fetch_flow_scalar=function(e){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_flow_scalar(e))},Scanner.prototype.fetch_plain=function(){return this.save_possible_simple_key(),this.allow_simple_key=!1,this.tokens.push(this.scan_plain())},Scanner.prototype.check_directive=function(){return 0===this.column},Scanner.prototype.check_document_start=function(){var t;return 0===this.column&&"---"===this.prefix(3)&&(t=this.peek(3),u.call(e+r+"\0",t)>=0)},Scanner.prototype.check_document_end=function(){var t;return 0===this.column&&"..."===this.prefix(3)&&(t=this.peek(3),u.call(e+r+"\0",t)>=0)},Scanner.prototype.check_block_entry=function(){var t;return t=this.peek(1),u.call(e+r+"\0",t)>=0},Scanner.prototype.check_key=function(){var t;return 0!==this.flow_level||(t=this.peek(1),u.call(e+r+"\0",t)>=0)},Scanner.prototype.check_value=function(){var t;return 0!==this.flow_level||(t=this.peek(1),u.call(e+r+"\0",t)>=0)},Scanner.prototype.check_plain=function(){var t,n;return t=this.peek(),u.call(e+r+"\0-?:,[]{}#&*!|>'\"%@`",t)<0||(n=this.peek(1),u.call(e+r+"\0",n)<0&&("-"===t||0===this.flow_level&&u.call("?:",t)>=0))},Scanner.prototype.scan_to_next_token=function(){var t,r,n;for(0===this.index&&"\ufeff"===this.peek()&&this.forward(),t=!1,n=[];!t;){for(;" "===this.peek();)this.forward();if("#"===this.peek())for(;r=this.peek(),u.call(e+"\0",r)<0;)this.forward();this.scan_line_break()?0===this.flow_level?n.push(this.allow_simple_key=!0):n.push(void 0):n.push(t=!0)}return n},Scanner.prototype.scan_directive=function(){var t,r,n,o,a;if(o=this.get_mark(),this.forward(),a=null,"YAML"===(r=this.scan_directive_name(o)))a=this.scan_yaml_directive_value(o),t=this.get_mark();else if("TAG"===r)a=this.scan_tag_directive_value(o),t=this.get_mark();else for(t=this.get_mark();n=this.peek(),u.call(e+"\0",n)<0;)this.forward();return this.scan_directive_ignored_line(o),new i.DirectiveToken(r,a,o,t)},Scanner.prototype.scan_directive_name=function(r){var n,i,o;for(i=0,n=this.peek(i);"0"<=n&&n<="9"||"A"<=n&&n<="Z"||"a"<=n&&n<="z"||u.call("-_",n)>=0;)i++,n=this.peek(i);if(0===i)throw new t.ScannerError("while scanning a directive",r,"expected alphanumeric or numeric character but found "+n,this.get_mark());if(o=this.prefix(i),this.forward(i),n=this.peek(),u.call(e+"\0 ",n)<0)throw new t.ScannerError("while scanning a directive",r,"expected alphanumeric or numeric character but found "+n,this.get_mark());return o},Scanner.prototype.scan_yaml_directive_value=function(r){for(var n,i,o;" "===this.peek();)this.forward();if(n=this.scan_yaml_directive_number(r),"."!==this.peek())throw new t.ScannerError("while scanning a directive",r,"expected a digit or '.' but found "+this.peek(),this.get_mark());if(this.forward(),i=this.scan_yaml_directive_number(r),o=this.peek(),u.call(e+"\0 ",o)<0)throw new t.ScannerError("while scanning a directive",r,"expected a digit or ' ' but found "+this.peek(),this.get_mark());return[n,i]},Scanner.prototype.scan_yaml_directive_number=function(e){var r,n,i,o;if(!("0"<=(r=this.peek())&&r<="9"))throw new t.ScannerError("while scanning a directive",e,"expected a digit but found "+r,this.get_mark());for(n=0;"0"<=(i=this.peek(n))&&i<="9";)n++;return o=parseInt(this.prefix(n)),this.forward(n),o},Scanner.prototype.scan_tag_directive_value=function(e){for(var t;" "===this.peek();)this.forward();for(t=this.scan_tag_directive_handle(e);" "===this.peek();)this.forward();return[t,this.scan_tag_directive_prefix(e)]},Scanner.prototype.scan_tag_directive_handle=function(e){var r,n;if(n=this.scan_tag_handle("directive",e)," "!==(r=this.peek()))throw new t.ScannerError("while scanning a directive",e,"expected ' ' but found "+r,this.get_mark());return n},Scanner.prototype.scan_tag_directive_prefix=function(r){var n,i;if(i=this.scan_tag_uri("directive",r),n=this.peek(),u.call(e+"\0 ",n)<0)throw new t.ScannerError("while scanning a directive",r,"expected ' ' but found "+n,this.get_mark());return i},Scanner.prototype.scan_directive_ignored_line=function(r){for(var n,i;" "===this.peek();)this.forward();if("#"===this.peek())for(;i=this.peek(),u.call(e+"\0",i)<0;)this.forward();if(n=this.peek(),u.call(e+"\0",n)<0)throw new t.ScannerError("while scanning a directive",r,"expected a comment or a line break but found "+n,this.get_mark());return this.scan_line_break()},Scanner.prototype.scan_anchor=function(n){var i,o,a,s,l;for(s=this.get_mark(),a="*"===this.peek()?"alias":"anchor",this.forward(),o=0,i=this.peek(o);"0"<=i&&i<="9"||"A"<=i&&i<="Z"||"a"<=i&&i<="z"||u.call("-_",i)>=0;)o++,i=this.peek(o);if(0===o)throw new t.ScannerError("while scanning an "+a,s,"expected alphabetic or numeric character but found '"+i+"'",this.get_mark());if(l=this.prefix(o),this.forward(o),i=this.peek(),u.call(e+r+"\0?:,]}%@`",i)<0)throw new t.ScannerError("while scanning an "+a,s,"expected alphabetic or numeric character but found '"+i+"'",this.get_mark());return new n(l,s,this.get_mark())},Scanner.prototype.scan_tag=function(){var n,o,a,s,l,c;if(s=this.get_mark(),"<"===(n=this.peek(1))){if(o=null,this.forward(2),l=this.scan_tag_uri("tag",s),">"!==this.peek())throw new t.ScannerError("while parsing a tag",s,"expected '>' but found "+this.peek(),this.get_mark());this.forward()}else if(u.call(e+r+"\0",n)>=0)o=null,l="!",this.forward();else{for(a=1,c=!1;u.call(e+"\0 ",n)<0;){if("!"===n){c=!0;break}a++,n=this.peek(a)}c?o=this.scan_tag_handle("tag",s):(o="!",this.forward()),l=this.scan_tag_uri("tag",s)}if(n=this.peek(),u.call(e+"\0 ",n)<0)throw new t.ScannerError("while scanning a tag",s,"expected ' ' but found "+n,this.get_mark());return new i.TagToken([o,l],s,this.get_mark())},Scanner.prototype.scan_block_scalar=function(t){var r,n,a,s,l,c,p,f,d,h,m,v,g,y,_,b,S,k,x,E;for(l=">"===t,a=[],E=this.get_mark(),this.forward(),n=(g=this.scan_block_scalar_indicators(E))[0],c=g[1],this.scan_block_scalar_ignored_line(E),(v=this.indent+1)<1&&(v=1),null==c?(r=(y=this.scan_block_scalar_indentation())[0],m=y[1],s=y[2],p=Math.max(v,m)):(p=v+c-1,r=(_=this.scan_block_scalar_breaks(p))[0],s=_[1]),h="";this.column===p&&"\0"!==this.peek();){for(a=a.concat(r),b=this.peek(),f=u.call(" \t",b)<0,d=0;S=this.peek(d),u.call(e+"\0",S)<0;)d++;if(a.push(this.prefix(d)),this.forward(d),h=this.scan_line_break(),r=(k=this.scan_block_scalar_breaks(p))[0],s=k[1],this.column!==p||"\0"===this.peek())break;l&&"\n"===h&&f&&(x=this.peek(),u.call(" \t",x)<0)?o.is_empty(r)&&a.push(" "):a.push(h)}return!1!==n&&a.push(h),!0===n&&(a=a.concat(r)),new i.ScalarToken(a.join(""),!1,E,s,t)},Scanner.prototype.scan_block_scalar_indicators=function(r){var n,i,o;if(i=null,o=null,n=this.peek(),u.call("+-",n)>=0){if(i="+"===n,this.forward(),n=this.peek(),u.call("0123456789",n)>=0){if(0===(o=parseInt(n)))throw new t.ScannerError("while scanning a block scalar",r,"expected indentation indicator in the range 1-9 but found 0",this.get_mark());this.forward()}}else if(u.call("0123456789",n)>=0){if(0===(o=parseInt(n)))throw new t.ScannerError("while scanning a block scalar",r,"expected indentation indicator in the range 1-9 but found 0",this.get_mark());this.forward(),n=this.peek(),u.call("+-",n)>=0&&(i="+"===n,this.forward())}if(n=this.peek(),u.call(e+"\0 ",n)<0)throw new t.ScannerError("while scanning a block scalar",r,"expected chomping or indentation indicators, but found "+n,this.get_mark());return[i,o]},Scanner.prototype.scan_block_scalar_ignored_line=function(r){for(var n,i;" "===this.peek();)this.forward();if("#"===this.peek())for(;i=this.peek(),u.call(e+"\0",i)<0;)this.forward();if(n=this.peek(),u.call(e+"\0",n)<0)throw new t.ScannerError("while scanning a block scalar",r,"expected a comment or a line break but found "+n,this.get_mark());return this.scan_line_break()},Scanner.prototype.scan_block_scalar_indentation=function(){var t,r,n,i;for(t=[],n=0,r=this.get_mark();i=this.peek(),u.call(e+" ",i)>=0;)" "!==this.peek()?(t.push(this.scan_line_break()),r=this.get_mark()):(this.forward(),this.column>n&&(n=this.column));return[t,n,r]},Scanner.prototype.scan_block_scalar_breaks=function(t){var r,n,i;for(r=[],n=this.get_mark();this.column=0;)for(r.push(this.scan_line_break()),n=this.get_mark();this.column=0)a.push(o),this.forward();else{if(!n||"\\"!==o)return a;if(this.forward(),(o=this.peek())in c)a.push(c[o]),this.forward();else if(o in l){for(d=l[o],this.forward(),f=p=0,m=d;0<=m?pm;f=0<=m?++p:--p)if(v=this.peek(f),u.call("0123456789ABCDEFabcdef",v)<0)throw new t.ScannerError("while scanning a double-quoted scalar",i,"expected escape sequence of "+d+" hexadecimal numbers, but found "+this.peek(f),this.get_mark());s=parseInt(this.prefix(d),16),a.push(String.fromCharCode(s)),this.forward(d)}else{if(!(u.call(e,o)>=0))throw new t.ScannerError("while scanning a double-quoted scalar",i,"found unknown escape character "+o,this.get_mark());this.scan_line_break(),a=a.concat(this.scan_flow_scalar_breaks(n,i))}}else a.push("'"),this.forward(2)}},Scanner.prototype.scan_flow_scalar_spaces=function(n,i){var o,a,s,l,c,p,f;for(s=[],l=0;p=this.peek(l),u.call(r,p)>=0;)l++;if(f=this.prefix(l),this.forward(l),"\0"===(a=this.peek()))throw new t.ScannerError("while scanning a quoted scalar",i,"found unexpected end of stream",this.get_mark());return u.call(e,a)>=0?(c=this.scan_line_break(),o=this.scan_flow_scalar_breaks(n,i),"\n"!==c?s.push(c):0===o.length&&s.push(" "),s=s.concat(o)):s.push(f),s},Scanner.prototype.scan_flow_scalar_breaks=function(n,i){var o,a,s,l,c;for(o=[];;){if("---"===(a=this.prefix(3))||"..."===a&&(s=this.peek(3),u.call(e+r+"\0",s)>=0))throw new t.ScannerError("while scanning a quoted scalar",i,"found unexpected document separator",this.get_mark());for(;l=this.peek(),u.call(r,l)>=0;)this.forward();if(c=this.peek(),!(u.call(e,c)>=0))return o;o.push(this.scan_line_break())}},Scanner.prototype.scan_plain=function(){var n,o,a,s,l,c,p,f,d;for(o=[],d=a=this.get_mark(),s=this.indent+1,f=[];l=0,"#"!==this.peek();){for(;n=this.peek(l),!(u.call(e+r+"\0",n)>=0||0===this.flow_level&&":"===n&&(c=this.peek(l+1),u.call(e+r+"\0",c)>=0)||0!==this.flow_level&&u.call(",:?[]{}",n)>=0);)l++;if(0!==this.flow_level&&":"===n&&(p=this.peek(l+1),u.call(e+r+"\0,[]{}",p)<0))throw this.forward(l),new t.ScannerError("while scanning a plain scalar",d,"found unexpected ':'",this.get_mark(),"Please check http://pyyaml.org/wiki/YAMLColonInFlowContext");if(0===l)break;if(this.allow_simple_key=!1,(o=o.concat(f)).push(this.prefix(l)),this.forward(l),a=this.get_mark(),null==(f=this.scan_plain_spaces(s,d))||0===f.length||"#"===this.peek()||0===this.flow_level&&this.column=0;)s++;if(m=this.prefix(s),this.forward(s),o=this.peek(),u.call(e,o)>=0){if(l=this.scan_line_break(),this.allow_simple_key=!0,"---"===(c=this.prefix(3))||"..."===c&&(f=this.peek(3),u.call(e+r+"\0",f)>=0))return;for(i=[];h=this.peek(),u.call(e+" ",h)>=0;)if(" "===this.peek())this.forward();else if(i.push(this.scan_line_break()),"---"===(c=this.prefix(3))||"..."===c&&(d=this.peek(3),u.call(e+r+"\0",d)>=0))return;"\n"!==l?a.push(l):0===i.length&&a.push(" "),a=a.concat(i)}else m&&a.push(m);return a},Scanner.prototype.scan_tag_handle=function(e,r){var n,i,o;if("!"!==(n=this.peek()))throw new t.ScannerError("while scanning a "+e,r,"expected '!' but found "+n,this.get_mark());if(i=1," "!==(n=this.peek(i))){for(;"0"<=n&&n<="9"||"A"<=n&&n<="Z"||"a"<=n&&n<="z"||u.call("-_",n)>=0;)i++,n=this.peek(i);if("!"!==n)throw this.forward(i),new t.ScannerError("while scanning a "+e,r,"expected '!' but found "+n,this.get_mark());i++}return o=this.prefix(i),this.forward(i),o},Scanner.prototype.scan_tag_uri=function(e,r){var n,i,o;for(i=[],o=0,n=this.peek(o);"0"<=n&&n<="9"||"A"<=n&&n<="Z"||"a"<=n&&n<="z"||u.call("-;/?:@&=+$,_.!~*'()[]%",n)>=0;)"%"===n?(i.push(this.prefix(o)),this.forward(o),o=0,i.push(this.scan_uri_escapes(e,r))):o++,n=this.peek(o);if(0!==o&&(i.push(this.prefix(o)),this.forward(o),o=0),0===i.length)throw new t.ScannerError("while parsing a "+e,r,"expected URI but found "+n,this.get_mark());return i.join("")},Scanner.prototype.scan_uri_escapes=function(e,r){var n,i,o;for(n=[],this.get_mark();"%"===this.peek();){for(this.forward(),o=i=0;i<=2;o=++i)throw new t.ScannerError("while scanning a "+e,r,"expected URI escape sequence of 2 hexadecimal numbers but found "+this.peek(o),this.get_mark());n.push(String.fromCharCode(parseInt(this.prefix(2),16))),this.forward(2)}return n.join("")},Scanner.prototype.scan_line_break=function(){var e;return e=this.peek(),u.call("\r\n…",e)>=0?("\r\n"===this.prefix(2)?this.forward(2):this.forward(),"\n"):u.call("\u2028\u2029",e)>=0?(this.forward(),e):""},Scanner}()}).call(this)},function(e,t,r){(function(){var e,n,i,o={}.hasOwnProperty,a=[].slice;n=r(119),e=r(46).MarkedYAMLError,i=r(242),this.ParserError=function(t){function ParserError(){return ParserError.__super__.constructor.apply(this,arguments)}return function(e,t){for(var r in t)o.call(t,r)&&(e[r]=t[r]);function ctor(){this.constructor=e}ctor.prototype=t.prototype,e.prototype=new ctor,e.__super__=t.prototype}(ParserError,e),ParserError}(),this.Parser=function(){var e;function Parser(){this.current_event=null,this.yaml_version=null,this.tag_handles={},this.states=[],this.marks=[],this.state="parse_stream_start"}return e={"!":"!","!!":"tag:yaml.org,2002:"},Parser.prototype.dispose=function(){return this.states=[],this.state=null},Parser.prototype.check_event=function(){var e,t,r,n;if(t=1<=arguments.length?a.call(arguments,0):[],null===this.current_event&&null!=this.state&&(this.current_event=this[this.state]()),null!==this.current_event){if(0===t.length)return!0;for(r=0,n=t.length;r', but found "+this.peek_token().id,this.peek_token().start_mark);e=(u=this.get_token()).end_mark,r=new n.DocumentStartEvent(a,e,!0,l,s),this.states.push("parse_document_end"),this.state="parse_document_content"}return r},Parser.prototype.parse_document_end=function(){var e,t,r,o;return o=e=this.peek_token().start_mark,r=!1,this.check_token(i.DocumentEndToken)&&(e=this.get_token().end_mark,r=!0),t=new n.DocumentEndEvent(o,e,r),this.state="parse_document_start",t},Parser.prototype.parse_document_content=function(){var e;return this.check_token(i.DirectiveToken,i.DocumentStartToken,i.DocumentEndToken,i.StreamEndToken)?(e=this.process_empty_scalar(this.peek_token().start_mark),this.state=this.states.pop(),e):this.parse_block_node()},Parser.prototype.process_directives=function(){var r,n,a,s,u,l,c,p,f;for(this.yaml_version=null,this.tag_handles={};this.check_token(i.DirectiveToken);)if("YAML"===(p=this.get_token()).name){if(null!==this.yaml_version)throw new t.ParserError(null,null,"found duplicate YAML directive",p.start_mark);if(n=(s=p.value)[0],s[1],1!==n)throw new t.ParserError(null,null,"found incompatible YAML document (version 1.* is required)",p.start_mark);this.yaml_version=p.value}else if("TAG"===p.name){if(r=(u=p.value)[0],a=u[1],r in this.tag_handles)throw new t.ParserError(null,null,"duplicate tag handle "+r,p.start_mark);this.tag_handles[r]=a}for(r in c=null,l=this.tag_handles)o.call(l,r)&&(a=l[r],null==c&&(c={}),c[r]=a);for(r in f=[this.yaml_version,c],e)o.call(e,r)&&((a=e[r])in this.tag_handles||(this.tag_handles[r]=a));return f},Parser.prototype.parse_block_node=function(){return this.parse_node(!0)},Parser.prototype.parse_flow_node=function(){return this.parse_node()},Parser.prototype.parse_block_node_or_indentless_sequence=function(){return this.parse_node(!0,!0)},Parser.prototype.parse_node=function(e,r){var o,a,s,u,l,c,p,f,d,h,m;if(null==e&&(e=!1),null==r&&(r=!1),this.check_token(i.AliasToken))m=this.get_token(),s=new n.AliasEvent(m.value,m.start_mark,m.end_mark),this.state=this.states.pop();else{if(o=null,d=null,p=a=h=null,this.check_token(i.AnchorToken)?(p=(m=this.get_token()).start_mark,a=m.end_mark,o=m.value,this.check_token(i.TagToken)&&(h=(m=this.get_token()).start_mark,a=m.end_mark,d=m.value)):this.check_token(i.TagToken)&&(p=h=(m=this.get_token()).start_mark,a=m.end_mark,d=m.value,this.check_token(i.AnchorToken)&&(a=(m=this.get_token()).end_mark,o=m.value)),null!==d)if(u=d[0],f=d[1],null!==u){if(!(u in this.tag_handles))throw new t.ParserError("while parsing a node",p,"found undefined tag handle "+u,h);d=this.tag_handles[u]+f}else d=f;if(null===p&&(p=a=this.peek_token().start_mark),s=null,l=null===d||"!"===d,r&&this.check_token(i.BlockEntryToken))a=this.peek_token().end_mark,s=new n.SequenceStartEvent(o,d,l,p,a),this.state="parse_indentless_sequence_entry";else if(this.check_token(i.ScalarToken))a=(m=this.get_token()).end_mark,l=m.plain&&null===d||"!"===d?[!0,!1]:null===d?[!1,!0]:[!1,!1],s=new n.ScalarEvent(o,d,l,m.value,p,a,m.style),this.state=this.states.pop();else if(this.check_token(i.FlowSequenceStartToken))a=this.peek_token().end_mark,s=new n.SequenceStartEvent(o,d,l,p,a,!0),this.state="parse_flow_sequence_first_entry";else if(this.check_token(i.FlowMappingStartToken))a=this.peek_token().end_mark,s=new n.MappingStartEvent(o,d,l,p,a,!0),this.state="parse_flow_mapping_first_key";else if(e&&this.check_token(i.BlockSequenceStartToken))a=this.peek_token().end_mark,s=new n.SequenceStartEvent(o,d,l,p,a,!1),this.state="parse_block_sequence_first_entry";else if(e&&this.check_token(i.BlockMappingStartToken))a=this.peek_token().end_mark,s=new n.MappingStartEvent(o,d,l,p,a,!1),this.state="parse_block_mapping_first_key";else{if(null===o&&null===d)throw c=e?"block":"flow",m=this.peek_token(),new t.ParserError("while parsing a "+c+" node",p,"expected the node content, but found "+m.id,m.start_mark);s=new n.ScalarEvent(o,d,[l,!1],"",p,a),this.state=this.states.pop()}}return s},Parser.prototype.parse_block_sequence_first_entry=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_block_sequence_entry()},Parser.prototype.parse_block_sequence_entry=function(){var e,r;if(this.check_token(i.BlockEntryToken))return r=this.get_token(),this.check_token(i.BlockEntryToken,i.BlockEndToken)?(this.state="parse_block_sequence_entry",this.process_empty_scalar(r.end_mark)):(this.states.push("parse_block_sequence_entry"),this.parse_block_node());if(!this.check_token(i.BlockEndToken))throw r=this.peek_token(),new t.ParserError("while parsing a block collection",this.marks.slice(-1)[0],"expected , but found "+r.id,r.start_mark);return r=this.get_token(),e=new n.SequenceEndEvent(r.start_mark,r.end_mark),this.state=this.states.pop(),this.marks.pop(),e},Parser.prototype.parse_indentless_sequence_entry=function(){var e,t;return this.check_token(i.BlockEntryToken)?(t=this.get_token(),this.check_token(i.BlockEntryToken,i.KeyToken,i.ValueToken,i.BlockEndToken)?(this.state="parse_indentless_sequence_entry",this.process_empty_scalar(t.end_mark)):(this.states.push("parse_indentless_sequence_entry"),this.parse_block_node())):(t=this.peek_token(),e=new n.SequenceEndEvent(t.start_mark,t.start_mark),this.state=this.states.pop(),e)},Parser.prototype.parse_block_mapping_first_key=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_block_mapping_key()},Parser.prototype.parse_block_mapping_key=function(){var e,r;if(this.check_token(i.KeyToken))return r=this.get_token(),this.check_token(i.KeyToken,i.ValueToken,i.BlockEndToken)?(this.state="parse_block_mapping_value",this.process_empty_scalar(r.end_mark)):(this.states.push("parse_block_mapping_value"),this.parse_block_node_or_indentless_sequence());if(!this.check_token(i.BlockEndToken))throw r=this.peek_token(),new t.ParserError("while parsing a block mapping",this.marks.slice(-1)[0],"expected , but found "+r.id,r.start_mark);return r=this.get_token(),e=new n.MappingEndEvent(r.start_mark,r.end_mark),this.state=this.states.pop(),this.marks.pop(),e},Parser.prototype.parse_block_mapping_value=function(){var e;return this.check_token(i.ValueToken)?(e=this.get_token(),this.check_token(i.KeyToken,i.ValueToken,i.BlockEndToken)?(this.state="parse_block_mapping_key",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_block_mapping_key"),this.parse_block_node_or_indentless_sequence())):(this.state="parse_block_mapping_key",e=this.peek_token(),this.process_empty_scalar(e.start_mark))},Parser.prototype.parse_flow_sequence_first_entry=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_flow_sequence_entry(!0)},Parser.prototype.parse_flow_sequence_entry=function(e){var r,o;if(null==e&&(e=!1),!this.check_token(i.FlowSequenceEndToken)){if(!e){if(!this.check_token(i.FlowEntryToken))throw o=this.peek_token(),new t.ParserError("while parsing a flow sequence",this.marks.slice(-1)[0],"expected ',' or ']', but got "+o.id,o.start_mark);this.get_token()}if(this.check_token(i.KeyToken))return o=this.peek_token(),r=new n.MappingStartEvent(null,null,!0,o.start_mark,o.end_mark,!0),this.state="parse_flow_sequence_entry_mapping_key",r;if(!this.check_token(i.FlowSequenceEndToken))return this.states.push("parse_flow_sequence_entry"),this.parse_flow_node()}return o=this.get_token(),r=new n.SequenceEndEvent(o.start_mark,o.end_mark),this.state=this.states.pop(),this.marks.pop(),r},Parser.prototype.parse_flow_sequence_entry_mapping_key=function(){var e;return e=this.get_token(),this.check_token(i.ValueToken,i.FlowEntryToken,i.FlowSequenceEndToken)?(this.state="parse_flow_sequence_entry_mapping_value",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_flow_sequence_entry_mapping_value"),this.parse_flow_node())},Parser.prototype.parse_flow_sequence_entry_mapping_value=function(){var e;return this.check_token(i.ValueToken)?(e=this.get_token(),this.check_token(i.FlowEntryToken,i.FlowSequenceEndToken)?(this.state="parse_flow_sequence_entry_mapping_end",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_flow_sequence_entry_mapping_end"),this.parse_flow_node())):(this.state="parse_flow_sequence_entry_mapping_end",e=this.peek_token(),this.process_empty_scalar(e.start_mark))},Parser.prototype.parse_flow_sequence_entry_mapping_end=function(){var e;return this.state="parse_flow_sequence_entry",e=this.peek_token(),new n.MappingEndEvent(e.start_mark,e.start_mark)},Parser.prototype.parse_flow_mapping_first_key=function(){var e;return e=this.get_token(),this.marks.push(e.start_mark),this.parse_flow_mapping_key(!0)},Parser.prototype.parse_flow_mapping_key=function(e){var r,o;if(null==e&&(e=!1),!this.check_token(i.FlowMappingEndToken)){if(!e){if(!this.check_token(i.FlowEntryToken))throw o=this.peek_token(),new t.ParserError("while parsing a flow mapping",this.marks.slice(-1)[0],"expected ',' or '}', but got "+o.id,o.start_mark);this.get_token()}if(this.check_token(i.KeyToken))return o=this.get_token(),this.check_token(i.ValueToken,i.FlowEntryToken,i.FlowMappingEndToken)?(this.state="parse_flow_mapping_value",this.process_empty_scalar(o.end_mark)):(this.states.push("parse_flow_mapping_value"),this.parse_flow_node());if(!this.check_token(i.FlowMappingEndToken))return this.states.push("parse_flow_mapping_empty_value"),this.parse_flow_node()}return o=this.get_token(),r=new n.MappingEndEvent(o.start_mark,o.end_mark),this.state=this.states.pop(),this.marks.pop(),r},Parser.prototype.parse_flow_mapping_value=function(){var e;return this.check_token(i.ValueToken)?(e=this.get_token(),this.check_token(i.FlowEntryToken,i.FlowMappingEndToken)?(this.state="parse_flow_mapping_key",this.process_empty_scalar(e.end_mark)):(this.states.push("parse_flow_mapping_key"),this.parse_flow_node())):(this.state="parse_flow_mapping_key",e=this.peek_token(),this.process_empty_scalar(e.start_mark))},Parser.prototype.parse_flow_mapping_empty_value=function(){return this.state="parse_flow_mapping_key",this.process_empty_scalar(this.peek_token().start_mark)},Parser.prototype.process_empty_scalar=function(e){return new n.ScalarEvent(null,null,[!0,!1],"",e,e)},Parser}()}).call(this)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(4)),i=_interopRequireDefault(r(2)),o=_interopRequireDefault(r(3)),a=_interopRequireDefault(r(5)),s=_interopRequireDefault(r(6));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function JumpToPath(){return(0,i.default)(this,JumpToPath),(0,a.default)(this,(JumpToPath.__proto__||(0,n.default)(JumpToPath)).apply(this,arguments))}return(0,s.default)(JumpToPath,e),(0,o.default)(JumpToPath,[{key:"render",value:function render(){return null}}]),JumpToPath}(_interopRequireDefault(r(0)).default.Component);t.default=u},function(e,t,r){"use strict";var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(419));e.exports=function(e){var t=e.configs;return{fn:{fetch:n.default.makeHttp(t.preFetch,t.postFetch),buildRequest:n.default.buildRequest,execute:n.default.execute,resolve:n.default.resolve,resolveSubtree:n.default.resolveSubtree,serializeRes:n.default.serializeRes,opId:n.default.helpers.opId}}}},function(e,t,r){e.exports=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=23)}([function(e,t){e.exports=r(43)},function(e,t){e.exports=r(44)},function(e,t){e.exports=r(25)},function(e,t){e.exports=r(26)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).v2OperationIdCompatibilityMode;return e&&"object"===(void 0===e?"undefined":(0,h.default)(e))?(e.operationId||"").replace(/\s/g,"").length?y(e.operationId):i(t,r,{v2OperationIdCompatibilityMode:n}):null}function i(e,t){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).v2OperationIdCompatibilityMode){var r=(t.toLowerCase()+"_"+e).replace(/[\s!@#$%^&*()_+=[{\]};:<>|.\/?,\\'""-]/g,"_");return(r=r||e.substring(1)+"_"+t).replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return""+g(t)+y(e)}function s(e,t){return g(t)+"-"+e}function c(e,t){return f(e,t,!0)||null}function f(e,t,r){if(!e||"object"!==(void 0===e?"undefined":(0,h.default)(e))||!e.paths||"object"!==(0,h.default)(e.paths))return null;var n=e.paths;for(var i in n)for(var o in n[i])if("PARAMETERS"!==o.toUpperCase()){var a=n[i][o];if(a&&"object"===(void 0===a?"undefined":(0,h.default)(a))){var s={spec:e,pathName:i,method:o.toUpperCase(),operation:a},u=t(s);if(r&&u)return s}}}Object.defineProperty(t,"__esModule",{value:!0});var d=n(r(18)),h=n(r(1));t.isOAS3=function a(e){var t=e.openapi;return!!t&&(0,v.default)(t,"3")},t.isSwagger2=function u(e){var t=e.swagger;return!!t&&(0,v.default)(t,"2")},t.opId=o,t.idFromPathMethod=i,t.legacyIdFromPathMethod=s,t.getOperationRaw=function l(e,t){return e&&e.paths?c(e,function(e){var r=e.pathName,n=e.method,i=e.operation;if(!i||"object"!==(void 0===i?"undefined":(0,h.default)(i)))return!1;var a=i.operationId;return[o(i,r,n),s(r,n),a].some(function(e){return e&&e===t})}):null},t.findOperation=c,t.eachOperation=f,t.normalizeSwagger=function p(e){var t=e.spec,r=t.paths,n={};if(!r||t.$$normalized)return e;for(var i in r){var a=r[i];if((0,m.default)(a)){var s=a.parameters;for(var u in a)!function(e){var r=a[e];if(!(0,m.default)(r))return"continue";var u=o(r,i,e);if(u){n[u]?n[u].push(r):n[u]=[r];var l=n[u];if(l.length>1)l.forEach(function(e,t){e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId=""+u+(t+1)});else if(void 0!==r.operationId){var c=l[0];c.__originalOperationId=c.__originalOperationId||r.operationId,c.operationId=u}}if("parameters"!==e){var p=[],f={};for(var h in t)"produces"!==h&&"consumes"!==h&&"security"!==h||(f[h]=t[h],p.push(f));if(s&&(f.parameters=s,p.push(f)),p.length){var v=!0,g=!1,y=void 0;try{for(var _,b=(0,d.default)(p);!(v=(_=b.next()).done);v=!0){var S=_.value;for(var k in S)if(r[k]){if("parameters"===k){var x=!0,E=!1,C=void 0;try{for(var w,D=(0,d.default)(S[k]);!(x=(w=D.next()).done);x=!0)!function(){var e=w.value;r[k].some(function(t){return t.name&&t.name===e.name||t.$ref&&t.$ref===e.$ref||t.$$ref&&t.$$ref===e.$$ref||t===e})||r[k].push(e)}()}catch(e){E=!0,C=e}finally{try{!x&&D.return&&D.return()}finally{if(E)throw C}}}}else r[k]=S[k]}}catch(e){g=!0,y=e}finally{try{!v&&b.return&&b.return()}finally{if(g)throw y}}}}}(u)}}return t.$$normalized=!0,e};var m=n(r(48)),v=n(r(14)),g=function(e){return String.prototype.toLowerCase.call(e)},y=function(e){return e.replace(/[^\w]/gi,"_")}},function(e,t){e.exports=r(946)},function(t,r,p){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).loadSpec,n=void 0!==r&&r,i={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:o(e.headers)},s=i.headers["content-type"],u=n||x(s);return(u?e.text:e.blob||e.buffer).call(e).then(function(e){if(i.text=e,i.data=e,u)try{var t=function a(e,t){return"application/json"===t?JSON.parse(e):b.default.safeLoad(e)}(e,s);i.body=t,i.obj=t}catch(e){i.parseError=e}return i})}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return"function"==typeof e.forEach?(e.forEach(function(e,r){void 0!==t[r]?(t[r]=Array.isArray(t[r])?t[r]:[t[r]],t[r].push(e)):t[r]=e}),t):t}function i(e){return"undefined"!=typeof File?e instanceof File:null!==e&&"object"===(void 0===e?"undefined":(0,g.default)(e))&&"function"==typeof e.pipe}function s(e,t){var r=e.collectionFormat,n=e.allowEmptyValue,o="object"===(void 0===e?"undefined":(0,g.default)(e))?e.value:e;if(void 0===o&&n)return"";if(i(o)||"boolean"==typeof o)return o;var a=encodeURIComponent;return t&&(a=(0,S.default)(o)?function(e){return e}:function(e){return(0,m.default)(e)}),"object"!==(void 0===o?"undefined":(0,g.default)(o))||Array.isArray(o)?Array.isArray(o)?Array.isArray(o)&&!r?o.map(a).join(","):"multi"===r?o.map(a):o.map(a).join({csv:",",ssv:"%20",tsv:"%09",pipes:"|"}[r]):a(o):""}function l(e){var t=(0,h.default)(e).reduce(function(t,r){var n=e[r],i=!!n.skipEncoding,o=i?r:encodeURIComponent(r),a=function(e){return e&&"object"===(void 0===e?"undefined":(0,g.default)(e))}(n)&&!Array.isArray(n);return t[o]=s(a?n:{value:n},i),t},{});return _.default.stringify(t,{encode:!1,indices:!1})||""}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.url,r=void 0===t?"":t,n=e.query,o=e.form;if(o){var a=(0,h.default)(o).some(function(e){return i(o[e].value)}),u=e.headers["content-type"]||e.headers["Content-Type"];if(a||/multipart\/form-data/i.test(u)){var c=p(30);e.body=new c,(0,h.default)(o).forEach(function(t){e.body.append(t,s(o[t],!0))})}else e.body=l(o);delete e.form}if(n){var f=r.split("?"),m=(0,d.default)(f,2),v=m[0],g=m[1],y="";if(g){var b=_.default.parse(g);(0,h.default)(n).forEach(function(e){return delete b[e]}),y=_.default.stringify(b,{encode:!0})}var S=function(){for(var e=arguments.length,t=Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return v.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("object"===(void 0===t?"undefined":(0,g.default)(t))&&(t=(a=t).url),a.headers=a.headers||{},k.mergeInQueryOrForm(a),!a.requestInterceptor){e.next=10;break}return e.next=6,a.requestInterceptor(a);case 6:if(e.t0=e.sent,e.t0){e.next=9;break}e.t0=a;case 9:a=e.t0;case 10:return r=a.headers["content-type"]||a.headers["Content-Type"],/multipart\/form-data/i.test(r)&&(delete a.headers["content-type"],delete a.headers["Content-Type"]),n=void 0,e.prev=13,e.next=16,(a.userFetch||fetch)(a.url,a);case 16:return n=e.sent,e.next=19,k.serializeRes(n,t,a);case 19:if(n=e.sent,!a.responseInterceptor){e.next=27;break}return e.next=23,a.responseInterceptor(n);case 23:if(e.t1=e.sent,e.t1){e.next=26;break}e.t1=n;case 26:n=e.t1;case 27:e.next=37;break;case 29:if(e.prev=29,e.t2=e.catch(13),n){e.next=33;break}throw e.t2;case 33:throw(i=new Error(n.statusText)).statusCode=i.status=n.status,i.responseError=e.t2,i;case 37:if(n.ok){e.next=42;break}throw(o=new Error(n.statusText)).statusCode=o.status=n.status,o.response=n,o;case 42:return e.abrupt("return",n);case 43:case"end":return e.stop()}},e,this,[[13,29]])}));return function e(r){return t.apply(this,arguments)}}();var x=r.shouldDownloadAsText=function(){return/(json|xml|yaml|text)\b/.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}},function(e,t){e.exports=r(37)},function(e,t){e.exports=r(361)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function u(e){return Array.isArray(e)?e.length<1?"":"/"+e.map(function(e){return(e+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/"):e}function i(e,t,r){return{op:"replace",path:e,value:t,meta:r}}function h(e,t,r){return k(P(e.filter(j).map(function(e){return t(e.value,r,e.path)})||[]))}function v(e,t,r){return r=r||[],Array.isArray(e)?e.map(function(e,n){return v(e,t,r.concat(n))}):w(e)?(0,R.default)(e).map(function(n){return v(e[n],t,r.concat(n))}):t(e,r[r.length-1],r)}function m(e,t,r){var n=[];if((r=r||[]).length>0){var i=t(e,r[r.length-1],r);i&&(n=n.concat(i))}if(Array.isArray(e)){var o=e.map(function(e,n){return m(e,t,r.concat(n))});o&&(n=n.concat(o))}else if(w(e)){var a=(0,R.default)(e).map(function(n){return m(e[n],t,r.concat(n))});a&&(n=n.concat(a))}return P(n)}function x(e){return Array.isArray(e)?e:[e]}function P(e){var t;return(t=[]).concat.apply(t,(0,D.default)(e.map(function(e){return Array.isArray(e)?P(e):e})))}function k(e){return e.filter(function(e){return void 0!==e})}function w(e){return e&&"object"===(void 0===e?"undefined":(0,S.default)(e))}function q(e){return e&&"function"==typeof e}function M(e){if(I(e)){var t=e.op;return"add"===t||"remove"===t||"replace"===t}return!1}function A(e){return M(e)||I(e)&&"mutation"===e.type}function j(e){return A(e)&&("add"===e.op||"replace"===e.op||"merge"===e.op||"mergeDeep"===e.op)}function I(e){return e&&"object"===(void 0===e?"undefined":(0,S.default)(e))}function E(e,t){try{return B.default.getValueByPointer(e,t)}catch(e){return console.error(e),{}}}Object.defineProperty(t,"__esModule",{value:!0});var S=n(r(1)),D=n(r(34)),R=n(r(0)),T=n(r(35)),F=n(r(2)),B=n(r(36)),N=n(r(37)),L=r(38),z=n(r(39));t.default={add:function o(e,t){return{op:"add",path:e,value:t}},replace:i,remove:function s(e,t){return{op:"remove",path:e}},merge:function l(e,t){return{type:"mutation",op:"merge",path:e,value:t}},mergeDeep:function c(e,t){return{type:"mutation",op:"mergeDeep",path:e,value:t}},context:function f(e,t){return{type:"context",path:e,value:t}},getIn:function g(e,t){return t.reduce(function(e,t){return void 0!==t&&e?e[t]:e},e)},applyPatch:function a(e,t,r){if(r=r||{},"merge"===(t=(0,F.default)({},t,{path:t.path&&u(t.path)})).op){var n=E(e,t.path);(0,F.default)(n,t.value),B.default.applyPatch(e,[i(t.path,n)])}else if("mergeDeep"===t.op){var o=E(e,t.path);for(var a in t.value){var s=t.value[a],l=Array.isArray(s);if(l){var c=o[a]||[];o[a]=c.concat(s)}else if(w(s)&&!l){var p=(0,F.default)({},o[a]);for(var f in s){if(Object.prototype.hasOwnProperty.call(p,f)){p=(0,N.default)((0,z.default)({},p),s);break}(0,F.default)(p,(0,T.default)({},f,s[f]))}o[a]=p}else o[a]=s}}else if("add"===t.op&&""===t.path&&w(t.value)){var d=(0,R.default)(t.value).reduce(function(e,r){return e.push({op:"add",path:"/"+u(r),value:t.value[r]}),e},[]);B.default.applyPatch(e,d)}else if("replace"===t.op&&""===t.path){var h=t.value;r.allowMetaPatches&&t.meta&&j(t)&&(Array.isArray(t.value)||w(t.value))&&(h=(0,F.default)({},h,t.meta)),e=h}else if(B.default.applyPatch(e,[t]),r.allowMetaPatches&&t.meta&&j(t)&&(Array.isArray(t.value)||w(t.value))){var m=E(e,t.path),v=(0,F.default)({},m,t.meta);B.default.applyPatch(e,[i(t.path,v)])}return e},parentPathMatch:function y(e,t){if(!Array.isArray(t))return!1;for(var r=0,n=t.length;r1&&void 0!==arguments[1]?arguments[1]:{},r=t.requestInterceptor,n=t.responseInterceptor,i=e.withCredentials?"include":"same-origin";return function(t){return e({url:t,loadSpec:!0,requestInterceptor:r,responseInterceptor:n,headers:{Accept:"application/json"},credentials:i}).then(function(e){return e.body})}}Object.defineProperty(i,"__esModule",{value:!0});var l=n(s(8)),c=n(s(11));i.makeFetchJSON=a,i.clearCache=function u(){f.plugins.refs.clearCache()},i.default=function o(e){function t(t){var r=this;k&&(f.plugins.refs.docCache[k]=t),f.plugins.refs.fetchJSON=a(S,{requestInterceptor:y,responseInterceptor:_});var n=[f.plugins.refs];return"function"==typeof g&&n.push(f.plugins.parameters),"function"==typeof v&&n.push(f.plugins.properties),"strict"!==o&&n.push(f.plugins.allOf),(0,d.default)({spec:t,context:{baseDoc:k},plugins:n,allowMetaPatches:u,pathDiscriminator:m,parameterMacro:g,modelPropertyMacro:v}).then(b?function(){var e=(0,c.default)(l.default.mark(function e(t){return l.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t);case 1:case"end":return e.stop()}},e,r)}));return function(t){return e.apply(this,arguments)}}():h.normalizeSwagger)}var r=e.fetch,n=e.spec,i=e.url,o=e.mode,s=e.allowMetaPatches,u=void 0===s||s,m=e.pathDiscriminator,v=e.modelPropertyMacro,g=e.parameterMacro,y=e.requestInterceptor,_=e.responseInterceptor,b=e.skipNormalization,S=e.http,k=e.baseDoc;return k=k||i,S=r||S||p.default,n?t(n):a(S,{requestInterceptor:y,responseInterceptor:_})(k).then(t)};var p=n(s(6)),f=s(31),d=n(f),h=s(4)},function(e,t){e.exports=r(151)},function(e,t){e.exports=r(97)},function(e,t){e.exports=r(2)},function(e,t){e.exports=r(3)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function n(e,t){function r(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack;for(var e=arguments.length,r=Array(e),n=0;n-1||o.indexOf(r)>-1};var i=["properties"],o=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"]},function(e,t,r){e.exports=r(24)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e?r.url=e:r=e,!(this instanceof a))return new a(r);(0,o.default)(this,r);var n=this.resolve().then(function(){return t.disableInterfaces||(0,o.default)(t,a.makeApisTagOperation(t)),t});return n.client=this,n}Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(3)),o=n((n(r(25)),r(5))),s=n(r(14)),u=n(r(10)),l=r(6),c=n(l),p=r(16),f=n(p),d=n(r(49)),h=r(50),m=r(52),v=r(4);a.http=c.default,a.makeHttp=l.makeHttp.bind(null,a.http),a.resolve=f.default,a.resolveSubtree=d.default,a.execute=m.execute,a.serializeRes=l.serializeRes,a.serializeHeaders=l.serializeHeaders,a.clearCache=p.clearCache,a.parameterBuilders=m.PARAMETER_BUILDERS,a.makeApisTagOperation=h.makeApisTagOperation,a.buildRequest=m.buildRequest,a.helpers={opId:v.opId},a.prototype={http:c.default,execute:function(e){return this.applyDefaults(),a.execute((0,i.default)({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:"string"==typeof this.url?this.url:void 0},e))},resolve:function(){var e=this;return a.resolve({spec:this.spec,url:this.url,allowMetaPatches:this.allowMetaPatches,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null}).then(function(t){return e.originalSpec=e.spec,e.spec=t.spec,e.errors=t.errors,e})}},a.prototype.applyDefaults=function(){var e=this.spec,t=this.url;if(t&&(0,s.default)(t,"http")){var r=u.default.parse(t);e.host||(e.host=r.host),e.schemes||(e.schemes=[r.protocol.replace(":","")]),e.basePath||(e.basePath="/")}},t.default=a,e.exports=t.default},function(e,t){e.exports=r(958)},function(e,t){e.exports=r(19)},function(e,t){e.exports=r(959)},function(e,t){e.exports=r(960)},function(e,t){e.exports=r(365)},function(e,t){e.exports=r(963)},function(t,r,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.plugins=r.SpecMap=void 0;var o=n(i(7)),s=n(i(1)),u=n(i(17)),l=n(i(8)),c=n(i(0)),p=n(i(18)),f=n(i(32)),d=n(i(2)),h=n(i(19)),m=n(i(20));r.default=function a(e){return new x(e).dispatch()};var v=n(i(33)),g=n(i(9)),y=n(i(40)),_=n(i(44)),b=n(i(45)),S=n(i(46)),k=n(i(47)),x=function(){function e(t){(0,h.default)(this,e),(0,d.default)(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new k.default,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:(0,d.default)((0,f.default)(this),g.default),allowMetaPatches:!1},t),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=this.plugins.map(this.wrapPlugin.bind(this)).filter(g.default.isFunction),this.patches.push(g.default.add([],this.spec)),this.patches.push(g.default.context([],this.context)),this.updatePatches(this.patches)}return(0,m.default)(e,[{key:"debug",value:function(e){if(this.debugLevel===e){for(var t,r=arguments.length,n=Array(r>1?r-1:0),i=1;i1?r-1:0),i=1;i0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0)return u.default.race(this.promisedPatches.map(function(e){return e.value}))}},{key:"getPluginHistory",value:function(e){var t=this.getPluginName(e);return this.pluginHistory[t]||[]}},{key:"getPluginRunCount",value:function(e){return this.getPluginHistory(e).length}},{key:"getPluginHistoryTip",value:function(e){var t=this.getPluginHistory(e);return t&&t[t.length-1]||{}}},{key:"getPluginMutationIndex",value:function(e){var t=this.getPluginHistoryTip(e).mutationIndex;return"number"!=typeof t?-1:t}},{key:"getPluginName",value:function(e){return e.pluginName}},{key:"updatePluginHistory",value:function(e,t){var r=this.getPluginName(e);(this.pluginHistory[r]=this.pluginHistory[r]||[]).push(t)}},{key:"updatePatches",value:function(e,t){var r=this;g.default.normalizeArray(e).forEach(function(e){if(e instanceof Error)r.errors.push(e);else try{if(!g.default.isObject(e))return void r.debug("updatePatches","Got a non-object patch",e);if(r.showDebug&&r.allPatches.push(e),g.default.isPromise(e.value))return r.promisedPatches.push(e),void r.promisedPatchThen(e);if(g.default.isContextPatch(e))return void r.setContext(e.path,e.value);if(g.default.isMutation(e))return void r.updateMutations(e)}catch(e){console.error(e),r.errors.push(e)}})}},{key:"updateMutations",value:function(e){"object"===(0,s.default)(e.value)&&!Array.isArray(e.value)&&this.allowMetaPatches&&(e.value=(0,d.default)({},e.value));var t=g.default.applyPatch(this.state,e,{allowMetaPatches:this.allowMetaPatches});t&&(this.mutations.push(e),this.state=t)}},{key:"removePromisedPatch",value:function(e){var t=this.promisedPatches.indexOf(e);t<0?this.debug("Tried to remove a promisedPatch that isn't there!"):this.promisedPatches.splice(t,1)}},{key:"promisedPatchThen",value:function(e){var t=this;return e.value=e.value.then(function(r){var n=(0,d.default)({},e,{value:r});t.removePromisedPatch(e),t.updatePatches(n)}).catch(function(r){t.removePromisedPatch(e),t.updatePatches(r)})}},{key:"getMutations",value:function(e,t){return e=e||0,"number"!=typeof t&&(t=this.mutations.length),this.mutations.slice(e,t)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(e){var t=this.getPluginMutationIndex(e);return this.getMutations(t+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getPatchesOfType",value:function(e,t){return e.filter(t)}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(e){return g.default.getIn(this.state,e)}},{key:"_getContext",value:function(e){return this.contextTree.get(e)}},{key:"setContext",value:function(e,t){return this.contextTree.set(e,t)}},{key:"_hasRun",value:function(e){return this.getPluginRunCount(this.getCurrentPlugin())>(e||0)}},{key:"_clone",value:function(e){return JSON.parse((0,o.default)(e))}},{key:"dispatch",value:function(){function e(e){e&&(e=g.default.fullyNormalizeArray(e),r.updatePatches(e,n))}var t=this,r=this,n=this.nextPlugin();if(!n){var i=this.nextPromisedPatch();if(i)return i.then(function(){return t.dispatch()}).catch(function(){return t.dispatch()});var o={spec:this.state,errors:this.errors};return this.showDebug&&(o.patches=this.allPatches),u.default.resolve(o)}if(r.pluginCount=r.pluginCount||{},r.pluginCount[n]=(r.pluginCount[n]||0)+1,r.pluginCount[n]>100)return u.default.resolve({spec:r.state,errors:r.errors.concat(new Error("We've reached a hard limit of 100 plugin runs"))});if(n!==this.currentPlugin&&this.promisedPatches.length){var a=this.promisedPatches.map(function(e){return e.value});return u.default.all(a.map(function(e){return e.then(Function,Function)})).then(function(){return t.dispatch()})}return function(){r.currentPlugin=n;var t=r.getCurrentMutations(),i=r.mutations.length-1;try{if(n.isGeneratorFunction){var o=!0,a=!1,s=void 0;try{for(var u,l=(0,p.default)(n(t,r.getLib()));!(o=(u=l.next()).done);o=!0)e(u.value)}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}}else e(n(t,r.getLib()))}catch(t){console.error(t),e([(0,d.default)((0,f.default)(t),{plugin:n})])}finally{r.updatePluginHistory(n,{mutationIndex:i})}return r.dispatch()}()}}]),e}(),E={refs:y.default,allOf:_.default,parameters:b.default,properties:S.default};r.SpecMap=x,r.plugins=E},function(e,t){e.exports=r(372)},function(e,t){e.exports=r(193)},function(e,t){e.exports=r(86)},function(e,t){e.exports=r(24)},function(e,t){e.exports=r(964)},function(e,t){e.exports=r(189)},function(e,t){e.exports=r(967)},function(e,t){e.exports=r(968)},function(e,t,_){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!O.test(e)){if(!t)throw new P("Tried to resolve a relative URL, without having a basePath. path: '"+e+"' basePath: '"+t+"'");return A.default.resolve(t,e)}return e}function u(e,t){return new P("Could not resolve reference because of: "+e.message,t,e)}function o(e){return(e+"").split("#")}function i(e,t){var r=I[e];if(r&&!R.default.isPromise(r))try{var n=f(t,r);return(0,E.default)(k.default.resolve(n),{__value:n})}catch(e){return k.default.reject(e)}return l(e).then(function(e){return f(t,e)})}function l(e){var t=I[e];return t?R.default.isPromise(t)?t:k.default.resolve(t):(I[e]=B.fetchJSON(e).then(function(t){return I[e]=t,t}),I[e])}function f(e,t){var r=p(e);if(r.length<1)return t;var n=R.default.getIn(t,r);if(void 0===n)throw new P("Could not resolve pointer: "+e+" does not exist in document",{pointer:e});return n}function p(e){if("string"!=typeof e)throw new TypeError("Expected a string, got a "+(void 0===e?"undefined":(0,b.default)(e)));return"/"===e[0]&&(e=e.substr(1)),""===e?[]:e.split("/").map(d)}function d(e){return"string"!=typeof e?e:D.default.unescape(e.replace(/~1/g,"/").replace(/~0/g,"~"))}function h(e){return D.default.escape(e.replace(/~/g,"~0").replace(/\//g,"~1"))}function m(e,t){if(N(t))return!0;var r=e.charAt(t.length),n=t.slice(-1);return 0===e.indexOf(t)&&(!r||"/"===r||"#"===r)&&"#"!==n}function y(e,t,r,n){var i=q.get(n);i||(i={},q.set(n,i));var o=function v(e){return 0===e.length?"":"/"+e.map(h).join("/")}(r),a=(t||"")+"#"+e;if(t==n.contextTree.get([]).baseDoc&&m(o,e))return!0;var s="";if(r.some(function(e){return s=s+"/"+h(e),i[s]&&i[s].some(function(e){return m(e,a)||m(a,e)})}))return!0;i[o]=(i[o]||[]).concat(a)}Object.defineProperty(t,"__esModule",{value:!0});var b=n(_(1)),S=n(_(0)),k=n(_(17)),x=n(_(41)),E=n(_(2)),C=_(42),w=n(_(15)),D=n(_(43)),A=n(_(10)),R=n(_(9)),M=n(_(21)),T=_(22),O=new RegExp("^([a-z]+://|//)","i"),P=(0,M.default)("JSONRefError",function(e,t,r){this.originalError=r,(0,E.default)(this,t||{})}),I={},q=new x.default,F={key:"$ref",plugin:function(e,t,r,n){var s=r.slice(0,-1);if(!(0,T.isFreelyNamed)(s)){var l=n.getContext(r).baseDoc;if("string"!=typeof e)return new P("$ref: must be a string (JSON-Ref)",{$ref:e,baseDoc:l,fullPath:r});var c=o(e),f=c[0],d=c[1]||"",h=void 0;try{h=l||f?a(f,l):null}catch(t){return u(t,{pointer:d,$ref:e,basePath:h,fullPath:r})}var m=void 0,v=void 0;if(!y(d,h,s,n)){if(null==h?(v=p(d),void 0===(m=n.get(v))&&(m=new P("Could not resolve reference: "+e,{pointer:d,$ref:e,baseDoc:l,fullPath:r}))):m=null!=(m=i(h,d)).__value?m.__value:m.catch(function(t){throw u(t,{pointer:d,$ref:e,baseDoc:l,fullPath:r})}),m instanceof Error)return[R.default.remove(r),m];var _=R.default.replace(s,m,{$$ref:e});return h&&h!==l?[_,R.default.context(s,{baseDoc:h})]:function g(e,t){var n=[e];return t.path.reduce(function(e,t){return n.push(e[t]),e[t]},e),function r(e){return R.default.isObject(e)&&(n.indexOf(e)>=0||(0,S.default)(e).some(function(t){return r(e[t])}))}(t.value)}(n.state,_)?void 0:_}}}},B=(0,E.default)(F,{docCache:I,absoluteify:a,clearCache:function s(e){void 0!==e?delete I[e]:(0,S.default)(I).forEach(function(e){delete I[e]})},JSONRefError:P,wrapError:u,getDoc:l,split:o,extractFromDoc:i,fetchJSON:function c(e){return(0,C.fetch)(e,{headers:{Accept:"application/json, application/yaml"},loadSpec:!0}).then(function(e){return e.text()}).then(function(e){return w.default.safeLoad(e)})},extract:f,jsonPointerToArray:p,unescapeJsonPointerToken:d});t.default=B;var N=function(e){return!e||"/"===e||"#"===e};e.exports=t.default},function(e,t){e.exports=r(969)},function(e,t){e.exports=r(980)},function(e,t){e.exports=r(981)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(2)),i=r(22);t.default={key:"allOf",plugin:function(e,t,r,o,a){if(!a.meta||!a.meta.$$ref){var s=r.slice(0,-1);if(!(0,i.isFreelyNamed)(s)){if(!Array.isArray(e)){var u=new TypeError("allOf must be an array");return u.fullPath=r,u}var l=!1,c=a.value;s.forEach(function(e){c&&(c=c[e])}),delete(c=(0,n.default)({},c)).allOf;var p=[o.replace(s,{})].concat(e.map(function(e,t){if(!o.isObject(e)){if(l)return null;l=!0;var n=new TypeError("Elements in allOf must be objects");return n.fullPath=r,n}return o.mergeDeep(s,e)}));return p.push(o.mergeDeep(s,c)),c.$$ref||p.push(o.remove([].concat(s,"$$ref"))),p}}}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(2)),o=n(r(9));t.default={key:"parameters",plugin:function(e,t,r,n,a){if(Array.isArray(e)&&e.length){var s=(0,i.default)([],e),u=r.slice(0,-1),l=(0,i.default)({},o.default.getIn(n.spec,u));return e.forEach(function(e,t){try{s[t].default=n.parameterMacro(l,e)}catch(e){var i=new Error(e);return i.fullPath=r,i}}),o.default.replace(r,s)}return o.default.replace(r,e)}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(2)),o=n(r(9));t.default={key:"properties",plugin:function(e,t,r,n){var a=(0,i.default)({},e);for(var s in e)try{a[s].default=n.modelPropertyMacro(a[s])}catch(e){var u=new Error(e);return u.fullPath=r,u}return o.default.replace(r,a)}},e.exports=t.default},function(t,r,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return u({children:{}},e,t)}function u(e,t,r){return e.value=t||{},e.protoValue=r?(0,s.default)({},r.protoValue,e.value):e.value,(0,o.default)(e.children).forEach(function(t){var r=e.children[t];e.children[t]=u(r,r.value,e)}),e}Object.defineProperty(r,"__esModule",{value:!0});var o=n(i(0)),s=n(i(3)),l=n(i(19)),c=n(i(20)),p=function(){function e(t){(0,l.default)(this,e),this.root=a(t||{})}return(0,c.default)(e,[{key:"set",value:function(e,t){var r=this.getParent(e,!0);if(r){var n=e[e.length-1],i=r.children;i[n]?u(i[n],t,r):i[n]=a(t,r)}else u(this.root,t,null)}},{key:"get",value:function(e){if((e=e||[]).length<1)return this.root.value;for(var t=this.root,r=void 0,n=void 0,i=0;i2&&void 0!==arguments[2]?arguments[2]:{};return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=y.returnEntireTree,i=y.baseDoc,s=y.requestInterceptor,p=y.responseInterceptor,f=y.parameterMacro,d=y.modelPropertyMacro,h={pathDiscriminator:r,baseDoc:i,requestInterceptor:s,responseInterceptor:p,parameterMacro:f,modelPropertyMacro:d},m=(0,c.normalizeSwagger)({spec:t}),v=m.spec,e.next=5,(0,l.default)((0,a.default)({},h,{spec:v,allowMetaPatches:!0,skipNormalization:!0}));case 5:return g=e.sent,!n&&Array.isArray(r)&&r.length&&(g.spec=(0,u.default)(g.spec,r)||null),e.abrupt("return",g);case 8:case"end":return e.stop()}},e,this)}));return function e(r,n){return t.apply(this,arguments)}}(),t.exports=r.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var r=t.pathName,n=t.method,i=t.operationId;return function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.execute((0,s.default)({spec:e.spec},(0,l.default)(e,"requestInterceptor","responseInterceptor","userFetch"),{pathName:r,method:n,parameters:t,operationId:i},o))}}}function i(e){var t=e.spec,r=e.cb,n=void 0===r?p:r,i=e.defaultTag,o=void 0===i?"default":i,a=e.v2OperationIdCompatibilityMode,s={},u={};return(0,c.eachOperation)(t,function(e){var r=e.pathName,i=e.method,l=e.operation;(l.tags?f(l.tags):[o]).forEach(function(e){if("string"==typeof e){var o=u[e]=u[e]||{},p=(0,c.opId)(l,r,i,{v2OperationIdCompatibilityMode:a}),f=n({spec:t,pathName:r,method:i,operation:l,operationId:p});if(s[p])s[p]++,o[""+p+s[p]]=f;else if(void 0!==o[p]){var d=s[p]||1;s[p]=d+1,o[""+p+s[p]]=f;var h=o[p];delete o[p],o[""+p+d]=h}else o[p]=f}})}),u}Object.defineProperty(t,"__esModule",{value:!0}),t.self=void 0;var s=n(r(3));t.makeExecute=a,t.makeApisTagOperationsOperationExecute=function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=d.makeExecute(e),r=d.mapTagOperations({v2OperationIdCompatibilityMode:e.v2OperationIdCompatibilityMode,spec:e.spec,cb:t}),n={};for(var i in r)for(var o in n[i]={operations:{}},r[i])n[i].operations[o]={execute:r[i][o]};return{apis:n}},t.makeApisTagOperation=function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=d.makeExecute(e);return{apis:d.mapTagOperations({v2OperationIdCompatibilityMode:e.v2OperationIdCompatibilityMode,spec:e.spec,cb:t})}},t.mapTagOperations=i;var l=n(r(51)),c=r(4),p=function(){return null},f=function(e){return Array.isArray(e)?e:[e]},d=t.self={mapTagOperations:i,makeExecute:a}},function(e,t){e.exports=r(982)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=e.spec,r=e.operationId,n=(e.securities,e.requestContentType,e.responseContentType),i=e.scheme,a=e.requestInterceptor,s=e.responseInterceptor,u=e.contextUrl,l=e.userFetch,c=(e.requestBody,e.server),p=e.serverVariables,d=e.http,m=e.parameters,v=e.parameterBuilders,g=(0,A.isOAS3)(t);v||(v=g?C.default:E.default);var y={url:"",credentials:d&&d.withCredentials?"include":"same-origin",headers:{},cookies:{}};a&&(y.requestInterceptor=a),s&&(y.responseInterceptor=s),l&&(y.userFetch=l);var _=(0,A.getOperationRaw)(t,r);if(!_)throw new M("Operation "+r+" not found");var k=_.operation,x=void 0===k?{}:k,P=_.method,I=_.pathName;if(y.url+=o({spec:t,scheme:i,contextUrl:u,server:c,serverVariables:p,pathName:I,method:P}),!r)return delete y.cookies,y;y.url+=I,y.method=(""+P).toUpperCase(),m=m||{};var q=t.paths[I]||{};n&&(y.headers.accept=n);var F=O([].concat(R(x.parameters)).concat(R(q.parameters)));F.forEach(function(e){var r=v[e.in],n=void 0;if("body"===e.in&&e.schema&&e.schema.properties&&(n=m),void 0===(n=e&&e.name&&m[e.name])?n=e&&e.name&&m[e.in+"."+e.name]:T(e.name,F).length>1&&console.warn("Parameter '"+e.name+"' is ambiguous because the defined spec has more than one parameter with the name: '"+e.name+"' and the passed-in parameter values did not define an 'in' value."),void 0!==e.default&&void 0===n&&(n=e.default),void 0===n&&e.required&&!e.allowEmptyValue)throw new Error("Required parameter "+e.name+" is not provided");if(g&&e.schema&&"object"===e.schema.type&&"string"==typeof n)try{n=JSON.parse(n)}catch(e){throw new Error("Could not parse object parameter value string as JSON")}r&&r({req:y,parameter:e,value:n,operation:x,spec:t})});var B=(0,f.default)({},e,{operation:x});if((y=g?(0,w.default)(B,y):(0,D.default)(B,y)).cookies&&(0,h.default)(y.cookies).length){var N=(0,h.default)(y.cookies).reduce(function(e,t){var r=y.cookies[t];return e+(e?"&":"")+b.default.serialize(t,r)},"");y.headers.Cookie=N}return y.cookies&&delete y.cookies,(0,S.mergeInQueryOrForm)(y),y}function o(e){return(0,A.isOAS3)(e.spec)?function i(e){var t=e.spec,r=e.pathName,n=e.method,i=e.server,o=e.contextUrl,a=e.serverVariables,u=void 0===a?{}:a,c=(0,v.default)(t,["paths",r,(n||"").toLowerCase(),"servers"])||(0,v.default)(t,["paths",r,"servers"])||(0,v.default)(t,["servers"]),p="",f=null;if(i&&c&&c.length){var d=c.map(function(e){return e.url});d.indexOf(i)>-1&&(p=i,f=c[d.indexOf(i)])}!p&&c&&c.length&&(p=c[0].url,f=c[0]),p.indexOf("{")>-1&&function l(e){for(var t=[],r=/{([^}]+)}/g,n=void 0;n=r.exec(e);)t.push(n[1]);return t}(p).forEach(function(e){if(f.variables&&f.variables[e]){var t=f.variables[e],r=u[e]||t.default,n=new RegExp("{"+e+"}","g");p=p.replace(n,r)}});return function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=_.default.parse(e),n=_.default.parse(t),i=I(r.protocol)||I(n.protocol)||"",o=r.host||n.host,a=r.pathname||"",s=void 0;return"/"===(s=i&&o?i+"://"+(o+a):a)[s.length-1]?s.slice(0,-1):s}(p,o)}(e):function c(e){var t=e.spec,r=e.scheme,n=e.contextUrl,i=void 0===n?"":n,o=_.default.parse(i),a=Array.isArray(t.schemes)?t.schemes[0]:null,s=r||a||I(o.protocol)||"http",u=t.host||o.host||"",l=t.basePath||"",c=void 0;return"/"===(c=s&&u?s+"://"+(u+l):l)[c.length-1]?c.slice(0,-1):c}(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.self=void 0;var p=n(r(7)),f=n(r(3)),d=n(r(53)),h=n(r(0)),m=n(r(2));t.execute=function a(e){var t=e.http,r=e.fetch,n=e.spec,i=e.operationId,o=e.pathName,a=e.method,s=e.parameters,u=e.securities,l=(0,d.default)(e,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),c=t||r||k.default;o&&a&&!i&&(i=(0,A.legacyIdFromPathMethod)(o,a));var h=P.buildRequest((0,f.default)({spec:n,operationId:i,parameters:s,securities:u,http:c},l));return h.body&&((0,g.default)(h.body)||(0,y.default)(h.body))&&(h.body=(0,p.default)(h.body)),c(h)},t.buildRequest=u,t.baseUrl=o;var v=n((n(r(5)),r(12))),g=n(r(54)),y=n(r(55)),_=n((n(r(13)),r(10))),b=n(r(56)),S=r(6),k=n(S),x=n(r(21)),E=n(r(57)),C=n(r(58)),w=n(r(63)),D=n(r(65)),A=r(4),R=function(e){return Array.isArray(e)?e:[]},M=(0,x.default)("OperationNotFoundError",function(e,t,r){this.originalError=r,(0,m.default)(this,t||{})}),T=function(e,t){return t.filter(function(t){return t.name===e})},O=function(e){var t={};e.forEach(function(e){t[e.in]||(t[e.in]={}),t[e.in][e.name]=e});var r=[];return(0,h.default)(t).forEach(function(e){(0,h.default)(t[e]).forEach(function(n){r.push(t[e][n])})}),r},P=t.self={buildRequest:u},I=function(e){return e?e.replace(/\W/g,""):null}},function(e,t){e.exports=r(87)},function(e,t){e.exports=r(238)},function(e,t){e.exports=r(21)},function(e,t){e.exports=r(985)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={body:function n(e){var t=e.req,r=e.value;t.body=r},header:function u(e){var t=e.req,r=e.parameter,n=e.value;t.headers=t.headers||{},void 0!==n&&(t.headers[r.name]=n)},query:function i(e){var t=e.req,r=e.value,n=e.parameter;if(t.query=t.query||{},!1===r&&"boolean"===n.type&&(r="false"),0===r&&["number","integer"].indexOf(n.type)>-1&&(r="0"),r)t.query[n.name]={collectionFormat:n.collectionFormat,value:r};else if(n.allowEmptyValue&&void 0!==r){var i=n.name;t.query[i]=t.query[i]||{},t.query[i].allowEmptyValue=!0}},path:function o(e){var t=e.req,r=e.value,n=e.parameter;t.url=t.url.replace("{"+n.name+"}",encodeURIComponent(r))},formData:function a(e){var t=e.req,r=e.value,n=e.parameter;(r||n.allowEmptyValue)&&(t.form=t.form||{},t.form[n.name]={value:r,allowEmptyValue:n.allowEmptyValue,collectionFormat:n.collectionFormat})}},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(r(0)),l=n(r(1)),c=n(r(59));t.default={path:function a(e){var t=e.req,r=e.value,n=e.parameter,i=n.name,o=n.style,a=n.explode,s=(0,c.default)({key:n.name,value:r,style:o||"simple",explode:a||!1,escape:!1});t.url=t.url.replace("{"+i+"}",s)},query:function u(e){var t=e.req,r=e.value,n=e.parameter;if(t.query=t.query||{},!1===r&&(r="false"),0===r&&(r="0"),r){var i=void 0===r?"undefined":(0,l.default)(r);"deepObject"===n.style?(0,s.default)(r).forEach(function(e){var i=r[e];t.query[n.name+"["+e+"]"]={value:(0,c.default)({key:e,value:i,style:"deepObject",escape:n.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}}):"object"!==i||Array.isArray(r)||"form"!==n.style&&n.style||!n.explode&&void 0!==n.explode?t.query[n.name]={value:(0,c.default)({key:n.name,value:r,style:n.style||"form",explode:void 0===n.explode||n.explode,escape:n.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}:(0,s.default)(r).forEach(function(e){var i=r[e];t.query[e]={value:(0,c.default)({key:e,value:i,style:n.style||"form",escape:n.allowReserved?"unsafe":"reserved"}),skipEncoding:!0}})}else if(n.allowEmptyValue&&void 0!==r){var o=n.name;t.query[o]=t.query[o]||{},t.query[o].allowEmptyValue=!0}},header:function o(e){var t=e.req,r=e.parameter,n=e.value;t.headers=t.headers||{},p.indexOf(r.name.toLowerCase())>-1||void 0!==n&&(t.headers[r.name]=(0,c.default)({key:r.name,value:n,style:r.style||"simple",explode:void 0!==r.explode&&r.explode,escape:!1}))},cookie:function i(e){var t=e.req,r=e.parameter,n=e.value;t.headers=t.headers||{};var i=void 0===n?"undefined":(0,l.default)(n);if("undefined"!==i){var o="object"===i&&!Array.isArray(n)&&r.explode?"":r.name+"=";t.headers.Cookie=o+(0,c.default)({key:r.name,value:n,escape:!1,style:r.style||"form",explode:void 0!==r.explode&&r.explode})}}};var p=["accept","authorization","content-type"];e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).escape,r=arguments[2];return"number"==typeof e&&(e=e.toString()),"string"==typeof e&&e.length&&t?r?JSON.parse(e):(0,p.stringToCharArray)(e).map(function(e){return d(e)?e:f(e)&&"unsafe"===t?e:((0,c.default)(e)||[]).map(function(e){return e.toString(16).toUpperCase()}).map(function(e){return"%"+e}).join("")}).join(""):e}Object.defineProperty(t,"__esModule",{value:!0});var s=n(r(0)),l=n(r(1));t.encodeDisallowedCharacters=a,t.default=function(e){var t=e.value;return Array.isArray(t)?function u(e){var t=e.key,r=e.value,n=e.style,i=e.explode,o=e.escape,s=function(e){return a(e,{escape:o})};if("simple"===n)return r.map(function(e){return s(e)}).join(",");if("label"===n)return"."+r.map(function(e){return s(e)}).join(".");if("matrix"===n)return r.map(function(e){return s(e)}).reduce(function(e,r){return!e||i?(e||"")+";"+t+"="+r:e+","+r},"");if("form"===n){var u=i?"&"+t+"=":",";return r.map(function(e){return s(e)}).join(u)}if("spaceDelimited"===n){var l=i?t+"=":"";return r.map(function(e){return s(e)}).join(" "+l)}if("pipeDelimited"===n){var c=i?t+"=":"";return r.map(function(e){return s(e)}).join("|"+c)}}(e):"object"===(void 0===t?"undefined":(0,l.default)(t))?function o(e){var t=e.key,r=e.value,n=e.style,i=e.explode,o=e.escape,u=function(e){return a(e,{escape:o})},l=(0,s.default)(r);return"simple"===n?l.reduce(function(e,t){var n=u(r[t]);return(e?e+",":"")+t+(i?"=":",")+n},""):"label"===n?l.reduce(function(e,t){var n=u(r[t]);return(e?e+".":".")+t+(i?"=":".")+n},""):"matrix"===n&&i?l.reduce(function(e,t){var n=u(r[t]);return(e?e+";":";")+t+"="+n},""):"matrix"===n?l.reduce(function(e,n){var i=u(r[n]);return(e?e+",":";"+t+"=")+n+","+i},""):"form"===n?l.reduce(function(e,t){var n=u(r[t]);return(e?e+(i?"&":","):"")+t+(i?"=":",")+n},""):void 0}(e):function i(e){var t=e.key,r=e.value,n=e.style,i=e.escape,o=function(e){return a(e,{escape:i})};return"simple"===n?o(r):"label"===n?"."+o(r):"matrix"===n?";"+t+"="+o(r):"form"===n?o(r):"deepObject"===n?o(r):void 0}(e)};var c=n((n(r(60)),r(61))),p=r(62),f=function(e){return":/?#[]@!$&'()*+,;=".indexOf(e)>-1},d=function(e){return/^[a-z0-9\-._~]+$/i.test(e)}},function(e,t){e.exports=r(986)},function(e,t){e.exports=r(987)},function(e,t){e.exports=r(988)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=e.request,r=e.securities,n=void 0===r?{}:r,i=e.operation,o=void 0===i?{}:i,a=e.spec,p=(0,u.default)({},t),f=n.authorized,d=void 0===f?{}:f,h=o.security||a.security||[],m=d&&!!(0,s.default)(d).length,v=(0,l.default)(a,["components","securitySchemes"])||{};return p.headers=p.headers||{},p.query=p.query||{},(0,s.default)(n).length&&m&&h&&(!Array.isArray(o.security)||o.security.length)?(h.forEach(function(e,t){for(var r in e){var n=d[r],i=v[r];if(n){var o=n.value||n,a=i.type;if(n)if("apiKey"===a)"query"===i.in&&(p.query[i.name]=o),"header"===i.in&&(p.headers[i.name]=o),"cookie"===i.in&&(p.cookies[i.name]=o);else if("http"===a){if("basic"===i.scheme){var s=o.username,u=o.password,l=(0,c.default)(s+":"+u);p.headers.Authorization="Basic "+l}"bearer"===i.scheme&&(p.headers.Authorization="Bearer "+o)}else if("oauth2"===a){var f=n.token||{},h=f.access_token,m=f.token_type;m&&"bearer"!==m.toLowerCase()||(m="Bearer"),p.headers.Authorization=m+" "+h}}}}),p):t}Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(7)),o=n(r(1)),s=n(r(0));t.default=function(e,t){var r=e.operation,n=e.requestBody,u=e.securities,l=e.spec,c=e.attachContentTypeForEmptyPayload,f=e.requestContentType;t=a({request:t,securities:u,operation:r,spec:l});var d=r.requestBody||{},h=(0,s.default)(d.content||{}),m=f&&h.indexOf(f)>-1;if(n||c){if(f&&m)t.headers["Content-Type"]=f;else if(!f){var v=h[0];v&&(t.headers["Content-Type"]=v,f=v)}}else f&&m&&(t.headers["Content-Type"]=f);return n&&(f?h.indexOf(f)>-1&&("application/x-www-form-urlencoded"===f||0===f.indexOf("multipart/")?"object"===(void 0===n?"undefined":(0,o.default)(n))?(t.form={},(0,s.default)(n).forEach(function(e){var r,a=n[e],s=void 0;"undefined"!=typeof File&&(s=a instanceof File),"undefined"!=typeof Blob&&(s=s||a instanceof Blob),void 0!==p.Buffer&&(s=s||p.Buffer.isBuffer(a)),r="object"!==(void 0===a?"undefined":(0,o.default)(a))||s?a:Array.isArray(a)?a.toString():(0,i.default)(a),t.form[e]={value:r}})):t.form=n:t.body=n):t.body=n),t},t.applySecurities=a;var u=n(r(5)),l=n(r(12)),c=n(r(13)),p=r(64)},function(e,t){e.exports=r(48)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=e.request,r=e.securities,n=void 0===r?{}:r,a=e.operation,u=void 0===a?{}:a,l=e.spec,c=(0,s.default)({},t),p=n.authorized,f=void 0===p?{}:p,d=n.specSecurity,h=void 0===d?[]:d,m=u.security||h,v=f&&!!(0,i.default)(f).length,g=l.securityDefinitions;return c.headers=c.headers||{},c.query=c.query||{},(0,i.default)(n).length&&v&&m&&(!Array.isArray(u.security)||u.security.length)?(m.forEach(function(e,t){for(var r in e){var n=f[r];if(n){var i=n.token,a=n.value||n,s=g[r],u=s.type,l=i&&i.access_token,p=i&&i.token_type;if(n)if("apiKey"===u){var d="query"===s.in?"query":"headers";c[d]=c[d]||{},c[d][s.name]=a}else"basic"===u?a.header?c.headers.authorization=a.header:(a.base64=(0,o.default)(a.username+":"+a.password),c.headers.authorization="Basic "+a.base64):"oauth2"===u&&l&&(p=p&&"bearer"!==p.toLowerCase()?p:"Bearer",c.headers.authorization=p+" "+l)}}}),c):t}Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(0));t.default=function(e,t){var r=e.spec,n=e.operation,i=e.securities,o=e.requestContentType,s=e.attachContentTypeForEmptyPayload;if((t=a({request:t,securities:i,operation:n,spec:r})).body||t.form||s)o?t.headers["Content-Type"]=o:Array.isArray(n.consumes)?t.headers["Content-Type"]=n.consumes[0]:Array.isArray(r.consumes)?t.headers["Content-Type"]=r.consumes[0]:n.parameters&&n.parameters.filter(function(e){return"file"===e.type}).length?t.headers["Content-Type"]="multipart/form-data":n.parameters&&n.parameters.filter(function(e){return"formData"===e.in}).length&&(t.headers["Content-Type"]="application/x-www-form-urlencoded");else if(o){var u=n.parameters&&n.parameters.filter(function(e){return"body"===e.in}).length>0,l=n.parameters&&n.parameters.filter(function(e){return"formData"===e.in}).length>0;(u||l)&&(t.headers["Content-Type"]=o)}return t},t.applySecurities=a;var o=n(r(13)),s=n(r(5));n(r(6))}])},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function arrayToObject(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?r+=t.charAt(n):o<128?r+=i[o]:o<2048?r+=i[192|o>>6]+i[128|63&o]:o<55296||o>=57344?r+=i[224|o>>12]+i[128|o>>6&63]+i[128|63&o]:(n+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(n)),r+=i[240|o>>18]+i[128|o>>12&63]+i[128|o>>6&63]+i[128|63&o])}return r},t.compact=function compact(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n=0;s--)if(l[s]!=c[s])return!1;for(s=l.length-1;s>=0;s--)if(u=l[s],!a(e[u],t[u],r))return!1;return typeof e==typeof t}(e,t,r))};function isUndefinedOrNull(e){return null===e||void 0===e}function isBuffer(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}},function(e,t,r){var n={strict:!0},i=r(422),o=function(e,t){return i(e,t,n)},a=r(243);t.JsonPatchError=a.PatchError,t.deepClone=a._deepClone;var s={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=getValueByPointer(r,this.path);n&&(n=a._deepClone(n));var i=applyOperation(r,{op:"remove",path:this.from}).removed;return applyOperation(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=getValueByPointer(r,this.from);return applyOperation(r,{op:"add",path:this.path,value:a._deepClone(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:o(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},u={add:function(e,t,r){return a.isInteger(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:s.move,copy:s.copy,test:s.test,_get:s._get};function getValueByPointer(e,t){if(""==t)return e;var r={op:"_get",path:t};return applyOperation(e,r),r.value}function applyOperation(e,r,n,i){if(void 0===n&&(n=!1),void 0===i&&(i=!0),n&&("function"==typeof n?n(r,0,e,r.path):validator(r,0)),""===r.path){var l={newDocument:e};if("add"===r.op)return l.newDocument=r.value,l;if("replace"===r.op)return l.newDocument=r.value,l.removed=e,l;if("move"===r.op||"copy"===r.op)return l.newDocument=getValueByPointer(e,r.from),"move"===r.op&&(l.removed=e),l;if("test"===r.op){if(l.test=o(e,r.value),!1===l.test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",0,r,e);return l.newDocument=e,l}if("remove"===r.op)return l.removed=e,l.newDocument=null,l;if("_get"===r.op)return r.value=e,l;if(n)throw new t.JsonPatchError("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",0,r,e);return l}i||(e=a._deepClone(e));var c=(r.path||"").split("/"),p=e,f=1,d=c.length,h=void 0,m=void 0,v=void 0;for(v="function"==typeof n?n:validator;;){if(m=c[f],n&&void 0===h&&(void 0===p[m]?h=c.slice(0,f).join("/"):f==d-1&&(h=r.path),void 0!==h&&v(r,0,e,h)),f++,Array.isArray(p)){if("-"===m)m=p.length;else{if(n&&!a.isInteger(m))throw new t.JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",0,r.path,r);a.isInteger(m)&&(m=~~m)}if(f>=d){if(n&&"add"===r.op&&m>p.length)throw new t.JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",0,r.path,r);if(!1===(l=u[r.op].call(r,p,m,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",0,r,e);return l}}else if(m&&-1!=m.indexOf("~")&&(m=a.unescapePathComponent(m)),f>=d){if(!1===(l=s[r.op].call(r,p,m,e)).test)throw new t.JsonPatchError("Test operation failed","TEST_OPERATION_FAILED",0,r,e);return l}p=p[m]}}function applyPatch(e,r,n,i){if(void 0===i&&(i=!0),n&&!Array.isArray(r))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=a._deepClone(e));for(var o=new Array(r.length),s=0,u=r.length;s0)throw new t.JsonPatchError('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",r,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new t.JsonPatchError("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",r,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",r,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&a.hasUndefined(e.value))throw new t.JsonPatchError("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",r,e,n);if(n)if("add"==e.op){var o=e.path.split("/").length,u=i.split("/").length;if(o!==u+1&&o!==u)throw new t.JsonPatchError("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",r,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==i)throw new t.JsonPatchError("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",r,e,n)}else if("move"===e.op||"copy"===e.op){var l=validate([{op:"_get",path:e.from,value:void 0}],n);if(l&&"OPERATION_PATH_UNRESOLVABLE"===l.name)throw new t.JsonPatchError("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",r,e,n)}}function validate(e,r,n){try{if(!Array.isArray(e))throw new t.JsonPatchError("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(r)applyPatch(a._deepClone(r),a._deepClone(e),n||!0);else{n=n||validator;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:(0,a.List)();return function(e){return(e.authSelectors.definitionsToAuthorize()||(0,a.List)()).filter(function(e){return t.some(function(t){return t.get(e.keySeq().first())})})}},t.authorized=(0,o.createSelector)(s,function(e){return e.get("authorized")||(0,a.Map)()}),t.isAuthorized=function isAuthorized(e,t){return function(e){var r=e.authSelectors.authorized();return a.List.isList(t)?!!t.toJS().filter(function(e){return-1===(0,n.default)(e).map(function(e){return!!r.get(e)}).indexOf(!1)}).length:null}},t.getConfigs=(0,o.createSelector)(s,function(e){return e.get("configs")})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.execute=void 0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(26));t.execute=function execute(e,t){var r=t.authSelectors,i=t.specSelectors;return function(t){var o=t.path,a=t.method,s=t.operation,u=t.extras,l={authorized:r.authorized()&&r.authorized().toJS(),definitions:i.securityDefinitions()&&i.securityDefinitions().toJS(),specSecurity:i.security()&&i.security().toJS()};return e((0,n.default)({path:o,method:a,operation:s,securities:l},u))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return{fn:{shallowEqualKeys:n.shallowEqualKeys}}};var n=r(10)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function SplitPaneModePlugin(){return{components:{SplitPaneMode:n.default}}};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(431))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(4)),i=_interopRequireDefault(r(2)),o=_interopRequireDefault(r(3)),a=_interopRequireDefault(r(5)),s=_interopRequireDefault(r(6)),u=_interopRequireDefault(r(0)),l=_interopRequireDefault(r(1)),c=_interopRequireDefault(r(989));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var p=["split-pane-mode"],f="left",d="right",h="both",m=function(e){function SplitPaneMode(){var e,t,r,o;(0,i.default)(this,SplitPaneMode);for(var s=arguments.length,u=Array(s),l=0;l=400)return a.updateLoadingStatus("failed"),n.newThrownErr((0,i.default)(new Error((t.message||t.statusText)+" "+e),{source:"fetch"})),void(!t.status&&t instanceof Error&&function checkPossibleFailReasons(){try{var t=void 0;if("URL"in s.default?t=new URL(e):(t=document.createElement("a")).href=e,"https:"!==t.protocol&&"https:"===s.default.location.protocol){var r=(0,i.default)(new Error("Possible mixed-content issue? The page was loaded over https:// but a "+t.protocol+"// URL was specified. Check that you are not attempting to load mixed content."),{source:"fetch"});return void n.newThrownErr(r)}if(t.origin!==s.default.location.origin){var o=(0,i.default)(new Error("Possible cross-origin (CORS) issue? The URL origin ("+t.origin+") does not match the page ("+s.default.location.origin+"). Check the server returns the correct 'Access-Control-Allow-*' headers."),{source:"fetch"});n.newThrownErr(o)}}catch(e){return}}());a.updateLoadingStatus("success"),a.updateSpec(t.text),o.url()!==e&&a.updateUrl(e)}e=e||o.url(),a.updateLoadingStatus("loading"),n.clear({source:"fetch"}),l({url:e,loadSpec:!0,requestInterceptor:c.requestInterceptor||function(e){return e},responseInterceptor:c.responseInterceptor||function(e){return e},credentials:"same-origin",headers:{Accept:"application/json,*/*"}}).then(next,next)}},updateLoadingStatus:function updateLoadingStatus(e){var t=[null,"loading","failed","success","failedConfig"];return-1===t.indexOf(e)&&console.error("Error: "+e+" is not one of "+(0,n.default)(t)),{type:"spec_update_loading_status",payload:e}}},u={loadingStatus:(0,o.createSelector)(function(e){return e||(0,a.Map)()},function(e){return e.get("loadingStatus")||null})};return{statePlugins:{spec:{actions:r,reducers:{spec_update_loading_status:function spec_update_loading_status(e,t){return"string"==typeof t.payload?e.set("loadingStatus",t.payload):e}},selectors:u}}}};var o=r(59),a=r(7),s=_interopRequireDefault(r(32));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function configsPlugin(){return{statePlugins:{spec:{actions:a,selectors:l},configs:{reducers:u.default,actions:o,selectors:s}}}};var n=_interopRequireDefault(r(1025)),i=r(249),o=_interopRequireWildcard(r(250)),a=_interopRequireWildcard(r(438)),s=_interopRequireWildcard(r(439)),u=_interopRequireDefault(r(440));function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var l={getLocalConfig:function getLocalConfig(){return(0,i.parseYamlConfig)(n.default)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigByUrl=t.downloadConfig=void 0;var n=r(249);t.downloadConfig=function downloadConfig(e){return function(t){return(0,t.fn.fetch)(e)}},t.getConfigByUrl=function getConfigByUrl(e,t){return function(r){var i=r.specActions;if(e)return i.downloadConfig(e).then(next,next);function next(r){r instanceof Error||r.status>=400?(i.updateLoadingStatus("failedConfig"),i.updateLoadingStatus("failedConfig"),i.updateUrl(""),console.error(r.statusText+" "+e.url),t(null)):t((0,n.parseYamlConfig)(r.text))}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.get=function get(e,t){return e.getIn(Array.isArray(t)?t:[t])}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(24)),o=r(7),a=r(250);t.default=(n={},(0,i.default)(n,a.UPDATE_CONFIGS,function(e,t){return e.merge((0,o.fromJS)(t.payload))}),(0,i.default)(n,a.TOGGLE_CONFIGS,function(e,t){var r=t.payload,n=e.get(r);return e.set(r,!n)}),n)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return[n.default,{statePlugins:{configs:{wrapActions:{loaded:function loaded(e,t){return function(){e.apply(void 0,arguments);var r=window.location.hash;t.layoutActions.parseDeepLinkHash(r)}}}}},wrapComponents:{operation:i.default,OperationTag:o.default}}]};var n=_interopRequireDefault(r(442)),i=_interopRequireDefault(r(444)),o=_interopRequireDefault(r(445));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearScrollTo=t.scrollToElement=t.readyToScroll=t.parseDeepLinkHash=t.scrollTo=t.show=void 0;var n,i=_interopRequireDefault(r(24)),o=_interopRequireDefault(r(19)),a=r(443),s=_interopRequireDefault(r(1026)),u=r(7),l=_interopRequireDefault(u);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var c=t.show=function show(e,t){var r=t.getConfigs,n=t.layoutSelectors;return function(){for(var t=arguments.length,i=Array(t),s=0;s-1?t:e.content.clientHeight},this.getWrapperStyle=function(t){if(e.state.currentState===u&&e.state.to){var r=e.props.fixedHeight;return r>-1?{overflow:"hidden",height:r}:{height:"auto"}}return"WAITING"!==e.state.currentState||e.state.to?{overflow:"hidden",height:Math.max(0,t)}:{overflow:"hidden",height:0}},this.getMotionProps=function(){var t=e.props.springConfig;return e.state.currentState===u?{defaultStyle:{height:e.state.to},style:{height:e.state.to}}:{defaultStyle:{height:e.state.from},style:{height:(0,s.spring)(e.state.to,n({precision:1},t))}}},this.renderContent=function(t){var r=t.height,i=e.props,a=(i.isOpened,i.springConfig,i.forceInitialAnimation,i.hasNestedCollapse,i.fixedHeight,i.theme),s=i.style,u=i.onRender,l=(i.onRest,i.onMeasure,i.children),c=function _objectWithoutProperties(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(i,["isOpened","springConfig","forceInitialAnimation","hasNestedCollapse","fixedHeight","theme","style","onRender","onRest","onMeasure","children"]),p=e.state;return u({current:r,from:p.from,to:p.to}),o.default.createElement("div",n({ref:e.onWrapperRef,className:a.collapse,style:n({},e.getWrapperStyle(Math.max(0,r)),s)},c),o.default.createElement("div",{ref:e.onContentRef,className:a.content},l))}}},function(e,t,r){"use strict";t.__esModule=!0,t.default={noWobble:{stiffness:170,damping:26},gentle:{stiffness:120,damping:14},wobbly:{stiffness:180,damping:12},stiff:{stiffness:210,damping:20}},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Collapse=t.Link=t.Select=t.Input=t.TextArea=t.Button=t.Row=t.Col=t.Container=void 0;var n=_interopRequireDefault(r(26)),i=_interopRequireDefault(r(87)),o=_interopRequireDefault(r(4)),a=_interopRequireDefault(r(2)),s=_interopRequireDefault(r(3)),u=_interopRequireDefault(r(5)),l=_interopRequireDefault(r(6)),c=_interopRequireDefault(r(0)),p=_interopRequireDefault(r(1)),f=r(450);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function xclass(){for(var e=arguments.length,t=Array(e),r=0;r",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},function(e,t,r){"use strict";var n=r(458),i=r(28).unescapeMd;e.exports=function parseLinkDestination(e,t){var r,o,a,s=t,u=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t8&&r<14);)if(92===r&&t+11)break;if(41===r&&--o<0)break;t++}return s!==t&&(a=i(e.src.slice(s,t)),!!e.parser.validateLink(a)&&(e.linkContent=a,e.pos=t,!0))}},function(e,t,r){"use strict";var n=r(28).replaceEntities;e.exports=function normalizeLink(e){var t=n(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}},function(e,t,r){"use strict";var n=r(28).unescapeMd;e.exports=function parseLinkTitle(e,t){var r,i=t,o=e.posMax,a=e.src.charCodeAt(t);if(34!==a&&39!==a&&40!==a)return!1;for(t++,40===a&&(a=41);t1?i-1:0),a=1;a1?r-1:0),i=1;i0?Array(e+1).join(" ")+t:t}).join("\n")}(0,(0,n.default)(a,null,2))||"{}",c.default.createElement("br",null)))}}]),OperationLink}(l.Component);d.propTypes={getComponent:p.default.func.isRequired,link:f.default.orderedMap.isRequired,name:p.default.String},t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(4)),i=_interopRequireDefault(r(2)),o=_interopRequireDefault(r(3)),a=_interopRequireDefault(r(5)),s=_interopRequireDefault(r(6)),u=_interopRequireDefault(r(0)),l=r(7),c=_interopRequireDefault(r(1)),p=_interopRequireDefault(r(12));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function Servers(){var e,t,r,o;(0,i.default)(this,Servers);for(var s=arguments.length,u=Array(s),l=0;l=55296&&a<=57343){if(a>=55296&&a<=56319&&i+1=56320&&s<=57343){l+=encodeURIComponent(e[i]+e[i+1]),i++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[i]);return l}encode.defaultChars=";/?:@&=+$,-_.!~*'()#",encode.componentChars="-_.!~*'()",e.exports=encode},function(e,t,r){"use strict";var n={};function decode(e,t){var r;return"string"!=typeof t&&(t=decode.defaultChars),r=function getDecodeCache(e){var t,r,i=n[e];if(i)return i;for(i=n[e]=[],t=0;t<128;t++)r=String.fromCharCode(t),i.push(r);for(t=0;t=55296&&u<=57343?"���":String.fromCharCode(u),t+=6):240==(248&i)&&t+91114111?l+="����":(u-=65536,l+=String.fromCharCode(55296+(u>>10),56320+(1023&u))),t+=9):l+="�";return l})}decode.defaultChars=";/?:@&=+$,#",decode.componentChars="",e.exports=decode},function(e,t){e.exports={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}},function(e,t){e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},function(e,t){ +/*! http://mths.be/repeat v0.2.0 by @mathias */ +String.prototype.repeat||function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,r=t(e,e,e)&&t}catch(e){}return r}(),t=function(e){if(null==this)throw TypeError();var t=String(this),r=e?Number(e):0;if(r!=r&&(r=0),r<0||r==1/0)throw RangeError();for(var n="";r;)r%2==1&&(n+=t),r>1&&(t+=t),r>>=1;return n};e?e(String.prototype,"repeat",{value:t,configurable:!0,writable:!0}):String.prototype.repeat=t}()},function(e,t,r){"use strict";function Renderer(){}Renderer.prototype.render=function render(e){var t,r,n=e.walker();for(this.buffer="",this.lastOut="\n";t=n.next();)this[r=t.node.type]&&this[r](t.node,t.entering);return this.buffer},Renderer.prototype.out=function out(e){this.lit(e)},Renderer.prototype.lit=function lit(e){this.buffer+=e,this.lastOut=e},Renderer.prototype.cr=function cr(){"\n"!==this.lastOut&&this.lit("\n")},Renderer.prototype.esc=function esc(e){return e},e.exports=Renderer},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(87)),i=_interopRequireDefault(r(0)),o=r(35);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.default=(0,o.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,r=(0,n.default)(e,["Ori"]),o=r.schema,a=r.getComponent,s=r.errSelectors,u=r.authorized,l=r.onAuthChange,c=r.name,p=a("HttpAuth");return"http"===o.get("type")?i.default.createElement(p,{key:c,schema:o,name:c,errSelectors:s,authorized:u,getComponent:a,onChange:l}):i.default.createElement(t,r)})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(86)),i=_interopRequireDefault(r(4)),o=_interopRequireDefault(r(2)),a=_interopRequireDefault(r(3)),s=_interopRequireDefault(r(5)),u=_interopRequireDefault(r(6)),l=r(0),c=_interopRequireDefault(l),p=_interopRequireDefault(r(1)),f=r(7),d=_interopRequireDefault(f),h=_interopRequireDefault(r(12)),m=r(35);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var v=function(e){function Parameters(e){(0,o.default)(this,Parameters);var t=(0,s.default)(this,(Parameters.__proto__||(0,i.default)(Parameters)).call(this,e));return t.onChange=function(e,r,n){var i=t.props;(0,i.specActions.changeParamByIdentity)(i.onChangeKey,e,r,n)},t.onChangeConsumesWrapper=function(e){var r=t.props;(0,r.specActions.changeConsumesValue)(r.onChangeKey,e)},t.toggleTab=function(e){return"parameters"===e?t.setState({parametersVisible:!0,callbackVisible:!1}):"callbacks"===e?t.setState({callbackVisible:!0,parametersVisible:!1}):void 0},t.state={callbackVisible:!1,parametersVisible:!0},t}return(0,u.default)(Parameters,e),(0,a.default)(Parameters,[{key:"render",value:function render(){var e=this,t=this.props,r=t.onTryoutClick,i=t.onCancelClick,o=t.parameters,a=t.allowTryItOut,s=t.tryItOutEnabled,u=t.fn,l=t.getComponent,p=t.getConfigs,h=t.specSelectors,m=t.oas3Actions,v=t.oas3Selectors,g=t.pathMethod,y=t.specPath,_=t.operation,b=l("parameterRow"),S=l("TryItOutButton"),k=l("contentType"),x=l("Callbacks",!0),E=l("RequestBody",!0),C=s&&a,w=h.isOAS3,D=_.get("requestBody"),A=y.slice(0,-1).push("requestBody");return c.default.createElement("div",{className:"opblock-section"},c.default.createElement("div",{className:"opblock-section-header"},c.default.createElement("div",{className:"tab-header"},c.default.createElement("div",{onClick:function onClick(){return e.toggleTab("parameters")},className:"tab-item "+(this.state.parametersVisible&&"active")},c.default.createElement("h4",{className:"opblock-title"},c.default.createElement("span",null,"Parameters"))),_.get("callbacks")?c.default.createElement("div",{onClick:function onClick(){return e.toggleTab("callbacks")},className:"tab-item "+(this.state.callbackVisible&&"active")},c.default.createElement("h4",{className:"opblock-title"},c.default.createElement("span",null,"Callbacks"))):null),a?c.default.createElement(S,{enabled:s,onCancelClick:i,onTryoutClick:r}):null),this.state.parametersVisible?c.default.createElement("div",{className:"parameters-container"},o.count()?c.default.createElement("div",{className:"table-container"},c.default.createElement("table",{className:"parameters"},c.default.createElement("thead",null,c.default.createElement("tr",null,c.default.createElement("th",{className:"col col_header parameters-col_name"},"Name"),c.default.createElement("th",{className:"col col_header parameters-col_description"},"Description"))),c.default.createElement("tbody",null,function eachMap(e,t){return e.valueSeq().filter(d.default.Map.isMap).map(t)}(o,function(t,r){return c.default.createElement(b,{fn:u,getComponent:l,specPath:y.push(r),getConfigs:p,rawParam:t,param:h.parameterWithMetaByIdentity(g,t),key:t.get("name"),onChange:e.onChange,onChangeConsumes:e.onChangeConsumesWrapper,specSelectors:h,pathMethod:g,isExecute:C})}).toArray()))):c.default.createElement("div",{className:"opblock-description-wrapper"},c.default.createElement("p",null,"No parameters"))):"",this.state.callbackVisible?c.default.createElement("div",{className:"callbacks-container opblock-description-wrapper"},c.default.createElement(x,{callbacks:(0,f.Map)(_.get("callbacks")),specPath:y.slice(0,-1).push("callbacks")})):"",w()&&D&&this.state.parametersVisible&&c.default.createElement("div",{className:"opblock-section"},c.default.createElement("div",{className:"opblock-section-header"},c.default.createElement("h4",{className:"opblock-title parameter__name "+(D.get("required")&&"required")},"Request body"),c.default.createElement("label",null,c.default.createElement(k,{value:v.requestContentType.apply(v,(0,n.default)(g)),contentTypes:D.get("content").keySeq(),onChange:function onChange(e){m.setRequestContentType({value:e,pathMethod:g})},className:"body-param-content-type"}))),c.default.createElement("div",{className:"opblock-description-wrapper"},c.default.createElement(E,{specPath:A,requestBody:D,requestBodyValue:v.requestBodyValue.apply(v,(0,n.default)(g))||(0,f.Map)(),isExecute:C,onChange:function onChange(e,t){if(t){var r=v.requestBodyValue.apply(v,(0,n.default)(g)),i=f.Map.isMap(r)?r:(0,f.Map)();return m.setRequestBodyValue({pathMethod:g,value:i.setIn(t,e)})}m.setRequestBodyValue({value:e,pathMethod:g})},contentType:v.requestContentType.apply(v,(0,n.default)(g))}))))}}]),Parameters}(l.Component);v.propTypes={parameters:h.default.list.isRequired,specActions:p.default.object.isRequired,operation:p.default.object.isRequired,getComponent:p.default.func.isRequired,getConfigs:p.default.func.isRequired,specSelectors:p.default.object.isRequired,oas3Actions:p.default.object.isRequired,oas3Selectors:p.default.object.isRequired,fn:p.default.object.isRequired,tryItOutEnabled:p.default.bool,allowTryItOut:p.default.bool,specPath:h.default.list.isRequired,onTryoutClick:p.default.func,onCancelClick:p.default.func,onChangeKey:p.default.array,pathMethod:p.default.array.isRequired},v.defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[]},t.default=(0,m.OAS3ComponentWrapFactory)(v)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(0)),i=r(35);t.default=(0,i.OAS3ComponentWrapFactory)(function(e){var t=e.Ori;return n.default.createElement("span",null,n.default.createElement(t,e),n.default.createElement("small",{style:{backgroundColor:"#89bf04"}},n.default.createElement("pre",{className:"version"},"OAS3")))})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(35);t.default=(0,n.OAS3ComponentWrapFactory)(function(){return null})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(26)),i=_interopRequireDefault(r(4)),o=_interopRequireDefault(r(2)),a=_interopRequireDefault(r(3)),s=_interopRequireDefault(r(5)),u=_interopRequireDefault(r(6)),l=r(0),c=_interopRequireDefault(l),p=_interopRequireDefault(r(1)),f=r(35),d=r(454);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var h=function(e){function ModelComponent(){return(0,o.default)(this,ModelComponent),(0,s.default)(this,(ModelComponent.__proto__||(0,i.default)(ModelComponent)).apply(this,arguments))}return(0,u.default)(ModelComponent,e),(0,a.default)(ModelComponent,[{key:"render",value:function render(){var e=this.props,t=e.getConfigs,r=["model-box"],i=null;return!0===e.schema.get("deprecated")&&(r.push("deprecated"),i=c.default.createElement("span",{className:"model-deprecated-warning"},"Deprecated:")),c.default.createElement("div",{className:r.join(" ")},i,c.default.createElement(d.Model,(0,n.default)({},this.props,{getConfigs:t,depth:1,expandDepth:this.props.expandDepth||0})))}}]),ModelComponent}(l.Component);h.propTypes={schema:p.default.object.isRequired,name:p.default.string,getComponent:p.default.func.isRequired,getConfigs:p.default.func.isRequired,specSelectors:p.default.object.isRequired,expandDepth:p.default.number},t.default=(0,f.OAS3ComponentWrapFactory)(h)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(87)),i=_interopRequireDefault(r(0)),o=r(35);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.default=(0,o.OAS3ComponentWrapFactory)(function(e){var t=e.Ori,r=(0,n.default)(e,["Ori"]),o=r.schema,a=r.getComponent,s=r.errors,u=r.onChange,l=o.type,c=o.format,p=a("Input");return"string"!==l||"binary"!==c&&"base64"!==c?i.default.createElement(t,r):i.default.createElement(p,{type:"file",className:s.length?"invalid":"",title:s.length?s:"",onChange:function onChange(e){u(e.target.files[0])},disabled:t.isDisabled})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serverEffectiveValue=t.serverVariables=t.serverVariableValue=t.responseContentType=t.requestContentType=t.requestBodyValue=t.selectedServer=void 0;var n=r(7),i=r(35);function onlyOAS3(e){return function(){for(var t=arguments.length,r=Array(t),n=0;n=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?r:"values"==t?e[r]:[r,e[r]])},"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,r){"use strict";var n=r(170),i=r(101),o=r(103),a={};r(54)(a,r(20)("iterator"),function(){return this}),e.exports=function(e,t,r){e.prototype=n(a,{next:i(1,r)}),o(e,t+" Iterator")}},function(e,t,r){var n=r(42),i=r(36),o=r(102);e.exports=r(47)?Object.defineProperties:function defineProperties(e,t){i(e);for(var r,a=o(t),s=a.length,u=0;s>u;)n.f(e,r=a[u++],t[r]);return e}},function(e,t,r){var n=r(73),i=r(122),o=r(500);e.exports=function(e){return function(t,r,a){var s,u=n(t),l=i(u.length),c=o(a,l);if(e&&r!=r){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===r)return e||c||0;return!e&&-1}}},function(e,t,r){var n=r(171),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=n(e))<0?i(e+t,0):o(e,t)}},function(e,t,r){var n=r(171),i=r(166);e.exports=function(e){return function(t,r){var o,a,s=String(i(t)),u=n(r),l=s.length;return u<0||u>=l?e?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===l||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},function(e,t,r){var n=r(36),i=r(175);e.exports=r(15).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return n(t.call(e))}},function(e,t,r){r(504),r(267),r(515),r(519),r(530),r(531),e.exports=r(63).Promise},function(e,t,r){"use strict";var n=r(177),i={};i[r(17)("toStringTag")]="z",i+""!="[object z]"&&r(75)(Object.prototype,"toString",function toString(){return"[object "+n(this)+"]"},!0)},function(e,t,r){e.exports=!r(106)&&!r(107)(function(){return 7!=Object.defineProperty(r(179)("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){var n=r(76);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){"use strict";var n=r(508),i=r(266),o=r(181),a={};r(61)(a,r(17)("iterator"),function(){return this}),e.exports=function(e,t,r){e.prototype=n(a,{next:i(1,r)}),o(e,t+" Iterator")}},function(e,t,r){var n=r(62),i=r(509),o=r(273),a=r(180)("IE_PROTO"),s=function(){},u=function(){var e,t=r(179)("iframe"),n=o.length;for(t.style.display="none",r(274).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write(" + + + + + + + + + + + + + + + + + + + + TheTransitClock Synoptic + + + + +
+
+ + +
+
+
+ + diff --git a/transitclockWebapp/src/main/webapp/synoptic/javascript/synoptic.js b/transitclockWebapp/src/main/webapp/synoptic/javascript/synoptic.js new file mode 100644 index 000000000..0fba76845 --- /dev/null +++ b/transitclockWebapp/src/main/webapp/synoptic/javascript/synoptic.js @@ -0,0 +1,781 @@ +var doStuff = function (indice,top, left ) { + this.__showContexMenuFromMuli({ top, left },indice) + } + + + +/** + * It defines a synoptic + * The contructor receivs as paramters: + * container:div|window + * onclick:callback + * border:int + * routeName:string + * showReturn:true|false + * drawReturnUpside:true|false + */ +class Sinoptico +{ + //{container:div|window,onclick:calback,border:int,vehicleIcon:image} + // + constructor(params) + //constructor(canvas,onclick,menu) + { + this.name=params.routeName; + this.container=params.container; + this.infoStop=(data) =>`
${data.identifier}
${data.projection}
`; + this.infoVehicle=(data)=>`
Móvil ${data.identifier}
${data.projection}
`; + if(params.infoStop!=undefined) + { + + console.log(this.infoStop({identifier:"test"})); + console.log(this.infoStop); + this.infoStop=params.infoStop; + + this.infoStop=this.infoStop.bind(this); + console.log(this.infoStop({identifier:"test"})); + } + if(params.infoVehicle!=undefined) + { + this.infoVehicle=params.infoVehicle; + } + this.__showReturn=true; + if(params.showReturn!=undefined) + this.__showReturn=params.showReturn; + this.toolTipDiv = document.createElement('div'); + this.menuDiv = document.createElement('div'); + this.menuDiv.className='menu-content'; + this.canvas = document.createElement('canvas'); + this.canvas.style.position = "absolute"; + this.canvas.border=0; + if(params.border!=undefined) + { + this.canvas.border= params.border; + } + this.canvas.style.border =this.canvas.border+"px solid"; + this.canvas.style.left="0"; + this.canvas.style.top="0"; + this.drawReturnUpside=true; + this.zoomFactor=1.0; +// if(params.drawReturnUpside!=undefined) +// this.drawReturnUpside=params.drawReturnUpside; + + + + //this.canvas=canvas; + if(params.routeName!=undefined) + { + + this.title = document.createElement('div'); + this.title.className='synopticTitle'; + this.title.innerHTML=''+params.routeName+''; + this.container.appendChild(this.title); + + } + + this.container.appendChild(this.canvas); + this.container.appendChild(this.toolTipDiv); + this.container.appendChild(this.menuDiv); + + this.ctx= this.canvas.getContext('2d'); + // this.ctx.fillRect(0, 0,80, 98); + //this.busPath=Path2d(); + + this.vehicleIcon//= document.getElementById("vehicleIcon"); + = new Image(); + this.vehicleIcon.addEventListener('load', function() { + console.log("Image loaded"); + + }, false); +// this.vehicleIcon.addEventListener('load', function() { +// // execute drawImage statements here +// }, false); + this.vehicleIcon.src="bus_verde_negro.png"; + + this.vehicleIcon.width=25; + this.vehicleIcon.height=25; + + this.linewidth=0.9;//Porcentaje que ocupa del canvas + // var lineWidth=(canvas.width*linewidth); + //this.margen=(canvas.width-lineWidth)/2.0;//MOVE TO POSITION OF THE LINE + this.forwarLinePosition=80; + this.returnLinePosition=150; + //this.separation=40; + this.linecolour="#CD5F48"; + this.resize = this.resize.bind(this); + this.init = this.init.bind(this); + this.__handleMouseEvent = this.__handleMouseEvent.bind(this); + + this.__animateBus = this.__animateBus.bind(this); + this.__showContexMenuFromMuli=this.__showContexMenuFromMuli.bind(this); + this.__zoomIn=this.__zoomIn.bind(this); + this.__zoomOut=this.__zoomOut.bind(this); + this.mapBuses=new Map(); + this.buses=null; + this.stops=null; + this.resized=false; + this.onVehiClick=params.onVehiClick; + if(params.predictionFunction!=undefined) + this.predictionFunction=params.predictionFunction; + // this.menu=menu; + this.busDistanceToLine=3; + this.textSeparation=6; + this.__mouseWheelHandler = this.__mouseWheelHandler.bind(this); + } + init() + { + window.addEventListener('resize',this.resize, false); + this.canvas.addEventListener('click', this.__handleMouseEvent); + this.canvas.addEventListener('mousedown', this.__handleMouseEvent); + this.canvas.addEventListener('contextmenu', this.__handleMouseEvent); + this.canvas.addEventListener('mousemove',this.__handleMouseEvent); + this.canvas.addEventListener('wheel',this.__mouseWheelHandler); + this.resize(); + } + + __mouseWheelHandler(e) { + + // cross-browser wheel delta + if(e.deltaY>0) + { + console.log(e); + this.__zoomOut(); + } + else + { + this.__zoomIn(); + } + } + ////////////////////////////////// + getElements(x,y) + { + var elements=[]; + for(var m=0;m=x && this.buses[m].posY+this.vehicleIcon.height>=y ) + elements.push(this.buses[m]); + } + for(var m=0;m=x && this.stops[m].posY+5>=y ) + elements.push(this.stops[m]); + } + return elements; + } + __hideContexMenu( ){ + + const menu = this.menuDiv; + menu.style.visibility = "hidden"; + + } + __hideTooltip( ){ + const tooltip=this.toolTipDiv; + // menu = window.getComputedStyle ? getComputedStyle(this.tootTipDiv, null) : this.tootTipDiv.currentStyle; + +// var menu = document.querySelector(".tooltip-right"); +// menu.style.visibility = "hidden"; +// menu.style.opacity = 0; +// menu = document.querySelector(".tooltip-left"); + tooltip.style.visibility = "hidden"; + tooltip.style.opacity = 0; + } + __showTooltipBus(elements,{ top, left }) + { + + if(this.toolTipDiv.clientWidth!=undefined) + { + if(left+this.toolTipDiv.clientWidth + Móvil ${data.identifier} + ${data.projection} + `; + tooltip.innerHTML+=this.infoVehicle(data); + } +// const toggleMenu = command => { +// menu.style.display = command === "show" ? "block" : "none"; +// menuVisible = !menuVisible; +// }; + + + } + setPredictionsContent(content) + { + const tooltip=this.toolTipDiv; + tooltip.innerHTML=content; + } + + __showTooltipStop(elements,{ top, left }) + { + top+=15; + if(this.toolTipDiv.clientWidth!=undefined) + { + left-=this.toolTipDiv.clientWidth/2; + if(left<0) + { + left=0; + + } + else if(left>window.innerWidth) + { + + left=window.innerWidth-this.toolTipDiv.clientWidth; + } + } + +// if(this.toolTipDiv.clientWidth!=undefined) +// { +// console.log("a"); +// if(left+this.toolTipDiv.clientWidth { +// menu.style.display = command === "show" ? "block" : "none"; +// menuVisible = !menuVisible; +// }; + + + } + + __showTooltip(elements,{ top, left }) + { + + if(elements[0].type=='bus') + this.__showTooltipBus(elements,{ top, left }) + else if (elements[0].type=='stop') + this.__showTooltipStop(elements,{ top, left }) + } + __showContexMenuFromMuli(event) + { + console.log("__showContexMenuFromMuli"); + console.log(event); +// { top, left },indice +// console.log(this.__menuElements); +// console.log(indice); + var top=event.target.top; + var left= event.target.left; + this.__showContexMenu([event.target.element],{ top, left}); + + } + __showContexMenu(elements,{ top, left }) + { + + const menu = this.menuDiv; + if(elements == null) + { + const menu = this.menuDiv; + menu.innerHTML=""; + var a=document.createElement("a"); + a.innerHTML="Zoom in"; + a.addEventListener('click',this.__zoomIn) + // a.onclick=function (){this.__zoomIn}; + console.log("===>"+this.zoomFactor) + menu.appendChild(a); + a=document.createElement("a"); + a.innerHTML="Zoom out"; + a.addEventListener('click',this.__zoomOut) + // a.onclick=function (){this.__zoomIn}; + console.log("===>"+this.zoomFactor) + menu.appendChild(a); + menu.style.left = `${left}px`; + menu.style.top = `${top}px`; + menu.style.visibility = "visible"; + menu.style.border='1px solid'; + return; + } + if(elements[0].type=='bus') + { + top+=this.vehicleIcon.height+3; + } + else + top+=3; + + if(left+menu.clientWidth>window.innerWidth) + { + left=window.innerWidth-menu.clientWidth; + + } + menu.style.left = `${left}px`; + menu.style.top = `${top}px`; + menu.style.visibility = "visible"; + menu.style.border='1px solid'; + if(elements[0].type=='bus') + { + + if(elements.length>1) + { + menu.innerHTML=""; + for(var pos=0;pos${data.identifier}`; + ; + } + } + else + { + menu.innerHTML="menu1menu2"; +// var a=document.createElement("a"); +// a.innerHTML="Zoom in"; +// a.addEventListener('click',this.__zoomIn) +// // a.onclick=function (){this.__zoomIn}; +// console.log("===>"+this.zoomFactor) +// menu.appendChild(a); +// a=document.createElement("a"); +// a.innerHTML="Zoom out"; +// a.addEventListener('click',this.__zoomOut) +// // a.onclick=function (){this.__zoomIn}; +// console.log("===>"+this.zoomFactor) +// menu.appendChild(a); + } + + } + + if(elements[0].type=='stop') + menu.innerHTML="stop"; + + + + + } + __zoomIn() + { + if(this.zoomFactor<4) + this.zoomFactor+=0.1; + this.resize(); + this.__hideContexMenu(); + } + __zoomOut() + { + if(this.zoomFactor>1) + this.zoomFactor-=0.1; + this.resize(); + this.__hideContexMenu(); + } + __handleMouseEvent(event) + { + var rect = this.canvas.getBoundingClientRect(); + var x = event.pageX-rect.left, + y = event.pageY-rect.top; + if(event.type=="click") + { + this.__hideTooltip(); + this.__hideContexMenu(); + var elements=this.getElements(x,y); + if(elements!=undefined && elements.length>0) + this.onVehiClick(elements) + } + if(event.type=="contextmenu") + { + this.__hideTooltip(); + event.preventDefault(); + var elements=this.getElements(x,y); + + if(elements!=undefined && elements.length>0) + { + + const origin = { + left: elements[0].posX, + top: elements[0].posY + }; + this.__showContexMenu(elements,origin); + } + else + { + const origin = { + left: x, + top: y + }; + this.__showContexMenu(null,origin); + //this.__hideContexMenu(); + } + //alert(event.type); + } + if(event.type=="mousemove") + { + var elements=this.getElements(x,y); + + if(elements!=undefined && elements.length>0) + { + const origin = { + left: elements[0].posX, + top: elements[0].posY + }; + //console.log(origin); + this.__showTooltip(elements,origin); + } + else + this.__hideTooltip(); + + } + //console.log("CLICK "+x+ " "+y+ " canvas.width " +canvas.width+ " line "+lineWidth); + + + + + } + getLineWidth() + { + //return (this.canvas.width*this.linewidth); + return (this.canvas.width-80); + } + + getLineMargin() + { + return (this.canvas.width-this.getLineWidth())/2.0; + } + drawLine(direction) + { + this.ctx.save(); + this.ctx.beginPath(); + this.ctx.lineCap="round"; + this.ctx.moveTo(this.getLineMargin(), direction==0?this.forwarLinePosition:this.returnLinePosition); + this.ctx.lineWidth = 5; + this.ctx.strokeStyle = this.linecolour; + this.ctx.lineTo(this.getLineWidth()+this.getLineMargin(), direction==0?this.forwarLinePosition:this.returnLinePosition); + this.ctx.stroke(); + this.ctx.closePath(); + this.ctx.restore(); + + + } + resize() { + console.log("RESIZE "+this.zoomFactor); + var width=this.container.innerWidth; + var height=this.container.innerHeight + if(width == undefined) + { + width=this.container.clientWidth; + height=this.container.clientHeight + } + width=this.zoomFactor*width; + this.container.style.overflow="auto"; + //console.log(this.canvas.style); + if(this.canvas.border!= undefined) + { + + width-=2*this.canvas.border; + height-=2*this.canvas.border; + } + //console.log("resizing"); +// console.log("resizing"+ this.container.innerWidth); +// console.log("resizing"+ this.container.clientWidth); +// console.log("resizing"+ this.container.clientHeight);//offsetHeight==>incluye padding, scrollbar y bordes + this.canvas.width = width; + this.canvas.height = height; + this.paint(); + this.resized=true; + } + getLastPostition(id) + { + + var lastPosition={}; + if(this.buses == undefined) + return lastPosition; + + for (var i=0; i < this.buses.length; i++) { + if (this.buses[i].id == id) { + //console.log("FOUND ID "+id); + lastPosition.posX=this.buses[i].posX; + lastPosition.posY=this.buses[i].posY; + return lastPosition; + } + + } + return lastPosition; + } + setBuses(buses) + { + // console.log("SETTING BUSES"); + for(var pos=0;posbus.posX) + xToDraw=bus.lastPosition.posX-(bus.lastPosition.posX-bus.posX)/this.steps*this.counter; + else + xToDraw=bus.lastPosition.posX+((bus.posX-bus.lastPosition.posX)/this.steps)*this.counter; + + } + this.ctx.fillStyle = bus.fill; + // this.ctx.fillRect(xToDraw, yToDraw, this.vehicleIcon.width, this.vehicleIcon.height); + this.ctx.drawImage(this.vehicleIcon,xToDraw, yToDraw,this.vehicleIcon.width, this.vehicleIcon.height); + + + //console.log(metrics); + var fontPostY=(bus.direction==0)?bus.posY-this.textSeparation:(this.drawReturnUpside==true)?bus.posY-this.textSeparation:bus.posY+metrics.height+this.vehicleIcon.height+this.textSeparation; + this.ctx.fillText(bus.identifier,xToDraw,fontPostY ); + +// ctx.stroke(); + } + this.ctx.restore(); + this.counter++; + if(this.counter<=this.steps) + { + //console.log("TIME "+ this.counter); + window.requestAnimationFrame(this.__animateBus); + } + } + setStops(stops) + { + console.log('setting stops'+stops.length); + for(var pos=0;posbus.posX) + xToDraw=bus.lastPosition.posX-(bus.lastPosition.posX-bus.posX)/this.steps*this.counter; + else + xToDraw=bus.lastPosition.posX+((bus.posX-bus.lastPosition.posX)/this.steps)*this.counter; + + }*/ + this.ctx.fillStyle = bus.fill; + // this.ctx.fillRect(xToDraw, yToDraw, this.vehicleIcon.width, this.vehicleIcon.height); + this.ctx.drawImage(this.vehicleIcon,xToDraw, yToDraw,this.vehicleIcon.width, this.vehicleIcon.height); + + + //console.log(metrics); + var fontPostY=(bus.direction==0)?bus.posY-this.textSeparation:(this.drawReturnUpside==true)?bus.posY-this.textSeparation:bus.posY+metrics.height+this.vehicleIcon.height+this.textSeparation; + this.ctx.fillText(bus.identifier,xToDraw,fontPostY ); + +// ctx.stroke(); + } + this.ctx.restore(); + + } + paint() + { + if(this.resize) + { + this.drawLine(0); + if(this.__showReturn) + this.drawLine(1); + this.paintStop(); + } + if(this.buses== undefined || this.buses==null) + { + console.warn("no bus to paint"); + return; + } + + this.paintBus(); + + this.resized=false; + // + + //this.ctx.translate(25,20); + + } + draw() + { + this.ctx.save(); + this.ctx.fillStyle = 'rgb(255,255,0)'; + + this.ctx.translate(40,40); + this.ctx.fillRect(0,0,25,25); + this.ctx.restore(); + this.ctx.save(); + this.ctx.fillStyle = 'rgb(255,0,0)'; + + //this.ctx.restore(); + // + this.ctx.translate(40,40); + this.ctx.drawImage(this.vehicleIcon,0,0); + this.ctx.fillRect(5,5,5,5); + this.ctx.restore(); + + + } + +} + diff --git a/transitclockWebapp/src/main/webapp/welcome/index.jsp b/transitclockWebapp/src/main/webapp/welcome/index.jsp index a42b59ce2..721eff099 100644 --- a/transitclockWebapp/src/main/webapp/welcome/index.jsp +++ b/transitclockWebapp/src/main/webapp/welcome/index.jsp @@ -63,6 +63,7 @@ for (WebAgency webAgency : webAgencies) { Reports API Status + Synoptic Extensions <% From 7bc89f34a1babd89ad647d669e2e2f3bca04cb80 Mon Sep 17 00:00:00 2001 From: vperez Date: Sun, 19 Aug 2018 20:20:51 -0300 Subject: [PATCH 72/81] Files to check if needed --- .../src/main/webapp/synoptic/css/avlMapUi.css | 73 ++++ .../webapp/synoptic/javascript/animation.js | 179 +++++++++ .../main/webapp/synoptic/javascript/avlMap.js | 358 ++++++++++++++++++ .../javascript/leafletRotatedMarker.js | 26 ++ .../synoptic/javascript/mapUiOptions.js | 145 +++++++ 5 files changed, 781 insertions(+) create mode 100644 transitclockWebapp/src/main/webapp/synoptic/css/avlMapUi.css create mode 100644 transitclockWebapp/src/main/webapp/synoptic/javascript/animation.js create mode 100644 transitclockWebapp/src/main/webapp/synoptic/javascript/avlMap.js create mode 100644 transitclockWebapp/src/main/webapp/synoptic/javascript/leafletRotatedMarker.js create mode 100644 transitclockWebapp/src/main/webapp/synoptic/javascript/mapUiOptions.js diff --git a/transitclockWebapp/src/main/webapp/synoptic/css/avlMapUi.css b/transitclockWebapp/src/main/webapp/synoptic/css/avlMapUi.css new file mode 100644 index 000000000..75ec0984b --- /dev/null +++ b/transitclockWebapp/src/main/webapp/synoptic/css/avlMapUi.css @@ -0,0 +1,73 @@ +body { + margin: 0px; +} + +/* For the AVL points */ +div.avlMarker { + background-color: #ff7800; + border-color: black; + border-radius: 4px; + border-style: solid; + border-width: 1px; + width:7px; + height:7px; +} + +div.avlTriangle { + width: 0px; + height: 0px; + border-bottom: 10px solid #ff7800; + border-left: 5px solid transparent; + border-right: 5px solid transparent + } + +.popupTable { + border-spacing: 0px; +} + +.popupTableLabel { + font-weight: bold; + text-align: right; +} + +/* For the params menu */ +#params { + background: lightgrey; + position:absolute; + top:10px; + right:10px; + border-radius: 25px; + padding: 2%; + border: 2px solid black; +} + + /* Playback menu */ +#playbackContainer { + position: absolute; + left: 50%; + bottom: 5%; +} +#playback { + background: lightgrey; + position: relative; + left: -50%; + text-align: center; + border-radius: 25px; + padding: 2%; + font-family: monospace; + border: 2px solid black; + width: 300px; +} + +#playback input { + background: lightgrey; +} + +#playback input:hover { + border: 1px solid #CCC; + box-shadow: 1px 1px 5px #999 +} + +#playback input:active { + background: lightblue; +} \ No newline at end of file diff --git a/transitclockWebapp/src/main/webapp/synoptic/javascript/animation.js b/transitclockWebapp/src/main/webapp/synoptic/javascript/animation.js new file mode 100644 index 000000000..c7692d36e --- /dev/null +++ b/transitclockWebapp/src/main/webapp/synoptic/javascript/animation.js @@ -0,0 +1,179 @@ +// D3-style object to create and control an animation of the AVL +// data for a particular vehicle. +// map : map or group where animation will be added. +// clock: DOM object where current time should be updated. +// icon: Leaflet icon which will be animated. +function avlAnimation(map, icon, clock) { + + var startTime, endTime, rate, currentIndex, elapsedTime, + lastTime, lineDone, paused, durations, sprite, positions, end; + + var ready = false; + + // create icon for animation and initialize values + // positions is an array of position values: { lat, lon, timestamp } + function animation(data) { + + // remove old sprite. + if (sprite) + map.removeLayer(sprite); + + positions = data + + ready = true; + startTime = positions[0].timestamp; + endTime = positions[positions.length-1].timestamp; + rate = 1; + + currentIndex = 0; // this means we're going to 1 + + elapsedTime = positions[0].timestamp, + lastTime = 0, + lineDone = 0; + + paused = true; + + durations = [] + for (var i = 0; i < positions.length - 1; i++) + durations.push(positions[i+1].timestamp - positions[i].timestamp); + + sprite = L.marker(positions[0], {icon: icon}).addTo(map); + clock.textContent = parseTime(elapsedTime); + } + + function tick() { + var now = Date.now(), + delta = now - lastTime; + + lastTime = now; + + elapsedTime += delta * rate; + + lineDone += delta * rate; + + if (lineDone > durations[currentIndex]) { + // advance index and icon + currentIndex += 1 + lineDone = 0; + + if (currentIndex == positions.length - 1) { + if (end) + end() + currentIndex = 0; + paused = true; + return; + } + + sprite.setLatLng(positions[currentIndex]) + sprite.update() + elapsedTime = positions[currentIndex].timestamp + } + else { + var pos = interpolatePosition(positions[currentIndex], positions[currentIndex+1], durations[currentIndex], lineDone) + sprite.setLatLng(pos) + sprite.update() + + } + clock.textContent = parseTime(elapsedTime); + + if (!paused) + requestAnimationFrame(tick) + } + + animation.ready = function() { + return ready; + } + + animation.start = function() { + lastTime = Date.now(); + paused = false; + tick(); + } + + animation.pause = function() { + paused = true; + } + + animation.paused = function() { + return paused; + } + + animation.onEnd = function (_) { + end = _; + } + + animation.rate = function(_) { + if(_) + rate = _; + else + return rate; + } + + // skip to next AVL + animation.next = function() { + updateToIndex(currentIndex+1); + } + + // previous AVL + animation.prev = function() { + // In most cases, we don't actually want to go *back* an index, just + // restart this one. Exception: if we are less than 500ms (in realtime) + // into this avl. + + var delta = elapsedTime - positions[currentIndex].timestamp; + if (delta/rate < 500) + updateToIndex(currentIndex-1); + else + updateToIndex(currentIndex); + } + + // find next AVL that has a different lat/lng + animation.advance = function() { + var pos = positions[currentIndex] + var nextIndex = currentIndex + 1; + while(nextIndex < positions.length) { + var next = positions[currentIndex]; + if (pos.lat != next.lat || pos.lon != next.lon) + break; + nextIndex++; + } + updateToIndex(nextIndex); + console.log(nextIndex) + } + + function updateToIndex(i) { + if (i > positions.length - 1) + i = positions.length - 1; + if (i < 0) + i = 0; + + currentIndex = i; //+= 1; + lineDone = 0; + var avl = positions[currentIndex]; + elapsedTime = avl.timestamp; + + // update GUI if tick won't. + if (paused) { + sprite.setLatLng(avl); + sprite.update(); + clock.textContent = parseTime(elapsedTime); + } + } + + function parseTime(x) { + return new Date(x).toTimeString().slice(0, 8); + } + + // taken from leafletMovingMarker.js + var interpolatePosition = function(p1, p2, duration, t) { + var k = t/duration; + k = (k>0) ? k : 0; + k = (k>1) ? 1 : k; + return L.latLng(p1.lat + k*(p2.lat-p1.lat), p1.lon + k*(p2.lon-p1.lon)); + }; + + + return animation; +} + + \ No newline at end of file diff --git a/transitclockWebapp/src/main/webapp/synoptic/javascript/avlMap.js b/transitclockWebapp/src/main/webapp/synoptic/javascript/avlMap.js new file mode 100644 index 000000000..8e68439fd --- /dev/null +++ b/transitclockWebapp/src/main/webapp/synoptic/javascript/avlMap.js @@ -0,0 +1,358 @@ +//Edit route input width. +$("#route").attr("style", "width: 200px"); + +/* For drawing the route and stops */ +var routeOptions = { + color: '#00ee00', + weight: 4, + opacity: 0.4, + lineJoin: 'round', + clickable: false +}; + + var stopOptions = { + color: '#006600', + opacity: 0.4, + radius: 4, + weight: 2, + fillColor: '#006600', + fillOpacity: 0.3, +}; + +var routePolylineOptions = {clickable: false, color: "#00f", opacity: 0.5, weight: 4}; + +var stopPopupOptions = {closeButton: false}; + +function drawAvlMarker(avl) { + var latLng = L.latLng(avl.lat, avl.lon); + + // Create the marker. Use a divIcon so that can have tooltips + var tooltip = avl.time.substring(avl.time.indexOf(' ') + 1); + var avlMarker = L.rotatedMarker(avl, { + icon: L.divIcon({ + className: 'avlMarker_', + html: "
", + iconSize: [7,7] + }), + angle: avl.heading, + title: tooltip + }).addTo(vehicleGroup); + + // Create popup with detailed info + + var labels = ["Vehicle", "GPS Time", "Time Proc", "Lat/Lon", "Speed", "Heading", "Assignment ID"], + keys = ["vehicleId", "time", "timeProcessed", "latlon", "niceSpeed", "heading", "assignmentId"]; + + // populate missing keys + avl.latlon = avl.lat + ", " + avl.lon + avl.niceSpeed = Math.round(parseFloat(avl.speed) * 10)/10 + " kph"; + + var content = $("").attr("class", "popupTable"); + + for (var i = 0; i < labels.length; i++) { + var label = $("").append(label, value) ) + } + + avlMarker.bindPopup(content[0]); + + return avlMarker; +} + +/* Called when receiving the AVL data via AJAX call */ +function processAvlCallback(jsonData) { + + /* Save avl data */ + + // List of all the latLngs + var latLngs = []; + + // So can draw separate polyline per vehicle + var previousVehicleId = ""; + var latLngsForVehicle = []; + + // reset list of vehicles + var vehicles = []; + + // For each AVL report... + var vehicle; + for (var i=0; i= 2) + L.polyline(latLngsForVehicle, routePolylineOptions).addTo(map); //.bringToBack(); + latLngsForVehicle = []; + vehicle = {id: avl.vehicleId, data: []} + vehicles.push(vehicle); + } + + // parse date string -> number + avl.timestamp = Date.parse(avl.time.replace(/-/g, '/').slice(0,-2)) + + vehicle.data.push(avl) + previousVehicleId = avl.vehicleId; + + var latLng = drawAvlMarker(avl).getLatLng(); + + latLngsForVehicle.push(latLng); + latLngs.push(latLng); + } + + // Draw polyline for the last vehicle in the AVL data + if (latLngsForVehicle.length >= 2) + L.polyline(latLngsForVehicle, routePolylineOptions).addTo(vehicleGroup); //.bringToBack(); + + // If actually read AVL data... + if (latLngs.length > 0) { + // To make all AVL reports fit in bounds of map. + map.fitBounds(latLngs); + } else { + alert("No AVL data for the criteria specified.") + } + return vehicles; +} + + +/** + * Reads in route data obtained via AJAX and draws route and stops on map. + */ +function routeConfigCallback(data, status) { + // Draw the paths for the route + + var route = data.routes[0]; + + for (var i=0; i").attr("class", "popupTable"); + var labels = ["Stop ID", "Name"], keys = ["id", "name"]; + for (var i = 0; i < labels.length; i++) { + var label = $("").append(label, value) ); + } + + stopMarker.bindPopup(content[0]); + } + } +} + +// Data in vehicles will be available as CSV when you click the `export' link. +// CSV should be the AVL CSV format used elsewhere in Transitime. +// org.transitclock.avl.AvlCsvWriter writes the following header: +// vehicleId,time,justTime,latitude,longitude,speed,heading,assignmentId,assignmentType +// org.transitclock.avl.AvlCsvRecord has required keys vehicleId, time, latitude, longitude +// all others optional +function createExport(vehicles) { + + var data = vehicles[0].data + + // set keys + var keys = ["vehicleId", "time", "latitude", "longitude", "speed", "heading", "assignmentId"] + // CSV key => JS object key + function mapKey(k) { + var o = {"latitude": "lat", "longitude": "lon"} + return o[k] || k; + } + + // write header + var text = keys[0]; + for (var i = 1; i < keys.length; i++) + text += "," + keys[i] + text += '\n' + + // write rows + for (var i = 0; i < data.length; i++) { + text += data[i][keys[0]] + for (var j = 1; j < keys.length; j++) { + var k = mapKey(keys[j]) + text += "," + data[i][k] + } + text += "\n"; + } + + var blob = new Blob([text], { type: 'text/plain' }); // change to text/csv for download prompt + $("#exportData")[0].href = window.URL.createObjectURL(blob); + } + +//Add a new layer for only route/bus markers, so that it can be refreshed +//when selections change without having to redraw tiles. +var map = L.map('map'); +L.control.scale({metric: false}).addTo(map); +L.tileLayer('http://api.tiles.mapbox.com/v4/transitime.j1g5bb0j/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoidHJhbnNpdGltZSIsImEiOiJiYnNWMnBvIn0.5qdbXMUT1-d90cv1PAIWOQ', { + attribution: '© OpenStreetMap & CC-BY-SA, Imagery © Mapbox', + maxZoom: 19 +}).addTo(map); + +//fit map to agency boundaries. +$.getJSON(apiUrlPrefix + "/command/agencyGroup", function(agencies) { + var e = agencies.agency[0].extent; + map.fitBounds([[e.minLat, e.minLon], [e.maxLat, e.maxLon]]); +}) +.fail(function(request, status, error) { + alert(error + '. ' + request.responseText); +}); + + +var vehicleGroup = L.layerGroup().addTo(map); +var routeGroup = L.layerGroup().addTo(map); +var animationGroup = L.layerGroup().addTo(map); + +//Set the CLIP_PADDING to a higher value so that when user pans on map +//the route path doesn't need to be redrawn. Note: leaflet documentation +//says that this could decrease drawing performance. But hey, it looks +//better. +L.Path.CLIP_PADDING = 0.8;0 + +if (request.v || request.r) { + // Request exists; set all the controls to match the values in the request. + $("#vehicle").val(request.v).trigger("change"); + $("#beginDate").val(request.beginDate).trigger("change"); + $("#numDays").val(parseInt(request.numDays)).trigger("change"); + $("#beginTime").val(request.beginTime).trigger("change"); + $("#endTime").val(request.endTime).trigger("change"); + $("#route").val(request.r).trigger("change"); + + //draw vehicles if there is already request information + if (request.v) { + drawAvlData(); + } + if (request.r && request.r != "") + drawRoute(request.r); + +} +else { + // no request + // set beginDate and endDate to defaults + request.beginDate = $("#beginDate").val() + request.numDays = $("#numDays").val() +} + +// draw route data when dropdown is selected +$("#route").change(function(evt) { drawRoute(evt.target.value) }); + +// draw AVL data when submit button is clicked +$("#submit").on("click", function() { + /* Set request object to match new values */ + request.v = $("#vehicle").val(); + request.beginDate = $("#beginDate").val(); + request.numDays = $("#numDays").val(); + request.beginTime = $("#beginTime").val(); + request.endTime = $("#endTime").val(); + request.r = $("#route").val(); + + // Clear existing layer and draw new objects on map. + drawAvlData(); +}); + + +//Get the AVL data via AJAX and call processAvlCallback to draw it +function drawAvlData() { + $.ajax({ + // The page being requested + url: contextPath + "/reports/avlJsonData.jsp", + // Pass in query string parameters to page being requested + data: request, + // Needed so that parameters passed properly to page being requested + traditional: true, + dataType:"json", + async: true, + // When successful process JSON data + success: function(resp) { + vehicleGroup.clearLayers(); + var vehicles = processAvlCallback(resp); + // connect export to link to csv creation. + createExport(vehicles); + if (vehicles.length) + prepareAnimation(vehicles[0].data); // only animate first vehicle returned. + }, + // When there is an AJAX problem alert the user + error: function(request, status, error) { + alert(error + '. ' + request.responseText); + }, + }); +} + +function drawRoute(route) { + routeGroup.clearLayers(); + if (route != "") { + var url = apiUrlPrefix + "/command/routesDetails?r=" + route; + $.getJSON(url, routeConfigCallback); + } +} + +/* Animation controls */ + +var busIcon = L.icon({ + iconUrl: contextPath + "/reports/images/bus.png", + iconSize: [25,25] +}); +var animate = avlAnimation(animationGroup, busIcon, $("#playbackTime")[0]); + +var playButton = contextPath + "/reports/images/playback/media-playback-start.svg", + pauseButton = contextPath + "/reports/images/playback/media-playback-pause.svg"; + +animate.onEnd(function() { + $("#playbackPlay").attr("src", playButton); +}) + +// Given a list of AVL positions, initialize the animation object. +function prepareAnimation(avlData) { + + // Make sure animation controls are in their initial state. + $("#playbackPlay").attr("src", playButton); + $("#playbackRate").text("1X"); + + animate(avlData); + +} + +$("#playbackNext").on("click", animate.next); + +$("#playbackPrev").on("click", animate.prev); + +$("#playbackPlay").on("click", function() { + + if (!animate.paused()) { + animate.pause(); + $("#playbackPlay").attr("src", playButton); + } + else { // need to start it + animate.start(); + $("#playbackPlay").attr("src", pauseButton); + } + +}); + +$("#playbackFF").on("click", function() { + var rate = animate.rate()*2; + animate.rate(rate); + $("#playbackRate").text(rate + "X"); +}); + +$("#playbackRew").on("click", function() { + var rate = animate.rate()/2; + animate.rate(rate); + $("#playbackRate").text(rate + "X"); +}); + + diff --git a/transitclockWebapp/src/main/webapp/synoptic/javascript/leafletRotatedMarker.js b/transitclockWebapp/src/main/webapp/synoptic/javascript/leafletRotatedMarker.js new file mode 100644 index 000000000..2ce968de2 --- /dev/null +++ b/transitclockWebapp/src/main/webapp/synoptic/javascript/leafletRotatedMarker.js @@ -0,0 +1,26 @@ +// Class for creating marker with an orientation. Found at +// https://www.mapbox.com/mapbox.js/example/v1.0.0/rotating-controlling-marker/ +// Orients the icon to marker.options.angle when setLatLng() is called. +// MIT-licensed code by Benjamin Becquet +// https://github.com/bbecquet/Leaflet.PolylineDecorator +L.RotatedMarker = L.Marker.extend({ +options: { angle: 0 }, +_setPos: function(pos) { + L.Marker.prototype._setPos.call(this, pos); + if (L.DomUtil.TRANSFORM) { + // use the CSS transform rule if available + this._icon.style[L.DomUtil.TRANSFORM] += ' rotate(' + this.options.angle + 'deg)'; + } else if (L.Browser.ie) { + // fallback for IE6, IE7, IE8 + var rad = this.options.angle * L.LatLng.DEG_TO_RAD, + costheta = Math.cos(rad), + sintheta = Math.sin(rad); + this._icon.style.filter += ' progid:DXImageTransform.Microsoft.Matrix(sizingMethod=\'auto expand\', M11=' + + costheta + ', M12=' + (-sintheta) + ', M21=' + sintheta + ', M22=' + costheta + ')'; + } +} +}); + +L.rotatedMarker = function(pos, options) { + return new L.RotatedMarker(pos, options); +}; diff --git a/transitclockWebapp/src/main/webapp/synoptic/javascript/mapUiOptions.js b/transitclockWebapp/src/main/webapp/synoptic/javascript/mapUiOptions.js new file mode 100644 index 000000000..41fa0faf3 --- /dev/null +++ b/transitclockWebapp/src/main/webapp/synoptic/javascript/mapUiOptions.js @@ -0,0 +1,145 @@ +/** + * Options that effect how routes, stops, and vehicles are drawn + */ + +var shapeOptions = { + color: '#00ee00', + weight: 8, + opacity: 0.8, + lineJoin: 'round' +}; + +var minorShapeOptions = { + color: '#00ee00', + weight: 2, + opacity: 0.4, +}; + +var stopOptions = { + color: '#006600', + opacity: 1.0, + radius: 4, + weight: 2, + fillColor: '#006600', + fillOpacity: 0.6, +}; + +var firstStopOptions = { + color: '#006600', + opacity: 1.0, + radius: 7, + weight: 2, + fillColor: '#ccffcc', + fillOpacity: 0.9, +} + +var minorStopOptions = { + color: '#006600', + opacity: 0.2, + radius: 3, + weight: 2, + fillColor: '#006600', + fillOpacity: 0.2, +}; + +var busIcon = L.icon({ + iconUrl: 'images/bus-24.png', + iconRetinaUrl: 'images/bus-24@2x.png', + iconSize: [24, 24], + iconAnchor: [13, 12], + popupAnchor: [0, -12], +}); + +var streetcarIcon = L.icon({ + iconUrl: 'images/rail-light-24.png', + iconRetinaUrl: 'images/rail-light-24@2x.png', + iconSize: [24, 24], + iconAnchor: [12, 12], + popupAnchor: [0, -12], +}); + +var railIcon = L.icon({ + iconUrl: 'images/rail-24.png', + iconRetinaUrl: 'images/rail-24@2x.png', + iconSize: [24, 24], + iconAnchor: [13, 12], + popupAnchor: [0, -12], +}); + +var ferryIcon = L.icon({ + iconUrl: 'images/ferry-24.png', + iconRetinaUrl: 'images/ferry-24@2x.png', + iconSize: [24, 24], + iconAnchor: [12, 12], + popupAnchor: [0, -12], +}); + +var layoverIcon = L.icon({ + iconUrl: 'images/cafe-24.png', + iconRetinaUrl: 'images/cafe-24@2x.png', + iconSize: [24, 24], + iconAnchor: [12, 12], + popupAnchor: [0, -12], + +}); + +var arrowIcon = L.icon({ + iconUrl: 'images/arrow.png', + iconSize: [30, 30], + iconAnchor: [15,15], +}); + +var vehicleMarkerOptions = { + opacity: 1.0, +}; + +var secondaryVehicleMarkerOptions = { + opacity: 0.8, +}; + +var minorVehicleMarkerOptions = { + opacity: 0.3, +}; + +var vehicleMarkerBackgroundOptions = { + radius: 12, + weight: 0, + fillColor: '#ffffff', + fillOpacity: 1.0, +}; + +var secondaryVehicleMarkerBackgroundOptions = { + radius: 12, + weight: 0, + fillColor: '#ffffff', + fillOpacity: 0.80, +}; + +var minorVehicleMarkerBackgroundOptions = { + radius: 12, + weight: 0, + fillColor: '#ffffff', + fillOpacity: 0.3, +}; + +var unassignedVehicleMarkerBackgroundOptions = { + radius: 10, + weight: 0, + fillColor: '#F0FA39', + fillOpacity: 0.6, +}; + +var vehiclePopupOptions = { + offset: L.point(0,-2), + closeButton: false +}; + +var stopPopupOptions = { + offset: L.point(0, -0), + closeButton: false +} + +var tripPatternPopupOptions = { + closeButton: false +} + From 963966022d2e29a3bf673a1cd5e286669b804a0d Mon Sep 17 00:00:00 2001 From: scrudden Date: Mon, 20 Aug 2018 17:05:30 +0100 Subject: [PATCH 73/81] Some very basic anomaly filtering. --- .../dataCache/jcs/DwellTimeModelCache.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/transitclock/src/main/java/org/transitclock/core/dataCache/jcs/DwellTimeModelCache.java b/transitclock/src/main/java/org/transitclock/core/dataCache/jcs/DwellTimeModelCache.java index fe5b07838..964f7947f 100644 --- a/transitclock/src/main/java/org/transitclock/core/dataCache/jcs/DwellTimeModelCache.java +++ b/transitclock/src/main/java/org/transitclock/core/dataCache/jcs/DwellTimeModelCache.java @@ -32,8 +32,12 @@ public class DwellTimeModelCache implements org.transitclock.core.dataCache.Dwel final private static String cacheName = "DwellTimeModelCache"; - private static IntegerConfigValue maxDwellTimeAllowedInModel = new IntegerConfigValue("org.transitclock.core.dataCache.jcs.maxDwellTimeAllowedInModel", 120000, "Max dwell time to be considered in dwell RLS algotithm."); - private static LongConfigValue maxHeadwayAllowedInModel = new LongConfigValue("org.transitclock.core.dataCache.jcs.maxHeadwayAllowedInModel", 1*Time.MS_PER_HOUR, "Max dwell time to be considered in dwell RLS algotithm."); + + private static LongConfigValue maxDwellTimeAllowedInModel = new LongConfigValue("org.transitclock.core.dataCache.jcs.maxDwellTimeAllowedInModel", (long) (2 * Time.MS_PER_MIN), "Max dwell time to be considered in dwell RLS algotithm."); + private static LongConfigValue minDwellTimeAllowedInModel = new LongConfigValue("org.transitclock.core.dataCache.jcs.minDwellTimeAllowedInModel", (long) 1000, "Min dwell time to be considered in dwell RLS algotithm."); + private static LongConfigValue maxHeadwayAllowedInModel = new LongConfigValue("org.transitclock.core.dataCache.jcs.maxHeadwayAllowedInModel", 1*Time.MS_PER_HOUR, "Max headway to be considered in dwell RLS algotithm."); + private static LongConfigValue minHeadwayAllowedInModel = new LongConfigValue("org.transitclock.core.dataCache.jcs.minHeadwayAllowedInModel", (long) 1000, "Min headway to be considered in dwell RLS algotithm."); + private static DoubleConfigValue lambda = new DoubleConfigValue("org.transitclock.core.dataCache.jcs.lambda", 0.5, "This sets the rate at which the RLS algorithm forgets old values. Value are between 0 and 1. With 0 being the most forgetful."); @@ -118,13 +122,19 @@ public void addSample(ArrivalDeparture departure) { headway.setHeadway(arrival.getTime()-previousArrival.getTime()); long dwelltime=departure.getTime()-arrival.getTime(); headway.setTripId(arrival.getTripId()); - - /* Leave out silly values as they are most likely errors or unusual circumstance. */ + + + /* Leave out silly values as they are most likely errors or unusual circumstance. */ + /* TODO Should abstract this behind an anomaly detention interface/Factory */ if(dwelltime minDwellTimeAllowedInModel.getValue() && + headway.getHeadway() < maxHeadwayAllowedInModel.getValue() + && headway.getHeadway() > minHeadwayAllowedInModel.getValue()) + { addSample(indices, headway,dwelltime); } + } } } From 3cca67efab135aea5ac55e6c43f687834e404a13 Mon Sep 17 00:00:00 2001 From: vperez Date: Mon, 20 Aug 2018 23:02:34 -0300 Subject: [PATCH 74/81] Changes method for canceling - Search vehicle according to tripId - Set vehicleState to cancel Add method to reenable trip Add automatic reenable if trip changes --- .../org/transitclock/core/VehicleState.java | 4 ++ .../ipc/interfaces/CommandsInterface.java | 8 ++- .../ipc/servers/CommandsServer.java | 64 +++++++++++++++++-- .../api/rootResources/CommandsApi.java | 37 ++++++++++- 4 files changed, 106 insertions(+), 7 deletions(-) diff --git a/transitclock/src/main/java/org/transitclock/core/VehicleState.java b/transitclock/src/main/java/org/transitclock/core/VehicleState.java index f15359eae..0352d71b4 100644 --- a/transitclock/src/main/java/org/transitclock/core/VehicleState.java +++ b/transitclock/src/main/java/org/transitclock/core/VehicleState.java @@ -219,6 +219,10 @@ public boolean vehicleNewlyAssignedToSameBlock() { * @param match */ public void setMatch(TemporalMatch match) { + TemporalMatch lastMatch = getMatch(); + //To enable the vehicle if it was canceled and the trip is changed. + if(this.isCanceled &&(lastMatch==null || lastMatch.getTrip()==null || match==null || match.getTrip()==null || lastMatch.getTrip().getId().compareTo(match.getTrip().getId())!=0)) + this.isCanceled=false; // Add match to history temporalMatchHistory.addFirst(match); diff --git a/transitclock/src/main/java/org/transitclock/ipc/interfaces/CommandsInterface.java b/transitclock/src/main/java/org/transitclock/ipc/interfaces/CommandsInterface.java index 4f0319112..ffd372aeb 100644 --- a/transitclock/src/main/java/org/transitclock/ipc/interfaces/CommandsInterface.java +++ b/transitclock/src/main/java/org/transitclock/ipc/interfaces/CommandsInterface.java @@ -58,5 +58,11 @@ public interface CommandsInterface extends Remote { * Cancel a trip. It should exists in current predictions. * Retruns null on success */ - public String cancelTrip(String blockId) throws RemoteException; + public String cancelTrip(String tripId) throws RemoteException; + + /* + * Enable a canceled trip. It should exists in current predictions. + * Retruns null on success + */ + String reenableTrip(String tripId) throws RemoteException;; } diff --git a/transitclock/src/main/java/org/transitclock/ipc/servers/CommandsServer.java b/transitclock/src/main/java/org/transitclock/ipc/servers/CommandsServer.java index 918aa24ff..c3e90f34e 100644 --- a/transitclock/src/main/java/org/transitclock/ipc/servers/CommandsServer.java +++ b/transitclock/src/main/java/org/transitclock/ipc/servers/CommandsServer.java @@ -15,6 +15,7 @@ import org.transitclock.db.structs.AvlReport; import org.transitclock.db.structs.VehicleEvent; import org.transitclock.ipc.data.IpcAvl; +import org.transitclock.ipc.data.IpcVehicleComplete; import org.transitclock.ipc.interfaces.CommandsInterface; import org.transitclock.ipc.rmi.AbstractServer; @@ -133,14 +134,30 @@ public void setVehicleUnpredictable(String vehicleId) throws RemoteException { } @Override - public String cancelTrip(String blockId) { + public String cancelTrip(String tripId) { /* * VehicleId is virtual and is constructed by "block_" + block.getId() + "_schedBasedVehicle"; */ - String vehicleId= "block_" + blockId + "_schedBasedVehicle"; + //String vehicleId= "block_" + blockId + "_schedBasedVehicle"; + /** + * Get the vehicle assosiated to the tripId. + * Is it possible to have more than 1 bus with the same tripId?? + */ + Collection ipcVehicleCompletList = VehicleDataCache.getInstance().getVehiclesIncludingSchedBasedOnes(); + IpcVehicleComplete ipcVehicle=null; + for(IpcVehicleComplete _ipcVehicle:ipcVehicleCompletList) + { + if(_ipcVehicle.getTripId()!=null && _ipcVehicle.getTripId().compareTo(tripId)==0) + { + ipcVehicle=_ipcVehicle; + break; + } + } + if(ipcVehicle==null) + return "TripId id is not currently available"; VehicleState vehicleState = VehicleStateManager.getInstance() - .getVehicleState(vehicleId); + .getVehicleState(ipcVehicle.getId()); AvlReport avlReport=vehicleState.getAvlReport(); if(avlReport!=null) @@ -151,7 +168,46 @@ public String cancelTrip(String blockId) { return null; } else - return "Block id is not currently available"; + return "TripId id is not currently available"; + + + } + @Override + public String reenableTrip(String tripId) { + /* + * VehicleId is virtual and is constructed by "block_" + block.getId() + "_schedBasedVehicle"; + */ + //String vehicleId= "block_" + blockId + "_schedBasedVehicle"; + + /** + * Get the vehicle assosiated to the tripId. + * Is it possible to have more than 1 bus with the same tripId?? + */ + Collection ipcVehicleCompletList = VehicleDataCache.getInstance().getVehiclesIncludingSchedBasedOnes(); + IpcVehicleComplete ipcVehicle=null; + for(IpcVehicleComplete _ipcVehicle:ipcVehicleCompletList) + { + if(_ipcVehicle.getTripId()!=null && _ipcVehicle.getTripId().compareTo(tripId)==0) + { + ipcVehicle=_ipcVehicle; + break; + } + } + if(ipcVehicle==null) + return "TripId id is not currently available"; + VehicleState vehicleState = VehicleStateManager.getInstance() + .getVehicleState(ipcVehicle.getId()); + AvlReport avlReport=vehicleState.getAvlReport(); + + if(avlReport!=null) + { + vehicleState.setCanceled(false); + VehicleDataCache.getInstance().updateVehicle(vehicleState); + AvlProcessor.getInstance().processAvlReport(avlReport); + return null; + } + else + return "TripId id is not currently available"; } diff --git a/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java b/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java index 117ce20a8..6481076aa 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java +++ b/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java @@ -358,8 +358,7 @@ public Response cancelTrip(@BeanParam StandardParameters stdParameters, IpcTrip ipcTrip = cofingInterface.getTrip(tripId); if(ipcTrip==null) throw WebUtils.badRequestException("TripId=" + tripId + " does not exist."); - String blockId=ipcTrip.getBlockId(); - result=inter.cancelTrip(blockId); + result=inter.cancelTrip(tripId); } catch (RemoteException e) { e.printStackTrace(); @@ -370,4 +369,38 @@ public Response cancelTrip(@BeanParam StandardParameters stdParameters, else return stdParameters.createResponse(new ApiCommandAck(true,result)); } + + @Path("/command/reenableTrip/{tripId}") + @GET //SHOULD BE POST,IT IS AN UPDATE + @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + @Operation(summary="Cancel a trip in order to be shown in GTFS realtime.", + description="Experimental. It will work olny with the correct version. It cancel a trip that has no vechilce assigned." + ,tags= {"command","trip"}) + + public Response reenableTrip(@BeanParam StandardParameters stdParameters, + @Parameter(description="tripId to remove calceled satate.",required=true)@PathParam("tripId") String tripId) + { + stdParameters.validate(); + String agencyId = stdParameters.getAgencyId(); + System.out.println(agencyId); + String result=null; + try + { + CommandsInterface inter = stdParameters.getCommandsInterface(); + //We need to get the block id in order to get the vehicle + ConfigInterface cofingInterface = stdParameters.getConfigInterface(); + IpcTrip ipcTrip = cofingInterface.getTrip(tripId); + if(ipcTrip==null) + throw WebUtils.badRequestException("TripId=" + tripId + " does not exist."); + result=inter.reenableTrip(tripId); + } + catch (RemoteException e) { + e.printStackTrace(); + throw WebUtils.badRequestException("Could not send request to Core server. "+e.getMessage()); + } + if(result==null) + return stdParameters.createResponse(new ApiCommandAck(true,"Processed")); + else + return stdParameters.createResponse(new ApiCommandAck(true,result)); + } } From afe746487d14fb547f378a0bd77fbbd869aada1f Mon Sep 17 00:00:00 2001 From: scrudden Date: Tue, 21 Aug 2018 20:43:49 +0100 Subject: [PATCH 75/81] Set precedence of assignment correctly. --- .../feed/gtfsRt/GtfsRtVehiclePositionsReaderBase.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/transitclock/src/main/java/org/transitclock/feed/gtfsRt/GtfsRtVehiclePositionsReaderBase.java b/transitclock/src/main/java/org/transitclock/feed/gtfsRt/GtfsRtVehiclePositionsReaderBase.java index 50e787a6a..6197f1eb4 100644 --- a/transitclock/src/main/java/org/transitclock/feed/gtfsRt/GtfsRtVehiclePositionsReaderBase.java +++ b/transitclock/src/main/java/org/transitclock/feed/gtfsRt/GtfsRtVehiclePositionsReaderBase.java @@ -199,15 +199,18 @@ private void processMessage(FeedMessage message) { if (vehicle.hasTrip()) { TripDescriptor tripDescriptor = vehicle.getTrip(); + + if (tripDescriptor.hasRouteId()) { + avlReport.setAssignment(tripDescriptor.getRouteId(), + AssignmentType.ROUTE_ID); + } + if (tripDescriptor.hasTripId()) { avlReport.setAssignment(tripDescriptor.getTripId(), AssignmentType.TRIP_ID); } - if (tripDescriptor.hasRouteId()) { - avlReport.setAssignment(tripDescriptor.getRouteId(), - AssignmentType.ROUTE_ID); - } + } logger.debug("Processed {}", avlReport); From 2702b70b31f78b11773ea3af27d16f2cf2a2a348 Mon Sep 17 00:00:00 2001 From: vperez Date: Tue, 21 Aug 2018 19:52:30 -0300 Subject: [PATCH 76/81] Improvement in trip canceling - Add datetime parameter in order to cancel or reenable trip - VehiclePositionFeed set scheduler relationshiop of trip to cancel --- .../ipc/data/IpcVehicleComplete.java | 8 +- .../ipc/data/IpcVehicleGtfsRealtime.java | 26 ++++- .../ipc/interfaces/CommandsInterface.java | 5 +- .../ipc/servers/CommandsServer.java | 99 ++++++++++--------- .../api/gtfsRealtime/GtfsRtVehicleFeed.java | 4 + .../api/rootResources/CommandsApi.java | 22 +++-- .../api/rootResources/DateTimeParam.java | 46 +++++++++ 7 files changed, 141 insertions(+), 69 deletions(-) create mode 100644 transitclockApi/src/main/java/org/transitclock/api/rootResources/DateTimeParam.java diff --git a/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleComplete.java b/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleComplete.java index cdd33990d..32018f044 100644 --- a/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleComplete.java +++ b/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleComplete.java @@ -142,14 +142,14 @@ private IpcVehicleComplete(String blockId, Integer atOrNextGtfsStopSeq, String originStopId, String destinationId, double distanceToNextStop, - double distanceOfNextStopFromTripStart, double distanceAlongTrip, long freqStartTime, IpcHoldingTime holdingTime, double predictedLatitude, double predictedLongitude) { + double distanceOfNextStopFromTripStart, double distanceAlongTrip, long freqStartTime, IpcHoldingTime holdingTime, double predictedLatitude, double predictedLongitude,boolean isCanceled) { super(blockId, blockAssignmentMethod, avl, pathHeading, routeId, routeShortName, routeName, tripId, tripPatternId, directionId, headsign, predictable, schedBasedPred, realTimeSchdAdh, isDelayed, isLayover, layoverDepartureTime, nextStopId, nextStopName, vehicleType, tripStartEpochTime, atStop, atOrNextStopId, - atOrNextGtfsStopSeq, freqStartTime, holdingTime, predictedLatitude, predictedLongitude); + atOrNextGtfsStopSeq, freqStartTime, holdingTime, predictedLatitude, predictedLongitude,isCanceled); this.originStopId = originStopId; @@ -231,6 +231,7 @@ protected void readObject(java.io.ObjectInputStream stream) distanceToNextStop = stream.readDouble(); distanceOfNextStopFromTripStart = stream.readDouble(); distanceAlongTrip = stream.readDouble(); + isCanceled=stream.readBoolean(); } /* @@ -249,7 +250,7 @@ private Object readResolve() { atOrNextGtfsStopSeq, originStopId, destinationId, distanceToNextStop, distanceOfNextStopFromTripStart, - distanceAlongTrip, freqStartTime, holdingTime, predictedLatitude, predictedLongitude); + distanceAlongTrip, freqStartTime, holdingTime, predictedLatitude, predictedLongitude,isCanceled); } @@ -322,6 +323,7 @@ public String toString() { + ", atOrNextGtfsStopSeq=" + getAtOrNextGtfsStopSeq() + ", tripStartEpochTime=" + getTripStartEpochTime() + ", tripStartEpochTime=" + new Date(getTripStartEpochTime()) + + ", isCanceled=" + isCanceled() + ", originStopId=" + originStopId + ", destinationId=" + destinationId + ", distanceToNextStop=" diff --git a/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleGtfsRealtime.java b/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleGtfsRealtime.java index 6420a9b34..ba3ae7e71 100644 --- a/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleGtfsRealtime.java +++ b/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleGtfsRealtime.java @@ -54,7 +54,17 @@ public class IpcVehicleGtfsRealtime extends IpcVehicle { private final Integer atOrNextGtfsStopSeq; // For GTFS-rt to disambiguate trips - private final long tripStartEpochTime; + private final long tripStartEpochTime; + + private boolean isCanceled; + + public boolean isCanceled() { + return isCanceled; + } + + public void setCanceled(boolean isCanceled) { + this.isCanceled = isCanceled; + } private static final long serialVersionUID = -6611046660260490100L; @@ -82,7 +92,7 @@ public IpcVehicleGtfsRealtime(VehicleState vs) { match.getAtStop().getStopPath() : match.getStopPath(); atOrNextStopId = stopPath.getStopId(); atOrNextGtfsStopSeq = stopPath.getGtfsStopSeq(); - + this.isCanceled =vs.isCanceled(); // Note: the trip start date is created on server side so that // proper timezone is used. This unfortunately is a bit expensive. int time = vs.getTrip().getStartTime(); @@ -126,6 +136,7 @@ public IpcVehicleGtfsRealtime(VehicleState vs) { * @param atOrNextStopId * @param atOrNextGtfsStopSeq * @param holdingTime + * @param isCanceled */ protected IpcVehicleGtfsRealtime(String blockId, BlockAssignmentMethod blockAssignmentMethod, IpcAvl avl, @@ -138,7 +149,7 @@ protected IpcVehicleGtfsRealtime(String blockId, long tripStartEpochTime, boolean atStop, String atOrNextStopId, Integer atOrNextGtfsStopSeq, long freqStartTime, IpcHoldingTime holdingTime, double predictedLatitude, - double predictedLongitude) { + double predictedLongitude,boolean isCanceled) { super(blockId, blockAssignmentMethod, avl, pathHeading, routeId, routeShortName, routeName, tripId, tripPatternId, directionId, headsign, @@ -151,6 +162,7 @@ protected IpcVehicleGtfsRealtime(String blockId, this.atOrNextStopId = atOrNextStopId; this.atOrNextGtfsStopSeq = atOrNextGtfsStopSeq; this.tripStartEpochTime = tripStartEpochTime; + this.isCanceled=isCanceled; } /* @@ -163,7 +175,7 @@ protected static class GtfsRealtimeVehicleSerializationProxy protected String atOrNextStopId; protected Integer atOrNextGtfsStopSeq; protected long tripStartEpochTime; - + protected boolean isCanceled; private static final short currentSerializationVersion = 0; private static final long serialVersionUID = 5804716921925188073L; @@ -173,6 +185,7 @@ protected GtfsRealtimeVehicleSerializationProxy(IpcVehicleGtfsRealtime v) { this.atOrNextStopId = v.atOrNextStopId; this.atOrNextGtfsStopSeq = v.atOrNextGtfsStopSeq; this.tripStartEpochTime = v.tripStartEpochTime; + this.isCanceled=v.isCanceled; } /* @@ -193,6 +206,7 @@ protected void writeObject(java.io.ObjectOutputStream stream) stream.writeObject(atOrNextStopId); stream.writeObject(atOrNextGtfsStopSeq); stream.writeLong(tripStartEpochTime); + stream.writeBoolean(isCanceled); } /* @@ -219,6 +233,7 @@ protected void readObject(java.io.ObjectInputStream stream) atOrNextStopId = (String) stream.readObject(); atOrNextGtfsStopSeq = (Integer) stream.readObject(); tripStartEpochTime = stream.readLong(); + isCanceled=stream.readBoolean(); } /* @@ -235,7 +250,7 @@ private Object readResolve() { layoverDepartureTime, nextStopId, nextStopName, vehicleType, tripStartEpochTime, atStop, atOrNextStopId, - atOrNextGtfsStopSeq, freqStartTime, holdingTime, predictedLongitude, predictedLatitude); + atOrNextGtfsStopSeq, freqStartTime, holdingTime, predictedLongitude, predictedLatitude,isCanceled); } @@ -303,6 +318,7 @@ public String toString() { + ", atOrNextGtfsStopSeq=" + atOrNextGtfsStopSeq + ", tripStartEpochTime=" + tripStartEpochTime + ", tripStartEpochTime=" + new Date(tripStartEpochTime) + + ", isCanceled=" +isCanceled + "]"; } diff --git a/transitclock/src/main/java/org/transitclock/ipc/interfaces/CommandsInterface.java b/transitclock/src/main/java/org/transitclock/ipc/interfaces/CommandsInterface.java index ffd372aeb..a208ea721 100644 --- a/transitclock/src/main/java/org/transitclock/ipc/interfaces/CommandsInterface.java +++ b/transitclock/src/main/java/org/transitclock/ipc/interfaces/CommandsInterface.java @@ -18,6 +18,7 @@ import java.rmi.Remote; import java.rmi.RemoteException; +import java.time.LocalDateTime; import java.util.Collection; import org.transitclock.ipc.data.IpcAvl; @@ -58,11 +59,11 @@ public interface CommandsInterface extends Remote { * Cancel a trip. It should exists in current predictions. * Retruns null on success */ - public String cancelTrip(String tripId) throws RemoteException; + public String cancelTrip(String tripId,LocalDateTime at) throws RemoteException; /* * Enable a canceled trip. It should exists in current predictions. * Retruns null on success */ - String reenableTrip(String tripId) throws RemoteException;; + String reenableTrip(String tripId, LocalDateTime startTripTime) throws RemoteException; } diff --git a/transitclock/src/main/java/org/transitclock/ipc/servers/CommandsServer.java b/transitclock/src/main/java/org/transitclock/ipc/servers/CommandsServer.java index c3e90f34e..9b4277091 100644 --- a/transitclock/src/main/java/org/transitclock/ipc/servers/CommandsServer.java +++ b/transitclock/src/main/java/org/transitclock/ipc/servers/CommandsServer.java @@ -1,7 +1,10 @@ package org.transitclock.ipc.servers; import java.rmi.RemoteException; +import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.Collection; +import java.util.Date; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -132,34 +135,53 @@ public void setVehicleUnpredictable(String vehicleId) throws RemoteException { VehicleDataCache.getInstance().updateVehicle(vehicleState); } - - @Override - public String cancelTrip(String tripId) { - /* - * VehicleId is virtual and is constructed by "block_" + block.getId() + "_schedBasedVehicle"; - */ - //String vehicleId= "block_" + blockId + "_schedBasedVehicle"; - + private VehicleState getVehicleStateForTrip(String tripId, LocalDateTime _startTripTime) + { /** - * Get the vehicle assosiated to the tripId. - * Is it possible to have more than 1 bus with the same tripId?? + * The startTripTime parameter should not be null if noSchedule */ - Collection ipcVehicleCompletList = VehicleDataCache.getInstance().getVehiclesIncludingSchedBasedOnes(); - IpcVehicleComplete ipcVehicle=null; - for(IpcVehicleComplete _ipcVehicle:ipcVehicleCompletList) - { - if(_ipcVehicle.getTripId()!=null && _ipcVehicle.getTripId().compareTo(tripId)==0) + long startTripTime=0; + if(_startTripTime!=null) + startTripTime=_startTripTime.atZone(ZoneId.systemDefault()).toEpochSecond()*1000L; + /** + * Get the vehicle assosiated to the tripId. + * Is it possible to have more than 1 bus with the same tripId?? + */ + Collection ipcVehicleCompletList = VehicleDataCache.getInstance().getVehiclesIncludingSchedBasedOnes(); + VehicleState vehicleState=null; + for(IpcVehicleComplete _ipcVehicle:ipcVehicleCompletList) { - ipcVehicle=_ipcVehicle; - break; + + + if(_ipcVehicle.getTripId()!=null && _ipcVehicle.getTripId().compareTo(tripId)==0) + { + VehicleState _vehicleState = VehicleStateManager.getInstance() + .getVehicleState(_ipcVehicle.getId()); + boolean noSchedule=_vehicleState.getTrip().isNoSchedule(); + if(!noSchedule) + { + vehicleState=_vehicleState; + break; + } + else if(noSchedule && _ipcVehicle.getTripStartEpochTime()==startTripTime) + { + vehicleState=_vehicleState; + break; + } + + } } - } - if(ipcVehicle==null) + return vehicleState; + } + @Override + public String cancelTrip(String tripId, LocalDateTime startTripTime) { + + //String vehicleId= "block_" + blockId + "_schedBasedVehicle"; + VehicleState vehicleState=this.getVehicleStateForTrip(tripId, startTripTime); + if(vehicleState==null) return "TripId id is not currently available"; - VehicleState vehicleState = VehicleStateManager.getInstance() - .getVehicleState(ipcVehicle.getId()); + AvlReport avlReport=vehicleState.getAvlReport(); - if(avlReport!=null) { vehicleState.setCanceled(true); @@ -168,37 +190,18 @@ public String cancelTrip(String tripId) { return null; } else - return "TripId id is not currently available"; + return "vehicle with this trip id does not have avl report"; } @Override - public String reenableTrip(String tripId) { - /* - * VehicleId is virtual and is constructed by "block_" + block.getId() + "_schedBasedVehicle"; - */ - //String vehicleId= "block_" + blockId + "_schedBasedVehicle"; + public String reenableTrip(String tripId, LocalDateTime startTripTime) { - /** - * Get the vehicle assosiated to the tripId. - * Is it possible to have more than 1 bus with the same tripId?? - */ - Collection ipcVehicleCompletList = VehicleDataCache.getInstance().getVehiclesIncludingSchedBasedOnes(); - IpcVehicleComplete ipcVehicle=null; - for(IpcVehicleComplete _ipcVehicle:ipcVehicleCompletList) - { - if(_ipcVehicle.getTripId()!=null && _ipcVehicle.getTripId().compareTo(tripId)==0) - { - ipcVehicle=_ipcVehicle; - break; - } - } - if(ipcVehicle==null) + //String vehicleId= "block_" + blockId + "_schedBasedVehicle"; + VehicleState vehicleState=this.getVehicleStateForTrip(tripId, startTripTime); + if(vehicleState==null) return "TripId id is not currently available"; - VehicleState vehicleState = VehicleStateManager.getInstance() - .getVehicleState(ipcVehicle.getId()); AvlReport avlReport=vehicleState.getAvlReport(); - if(avlReport!=null) { vehicleState.setCanceled(false); @@ -207,9 +210,7 @@ public String reenableTrip(String tripId) { return null; } else - return "TripId id is not currently available"; - - + return "vehicle with this trip id does not have avl report"; } } diff --git a/transitclockApi/src/main/java/org/transitclock/api/gtfsRealtime/GtfsRtVehicleFeed.java b/transitclockApi/src/main/java/org/transitclock/api/gtfsRealtime/GtfsRtVehicleFeed.java index 1dfa6aac6..49743930f 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/gtfsRealtime/GtfsRtVehicleFeed.java +++ b/transitclockApi/src/main/java/org/transitclock/api/gtfsRealtime/GtfsRtVehicleFeed.java @@ -36,6 +36,7 @@ import com.google.transit.realtime.GtfsRealtime.FeedMessage; import com.google.transit.realtime.GtfsRealtime.Position; import com.google.transit.realtime.GtfsRealtime.TripDescriptor; +import com.google.transit.realtime.GtfsRealtime.TripDescriptor.ScheduleRelationship; import com.google.transit.realtime.GtfsRealtime.VehicleDescriptor; import com.google.transit.realtime.GtfsRealtime.VehiclePosition; import com.google.transit.realtime.GtfsRealtime.FeedHeader.Incrementality; @@ -93,7 +94,10 @@ private VehiclePosition createVehiclePosition( TripDescriptor.newBuilder() .setRouteId(vehicleData.getRouteId()) .setTripId(vehicleData.getTripId()) + .setStartDate(tripStartDateStr); + if(vehicleData.isCanceled()) + tripDescriptor.setScheduleRelationship(ScheduleRelationship.CANCELED); if(vehicleData.getFreqStartTime()>0) { String tripStartTimeStr=gtfsRealtimeTimeFormatter.format(new Date(vehicleData.getFreqStartTime())); diff --git a/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java b/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java index 6481076aa..232504a6f 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java +++ b/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java @@ -21,6 +21,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.rmi.RemoteException; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -344,11 +345,11 @@ public Response pushAvlData( ,tags= {"command","trip"}) public Response cancelTrip(@BeanParam StandardParameters stdParameters, - @Parameter(description="tripId to be marked as canceled.",required=true)@PathParam("tripId") String tripId) + @Parameter(description="tripId to be marked as canceled.",required=true)@PathParam("tripId") String tripId, + @Parameter(description="start trip time",required=false) @QueryParam( value="at") DateTimeParam at + ) { stdParameters.validate(); - String agencyId = stdParameters.getAgencyId(); - System.out.println(agencyId); String result=null; try { @@ -358,12 +359,14 @@ public Response cancelTrip(@BeanParam StandardParameters stdParameters, IpcTrip ipcTrip = cofingInterface.getTrip(tripId); if(ipcTrip==null) throw WebUtils.badRequestException("TripId=" + tripId + " does not exist."); - result=inter.cancelTrip(tripId); + System.out.println("AT "+at); + result=inter.cancelTrip(tripId,at==null?null:at.getDate()); } catch (RemoteException e) { e.printStackTrace(); throw WebUtils.badRequestException("Could not send request to Core server. "+e.getMessage()); } + if(result==null) return stdParameters.createResponse(new ApiCommandAck(true,"Processed")); else @@ -376,13 +379,12 @@ public Response cancelTrip(@BeanParam StandardParameters stdParameters, @Operation(summary="Cancel a trip in order to be shown in GTFS realtime.", description="Experimental. It will work olny with the correct version. It cancel a trip that has no vechilce assigned." ,tags= {"command","trip"}) - + public Response reenableTrip(@BeanParam StandardParameters stdParameters, - @Parameter(description="tripId to remove calceled satate.",required=true)@PathParam("tripId") String tripId) + @Parameter(description="tripId to remove calceled satate.",required=true)@PathParam("tripId") String tripId, + @Parameter(description="start trip time",required=false) @QueryParam( value="at") DateTimeParam at) { stdParameters.validate(); - String agencyId = stdParameters.getAgencyId(); - System.out.println(agencyId); String result=null; try { @@ -392,8 +394,8 @@ public Response reenableTrip(@BeanParam StandardParameters stdParameters, IpcTrip ipcTrip = cofingInterface.getTrip(tripId); if(ipcTrip==null) throw WebUtils.badRequestException("TripId=" + tripId + " does not exist."); - result=inter.reenableTrip(tripId); - } + result=inter.reenableTrip(tripId,at==null?null:at.getDate()); + } catch (RemoteException e) { e.printStackTrace(); throw WebUtils.badRequestException("Could not send request to Core server. "+e.getMessage()); diff --git a/transitclockApi/src/main/java/org/transitclock/api/rootResources/DateTimeParam.java b/transitclockApi/src/main/java/org/transitclock/api/rootResources/DateTimeParam.java new file mode 100644 index 000000000..b8b26a66f --- /dev/null +++ b/transitclockApi/src/main/java/org/transitclock/api/rootResources/DateTimeParam.java @@ -0,0 +1,46 @@ +package org.transitclock.api.rootResources; + +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; + +import javax.ws.rs.WebApplicationException; + + + +public class DateTimeParam { + + private static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); + + private LocalDateTime date; + + public DateTimeParam(String in) throws WebApplicationException { + try { + date=LocalDateTime.parse(in,DateTimeFormatter.ISO_LOCAL_DATE_TIME); + + } + catch (Exception exception) { + throw new WebApplicationException(400); + } + } + public LocalDateTime getDate() { + return date; + } + public long getTimeStamp() { + return date.toEpochSecond(ZoneOffset.UTC)*1000L; + } + public String format() { + return date.toString(); + } + public static void main(String[] args) { + + + DateTimeParam date=new DateTimeParam("2018-02-02T18:02:00"); + LocalDateTime now = date.getDate(); // 2015-11-19T19:42:19.224 + + + + System.out.println(now+ " "+date.getTimeStamp()+ " "+format.format(now.toEpochSecond(ZoneOffset.UTC)*1000L)); + } + } \ No newline at end of file From 73fd451307f5ec6cca7e01810b9b573dfc780ab8 Mon Sep 17 00:00:00 2001 From: vperez Date: Tue, 21 Aug 2018 21:28:27 -0300 Subject: [PATCH 77/81] Remove error in IpcVehicleGtfsRealtime --- .../java/org/transitclock/ipc/data/IpcVehicleGtfsRealtime.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleGtfsRealtime.java b/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleGtfsRealtime.java index 822ad901e..e6765a818 100644 --- a/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleGtfsRealtime.java +++ b/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleGtfsRealtime.java @@ -266,7 +266,7 @@ private Object readResolve() { layoverDepartureTime, nextStopId, nextStopName, vehicleType, tripStartEpochTime, atStop, atOrNextStopId, - atOrNextGtfsStopSeq, freqStartTime, holdingTime, predictedLongitude, predictedLatitude,isCanceled,isTripUnscheduled); + atOrNextGtfsStopSeq, freqStartTime, holdingTime, predictedLongitude, predictedLatitude,isCanceled); } From d9fe20d0a2a14e450b325ac485c472eaabb3caf0 Mon Sep 17 00:00:00 2001 From: vperez Date: Tue, 21 Aug 2018 23:01:52 -0300 Subject: [PATCH 78/81] Remove system.out --- .../java/org/transitclock/api/rootResources/CommandsApi.java | 1 - 1 file changed, 1 deletion(-) diff --git a/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java b/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java index 232504a6f..138ef9561 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java +++ b/transitclockApi/src/main/java/org/transitclock/api/rootResources/CommandsApi.java @@ -359,7 +359,6 @@ public Response cancelTrip(@BeanParam StandardParameters stdParameters, IpcTrip ipcTrip = cofingInterface.getTrip(tripId); if(ipcTrip==null) throw WebUtils.badRequestException("TripId=" + tripId + " does not exist."); - System.out.println("AT "+at); result=inter.cancelTrip(tripId,at==null?null:at.getDate()); } catch (RemoteException e) { From 351caa2904038718348d8362970db5a8d30368f6 Mon Sep 17 00:00:00 2001 From: scrudden Date: Wed, 22 Aug 2018 14:10:01 +0100 Subject: [PATCH 79/81] Tighten up on values allowed into dwell rls model. Also change name of config values to something more sensible. --- .../dataCache/jcs/DwellTimeModelCache.java | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/transitclock/src/main/java/org/transitclock/core/dataCache/jcs/DwellTimeModelCache.java b/transitclock/src/main/java/org/transitclock/core/dataCache/jcs/DwellTimeModelCache.java index 964f7947f..470cb65c9 100644 --- a/transitclock/src/main/java/org/transitclock/core/dataCache/jcs/DwellTimeModelCache.java +++ b/transitclock/src/main/java/org/transitclock/core/dataCache/jcs/DwellTimeModelCache.java @@ -1,5 +1,7 @@ package org.transitclock.core.dataCache.jcs; +import java.util.Calendar; +import java.util.Date; import java.util.List; import java.util.concurrent.TimeUnit; @@ -33,13 +35,13 @@ public class DwellTimeModelCache implements org.transitclock.core.dataCache.Dwel final private static String cacheName = "DwellTimeModelCache"; - private static LongConfigValue maxDwellTimeAllowedInModel = new LongConfigValue("org.transitclock.core.dataCache.jcs.maxDwellTimeAllowedInModel", (long) (2 * Time.MS_PER_MIN), "Max dwell time to be considered in dwell RLS algotithm."); - private static LongConfigValue minDwellTimeAllowedInModel = new LongConfigValue("org.transitclock.core.dataCache.jcs.minDwellTimeAllowedInModel", (long) 1000, "Min dwell time to be considered in dwell RLS algotithm."); - private static LongConfigValue maxHeadwayAllowedInModel = new LongConfigValue("org.transitclock.core.dataCache.jcs.maxHeadwayAllowedInModel", 1*Time.MS_PER_HOUR, "Max headway to be considered in dwell RLS algotithm."); - private static LongConfigValue minHeadwayAllowedInModel = new LongConfigValue("org.transitclock.core.dataCache.jcs.minHeadwayAllowedInModel", (long) 1000, "Min headway to be considered in dwell RLS algotithm."); + private static LongConfigValue maxDwellTimeAllowedInModel = new LongConfigValue("transitclock.prediction.rls.maxDwellTimeAllowedInModel", (long) (2 * Time.MS_PER_MIN), "Max dwell time to be considered in dwell RLS algotithm."); + private static LongConfigValue minDwellTimeAllowedInModel = new LongConfigValue("transitclock.prediction.rls.minDwellTimeAllowedInModel", (long) 1000, "Min dwell time to be considered in dwell RLS algotithm."); + private static LongConfigValue maxHeadwayAllowedInModel = new LongConfigValue("transitclock.prediction.rls.maxHeadwayAllowedInModel", 1*Time.MS_PER_HOUR, "Max headway to be considered in dwell RLS algotithm."); + private static LongConfigValue minHeadwayAllowedInModel = new LongConfigValue("transitclock.prediction.rls.minHeadwayAllowedInModel", (long) 1000, "Min headway to be considered in dwell RLS algotithm."); - private static DoubleConfigValue lambda = new DoubleConfigValue("org.transitclock.core.dataCache.jcs.lambda", 0.5, "This sets the rate at which the RLS algorithm forgets old values. Value are between 0 and 1. With 0 being the most forgetful."); + private static DoubleConfigValue lambda = new DoubleConfigValue("transitclock.prediction.rls.lambda", 0.5, "This sets the rate at which the RLS algorithm forgets old values. Value are between 0 and 1. With 0 being the most forgetful."); private CacheAccess cache = null; @@ -151,8 +153,8 @@ private ArrivalDeparture findPreviousArrival(List stopData, Ar if(!event.getTripId().equals(arrival.getTripId())) { if(event.getStopId().equals(arrival.getStopId())) - { - if(event.getTime() stopData, Ar return null; } + private boolean sameDay(Long date1, Long date2) + { + Calendar cal1 = Calendar.getInstance(); + Calendar cal2 = Calendar.getInstance(); + cal1.setTime(new Date(date1)); + cal2.setTime(new Date(date2)); + boolean sameDay = cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && + cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR); + + return sameDay; + } private ArrivalDeparture findArrival(List stopData, ArrivalDeparture departure) { for(ArrivalDeparture event:stopData) From 565da79c60f4d9e4aed25dec9e391c08484b3611 Mon Sep 17 00:00:00 2001 From: vperez Date: Sun, 26 Aug 2018 23:01:12 -0300 Subject: [PATCH 80/81] Improvements in visualization - Change of icons. - Corrections in ccs and popup arrows placement --- .../api/data/ApiVehicleDetails.java | 4 + .../src/main/webapp/synoptic/css/synoptic.css | 93 +++++++++++++++--- .../src/main/webapp/synoptic/index.jsp | 30 +++--- .../webapp/synoptic/javascript/synoptic.js | 76 ++++++++++---- .../src/main/webapp/synoptic/mybus.png | Bin 0 -> 1078 bytes 5 files changed, 153 insertions(+), 50 deletions(-) create mode 100644 transitclockWebapp/src/main/webapp/synoptic/mybus.png diff --git a/transitclockApi/src/main/java/org/transitclock/api/data/ApiVehicleDetails.java b/transitclockApi/src/main/java/org/transitclock/api/data/ApiVehicleDetails.java index f565b3640..0b21b7061 100644 --- a/transitclockApi/src/main/java/org/transitclock/api/data/ApiVehicleDetails.java +++ b/transitclockApi/src/main/java/org/transitclock/api/data/ApiVehicleDetails.java @@ -106,6 +106,9 @@ public class ApiVehicleDetails extends ApiVehicleAbstract { @XmlAttribute private double distanceAlongTrip; + @XmlAttribute + private String licensePlate; + /** * Need a no-arg constructor for Jersey. Otherwise get really obtuse * "MessageBodyWriter not found for media type=application/json" exception. @@ -152,6 +155,7 @@ public ApiVehicleDetails(IpcVehicle vehicle, Time timeForAgency, UiMode... uiTyp vehicle.getNextStopName() != null ? vehicle.getNextStopName() : null; driverId = vehicle.getAvl().getDriverId(); + licensePlate=vehicle.getLicensePlate(); if(vehicle instanceof IpcVehicleComplete ) distanceAlongTrip=((IpcVehicleComplete)vehicle).getDistanceAlongTrip(); isScheduledService = vehicle.getFreqStartTime() > 0 ? false : true; diff --git a/transitclockWebapp/src/main/webapp/synoptic/css/synoptic.css b/transitclockWebapp/src/main/webapp/synoptic/css/synoptic.css index 3f4d895de..50b060c5b 100644 --- a/transitclockWebapp/src/main/webapp/synoptic/css/synoptic.css +++ b/transitclockWebapp/src/main/webapp/synoptic/css/synoptic.css @@ -1,7 +1,8 @@ .tooltip-left{ visibility: hidden; - width: 120px; + min-width: 180px; + max-width: 300px; background-color: #555; color: #fff; text-align: center; @@ -25,7 +26,37 @@ .tooltip-bottom{ visibility: hidden; - width: 120px; + min-width: 180px; + max-width: 300px; + background-color: #555; + color: #fff; + text-align: center; + border-radius: 6px; + padding: 5px 0; + position: relative; + opacity: 0; + transition: opacity 0.5s; + +} + +.tooltip-bottom-overflow-left{ + visibility: hidden; + min-width: 180px; + max-width: 300px; + background-color: #555; + color: #fff; + text-align: center; + border-radius: 6px; + padding: 5px 0; + position: relative; + opacity: 0; + transition: opacity 0.5s; + +} +.tooltip-bottom-overflow-right{ + visibility: hidden; + min-width: 180px; + max-width: 300px; background-color: #555; color: #fff; text-align: center; @@ -47,9 +78,32 @@ border-color: transparent transparent #555 transparent; } +.tooltip-bottom-overflow-right::after{ + content: ""; + position: absolute; + left: 90%; + bottom: 100%; /* To the left of the tooltip */ + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: transparent transparent #555 transparent; +} + + +.tooltip-bottom-overflow-left::after{ + content: ""; + position: absolute; + left: 10%; + bottom: 100%; /* To the left of the tooltip */ + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: transparent transparent #555 transparent; +} .tooltip-right{ visibility: visible; - width: 120px; + min-width: 180px; + max-width: 300px; background-color: #555; color: #fff; text-align: center; @@ -75,38 +129,45 @@ .tooltip-right .table{ - width: 120px; + text-align: left; + width: 100%; background-color: #555; color: #fff; - text-align: center; - font-size:8px; + font-size:10px; + padding-left:3px; + padding-right:3px; margin: 0 auto; } .tooltipTable { - width: 120px; + text-align: left; + width: 100%; background-color: #555; color: #fff; - text-align: center; - font-size:8px; + font-size:10px; + padding-left:3px; + padding-right:3px; margin: 0 auto; } .tooltip-left .table{ - width: 120px; + text-align: left; + width: 100%; background-color: #555; color: #fff; - text-align: center; - font-size:8px; + font-size:10px; + padding-left:3px; + padding-right:3px; margin: 0 auto; } .tooltip-bottom .table{ - width: 120px; + text-align: left; + width: 100%; background-color: #555; color: #fff; - text-align: center; font-size:8px; + margin: 0 auto; } .synopticTitle @@ -123,7 +184,7 @@ .menu { visibility: visible; - width: 120px; + width: 180px; background-color: #555; color: #fff; text-align: center; @@ -134,7 +195,7 @@ .menu-content { visibility: visible; - width: 120px; + width: 180px; position: absolute; background-color: #555; diff --git a/transitclockWebapp/src/main/webapp/synoptic/index.jsp b/transitclockWebapp/src/main/webapp/synoptic/index.jsp index f37d46f1b..ab7a059f2 100644 --- a/transitclockWebapp/src/main/webapp/synoptic/index.jsp +++ b/transitclockWebapp/src/main/webapp/synoptic/index.jsp @@ -132,7 +132,7 @@ function predictionCallback(preds, status) { var stopName = routeStopPreds.stopName; if (routeStopPreds.stopCode) stopName += " (" + routeStopPreds.stopCode + ")"; - var content = '
").attr("class", "popupTableLabel").text(labels[i] + ": "); + var value = $("").text(avl[keys[i]]); + content.append( $("
").attr("class", "popupTableLabel").text(labels[i] + ": "); + var value = $("").text(stop[keys[i]]); + content.append( $("
' + var content = '
Route: ' + routeStopPreds.routeName + '
' + ''; //if (verbose) // content += 'Stop Id: ' + routeStopPreds.stopId + '
'; @@ -149,21 +149,27 @@ function predictionCallback(preds, status) { content += ''; content +='
Stop: ' + stopName + '
Destination: ' + routeStopPreds.dest[i].headsign + '
'; // Add each prediction for the current destination + if (routeStopPreds.dest[i].pred.length > 0) { - content += ''; - + content += ''; + content += ''; + content += ''; + content += ''; for (var j in routeStopPreds.dest[i].pred) { // Separators between the predictions - if (j == 1) - content += ', '; - else if (j ==2) - content += ' & ' + // Add the actual prediction var pred = routeStopPreds.dest[i].pred[j]; - content += pred.min; + content+= '"; + var ident=test.getVehicleIdentifier(pred.vehicle ); + if(ident==null) + ident=pred.vehicle; + content+= '"; + content+= '"; + - // Added any special indicators for if schedule based, + // Added any special indipredcators for if schedule based, // delayed, or not yet departed from terminal /* if (pred.scheduleBased) @@ -178,11 +184,9 @@ function predictionCallback(preds, status) { */ // If in verbose mode add vehicle info //if (verbose) - content += ' (vehicle ' + pred.vehicle + ')'; } - content += ' minutes'; - content += ''; + content += '
tripVehicleMinutes
'+ pred.trip + "'+ ident + "'+ pred.min + "
'; } else { // There are no predictions so let user know @@ -213,7 +217,7 @@ function vehicleUpdate(vehicleDetail, status) console.log(vehicle); var directionVehicle=(vehicle.direction=="0")?0:1; var gpsTimeStr = dateFormat(vehicle.loc.time); - buses.push({id:vehicle.id, projection:vehicle.distanceAlongTrip/getShapeLength(vehicle.tripPattern),identifier:vehicle.id,direction:directionVehicle,gpsTimeStr:gpsTimeStr,nextStopName:vehicle.nextStopName,schAdh:vehicle.schAdhStr,trip:vehicle.trip}); + buses.push({id:vehicle.id, projection:vehicle.distanceAlongTrip/getShapeLength(vehicle.tripPattern),identifier:vehicle.licensePlate,direction:directionVehicle,gpsTimeStr:gpsTimeStr,nextStopName:vehicle.nextStopName,schAdh:vehicle.schAdhStr,trip:vehicle.trip}); } test.setBuses(buses); test.steps=100; diff --git a/transitclockWebapp/src/main/webapp/synoptic/javascript/synoptic.js b/transitclockWebapp/src/main/webapp/synoptic/javascript/synoptic.js index 0fba76845..c02f3c589 100644 --- a/transitclockWebapp/src/main/webapp/synoptic/javascript/synoptic.js +++ b/transitclockWebapp/src/main/webapp/synoptic/javascript/synoptic.js @@ -59,7 +59,10 @@ class Sinoptico this.zoomFactor=1.0; // if(params.drawReturnUpside!=undefined) // this.drawReturnUpside=params.drawReturnUpside; - + this.stopImg = new Image(); + this.stopImg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEwAACxMBAJqcGAAAAPVJREFUOI2Vkl1qwlAQhT/z1GQpNYRQ29XUJYkiqOiDS7GldBENFUSx\ne2jjy/XhnluHGPJzYEgyOTNz5gfu8QRsgD1wkX0DayCv4f8jAbaAa7ENENcFf4rwC0yk5EE2AqbA\nnzgf1SSh8gl4bFCZAmdx17bnULkp2CYpFZOjnpxkd8VMMSvw03ZSYlEdnsWzfAX4NTn8sLomSOQr\nox6yaxEBR70Pe8QF7iEC3vTxWiENKmYx1nMHfhUOfyRph+oZtzVmwRlWeW5JkgE/4i7tjxh/nkHJ\nDL+qRPYCzE3ld+63RmyUNNmyLtgix19YoYol8AUsbM8BV0fAV591YB1RAAAAAElFTkSuQmCC\n'; + this.stopImg.width=10; + this.stopImg.height=10; //this.canvas=canvas; @@ -90,10 +93,10 @@ class Sinoptico // this.vehicleIcon.addEventListener('load', function() { // // execute drawImage statements here // }, false); - this.vehicleIcon.src="bus_verde_negro.png"; + this.vehicleIcon.src="mybus.png"; - this.vehicleIcon.width=25; - this.vehicleIcon.height=25; + this.vehicleIcon.width=30; + this.vehicleIcon.height=30; this.linewidth=0.9;//Porcentaje que ocupa del canvas // var lineWidth=(canvas.width*linewidth); @@ -118,8 +121,9 @@ class Sinoptico if(params.predictionFunction!=undefined) this.predictionFunction=params.predictionFunction; // this.menu=menu; - this.busDistanceToLine=3; + this.busDistanceToLine=7; this.textSeparation=6; + this.__mouseWheelHandler = this.__mouseWheelHandler.bind(this); } init() @@ -132,7 +136,19 @@ class Sinoptico this.canvas.addEventListener('wheel',this.__mouseWheelHandler); this.resize(); } - + getVehicleIdentifier(id) + { + if(this.buses!=undefined) + for(var m=0;mwindow.innerWidth) + else if(left+this.toolTipDiv.clientWidth>window.innerWidth+leftScroll) { - - left=window.innerWidth-this.toolTipDiv.clientWidth; + //alert(this.container.scrollLeft); + this.toolTipDiv.className="tooltip-bottom-overflow-right"; + //left+=this.toolTipDiv.clientWidth*0.45; + left-=this.toolTipDiv.clientWidth*0.40; } } @@ -280,7 +309,7 @@ class Sinoptico // } // } - this.toolTipDiv.className="tooltip-bottom"; + //menu = window.getComputedStyle ? getComputedStyle(this.tootTipDiv, null) : this.tootTipDiv.currentStyle; const tooltip=this.toolTipDiv; //const tooltip=document.getElementById("myToolTip"); @@ -604,11 +633,11 @@ class Sinoptico this.ctx.font="10px Georgia"; var metrics=this.ctx.measureText("anyText"); metrics.height=parseInt(this.ctx.font.match(/\d+/), 10); - this.ctx.clearRect(0, this.forwarLinePosition-this.vehicleIcon.height-metrics.height-this.textSeparation-1, this.canvas.width, this.vehicleIcon.height+metrics.height+this.textSeparation-2);//Tenemos que tener el cuadrado de los buses. + this.ctx.clearRect(0, this.forwarLinePosition-(this.vehicleIcon.height+metrics.height+this.textSeparation+this.busDistanceToLine+1), this.canvas.width, (this.vehicleIcon.height+metrics.height+this.textSeparation));//Tenemos que tener el cuadrado de los buses. if(this.drawReturnUpside==true) - this.ctx.clearRect( 0,this.returnLinePosition-this.vehicleIcon.height-metrics.height-this.textSeparation-1, this.canvas.width, this.vehicleIcon.height+metrics.height+this.textSeparation-2);//Tenemos que tener el cuadrado de los buses. + this.ctx.clearRect( 0,this.returnLinePosition-(this.vehicleIcon.height+metrics.height+this.textSeparation+this.busDistanceToLine+1), this.canvas.width,(this.vehicleIcon.height+metrics.height+this.textSeparation));//Tenemos que tener el cuadrado de los buses. else - this.ctx.clearRect( 0,this.returnLinePosition+this.busDistanceToLine, this.canvas.width, this.vehicleIcon.height+metrics.height+this.textSeparation+3);//Tenemos que tener el cuadrado de los buses. + this.ctx.clearRect( 0,this.returnLinePosition+this.busDistanceToLine, this.canvas.width, (this.vehicleIcon.height+metrics.height+this.textSeparation));//Tenemos que tener el cuadrado de los buses. for(var pos=0;posWFU8GbZ8()Nlj2>E@cM*00WvyL_t(Y$IX^qXp?6Y z$N$gsex!ZVSUZy#kx?d*O@^!&mN4iXE9hiH8Acj#f<>>imJW&#P}xvd21>2yU8po- zhi$BEltQ-&gHaXhz>Bcz$c2F-DO4(&kG@~c*+pt-mN#jd+RX#+#ryE*{5a1!=Q)RA z(TJ$;_HVbl!as!}iXz^mnWl-uUmeE&UHdOH#=ZdnaS?j;_}Swf!{ft{LWMLm;9RK^bGXF?Iuw04Gq8gHv9U4C&CQhs zJDtuv*vdym;H5@Hh(@ERRLdA!R%Z!L&!?g4xocfmSis=mAZlxCD*_vafj}StK@e63 zR&^B*hackBueSgI)6>%k27|FgBC)m7!fI`8g~#Io03`lMVAIY`#qDO5+w^=Iny%#p zoI?-U2q z9A+|^f`6;RD%no5B6G!4DIy#zoV7#L7i1)iLo6zq08TMh~UHk%ExSS({0hP3L4o12^EmE_Lr z_1agJW6n9Wd2MwS#Hs)*H44sLIg_6_m24qPbtiu~i8`gO>{W9s0p}dy(J(IbUjY4` zb0&W%L$X$i?kjw-XT^9J)00qrcOShWdu0D?j$_G1z50xKz6B z1xY~HcU{m)FWR#J;Kj=q7`ZZnrVpA9GRBB4$cU%;2OePpBS wKVK&zy1M2A{B=aCuHKuSo1G`3-PQQ{2NK(8u2~O>IRF3v07*qoM6N<$f|Ud8h5!Hn literal 0 HcmV?d00001 From a9935d576eafecb385bda8025354ead806a14763 Mon Sep 17 00:00:00 2001 From: vperez Date: Tue, 28 Aug 2018 20:58:18 -0300 Subject: [PATCH 81/81] Start to add headway information to API --- .../org/transitclock/ipc/data/IpcVehicleComplete.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleComplete.java b/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleComplete.java index cdd33990d..2477d8ca3 100644 --- a/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleComplete.java +++ b/transitclock/src/main/java/org/transitclock/ipc/data/IpcVehicleComplete.java @@ -51,6 +51,8 @@ public class IpcVehicleComplete extends IpcVehicleGtfsRealtime { private final double distanceToNextStop; private final double distanceOfNextStopFromTripStart; private final double distanceAlongTrip; + private double headway; + private String headwayVehicleId; private static final long serialVersionUID = 8154105842499551461L; @@ -87,7 +89,12 @@ public IpcVehicleComplete(VehicleState vs) { } this.distanceOfNextStopFromTripStart = sumOfStopPathLengths; this.distanceAlongTrip = - sumOfStopPathLengths - this.distanceToNextStop; + sumOfStopPathLengths - this.distanceToNextStop; + if(vs.getHeadway()!=null) + { + this.headway=vs.getHeadway().getHeadway(); + this.headwayVehicleId=vs.getHeadway().getOtherVehicleId(); + } } else { // Vehicle not assigned to trip so null out parameters this.originStopId = null;