@targomo/core
Advanced tools
Comparing version 0.4.4 to 0.5.0
@@ -5,3 +5,3 @@ { | ||
"author": "Targomo", | ||
"version": "0.4.4", | ||
"version": "0.5.0", | ||
"license": "MIT", | ||
@@ -60,6 +60,6 @@ "repository": "github:targomo/targomo-js", | ||
"dependencies": { | ||
"@types/geojson": "^7946.0.1", | ||
"isomorphic-fetch": "^2.2.1", | ||
"whatwg-fetch": "^2.0.3", | ||
"@types/geojson": "^7946.0.1" | ||
"whatwg-fetch": "^2.0.3" | ||
} | ||
} |
/** | ||
* @targomo/core "0.4.4" http://targomo.com | ||
* @targomo/core "0.5.0" http://targomo.com | ||
* The JavaScript (& TypeScript) API for Targomo's time-based access mapping services. | ||
* (c) 2021 Targomo | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.tgm={})}(this,function(u){"use strict";!function(t){if(!t.fetch){var e="URLSearchParams"in t,i="Symbol"in t&&"iterator"in Symbol,s="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),r="FormData"in t,n="ArrayBuffer"in t;if(n)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=function(t){return t&&DataView.prototype.isPrototypeOf(t)},l=ArrayBuffer.isView||function(t){return t&&-1<o.indexOf(Object.prototype.toString.call(t))};d.prototype.append=function(t,e){t=h(t),e=p(e);var i=this.map[t];this.map[t]=i?i+","+e:e},d.prototype.delete=function(t){delete this.map[h(t)]},d.prototype.get=function(t){return t=h(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(h(t))},d.prototype.set=function(t,e){this.map[h(t)]=p(e)},d.prototype.forEach=function(t,e){for(var i in this.map)this.map.hasOwnProperty(i)&&t.call(e,this.map[i],i,this)},d.prototype.keys=function(){var i=[];return this.forEach(function(t,e){i.push(e)}),f(i)},d.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),f(e)},d.prototype.entries=function(){var i=[];return this.forEach(function(t,e){i.push([e,t])}),f(i)},i&&(d.prototype[Symbol.iterator]=d.prototype.entries);var c=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];T.prototype.clone=function(){return new T(this,{body:this._bodyInit})},S.call(T.prototype),S.call(U.prototype),U.prototype.clone=function(){return new U(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},U.error=function(){var t=new U(null,{status:0,statusText:""});return t.type="error",t};var u=[301,302,303,307,308];U.redirect=function(t,e){if(-1===u.indexOf(e))throw new RangeError("Invalid status code");return new U(null,{status:e,headers:{location:t}})},t.Headers=d,t.Request=T,t.Response=U,t.fetch=function(i,n){return new Promise(function(r,t){var e=new T(i,n),o=new XMLHttpRequest;o.onload=function(){var t,n,e={status:o.status,statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",n=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var e=t.split(":"),i=e.shift().trim();if(i){var r=e.join(":").trim();n.append(i,r)}}),n)};e.url="responseURL"in o?o.responseURL:e.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;r(new U(i,e))},o.onerror=function(){t(new TypeError("Network request failed"))},o.ontimeout=function(){t(new TypeError("Network request failed"))},o.open(e.method,e.url,!0),"include"===e.credentials?o.withCredentials=!0:"omit"===e.credentials&&(o.withCredentials=!1),"responseType"in o&&s&&(o.responseType="blob"),e.headers.forEach(function(t,e){o.setRequestHeader(e,t)}),o.send(void 0===e._bodyInit?null:e._bodyInit)})},t.fetch.polyfill=!0}function h(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function p(t){return"string"!=typeof t&&(t=String(t)),t}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach(function(t,e){this.append(e,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function g(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function m(i){return new Promise(function(t,e){i.onload=function(){t(i.result)},i.onerror=function(){e(i.error)}})}function y(t){var e=new FileReader,i=m(e);return e.readAsArrayBuffer(t),i}function v(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function S(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t)if("string"==typeof t)this._bodyText=t;else if(s&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(r&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(e&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(n&&s&&a(t))this._bodyArrayBuffer=v(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!n||!ArrayBuffer.prototype.isPrototypeOf(t)&&!l(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=v(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var t=g(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var t,e,i,r=g(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,i=m(e),e.readAsText(t),i;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),i=new Array(e.length),r=0;r<e.length;r++)i[r]=String.fromCharCode(e[r]);return i.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}function T(t,e){var i,r,n=(e=e||{}).body;if(t instanceof T){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new d(e.headers)),this.method=(i=e.method||this.method||"GET",r=i.toUpperCase(),-1<c.indexOf(r)?r:i),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function b(t){var n=new FormData;return t.trim().split("&").forEach(function(t){if(t){var e=t.split("="),i=e.shift().replace(/\+/g," "),r=e.join("=").replace(/\+/g," ");n.append(decodeURIComponent(i),decodeURIComponent(r))}}),n}function U(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}}("undefined"!=typeof self?self:window);var r=function(t){this.serverUrl="https://api.targomo.com/",this.statisticsUrl="https://api.targomo.com/statistics/",this.tilesUrl="https://api.targomo.com/vector-statistics/",this.poiUrl="https://api.targomo.com/pointofinterest/",this.mapTilesUrl="https://maps.targomo.com/",this.photonGeocoderUrl="https://api.targomo.com/geocode/",this.overpassUrl="https://api.targomo.com/overpass/",this.fleetsUrl="https://api.targomo.com/fleetplanner/",this.basemapsUrl="https://maps.targomo.com/styles/",this.version=1,this.debug=!1,Object.assign(this,t)},n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function i(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var o=function(){return(o=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function h(o,s,a,l){return new(a||(a=Promise))(function(t,e){function i(t){try{n(l.next(t))}catch(t){e(t)}}function r(t){try{n(l.throw(t))}catch(t){e(t)}}function n(e){e.done?t(e.value):new a(function(t){t(e.value)}).then(i,r)}n((l=l.apply(o,s||[])).next())})}function v(i,r){var n,o,s,t,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,o=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=r.call(i,a)}catch(t){e=[6,t],o=0}finally{n=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var t,l=function(t,e,i,r){this.value=t,this.key=e,this.previous=i,this.next=r},e=function(){function t(t){void 0===t&&(t=0),this.capacity=t,this.map={},this.size=0}return t.prototype.get=function(s,a){return h(this,void 0,void 0,function(){var e,i,r,n,o;return v(this,function(t){switch(t.label){case 0:if(void 0===(e=this.map[s]))return[3,5];this.oldest==e&&e.next&&(this.oldest=e.next),e.next&&(e.next.previous=e.previous),e.previous&&(e.previous.next=e.next),e.previous=this.newest,e.next=null,this.newest=e,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.value];case 2:return[2,t.sent()];case 3:return t.sent(),this.map[s]=void 0,[2,this.get(s,a)];case 4:return[3,8];case 5:return a?(i=a(),r=this.map[s]=new l(i,s,this.newest,null),[4,i]):[3,7];case 6:return n=t.sent(),this.newest&&(this.newest.next=r),this.newest=r,this.capacity&&(this.size>=this.capacity?(o=this.oldest)&&(this.oldest=o.next,delete this.map[o.key]):this.size++),this.oldest||(this.oldest=this.newest),[2,n];case 7:return[2,void 0];case 8:return[2]}})})},t}(),s=function(){function t(){this.map={}}return t.prototype.get=function(r,n){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e="string"==typeof r?r:JSON.stringify(r),null==this.map[e]?[3,1]:[2,this.map[e]];case 1:return[4,n()];case 2:return i=t.sent(),[2,this.map[e]=i]}})})},t}(),S="x-targomo-environment";(t=u.TargomoEnvironment||(u.TargomoEnvironment={})).REVIEW="review",t.STAGING="staging",t.PROD="";var a=new s;function T(t){t instanceof String||"string"==typeof t?console.log(t):console.log(JSON.stringify(t,null,2))}var c=function(){function t(t){this.options=t}return t.prototype.fetch=function(d,g,m,y){return void 0===g&&(g="GET"),void 0===y&&(y={}),h(this,void 0,void 0,function(){var e,i,r,n,o,s,a,l,c,u,h,p,f;return v(this,function(t){switch(t.label){case 0:return this.options.environment&&(y[S]=this.options.environment),"JSONP"!==(e=g)?y.Accept=y.Accept?y.Accept:"application/json":e="GET","POST-RAW"===g&&(e="POST"),"PUT"!==e&&"POST"!==e||(y["Content-Type"]="application/json"),i=new Headers(y),r={method:e,headers:i},"POST-RAW"===g?r.body=m:"GET"!==g&&"JSONP"!==g&&(r.body=JSON.stringify(m)),[4,fetch(d,r)];case 1:return n=t.sent(),(this.options&&this.options.debug||400<=n.status)&&(console.log("[TargomoClient Begin]"),console.log("[ENVIRONMENT]"),console.log(this.options.environment),console.log("[Request]",r.method,d),console.log(" [Headers]"),i.forEach(function(t,e){console.log(" "+e+" = "+t)}),r.body&&(console.log(" [Body]"),console.log(r.body)),console.log("[Response]"),console.log(" status = ",n.status),console.log(" statusText = ",n.statusText),console.log(" [Headers]"),n.headers.forEach(function(t,e){console.log(" "+e+" = "+t)})),400<=n.status?(console.log(" [Body]"),"application/json"!==n.headers.get("content-type")?[3,3]:(l=(a=JSON).stringify,[4,n.text()])):[3,6];case 2:return s=l.apply(a,[t.sent(),null,2]),[3,5];case 3:return[4,n.text()];case 4:s=t.sent(),t.label=5;case 5:throw T(o=s),console.log("[TargomoClient End]"),new Error(o);case 6:return c=null,"JSONP"!==g?[3,8]:[4,n.text()];case 7:return u=t.sent(),h=u.indexOf("("),p=u.lastIndexOf(")"),c=-1<h&&-1<p?JSON.parse(u.substring(h+1,p)):JSON.parse(u),[3,11];case 8:return"POST-RAW"!==g?[3,10]:[4,n.text()];case 9:return c=t.sent(),[3,11];case 10:c=n.json(),t.label=11;case 11:return this.options&&this.options.debug?(console.log(" [Body]"),f=T,[4,c]):[3,13];case 12:f.apply(void 0,[t.sent()]),console.log("[TargomoClient End]"),t.label=13;case 13:return[2,c]}})})},t.prototype.fetchData=function(i,r,n,o){return void 0===r&&(r="GET"),h(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return[4,this.fetch(i,r,n,o)];case 1:return(e=t.sent()).data?[2,e.data]:(console.warn("No data object was transmitted by "+i+" \nReturning raw response"),[2,e])}})})},t.prototype.fetchCached=function(t,e,i,r,n){var o=this;if(void 0===i&&(i="GET"),!1===t)return this.fetch(e,i,r,n);!0!==t&&t||(t=a);var s=JSON.stringify({url:e,method:i,payload:r});return t.get(s,function(){return o.fetch(e,i,r,n)})},t.prototype.fetchCachedData=function(t,e,i,r,n){var o=this;if(void 0===i&&(i="GET"),!1===t)return this.fetchData(e,i,r,n);!0!==t&&t||(t=a);var s=JSON.stringify({url:e,method:i,payload:r});return t.get(s,function(){return o.fetchData(e,i,r,n)})},t}();function p(t,e){return new c({debug:t&&t.config&&t.config.debug,environment:t&&t.config&&t.config.environment?t.config.environment:u.TargomoEnvironment.PROD})}var f,d,g=function(){function t(t){this.client=t}return t.prototype.fetch=function(n,o,s){return h(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e={west:s.southWest.lng,south:s.southWest.lat,east:s.northEast.lng,north:s.northEast.lat},i={bounds:e,benchmarks:o.map(function(t){return{source:t.source,minEnd:t.minEnd,minStart:t.minStart,factor:t.factor}})},r=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.tilesUrl).part("benchmarks/scores_cumulative/").version().part("/"+encodeURIComponent(""+n)).key().toString(),[4,p(this.client).fetch(r,"POST",i)];case 1:return[2,t.sent()]}})})},t.prototype.metadata=function(i){return h(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.tilesUrl).part("benchmarks/meta/").version().part("/"+encodeURIComponent(""+i)).key().toString(),[4,p(this.client).fetch(e)];case 1:return[2,t.sent()]}})})},t}();f=u.UrlUtil||(u.UrlUtil={}),d=function(){function t(t){this.client=t,this.url="",this.firstParamPlaced=!1}return t.prototype.host=function(t){return 0===this.url.length&&"/"!==t[t.length-1]&&(t+="/"),this.part(t)},t.prototype.part=function(t){return this.url+=t,this},t.prototype.version=function(){return null!==this.client.config.version&&void 0!==this.client.config.version?this.part("v"+this.client.config.version):"/"===this.url[this.url.length-1]&&(this.url=this.url.substr(0,this.url.length-1)),this},t.prototype.params=function(t){var i=this;return Object.keys(t).forEach(function(e){t[e]instanceof Array?t[e].forEach(function(t){i.param(e,t)}):i.param(e,t[e])}),this},t.prototype.param=function(t,e){void 0!==e&&(this.firstParamPlaced?this.url+="&"+t+"="+e:(this.firstParamPlaced=!0,this.url+="?"+t+"="+e))},t.prototype.key=function(t){var e;return void 0===t&&(t="key"),this.params(((e={})[t]=this.client.serviceKey,e))},t.prototype.toString=function(){return this.url},t}(),f.TargomoUrl=d;var m=function(){function t(){}return t.prototype.geocode=function(n,o,t,s,a){return h(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e={singleLine:n,f:"json",countryCode:s,maxLocations:5},o&&(e.location=o.lng+","+o.lat),a&&(e.magicKey=a),i=(new u.UrlUtil.TargomoUrl).part("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates").params(e).toString(),[4,p().fetch(i)];case 1:return r=t.sent(),[2,r.candidates.map(function(t){return{lat:t.location.y,lng:t.location.x,description:t.address}})]}})})},t.prototype.suggest=function(r,n,t,o,s){return void 0===s&&(s=5),h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e={text:r,f:"json",countryCode:o,maxSuggestions:s},n&&(e.location=n.lng+","+n.lat),i=(new u.UrlUtil.TargomoUrl).part("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest").params(e).toString(),[4,p().fetch(i)];case 1:return[2,t.sent().suggestions]}})})},t.prototype.reverseGeocode=function(n,t){return h(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return(e={f:"json"}).location=n.lng+","+n.lat,i=(new u.UrlUtil.TargomoUrl).part("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode").params(e).toString(),[4,p().fetch(i)];case 1:return(r=t.sent())&&r.address?[2,{address:r.address.Match_addr,city:r.address.City,countryCode:r.address.CountryCode,location:r.address.Loc_name,region:r.address.Region,subregion:r.address.Subregion,zip:r.address.Postal}]:[2,{}]}})})},t}(),y=function(){function t(t){this.client=t}return t.prototype.geocode=function(n,o,s){return h(this,void 0,void 0,function(){var e,i,r=this;return v(this,function(t){switch(t.label){case 0:return e=(new u.UrlUtil.TargomoUrl).host(this.client.config.photonGeocoderUrl).part("api").params({q:encodeURIComponent(n),limit:5}).toString(),o&&(e+="&lat="+o.lat+"&lon="+o.lng),s&&(e+="&lang="+encodeURIComponent(s)),[4,p().fetch(e)];case 1:return(i=t.sent()).features.forEach(function(t,e,i){"boundary"==t.properties.osm_key&&i.splice(e,1)}),[2,i.features.map(function(t){return t.value=t.properties.osm_id,t.description=r.buildPlaceDescription(t.properties),t})]}})})},t.prototype.buildPlaceDescription=function(i){var r=function(t,e){return void 0===e&&(e=" "),t.filter(function(t){return!!t}).join(e).trim()},t=function(t,e){return r(t.map(function(t){return i[t]}),e)},e=t(["street","housenumber"]," "),n=r([t(["postcode","city"]," "),i.country],", "),o={title:"",meta1:"",meta2:"",full:""};return void 0!==i.name?(o.title=i.name,o.meta1=e,o.meta2=n):(o.title=e,o.meta1=n),i.name!==e&&(o.full=o.title),o.meta1&&i.name!==e&&(o.full+=", "+o.meta1),o.meta1&&i.name===e&&(o.full+=o.meta1),o.full=r([o.full,o.meta2],", "),o},t}(),b=function(){},U=function(){this.edgeWeight="time"},w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.transitFrameDuration=void 0,t.transitFrameDate=20170801,t.transitFrameTime=39600,t.transitMaxTransfers=-1,t.transitAvoidTransitRouteTypes=[],t.walkSpeed={},t.bikeSpeed={},t}return i(t,e),t}(U),E=function(o){function t(t){var e=o.call(this)||this;if(Object.assign(e,t),null!=t.transitFrameDateTime){var i=void 0,r=(i=t.transitFrameDateTime instanceof Date?t.transitFrameDateTime:new Date(t.transitFrameDateTime))?1e4*i.getFullYear()+100*(i.getMonth()+1)+i.getDate():void 0,n=i?3600*i.getHours()+60*i.getMinutes():void 0;e.transitFrameDate=r||e.transitFrameDate,e.transitFrameTime=n||e.transitFrameTime}return e}return i(t,o),t.prototype.buildTargetsCfg=function(t){return t.map(function(t){return{lat:t.lat,lng:t.lng,id:t.id}})},t.prototype.buildSourcesCfg=function(t){var i=this;if(t)return t.map(function(t){var e={lat:t.lat,lng:t.lng,id:t.id,tm:t.tm};if(!e.tm)switch(i.travelType){case"car":e.tm={car:i.rushHour?{rushHour:i.rushHour}:{}};break;case"walk":e.tm={walk:i.walkSpeed};break;case"bike":e.tm={bike:i.bikeSpeed};break;case"transit":e.tm={transit:{frame:{date:i.transitFrameDate,time:i.transitFrameTime,duration:i.transitFrameDuration},maxTransfers:i.transitMaxTransfers}}}return e})},t.prototype.buildSourceGeometriesCfg=function(t){var i=this;if(t)return t.map(function(t){var e={data:JSON.stringify(t.geometry),crs:t.crs||4326,id:""+t.id,tm:t.tm};if(!e.tm)switch(i.travelType){case"car":e.tm={car:i.rushHour?{rushHour:i.rushHour}:{}};break;case"walk":e.tm={walk:i.walkSpeed};break;case"bike":e.tm={bike:i.bikeSpeed};break;case"transit":e.tm={transit:{frame:{date:i.transitFrameDate,time:i.transitFrameTime,duration:i.transitFrameDuration},maxTransfers:i.transitMaxTransfers}}}return e})},t}(w),A=function(n){function t(t,e,i){var r=n.call(this,e)||this;return t?r.sources=r.buildSourcesCfg(t):(r.sources=r.buildSourcesCfg(e.sources),r.sourceGeometries=r.buildSourceGeometriesCfg(e.sourceGeometries)),i?r.targets=r.buildTargetsCfg(i):e&&e.targets&&(r.targets=r.buildTargetsCfg(e.targets)),r.multigraph=e.multigraph,r}return i(t,n),t}(E),x=function(){function t(t){this.client=t}return t.prototype.fetch=function(n,o,s){return h(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=o?n:null,o=o||n,i=new u.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/multigraph").key().toString(),r=new A(e,o,s),[4,p(this.client).fetch(i,"POST",r)];case 1:return[2,t.sent()]}})})},t.prototype.fetchOverview=function(n,o,s){return h(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=o?n:null,o=o||n,i=new u.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/multigraph/overview").key().toString(),r=new A(e,o,s),[4,p(this.client).fetch(i,"POST",r)];case 1:return[2,t.sent()]}})})},t.prototype.getTiledMultigraphUrl=function(o,s,a,l){return h(this,void 0,void 0,function(){var e,i,r,n;return v(this,function(t){switch(t.label){case 0:return e=s?o:null,s=s||o,i=new u.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/objectcache/add").key().toString(),r=new A(e,s,l),[4,p(this.client).fetch(i,"POST",r)];case 1:return n=t.sent(),[2,new u.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/multigraph/{z}/{x}/{y}."+(a||o.format||"mvt")).key().params({cfgUuid:n.uuid}).toString()]}})})},t}(),C=function(t,e,i,r){this.description=r.description||"",this.serviceUrl=t,this.serviceKey=e,this.email=r.email||"developers@targomo.com",this.sendMail=!1,this.callbackUrl=r.callbackUrl||"https://localhost/",this.pointsPerSolution=r.pointsPerSolution,this.maxSolutions=r.maxSolutions||1,this.travelType=r.travelType,this.edgeWeight=r.edgeWeight,this.maxEdgeWeight=r.maxEdgeWeight,this.statisticGroupId=r.statisticGroup,r.statistic instanceof Number||"number"==typeof r.statistic?this.statisticId=+r.statistic:this.statisticId=r.statistic.id;var n={};i.forEach(function(t){n[t.id]={id:t.id,x:t.lng,y:t.lat}}),this.sources.push(n)},O=function(t){this.raw=t,this.id=t.id,this.maxPossibleValue=t.maxPossibleValue,this.solutions=t.simulationResults.map(function(t){var e={};return t.sourcePoints.forEach(function(t){e[t.id]=t.optimal}),{id:t.id,startTime:t.startTime,endTime:t.endTime,maxValue:t.maxValue,numberOfDesiredPoints:t.numberOfDesiredPoints,sources:e}})},R=function(){function t(t){this.client=t}return t.prototype.create=function(n,o){return h(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return n.length?(e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("simulation/start/").key("apiKey").params({serviceUrl:encodeURIComponent(this.client.serviceUrl)}).toString(),i=new C(this.client.serviceUrl,this.client.serviceKey,n,o),[4,p(this.client).fetch(e,"POST",i)]):[2,null];case 1:return[2,(r=t.sent())&&+r.id]}})})},t.prototype.ready=function(i){return h(this,void 0,void 0,function(){var e;return v(this,function(t){return i instanceof Array||(i=[i]),e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("simulation/ready/").key("apiKey").params({serviceUrl:encodeURIComponent(this.client.serviceUrl),simulationId:i}).toString(),[2,p(this.client).fetch(e)]})})},t.prototype.fetch=function(r){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("simulation/"+r+"/").key("apiKey").params({serviceUrl:encodeURIComponent(this.client.serviceUrl)}).toString(),i=O.bind,[4,p(this.client).fetch(e)];case 1:return[2,new(i.apply(O,[void 0,t.sent()]))]}})})},t}(),G=function(n){function t(t,e,i){var r=n.call(this,i)||this;return r.osmTypes=[],r.sources=r.buildSourcesCfg(e instanceof Array?e:[e]),r.osmTypes=i.osmTypes,r.format=i.format,r.serviceKey=t.serviceKey,r.serviceUrl=t.serviceUrl,r}return i(t,n),t}(E),I=function(){function i(t,e,i,r){this.id=t,this.lng=e,this.lat=i,this.properties=r,this.properties&&(this.properties["marker-size"]=1)}return i.prototype.toString=function(){return this.properties?this.properties.name:""},i.prototype.copy=function(){var t=new i(this.id,this.lat,this.lng,o({},this.properties));for(var e in this)"properties"!=e&&(t[e]=this[e]);return t},i}();var k=function(){function t(t){this.client=t}return t.prototype.queryGetCustom=function(e){return h(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,p(this.client).fetch(e)];case 1:return[2,t.sent().elements.map(function(t){return i=(e=t).lat,r=e.lon,void 0===i&&e.center&&(i=e.center.lat,r=e.center.lon),new I(e.id,r,i,e.tags);var e,i,r})]}})})},t.prototype.reachable=function(i,r){return h(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=this.client.config.poiUrl+"/reachability",[4,p(this.client).fetch(e,"POST",new G(this.client,i,r))];case 1:return[2,t.sent()]}})})},t.prototype.reachabilitySummary=function(i){return h(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("reachability/summary/"),i&&e.part(i),e.key("apiKey"),[4,p(this.client).fetch(e.toString())];case 1:return[2,t.sent()]}})})},t.prototype.register=function(r){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("register").key(),i={osmTypes:r&&r.osmTypes,serviceKey:this.client.serviceKey,serviceUrl:this.client.serviceUrl,format:r&&r.format},[4,p(this.client).fetch(e.toString(),"POST-RAW",JSON.stringify(i),{Accept:"application/json, text/plain, */*"})];case 1:return[2,t.sent()]}})})},t.prototype.reachabilityRegister=function(r,n){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("reachability/register").key(),i=new G(this.client,r,n),[4,p(this.client).fetch(e.toString(),"POST-RAW",JSON.stringify(i),{Accept:"application/json, text/plain, */*"})];case 1:return[2,t.sent()]}})})},t.prototype.reachabilityTileRoute=function(t,e){return this.tileRouteImpl(t,e,"reachability")},t.prototype.geometryTileRoute=function(t,e){return this.tileRouteImpl(t,e,"geometry")},t.prototype.tileRoute=function(t,e){return this.tileRouteImpl(t,e)},t.prototype.tileRouteImpl=function(t,e,i){var r=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl);return"reachability"!==i&&"geometry"!==i||r.part(i+"/"),t&&r.part(t+"/"),r.part("{z}/{x}/{y}.mvt").params(o({layerType:"node"},e,{apiKey:this.client.serviceKey})),r.toString()},t.prototype.hierarchy=function(){return h(this,void 0,void 0,function(){var e;return v(this,function(t){return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("poiHierarchy").key("apiKey").toString(),[2,p(this.client).fetch(e)]})})},t.prototype.osmTypes=function(){return h(this,void 0,void 0,function(){var e;return v(this,function(t){return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("osmTypes").key("apiKey").toString(),[2,p(this.client).fetch(e)]})})},t.prototype.osmTagValues=function(i,r,n){return h(this,void 0,void 0,function(){var e;return v(this,function(t){return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("osmTagValues/").part(i).key("apiKey").params({text:r||void 0,limit:n}).toString(),[2,p(this.client).fetch(e)]})})},t.prototype.info=function(i){return h(this,void 0,void 0,function(){var e;return v(this,function(t){return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("info/").part(i.map(encodeURIComponent).join(",")).key("apiKey").toString(),[2,p(this.client).fetch(e)]})})},t.prototype.boundingBox=function(i,r){return h(this,void 0,void 0,function(){var e;return v(this,function(t){return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("boundingBox").key("apiKey").params({northEastX:i.northEast.lng,northEastY:i.northEast.lat,southWestX:i.southWest.lng,southWestY:i.southWest.lat,group:r&&r.group,exclude:r&&r.exclude,match:r&&r.match}).toString(),[2,p(this.client).fetch(e)]})})},t.prototype.geometry=function(r,n,o){return void 0===o&&(o="geojson"),h(this,void 0,void 0,function(){var e,i;return v(this,function(t){return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("geometry").key().toString(),i={osmTypes:n,serviceKey:this.client.serviceKey,serviceUrl:this.client.serviceUrl,filterGeometry:{crs:4326,type:"geojson",data:JSON.stringify(r)},format:o},[2,p(this.client).fetch(e,"POST",i)]})})},t.prototype.geometrySummary=function(i){return h(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("geometry/summary/"),i&&e.part(i),e.key("apiKey"),[4,p(this.client).fetch(e.toString())];case 1:return[2,t.sent()]}})})},t.prototype.geometryRegister=function(r,n){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("geometry/register").key(),i={serviceKey:this.client.serviceKey,serviceUrl:this.client.serviceUrl,filterGeometry:{crs:4326,type:"geojson",data:JSON.stringify(r)},osmTypes:n&&n.osmTypes,format:n&&n.format||"geojson"},[4,p(this.client).fetch(e.toString(),"POST-RAW",JSON.stringify(i),{Accept:"application/json, text/plain, */*"})];case 1:return[2,t.sent()]}})})},t}(),P=new(function(){function t(){this.R=6378137}return t.prototype.project=function(t){var e=Math.PI/180,i=Math.max(Math.min(Math.sin(t.lat*e),1-1e-15),-(1-1e-15));return{x:this.R*t.lng*e,y:this.R*Math.log((1+i)/(1-i))/2}},t.prototype.unproject=function(t){var e=180/Math.PI;return{lat:(2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,lng:t.x*e/this.R}},t}()),_=6371.01,M=Math.PI/180;function N(t,e){var i=M*t.lat,r=M*t.lng,n=M*e.lat,o=M*e.lng;return Math.acos(Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos(r-o))*_}function D(t,e){e*=1e3;var i=t.lat,r=t.lng,n=i*M,o=e/1e3/110.574235,s=e/1e3/(110.572833*Math.cos(n));return{northEast:{lat:i+o,lng:r+s},southWest:{lat:i-o,lng:r-s}}}function W(t){switch(t.travelType){case"walk":return 10;case"bike":return 25;case"transit":return 150;default:return 120}}function B(t){return t.reduce(function(t,e){return t.northEast.lat=e.lat>t.northEast.lat?e.lat:t.northEast.lat,t.northEast.lng=e.lng>t.northEast.lng?e.lng:t.northEast.lng,t.southWest.lat=e.lat<t.southWest.lat?e.lat:t.southWest.lat,t.southWest.lng=e.lng<t.southWest.lng?e.lng:t.southWest.lng,t},{northEast:{lat:t[0].lat,lng:t[0].lng},southWest:{lat:t[0].lat,lng:t[0].lng}})}function F(t,i,e){return i instanceof Array?L(t,i,e).filter(function(e){return!i.some(function(t){return t==e})}):L(t,i,e).filter(function(t){return i!=t})}function L(t,i,r){return i instanceof Array?t.filter(function(e){return i.some(function(t){return N(e,t)<=r})}):t.filter(function(t){return N(t,i)<=r})}function j(t,e){var i=P.unproject(t);return null!=e?{lat:i.lat,lng:i.lng,elevation:e}:i}var H,z=Object.freeze({contains:function(t,e){return e.lat>=t.southWest.lat&&e.lat<=t.northEast.lat&&e.lng>=t.southWest.lng&&e.lng<=t.northEast.lng},calculateDistance:N,boundingBox:D,locationsWithinTravelOptions:function(t,e,i){var r,n=i.maxEdgeWeight;switch(i.travelType){case"walk":r=10;break;case"bike":r=25;break;case"transit":r=150;break;default:r=120}return F(t,e,"distance"===i.edgeWeight?Math.round(n/1e3):r*n/3600)},boundingBoxWithinTravelOptions:function(t,e){var i=e.maxEdgeWeight,r=W(e);return D(t,"distance"===e.edgeWeight?Math.round(i/1e3):r*i/3600)},boundingBoxFromLocationArray:B,boundingBoxListWithinTravelOptions:function(t,e){var i=e.maxEdgeWeight,r=W(e),n="distance"===e.edgeWeight?Math.round(i/1e3):r*i/3600,o={northEast:{lat:-1/0,lng:-1/0},southWest:{lat:1/0,lng:1/0}};return t.forEach(function(t){var e=D(t,n);o.northEast.lat=Math.max(o.northEast.lat,e.northEast.lat),o.northEast.lng=Math.max(o.northEast.lng,e.northEast.lng),o.southWest.lat=Math.min(o.southWest.lat,e.southWest.lat),o.southWest.lng=Math.min(o.southWest.lng,e.southWest.lng)}),o},locationsWithinDistance:F,locationsWithinDistanceInclusive:L,webMercatorToLatLng:j,latLngToWebMercator:function(t){return P.project(t)}}),K=function(){function t(t){this.southWest=new q(1/0,1/0),this.northEast=new q(-1/0,-1/0),t&&(this.southWest=new q(t.southWest.x,t.southWest.y),this.northEast=new q(t.northEast.x,t.northEast.y))}return t.prototype.expandPoint=function(t,e){this.southWest.x=Math.min(this.southWest.x,t),this.northEast.x=Math.max(this.northEast.x,t),this.southWest.y=Math.min(this.southWest.y,e),this.northEast.y=Math.max(this.northEast.y,e)},t.prototype.expand=function(t){this.expandPoint(t.northEast.x,t.northEast.y),this.expandPoint(t.southWest.x,t.southWest.y)},t}(),q=function(t,e){this.x=t,this.y=e},V=function(t){var i=this;this.bounds3857=new K,this.points=t.map(function(t){i.bounds3857.expandPoint(t[0],t[1]);var e=P.project({lat:t[0],lng:t[1]});return new q(e.x,e.y)})},J=function(t){var i=this;this.bounds3857=new K,this.travelTime=t.travelTime,this.area=t.area,this.lineStrings=[new V(t.outerBoundary)],this.bounds3857.expand(this.lineStrings[0].bounds3857),t.innerBoundary&&t.innerBoundary.forEach(function(t){var e=new V(t);i.lineStrings.push(e),i.bounds3857.expand(e.bounds3857)})},Y=function(){},Z=function(){};(H=u.StatisticsGroups||(u.StatisticsGroups={}))[H.GERMANY_ZENSUS_100M_STATISTICS=9]="GERMANY_ZENSUS_100M_STATISTICS",H[H.GERMANY_ZENSUS_200M_STATISTICS=2]="GERMANY_ZENSUS_200M_STATISTICS",H[H.GERMANY_ZENSUS_500M_STATISTICS=11]="GERMANY_ZENSUS_500M_STATISTICS",H[H.GERMANY_ZENSUS_1000M_STATISTICS=3]="GERMANY_ZENSUS_1000M_STATISTICS",H[H.GERMANY_ZENSUS_2000M_STATISTICS=10]="GERMANY_ZENSUS_2000M_STATISTICS",H[H.NORWAY_STATISTICS=4]="NORWAY_STATISTICS",H[H.CENSUS_BRANDENBURG_POPULATION=12]="CENSUS_BRANDENBURG_POPULATION",H[H.CANADA_BLOCK_STATISTICS=8]="CANADA_BLOCK_STATISTICS",H[H.CANADA_AREA_STATISTICS=5]="CANADA_AREA_STATISTICS",H[H.BERLIN_STATISTICS=6]="BERLIN_STATISTICS";var X,$,Q,tt=function(){},et=function(t){for(var e in this.values=t,this.total=0,this.values)this.total+=this.values[e]};(X=u.SRID||(u.SRID={}))[X.SRID_3857=3857]="SRID_3857",X[X.SRID_4326=4326]="SRID_4326",($=u.MultigraphRequestAggregation||(u.MultigraphRequestAggregation={})).NONE="none",$.SUM="sum",$.MAX="max",$.MIN="min",$.MEAN="mean",$.MEDIAN="median",$.NEAREST="nearest",$.UNION="routing_union",$.MATH="math",$.GRAVITATION="gravitation_huff",(Q=u.MultigraphRequestLayer||(u.MultigraphRequestLayer={})).IDENTITY="identity",Q.TILE="tile",Q.HEXAGON="hexagon",Q.CUSTOM_GEOMETRIES="custom_geometries";var it,rt=function(t,e){var i=this;this.points=[],this.type=e.type,this.travelTime=e.travelTime,this.distance=e.length/1e3,this.warning=e.warning,this.elevationGain=e.elevationGain,this.transitSegment=!1,this.startName=e.startname,this.endName=e.endname,e.points.forEach(function(t){i.points.push(j({x:t[1],y:t[0]},t[2]))}),e.isTransit&&(this.transitSegment=!0,this.routeType=e.routeType,this.routeShortName=e.routeShortName,this.routeLongName=e.routeLongName,this.startName=e.startname,this.endName=e.endname,this.departureTime=e.departureTime,this.arrivalTime=e.arrivalTime,this.tripHeadSign=e.tripHeadSign)},nt=function(){function t(i,t,e,r){var n=this;this.travelTime=t,this.routeSegments=[],this.targetHeight=void 0,this.sourceHeight=void 0,this.sourceId=void 0,this.targetId=void 0,this.length=void 0;var o=0,s=[];e.reverse().forEach(function(t){var e=new rt(i,t);n.routeSegments.push(e),"TRANSFER"===e.type&&o++,s=s.concat(e.points.reverse())}),this.points=s,this.transfers=o,void 0!==r&&(this.sourceId=r.source_id,this.targetId=r.target_id,this.length=r.length);var a=this.calculateElevationDifferences(this.points);this.targetHeight=a.targetHeight,this.sourceHeight=a.sourceHeight,this.uphillMeter=a.uphillMeter,this.downhillMeter=a.downhillMeter,this.totalElevationDifference=Math.abs(this.sourceHeight-this.targetHeight),this.departureTime=this.calculateDepartureTime(),this.arrivalTime=this.calculateArrivalTime(),this.distance=this.calculateDistance(),this.elevationGain=this.calculateElevationGain()}return t.prototype.calculateDistance=function(){for(var t=0,e=0;e<this.routeSegments.length;e++)t+=this.routeSegments[e].distance;return t},t.prototype.calculateElevationGain=function(){for(var t=void 0,e=0;e<this.routeSegments.length;e++)isFinite(this.routeSegments[e].elevationGain)&&(t=(t||0)+this.routeSegments[e].elevationGain);return t},t.prototype.calculateElevationDifferences=function(t){for(var e=void 0,i=void 0,r=void 0,n=0,o=0,s=this.points.length-1;0<=s;s--)0==s&&(i=this.points[s].elevation),s==this.points.length-1&&(r=this.points[s].elevation),void 0!==e&&(e>this.points[s].elevation?n+=e-this.points[s].elevation:e<this.points[s].elevation&&(o+=this.points[s].elevation-e)),e=this.points[s].elevation;return{targetHeight:i,sourceHeight:r,uphillMeter:n,downhillMeter:o}},t.prototype.calculateDepartureTime=function(){for(var t=0,e=0;e<this.routeSegments.length;e++){var i=this.routeSegments[e];if(null!=i.departureTime)return i.departureTime-t;t+=i.travelTime||0}},t.prototype.calculateArrivalTime=function(){for(var t=0,e=this.routeSegments.length-1;0<=e;e--){var i=this.routeSegments[e];if(null!=i.arrivalTime)return i.arrivalTime+t;t+=i.travelTime||0}},t}(),ot=function(t,o){function e(t){for(var e={},i=0,r=o;i<r.length;i++){var n=r[i];e[n.name]=new et(t[n.id])}return e}var i={};if(t.individualStatistics)for(var r in t.individualStatistics)t.individualStatistics[r]&&t.individualStatistics[r].statistics&&(i[r]=e(t.individualStatistics[r].statistics));this.statistics=e(t.statistics),this.individualStatistics=i,this.raw=t};(it=u.MultigraphStatus||(u.MultigraphStatus={})).CREATED="CREATED",it.ROUTING="ROUTING",it.MERGING="MERGING",it.AGGREGATING="AGGREGATING",it.COMPLETED="COMPLETED",it.FAILED="FAILED";var st=function(){},at=function(t,e){this.values={};var i={};e.forEach(function(t){i[t.id]=t.name}),this.raw=t;var r=this.values;for(var n in t){var o=t[n],s=(o.aggregation||"").toLowerCase();r[s]=r[s]||{};var a=i[o.statisticId];r[s][a]={value:o.value}}},lt=function(){this.minPolygonHoleSize=1e7,this.buffer=50,this.simplify=50,this.srid=u.SRID.SRID_4326,this.quadrantSegments=2,this.intersectionMode="union",this.decimalPrecision=6},ct=function(n){function t(t,e,i){var r=n.call(this,i)||this;return r.polygon=new lt,e?r.sources=r.buildSourcesCfg(e):(r.sources=r.buildSourcesCfg(i.sources),r.sourceGeometries=r.buildSourceGeometriesCfg(i.sourceGeometries)),r.polygon.values=i.travelEdgeWeights,r.polygon.serializer=i.serializer,r.polygon.simplify=i.simplify,r.polygon.srid=i.srid,r.polygon.buffer=i.buffer,r.polygon.minPolygonHoleSize=i.minPolygonHoleSize,r.polygon.quadrantSegments=i.quadrantSegments,r.polygon.intersectionMode=i.intersectionMode,r.polygon.decimalPrecision=i.decimalPrecision,r}return i(t,n),t}(E),ut=function(){function t(t){this.client=t}return t.prototype.fetch=function(n,o){return h(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=o?n:null,o=o||n,i=new ct(this.client,e,o),[4,this._executeFetch(o,i)];case 1:return r=t.sent(),"json"===o.serializer?[2,ht.create(r,r.metadata)]:"geojson"===o.serializer?[2,r]:[2]}})})},t.prototype._executeFetch=function(r,n){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/polygon").key().toString(),[4,p(this.client).fetchCachedData(r.useClientCache,e,"POST",n)];case 1:return(i=t.sent()).metadata=r,[2,i]}})})},t}(),ht=function(e){function r(t){return e.apply(this,t)||this}return i(r,e),r.create=function(t,e){var i=Object.create(r.prototype);return t.forEach(function(t){return i.push(t)}),e&&(i.metadata=e),i},r.prototype.getMaxBounds=function(){var e=[];return this.forEach(function(t){var i;t.polygons.forEach(function(t){var e=new J(t);i?i.expand(e.bounds3857):i=e.bounds3857}),e.push(j(i.northEast,null)),e.push(j(i.southWest,null))}),B(e)},r}(Array),pt=function(o){function t(t,e,i,r){var n=o.call(this,r)||this;return e?n.sources=n.buildSourcesCfg(e):(n.sources=n.buildSourcesCfg(r.sources),n.sourceGeometries=n.buildSourceGeometriesCfg(r.sourceGeometries)),n.targets=i?n.buildTargetsCfg(i):n.buildTargetsCfg(r.targets),n}return i(t,o),t}(E),ft=function(){function t(t){this.client=t}return t.prototype.individual=function(n,o,s){return h(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=s?n:null,s=s||n,i=new u.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/time").key().toString(),r=new pt(this.client,e,o,s),[4,p(this.client).fetchCachedData(s.useClientCache,i,"POST",r)];case 1:return[2,t.sent()]}})})},t.prototype.combined=function(n,o,s){return h(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=s?n:null,s=s||n,i=new u.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/reachability").key().toString(),r=new pt(this.client,e,o,s),[4,p(this.client).fetchCachedData(s.useClientCache,i,"POST",r)];case 1:return[2,t.sent()]}})})},t.prototype.count=function(e,i,r){return h(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,this.locations(e,i,r)];case 1:return[2,t.sent().length]}})})},t.prototype.locations=function(r,n,o){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=o?r:null,o=o||r,i={},n.forEach(function(t){return i[String(t.id)]=-1}),[4,this.combined(e,n,o)];case 1:return t.sent().forEach(function(t){var e=String(t.id);i[e]?-1<t.travelTime&&(-1<i[e]?i[e]=Math.min(i[e],t.travelTime):i[e]=t.travelTime):console.warn("NOT FOUND",String(t.id))}),[2,n.filter(function(t){var e=String(t.id);return t.travelTime=i[e],-1<i[e]})]}})})},t}(),dt=function(o){function t(t,e,i,r){var n=o.call(this,r)||this;return e?n.sources=n.buildSourcesCfg(e):(n.sources=n.buildSourcesCfg(r.sources),n.sourceGeometries=n.buildSourceGeometriesCfg(r.sourceGeometries)),n.targets=i?n.buildTargetsCfg(i):n.buildTargetsCfg(r.targets),n.pathSerializer=r.pathSerializer,"boolean"==typeof r.recommendations&&(r.recommendations=r.recommendations?1:0),Number.isInteger(r.recommendations)&&n.sources&&n.sources.forEach(function(t){if(null!=t.tm)for(var e in t.tm)t.tm[e].recommendations=r.recommendations}),n}return i(t,o),t}(E),gt=function(){function t(t){this.client=t}return t.prototype.fetch=function(o,s,a){return h(this,void 0,void 0,function(){var e,i,r,n=this;return v(this,function(t){switch(t.label){case 0:return e=a?o:null,a=a||o,i=new dt(this.client,e,s,a),[4,this._executeFetch(a,i)];case 1:return r=t.sent(),a.pathSerializer&&"compact"!==a.pathSerializer?"geojson"===a.pathSerializer?[2,r.routes]:[2]:[2,r.routes.map(function(t){return new nt(n.client,t.travelTime,t.segments,t)})]}})})},t.prototype._executeFetch=function(i,r){return h(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/route").key().toString(),[4,p(this.client).fetchCachedData(i.useClientCache,e,"POST",r,{Accept:"application/json,application/javascript,*/*"})];case 1:return[2,t.sent()]}})})},t}(),mt=function(){function t(t){this.client=t}return t.prototype.metadata=function(i){return h(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.tilesUrl).part("similarity/meta/").version().part("/"+encodeURIComponent(""+i)).key().toString(),[4,p(this.client).fetch(e)];case 1:return[2,t.sent()]}})})},t.prototype.fetch=function(o,s,a,l,c){return h(this,void 0,void 0,function(){var e,i,r,n;return v(this,function(t){switch(t.label){case 0:return e={west:l.southWest.lng,south:l.southWest.lat,east:l.northEast.lng,north:l.northEast.lat},i={bounds:e,refCellId:s,scores:a.map(function(t){return{source:t.source,minutes:t.minutes,factor:t.factor||1}})},r=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.tilesUrl).part("similarity/scores_cumulative/").version().part("/"+encodeURIComponent(""+o)).key(),n=c?r.params({normalizeOnViewport:!!c}).toString():r.toString(),[4,p(this.client).fetch(n,"POST",i)];case 1:return[2,t.sent()]}})})},t}();var yt=function(t,e,i){this.inactiveSources=[],this.getClosestSources=!1,this.serviceUrl=t.serviceUrl,this.serviceKey=t.serviceKey,this.useCache=null==i.useCache||i.useCache,e?this.sources=e.map(function(t){return{id:t.id,y:t.lat,x:t.lng}}):(i.sources&&(this.sources=i.sources.map(function(t){return{id:t.id,y:t.lat,x:t.lng}})),i.sourceGeometries&&(this.sourceGeometries=i.sourceGeometries.map(function(t){return{data:JSON.stringify(t.geometry),crs:t.crs||4326,id:t.id}}))),this.iFeelLucky=i.iFeelLucky,this.travelType=i.travelType,this.edgeWeight=i.edgeWeight,this.maxEdgeWeight=i.maxEdgeWeight,this.frame=i.transitFrameDuration,this.time=i.transitFrameTime,this.date=i.transitFrameDate,this.maxTransfers=i.transitMaxTransfers,this.maxWalkingTimeFromSource=i.transitMaxWalkingTimeFromSource,this.avoidTransitRouteTypes=i.transitAvoidTransitRouteTypes,this.rushHour=i.rushHour,i.inactiveSources&&(this.inactiveSources=i.inactiveSources.map(function(t){return{id:t.id,y:t.lat,x:t.lng}}));var r=[];i.statistics&&(this.omitIndividualStatistics=i.omitIndividualStatistics,r=i.statistics.map(function(t){return t instanceof Number||"number"==typeof t?+t:t.id})),this.statisticGroupId=+i.statisticsGroup,this.statisticIds=r,i.closestSources&&(this.getClosestSources=!0),i.walkSpeed&&(this.walkDownhill=null!=i.walkSpeed.downhill?+i.walkSpeed.downhill:void 0,this.walkSpeed=null!=i.walkSpeed.speed?+i.walkSpeed.speed:void 0,this.walkUphill=null!=i.walkSpeed.uphill?+i.walkSpeed.uphill:void 0),i.bikeSpeed&&(this.bikeDownhill=null!=i.bikeSpeed.downhill?+i.bikeSpeed.downhill:void 0,this.bikeSpeed=null!=i.bikeSpeed.speed?+i.bikeSpeed.speed:void 0,this.bikeUphill=null!=i.bikeSpeed.uphill?+i.bikeSpeed.uphill:void 0)},vt=function(t,e,i){var r=i.statistics.map(function(t){return t instanceof Number||"number"==typeof t?+t:t.id});this.statisticGroupId=+i.statisticsGroup,this.statisticIds=r,this.intersectionGeometry={data:e,crs:i.crs||4326}},St=function(){function t(t){this.client=t,this.statisticsMetadataCache=new e(200),this.statisticsEnsemblesCache=new e(200)}return t.prototype.combined=function(i,r){return h(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return[4,this.dependent(i,r)];case 1:return[2,(e=t.sent())&&e.statistics]}})})},t.prototype.individual=function(i,r){return h(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return[4,this.dependent(i,r)];case 1:return[2,(e=t.sent())&&e.individualStatistics]}})})},t.prototype.travelTimes=function(n,o){return h(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=void 0!==o?n:null,o=o||n,i=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("traveltimes").key("apiKey").params({serviceUrl:this.client.serviceUrl}).toString(),(r=new yt(this.client,e,o)).sources&&0!=r.sources.length||r.sourceGeometries&&0!=r.sourceGeometries.length?[4,p(this.client).fetch(i,"POST",r)]:[2,null];case 1:return[2,t.sent()]}})})},t.prototype.dependent=function(o,s){return h(this,void 0,void 0,function(){var e,i,r,n;return v(this,function(t){switch(t.label){case 0:return e=void 0!==s?o:null,s=s||o,i=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("charts/dependent").key("apiKey").params({serviceUrl:this.client.serviceUrl}).toString(),(r=new yt(this.client,e,s)).sources&&0!=r.sources.length||r.sourceGeometries&&0!=r.sourceGeometries.length?[4,p(this.client).fetch(i,"POST",r)]:[2,null];case 1:return n=t.sent(),[2,new ot(n,s.statistics)]}})})},t.prototype.geometry=function(r,n){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return r?(e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("values/geometry").key("apiKey").params({serviceUrl:this.client.serviceUrl}).toString(),[4,p(this.client).fetch(e,"POST",new vt(this.client,r,n))]):[2,null];case 1:return i=t.sent(),[2,new at(i,n.statistics)]}})})},t.prototype.metadata=function(o){return h(this,void 0,void 0,function(){var e,r,i,n=this;return v(this,function(t){switch(t.label){case 0:return e=this.client.config.tilesUrl,r="number"==typeof o?o:o.id,i=e+"-"+r,[4,this.statisticsMetadataCache.get(i,function(){return h(n,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.tilesUrl).part("statistics/meta/").version().part("/"+r).key().toString(),[4,p(this.client).fetch(e)];case 1:return!(i=t.sent()).name&&i.names&&i.names.en&&(i.name=i.names.en),i.stats&&i.stats.length&&i.stats.forEach(function(t){!t.name&&t.names&&t.names.en&&(t.name=t.names.en)}),[2,i]}})})})];case 1:return[2,t.sent()]}})})},t.prototype.metadataKey=function(o,s){return h(this,void 0,void 0,function(){var e,i,r,n;return v(this,function(t){switch(t.label){case 0:return[4,this.metadata(o)];case 1:for(e=t.sent(),i=0,r=e.stats;i<r.length;i++)if(n=r[i],s.id==n.statistic_id||n.names&&n.names.en==s.name)return[2,n];return[2,null]}})})},t.prototype.tileRoute=function(t,e){var i="number"==typeof t?t:t.id,r=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.tilesUrl).part("statistics/tiles/").version().part("/"+i+"/{z}/{x}/{y}.mvt").key();return e&&0<e.length?r.params({columns:encodeURIComponent(e.map(function(t){return+t.id}).join(","))}).toString():r.toString()},t.prototype.ensembles=function(){return h(this,void 0,void 0,function(){var e,i=this;return v(this,function(t){switch(t.label){case 0:return e=this.client.config.tilesUrl,[4,this.statisticsEnsemblesCache.get(e,function(){return h(i,void 0,void 0,function(){var e,i,r,n;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.tilesUrl).part("ensemble/list/").version().key().toString(),[4,p(this.client).fetch(e,"GET")];case 1:for(r in i=t.sent())i[r]&&((n=i[r]).id=+n.id,n.groups&&n.groups.length&&n.groups.forEach(function(t){t.hierarchy=+t.hierarchy,t.id=+t.id}));return[2,i]}})})})];case 1:return[2,t.sent()]}})})},t}(),Tt=function(n){function t(t,e,i){var r=n.call(this,t,e,i)||this;return delete r.inactiveSources,delete r.statisticGroupId,delete r.statisticIds,delete r.getClosestSources,delete r.useCache,i&&(i.multigraph.preAggregationPipeline&&(r.multiGraphPreAggregationPipeline=i.multigraph.preAggregationPipeline),i.multigraph.referencedStatisticIds&&(r.multiGraphReferencedStatisticIds=i.multigraph.referencedStatisticIds),i.multigraph.aggregation&&(r.multiGraphAggregationType=i.multigraph.aggregation.type||null,r.multiGraphAggregationIgnoreOutliers=i.multigraph.aggregation.ignoreOutliers||null,r.multiGraphAggregationOutlierPenalty=i.multigraph.aggregation.outlierPenalty||null,r.multiGraphAggregationMinSourcesRatio=i.multigraph.aggregation.minSourcesRatio||null,r.multiGraphAggregationMinSourcesCount=i.multigraph.aggregation.minSourcesCount||null,r.multiGraphAggregationMaxResultValueRatio=i.multigraph.aggregation.maxResultValueRatio||null,r.multiGraphAggregationMaxResultValue=i.multigraph.aggregation.maxResultValue||null,r.multiGraphAggregationFilterValuesForSourceOrigins=i.multigraph.aggregation.filterValuesForSourceOrigins||null,r.multiGraphAggregationInputParameters=i.multigraph.aggregation.aggregationInputParameters||null,r.multiGraphAggregationMathExpression=i.multigraph.aggregation.mathExpression||null,r.multiGraphAggregationGravitationExponent=i.multigraph.aggregation.gravitationExponent||null,r.multiGraphAggregationPostAggregationFactor=i.multigraph.aggregation.postAggregationFactor||null),r.multiGraphSerializationFormat=i.multigraph.serialization.format,r.multiGraphSerializationDecimalPrecision=i.multigraph.serialization.decimalPrecision,r.multiGraphSerializationMaxGeometryCount=i.multigraph.serialization.maxGeometryCount,r.multiGraphDomainType=i.multigraph.domain.type,r.multiGraphDomainEdgeAggregationType=i.multigraph.domain.edgeAggregationType,r.multiGraphDomainStatisticGroupId=i.multigraph.domain.statisticGroupId,i.multigraph.layer&&(r.multiGraphLayerType=i.multigraph.layer.type,r.multiGraphLayerGeometryDetailPerTile=i.multigraph.layer.geometryDetailPerTile,r.multiGraphLayerMinGeometryDetailLevel=i.multigraph.layer.minGeometryDetailLevel,r.multiGraphLayerMaxGeometryDetailLevel=i.multigraph.layer.maxGeometryDetailLevel,r.multiGraphLayerGeometryDetailLevel=i.multigraph.layer.geometryDetailLevel,r.multiGraphLayerCustomGeometryMergeAggregation=i.multigraph.layer.customGeometryMergeAggregation)),r}return i(t,n),t}(yt),bt=function(){function t(t){this.client=t}return t.prototype.create=function(r,n){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("multigraph").key().params({serviceUrl:this.client.serviceUrl}).toString(),i=new Tt(this.client,r,n),[4,p(this.client).fetchCachedData(n.useClientCache,e,"POST-RAW",JSON.stringify(i),{Accept:"text/plain"})];case 1:return[2,t.sent()]}})})},t.prototype.monolith=function(r,n){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("multigraph/monolith").key().params({serviceUrl:this.client.serviceUrl}).toString(),i=new Tt(this.client,r,n),[4,p(this.client).fetchCachedData(n.useClientCache,e,"POST",i,{Accept:"application/json"})];case 1:return[2,t.sent()]}})})},t.prototype.info=function(r){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("multigraph/"+r).key().params({serviceUrl:this.client.serviceUrl}).toString(),[4,p(this.client).fetch(e,"GET")];case 1:return(i=t.sent()).boundingBoxNorthEast&&i.boundingBoxSouthWest&&(i.boundingBox={northEast:{lat:i.boundingBoxNorthEast.y,lng:i.boundingBoxNorthEast.x},southWest:{lat:i.boundingBoxSouthWest.y,lng:i.boundingBoxSouthWest.x}},delete i.boundingBoxNorthEast,delete i.boundingBoxSouthWest),[2,i]}})})},t.prototype.redo=function(i){return h(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("multigraph/"+i+"/update").key().params({serviceUrl:this.client.serviceUrl}).toString(),[4,p(this.client).fetch(e,"PATCH")];case 1:return[2,t.sent()]}})})},t.prototype.getTiledMultigraphUrl=function(t,e){return new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("multigraph/"+t+"/{z}/{x}/{y}."+e).key().params({serviceUrl:this.client.serviceUrl}).toString()},t}(),Ut=function(){function t(t){this.client=t}return t.prototype.fetch=function(r,n,o,s){return h(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.fleetsUrl).version().part("/api/key-auth/optimizations").key().toString(),i=this._createPayload(this.client,r,n,o,s),[4,p(this.client).fetch(e,"POST",i)];case 1:return[2,t.sent()]}})})},t.prototype._createPayload=function(t,e,i,r,n){return{optimizationTime:n.optimizationTime,optimizationAlgorithm:n.optimizationAlgorithm,optimizationMetadata:{costMatrixSource:n.costMatrixSource,geojsonCreation:n.geojsonCreation,unimprovedWaitingTime:n.unimprovedWaitingTime,filterOrdersWithMissedDeadline:n.filterOrdersWithMissedDeadline,filterOrdersOutsideOfValidWorkingHours:n.filterOrdersOutsideOfValidWorkingHours,prohibitFilteringOfOrdersWithDeadlinesEarlierEqualsThan:n.prohibitFilteringOfOrdersWithDeadlinesEarlierEqualsThan,secondsToPenaltyRatioForDeadlineMissed:n.secondsToPenaltyRatioForDeadlineMissed,secondsToPenaltyRatioForOutOfWorkingHours:n.secondsToPenaltyRatioForOutOfWorkingHours,timeConstraintPenaltyToTravelCostRatio:n.timeConstraintPenaltyToTravelCostRatio,longestTourPenaltyFactor:n.longestTourPenaltyFactor,nonParallelOrdersByTags:n.nonParallelOrdersByTags,travelOptions:{travelType:n.travelType,serviceKey:t.serviceKey,serviceUrl:t.serviceUrl,travelTimeFactors:n.travelTimeFactors,fallbackServiceUrl:"",edgeWeight:n.edgeWeight,maxEdgeWeight:n.maxEdgeWeight,elevation:n.elevation,rushHour:n.rushHour}},stores:e,transports:r,orders:i}},t}(),wt=function(){function t(t){this.client=t,this.basemapsLookup={Bright:"osm-bright-gl-style",Light:"positron-gl-style","Light No-Labels":"positron-nolabels-gl-style",Dark:"dark-matter-gl-style","Dark No-Labels":"dark-matter-nolabels-gl-style",Gray:"gray-gl-style","Gray No-Labels":"gray-nolabels-gl-style","Light blue":"blueberry-gl-style","Dark blue":"fiord-color-gl-style","Dark blue No-Labels":"fiord-color-nolabels-gl-style",Basic:"klokantech-basic-gl-style",Toner:"toner-gl-style"}}return Object.defineProperty(t.prototype,"basemapNames",{get:function(){return Object.keys(this.basemapsLookup)},enumerable:!0,configurable:!0}),t.prototype.getGLStyleURL=function(t){if(!t||!this.basemapsLookup[t])throw new Error("valid style name required to access Targomo basemap");return new u.UrlUtil.TargomoUrl(this.client).host(this.client.config.basemapsUrl).part(this.basemapsLookup[t]+".json").params({key:this.client.serviceKey}).toString()},t}(),Et=function(t,e){this.esri=t,this.photon=e},At=function(){function t(t,e,i){if(this.serviceKey=e,!t)throw new TypeError("Region parameter is missing");this.config=new r(i),t.includes("http")||t.includes("localhost")||t.includes("/")?this.serviceUrl=t:this.serviceUrl="https://api.targomo.com/"+t+"/",this.pois=new k(this),this.statistics=new St(this),this.reachability=new ft(this),this.optimizations=new R(this),this.geocoding=new Et(new m,new y(this)),this.polygons=new ut(this),this.routes=new gt(this),this.similarity=new mt(this),this.benchmarks=new g(this),this.statefulMultigraph=new bt(this),this.multigraph=new x(this),this.basemaps=new wt(this),this.fleets=new Ut(this)}return Object.defineProperty(t.prototype,"endpoint",{get:function(){var t=this.serviceUrl.split("/").filter(function(t){return!!t});return t[t.length-1]},enumerable:!0,configurable:!0}),t.prototype.metadata=function(){return h(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new u.UrlUtil.TargomoUrl(this).part(this.serviceUrl).version().part("/metadata/network").key().toString(),[4,p(this).fetch(e)];case 1:return[2,t.sent()]}})})},t}(),xt=z;u.geometry=xt,u.PointsOfInterestClient=k,u.ClientConfig=r,u.BenchmarksClient=g,u.GeocodeEsriClient=m,u.GeocodePhotonClient=y,u.MultigraphClient=x,u.OptimizationsClient=R,u.PolygonsClient=ut,u.PolygonArray=ht,u.ReachabilityClient=ft,u.RoutesClient=gt,u.SimilarityClient=mt,u.StatisticsClient=St,u.GeocodingClients=Et,u.TargomoClient=At,u.FleetsClient=Ut,u.LatLng=Y,u.BoundingBox=Z,u.TravelSpeedValues=tt,u.StatisticValues=et,u.UseCacheRequestOptions=b,u.BaseRequestOptions=U,u.TravelRequestOptions=w,u.Route=nt,u.RouteSegment=rt,u.StatisticsResult=ot,u.FpResult=st,u.OptimizationResult=O,u.StatisticsGeometryResult=at,u.RequestsUtil=c,u.requests=p,u.SimpleLRU=e,u.SimpleCache=s,u.TARGOMO_ENVIRONMENT_HEADER=S,Object.defineProperty(u,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.tgm={})}(this,function(c){"use strict";!function(t){if(!t.fetch){var e="URLSearchParams"in t,i="Symbol"in t&&"iterator"in Symbol,s="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),r="FormData"in t,n="ArrayBuffer"in t;if(n)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=function(t){return t&&DataView.prototype.isPrototypeOf(t)},l=ArrayBuffer.isView||function(t){return t&&-1<o.indexOf(Object.prototype.toString.call(t))};d.prototype.append=function(t,e){t=h(t),e=p(e);var i=this.map[t];this.map[t]=i?i+","+e:e},d.prototype.delete=function(t){delete this.map[h(t)]},d.prototype.get=function(t){return t=h(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(h(t))},d.prototype.set=function(t,e){this.map[h(t)]=p(e)},d.prototype.forEach=function(t,e){for(var i in this.map)this.map.hasOwnProperty(i)&&t.call(e,this.map[i],i,this)},d.prototype.keys=function(){var i=[];return this.forEach(function(t,e){i.push(e)}),f(i)},d.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),f(e)},d.prototype.entries=function(){var i=[];return this.forEach(function(t,e){i.push([e,t])}),f(i)},i&&(d.prototype[Symbol.iterator]=d.prototype.entries);var c=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];T.prototype.clone=function(){return new T(this,{body:this._bodyInit})},S.call(T.prototype),S.call(U.prototype),U.prototype.clone=function(){return new U(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},U.error=function(){var t=new U(null,{status:0,statusText:""});return t.type="error",t};var u=[301,302,303,307,308];U.redirect=function(t,e){if(-1===u.indexOf(e))throw new RangeError("Invalid status code");return new U(null,{status:e,headers:{location:t}})},t.Headers=d,t.Request=T,t.Response=U,t.fetch=function(i,n){return new Promise(function(r,t){var e=new T(i,n),o=new XMLHttpRequest;o.onload=function(){var t,n,e={status:o.status,statusText:o.statusText,headers:(t=o.getAllResponseHeaders()||"",n=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var e=t.split(":"),i=e.shift().trim();if(i){var r=e.join(":").trim();n.append(i,r)}}),n)};e.url="responseURL"in o?o.responseURL:e.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;r(new U(i,e))},o.onerror=function(){t(new TypeError("Network request failed"))},o.ontimeout=function(){t(new TypeError("Network request failed"))},o.open(e.method,e.url,!0),"include"===e.credentials?o.withCredentials=!0:"omit"===e.credentials&&(o.withCredentials=!1),"responseType"in o&&s&&(o.responseType="blob"),e.headers.forEach(function(t,e){o.setRequestHeader(e,t)}),o.send(void 0===e._bodyInit?null:e._bodyInit)})},t.fetch.polyfill=!0}function h(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function p(t){return"string"!=typeof t&&(t=String(t)),t}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach(function(t,e){this.append(e,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function g(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function m(i){return new Promise(function(t,e){i.onload=function(){t(i.result)},i.onerror=function(){e(i.error)}})}function y(t){var e=new FileReader,i=m(e);return e.readAsArrayBuffer(t),i}function v(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function S(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t)if("string"==typeof t)this._bodyText=t;else if(s&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(r&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(e&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(n&&s&&a(t))this._bodyArrayBuffer=v(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!n||!ArrayBuffer.prototype.isPrototypeOf(t)&&!l(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=v(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var t=g(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var t,e,i,r=g(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,i=m(e),e.readAsText(t),i;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),i=new Array(e.length),r=0;r<e.length;r++)i[r]=String.fromCharCode(e[r]);return i.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}function T(t,e){var i,r,n=(e=e||{}).body;if(t instanceof T){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new d(e.headers)),this.method=(i=e.method||this.method||"GET",r=i.toUpperCase(),-1<c.indexOf(r)?r:i),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function b(t){var n=new FormData;return t.trim().split("&").forEach(function(t){if(t){var e=t.split("="),i=e.shift().replace(/\+/g," "),r=e.join("=").replace(/\+/g," ");n.append(decodeURIComponent(i),decodeURIComponent(r))}}),n}function U(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=200<=this.status&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}}("undefined"!=typeof self?self:window);var r=function(t){this.serverUrl="https://api.targomo.com/",this.statisticsUrl="https://api.targomo.com/statistics/",this.tilesUrl="https://api.targomo.com/vector-statistics/",this.poiUrl="https://api.targomo.com/pointofinterest/",this.mapTilesUrl="https://maps.targomo.com/",this.photonGeocoderUrl="https://api.targomo.com/geocode/",this.overpassUrl="https://api.targomo.com/overpass/",this.fleetsUrl="https://api.targomo.com/fleetplanner/",this.basemapsUrl="https://maps.targomo.com/styles/",this.version=1,this.debug=!1,Object.assign(this,t)},n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function i(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var o=function(){return(o=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function u(o,s,a,l){return new(a||(a=Promise))(function(t,e){function i(t){try{n(l.next(t))}catch(t){e(t)}}function r(t){try{n(l.throw(t))}catch(t){e(t)}}function n(e){e.done?t(e.value):new a(function(t){t(e.value)}).then(i,r)}n((l=l.apply(o,s||[])).next())})}function v(i,r){var n,o,s,t,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,o=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=r.call(i,a)}catch(t){e=[6,t],o=0}finally{n=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var t,l=function(t,e,i,r){this.value=t,this.key=e,this.previous=i,this.next=r},e=function(){function t(t){void 0===t&&(t=0),this.capacity=t,this.map={},this.size=0}return t.prototype.get=function(s,a){return u(this,void 0,void 0,function(){var e,i,r,n,o;return v(this,function(t){switch(t.label){case 0:if(void 0===(e=this.map[s]))return[3,5];this.oldest==e&&e.next&&(this.oldest=e.next),e.next&&(e.next.previous=e.previous),e.previous&&(e.previous.next=e.next),e.previous=this.newest,e.next=null,this.newest=e,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.value];case 2:return[2,t.sent()];case 3:return t.sent(),this.map[s]=void 0,[2,this.get(s,a)];case 4:return[3,8];case 5:return a?(i=a(),r=this.map[s]=new l(i,s,this.newest,null),[4,i]):[3,7];case 6:return n=t.sent(),this.newest&&(this.newest.next=r),this.newest=r,this.capacity&&(this.size>=this.capacity?(o=this.oldest)&&(this.oldest=o.next,delete this.map[o.key]):this.size++),this.oldest||(this.oldest=this.newest),[2,n];case 7:return[2,void 0];case 8:return[2]}})})},t}(),s=function(){function t(){this.map={}}return t.prototype.get=function(r,n){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e="string"==typeof r?r:JSON.stringify(r),null==this.map[e]?[3,1]:[2,this.map[e]];case 1:return[4,n()];case 2:return i=t.sent(),[2,this.map[e]=i]}})})},t}(),S="x-targomo-environment";(t=c.TargomoEnvironment||(c.TargomoEnvironment={})).REVIEW="review",t.STAGING="staging",t.PROD="";var a=new s;function T(t){t instanceof String||"string"==typeof t?console.log(t):console.log(JSON.stringify(t,null,2))}var h,p,f=function(){function t(t){this.options=t}return t.prototype.fetch=function(d,g,m,y){return void 0===g&&(g="GET"),void 0===y&&(y={}),u(this,void 0,void 0,function(){var e,i,r,n,o,s,a,l,c,u,h,p,f;return v(this,function(t){switch(t.label){case 0:return this.options.environment&&(y[S]=this.options.environment),"JSONP"!==(e=g)?y.Accept=y.Accept?y.Accept:"application/json":e="GET","POST-RAW"===g&&(e="POST"),"PUT"!==e&&"POST"!==e||(y["Content-Type"]="application/json"),i=new Headers(y),r={method:e,headers:i},"POST-RAW"===g?r.body=m:"GET"!==g&&"JSONP"!==g&&(r.body=JSON.stringify(m)),[4,fetch(d,r)];case 1:return n=t.sent(),(this.options&&this.options.debug||400<=n.status)&&(console.log("[TargomoClient Begin]"),console.log("[ENVIRONMENT]"),console.log(this.options.environment),console.log("[Request]",r.method,d),console.log(" [Headers]"),i.forEach(function(t,e){console.log(" "+e+" = "+t)}),r.body&&(console.log(" [Body]"),console.log(r.body)),console.log("[Response]"),console.log(" status = ",n.status),console.log(" statusText = ",n.statusText),console.log(" [Headers]"),n.headers.forEach(function(t,e){console.log(" "+e+" = "+t)})),400<=n.status?(console.log(" [Body]"),"application/json"!==n.headers.get("content-type")?[3,3]:(l=(a=JSON).stringify,[4,n.text()])):[3,6];case 2:return s=l.apply(a,[t.sent(),null,2]),[3,5];case 3:return[4,n.text()];case 4:s=t.sent(),t.label=5;case 5:throw T(o=s),console.log("[TargomoClient End]"),new Error(o);case 6:return c=null,"JSONP"!==g?[3,8]:[4,n.text()];case 7:return u=t.sent(),h=u.indexOf("("),p=u.lastIndexOf(")"),c=-1<h&&-1<p?JSON.parse(u.substring(h+1,p)):JSON.parse(u),[3,11];case 8:return"POST-RAW"!==g?[3,10]:[4,n.text()];case 9:return c=t.sent(),[3,11];case 10:c=n.json(),t.label=11;case 11:return this.options&&this.options.debug?(console.log(" [Body]"),f=T,[4,c]):[3,13];case 12:f.apply(void 0,[t.sent()]),console.log("[TargomoClient End]"),t.label=13;case 13:return[2,c]}})})},t.prototype.fetchData=function(i,r,n,o){return void 0===r&&(r="GET"),u(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return[4,this.fetch(i,r,n,o)];case 1:return(e=t.sent()).data?[2,e.data]:(console.warn("No data object was transmitted by "+i+" \nReturning raw response"),[2,e])}})})},t.prototype.fetchCached=function(t,e,i,r,n){var o=this;if(void 0===i&&(i="GET"),!1===t)return this.fetch(e,i,r,n);!0!==t&&t||(t=a);var s=JSON.stringify({url:e,method:i,payload:r});return t.get(s,function(){return o.fetch(e,i,r,n)})},t.prototype.fetchCachedData=function(t,e,i,r,n){var o=this;if(void 0===i&&(i="GET"),!1===t)return this.fetchData(e,i,r,n);!0!==t&&t||(t=a);var s=JSON.stringify({url:e,method:i,payload:r});return t.get(s,function(){return o.fetchData(e,i,r,n)})},t}();function d(t,e){return new f({debug:t&&t.config&&t.config.debug,environment:t&&t.config&&t.config.environment?t.config.environment:c.TargomoEnvironment.PROD})}h=c.UrlUtil||(c.UrlUtil={}),p=function(){function t(t){this.client=t,this.url="",this.firstParamPlaced=!1}return t.prototype.host=function(t){return 0===this.url.length&&"/"!==t[t.length-1]&&(t+="/"),this.part(t)},t.prototype.part=function(t){return this.url+=t,this},t.prototype.version=function(){return null!==this.client.config.version&&void 0!==this.client.config.version?this.part("v"+this.client.config.version):"/"===this.url[this.url.length-1]&&(this.url=this.url.substr(0,this.url.length-1)),this},t.prototype.params=function(t){var i=this;return Object.keys(t).forEach(function(e){t[e]instanceof Array?t[e].forEach(function(t){i.param(e,t)}):i.param(e,t[e])}),this},t.prototype.param=function(t,e){void 0!==e&&(this.firstParamPlaced?this.url+="&"+t+"="+e:(this.firstParamPlaced=!0,this.url+="?"+t+"="+e))},t.prototype.key=function(t){var e;return void 0===t&&(t="key"),this.params(((e={})[t]=this.client.serviceKey,e))},t.prototype.toString=function(){return this.url},t}(),h.TargomoUrl=p;var g=function(){function t(){}return t.prototype.geocode=function(n,o,t,s,a){return u(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e={singleLine:n,f:"json",countryCode:s,maxLocations:5},o&&(e.location=o.lng+","+o.lat),a&&(e.magicKey=a),i=(new c.UrlUtil.TargomoUrl).part("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates").params(e).toString(),[4,d().fetch(i)];case 1:return r=t.sent(),[2,r.candidates.map(function(t){return{lat:t.location.y,lng:t.location.x,description:t.address}})]}})})},t.prototype.suggest=function(r,n,t,o,s){return void 0===s&&(s=5),u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e={text:r,f:"json",countryCode:o,maxSuggestions:s},n&&(e.location=n.lng+","+n.lat),i=(new c.UrlUtil.TargomoUrl).part("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest").params(e).toString(),[4,d().fetch(i)];case 1:return[2,t.sent().suggestions]}})})},t.prototype.reverseGeocode=function(n,t){return u(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return(e={f:"json"}).location=n.lng+","+n.lat,i=(new c.UrlUtil.TargomoUrl).part("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode").params(e).toString(),[4,d().fetch(i)];case 1:return(r=t.sent())&&r.address?[2,{address:r.address.Match_addr,city:r.address.City,countryCode:r.address.CountryCode,location:r.address.Loc_name,region:r.address.Region,subregion:r.address.Subregion,zip:r.address.Postal}]:[2,{}]}})})},t}(),m=function(){function t(t){this.client=t}return t.prototype.geocode=function(n,o,s){return u(this,void 0,void 0,function(){var e,i,r=this;return v(this,function(t){switch(t.label){case 0:return e=(new c.UrlUtil.TargomoUrl).host(this.client.config.photonGeocoderUrl).part("api").params({q:encodeURIComponent(n),limit:5}).toString(),o&&(e+="&lat="+o.lat+"&lon="+o.lng),s&&(e+="&lang="+encodeURIComponent(s)),[4,d().fetch(e)];case 1:return(i=t.sent()).features.forEach(function(t,e,i){"boundary"==t.properties.osm_key&&i.splice(e,1)}),[2,i.features.map(function(t){return t.value=t.properties.osm_id,t.description=r.buildPlaceDescription(t.properties),t})]}})})},t.prototype.buildPlaceDescription=function(i){var r=function(t,e){return void 0===e&&(e=" "),t.filter(function(t){return!!t}).join(e).trim()},t=function(t,e){return r(t.map(function(t){return i[t]}),e)},e=t(["street","housenumber"]," "),n=r([t(["postcode","city"]," "),i.country],", "),o={title:"",meta1:"",meta2:"",full:""};return void 0!==i.name?(o.title=i.name,o.meta1=e,o.meta2=n):(o.title=e,o.meta1=n),i.name!==e&&(o.full=o.title),o.meta1&&i.name!==e&&(o.full+=", "+o.meta1),o.meta1&&i.name===e&&(o.full+=o.meta1),o.full=r([o.full,o.meta2],", "),o},t}(),y=function(){},b=function(){this.edgeWeight="time"},U=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.transitFrameDuration=void 0,t.transitFrameDate=20170801,t.transitFrameTime=39600,t.transitMaxTransfers=-1,t.transitAvoidTransitRouteTypes=[],t.walkSpeed={},t.bikeSpeed={},t}return i(t,e),t}(b),w=function(o){function t(t){var e=o.call(this)||this;if(Object.assign(e,t),null!=t.transitFrameDateTime){var i=void 0,r=(i=t.transitFrameDateTime instanceof Date?t.transitFrameDateTime:new Date(t.transitFrameDateTime))?1e4*i.getFullYear()+100*(i.getMonth()+1)+i.getDate():void 0,n=i?3600*i.getHours()+60*i.getMinutes():void 0;e.transitFrameDate=r||e.transitFrameDate,e.transitFrameTime=n||e.transitFrameTime}return e}return i(t,o),t.prototype.buildTargetsCfg=function(t){return t.map(function(t){return{lat:t.lat,lng:t.lng,id:t.id}})},t.prototype.buildSourcesCfg=function(t){var i=this;if(t)return t.map(function(t){var e={lat:t.lat,lng:t.lng,id:t.id,tm:t.tm};if(!e.tm)switch(i.travelType){case"car":e.tm={car:i.rushHour?{rushHour:i.rushHour}:{}};break;case"walk":e.tm={walk:i.walkSpeed};break;case"bike":e.tm={bike:i.bikeSpeed};break;case"transit":e.tm={transit:{frame:{date:i.transitFrameDate,time:i.transitFrameTime,duration:i.transitFrameDuration},maxTransfers:i.transitMaxTransfers}}}return e})},t.prototype.buildSourceGeometriesCfg=function(t){var i=this;if(t)return t.map(function(t){var e={data:JSON.stringify(t.geometry),crs:t.crs||4326,id:""+t.id,tm:t.tm};if(!e.tm)switch(i.travelType){case"car":e.tm={car:i.rushHour?{rushHour:i.rushHour}:{}};break;case"walk":e.tm={walk:i.walkSpeed};break;case"bike":e.tm={bike:i.bikeSpeed};break;case"transit":e.tm={transit:{frame:{date:i.transitFrameDate,time:i.transitFrameTime,duration:i.transitFrameDuration},maxTransfers:i.transitMaxTransfers}}}return e})},t}(U),E=function(n){function t(t,e,i){var r=n.call(this,e)||this;return t?r.sources=r.buildSourcesCfg(t):(r.sources=r.buildSourcesCfg(e.sources),r.sourceGeometries=r.buildSourceGeometriesCfg(e.sourceGeometries)),i?r.targets=r.buildTargetsCfg(i):e&&e.targets&&(r.targets=r.buildTargetsCfg(e.targets)),r.multigraph=e.multigraph,r}return i(t,n),t}(w),A=function(){function t(t){this.client=t}return t.prototype.fetch=function(n,o,s){return u(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=o?n:null,o=o||n,i=new c.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/multigraph").key().toString(),r=new E(e,o,s),[4,d(this.client).fetch(i,"POST",r)];case 1:return[2,t.sent()]}})})},t.prototype.fetchOverview=function(n,o,s){return u(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=o?n:null,o=o||n,i=new c.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/multigraph/overview").key().toString(),r=new E(e,o,s),[4,d(this.client).fetch(i,"POST",r)];case 1:return[2,t.sent()]}})})},t.prototype.getTiledMultigraphUrl=function(o,s,a,l){return u(this,void 0,void 0,function(){var e,i,r,n;return v(this,function(t){switch(t.label){case 0:return e=s?o:null,s=s||o,i=new c.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/objectcache/add").key().toString(),r=new E(e,s,l),[4,d(this.client).fetch(i,"POST",r)];case 1:return n=t.sent(),[2,new c.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/multigraph/{z}/{x}/{y}."+(a||o.format||"mvt")).key().params({cfgUuid:n.uuid}).toString()]}})})},t}(),x=function(t,e,i,r){this.description=r.description||"",this.serviceUrl=t,this.serviceKey=e,this.email=r.email||"developers@targomo.com",this.sendMail=!1,this.callbackUrl=r.callbackUrl||"https://localhost/",this.pointsPerSolution=r.pointsPerSolution,this.maxSolutions=r.maxSolutions||1,this.travelType=r.travelType,this.edgeWeight=r.edgeWeight,this.maxEdgeWeight=r.maxEdgeWeight,this.statisticGroupId=r.statisticGroup,r.statistic instanceof Number||"number"==typeof r.statistic?this.statisticId=+r.statistic:this.statisticId=r.statistic.id;var n={};i.forEach(function(t){n[t.id]={id:t.id,x:t.lng,y:t.lat}}),this.sources.push(n)},O=function(t){this.raw=t,this.id=t.id,this.maxPossibleValue=t.maxPossibleValue,this.solutions=t.simulationResults.map(function(t){var e={};return t.sourcePoints.forEach(function(t){e[t.id]=t.optimal}),{id:t.id,startTime:t.startTime,endTime:t.endTime,maxValue:t.maxValue,numberOfDesiredPoints:t.numberOfDesiredPoints,sources:e}})},C=function(){function t(t){this.client=t}return t.prototype.create=function(n,o){return u(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return n.length?(e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("simulation/start/").key("apiKey").params({serviceUrl:encodeURIComponent(this.client.serviceUrl)}).toString(),i=new x(this.client.serviceUrl,this.client.serviceKey,n,o),[4,d(this.client).fetch(e,"POST",i)]):[2,null];case 1:return[2,(r=t.sent())&&+r.id]}})})},t.prototype.ready=function(i){return u(this,void 0,void 0,function(){var e;return v(this,function(t){return i instanceof Array||(i=[i]),e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("simulation/ready/").key("apiKey").params({serviceUrl:encodeURIComponent(this.client.serviceUrl),simulationId:i}).toString(),[2,d(this.client).fetch(e)]})})},t.prototype.fetch=function(r){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("simulation/"+r+"/").key("apiKey").params({serviceUrl:encodeURIComponent(this.client.serviceUrl)}).toString(),i=O.bind,[4,d(this.client).fetch(e)];case 1:return[2,new(i.apply(O,[void 0,t.sent()]))]}})})},t}(),G=function(n){function t(t,e,i){var r=n.call(this,i)||this;return r.osmTypes=[],r.sources=r.buildSourcesCfg(e instanceof Array?e:[e]),r.osmTypes=i.osmTypes,r.format=i.format,r.serviceKey=t.serviceKey,r.serviceUrl=t.serviceUrl,r}return i(t,n),t}(w),R=function(){function i(t,e,i,r){this.id=t,this.lng=e,this.lat=i,this.properties=r,this.properties&&(this.properties["marker-size"]=1)}return i.prototype.toString=function(){return this.properties?this.properties.name:""},i.prototype.copy=function(){var t=new i(this.id,this.lat,this.lng,o({},this.properties));for(var e in this)"properties"!=e&&(t[e]=this[e]);return t},i}();var I=function(){function t(t){this.client=t}return t.prototype.queryGetCustom=function(e){return u(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,d(this.client).fetch(e)];case 1:return[2,t.sent().elements.map(function(t){return i=(e=t).lat,r=e.lon,void 0===i&&e.center&&(i=e.center.lat,r=e.center.lon),new R(e.id,r,i,e.tags);var e,i,r})]}})})},t.prototype.reachable=function(i,r){return u(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=this.client.config.poiUrl+"/reachability",[4,d(this.client).fetch(e,"POST",new G(this.client,i,r))];case 1:return[2,t.sent()]}})})},t.prototype.reachabilitySummary=function(i){return u(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("reachability/summary/"),i&&e.part(i),e.key("apiKey"),[4,d(this.client).fetch(e.toString())];case 1:return[2,t.sent()]}})})},t.prototype.register=function(r){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("register").key(),i={osmTypes:r&&r.osmTypes,serviceKey:this.client.serviceKey,serviceUrl:this.client.serviceUrl,format:r&&r.format},[4,d(this.client).fetch(e.toString(),"POST-RAW",JSON.stringify(i),{Accept:"application/json, text/plain, */*"})];case 1:return[2,t.sent()]}})})},t.prototype.reachabilityRegister=function(r,n){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("reachability/register").key(),i=new G(this.client,r,n),[4,d(this.client).fetch(e.toString(),"POST-RAW",JSON.stringify(i),{Accept:"application/json, text/plain, */*"})];case 1:return[2,t.sent()]}})})},t.prototype.reachabilityTileRoute=function(t,e){return this.tileRouteImpl(t,e,"reachability")},t.prototype.geometryTileRoute=function(t,e){return this.tileRouteImpl(t,e,"geometry")},t.prototype.tileRoute=function(t,e){return this.tileRouteImpl(t,e)},t.prototype.tileRouteImpl=function(t,e,i){var r=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl);return"reachability"!==i&&"geometry"!==i||r.part(i+"/"),t&&r.part(t+"/"),r.part("{z}/{x}/{y}.mvt").params(o({layerType:"node"},e,{apiKey:this.client.serviceKey})),r.toString()},t.prototype.hierarchy=function(){return u(this,void 0,void 0,function(){var e;return v(this,function(t){return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("poiHierarchy").key("apiKey").toString(),[2,d(this.client).fetch(e)]})})},t.prototype.osmTypes=function(){return u(this,void 0,void 0,function(){var e;return v(this,function(t){return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("osmTypes").key("apiKey").toString(),[2,d(this.client).fetch(e)]})})},t.prototype.osmTagValues=function(i,r,n){return u(this,void 0,void 0,function(){var e;return v(this,function(t){return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("osmTagValues/").part(i).key("apiKey").params({text:r||void 0,limit:n}).toString(),[2,d(this.client).fetch(e)]})})},t.prototype.info=function(i){return u(this,void 0,void 0,function(){var e;return v(this,function(t){return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("info/").part(i.map(encodeURIComponent).join(",")).key("apiKey").toString(),[2,d(this.client).fetch(e)]})})},t.prototype.boundingBox=function(i,r){return u(this,void 0,void 0,function(){var e;return v(this,function(t){return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("boundingBox").key("apiKey").params({northEastX:i.northEast.lng,northEastY:i.northEast.lat,southWestX:i.southWest.lng,southWestY:i.southWest.lat,group:r&&r.group,exclude:r&&r.exclude,match:r&&r.match}).toString(),[2,d(this.client).fetch(e)]})})},t.prototype.geometry=function(r,n,o){return void 0===o&&(o="geojson"),u(this,void 0,void 0,function(){var e,i;return v(this,function(t){return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("geometry").key().toString(),i={osmTypes:n,serviceKey:this.client.serviceKey,serviceUrl:this.client.serviceUrl,filterGeometry:{crs:4326,type:"geojson",data:JSON.stringify(r)},format:o},[2,d(this.client).fetch(e,"POST",i)]})})},t.prototype.geometrySummary=function(i){return u(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("geometry/summary/"),i&&e.part(i),e.key("apiKey"),[4,d(this.client).fetch(e.toString())];case 1:return[2,t.sent()]}})})},t.prototype.geometryRegister=function(r,n){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.poiUrl).part("geometry/register").key(),i={serviceKey:this.client.serviceKey,serviceUrl:this.client.serviceUrl,filterGeometry:{crs:4326,type:"geojson",data:JSON.stringify(r)},osmTypes:n&&n.osmTypes,format:n&&n.format||"geojson"},[4,d(this.client).fetch(e.toString(),"POST-RAW",JSON.stringify(i),{Accept:"application/json, text/plain, */*"})];case 1:return[2,t.sent()]}})})},t}(),P=new(function(){function t(){this.R=6378137}return t.prototype.project=function(t){var e=Math.PI/180,i=Math.max(Math.min(Math.sin(t.lat*e),1-1e-15),-(1-1e-15));return{x:this.R*t.lng*e,y:this.R*Math.log((1+i)/(1-i))/2}},t.prototype.unproject=function(t){var e=180/Math.PI;return{lat:(2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,lng:t.x*e/this.R}},t}()),k=6371.01,M=Math.PI/180;function _(t,e){var i=M*t.lat,r=M*t.lng,n=M*e.lat,o=M*e.lng;return Math.acos(Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos(r-o))*k}function N(t,e){e*=1e3;var i=t.lat,r=t.lng,n=i*M,o=e/1e3/110.574235,s=e/1e3/(110.572833*Math.cos(n));return{northEast:{lat:i+o,lng:r+s},southWest:{lat:i-o,lng:r-s}}}function D(t){switch(t.travelType){case"walk":return 10;case"bike":return 25;case"transit":return 150;default:return 120}}function W(t){return t.reduce(function(t,e){return t.northEast.lat=e.lat>t.northEast.lat?e.lat:t.northEast.lat,t.northEast.lng=e.lng>t.northEast.lng?e.lng:t.northEast.lng,t.southWest.lat=e.lat<t.southWest.lat?e.lat:t.southWest.lat,t.southWest.lng=e.lng<t.southWest.lng?e.lng:t.southWest.lng,t},{northEast:{lat:t[0].lat,lng:t[0].lng},southWest:{lat:t[0].lat,lng:t[0].lng}})}function B(t,i,e){return i instanceof Array?F(t,i,e).filter(function(e){return!i.some(function(t){return t==e})}):F(t,i,e).filter(function(t){return i!=t})}function F(t,i,r){return i instanceof Array?t.filter(function(e){return i.some(function(t){return _(e,t)<=r})}):t.filter(function(t){return _(t,i)<=r})}function L(t,e){var i=P.unproject(t);return null!=e?{lat:i.lat,lng:i.lng,elevation:e}:i}var j,H=Object.freeze({contains:function(t,e){return e.lat>=t.southWest.lat&&e.lat<=t.northEast.lat&&e.lng>=t.southWest.lng&&e.lng<=t.northEast.lng},calculateDistance:_,boundingBox:N,locationsWithinTravelOptions:function(t,e,i){var r,n=i.maxEdgeWeight;switch(i.travelType){case"walk":r=10;break;case"bike":r=25;break;case"transit":r=150;break;default:r=120}return B(t,e,"distance"===i.edgeWeight?Math.round(n/1e3):r*n/3600)},boundingBoxWithinTravelOptions:function(t,e){var i=e.maxEdgeWeight,r=D(e);return N(t,"distance"===e.edgeWeight?Math.round(i/1e3):r*i/3600)},boundingBoxFromLocationArray:W,boundingBoxListWithinTravelOptions:function(t,e){var i=e.maxEdgeWeight,r=D(e),n="distance"===e.edgeWeight?Math.round(i/1e3):r*i/3600,o={northEast:{lat:-1/0,lng:-1/0},southWest:{lat:1/0,lng:1/0}};return t.forEach(function(t){var e=N(t,n);o.northEast.lat=Math.max(o.northEast.lat,e.northEast.lat),o.northEast.lng=Math.max(o.northEast.lng,e.northEast.lng),o.southWest.lat=Math.min(o.southWest.lat,e.southWest.lat),o.southWest.lng=Math.min(o.southWest.lng,e.southWest.lng)}),o},locationsWithinDistance:B,locationsWithinDistanceInclusive:F,webMercatorToLatLng:L,latLngToWebMercator:function(t){return P.project(t)}}),z=function(){function t(t){this.southWest=new K(1/0,1/0),this.northEast=new K(-1/0,-1/0),t&&(this.southWest=new K(t.southWest.x,t.southWest.y),this.northEast=new K(t.northEast.x,t.northEast.y))}return t.prototype.expandPoint=function(t,e){this.southWest.x=Math.min(this.southWest.x,t),this.northEast.x=Math.max(this.northEast.x,t),this.southWest.y=Math.min(this.southWest.y,e),this.northEast.y=Math.max(this.northEast.y,e)},t.prototype.expand=function(t){this.expandPoint(t.northEast.x,t.northEast.y),this.expandPoint(t.southWest.x,t.southWest.y)},t}(),K=function(t,e){this.x=t,this.y=e},q=function(t){var i=this;this.bounds3857=new z,this.points=t.map(function(t){i.bounds3857.expandPoint(t[0],t[1]);var e=P.project({lat:t[0],lng:t[1]});return new K(e.x,e.y)})},V=function(t){var i=this;this.bounds3857=new z,this.travelTime=t.travelTime,this.area=t.area,this.lineStrings=[new q(t.outerBoundary)],this.bounds3857.expand(this.lineStrings[0].bounds3857),t.innerBoundary&&t.innerBoundary.forEach(function(t){var e=new q(t);i.lineStrings.push(e),i.bounds3857.expand(e.bounds3857)})},J=function(){},Y=function(){};(j=c.StatisticsGroups||(c.StatisticsGroups={}))[j.GERMANY_ZENSUS_100M_STATISTICS=9]="GERMANY_ZENSUS_100M_STATISTICS",j[j.GERMANY_ZENSUS_200M_STATISTICS=2]="GERMANY_ZENSUS_200M_STATISTICS",j[j.GERMANY_ZENSUS_500M_STATISTICS=11]="GERMANY_ZENSUS_500M_STATISTICS",j[j.GERMANY_ZENSUS_1000M_STATISTICS=3]="GERMANY_ZENSUS_1000M_STATISTICS",j[j.GERMANY_ZENSUS_2000M_STATISTICS=10]="GERMANY_ZENSUS_2000M_STATISTICS",j[j.NORWAY_STATISTICS=4]="NORWAY_STATISTICS",j[j.CENSUS_BRANDENBURG_POPULATION=12]="CENSUS_BRANDENBURG_POPULATION",j[j.CANADA_BLOCK_STATISTICS=8]="CANADA_BLOCK_STATISTICS",j[j.CANADA_AREA_STATISTICS=5]="CANADA_AREA_STATISTICS",j[j.BERLIN_STATISTICS=6]="BERLIN_STATISTICS";var Z,X,$,Q=function(){},tt=function(t){for(var e in this.values=t,this.total=0,this.values)this.total+=this.values[e]};(Z=c.SRID||(c.SRID={}))[Z.SRID_3857=3857]="SRID_3857",Z[Z.SRID_4326=4326]="SRID_4326",(X=c.MultigraphRequestAggregation||(c.MultigraphRequestAggregation={})).NONE="none",X.SUM="sum",X.MAX="max",X.MIN="min",X.MEAN="mean",X.MEDIAN="median",X.NEAREST="nearest",X.UNION="routing_union",X.MATH="math",X.GRAVITATION="gravitation_huff",($=c.MultigraphRequestLayer||(c.MultigraphRequestLayer={})).IDENTITY="identity",$.TILE="tile",$.HEXAGON="hexagon",$.CUSTOM_GEOMETRIES="custom_geometries";var et,it=function(t,e){var i=this;this.points=[],this.type=e.type,this.travelTime=e.travelTime,this.distance=e.length/1e3,this.warning=e.warning,this.elevationGain=e.elevationGain,this.transitSegment=!1,this.startName=e.startname,this.endName=e.endname,e.points.forEach(function(t){i.points.push(L({x:t[1],y:t[0]},t[2]))}),e.isTransit&&(this.transitSegment=!0,this.routeType=e.routeType,this.routeShortName=e.routeShortName,this.routeLongName=e.routeLongName,this.startName=e.startname,this.endName=e.endname,this.departureTime=e.departureTime,this.arrivalTime=e.arrivalTime,this.tripHeadSign=e.tripHeadSign)},rt=function(){function t(i,t,e,r){var n=this;this.travelTime=t,this.routeSegments=[],this.targetHeight=void 0,this.sourceHeight=void 0,this.sourceId=void 0,this.targetId=void 0,this.length=void 0;var o=0,s=[];e.reverse().forEach(function(t){var e=new it(i,t);n.routeSegments.push(e),"TRANSFER"===e.type&&o++,s=s.concat(e.points.reverse())}),this.points=s,this.transfers=o,void 0!==r&&(this.sourceId=r.source_id,this.targetId=r.target_id,this.length=r.length);var a=this.calculateElevationDifferences(this.points);this.targetHeight=a.targetHeight,this.sourceHeight=a.sourceHeight,this.uphillMeter=a.uphillMeter,this.downhillMeter=a.downhillMeter,this.totalElevationDifference=Math.abs(this.sourceHeight-this.targetHeight),this.departureTime=this.calculateDepartureTime(),this.arrivalTime=this.calculateArrivalTime(),this.distance=this.calculateDistance(),this.elevationGain=this.calculateElevationGain()}return t.prototype.calculateDistance=function(){for(var t=0,e=0;e<this.routeSegments.length;e++)t+=this.routeSegments[e].distance;return t},t.prototype.calculateElevationGain=function(){for(var t=void 0,e=0;e<this.routeSegments.length;e++)isFinite(this.routeSegments[e].elevationGain)&&(t=(t||0)+this.routeSegments[e].elevationGain);return t},t.prototype.calculateElevationDifferences=function(t){for(var e=void 0,i=void 0,r=void 0,n=0,o=0,s=this.points.length-1;0<=s;s--)0==s&&(i=this.points[s].elevation),s==this.points.length-1&&(r=this.points[s].elevation),void 0!==e&&(e>this.points[s].elevation?n+=e-this.points[s].elevation:e<this.points[s].elevation&&(o+=this.points[s].elevation-e)),e=this.points[s].elevation;return{targetHeight:i,sourceHeight:r,uphillMeter:n,downhillMeter:o}},t.prototype.calculateDepartureTime=function(){for(var t=0,e=0;e<this.routeSegments.length;e++){var i=this.routeSegments[e];if(null!=i.departureTime)return i.departureTime-t;t+=i.travelTime||0}},t.prototype.calculateArrivalTime=function(){for(var t=0,e=this.routeSegments.length-1;0<=e;e--){var i=this.routeSegments[e];if(null!=i.arrivalTime)return i.arrivalTime+t;t+=i.travelTime||0}},t}(),nt=function(t,o){function e(t){for(var e={},i=0,r=o;i<r.length;i++){var n=r[i];e[n.name]=new tt(t[n.id])}return e}var i={};if(t.individualStatistics)for(var r in t.individualStatistics)t.individualStatistics[r]&&t.individualStatistics[r].statistics&&(i[r]=e(t.individualStatistics[r].statistics));this.statistics=e(t.statistics),this.individualStatistics=i,this.raw=t};(et=c.MultigraphStatus||(c.MultigraphStatus={})).CREATED="CREATED",et.ROUTING="ROUTING",et.MERGING="MERGING",et.AGGREGATING="AGGREGATING",et.COMPLETED="COMPLETED",et.FAILED="FAILED";var ot=function(){},st=function(t,e){this.values={};var i={};e.forEach(function(t){i[t.id]=t.name}),this.raw=t;var r=this.values;for(var n in t){var o=t[n],s=(o.aggregation||"").toLowerCase();r[s]=r[s]||{};var a=i[o.statisticId];r[s][a]={value:o.value}}},at=function(){this.minPolygonHoleSize=1e7,this.buffer=50,this.simplify=50,this.srid=c.SRID.SRID_4326,this.quadrantSegments=2,this.intersectionMode="union",this.decimalPrecision=6},lt=function(n){function t(t,e,i){var r=n.call(this,i)||this;return r.polygon=new at,e?r.sources=r.buildSourcesCfg(e):(r.sources=r.buildSourcesCfg(i.sources),r.sourceGeometries=r.buildSourceGeometriesCfg(i.sourceGeometries)),r.polygon.values=i.travelEdgeWeights,r.polygon.serializer=i.serializer,r.polygon.simplify=i.simplify,r.polygon.srid=i.srid,r.polygon.buffer=i.buffer,r.polygon.minPolygonHoleSize=i.minPolygonHoleSize,r.polygon.quadrantSegments=i.quadrantSegments,r.polygon.intersectionMode=i.intersectionMode,r.polygon.decimalPrecision=i.decimalPrecision,r}return i(t,n),t}(w),ct=function(){function t(t){this.client=t}return t.prototype.fetch=function(n,o){return u(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=o?n:null,o=o||n,i=new lt(this.client,e,o),[4,this._executeFetch(o,i)];case 1:return r=t.sent(),"json"===o.serializer?[2,ut.create(r,r.metadata)]:"geojson"===o.serializer?[2,r]:[2]}})})},t.prototype._executeFetch=function(r,n){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/polygon").key().toString(),[4,d(this.client).fetchCachedData(r.useClientCache,e,"POST",n)];case 1:return(i=t.sent()).metadata=r,[2,i]}})})},t}(),ut=function(e){function r(t){return e.apply(this,t)||this}return i(r,e),r.create=function(t,e){var i=Object.create(r.prototype);return t.forEach(function(t){return i.push(t)}),e&&(i.metadata=e),i},r.prototype.getMaxBounds=function(){var e=[];return this.forEach(function(t){var i;t.polygons.forEach(function(t){var e=new V(t);i?i.expand(e.bounds3857):i=e.bounds3857}),e.push(L(i.northEast,null)),e.push(L(i.southWest,null))}),W(e)},r}(Array),ht=function(o){function t(t,e,i,r){var n=o.call(this,r)||this;return e?n.sources=n.buildSourcesCfg(e):(n.sources=n.buildSourcesCfg(r.sources),n.sourceGeometries=n.buildSourceGeometriesCfg(r.sourceGeometries)),n.targets=i?n.buildTargetsCfg(i):n.buildTargetsCfg(r.targets),n}return i(t,o),t}(w),pt=function(){function t(t){this.client=t}return t.prototype.individual=function(n,o,s){return u(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=s?n:null,s=s||n,i=new c.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/time").key().toString(),r=new ht(this.client,e,o,s),[4,d(this.client).fetchCachedData(s.useClientCache,i,"POST",r)];case 1:return[2,t.sent()]}})})},t.prototype.combined=function(n,o,s){return u(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=s?n:null,s=s||n,i=new c.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/reachability").key().toString(),r=new ht(this.client,e,o,s),[4,d(this.client).fetchCachedData(s.useClientCache,i,"POST",r)];case 1:return[2,t.sent()]}})})},t.prototype.count=function(e,i,r){return u(this,void 0,void 0,function(){return v(this,function(t){switch(t.label){case 0:return[4,this.locations(e,i,r)];case 1:return[2,t.sent().length]}})})},t.prototype.locations=function(r,n,o){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=o?r:null,o=o||r,i={},n.forEach(function(t){return i[String(t.id)]=-1}),[4,this.combined(e,n,o)];case 1:return t.sent().forEach(function(t){var e=String(t.id);i[e]?-1<t.travelTime&&(-1<i[e]?i[e]=Math.min(i[e],t.travelTime):i[e]=t.travelTime):console.warn("NOT FOUND",String(t.id))}),[2,n.filter(function(t){var e=String(t.id);return t.travelTime=i[e],-1<i[e]})]}})})},t}(),ft=function(o){function t(t,e,i,r){var n=o.call(this,r)||this;return e?n.sources=n.buildSourcesCfg(e):(n.sources=n.buildSourcesCfg(r.sources),n.sourceGeometries=n.buildSourceGeometriesCfg(r.sourceGeometries)),n.targets=i?n.buildTargetsCfg(i):n.buildTargetsCfg(r.targets),n.pathSerializer=r.pathSerializer,"boolean"==typeof r.recommendations&&(r.recommendations=r.recommendations?1:0),Number.isInteger(r.recommendations)&&n.sources&&n.sources.forEach(function(t){if(null!=t.tm)for(var e in t.tm)t.tm[e].recommendations=r.recommendations}),n}return i(t,o),t}(w),dt=function(){function t(t){this.client=t}return t.prototype.fetch=function(o,s,a){return u(this,void 0,void 0,function(){var e,i,r,n=this;return v(this,function(t){switch(t.label){case 0:return e=a?o:null,a=a||o,i=new ft(this.client,e,s,a),[4,this._executeFetch(a,i)];case 1:return r=t.sent(),a.pathSerializer&&"compact"!==a.pathSerializer?"geojson"===a.pathSerializer?[2,r.routes]:[2]:[2,r.routes.map(function(t){return new rt(n.client,t.travelTime,t.segments,t)})]}})})},t.prototype._executeFetch=function(i,r){return u(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).part(this.client.serviceUrl).version().part("/route").key().toString(),[4,d(this.client).fetchCachedData(i.useClientCache,e,"POST",r,{Accept:"application/json,application/javascript,*/*"})];case 1:return[2,t.sent()]}})})},t}();var gt=function(t,e,i){this.inactiveSources=[],this.getClosestSources=!1,this.serviceUrl=t.serviceUrl,this.serviceKey=t.serviceKey,this.useCache=null==i.useCache||i.useCache,e?this.sources=e.map(function(t){return{id:t.id,y:t.lat,x:t.lng}}):(i.sources&&(this.sources=i.sources.map(function(t){return{id:t.id,y:t.lat,x:t.lng}})),i.sourceGeometries&&(this.sourceGeometries=i.sourceGeometries.map(function(t){return{data:JSON.stringify(t.geometry),crs:t.crs||4326,id:t.id}}))),this.iFeelLucky=i.iFeelLucky,this.travelType=i.travelType,this.edgeWeight=i.edgeWeight,this.maxEdgeWeight=i.maxEdgeWeight,this.frame=i.transitFrameDuration,this.time=i.transitFrameTime,this.date=i.transitFrameDate,this.maxTransfers=i.transitMaxTransfers,this.maxWalkingTimeFromSource=i.transitMaxWalkingTimeFromSource,this.avoidTransitRouteTypes=i.transitAvoidTransitRouteTypes,this.rushHour=i.rushHour,i.inactiveSources&&(this.inactiveSources=i.inactiveSources.map(function(t){return{id:t.id,y:t.lat,x:t.lng}}));var r=[];i.statistics&&(this.omitIndividualStatistics=i.omitIndividualStatistics,r=i.statistics.map(function(t){return t instanceof Number||"number"==typeof t?+t:t.id})),this.statisticGroupId=+i.statisticsGroup,this.statisticIds=r,i.closestSources&&(this.getClosestSources=!0),i.walkSpeed&&(this.walkDownhill=null!=i.walkSpeed.downhill?+i.walkSpeed.downhill:void 0,this.walkSpeed=null!=i.walkSpeed.speed?+i.walkSpeed.speed:void 0,this.walkUphill=null!=i.walkSpeed.uphill?+i.walkSpeed.uphill:void 0),i.bikeSpeed&&(this.bikeDownhill=null!=i.bikeSpeed.downhill?+i.bikeSpeed.downhill:void 0,this.bikeSpeed=null!=i.bikeSpeed.speed?+i.bikeSpeed.speed:void 0,this.bikeUphill=null!=i.bikeSpeed.uphill?+i.bikeSpeed.uphill:void 0)},mt=function(t,e,i){var r=i.statistics.map(function(t){return t instanceof Number||"number"==typeof t?+t:t.id});this.statisticGroupId=+i.statisticsGroup,this.statisticIds=r,this.intersectionGeometry={data:e,crs:i.crs||4326}},yt=function(){function t(t){this.client=t,this.statisticsMetadataCache=new e(200),this.statisticsEnsemblesCache=new e(200)}return t.prototype.combined=function(i,r){return u(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return[4,this.dependent(i,r)];case 1:return[2,(e=t.sent())&&e.statistics]}})})},t.prototype.individual=function(i,r){return u(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return[4,this.dependent(i,r)];case 1:return[2,(e=t.sent())&&e.individualStatistics]}})})},t.prototype.travelTimes=function(n,o){return u(this,void 0,void 0,function(){var e,i,r;return v(this,function(t){switch(t.label){case 0:return e=void 0!==o?n:null,o=o||n,i=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("traveltimes").key("apiKey").params({serviceUrl:this.client.serviceUrl}).toString(),(r=new gt(this.client,e,o)).sources&&0!=r.sources.length||r.sourceGeometries&&0!=r.sourceGeometries.length?[4,d(this.client).fetch(i,"POST",r)]:[2,null];case 1:return[2,t.sent()]}})})},t.prototype.dependent=function(o,s){return u(this,void 0,void 0,function(){var e,i,r,n;return v(this,function(t){switch(t.label){case 0:return e=void 0!==s?o:null,s=s||o,i=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("charts/dependent").key("apiKey").params({serviceUrl:this.client.serviceUrl}).toString(),(r=new gt(this.client,e,s)).sources&&0!=r.sources.length||r.sourceGeometries&&0!=r.sourceGeometries.length?[4,d(this.client).fetch(i,"POST",r)]:[2,null];case 1:return n=t.sent(),[2,new nt(n,s.statistics)]}})})},t.prototype.geometry=function(r,n){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return r?(e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("values/geometry").key("apiKey").params({serviceUrl:this.client.serviceUrl}).toString(),[4,d(this.client).fetch(e,"POST",new mt(this.client,r,n))]):[2,null];case 1:return i=t.sent(),[2,new st(i,n.statistics)]}})})},t.prototype.metadata=function(o){return u(this,void 0,void 0,function(){var e,r,i,n=this;return v(this,function(t){switch(t.label){case 0:return e=this.client.config.tilesUrl,r="number"==typeof o?o:o.id,i=e+"-"+r,[4,this.statisticsMetadataCache.get(i,function(){return u(n,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.tilesUrl).part("statistics/meta/").version().part("/"+r).key().toString(),[4,d(this.client).fetch(e)];case 1:return!(i=t.sent()).name&&i.names&&i.names.en&&(i.name=i.names.en),i.stats&&i.stats.length&&i.stats.forEach(function(t){!t.name&&t.names&&t.names.en&&(t.name=t.names.en)}),[2,i]}})})})];case 1:return[2,t.sent()]}})})},t.prototype.metadataKey=function(o,s){return u(this,void 0,void 0,function(){var e,i,r,n;return v(this,function(t){switch(t.label){case 0:return[4,this.metadata(o)];case 1:for(e=t.sent(),i=0,r=e.stats;i<r.length;i++)if(n=r[i],s.id==n.statistic_id||n.names&&n.names.en==s.name)return[2,n];return[2,null]}})})},t.prototype.tileRoute=function(t,e){var i="number"==typeof t?t:t.id,r=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.tilesUrl).part("statistics/tiles/").version().part("/"+i+"/{z}/{x}/{y}.mvt").key();return e&&0<e.length?r.params({columns:encodeURIComponent(e.map(function(t){return+t.id}).join(","))}).toString():r.toString()},t.prototype.ensembles=function(){return u(this,void 0,void 0,function(){var e,i=this;return v(this,function(t){switch(t.label){case 0:return e=this.client.config.tilesUrl,[4,this.statisticsEnsemblesCache.get(e,function(){return u(i,void 0,void 0,function(){var e,i,r,n;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.tilesUrl).part("ensemble/list/").version().key().toString(),[4,d(this.client).fetch(e,"GET")];case 1:for(r in i=t.sent())i[r]&&((n=i[r]).id=+n.id,n.groups&&n.groups.length&&n.groups.forEach(function(t){t.hierarchy=+t.hierarchy,t.id=+t.id}));return[2,i]}})})})];case 1:return[2,t.sent()]}})})},t}(),vt=function(n){function t(t,e,i){var r=n.call(this,t,e,i)||this;return delete r.inactiveSources,delete r.statisticGroupId,delete r.statisticIds,delete r.getClosestSources,delete r.useCache,i&&(i.multigraph.preAggregationPipeline&&(r.multiGraphPreAggregationPipeline=i.multigraph.preAggregationPipeline),i.multigraph.referencedStatisticIds&&(r.multiGraphReferencedStatisticIds=i.multigraph.referencedStatisticIds),i.multigraph.aggregation&&(r.multiGraphAggregationType=i.multigraph.aggregation.type||null,r.multiGraphAggregationIgnoreOutliers=i.multigraph.aggregation.ignoreOutliers||null,r.multiGraphAggregationOutlierPenalty=i.multigraph.aggregation.outlierPenalty||null,r.multiGraphAggregationMinSourcesRatio=i.multigraph.aggregation.minSourcesRatio||null,r.multiGraphAggregationMinSourcesCount=i.multigraph.aggregation.minSourcesCount||null,r.multiGraphAggregationMaxResultValueRatio=i.multigraph.aggregation.maxResultValueRatio||null,r.multiGraphAggregationMaxResultValue=i.multigraph.aggregation.maxResultValue||null,r.multiGraphAggregationFilterValuesForSourceOrigins=i.multigraph.aggregation.filterValuesForSourceOrigins||null,r.multiGraphAggregationInputParameters=i.multigraph.aggregation.aggregationInputParameters||null,r.multiGraphAggregationMathExpression=i.multigraph.aggregation.mathExpression||null,r.multiGraphAggregationGravitationExponent=i.multigraph.aggregation.gravitationExponent||null,r.multiGraphAggregationPostAggregationFactor=i.multigraph.aggregation.postAggregationFactor||null),r.multiGraphSerializationFormat=i.multigraph.serialization.format,r.multiGraphSerializationDecimalPrecision=i.multigraph.serialization.decimalPrecision,r.multiGraphSerializationMaxGeometryCount=i.multigraph.serialization.maxGeometryCount,r.multiGraphDomainType=i.multigraph.domain.type,r.multiGraphDomainEdgeAggregationType=i.multigraph.domain.edgeAggregationType,r.multiGraphDomainStatisticGroupId=i.multigraph.domain.statisticGroupId,i.multigraph.layer&&(r.multiGraphLayerType=i.multigraph.layer.type,r.multiGraphLayerGeometryDetailPerTile=i.multigraph.layer.geometryDetailPerTile,r.multiGraphLayerMinGeometryDetailLevel=i.multigraph.layer.minGeometryDetailLevel,r.multiGraphLayerMaxGeometryDetailLevel=i.multigraph.layer.maxGeometryDetailLevel,r.multiGraphLayerGeometryDetailLevel=i.multigraph.layer.geometryDetailLevel,r.multiGraphLayerCustomGeometryMergeAggregation=i.multigraph.layer.customGeometryMergeAggregation)),r}return i(t,n),t}(gt),St=function(){function t(t){this.client=t}return t.prototype.create=function(r,n){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("multigraph").key().params({serviceUrl:this.client.serviceUrl}).toString(),i=new vt(this.client,r,n),[4,d(this.client).fetchCachedData(n.useClientCache,e,"POST-RAW",JSON.stringify(i),{Accept:"text/plain"})];case 1:return[2,t.sent()]}})})},t.prototype.monolith=function(r,n){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("multigraph/monolith").key().params({serviceUrl:this.client.serviceUrl}).toString(),i=new vt(this.client,r,n),[4,d(this.client).fetchCachedData(n.useClientCache,e,"POST",i,{Accept:"application/json"})];case 1:return[2,t.sent()]}})})},t.prototype.info=function(r){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("multigraph/"+r).key().params({serviceUrl:this.client.serviceUrl}).toString(),[4,d(this.client).fetch(e,"GET")];case 1:return(i=t.sent()).boundingBoxNorthEast&&i.boundingBoxSouthWest&&(i.boundingBox={northEast:{lat:i.boundingBoxNorthEast.y,lng:i.boundingBoxNorthEast.x},southWest:{lat:i.boundingBoxSouthWest.y,lng:i.boundingBoxSouthWest.x}},delete i.boundingBoxNorthEast,delete i.boundingBoxSouthWest),[2,i]}})})},t.prototype.redo=function(i){return u(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("multigraph/"+i+"/update").key().params({serviceUrl:this.client.serviceUrl}).toString(),[4,d(this.client).fetch(e,"PATCH")];case 1:return[2,t.sent()]}})})},t.prototype.getTiledMultigraphUrl=function(t,e){return new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.statisticsUrl).part("multigraph/"+t+"/{z}/{x}/{y}."+e).key().params({serviceUrl:this.client.serviceUrl}).toString()},t}(),Tt=function(){function t(t){this.client=t}return t.prototype.fetch=function(r,n,o,s){return u(this,void 0,void 0,function(){var e,i;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.fleetsUrl).version().part("/api/key-auth/optimizations").key().toString(),i=this._createPayload(this.client,r,n,o,s),[4,d(this.client).fetch(e,"POST",i)];case 1:return[2,t.sent()]}})})},t.prototype._createPayload=function(t,e,i,r,n){return{optimizationTime:n.optimizationTime,optimizationAlgorithm:n.optimizationAlgorithm,optimizationMetadata:{costMatrixSource:n.costMatrixSource,geojsonCreation:n.geojsonCreation,unimprovedWaitingTime:n.unimprovedWaitingTime,filterOrdersWithMissedDeadline:n.filterOrdersWithMissedDeadline,filterOrdersOutsideOfValidWorkingHours:n.filterOrdersOutsideOfValidWorkingHours,prohibitFilteringOfOrdersWithDeadlinesEarlierEqualsThan:n.prohibitFilteringOfOrdersWithDeadlinesEarlierEqualsThan,secondsToPenaltyRatioForDeadlineMissed:n.secondsToPenaltyRatioForDeadlineMissed,secondsToPenaltyRatioForOutOfWorkingHours:n.secondsToPenaltyRatioForOutOfWorkingHours,timeConstraintPenaltyToTravelCostRatio:n.timeConstraintPenaltyToTravelCostRatio,longestTourPenaltyFactor:n.longestTourPenaltyFactor,nonParallelOrdersByTags:n.nonParallelOrdersByTags,travelOptions:{travelType:n.travelType,serviceKey:t.serviceKey,serviceUrl:t.serviceUrl,travelTimeFactors:n.travelTimeFactors,fallbackServiceUrl:"",edgeWeight:n.edgeWeight,maxEdgeWeight:n.maxEdgeWeight,elevation:n.elevation,rushHour:n.rushHour}},stores:e,transports:r,orders:i}},t}(),bt=function(){function t(t){this.client=t,this.basemapsLookup={Bright:"osm-bright-gl-style",Light:"positron-gl-style","Light No-Labels":"positron-nolabels-gl-style",Dark:"dark-matter-gl-style","Dark No-Labels":"dark-matter-nolabels-gl-style",Gray:"gray-gl-style","Gray No-Labels":"gray-nolabels-gl-style","Light blue":"blueberry-gl-style","Dark blue":"fiord-color-gl-style","Dark blue No-Labels":"fiord-color-nolabels-gl-style",Basic:"klokantech-basic-gl-style",Toner:"toner-gl-style"}}return Object.defineProperty(t.prototype,"basemapNames",{get:function(){return Object.keys(this.basemapsLookup)},enumerable:!0,configurable:!0}),t.prototype.getGLStyleURL=function(t){if(!t||!this.basemapsLookup[t])throw new Error("valid style name required to access Targomo basemap");return new c.UrlUtil.TargomoUrl(this.client).host(this.client.config.basemapsUrl).part(this.basemapsLookup[t]+".json").params({key:this.client.serviceKey}).toString()},t}(),Ut=function(t,e){this.esri=t,this.photon=e},wt=function(){function t(t,e,i){if(this.serviceKey=e,!t)throw new TypeError("Region parameter is missing");this.config=new r(i),t.includes("http")||t.includes("localhost")||t.includes("/")?this.serviceUrl=t:this.serviceUrl="https://api.targomo.com/"+t+"/",this.pois=new I(this),this.statistics=new yt(this),this.reachability=new pt(this),this.optimizations=new C(this),this.geocoding=new Ut(new g,new m(this)),this.polygons=new ct(this),this.routes=new dt(this),this.statefulMultigraph=new St(this),this.multigraph=new A(this),this.basemaps=new bt(this),this.fleets=new Tt(this)}return Object.defineProperty(t.prototype,"endpoint",{get:function(){var t=this.serviceUrl.split("/").filter(function(t){return!!t});return t[t.length-1]},enumerable:!0,configurable:!0}),t.prototype.metadata=function(){return u(this,void 0,void 0,function(){var e;return v(this,function(t){switch(t.label){case 0:return e=new c.UrlUtil.TargomoUrl(this).part(this.serviceUrl).version().part("/metadata/network").key().toString(),[4,d(this).fetch(e)];case 1:return[2,t.sent()]}})})},t}(),Et=H;c.geometry=Et,c.PointsOfInterestClient=I,c.ClientConfig=r,c.GeocodeEsriClient=g,c.GeocodePhotonClient=m,c.MultigraphClient=A,c.OptimizationsClient=C,c.PolygonsClient=ct,c.PolygonArray=ut,c.ReachabilityClient=pt,c.RoutesClient=dt,c.StatisticsClient=yt,c.GeocodingClients=Ut,c.TargomoClient=wt,c.FleetsClient=Tt,c.LatLng=J,c.BoundingBox=Y,c.TravelSpeedValues=Q,c.StatisticValues=tt,c.UseCacheRequestOptions=y,c.BaseRequestOptions=b,c.TravelRequestOptions=U,c.Route=rt,c.RouteSegment=it,c.StatisticsResult=nt,c.FpResult=ot,c.OptimizationResult=O,c.StatisticsGeometryResult=st,c.RequestsUtil=f,c.requests=d,c.SimpleLRU=e,c.SimpleCache=s,c.TARGOMO_ENVIRONMENT_HEADER=S,Object.defineProperty(c,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=targomo-core.umd.min.js.map |
export * from './clientConfig'; | ||
export * from './benchmarks'; | ||
export * from './geocode'; | ||
@@ -11,5 +10,4 @@ export * from './geocodePhoton'; | ||
export * from './routes'; | ||
export * from './similarity'; | ||
export * from './statistics'; | ||
export * from './targomoClient'; | ||
export * from './fleets'; |
@@ -9,4 +9,2 @@ import { PointsOfInterestClient } from './pointsOfInterest'; | ||
import { RoutesClient } from './routes'; | ||
import { SimilarityClient } from './similarity'; | ||
import { BenchmarksClient } from './benchmarks'; | ||
import { ClientConfig, ClientOptions } from './clientConfig'; | ||
@@ -35,4 +33,2 @@ import { StatefulMultigraphClient } from './statefulMultigraph'; | ||
readonly routes: RoutesClient; | ||
readonly similarity: SimilarityClient; | ||
readonly benchmarks: BenchmarksClient; | ||
readonly statefulMultigraph: StatefulMultigraphClient; | ||
@@ -39,0 +35,0 @@ readonly multigraph: MultigraphClient; |
@@ -42,6 +42,6 @@ import { TravelRequestOptions, UseCacheRequestOptions } from '../requestOptions'; | ||
export interface MultigraphSpecificRequestOptions { | ||
preAggregationPipeline: { | ||
preAggregationPipeline?: { | ||
[pipelineName: string]: MultigraphAggregationOptions; | ||
}; | ||
referencedStatisticIds: { | ||
referencedStatisticIds?: { | ||
[parameterName: string]: number; | ||
@@ -55,3 +55,3 @@ }; | ||
}; | ||
domain: { | ||
domain?: { | ||
type: 'edge' | 'node' | 'statistic_geometry'; | ||
@@ -58,0 +58,0 @@ edgeAggregationType?: 'min' | 'max' | 'mean'; |
@@ -174,19 +174,2 @@ import { Geometry } from 'geojson'; | ||
/** | ||
* | ||
*/ | ||
export interface BenchmarkCriteria { | ||
source: string; | ||
minEnd: number; | ||
minStart: number; | ||
factor: number; | ||
} | ||
/** | ||
* | ||
*/ | ||
export interface SimilarityCriteria { | ||
source: string; | ||
minutes: number; | ||
factor: number; | ||
} | ||
/** | ||
* A lat, lng position with the addition of an id | ||
@@ -193,0 +176,0 @@ */ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1255568
70
10306