UNPKG

sygic-custom-url

Version:
9 lines 4.67 kB
/** * sygic-custom-url - sygic custom url * @version v1.0.9 * @author frankkoenigstein * @link https://github.com/frankkoenigstein/sygic-custom-url#readme * @license Apache-2.0 */ !function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.ticktock=r():t.ticktock=r()}(this,function(){return function(t){function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}var e={};return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="",r(r.s=0)}([function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(t){for(var e in t)r.hasOwnProperty(e)||(r[e]=t[e])}(e(1))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ACTION_TYPE={DRIVE:"drive",SHOW:"show",WALK:"walk"},r.ACTION={ACTIVATE:"activate",ADDRESS:"address",BACK_BUTTON:"back_button",COORDINATE:"coordinate",COORDINATEADDR:"coordinateaddr",DEVICECODE:"deviceCode",GPSLOG:"gpslog",LOGIN:"login",MYSYGIC:"mysygic",MYSYGICBUY:"mysygicbuy",MYSYGICPRODUCT:"mysygicproduct",RESTORE:"restore",ROUTE:"route",SETTINGSOVERWRITE:"settingsOverwrite",TRUCKSETTINGS:"truckSettings",UPDATE:"update",URL:"url"},r.TRUCK_ROUTING_TYPE={CAMPER:"cmp",CAR:"car",TRUCK:"tru",VAN:"van"},r.SCHEME="com.sygic.aura",r.ACTIONS_SEPARATOR="&&&",r.OPTIONS_SEPARATOR="|",r.TRUCK_SETTINGS_SEPARATOR="&";var o=function(){function t(){}return t.prototype.showAddress=function(t,e,o,n,u){return this.genCustomUrl(r.ACTION.ADDRESS,t,e,o,n,u,r.ACTION_TYPE.SHOW)},t.prototype.driveAddress=function(t,e,o,n,u){return this.genCustomUrl(r.ACTION.ADDRESS,t,e,o,n,u,r.ACTION_TYPE.DRIVE)},t.prototype.walkAddress=function(t,e,o,n,u){return this.genCustomUrl(r.ACTION.ADDRESS,t,e,o,n,u,r.ACTION_TYPE.WALK)},t.prototype.showCoordinates=function(t,e){return this.genCustomUrl(r.ACTION.COORDINATE,t,e,r.ACTION_TYPE.SHOW)},t.prototype.driveCoordinates=function(t,e){return this.genCustomUrl(r.ACTION.COORDINATE,t,e,r.ACTION_TYPE.DRIVE)},t.prototype.walkCoordinates=function(t,e){return this.genCustomUrl(r.ACTION.COORDINATE,t,e,r.ACTION_TYPE.WALK)},t.prototype.driveCoordinateaddr=function(t,e,o){return this.genCustomUrl(r.ACTION.COORDINATEADDR,t,e,o,r.ACTION_TYPE.DRIVE)},t.prototype.route=function(t){return this.genCustomUrl(r.ACTION.ROUTE,t)},t.prototype.url=function(t){return this.genCustomUrl(r.ACTION.URL,t)},t.prototype.activate=function(t){return this.genCustomUrl(r.ACTION.ACTIVATE,t)},t.prototype.login=function(t,e){return this.genCustomUrl(r.ACTION.LOGIN,t,e)},t.prototype.update=function(t){return this.genCustomUrl(r.ACTION.UPDATE,t)},t.prototype.mysygic=function(){return this.genCustomUrl(r.ACTION.MYSYGIC)},t.prototype.mysygicproduct=function(t){return this.genCustomUrl(r.ACTION.MYSYGICPRODUCT,t)},t.prototype.mysygicbuy=function(t){return this.genCustomUrl(r.ACTION.MYSYGICBUY,t)},t.prototype.restore=function(){return this.genCustomUrl(r.ACTION.RESTORE)},t.prototype.gpslog=function(t){return this.genCustomUrl(r.ACTION.GPSLOG,t)},t.prototype.truckSettings=function(t){var e=Object.keys(t).map(function(r){return r+"="+t[r]}).join(r.TRUCK_SETTINGS_SEPARATOR);return this.genCustomUrl(r.ACTION.TRUCKSETTINGS,e)},t.prototype.backButton=function(t){return this.genCustomUrl(r.ACTION.BACK_BUTTON,t)},t.prototype.settingsOverwrite=function(t){return this.genCustomUrl(r.ACTION.SETTINGSOVERWRITE,encodeURIComponent(t))},t.prototype.deviceCode=function(){return this.genCustomUrl(r.ACTION.DEVICECODE)},t.prototype.multipleActions=function(t){var r=this.prepareActions(t);return this.getCustomUrl(r)},t.prototype.genCustomUrl=function(t){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];var o=this.prepareAction.apply(this,[t].concat(r));return this.getCustomUrl(o)},t.prototype.getCustomUrl=function(t){return r.SCHEME+"://"+t},t.prototype.prepareActions=function(t){var e=this;return t.map(function(t){var r=t.action,o=t.args;return e.prepareAction.apply(e,[r].concat(o))}).join(r.ACTIONS_SEPARATOR)},t.prototype.prepareAction=function(t){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return r.unshift(t),this.prepareOptions(r)},t.prototype.prepareOptions=function(t){return t.filter(function(t){return null!==t&&void 0!==t}).join(r.OPTIONS_SEPARATOR)},t}();r.CustomUrlService=o}])}); //# sourceMappingURL=sygic-custom-url.min.js.map