diff --git a/index.html b/index.html index e32f93cd2bb6fd7f2ef20beac02222a72eda7881..61628666e177f035fa6e6ed5841f67b6ee9e7d68 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212"><meta name="color-scheme" content="only dark">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.9e315d75847abe91516b.js"></script><script src="app/ecolyo.b38f82c9e94bcd9ce7c0.js"></script></div></body></html> \ No newline at end of file +<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo</title><link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA Chrome --><link rel="icon" sizes="192x192" href="/android-chrome-192x192.png"><link rel="icon" sizes="512x512" href="/android-chrome-512x512.png"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212"><meta name="color-scheme" content="only dark">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="vendors/ecolyo.f61773b590eccf8409d4.js"></script><script src="app/ecolyo.b38f82c9e94bcd9ce7c0.js"></script></div></body></html> \ No newline at end of file diff --git a/public/ecolyo.87f94430460a36d39c04.js b/public/ecolyo.a9a39dd017620b189cd9.js similarity index 99% rename from public/ecolyo.87f94430460a36d39c04.js rename to public/ecolyo.a9a39dd017620b189cd9.js index b72773c519c897d634a4bca5381cb941b282d5fd..2a43286ec709f16a63c2b316f42422f99500112e 100644 --- a/public/ecolyo.87f94430460a36d39c04.js +++ b/public/ecolyo.a9a39dd017620b189cd9.js @@ -3029,154 +3029,6 @@ function startOfWeek (dirtyDate, dirtyOptions) { module.exports = startOfWeek -/***/ }), - -/***/ "/K1E": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "checkApp", { - enumerable: true, - get: function get() { - return _apps.checkApp; - } -}); -Object.defineProperty(exports, "getDeviceName", { - enumerable: true, - get: function get() { - return _device.getDeviceName; - } -}); -Object.defineProperty(exports, "getFlagshipMetadata", { - enumerable: true, - get: function get() { - return _flagship.getFlagshipMetadata; - } -}); -Object.defineProperty(exports, "getPlatform", { - enumerable: true, - get: function get() { - return _platform.getPlatform; - } -}); -Object.defineProperty(exports, "hasDevicePlugin", { - enumerable: true, - get: function get() { - return _plugins.hasDevicePlugin; - } -}); -Object.defineProperty(exports, "hasInAppBrowserPlugin", { - enumerable: true, - get: function get() { - return _plugins.hasInAppBrowserPlugin; - } -}); -Object.defineProperty(exports, "hasNetworkInformationPlugin", { - enumerable: true, - get: function get() { - return _plugins.hasNetworkInformationPlugin; - } -}); -Object.defineProperty(exports, "hasSafariPlugin", { - enumerable: true, - get: function get() { - return _plugins.hasSafariPlugin; - } -}); -Object.defineProperty(exports, "isAndroid", { - enumerable: true, - get: function get() { - return _platform.isAndroid; - } -}); -Object.defineProperty(exports, "isAndroidApp", { - enumerable: true, - get: function get() { - return _platform.isAndroidApp; - } -}); -Object.defineProperty(exports, "isCordova", { - enumerable: true, - get: function get() { - return _cordova.isCordova; - } -}); -Object.defineProperty(exports, "isFlagshipApp", { - enumerable: true, - get: function get() { - return _flagship.isFlagshipApp; - } -}); -Object.defineProperty(exports, "isIOS", { - enumerable: true, - get: function get() { - return _platform.isIOS; - } -}); -Object.defineProperty(exports, "isIOSApp", { - enumerable: true, - get: function get() { - return _platform.isIOSApp; - } -}); -Object.defineProperty(exports, "isMobile", { - enumerable: true, - get: function get() { - return _platform.isMobile; - } -}); -Object.defineProperty(exports, "isMobileApp", { - enumerable: true, - get: function get() { - return _platform.isMobileApp; - } -}); -Object.defineProperty(exports, "isWebApp", { - enumerable: true, - get: function get() { - return _platform.isWebApp; - } -}); -Object.defineProperty(exports, "nativeLinkOpen", { - enumerable: true, - get: function get() { - return _link.nativeLinkOpen; - } -}); -Object.defineProperty(exports, "openDeeplinkOrRedirect", { - enumerable: true, - get: function get() { - return _deeplink.openDeeplinkOrRedirect; - } -}); -Object.defineProperty(exports, "startApp", { - enumerable: true, - get: function get() { - return _apps.startApp; - } -}); - -var _platform = __webpack_require__("AzAX"); - -var _device = __webpack_require__("m6Tf"); - -var _apps = __webpack_require__("yL+W"); - -var _plugins = __webpack_require__("QJIl"); - -var _cordova = __webpack_require__("dlno"); - -var _link = __webpack_require__("tDKi"); - -var _deeplink = __webpack_require__("AIES"); - -var _flagship = __webpack_require__("lNPj"); - /***/ }), /***/ "/Mg5": @@ -43242,129 +43094,6 @@ var _default = exports.default = Icon; /***/ }), -/***/ "AIES": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.openDeeplinkOrRedirect = void 0; - -/** - * This file is used to open the native app from a webapp - * if this native app is installed - * - * From a webapp, we don't have any clue if a native app is installed. - * The only way to know that, is to try to open the custom link - * (aka cozydrive://) and if nothing happens (no blur) we redirect to - * the callback - * - * Firefox tries to open custom link, so we need to create an iframe - * to detect if this is supported or not - */ -var _createHiddenIframe = function _createHiddenIframe(target, uri, randomId) { - var iframe = document.createElement('iframe'); - iframe.src = uri; - iframe.id = "hiddenIframe_".concat(randomId); - iframe.style.display = 'none'; - target.appendChild(iframe); - return iframe; -}; - -var openUriWithHiddenFrame = function openUriWithHiddenFrame(uri, failCb) { - var randomId = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5); - window.addEventListener('blur', onBlur); - - var iframe = _createHiddenIframe(document.body, 'about:blank', randomId); - - var timeout = setTimeout(function () { - failCb(); - window.removeEventListener('blur', onBlur); - iframe.parentElement.removeChild(iframe); - }, 500); - - function onBlur() { - clearTimeout(timeout); - window.removeEventListener('blur', onBlur); - iframe.parentElement.removeChild(iframe); - } - - iframe.contentWindow.location.href = uri; -}; - -var openUriWithTimeoutHack = function openUriWithTimeoutHack(uri, failCb) { - var timeout = setTimeout(function () { - failCb(); - target.removeEventListener('blur', onBlur); - }, 500); // handle page running in an iframe (blur must be registered with top level window) - - var target = window; - - while (target != target.parent) { - target = target.parent; - } - - target.addEventListener('blur', onBlur); - - function onBlur() { - clearTimeout(timeout); - target.removeEventListener('blur', onBlur); - } // Why is an uri assigned to location object? - - - window.location = uri; -}; - -var openUriWithMsLaunchUri = function openUriWithMsLaunchUri(uri, failCb) { - navigator.msLaunchUri(uri, undefined, failCb); -}; - -var checkBrowser = function checkBrowser() { - var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; - var ua = navigator.userAgent.toLowerCase(); - var isSafari = ua.includes('safari') && !ua.includes('chrome') || Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; - var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; - var isIOS122 = isIOS && (ua.includes('os 12_2') || ua.includes('os 12_3')); - return { - isOpera: isOpera, - isFirefox: typeof window.InstallTrigger !== 'undefined', - isSafari: isSafari, - isChrome: !!window.chrome && !isOpera, - isIOS122: isIOS122, - isIOS: isIOS - }; -}; -/** - * - * @param {String} deeplink (cozydrive://) - * @param {String} failCb (http://drive.cozy.ios) - */ - - -var openDeeplinkOrRedirect = function openDeeplinkOrRedirect(deeplink, failCb) { - if (navigator.msLaunchUri) { - // for IE and Edge in Win 8 and Win 10 - openUriWithMsLaunchUri(deeplink, failCb); - } else { - var browser = checkBrowser(); - - if (browser.isChrome || browser.isIOS && !browser.isIOS122) { - openUriWithTimeoutHack(deeplink, failCb); - } else if (browser.isSafari && !browser.isIOS122 || browser.isFirefox) { - openUriWithHiddenFrame(deeplink, failCb); - } else { - failCb(); - } - } -}; - -exports.openDeeplinkOrRedirect = openDeeplinkOrRedirect; - -/***/ }), - /***/ "AJH6": /***/ (function(module, exports) { @@ -46086,80 +45815,6 @@ module.exports = function fill(value /* , start = 0, end = @length */) { }; -/***/ }), - -/***/ "AzAX": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isWebApp = exports.isMobileApp = exports.isMobile = exports.isIOSApp = exports.isIOS = exports.isAndroidApp = exports.isAndroid = exports.getPlatform = void 0; - -var _cordova = __webpack_require__("dlno"); - -var ANDROID_PLATFORM = 'android'; -var IOS_PLATFORM = 'ios'; -var WEB_PLATFORM = 'web'; - -var getPlatform = function getPlatform() { - return (0, _cordova.isCordova)() ? window.cordova.platformId : WEB_PLATFORM; -}; - -exports.getPlatform = getPlatform; - -var isPlatform = function isPlatform(platform) { - return getPlatform() === platform; -}; - -var isIOSApp = function isIOSApp() { - return isPlatform(IOS_PLATFORM); -}; - -exports.isIOSApp = isIOSApp; - -var isAndroidApp = function isAndroidApp() { - return isPlatform(ANDROID_PLATFORM); -}; - -exports.isAndroidApp = isAndroidApp; - -var isWebApp = function isWebApp() { - return isPlatform(WEB_PLATFORM); -}; - -exports.isWebApp = isWebApp; - -var isMobileApp = function isMobileApp() { - return (0, _cordova.isCordova)(); -}; // return if is on an Android Device (native or browser) - - -exports.isMobileApp = isMobileApp; - -var isAndroid = function isAndroid() { - return window.navigator.userAgent && window.navigator.userAgent.indexOf('Android') >= 0; -}; // return if is on an iOS Device (native or browser) - - -exports.isAndroid = isAndroid; - -var isIOS = function isIOS() { - return window.navigator.userAgent && /iPad|iPhone|iPod/.test(window.navigator.userAgent); -}; // isMobile checks if the user is on a smartphone : native app or browser - - -exports.isIOS = isIOS; - -var isMobile = function isMobile() { - return isAndroid() || isIOS(); -}; - -exports.isMobile = isMobile; - /***/ }), /***/ "B/g2": @@ -90773,7 +90428,7 @@ var _createClass2 = _interopRequireDefault(__webpack_require__("Zvb3")); var _microee = _interopRequireDefault(__webpack_require__("GIvT")); -var _cozyDeviceHelper = __webpack_require__("/K1E"); +var _cozyDeviceHelper = __webpack_require__("Kv7L"); var _RetryManager = _interopRequireDefault(__webpack_require__("oeo/")); @@ -92978,60 +92633,6 @@ module.exports = function shimEntries() { }; -/***/ }), - -/***/ "QJIl": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.hasSafariPlugin = exports.hasNetworkInformationPlugin = exports.hasInAppBrowserPlugin = exports.hasDevicePlugin = void 0; - -var _cordova = __webpack_require__("dlno"); - -var hasDevicePlugin = function hasDevicePlugin() { - return (0, _cordova.isCordova)() && window.device !== undefined; -}; - -exports.hasDevicePlugin = hasDevicePlugin; - -var hasInAppBrowserPlugin = function hasInAppBrowserPlugin() { - return (0, _cordova.isCordova)() && window.cordova.InAppBrowser !== undefined; -}; - -exports.hasInAppBrowserPlugin = hasInAppBrowserPlugin; - -var hasSafariPlugin = function hasSafariPlugin() { - return new Promise(function (resolve) { - if (!(0, _cordova.isCordova)() || window.SafariViewController === undefined) { - resolve(false); - return; - } - - window.SafariViewController.isAvailable(function (available) { - return resolve(available); - }); - }); -}; -/** - * Check if the Cordova's cordova-plugin-network-information plugin is installed - * @see https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-network-information/ - * @returns {boolean} - */ - - -exports.hasSafariPlugin = hasSafariPlugin; - -var hasNetworkInformationPlugin = function hasNetworkInformationPlugin() { - return (0, _cordova.isCordova)() && window.navigator.connection !== undefined; -}; - -exports.hasNetworkInformationPlugin = hasNetworkInformationPlugin; - /***/ }), /***/ "QJRf": @@ -129349,26 +128950,6 @@ module.exports = JSON.parse("{\"nationalities\":{\"AD\":\"Andorran\",\"AE\":\"É /***/ }), -/***/ "dlno": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isCordova = void 0; - -// cordova -var isCordova = function isCordova() { - return typeof window !== 'undefined' && window.cordova !== undefined; -}; - -exports.isCordova = isCordova; - -/***/ }), - /***/ "dodI": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -150245,54 +149826,6 @@ module.exports = JSON.parse("{\"country\":{\"foreign\":\"Étranger\"},\"Scan\":{ /***/ }), -/***/ "lNPj": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _interopRequireDefault = __webpack_require__("jm00"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isFlagshipApp = exports.getFlagshipMetadata = exports.FlagshipRoutes = void 0; - -var _cozyLogger = _interopRequireDefault(__webpack_require__("rUPj")); - -var FlagshipRoutes; -exports.FlagshipRoutes = FlagshipRoutes; - -(function (FlagshipRoutes) { - FlagshipRoutes["Home"] = "home"; - FlagshipRoutes["Cozyapp"] = "cozyapp"; - FlagshipRoutes["Authenticate"] = "authenticate"; - FlagshipRoutes["Onboarding"] = "onboarding"; - FlagshipRoutes["Stack"] = "stack"; -})(FlagshipRoutes || (exports.FlagshipRoutes = FlagshipRoutes = {})); - -var getGlobalWindow = function getGlobalWindow() { - return typeof window !== 'undefined' ? window : ((0, _cozyLogger.default)('error', "\"window\" is not defined. This means that getGlobalWindow() shouldn't have been called and investigation should be done to prevent this call"), undefined); -}; - -var getFlagshipMetadata = function getFlagshipMetadata() { - var _getGlobalWindow$cozy, _getGlobalWindow, _getGlobalWindow$cozy2; - - return (_getGlobalWindow$cozy = (_getGlobalWindow = getGlobalWindow()) === null || _getGlobalWindow === void 0 ? void 0 : (_getGlobalWindow$cozy2 = _getGlobalWindow.cozy) === null || _getGlobalWindow$cozy2 === void 0 ? void 0 : _getGlobalWindow$cozy2.flagship) !== null && _getGlobalWindow$cozy !== void 0 ? _getGlobalWindow$cozy : {}; -}; - -exports.getFlagshipMetadata = getFlagshipMetadata; - -var isFlagshipApp = function isFlagshipApp() { - var _getGlobalWindow2, _getGlobalWindow2$coz; - - return ((_getGlobalWindow2 = getGlobalWindow()) === null || _getGlobalWindow2 === void 0 ? void 0 : (_getGlobalWindow2$coz = _getGlobalWindow2.cozy) === null || _getGlobalWindow2$coz === void 0 ? void 0 : _getGlobalWindow2$coz.flagship) !== undefined; -}; - -exports.isFlagshipApp = isFlagshipApp; - -/***/ }), - /***/ "lPmf": /***/ (function(module, exports, __webpack_require__) { @@ -154092,64 +153625,6 @@ if(false) {} /***/ }), -/***/ "m6Tf": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _interopRequireDefault = __webpack_require__("jm00"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getDeviceName = void 0; - -var _capitalize = _interopRequireDefault(__webpack_require__("13ub")); - -var _cordova = __webpack_require__("dlno"); - -var _plugins = __webpack_require__("QJIl"); - -var _platform = __webpack_require__("AzAX"); - -var DEFAULT_DEVICE = 'Device'; - -// device -var getAppleModel = function getAppleModel(identifier) { - var devices = ['iPhone', 'iPad', 'Watch', 'AppleTV']; - - for (var _i = 0, _devices = devices; _i < _devices.length; _i++) { - var _device = _devices[_i]; - - if (identifier.match(new RegExp(_device))) { - return _device; - } - } - - return DEFAULT_DEVICE; -}; - -var getDeviceName = function getDeviceName() { - if (!(0, _plugins.hasDevicePlugin)()) { - if ((0, _cordova.isCordova)()) { - console.warn('You should install `cordova-plugin-device`.'); // eslint-disable-line no-console - } - - return DEFAULT_DEVICE; - } - - var _window$device = window.device, - manufacturer = _window$device.manufacturer, - originalModel = _window$device.model; - var model = (0, _platform.isIOSApp)() ? getAppleModel(originalModel) : originalModel; - return "".concat((0, _capitalize.default)(manufacturer), " ").concat(model); -}; - -exports.getDeviceName = getDeviceName; - -/***/ }), - /***/ "m7t9": /***/ (function(module, exports, __webpack_require__) { @@ -198436,91 +197911,6 @@ var groupBy = createAggregator(function(result, value, key) { module.exports = groupBy; -/***/ }), - -/***/ "tDKi": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _interopRequireDefault = __webpack_require__("jm00"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.nativeLinkOpen = void 0; - -var _regenerator = _interopRequireDefault(__webpack_require__("hJxD")); - -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__("HZZ/")); - -var _plugins = __webpack_require__("QJIl"); - -var nativeLinkOpen = /*#__PURE__*/function () { - var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) { - var url, target, options; - return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - url = _ref.url; - _context.next = 3; - return (0, _plugins.hasSafariPlugin)(); - - case 3: - _context.t0 = _context.sent; - - if (!_context.t0) { - _context.next = 6; - break; - } - - _context.t0 = window.SafariViewController; - - case 6: - if (!_context.t0) { - _context.next = 10; - break; - } - - window.SafariViewController.show({ - url: url, - transition: 'curl' - }, function (result) { - if (result.event === 'closed') { - window.SafariViewController.hide(); - } - }, function () { - window.SafariViewController.hide(); - }); - _context.next = 11; - break; - - case 10: - if ((0, _plugins.hasInAppBrowserPlugin)()) { - target = '_blank'; - options = 'clearcache=yes,zoom=no'; - window.cordova.InAppBrowser.open(url, target, options); - } else { - window.location = url; - } - - case 11: - case "end": - return _context.stop(); - } - } - }, _callee); - })); - - return function nativeLinkOpen(_x) { - return _ref2.apply(this, arguments); - }; -}(); - -exports.nativeLinkOpen = nativeLinkOpen; - /***/ }), /***/ "tEOf": @@ -212868,160 +212258,6 @@ __webpack_require__("AvzS")('Int16', 2, function (init) { }); -/***/ }), - -/***/ "yL+W": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _interopRequireDefault = __webpack_require__("jm00"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.startApp = exports.default = exports.checkApp = void 0; - -var _regenerator = _interopRequireDefault(__webpack_require__("hJxD")); - -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__("HZZ/")); - -var _platform = __webpack_require__("AzAX"); - -var cordovaPluginIsInstalled = function cordovaPluginIsInstalled() { - return window.startApp; -}; - -/** - * Normalize startApp params for Android and iOS - */ -var getParams = function getParams(_ref) { - var appId = _ref.appId, - uri = _ref.uri; - - if ((0, _platform.isAndroidApp)()) { - return { - package: appId - }; - } else { - return uri; - } -}; - -var exported = {}; -/** - * Start an application if it is installed on the phone - * @returns Promise - False if the application was not able to be started - */ - -var startApp = exported.startApp = /*#__PURE__*/function () { - var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(appInfo) { - var startAppPlugin, isAppInstalled, params; - return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - startAppPlugin = window.startApp; - _context.next = 3; - return exported.checkApp(appInfo); - - case 3: - isAppInstalled = _context.sent; - - if (!isAppInstalled) { - _context.next = 9; - break; - } - - params = getParams(appInfo); - return _context.abrupt("return", new Promise(function (resolve, reject) { - if (!cordovaPluginIsInstalled()) { - reject(new Error("Cordova plugin 'com.lampa.startapp' is not installed. This plugin is needed to start a native app. Required by cozy-bar")); - return; - } - - startAppPlugin.set(params).start(resolve, reject); - })); - - case 9: - return _context.abrupt("return", false); - - case 10: - case "end": - return _context.stop(); - } - } - }, _callee); - })); - - return function (_x) { - return _ref2.apply(this, arguments); - }; -}(); -/** - * Check that an application is installed on the phone - * @returns Promise - Promise containing information on the application - * - * @example - * > checkApp({ appId: 'io.cozy.drive.mobile', uri: 'cozydrive://' }) - * Promise.resolve({ - * versionName: "0.9.2", - * packageName: "io.cozy.drive.mobile", - * versionCode: 902, - * applicationInfo: "ApplicationInfo{70aa0ef io.cozy.drive.mobile}" - * }) - */ - - -exports.startApp = startApp; - -var checkApp = exported.checkApp = /*#__PURE__*/function () { - var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(appInfo) { - var startAppPlugin, params; - return _regenerator.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - startAppPlugin = window.startApp; - params = getParams(appInfo); - return _context2.abrupt("return", new Promise(function (resolve, reject) { - if (!cordovaPluginIsInstalled()) { - reject(new Error("Cordova plugin 'com.lampa.startapp' is not installed.")); - return; - } - - startAppPlugin.set(params).check(function (infos) { - return resolve(infos === 'OK' ? true : infos); - }, function (error) { - if (error === false || error.indexOf('NameNotFoundException') === 0) { - // Plugin returns an error 'NameNotFoundException' on Android and - // false on iOS when an application is not found. - // We prefer to always return false - resolve(false); - } else { - reject(error); - } - }); - })); - - case 3: - case "end": - return _context2.stop(); - } - } - }, _callee2); - })); - - return function (_x2) { - return _ref3.apply(this, arguments); - }; -}(); - -exports.checkApp = checkApp; -var _default = exported; -exports.default = _default; - /***/ }), /***/ "yP9i": diff --git a/public/index.html b/public/index.html index e34ee087f9aa97d0aa56b9ee96b5122bac99c2c4..e5e25fca9c060a056ce00181a3aed658e44b2bac 100644 --- a/public/index.html +++ b/public/index.html @@ -1 +1 @@ -<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo | Désabonnement</title><link rel="icon" type="image/png" href="public/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="public/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="mask-icon" href="public/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="public/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="public/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212"><meta name="color-scheme" content="only dark">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="../public/ecolyo.87f94430460a36d39c04.js"></script></div></body></html> \ No newline at end of file +<!DOCTYPE html><html lang="{{.Locale}}"><head><meta charset="utf-8"><title>Ecolyo | Désabonnement</title><link rel="icon" type="image/png" href="public/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="public/favicon-16x16.png" sizes="16x16"><!-- PWA Manifest --><link rel="mask-icon" href="public/safari-pinned-tab.svg" color="#297EF2"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,viewport-fit=cover"><!-- PWA iOS --><link rel="apple-touch-icon" sizes="180x180" href="public/apple-touch-icon.png"><link rel="apple-touch-startup-image" href="public/apple-touch-icon.png"><meta name="apple-mobile-web-app-title" content="Ecolyo"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><!-- PWA Colors --><meta name="theme-color" content="#343641"><meta name="background-color" content="#121212"><meta name="color-scheme" content="only dark">{{.ThemeCSS}} {{.CozyBar}}<script src="//{{.Domain}}/assets/js/piwik.js"></script></head><body><div role="application" class="application" data-cozy="{{.CozyData}}"><script src="../public/ecolyo.a9a39dd017620b189cd9.js"></script></div></body></html> \ No newline at end of file diff --git a/vendors/ecolyo.9e315d75847abe91516b.js b/vendors/ecolyo.f61773b590eccf8409d4.js similarity index 99% rename from vendors/ecolyo.9e315d75847abe91516b.js rename to vendors/ecolyo.f61773b590eccf8409d4.js index 286cf83f38a6a687a23736d4253cc6bd275c354a..98c0c5b155d1e440109066d4c37965a1fe90587c 100644 --- a/vendors/ecolyo.9e315d75847abe91516b.js +++ b/vendors/ecolyo.f61773b590eccf8409d4.js @@ -9749,154 +9749,6 @@ function startOfWeek (dirtyDate, dirtyOptions) { module.exports = startOfWeek -/***/ }), - -/***/ "/K1E": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "checkApp", { - enumerable: true, - get: function get() { - return _apps.checkApp; - } -}); -Object.defineProperty(exports, "getDeviceName", { - enumerable: true, - get: function get() { - return _device.getDeviceName; - } -}); -Object.defineProperty(exports, "getFlagshipMetadata", { - enumerable: true, - get: function get() { - return _flagship.getFlagshipMetadata; - } -}); -Object.defineProperty(exports, "getPlatform", { - enumerable: true, - get: function get() { - return _platform.getPlatform; - } -}); -Object.defineProperty(exports, "hasDevicePlugin", { - enumerable: true, - get: function get() { - return _plugins.hasDevicePlugin; - } -}); -Object.defineProperty(exports, "hasInAppBrowserPlugin", { - enumerable: true, - get: function get() { - return _plugins.hasInAppBrowserPlugin; - } -}); -Object.defineProperty(exports, "hasNetworkInformationPlugin", { - enumerable: true, - get: function get() { - return _plugins.hasNetworkInformationPlugin; - } -}); -Object.defineProperty(exports, "hasSafariPlugin", { - enumerable: true, - get: function get() { - return _plugins.hasSafariPlugin; - } -}); -Object.defineProperty(exports, "isAndroid", { - enumerable: true, - get: function get() { - return _platform.isAndroid; - } -}); -Object.defineProperty(exports, "isAndroidApp", { - enumerable: true, - get: function get() { - return _platform.isAndroidApp; - } -}); -Object.defineProperty(exports, "isCordova", { - enumerable: true, - get: function get() { - return _cordova.isCordova; - } -}); -Object.defineProperty(exports, "isFlagshipApp", { - enumerable: true, - get: function get() { - return _flagship.isFlagshipApp; - } -}); -Object.defineProperty(exports, "isIOS", { - enumerable: true, - get: function get() { - return _platform.isIOS; - } -}); -Object.defineProperty(exports, "isIOSApp", { - enumerable: true, - get: function get() { - return _platform.isIOSApp; - } -}); -Object.defineProperty(exports, "isMobile", { - enumerable: true, - get: function get() { - return _platform.isMobile; - } -}); -Object.defineProperty(exports, "isMobileApp", { - enumerable: true, - get: function get() { - return _platform.isMobileApp; - } -}); -Object.defineProperty(exports, "isWebApp", { - enumerable: true, - get: function get() { - return _platform.isWebApp; - } -}); -Object.defineProperty(exports, "nativeLinkOpen", { - enumerable: true, - get: function get() { - return _link.nativeLinkOpen; - } -}); -Object.defineProperty(exports, "openDeeplinkOrRedirect", { - enumerable: true, - get: function get() { - return _deeplink.openDeeplinkOrRedirect; - } -}); -Object.defineProperty(exports, "startApp", { - enumerable: true, - get: function get() { - return _apps.startApp; - } -}); - -var _platform = __webpack_require__("AzAX"); - -var _device = __webpack_require__("m6Tf"); - -var _apps = __webpack_require__("yL+W"); - -var _plugins = __webpack_require__("QJIl"); - -var _cordova = __webpack_require__("dlno"); - -var _link = __webpack_require__("tDKi"); - -var _deeplink = __webpack_require__("AIES"); - -var _flagship = __webpack_require__("lNPj"); - /***/ }), /***/ "/Kh4": @@ -87308,129 +87160,6 @@ var _default = exports.default = Icon; /***/ }), -/***/ "AIES": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.openDeeplinkOrRedirect = void 0; - -/** - * This file is used to open the native app from a webapp - * if this native app is installed - * - * From a webapp, we don't have any clue if a native app is installed. - * The only way to know that, is to try to open the custom link - * (aka cozydrive://) and if nothing happens (no blur) we redirect to - * the callback - * - * Firefox tries to open custom link, so we need to create an iframe - * to detect if this is supported or not - */ -var _createHiddenIframe = function _createHiddenIframe(target, uri, randomId) { - var iframe = document.createElement('iframe'); - iframe.src = uri; - iframe.id = "hiddenIframe_".concat(randomId); - iframe.style.display = 'none'; - target.appendChild(iframe); - return iframe; -}; - -var openUriWithHiddenFrame = function openUriWithHiddenFrame(uri, failCb) { - var randomId = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5); - window.addEventListener('blur', onBlur); - - var iframe = _createHiddenIframe(document.body, 'about:blank', randomId); - - var timeout = setTimeout(function () { - failCb(); - window.removeEventListener('blur', onBlur); - iframe.parentElement.removeChild(iframe); - }, 500); - - function onBlur() { - clearTimeout(timeout); - window.removeEventListener('blur', onBlur); - iframe.parentElement.removeChild(iframe); - } - - iframe.contentWindow.location.href = uri; -}; - -var openUriWithTimeoutHack = function openUriWithTimeoutHack(uri, failCb) { - var timeout = setTimeout(function () { - failCb(); - target.removeEventListener('blur', onBlur); - }, 500); // handle page running in an iframe (blur must be registered with top level window) - - var target = window; - - while (target != target.parent) { - target = target.parent; - } - - target.addEventListener('blur', onBlur); - - function onBlur() { - clearTimeout(timeout); - target.removeEventListener('blur', onBlur); - } // Why is an uri assigned to location object? - - - window.location = uri; -}; - -var openUriWithMsLaunchUri = function openUriWithMsLaunchUri(uri, failCb) { - navigator.msLaunchUri(uri, undefined, failCb); -}; - -var checkBrowser = function checkBrowser() { - var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; - var ua = navigator.userAgent.toLowerCase(); - var isSafari = ua.includes('safari') && !ua.includes('chrome') || Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; - var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; - var isIOS122 = isIOS && (ua.includes('os 12_2') || ua.includes('os 12_3')); - return { - isOpera: isOpera, - isFirefox: typeof window.InstallTrigger !== 'undefined', - isSafari: isSafari, - isChrome: !!window.chrome && !isOpera, - isIOS122: isIOS122, - isIOS: isIOS - }; -}; -/** - * - * @param {String} deeplink (cozydrive://) - * @param {String} failCb (http://drive.cozy.ios) - */ - - -var openDeeplinkOrRedirect = function openDeeplinkOrRedirect(deeplink, failCb) { - if (navigator.msLaunchUri) { - // for IE and Edge in Win 8 and Win 10 - openUriWithMsLaunchUri(deeplink, failCb); - } else { - var browser = checkBrowser(); - - if (browser.isChrome || browser.isIOS && !browser.isIOS122) { - openUriWithTimeoutHack(deeplink, failCb); - } else if (browser.isSafari && !browser.isIOS122 || browser.isFirefox) { - openUriWithHiddenFrame(deeplink, failCb); - } else { - failCb(); - } - } -}; - -exports.openDeeplinkOrRedirect = openDeeplinkOrRedirect; - -/***/ }), - /***/ "AJH6": /***/ (function(module, exports) { @@ -91708,80 +91437,6 @@ module.exports = Permission; /***/ }), -/***/ "AzAX": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isWebApp = exports.isMobileApp = exports.isMobile = exports.isIOSApp = exports.isIOS = exports.isAndroidApp = exports.isAndroid = exports.getPlatform = void 0; - -var _cordova = __webpack_require__("dlno"); - -var ANDROID_PLATFORM = 'android'; -var IOS_PLATFORM = 'ios'; -var WEB_PLATFORM = 'web'; - -var getPlatform = function getPlatform() { - return (0, _cordova.isCordova)() ? window.cordova.platformId : WEB_PLATFORM; -}; - -exports.getPlatform = getPlatform; - -var isPlatform = function isPlatform(platform) { - return getPlatform() === platform; -}; - -var isIOSApp = function isIOSApp() { - return isPlatform(IOS_PLATFORM); -}; - -exports.isIOSApp = isIOSApp; - -var isAndroidApp = function isAndroidApp() { - return isPlatform(ANDROID_PLATFORM); -}; - -exports.isAndroidApp = isAndroidApp; - -var isWebApp = function isWebApp() { - return isPlatform(WEB_PLATFORM); -}; - -exports.isWebApp = isWebApp; - -var isMobileApp = function isMobileApp() { - return (0, _cordova.isCordova)(); -}; // return if is on an Android Device (native or browser) - - -exports.isMobileApp = isMobileApp; - -var isAndroid = function isAndroid() { - return window.navigator.userAgent && window.navigator.userAgent.indexOf('Android') >= 0; -}; // return if is on an iOS Device (native or browser) - - -exports.isAndroid = isAndroid; - -var isIOS = function isIOS() { - return window.navigator.userAgent && /iPad|iPhone|iPod/.test(window.navigator.userAgent); -}; // isMobile checks if the user is on a smartphone : native app or browser - - -exports.isIOS = isIOS; - -var isMobile = function isMobile() { - return isAndroid() || isIOS(); -}; - -exports.isMobile = isMobile; - -/***/ }), - /***/ "Aznx": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -197483,7 +197138,7 @@ var _createClass2 = _interopRequireDefault(__webpack_require__("Zvb3")); var _microee = _interopRequireDefault(__webpack_require__("GIvT")); -var _cozyDeviceHelper = __webpack_require__("/K1E"); +var _cozyDeviceHelper = __webpack_require__("Kv7L"); var _RetryManager = _interopRequireDefault(__webpack_require__("oeo/")); @@ -202005,60 +201660,6 @@ module.exports = function shimEntries() { }; -/***/ }), - -/***/ "QJIl": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.hasSafariPlugin = exports.hasNetworkInformationPlugin = exports.hasInAppBrowserPlugin = exports.hasDevicePlugin = void 0; - -var _cordova = __webpack_require__("dlno"); - -var hasDevicePlugin = function hasDevicePlugin() { - return (0, _cordova.isCordova)() && window.device !== undefined; -}; - -exports.hasDevicePlugin = hasDevicePlugin; - -var hasInAppBrowserPlugin = function hasInAppBrowserPlugin() { - return (0, _cordova.isCordova)() && window.cordova.InAppBrowser !== undefined; -}; - -exports.hasInAppBrowserPlugin = hasInAppBrowserPlugin; - -var hasSafariPlugin = function hasSafariPlugin() { - return new Promise(function (resolve) { - if (!(0, _cordova.isCordova)() || window.SafariViewController === undefined) { - resolve(false); - return; - } - - window.SafariViewController.isAvailable(function (available) { - return resolve(available); - }); - }); -}; -/** - * Check if the Cordova's cordova-plugin-network-information plugin is installed - * @see https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-network-information/ - * @returns {boolean} - */ - - -exports.hasSafariPlugin = hasSafariPlugin; - -var hasNetworkInformationPlugin = function hasNetworkInformationPlugin() { - return (0, _cordova.isCordova)() && window.navigator.connection !== undefined; -}; - -exports.hasNetworkInformationPlugin = hasNetworkInformationPlugin; - /***/ }), /***/ "QJRf": @@ -283226,26 +282827,6 @@ parse.json = json; /***/ }), -/***/ "dlno": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isCordova = void 0; - -// cordova -var isCordova = function isCordova() { - return typeof window !== 'undefined' && window.cordova !== undefined; -}; - -exports.isCordova = isCordova; - -/***/ }), - /***/ "dnBB": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -323625,54 +323206,6 @@ var TableSortLabel = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__["forwardRef /***/ }), -/***/ "lNPj": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _interopRequireDefault = __webpack_require__("jm00"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isFlagshipApp = exports.getFlagshipMetadata = exports.FlagshipRoutes = void 0; - -var _cozyLogger = _interopRequireDefault(__webpack_require__("rUPj")); - -var FlagshipRoutes; -exports.FlagshipRoutes = FlagshipRoutes; - -(function (FlagshipRoutes) { - FlagshipRoutes["Home"] = "home"; - FlagshipRoutes["Cozyapp"] = "cozyapp"; - FlagshipRoutes["Authenticate"] = "authenticate"; - FlagshipRoutes["Onboarding"] = "onboarding"; - FlagshipRoutes["Stack"] = "stack"; -})(FlagshipRoutes || (exports.FlagshipRoutes = FlagshipRoutes = {})); - -var getGlobalWindow = function getGlobalWindow() { - return typeof window !== 'undefined' ? window : ((0, _cozyLogger.default)('error', "\"window\" is not defined. This means that getGlobalWindow() shouldn't have been called and investigation should be done to prevent this call"), undefined); -}; - -var getFlagshipMetadata = function getFlagshipMetadata() { - var _getGlobalWindow$cozy, _getGlobalWindow, _getGlobalWindow$cozy2; - - return (_getGlobalWindow$cozy = (_getGlobalWindow = getGlobalWindow()) === null || _getGlobalWindow === void 0 ? void 0 : (_getGlobalWindow$cozy2 = _getGlobalWindow.cozy) === null || _getGlobalWindow$cozy2 === void 0 ? void 0 : _getGlobalWindow$cozy2.flagship) !== null && _getGlobalWindow$cozy !== void 0 ? _getGlobalWindow$cozy : {}; -}; - -exports.getFlagshipMetadata = getFlagshipMetadata; - -var isFlagshipApp = function isFlagshipApp() { - var _getGlobalWindow2, _getGlobalWindow2$coz; - - return ((_getGlobalWindow2 = getGlobalWindow()) === null || _getGlobalWindow2 === void 0 ? void 0 : (_getGlobalWindow2$coz = _getGlobalWindow2.cozy) === null || _getGlobalWindow2$coz === void 0 ? void 0 : _getGlobalWindow2$coz.flagship) !== undefined; -}; - -exports.isFlagshipApp = isFlagshipApp; - -/***/ }), - /***/ "lPmf": /***/ (function(module, exports, __webpack_require__) { @@ -329350,64 +328883,6 @@ function getLocationHref() { /***/ }), -/***/ "m6Tf": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _interopRequireDefault = __webpack_require__("jm00"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getDeviceName = void 0; - -var _capitalize = _interopRequireDefault(__webpack_require__("13ub")); - -var _cordova = __webpack_require__("dlno"); - -var _plugins = __webpack_require__("QJIl"); - -var _platform = __webpack_require__("AzAX"); - -var DEFAULT_DEVICE = 'Device'; - -// device -var getAppleModel = function getAppleModel(identifier) { - var devices = ['iPhone', 'iPad', 'Watch', 'AppleTV']; - - for (var _i = 0, _devices = devices; _i < _devices.length; _i++) { - var _device = _devices[_i]; - - if (identifier.match(new RegExp(_device))) { - return _device; - } - } - - return DEFAULT_DEVICE; -}; - -var getDeviceName = function getDeviceName() { - if (!(0, _plugins.hasDevicePlugin)()) { - if ((0, _cordova.isCordova)()) { - console.warn('You should install `cordova-plugin-device`.'); // eslint-disable-line no-console - } - - return DEFAULT_DEVICE; - } - - var _window$device = window.device, - manufacturer = _window$device.manufacturer, - originalModel = _window$device.model; - var model = (0, _platform.isIOSApp)() ? getAppleModel(originalModel) : originalModel; - return "".concat((0, _capitalize.default)(manufacturer), " ").concat(model); -}; - -exports.getDeviceName = getDeviceName; - -/***/ }), - /***/ "m7Is": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -430714,91 +430189,6 @@ function createSvgIcon(path, displayName) { /***/ }), -/***/ "tDKi": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _interopRequireDefault = __webpack_require__("jm00"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.nativeLinkOpen = void 0; - -var _regenerator = _interopRequireDefault(__webpack_require__("hJxD")); - -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__("HZZ/")); - -var _plugins = __webpack_require__("QJIl"); - -var nativeLinkOpen = /*#__PURE__*/function () { - var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) { - var url, target, options; - return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - url = _ref.url; - _context.next = 3; - return (0, _plugins.hasSafariPlugin)(); - - case 3: - _context.t0 = _context.sent; - - if (!_context.t0) { - _context.next = 6; - break; - } - - _context.t0 = window.SafariViewController; - - case 6: - if (!_context.t0) { - _context.next = 10; - break; - } - - window.SafariViewController.show({ - url: url, - transition: 'curl' - }, function (result) { - if (result.event === 'closed') { - window.SafariViewController.hide(); - } - }, function () { - window.SafariViewController.hide(); - }); - _context.next = 11; - break; - - case 10: - if ((0, _plugins.hasInAppBrowserPlugin)()) { - target = '_blank'; - options = 'clearcache=yes,zoom=no'; - window.cordova.InAppBrowser.open(url, target, options); - } else { - window.location = url; - } - - case 11: - case "end": - return _context.stop(); - } - } - }, _callee); - })); - - return function nativeLinkOpen(_x) { - return _ref2.apply(this, arguments); - }; -}(); - -exports.nativeLinkOpen = nativeLinkOpen; - -/***/ }), - /***/ "tEOf": /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -472289,160 +471679,6 @@ module.exports = function getPublicSuffix(rules, hostname) { }; -/***/ }), - -/***/ "yL+W": -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _interopRequireDefault = __webpack_require__("jm00"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.startApp = exports.default = exports.checkApp = void 0; - -var _regenerator = _interopRequireDefault(__webpack_require__("hJxD")); - -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__("HZZ/")); - -var _platform = __webpack_require__("AzAX"); - -var cordovaPluginIsInstalled = function cordovaPluginIsInstalled() { - return window.startApp; -}; - -/** - * Normalize startApp params for Android and iOS - */ -var getParams = function getParams(_ref) { - var appId = _ref.appId, - uri = _ref.uri; - - if ((0, _platform.isAndroidApp)()) { - return { - package: appId - }; - } else { - return uri; - } -}; - -var exported = {}; -/** - * Start an application if it is installed on the phone - * @returns Promise - False if the application was not able to be started - */ - -var startApp = exported.startApp = /*#__PURE__*/function () { - var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(appInfo) { - var startAppPlugin, isAppInstalled, params; - return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - startAppPlugin = window.startApp; - _context.next = 3; - return exported.checkApp(appInfo); - - case 3: - isAppInstalled = _context.sent; - - if (!isAppInstalled) { - _context.next = 9; - break; - } - - params = getParams(appInfo); - return _context.abrupt("return", new Promise(function (resolve, reject) { - if (!cordovaPluginIsInstalled()) { - reject(new Error("Cordova plugin 'com.lampa.startapp' is not installed. This plugin is needed to start a native app. Required by cozy-bar")); - return; - } - - startAppPlugin.set(params).start(resolve, reject); - })); - - case 9: - return _context.abrupt("return", false); - - case 10: - case "end": - return _context.stop(); - } - } - }, _callee); - })); - - return function (_x) { - return _ref2.apply(this, arguments); - }; -}(); -/** - * Check that an application is installed on the phone - * @returns Promise - Promise containing information on the application - * - * @example - * > checkApp({ appId: 'io.cozy.drive.mobile', uri: 'cozydrive://' }) - * Promise.resolve({ - * versionName: "0.9.2", - * packageName: "io.cozy.drive.mobile", - * versionCode: 902, - * applicationInfo: "ApplicationInfo{70aa0ef io.cozy.drive.mobile}" - * }) - */ - - -exports.startApp = startApp; - -var checkApp = exported.checkApp = /*#__PURE__*/function () { - var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(appInfo) { - var startAppPlugin, params; - return _regenerator.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - startAppPlugin = window.startApp; - params = getParams(appInfo); - return _context2.abrupt("return", new Promise(function (resolve, reject) { - if (!cordovaPluginIsInstalled()) { - reject(new Error("Cordova plugin 'com.lampa.startapp' is not installed.")); - return; - } - - startAppPlugin.set(params).check(function (infos) { - return resolve(infos === 'OK' ? true : infos); - }, function (error) { - if (error === false || error.indexOf('NameNotFoundException') === 0) { - // Plugin returns an error 'NameNotFoundException' on Android and - // false on iOS when an application is not found. - // We prefer to always return false - resolve(false); - } else { - reject(error); - } - }); - })); - - case 3: - case "end": - return _context2.stop(); - } - } - }, _callee2); - })); - - return function (_x2) { - return _ref3.apply(this, arguments); - }; -}(); - -exports.checkApp = checkApp; -var _default = exported; -exports.default = _default; - /***/ }), /***/ "yLPM":